From ae54e59fc20dd0b2c3770515a7df5bbfb86d5925 Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Wed, 18 Sep 2024 00:09:01 +0000 Subject: [PATCH 1/2] New updates to generated code --- .github/ISSUE_TEMPLATE/bug.yml | 33 + .github/ISSUE_TEMPLATE/documentation.yml | 41 + .github/ISSUE_TEMPLATE/feature.yml | 41 + .github/ISSUE_TEMPLATE/maintenance.yml | 41 + .github/pull_request_template.md | 30 + .github/workflows/add_to_octokit_project.yml | 20 + .github/workflows/build.yml | 28 + .github/workflows/immediate-response.yml | 29 + .github/workflows/lint.yml | 32 + .gitignore | 97 + .golangci.toml | 214 ++ .vscode/settings.json | 7 + CODE_OF_CONDUCT.md | 74 + CONTRIBUTING.md | 24 + LICENSE | 21 + README.md | 136 +- cmd/app-example/main.go | 54 + cmd/token-example/main.go | 43 + go.mod | 30 + go.sum | 52 + pkg/authentication/request.go | 49 + pkg/authentication/token_provider.go | 89 + pkg/authentication/token_provider_test.go | 186 + pkg/client.go | 194 ++ pkg/client_test.go | 135 + pkg/example_test.go | 152 + ...6f8b1e5dad61229af1b0c4ac50a251cf04595be.go | 138 + ...ba2548e0181496ff48011378ab54206e41b5a9a.go | 109 + ...05d17f151781caa3c7b7bf997e5acd322956f9d.go | 52 + ...06c1415abd8dcbfff770ad750d5f0326e5e07dc.go | 52 + ...20f4f7e1f5deda2df7064e47ee7eef0a78956f9.go | 138 + pkg/github/admin/admin_request_builder.go | 63 + .../admin/hooks_item_pings_request_builder.go | 51 + ...em_with_hook_escaped_patch_request_body.go | 144 + ...caped_patch_request_body_escaped_config.go | 168 + pkg/github/admin/hooks_post_request_body.go | 173 + .../hooks_post_request_body_escaped_config.go | 168 + pkg/github/admin/hooks_request_builder.go | 107 + ..._with_hook_escaped_item_request_builder.go | 113 + .../get_direction_query_parameter_type.go | 33 + .../keys/get_sort_query_parameter_type.go | 36 + pkg/github/admin/keys_request_builder.go | 84 + ...th_key_escaped_ids_item_request_builder.go | 50 + pkg/github/admin/ldap_request_builder.go | 33 + ...p_teams_item_mapping_patch_request_body.go | 80 + ...ldap_teams_item_mapping_request_builder.go | 61 + .../ldap_teams_item_sync_post_response.go | 80 + .../ldap_teams_item_sync_request_builder.go | 56 + .../admin/ldap_teams_request_builder.go | 34 + ..._with_team_escaped_item_request_builder.go | 33 + ...p_users_item_mapping_patch_request_body.go | 80 + ...ldap_users_item_mapping_request_builder.go | 60 + .../ldap_users_item_sync_post_response.go | 80 + .../ldap_users_item_sync_request_builder.go | 56 + .../admin/ldap_users_request_builder.go | 35 + ...sers_with_username_item_request_builder.go | 33 + ...ations_item_with_org_patch_request_body.go | 80 + ...anizations_item_with_org_patch_response.go | 109 + .../admin/organizations_post_request_body.go | 138 + .../admin/organizations_request_builder.go | 72 + ...nizations_with_org_item_request_builder.go | 59 + ...s_item_downloads_latest_request_builder.go | 57 + ...ve_environment_download_status422_error.go | 129 + ...ronments_item_downloads_request_builder.go | 66 + ...s_item_pre_receive_environment422_error.go | 129 + ...ive_environment422_error_escaped_errors.go | 138 + ...e_escaped_environment_escaped_422_error.go | 129 + ..._receive_environments_post_request_body.go | 109 + ...re_receive_environments_request_builder.go | 111 + ...nvironment_escaped_item_request_builder.go | 123 + ...escaped_hook_escaped_patch_request_body.go | 225 ++ .../pre_receive_hooks_post_request_body.go | 225 ++ ...s_post_request_body_escaped_environment.go | 52 + ..._body_escaped_script_escaped_repository.go | 52 + .../pre_receive_hooks_request_builder.go | 112 + ...caped_hook_escaped_item_request_builder.go | 107 + .../get_direction_query_parameter_type.go | 33 + .../get_sort_query_parameter_type.go | 36 + .../get_direction_query_parameter_type.go | 33 + .../get_sort_query_parameter_type.go | 36 + pkg/github/admin/tokens_request_builder.go | 78 + ...with_token_escaped_item_request_builder.go | 51 + ...s_item_authorizations_post_request_body.go | 86 + ...ers_item_authorizations_request_builder.go | 81 + ...s_item_with_username_patch_request_body.go | 80 + ...users_item_with_username_patch_response.go | 109 + pkg/github/admin/users_post_request_body.go | 138 + pkg/github/admin/users_request_builder.go | 73 + ...sers_with_username_item_request_builder.go | 86 + .../advisories/advisories_request_builder.go | 117 + .../get_direction_query_parameter_type.go | 33 + .../get_severity_query_parameter_type.go | 42 + .../get_sort_query_parameter_type.go | 39 + .../get_type_query_parameter_type.go | 36 + .../with_ghsa_escaped_item_request_builder.go | 61 + pkg/github/api_client.go | 284 ++ pkg/github/app/app_request_builder.go | 72 + .../app/hook_config_patch_request_body.go | 168 + pkg/github/app/hook_config_request_builder.go | 88 + ..._deliveries_item_attempts_post_response.go | 51 + ...eliveries_item_attempts_request_builder.go | 63 + .../app/hook_deliveries_request_builder.go | 85 + ...h_delivery_escaped_item_request_builder.go | 68 + pkg/github/app/hook_request_builder.go | 33 + .../installation_requests_request_builder.go | 71 + ...access_escaped_tokens_post_request_body.go | 151 + ...m_access_escaped_tokens_request_builder.go | 71 + ...llations_item_suspended_request_builder.go | 84 + .../app/installations_request_builder.go | 82 + ...stallation_escaped_item_request_builder.go | 98 + .../applications_request_builder.go | 40 + .../applications/grants_request_builder.go | 92 + ...with_grant_escaped_item_request_builder.go | 97 + .../item_grant_delete_request_body.go | 80 + .../item_grant_request_builder.go | 61 + .../item_token_delete_request_body.go | 80 + .../item_token_patch_request_body.go | 80 + .../item_token_post_request_body.go | 80 + .../item_token_request_builder.go | 138 + .../item_token_scoped_post_request_body.go | 238 ++ .../item_token_scoped_request_builder.go | 71 + ...ith_client_escaped_item_request_builder.go | 33 + .../app_manifests_request_builder.go | 35 + .../item_conversions_integration.go | 69 + .../item_conversions_request_builder.go | 63 + .../with_code_item_request_builder.go | 28 + pkg/github/apps/apps_request_builder.go | 35 + ...h_app_escaped_slug_item_request_builder.go | 63 + .../authorizations_post_request_body.go | 231 ++ .../authorizations_request_builder.go | 140 + ..._item_with_fingerprint_put_request_body.go | 173 + ...em_with_client_escaped_put_request_body.go | 202 ++ ...m_with_fingerprint_item_request_builder.go | 68 + .../authorizations/clients_request_builder.go | 36 + ...ith_client_escaped_item_request_builder.go | 85 + ...uthorization_escaped_patch_request_body.go | 243 ++ ...horization_escaped_item_request_builder.go | 134 + ...aped_of_escaped_conduct_request_builder.go | 72 + .../with_key_item_request_builder.go | 61 + pkg/github/emojis/emojis_get_response.go | 51 + pkg/github/emojis/emojis_request_builder.go | 56 + .../announcement_request_builder.go | 110 + .../enterprise/enterprise_request_builder.go | 38 + .../settings_license_request_builder.go | 56 + .../enterprise/settings_request_builder.go | 28 + .../enterprise/stats_all_request_builder.go | 56 + .../stats_comments_request_builder.go | 56 + .../enterprise/stats_gists_request_builder.go | 56 + .../enterprise/stats_hooks_request_builder.go | 57 + .../stats_issues_request_builder.go | 56 + .../stats_milestones_request_builder.go | 56 + .../enterprise/stats_orgs_request_builder.go | 56 + .../enterprise/stats_pages_request_builder.go | 56 + .../enterprise/stats_pulls_request_builder.go | 56 + .../enterprise/stats_repos_request_builder.go | 57 + .../enterprise/stats_request_builder.go | 83 + ...stats_security_products_request_builder.go | 57 + .../enterprise/stats_users_request_builder.go | 56 + .../enterprises_request_builder.go | 35 + ...d_patch_request_body_escaped_visibility.go | 34 + ...ps_post_request_body_escaped_visibility.go | 34 + .../get_include_query_parameter_type.go | 36 + .../get_order_query_parameter_type.go | 33 + .../get_direction_query_parameter_type.go | 33 + .../alerts/get_sort_query_parameter_type.go | 33 + .../get_direction_query_parameter_type.go | 33 + .../alerts/get_scope_query_parameter_type.go | 33 + .../alerts/get_sort_query_parameter_type.go | 33 + .../get_direction_query_parameter_type.go | 33 + .../alerts/get_sort_query_parameter_type.go | 33 + .../alerts/get_state_query_parameter_type.go | 33 + .../item_actions_cache_request_builder.go | 33 + ...ions_cache_usage_policy_request_builder.go | 83 + ...tem_actions_cache_usage_request_builder.go | 57 + ..._permissions_organizations_get_response.go | 122 + ...missions_organizations_put_request_body.go | 86 + ...rmissions_organizations_request_builder.go | 100 + ...s_with_org_escaped_item_request_builder.go | 73 + ...em_actions_permissions_put_request_body.go | 112 + ...tem_actions_permissions_request_builder.go | 98 + ...ssions_selected_actions_request_builder.go | 83 + ...ns_permissions_workflow_request_builder.go | 83 + .../item_actions_request_builder.go | 43 + ...item_actions_runner_groups_get_response.go | 122 + ..._groups_item_organizations_get_response.go | 122 + ...ups_item_organizations_put_request_body.go | 86 + ...oups_item_organizations_request_builder.go | 100 + ...s_with_org_escaped_item_request_builder.go | 73 + ...runner_groups_item_runners_get_response.go | 122 + ...er_groups_item_runners_put_request_body.go | 86 + ...ner_groups_item_runners_request_builder.go | 100 + ...ith_runner_escaped_item_request_builder.go | 73 + ...scaped_group_escaped_patch_request_body.go | 173 + ...actions_runner_groups_post_request_body.go | 243 ++ ...m_actions_runner_groups_request_builder.go | 108 + ...aped_group_escaped_item_request_builder.go | 120 + ...tions_runners_downloads_request_builder.go | 60 + ...rs_generate_jitconfig_post_request_body.go | 175 + ...unners_generate_jitconfig_post_response.go | 110 + ...ners_generate_jitconfig_request_builder.go | 67 + .../item_actions_runners_get_response.go | 122 + ...ons_runners_item_labels_delete_response.go | 122 + ...ctions_runners_item_labels_get_response.go | 122 + ...m_labels_item_with_name_delete_response.go | 122 + ...s_runners_item_labels_post_request_body.go | 86 + ...tions_runners_item_labels_post_response.go | 122 + ...ns_runners_item_labels_put_request_body.go | 86 + ...ctions_runners_item_labels_put_response.go | 122 + ...ons_runners_item_labels_request_builder.go | 180 + ...m_labels_with_name_item_request_builder.go | 63 + ...ners_registration_token_request_builder.go | 57 + ...ns_runners_remove_token_request_builder.go | 57 + .../item_actions_runners_request_builder.go | 96 + ...ith_runner_escaped_item_request_builder.go | 84 + .../item_audit_log_request_builder.go | 78 + ...and_escaped_analysis_patch_request_body.go | 225 ++ ...ed_and_escaped_analysis_request_builder.go | 92 + ...em_code_scanning_alerts_request_builder.go | 88 + .../item_code_scanning_request_builder.go | 28 + .../item_dependabot_alerts_request_builder.go | 96 + .../item_dependabot_request_builder.go | 28 + ...em_with_enablement_item_request_builder.go | 57 + ..._secret_scanning_alerts_request_builder.go | 88 + .../item_secret_scanning_request_builder.go | 28 + ...lling_advanced_security_request_builder.go | 64 + .../item_settings_billing_request_builder.go | 28 + .../item_settings_request_builder.go | 28 + ...ty_escaped_product_item_request_builder.go | 35 + .../with_enterprise_item_request_builder.go | 70 + pkg/github/events/events_request_builder.go | 73 + pkg/github/feeds/feeds_request_builder.go | 57 + pkg/github/gists/gists_post_request_body.go | 232 ++ .../gists_post_request_body_escaped_files.go | 52 + pkg/github/gists/gists_request_builder.go | 135 + ...with_comment_escaped_patch_request_body.go | 80 + .../gists/item_comments_post_request_body.go | 80 + .../gists/item_comments_request_builder.go | 121 + ...th_comment_escaped_item_request_builder.go | 126 + .../gists/item_commits_request_builder.go | 72 + .../gists/item_forks_request_builder.go | 106 + pkg/github/gists/item_star404_error.go | 40 + pkg/github/gists/item_star_request_builder.go | 115 + ...em_with_gist_escaped_patch_request_body.go | 109 + ...scaped_patch_request_body_escaped_files.go | 52 + .../item_with_sha_item_request_builder.go | 65 + pkg/github/gists/public_request_builder.go | 76 + pkg/github/gists/starred_request_builder.go | 76 + .../with_gist_escaped_item_request_builder.go | 160 + .../gitignore/gitignore_request_builder.go | 28 + .../gitignore/templates_request_builder.go | 71 + ...emplates_with_name_item_request_builder.go | 57 + .../installation_request_builder.go | 33 + .../installation/repositories_get_response.go | 151 + .../repositories_request_builder.go | 70 + .../installation/token_request_builder.go | 51 + .../get_direction_query_parameter_type.go | 33 + .../issues/get_filter_query_parameter_type.go | 45 + .../issues/get_sort_query_parameter_type.go | 36 + .../issues/get_state_query_parameter_type.go | 36 + pkg/github/issues/issues_request_builder.go | 90 + pkg/github/kiota-lock.json | 33 + .../licenses/licenses_request_builder.go | 80 + .../with_license_item_request_builder.go | 63 + pkg/github/manage/manage_request_builder.go | 28 + .../manage/v1_access_request_builder.go | 28 + .../manage/v1_access_ssh_request_builder.go | 128 + .../manage/v1_checks_request_builder.go | 28 + ...cks_system_requirements_request_builder.go | 57 + .../manage/v1_cluster_request_builder.go | 28 + .../v1_cluster_status_request_builder.go | 57 + .../v1_config_apply_events_get_response.go | 92 + ...apply_events_get_response_escaped_nodes.go | 150 + ...t_response_escaped_nodes_escaped_events.go | 370 ++ .../v1_config_apply_events_request_builder.go | 61 + .../manage/v1_config_apply_get_response.go | 150 + ...config_apply_get_response_escaped_nodes.go | 167 + .../v1_config_apply_post_request_body.go | 80 + .../manage/v1_config_apply_post_response.go | 80 + .../manage/v1_config_apply_request_builder.go | 97 + .../manage/v1_config_init_request_builder.go | 56 + ...v1_config_license_check_request_builder.go | 57 + .../v1_config_license_request_builder.go | 93 + .../manage/v1_config_nodes_request_builder.go | 64 + .../manage/v1_config_request_builder.go | 48 + .../v1_config_settings_put_request_body.go | 51 + .../v1_config_settings_request_builder.go | 83 + .../manage/v1_maintenance_request_builder.go | 101 + .../manage/v1_replication_request_builder.go | 28 + .../v1_replication_status_request_builder.go | 64 + pkg/github/manage/v1_request_builder.go | 58 + .../manage/v1_version_request_builder.go | 67 + .../markdown/markdown_post_request_body.go | 141 + ...markdown_post_request_body_escaped_mode.go | 34 + .../markdown/markdown_request_builder.go | 60 + pkg/github/markdown/raw_request_builder.go | 53 + pkg/github/meta/meta_request_builder.go | 56 + ...60ee922cd911e0ad8ef4aea285bf52ed3099627.go | 261 ++ pkg/github/models/actions_cache_list.go | 122 + ...che_list_escaped_actions_escaped_caches.go | 255 ++ .../actions_cache_usage_by_repository.go | 139 + .../actions_cache_usage_org_enterprise.go | 109 + .../actions_cache_usage_policy_enterprise.go | 110 + ...tions_cache_usage_policy_for_repository.go | 81 + .../actions_default_workflow_permissions.go | 34 + .../models/actions_enterprise_permissions.go | 169 + ...ctions_get_default_workflow_permissions.go | 110 + .../actions_organization_permissions.go | 169 + pkg/github/models/actions_public_key.go | 226 ++ .../models/actions_repository_permissions.go | 139 + pkg/github/models/actions_secret.go | 140 + ...ctions_set_default_workflow_permissions.go | 110 + pkg/github/models/actions_variable.go | 168 + .../actions_workflow_access_to_repository.go | 81 + ...repository_escaped_access_escaped_level.go | 40 + pkg/github/models/activity.go | 286 ++ .../activity_escaped_activity_escaped_type.go | 46 + pkg/github/models/actor.go | 226 ++ .../models/added_to_project_issue_event.go | 342 ++ ...ssue_event_escaped_project_escaped_card.go | 225 ++ .../advanced_security_active_committers.go | 208 ++ ...d_security_active_committers_repository.go | 150 + ...dvanced_security_active_committers_user.go | 138 + pkg/github/models/alerts503_error.go | 146 + pkg/github/models/allowed_actions.go | 37 + pkg/github/models/analyses503_error.go | 146 + pkg/github/models/announcement.go | 111 + pkg/github/models/announcement_banner.go | 140 + pkg/github/models/api_overview.go | 174 + .../models/api_overview_escaped_domains.go | 255 ++ ...s_escaped_artifact_escaped_attestations.go | 115 + pkg/github/models/app_permissions.go | 1492 ++++++++ .../models/app_permissions_escaped_actions.go | 34 + .../app_permissions_escaped_administration.go | 34 + .../models/app_permissions_escaped_checks.go | 34 + .../app_permissions_escaped_codespaces.go | 34 + .../app_permissions_escaped_contents.go | 34 + ...ions_escaped_dependabot_escaped_secrets.go | 34 + .../app_permissions_escaped_deployments.go | 34 + ...issions_escaped_email_escaped_addresses.go | 34 + .../app_permissions_escaped_environments.go | 34 + .../app_permissions_escaped_followers.go | 34 + ...ns_escaped_git_escaped_ssh_escaped_keys.go | 34 + ...pp_permissions_escaped_gpg_escaped_keys.go | 34 + ...ions_escaped_interaction_escaped_limits.go | 34 + .../models/app_permissions_escaped_issues.go | 34 + .../models/app_permissions_escaped_members.go | 34 + .../app_permissions_escaped_metadata.go | 34 + ...ped_organization_escaped_administration.go | 34 + ...on_escaped_announcement_escaped_banners.go | 34 + ...copilot_escaped_seat_escaped_management.go | 31 + ...scaped_custom_escaped_org_escaped_roles.go | 34 + ...ation_escaped_custom_escaped_properties.go | 37 + ...ganization_escaped_custom_escaped_roles.go | 34 + ...ons_escaped_organization_escaped_events.go | 31 + ...ions_escaped_organization_escaped_hooks.go | 34 + ...s_escaped_organization_escaped_packages.go | 34 + ...d_access_escaped_token_escaped_requests.go | 34 + ..._personal_escaped_access_escaped_tokens.go | 34 + ...sions_escaped_organization_escaped_plan.go | 31 + ...s_escaped_organization_escaped_projects.go | 37 + ...ns_escaped_organization_escaped_secrets.go | 34 + ...ped_self_escaped_hosted_escaped_runners.go | 34 + ...anization_escaped_user_escaped_blocking.go | 34 + .../app_permissions_escaped_packages.go | 34 + .../models/app_permissions_escaped_pages.go | 34 + .../models/app_permissions_escaped_profile.go | 31 + ...rmissions_escaped_pull_escaped_requests.go | 34 + ...itory_escaped_custom_escaped_properties.go | 34 + ...ssions_escaped_repository_escaped_hooks.go | 34 + ...ons_escaped_repository_escaped_projects.go | 37 + ..._secret_escaped_scanning_escaped_alerts.go | 34 + .../models/app_permissions_escaped_secrets.go | 34 + ...issions_escaped_security_escaped_events.go | 34 + ...permissions_escaped_single_escaped_file.go | 34 + .../app_permissions_escaped_starring.go | 34 + .../app_permissions_escaped_statuses.go | 34 + ...ssions_escaped_team_escaped_discussions.go | 34 + ...ns_escaped_vulnerability_escaped_alerts.go | 34 + .../app_permissions_escaped_workflows.go | 31 + pkg/github/models/application_grant.go | 262 ++ .../models/application_grant_escaped_app.go | 138 + pkg/github/models/artifact.go | 372 ++ .../artifact_escaped_workflow_escaped_run.go | 196 ++ pkg/github/models/assigned_issue_event.go | 371 ++ pkg/github/models/audit_log_event.go | 1346 ++++++++ ...og_event_escaped_actor_escaped_location.go | 80 + .../models/audit_log_event_escaped_config.go | 51 + ...it_log_event_escaped_config_escaped_was.go | 51 + .../models/audit_log_event_escaped_data.go | 51 + .../models/audit_log_event_escaped_events.go | 51 + ...t_log_event_escaped_events_escaped_were.go | 51 + pkg/github/models/authentication_token.go | 240 ++ ...uthentication_token_escaped_permissions.go | 51 + ...en_escaped_repository_escaped_selection.go | 34 + pkg/github/models/author_association.go | 52 + pkg/github/models/authorization.go | 494 +++ .../models/authorization_escaped_app.go | 138 + pkg/github/models/auto_merge.go | 169 + ...auto_merge_escaped_merge_escaped_method.go | 37 + pkg/github/models/autolink.go | 168 + ...2464f8551f51f3033e3a502d2d5557f57b5fb77.go | 174 + pkg/github/models/base_gist.go | 633 ++++ pkg/github/models/base_gist_escaped_files.go | 51 + pkg/github/models/basic_error.go | 176 + pkg/github/models/blob.go | 255 ++ pkg/github/models/branch_protection.go | 516 +++ ...tection_escaped_allow_escaped_deletions.go | 80 + ...aped_allow_escaped_force_escaped_pushes.go | 80 + ...aped_allow_escaped_fork_escaped_syncing.go | 81 + ...tection_escaped_block_escaped_creations.go | 80 + ..._protection_escaped_lock_escaped_branch.go | 81 + ...escaped_conversation_escaped_resolution.go | 80 + ...required_escaped_linear_escaped_history.go | 80 + ...ion_escaped_required_escaped_signatures.go | 109 + .../models/branch_restriction_policy.go | 291 ++ .../branch_restriction_policy_escaped_apps.go | 434 +++ ...ction_policy_escaped_apps_escaped_owner.go | 718 ++++ ...policy_escaped_apps_escaped_permissions.go | 167 + ...branch_restriction_policy_escaped_teams.go | 428 +++ ...branch_restriction_policy_escaped_users.go | 573 ++++ pkg/github/models/branch_short.go | 139 + .../models/branch_short_escaped_commit.go | 109 + pkg/github/models/branch_with_protection.go | 284 ++ ..._with_protection_escaped__escaped_links.go | 109 + pkg/github/models/check_annotation.go | 342 ++ .../models/check_automated_security_fixes.go | 110 + pkg/github/models/check_run.go | 560 +++ .../check_run_escaped_check_escaped_suite.go | 80 + .../models/check_run_escaped_conclusion.go | 48 + pkg/github/models/check_run_escaped_output.go | 196 ++ pkg/github/models/check_run_escaped_status.go | 46 + pkg/github/models/check_suite.go | 618 ++++ .../models/check_suite_escaped_conclusion.go | 54 + .../models/check_suite_escaped_status.go | 46 + pkg/github/models/check_suite_preference.go | 110 + ...ck_suite_preference_escaped_preferences.go | 92 + ...ped_auto_escaped_trigger_escaped_checks.go | 109 + pkg/github/models/code.go | 208 ++ pkg/github/models/code503_error.go | 146 + pkg/github/models/code_escaped_matches.go | 115 + pkg/github/models/code_of_conduct.go | 197 ++ pkg/github/models/code_of_conduct_simple.go | 168 + pkg/github/models/code_scanning_alert.go | 441 +++ .../models/code_scanning_alert503_error.go | 146 + .../code_scanning_alert_classification.go | 40 + .../code_scanning_alert_dismissed_reason.go | 37 + .../models/code_scanning_alert_instance.go | 348 ++ ...scanning_alert_instance_escaped_message.go | 80 + .../models/code_scanning_alert_items.go | 441 +++ .../models/code_scanning_alert_location.go | 197 ++ pkg/github/models/code_scanning_alert_rule.go | 320 ++ ...security_escaped_severity_escaped_level.go | 40 + ...de_scanning_alert_rule_escaped_severity.go | 40 + .../code_scanning_alert_rule_summary.go | 233 ++ ...security_escaped_severity_escaped_level.go | 40 + ...ing_alert_rule_summary_escaped_severity.go | 40 + .../models/code_scanning_alert_set_state.go | 34 + .../models/code_scanning_alert_severity.go | 49 + .../models/code_scanning_alert_state.go | 37 + .../models/code_scanning_alert_state_query.go | 40 + pkg/github/models/code_scanning_analysis.go | 475 +++ .../models/code_scanning_analysis503_error.go | 146 + .../models/code_scanning_analysis_deletion.go | 98 + ...ode_scanning_analysis_deletion503_error.go | 146 + .../models/code_scanning_analysis_tool.go | 138 + .../models/code_scanning_default_setup.go | 207 ++ .../code_scanning_default_setup503_error.go | 146 + ...canning_default_setup_escaped_languages.go | 57 + ...fault_setup_escaped_query_escaped_suite.go | 34 + ...scanning_default_setup_escaped_schedule.go | 31 + ...de_scanning_default_setup_escaped_state.go | 34 + .../code_scanning_default_setup_update.go | 128 + ..._default_setup_update_escaped_languages.go | 51 + ...etup_update_escaped_query_escaped_suite.go | 34 + ...ning_default_setup_update_escaped_state.go | 34 + .../code_scanning_organization_alert_items.go | 470 +++ .../models/code_scanning_sarifs_receipt.go | 103 + .../code_scanning_sarifs_receipt503_error.go | 146 + .../models/code_scanning_sarifs_status.go | 133 + .../code_scanning_sarifs_status503_error.go | 146 + ...tatus_escaped_processing_escaped_status.go | 37 + pkg/github/models/code_search_result_item.go | 448 +++ pkg/github/models/codeowners_errors.go | 93 + .../codeowners_errors_escaped_errors.go | 254 ++ pkg/github/models/collaborator.go | 690 ++++ .../collaborator_escaped_permissions.go | 196 ++ pkg/github/models/combined_commit_status.go | 267 ++ pkg/github/models/commit.go | 561 +++ pkg/github/models/commit503_error.go | 146 + pkg/github/models/commit_activity.go | 145 + pkg/github/models/commit_comment.go | 460 +++ pkg/github/models/commit_comparison.go | 454 +++ .../models/commit_comparison503_error.go | 146 + .../commit_comparison_escaped_status.go | 39 + pkg/github/models/commit_escaped_commit.go | 254 ++ .../commit_escaped_commit_escaped_tree.go | 109 + pkg/github/models/commit_escaped_parents.go | 138 + pkg/github/models/commit_escaped_stats.go | 138 + .../models/commit_search_result_item.go | 424 +++ ...ommit_search_result_item_escaped_commit.go | 254 ++ ...sult_item_escaped_commit_escaped_author.go | 139 + ...result_item_escaped_commit_escaped_tree.go | 109 + ...mmit_search_result_item_escaped_parents.go | 138 + pkg/github/models/commits.go | 208 ++ pkg/github/models/commits_escaped_matches.go | 115 + pkg/github/models/configuration_status.go | 121 + .../configuration_status_escaped_progress.go | 109 + pkg/github/models/content_file.go | 459 +++ .../content_file_escaped__escaped_links.go | 138 + .../models/content_file_escaped_type.go | 30 + pkg/github/models/content_submodule.go | 372 ++ ...ontent_submodule_escaped__escaped_links.go | 138 + .../models/content_submodule_escaped_type.go | 30 + pkg/github/models/content_symlink.go | 372 ++ .../content_symlink_escaped__escaped_links.go | 138 + .../models/content_symlink_escaped_type.go | 30 + pkg/github/models/contributor.go | 661 ++++ pkg/github/models/contributor_activity.go | 151 + .../contributor_activity_escaped_weeks.go | 167 + .../converted_note_to_issue_issue_event.go | 342 ++ ...ssue_event_escaped_project_escaped_card.go | 225 ++ .../models/custom_deployment_rule_app.go | 168 + pkg/github/models/custom_property.go | 363 ++ ...tom_property_escaped_value_escaped_type.go | 40 + ...aped_values_escaped_editable_escaped_by.go | 34 + pkg/github/models/custom_property_value.go | 181 + pkg/github/models/cvss_severities.go | 109 + ...cvss_severities_escaped_cvss_escaped_v3.go | 103 + ...cvss_severities_escaped_cvss_escaped_v4.go | 103 + pkg/github/models/demilestoned_issue_event.go | 342 ++ ...ilestoned_issue_event_escaped_milestone.go | 80 + pkg/github/models/dependabot_alert.go | 398 +++ .../dependabot_alert_escaped_dependency.go | 121 + ..._alert_escaped_dependency_escaped_scope.go | 34 + ..._alert_escaped_dismissed_escaped_reason.go | 43 + .../models/dependabot_alert_escaped_state.go | 40 + pkg/github/models/dependabot_alert_package.go | 79 + .../dependabot_alert_security_advisory.go | 386 +++ ...ot_alert_security_advisory_escaped_cvss.go | 79 + ...ot_alert_security_advisory_escaped_cwes.go | 79 + ...t_security_advisory_escaped_identifiers.go | 79 + ...visory_escaped_identifiers_escaped_type.go | 34 + ...rt_security_advisory_escaped_references.go | 56 + ...lert_security_advisory_escaped_severity.go | 40 + ...dependabot_alert_security_vulnerability.go | 125 + ...d_first_escaped_patched_escaped_version.go | 56 + ...security_vulnerability_escaped_severity.go | 40 + .../dependabot_alert_with_repository.go | 427 +++ ...lert_with_repository_escaped_dependency.go | 121 + ...sitory_escaped_dependency_escaped_scope.go | 34 + ...sitory_escaped_dismissed_escaped_reason.go | 43 + ...bot_alert_with_repository_escaped_state.go | 40 + pkg/github/models/dependabot_public_key.go | 110 + pkg/github/models/dependabot_secret.go | 140 + pkg/github/models/dependency_graph_diff.go | 355 ++ ..._graph_diff_escaped_change_escaped_type.go | 33 + .../dependency_graph_diff_escaped_scope.go | 37 + ...ency_graph_diff_escaped_vulnerabilities.go | 167 + .../models/dependency_graph_spdx_sbom.go | 81 + ...dependency_graph_spdx_sbom_escaped_sbom.go | 301 ++ ...sbom_escaped_sbom_escaped_creation_info.go | 115 + ...spdx_sbom_escaped_sbom_escaped_packages.go | 353 ++ ..._escaped_packages_escaped_external_refs.go | 138 + pkg/github/models/deploy_key.go | 313 ++ pkg/github/models/deployment.go | 575 ++++ pkg/github/models/deployment_branch_policy.go | 169 + .../deployment_branch_policy_escaped_type.go | 34 + .../deployment_branch_policy_name_pattern.go | 80 + ...nt_branch_policy_name_pattern_with_type.go | 110 + ...icy_name_pattern_with_type_escaped_type.go | 34 + .../deployment_branch_policy_settings.go | 110 + .../models/deployment_protection_rule.go | 168 + pkg/github/models/deployment_reviewer_type.go | 34 + pkg/github/models/deployment_simple.go | 459 +++ pkg/github/models/deployment_status.go | 489 +++ .../models/deployment_status_escaped_state.go | 49 + pkg/github/models/diff_entry.go | 372 ++ .../models/diff_entry_escaped_status.go | 48 + pkg/github/models/email.go | 168 + pkg/github/models/empty_object.go | 33 + pkg/github/models/empty_object503_error.go | 146 + pkg/github/models/enabled_organizations.go | 37 + pkg/github/models/enabled_repositories.go | 37 + pkg/github/models/enterprise.go | 343 ++ .../models/enterprise_comment_overview.go | 167 + pkg/github/models/enterprise_gist_overview.go | 138 + pkg/github/models/enterprise_hook_overview.go | 138 + .../models/enterprise_issue_overview.go | 138 + .../models/enterprise_milestone_overview.go | 138 + .../enterprise_organization_overview.go | 167 + pkg/github/models/enterprise_overview.go | 341 ++ pkg/github/models/enterprise_page_overview.go | 80 + .../enterprise_pull_request_overview.go | 167 + .../models/enterprise_repository_overview.go | 225 ++ .../enterprise_security_analysis_settings.go | 225 ++ .../enterprise_security_products_overview.go | 486 +++ pkg/github/models/enterprise_settings.go | 115 + .../enterprise_settings_escaped_enterprise.go | 921 +++++ ...tings_escaped_enterprise_escaped_avatar.go | 109 + ...settings_escaped_enterprise_escaped_cas.go | 80 + ...ngs_escaped_enterprise_escaped_collectd.go | 225 ++ ...ngs_escaped_enterprise_escaped_customer.go | 196 ++ ...enterprise_escaped_github_escaped_oauth.go | 167 + ...d_enterprise_escaped_github_escaped_ssl.go | 138 + ...ettings_escaped_enterprise_escaped_ldap.go | 631 ++++ ...enterprise_escaped_ldap_escaped_profile.go | 167 + ...ise_escaped_ldap_escaped_reconciliation.go | 109 + ...ings_escaped_enterprise_escaped_license.go | 283 ++ ...ings_escaped_enterprise_escaped_mapping.go | 167 + ...settings_escaped_enterprise_escaped_ntp.go | 109 + ...ttings_escaped_enterprise_escaped_pages.go | 80 + ...ettings_escaped_enterprise_escaped_saml.go | 225 ++ ...ettings_escaped_enterprise_escaped_smtp.go | 428 +++ ...ettings_escaped_enterprise_escaped_snmp.go | 109 + ...tings_escaped_enterprise_escaped_syslog.go | 138 + pkg/github/models/enterprise_user_overview.go | 138 + pkg/github/models/environment.go | 437 +++ pkg/github/models/environment_approvals.go | 181 + ...ironment_approvals_escaped_environments.go | 255 ++ .../environment_approvals_escaped_state.go | 37 + ...scaped_protection_escaped_rules_member1.go | 167 + ...scaped_protection_escaped_rules_member2.go | 208 ++ ...escaped_rules_member2_escaped_reviewers.go | 196 ++ ...scaped_protection_escaped_rules_member3.go | 138 + pkg/github/models/event.go | 285 ++ pkg/github/models/event_escaped_payload.go | 179 + .../event_escaped_payload_escaped_pages.go | 225 ++ pkg/github/models/event_escaped_repo.go | 138 + pkg/github/models/events503_error.go | 146 + pkg/github/models/external_group.go | 221 ++ .../models/external_group_escaped_members.go | 167 + .../models/external_group_escaped_teams.go | 109 + pkg/github/models/external_groups.go | 93 + .../models/external_groups_escaped_groups.go | 138 + pkg/github/models/feed.go | 377 ++ .../models/feed_escaped__escaped_links.go | 353 ++ pkg/github/models/file_commit.go | 110 + pkg/github/models/file_commit503_error.go | 146 + .../models/file_commit_escaped_commit.go | 353 ++ ...le_commit_escaped_commit_escaped_author.go | 138 + ...commit_escaped_commit_escaped_committer.go | 138 + ...e_commit_escaped_commit_escaped_parents.go | 138 + ...file_commit_escaped_commit_escaped_tree.go | 109 + ...mit_escaped_commit_escaped_verification.go | 167 + .../models/file_commit_escaped_content.go | 341 ++ ..._escaped_content_escaped__escaped_links.go | 138 + pkg/github/models/files503_error.go | 146 + pkg/github/models/full_repository.go | 3050 +++++++++++++++++ ...itory_escaped_custom_escaped_properties.go | 52 + ...ed_merge_escaped_commit_escaped_message.go | 37 + ...aped_merge_escaped_commit_escaped_title.go | 34 + .../full_repository_escaped_permissions.go | 196 ++ ...ed_merge_escaped_commit_escaped_message.go | 37 + ...aped_merge_escaped_commit_escaped_title.go | 34 + .../models/ghes_checks_result_indicator.go | 33 + .../models/ghes_checks_system_requirements.go | 122 + ...hecks_system_requirements_escaped_nodes.go | 151 + ...aped_nodes_escaped_roles_escaped_status.go | 110 + pkg/github/models/ghes_cluster_roles.go | 72 + pkg/github/models/ghes_cluster_status.go | 122 + .../ghes_cluster_status_escaped_nodes.go | 151 + ...r_status_escaped_nodes_escaped_services.go | 139 + .../models/ghes_cluster_status_indicator.go | 39 + pkg/github/models/ghes_cluster_topology.go | 36 + pkg/github/models/ghes_config_init_request.go | 109 + pkg/github/models/ghes_config_nodes.go | 122 + .../models/ghes_config_nodes_escaped_nodes.go | 173 + pkg/github/models/ghes_delete_ssh_request.go | 80 + pkg/github/models/ghes_delete_ssh_response.go | 168 + pkg/github/models/ghes_get_maintenance.go | 303 ++ ...nce_escaped_connection_escaped_services.go | 109 + .../ghes_get_maintenance_escaped_status.go | 36 + pkg/github/models/ghes_get_settings.go | 921 +++++ .../ghes_get_settings_escaped_avatar.go | 109 + .../models/ghes_get_settings_escaped_cas.go | 80 + .../ghes_get_settings_escaped_collectd.go | 225 ++ .../ghes_get_settings_escaped_customer.go | 196 ++ ...t_settings_escaped_github_escaped_oauth.go | 167 + ...get_settings_escaped_github_escaped_ssl.go | 138 + .../models/ghes_get_settings_escaped_ldap.go | 643 ++++ ...t_settings_escaped_ldap_escaped_profile.go | 167 + ...ngs_escaped_ldap_escaped_reconciliation.go | 109 + .../ghes_get_settings_escaped_license.go | 283 ++ .../ghes_get_settings_escaped_mapping.go | 167 + .../models/ghes_get_settings_escaped_ntp.go | 109 + .../models/ghes_get_settings_escaped_pages.go | 80 + .../models/ghes_get_settings_escaped_saml.go | 225 ++ .../models/ghes_get_settings_escaped_smtp.go | 428 +++ .../models/ghes_get_settings_escaped_snmp.go | 109 + .../ghes_get_settings_escaped_syslog.go | 138 + pkg/github/models/ghes_get_ssh.go | 109 + pkg/github/models/ghes_license_check.go | 81 + .../ghes_license_check_escaped_status.go | 40 + pkg/github/models/ghes_license_info.go | 574 ++++ pkg/github/models/ghes_replication_status.go | 122 + .../ghes_replication_status_escaped_nodes.go | 151 + ...n_status_escaped_nodes_escaped_services.go | 139 + .../ghes_replication_status_indicator.go | 39 + .../models/ghes_set_maintenance_request.go | 204 ++ .../models/ghes_set_maintenance_response.go | 168 + pkg/github/models/ghes_set_ssh_request.go | 80 + pkg/github/models/ghes_set_ssh_response.go | 197 ++ .../models/ghes_upload_license_request.go | 80 + pkg/github/models/ghes_version.go | 109 + .../models/ghes_version_escaped_version.go | 168 + ...ersion_escaped_version_escaped_platform.go | 45 + pkg/github/models/gist_comment.go | 286 ++ pkg/github/models/gist_comment403_error.go | 146 + .../gist_comment403_error_escaped_block.go | 138 + pkg/github/models/gist_commit.go | 198 ++ ...st_commit_escaped_change_escaped_status.go | 138 + pkg/github/models/gist_history.go | 198 ++ ...t_history_escaped_change_escaped_status.go | 138 + pkg/github/models/gist_simple.go | 691 ++++ pkg/github/models/gist_simple403_error.go | 146 + .../gist_simple403_error_escaped_block.go | 138 + .../models/gist_simple_escaped_files.go | 51 + .../gist_simple_escaped_fork_escaped_of.go | 633 ++++ ...e_escaped_fork_escaped_of_escaped_files.go | 51 + .../models/gist_simple_escaped_forks.go | 197 ++ pkg/github/models/git_commit.go | 354 ++ .../models/git_commit_escaped_author.go | 140 + .../models/git_commit_escaped_committer.go | 140 + .../models/git_commit_escaped_parents.go | 138 + pkg/github/models/git_commit_escaped_tree.go | 109 + .../models/git_commit_escaped_verification.go | 167 + pkg/github/models/git_ref.go | 168 + pkg/github/models/git_ref_escaped_object.go | 138 + pkg/github/models/git_tag.go | 284 ++ pkg/github/models/git_tag_escaped_object.go | 138 + pkg/github/models/git_tag_escaped_tagger.go | 138 + pkg/github/models/git_tree.go | 180 + pkg/github/models/git_tree_escaped_tree.go | 225 ++ pkg/github/models/gitignore_template.go | 110 + pkg/github/models/global_advisory.go | 666 ++++ .../models/global_advisory_escaped_credits.go | 110 + .../models/global_advisory_escaped_cvss.go | 103 + .../models/global_advisory_escaped_cwes.go | 103 + .../models/global_advisory_escaped_epss.go | 109 + .../global_advisory_escaped_identifiers.go | 110 + ...visory_escaped_identifiers_escaped_type.go | 34 + .../global_advisory_escaped_severity.go | 43 + .../models/global_advisory_escaped_type.go | 37 + pkg/github/models/global_hook.go | 347 ++ pkg/github/models/global_hook2.go | 347 ++ .../models/global_hook2_escaped_config.go | 138 + .../models/global_hook_escaped_config.go | 167 + pkg/github/models/gpg_key.go | 512 +++ pkg/github/models/gpg_key_escaped_emails.go | 109 + pkg/github/models/gpg_key_escaped_subkeys.go | 469 +++ .../gpg_key_escaped_subkeys_escaped_emails.go | 109 + pkg/github/models/group.go | 185 + pkg/github/models/group_escaped_members.go | 109 + pkg/github/models/group_escaped_schemas.go | 30 + pkg/github/models/group_response.go | 185 + .../models/group_response_escaped_members.go | 138 + .../models/group_response_escaped_schemas.go | 33 + pkg/github/models/hook.go | 436 +++ pkg/github/models/hook_delivery.go | 488 +++ .../models/hook_delivery_escaped_request.go | 109 + ...elivery_escaped_request_escaped_headers.go | 52 + ...elivery_escaped_request_escaped_payload.go | 52 + .../models/hook_delivery_escaped_response.go | 109 + ...livery_escaped_response_escaped_headers.go | 52 + pkg/github/models/hook_delivery_item.go | 401 +++ pkg/github/models/hook_response.go | 138 + pkg/github/models/hovercard.go | 93 + .../models/hovercard_escaped_contexts.go | 109 + pkg/github/models/installation.go | 732 ++++ ...on_escaped_repository_escaped_selection.go | 34 + pkg/github/models/installation_token.go | 303 ++ ...en_escaped_repository_escaped_selection.go | 33 + pkg/github/models/instances503_error.go | 146 + pkg/github/models/integration.go | 523 +++ .../models/integration_escaped_permissions.go | 197 ++ .../integration_installation_request.go | 284 ++ pkg/github/models/issue.go | 1059 ++++++ pkg/github/models/issue503_error.go | 146 + pkg/github/models/issue_comment.go | 460 +++ .../issue_escaped_pull_escaped_request.go | 197 ++ .../issue_escaped_state_escaped_reason.go | 37 + pkg/github/models/issue_event.go | 692 ++++ .../models/issue_event_dismissed_review.go | 167 + pkg/github/models/issue_event_for_issue.go | 417 +++ pkg/github/models/issue_event_label.go | 110 + pkg/github/models/issue_event_milestone.go | 81 + pkg/github/models/issue_event_project_card.go | 226 ++ pkg/github/models/issue_event_rename.go | 110 + pkg/github/models/issue_search_result_item.go | 1105 ++++++ ...issue_search_result_item_escaped_labels.go | 254 ++ ...esult_item_escaped_pull_escaped_request.go | 197 ++ pkg/github/models/issues.go | 208 ++ pkg/github/models/issues503_error.go | 146 + pkg/github/models/issues_escaped_matches.go | 115 + pkg/github/models/job.go | 740 ++++ pkg/github/models/job_escaped_conclusion.go | 49 + pkg/github/models/job_escaped_status.go | 46 + pkg/github/models/job_escaped_steps.go | 227 ++ .../job_escaped_steps_escaped_status.go | 37 + pkg/github/models/key.go | 256 ++ pkg/github/models/key_simple.go | 110 + pkg/github/models/label.go | 255 ++ pkg/github/models/label_search_result_item.go | 325 ++ pkg/github/models/labeled_issue_event.go | 342 ++ .../labeled_issue_event_escaped_label.go | 109 + pkg/github/models/labels.go | 208 ++ pkg/github/models/labels_escaped_matches.go | 115 + pkg/github/models/language.go | 52 + pkg/github/models/ldap_mapping_team.go | 457 +++ pkg/github/models/ldap_mapping_user.go | 1271 +++++++ .../models/ldap_mapping_user_escaped_plan.go | 167 + pkg/github/models/license.go | 447 +++ pkg/github/models/license_content.go | 429 +++ .../license_content_escaped__escaped_links.go | 138 + pkg/github/models/license_info.go | 413 +++ pkg/github/models/license_simple.go | 226 ++ pkg/github/models/link.go | 81 + pkg/github/models/link_with_type.go | 110 + pkg/github/models/locations503_error.go | 146 + pkg/github/models/locked_issue_event.go | 342 ++ pkg/github/models/maintenance_status.go | 150 + ...tus_escaped_connection_escaped_services.go | 109 + pkg/github/models/merged_upstream.go | 140 + ...ged_upstream_escaped_merge_escaped_type.go | 36 + pkg/github/models/meta.go | 169 + .../models/meta_escaped_resource_type.go | 34 + pkg/github/models/metadata.go | 52 + pkg/github/models/migration.go | 593 ++++ pkg/github/models/milestone.go | 520 +++ pkg/github/models/milestone_escaped_state.go | 34 + pkg/github/models/milestoned_issue_event.go | 342 ++ ...ilestoned_issue_event_escaped_milestone.go | 80 + pkg/github/models/minimal_repository.go | 2582 ++++++++++++++ .../minimal_repository_escaped_license.go | 196 ++ .../minimal_repository_escaped_permissions.go | 196 ++ .../moved_column_in_project_issue_event.go | 342 ++ ...ssue_event_escaped_project_escaped_card.go | 225 ++ pkg/github/models/nullable_collaborator.go | 690 ++++ ...llable_collaborator_escaped_permissions.go | 196 ++ pkg/github/models/nullable_git_user.go | 139 + pkg/github/models/nullable_integration.go | 523 +++ ...ullable_integration_escaped_permissions.go | 197 ++ pkg/github/models/nullable_issue.go | 1059 ++++++ ...able_issue_escaped_pull_escaped_request.go | 197 ++ ...able_issue_escaped_state_escaped_reason.go | 37 + pkg/github/models/nullable_license_simple.go | 226 ++ pkg/github/models/nullable_milestone.go | 520 +++ .../nullable_milestone_escaped_state.go | 34 + .../models/nullable_minimal_repository.go | 2582 ++++++++++++++ ...able_minimal_repository_escaped_license.go | 196 ++ ..._minimal_repository_escaped_permissions.go | 196 ++ pkg/github/models/nullable_repository.go | 2826 +++++++++++++++ ...ed_merge_escaped_commit_escaped_message.go | 37 + ...aped_merge_escaped_commit_escaped_title.go | 34 + ...nullable_repository_escaped_permissions.go | 196 ++ ...ed_merge_escaped_commit_escaped_message.go | 37 + ...aped_merge_escaped_commit_escaped_title.go | 34 + .../models/nullable_scoped_installation.go | 261 ++ ...on_escaped_repository_escaped_selection.go | 34 + pkg/github/models/nullable_simple_commit.go | 227 ++ .../nullable_simple_commit_escaped_author.go | 110 + ...ullable_simple_commit_escaped_committer.go | 110 + pkg/github/models/nullable_simple_user.go | 661 ++++ pkg/github/models/nullable_team_simple.go | 429 +++ pkg/github/models/oidc_custom_sub.go | 87 + pkg/github/models/oidc_custom_sub_repo.go | 116 + pkg/github/models/org_hook.go | 378 ++ pkg/github/models/org_hook_escaped_config.go | 167 + pkg/github/models/org_membership.go | 257 ++ .../org_membership_escaped_permissions.go | 80 + .../models/org_membership_escaped_role.go | 37 + .../models/org_membership_escaped_state.go | 34 + pkg/github/models/org_pre_receive_hook.go | 196 ++ .../models/org_repo_custom_property_values.go | 180 + pkg/github/models/org_ruleset_conditions.go | 52 + .../models/organization_actions_secret.go | 199 ++ ...ation_actions_secret_escaped_visibility.go | 37 + .../models/organization_actions_variable.go | 228 ++ ...ion_actions_variable_escaped_visibility.go | 37 + ..._custom_organization_role_create_schema.go | 144 + ..._custom_organization_role_update_schema.go | 144 + .../organization_custom_repository_role.go | 292 ++ ...on_custom_repository_role_create_schema.go | 174 + ...create_schema_escaped_base_escaped_role.go | 40 + ...pository_role_escaped_base_escaped_role.go | 40 + ...on_custom_repository_role_update_schema.go | 174 + ...update_schema_escaped_base_escaped_role.go | 40 + .../models/organization_dependabot_secret.go | 199 ++ ...on_dependabot_secret_escaped_visibility.go | 37 + .../organization_fine_grained_permission.go | 110 + pkg/github/models/organization_full.go | 1724 ++++++++++ .../models/organization_full_escaped_plan.go | 196 ++ .../organization_programmatic_access_grant.go | 314 ++ ...mmatic_access_grant_escaped_permissions.go | 139 + ...scaped_permissions_escaped_organization.go | 51 + ...grant_escaped_permissions_escaped_other.go | 51 + ..._escaped_permissions_escaped_repository.go | 51 + ...nt_escaped_repository_escaped_selection.go | 37 + ...ation_programmatic_access_grant_request.go | 343 ++ ...ccess_grant_request_escaped_permissions.go | 139 + ...scaped_permissions_escaped_organization.go | 51 + ...quest_escaped_permissions_escaped_other.go | 51 + ..._escaped_permissions_escaped_repository.go | 51 + ...st_escaped_repository_escaped_selection.go | 37 + pkg/github/models/organization_role.go | 262 ++ .../organization_secret_scanning_alert.go | 576 ++++ ..._secret_scanning_alert_escaped_validity.go | 37 + pkg/github/models/organization_simple.go | 400 +++ pkg/github/models/package_escaped.go | 374 ++ .../package_escaped_package_escaped_type.go | 45 + .../models/package_escaped_visibility.go | 33 + pkg/github/models/package_version.go | 372 ++ .../package_version_escaped_metadata.go | 139 + ...sion_escaped_metadata_escaped_container.go | 86 + ...version_escaped_metadata_escaped_docker.go | 86 + ...d_metadata_escaped_package_escaped_type.go | 45 + pkg/github/models/page.go | 404 +++ pkg/github/models/page_build.go | 285 ++ pkg/github/models/page_build_escaped_error.go | 80 + pkg/github/models/page_build_status.go | 110 + pkg/github/models/page_deployment.go | 262 ++ .../models/page_escaped_build_escaped_type.go | 34 + ..._protected_escaped_domain_escaped_state.go | 37 + pkg/github/models/page_escaped_status.go | 37 + pkg/github/models/pages_deployment_status.go | 81 + .../pages_deployment_status_escaped_status.go | 61 + pkg/github/models/pages_https_certificate.go | 174 + .../pages_https_certificate_escaped_state.go | 63 + pkg/github/models/pages_source_hash.go | 109 + pkg/github/models/participation_stats.go | 121 + pkg/github/models/patch_schema.go | 127 + .../models/patch_schema_escaped_operations.go | 139 + ...ch_schema_escaped_operations_escaped_op.go | 36 + .../models/patch_schema_escaped_schemas.go | 30 + pkg/github/models/pending_deployment.go | 210 ++ .../pending_deployment_escaped_environment.go | 196 ++ .../pending_deployment_escaped_reviewers.go | 196 ++ pkg/github/models/pre_receive_environment.go | 312 ++ ...pre_receive_environment_download_status.go | 167 + ...re_receive_environment_escaped_download.go | 167 + pkg/github/models/pre_receive_hook.go | 254 ++ .../pre_receive_hook_escaped_environment.go | 312 ++ ...ok_escaped_environment_escaped_download.go | 167 + ..._hook_escaped_script_escaped_repository.go | 167 + pkg/github/models/private_user.go | 1300 +++++++ .../models/private_user_escaped_plan.go | 167 + pkg/github/models/project.go | 489 +++ pkg/github/models/project_card.go | 430 +++ .../models/project_collaborator_permission.go | 110 + pkg/github/models/project_column.go | 285 ++ ...escaped_organization_escaped_permission.go | 40 + pkg/github/models/protected_branch.go | 429 +++ .../models/protected_branch_admin_enforced.go | 110 + ..._branch_escaped_allow_escaped_deletions.go | 61 + ...aped_allow_escaped_force_escaped_pushes.go | 61 + ...aped_allow_escaped_fork_escaped_syncing.go | 62 + ..._branch_escaped_block_escaped_creations.go | 61 + ...d_branch_escaped_enforce_escaped_admins.go | 90 + ...cted_branch_escaped_lock_escaped_branch.go | 62 + ...escaped_conversation_escaped_resolution.go | 61 + ...required_escaped_linear_escaped_history.go | 61 + ...ed_pull_escaped_request_escaped_reviews.go | 254 ++ ...nch_escaped_required_escaped_signatures.go | 109 + .../protected_branch_pull_request_review.go | 255 ++ ...pull_escaped_request_escaped_allowances.go | 175 + ..._escaped_dismissal_escaped_restrictions.go | 261 ++ .../protected_branch_required_status_check.go | 244 ++ ...ch_required_status_check_escaped_checks.go | 109 + pkg/github/models/public_key_full.go | 371 ++ pkg/github/models/public_user.go | 1194 +++++++ pkg/github/models/public_user_escaped_plan.go | 167 + pkg/github/models/pull_request.go | 1495 ++++++++ pkg/github/models/pull_request503_error.go | 146 + .../pull_request_escaped__escaped_links.go | 283 ++ .../models/pull_request_escaped_base.go | 196 ++ .../pull_request_escaped_base_escaped_repo.go | 2523 ++++++++++++++ ...escaped_base_escaped_repo_escaped_owner.go | 573 ++++ ...d_base_escaped_repo_escaped_permissions.go | 196 ++ .../pull_request_escaped_base_escaped_user.go | 573 ++++ .../models/pull_request_escaped_head.go | 196 ++ .../pull_request_escaped_head_escaped_repo.go | 2523 ++++++++++++++ ...caped_head_escaped_repo_escaped_license.go | 196 ++ ...escaped_head_escaped_repo_escaped_owner.go | 573 ++++ ...d_head_escaped_repo_escaped_permissions.go | 196 ++ .../pull_request_escaped_head_escaped_user.go | 573 ++++ .../models/pull_request_escaped_labels.go | 254 ++ .../models/pull_request_escaped_state.go | 34 + .../models/pull_request_merge_result.go | 139 + pkg/github/models/pull_request_minimal.go | 196 ++ .../pull_request_minimal_escaped_base.go | 138 + ...quest_minimal_escaped_base_escaped_repo.go | 138 + .../pull_request_minimal_escaped_head.go | 138 + ...quest_minimal_escaped_head_escaped_repo.go | 138 + pkg/github/models/pull_request_review.go | 431 +++ .../models/pull_request_review_comment.go | 902 +++++ ...t_review_comment_escaped__escaped_links.go | 138 + ...ent_escaped__escaped_links_escaped_html.go | 80 + ...aped_links_escaped_pull_escaped_request.go | 80 + ...ent_escaped__escaped_links_escaped_self.go | 80 + ...ull_request_review_comment_escaped_side.go | 34 + ...view_comment_escaped_start_escaped_side.go | 34 + ...ew_comment_escaped_subject_escaped_type.go | 34 + ...l_request_review_escaped__escaped_links.go | 109 + ...iew_escaped__escaped_links_escaped_html.go | 80 + ...aped_links_escaped_pull_escaped_request.go | 80 + .../models/pull_request_review_request.go | 134 + pkg/github/models/pull_request_simple.go | 1146 +++++++ ...l_request_simple_escaped__escaped_links.go | 283 ++ .../pull_request_simple_escaped_base.go | 196 ++ .../pull_request_simple_escaped_head.go | 196 ++ .../pull_request_simple_escaped_labels.go | 254 ++ pkg/github/models/pull_request_webhook.go | 275 ++ ...ed_merge_escaped_commit_escaped_message.go | 37 + ...aped_merge_escaped_commit_escaped_title.go | 34 + ...ed_merge_escaped_commit_escaped_message.go | 37 + ...aped_merge_escaped_commit_escaped_title.go | 34 + pkg/github/models/rate_limit.go | 167 + pkg/github/models/rate_limit_overview.go | 110 + .../rate_limit_overview_escaped_resources.go | 312 ++ pkg/github/models/reaction.go | 199 ++ pkg/github/models/reaction_escaped_content.go | 52 + pkg/github/models/reaction_rollup.go | 341 ++ pkg/github/models/referenced_workflow.go | 139 + pkg/github/models/release.go | 703 ++++ pkg/github/models/release_asset.go | 431 +++ .../models/release_asset_escaped_state.go | 34 + pkg/github/models/release_notes_content.go | 110 + .../removed_from_project_issue_event.go | 342 ++ ...ssue_event_escaped_project_escaped_card.go | 225 ++ pkg/github/models/renamed_issue_event.go | 342 ++ .../renamed_issue_event_escaped_rename.go | 109 + pkg/github/models/repo_search_result_item.go | 2652 ++++++++++++++ ..._search_result_item_escaped_permissions.go | 196 ++ pkg/github/models/repositories.go | 208 ++ pkg/github/models/repositories503_error.go | 146 + .../models/repositories_escaped_matches.go | 115 + pkg/github/models/repository.go | 2826 +++++++++++++++ .../repository_collaborator_permission.go | 139 + ...ed_merge_escaped_commit_escaped_message.go | 37 + ...aped_merge_escaped_commit_escaped_title.go | 34 + .../models/repository_escaped_permissions.go | 196 ++ ...ed_merge_escaped_commit_escaped_message.go | 37 + ...aped_merge_escaped_commit_escaped_title.go | 34 + .../repository_fine_grained_permission.go | 110 + pkg/github/models/repository_invitation.go | 344 ++ ...pository_invitation_escaped_permissions.go | 43 + .../models/repository_pre_receive_hook.go | 167 + pkg/github/models/repository_rule.go | 1493 ++++++++ .../repository_rule_branch_name_pattern.go | 111 + ..._branch_name_pattern_escaped_parameters.go | 168 + ...ern_escaped_parameters_escaped_operator.go | 40 + ...y_rule_branch_name_pattern_escaped_type.go | 30 + .../models/repository_rule_code_scanning.go | 111 + ...y_rule_code_scanning_escaped_parameters.go | 92 + ...ository_rule_code_scanning_escaped_type.go | 30 + ...sitory_rule_commit_author_email_pattern.go | 111 + ...author_email_pattern_escaped_parameters.go | 168 + ...ern_escaped_parameters_escaped_operator.go | 40 + ...ommit_author_email_pattern_escaped_type.go | 30 + .../repository_rule_commit_message_pattern.go | 111 + ...mmit_message_pattern_escaped_parameters.go | 168 + ...ern_escaped_parameters_escaped_operator.go | 40 + ...ule_commit_message_pattern_escaped_type.go | 30 + ...repository_rule_committer_email_pattern.go | 111 + ...mitter_email_pattern_escaped_parameters.go | 168 + ...ern_escaped_parameters_escaped_operator.go | 40 + ...le_committer_email_pattern_escaped_type.go | 30 + pkg/github/models/repository_rule_creation.go | 82 + .../repository_rule_creation_escaped_type.go | 30 + pkg/github/models/repository_rule_deletion.go | 82 + .../repository_rule_deletion_escaped_type.go | 30 + pkg/github/models/repository_rule_detailed.go | 52 + .../models/repository_rule_enforcement.go | 37 + .../repository_rule_non_fast_forward.go | 82 + ...tory_rule_non_fast_forward_escaped_type.go | 30 + ...pository_rule_params_code_scanning_tool.go | 141 + ...g_tool_escaped_alerts_escaped_threshold.go | 40 + ...curity_escaped_alerts_escaped_threshold.go | 43 + ..._rule_params_status_check_configuration.go | 110 + ...ory_rule_params_workflow_file_reference.go | 168 + .../models/repository_rule_pull_request.go | 111 + ...ry_rule_pull_request_escaped_parameters.go | 196 ++ ...pository_rule_pull_request_escaped_type.go | 30 + .../repository_rule_required_deployments.go | 111 + ...required_deployments_escaped_parameters.go | 86 + ..._rule_required_deployments_escaped_type.go | 30 + ...repository_rule_required_linear_history.go | 82 + ...le_required_linear_history_escaped_type.go | 30 + .../repository_rule_required_signatures.go | 82 + ...y_rule_required_signatures_escaped_type.go | 30 + .../repository_rule_required_status_checks.go | 111 + ...quired_status_checks_escaped_parameters.go | 150 + ...ule_required_status_checks_escaped_type.go | 30 + .../repository_rule_tag_name_pattern.go | 111 + ...ule_tag_name_pattern_escaped_parameters.go | 168 + ...ern_escaped_parameters_escaped_operator.go | 40 + ...tory_rule_tag_name_pattern_escaped_type.go | 30 + pkg/github/models/repository_rule_update.go | 111 + ...pository_rule_update_escaped_parameters.go | 80 + .../repository_rule_update_escaped_type.go | 30 + .../models/repository_rule_workflows.go | 111 + ...itory_rule_workflows_escaped_parameters.go | 121 + .../repository_rule_workflows_escaped_type.go | 30 + pkg/github/models/repository_ruleset.go | 573 ++++ .../models/repository_ruleset_bypass_actor.go | 141 + ...bypass_actor_escaped_actor_escaped_type.go | 43 + ...ypass_actor_escaped_bypass_escaped_mode.go | 34 + .../models/repository_ruleset_conditions.go | 81 + ...set_conditions_escaped_ref_escaped_name.go | 121 + ...pository_ruleset_escaped__escaped_links.go | 109 + ...set_escaped__escaped_links_escaped_html.go | 80 + ...set_escaped__escaped_links_escaped_self.go | 80 + ...escaped_user_escaped_can_escaped_bypass.go | 37 + ...ory_ruleset_escaped_source_escaped_type.go | 34 + .../repository_ruleset_escaped_target.go | 37 + pkg/github/models/repository_subscription.go | 227 ++ pkg/github/models/review_comment.go | 872 +++++ .../review_comment_escaped__escaped_links.go | 138 + .../models/review_comment_escaped_side.go | 34 + ...view_comment_escaped_start_escaped_side.go | 34 + .../review_custom_gates_comment_required.go | 109 + .../review_custom_gates_state_required.go | 139 + ...stom_gates_state_required_escaped_state.go | 34 + .../models/review_dismissed_issue_event.go | 342 ++ ..._event_escaped_dismissed_escaped_review.go | 167 + .../review_request_removed_issue_event.go | 400 +++ .../models/review_requested_issue_event.go | 400 +++ pkg/github/models/root.go | 1011 ++++++ pkg/github/models/rule_suite.go | 415 +++ ...suite_escaped_evaluation_escaped_result.go | 34 + .../models/rule_suite_escaped_result.go | 37 + ..._suite_escaped_rule_escaped_evaluations.go | 198 ++ ...escaped_evaluations_escaped_enforcement.go | 37 + ...rule_escaped_evaluations_escaped_result.go | 34 + ...evaluations_escaped_rule_escaped_source.go | 138 + pkg/github/models/rule_suites.go | 373 ++ ...uites_escaped_evaluation_escaped_result.go | 34 + .../models/rule_suites_escaped_result.go | 37 + pkg/github/models/runner.go | 267 ++ pkg/github/models/runner_application.go | 226 ++ pkg/github/models/runner_groups_enterprise.go | 347 ++ pkg/github/models/runner_groups_org.go | 405 +++ pkg/github/models/runner_label.go | 140 + .../models/runner_label_escaped_type.go | 34 + .../models/scim_enterprise_group_list.go | 214 ++ ...m_enterprise_group_list_escaped_schemas.go | 30 + .../models/scim_enterprise_group_response.go | 97 + ...terprise_group_response_escaped_members.go | 138 + .../models/scim_enterprise_user_list.go | 214 ++ ...im_enterprise_user_list_escaped_schemas.go | 30 + .../models/scim_enterprise_user_response.go | 138 + ...enterprise_user_response_escaped_groups.go | 138 + pkg/github/models/scim_error.go | 240 ++ pkg/github/models/secret_scanning_alert.go | 547 +++ .../models/secret_scanning_alert503_error.go | 146 + .../secret_scanning_alert_escaped_validity.go | 37 + .../secret_scanning_alert_resolution.go | 40 + .../models/secret_scanning_alert_state.go | 34 + pkg/github/models/secret_scanning_location.go | 391 +++ .../models/secret_scanning_location_commit.go | 313 ++ ...ecret_scanning_location_discussion_body.go | 81 + ...et_scanning_location_discussion_comment.go | 81 + ...cret_scanning_location_discussion_title.go | 81 + .../secret_scanning_location_escaped_type.go | 67 + .../secret_scanning_location_issue_body.go | 81 + .../secret_scanning_location_issue_comment.go | 81 + .../secret_scanning_location_issue_title.go | 81 + ...ret_scanning_location_pull_request_body.go | 81 + ..._scanning_location_pull_request_comment.go | 81 + ...t_scanning_location_pull_request_review.go | 81 + ...ng_location_pull_request_review_comment.go | 81 + ...et_scanning_location_pull_request_title.go | 81 + .../secret_scanning_location_wiki_commit.go | 313 ++ .../models/security_advisory_credit_types.go | 58 + .../models/security_advisory_ecosystems.go | 67 + pkg/github/models/security_and_analysis.go | 167 + ...lysis_escaped_advanced_escaped_security.go | 81 + ...dvanced_escaped_security_escaped_status.go | 33 + ...ndabot_escaped_security_escaped_updates.go | 82 + ...security_escaped_updates_escaped_status.go | 34 + ...nalysis_escaped_secret_escaped_scanning.go | 81 + ...canning_escaped_push_escaped_protection.go | 81 + ..._push_escaped_protection_escaped_status.go | 33 + ..._secret_escaped_scanning_escaped_status.go | 33 + pkg/github/models/selected_actions.go | 115 + pkg/github/models/short_blob.go | 110 + pkg/github/models/short_branch.go | 197 ++ .../models/short_branch_escaped_commit.go | 109 + pkg/github/models/simple_commit.go | 227 ++ .../models/simple_commit_escaped_author.go | 110 + .../models/simple_commit_escaped_committer.go | 110 + pkg/github/models/simple_commit_status.go | 371 ++ pkg/github/models/simple_repository.go | 1386 ++++++++ pkg/github/models/simple_user.go | 661 ++++ pkg/github/models/snapshot.go | 266 ++ .../models/snapshot_escaped_detector.go | 120 + pkg/github/models/snapshot_escaped_job.go | 119 + .../models/snapshot_escaped_manifests.go | 52 + pkg/github/models/social_account.go | 110 + pkg/github/models/ssh_key.go | 109 + pkg/github/models/ssh_signing_key.go | 169 + pkg/github/models/state_change_issue_event.go | 342 ++ pkg/github/models/status.go | 371 ++ pkg/github/models/status_check_policy.go | 215 ++ .../status_check_policy_escaped_checks.go | 109 + pkg/github/models/tag.go | 197 ++ pkg/github/models/tag_escaped_commit.go | 109 + pkg/github/models/tag_protection.go | 197 ++ pkg/github/models/team.go | 458 +++ pkg/github/models/team_discussion.go | 575 ++++ pkg/github/models/team_discussion_comment.go | 430 +++ pkg/github/models/team_escaped_permissions.go | 196 ++ pkg/github/models/team_full.go | 606 ++++ ...ll_escaped_notification_escaped_setting.go | 34 + .../models/team_full_escaped_privacy.go | 34 + pkg/github/models/team_membership.go | 143 + .../models/team_membership_escaped_role.go | 34 + .../models/team_membership_escaped_state.go | 34 + pkg/github/models/team_organization.go | 1474 ++++++++ .../models/team_organization_escaped_plan.go | 196 ++ pkg/github/models/team_project.go | 516 +++ .../team_project_escaped_permissions.go | 138 + pkg/github/models/team_repository.go | 2642 ++++++++++++++ .../team_repository_escaped_permissions.go | 196 ++ pkg/github/models/team_role_assignment.go | 458 +++ ...eam_role_assignment_escaped_permissions.go | 196 ++ pkg/github/models/team_simple.go | 429 +++ pkg/github/models/thread.go | 313 ++ pkg/github/models/thread_escaped_subject.go | 167 + pkg/github/models/thread_subscription.go | 256 ++ .../models/timeline_assigned_issue_event.go | 342 ++ pkg/github/models/timeline_comment_event.go | 518 +++ .../models/timeline_commit_commented_event.go | 180 + pkg/github/models/timeline_committed_event.go | 383 +++ ...timeline_committed_event_escaped_author.go | 140 + ...eline_committed_event_escaped_committer.go | 140 + ...imeline_committed_event_escaped_parents.go | 138 + .../timeline_committed_event_escaped_tree.go | 109 + ...ne_committed_event_escaped_verification.go | 167 + .../models/timeline_cross_referenced_event.go | 198 ++ ...e_cross_referenced_event_escaped_source.go | 109 + pkg/github/models/timeline_issue_events.go | 592 ++++ .../models/timeline_line_commented_event.go | 151 + pkg/github/models/timeline_reviewed_event.go | 460 +++ ...e_reviewed_event_escaped__escaped_links.go | 109 + ...ent_escaped__escaped_links_escaped_html.go | 80 + ...aped_links_escaped_pull_escaped_request.go | 80 + .../models/timeline_unassigned_issue_event.go | 342 ++ pkg/github/models/topic.go | 87 + pkg/github/models/topic_search_result_item.go | 553 +++ ...opic_search_result_item_escaped_aliases.go | 80 + ..._aliases_escaped_topic_escaped_relation.go | 167 + ...opic_search_result_item_escaped_related.go | 80 + ..._related_escaped_topic_escaped_relation.go | 167 + pkg/github/models/topics.go | 208 ++ pkg/github/models/topics_escaped_matches.go | 115 + pkg/github/models/unassigned_issue_event.go | 371 ++ pkg/github/models/unlabeled_issue_event.go | 342 ++ .../unlabeled_issue_event_escaped_label.go | 109 + pkg/github/models/user.go | 313 ++ pkg/github/models/user_escaped_schemas.go | 30 + pkg/github/models/user_name.go | 167 + pkg/github/models/user_name_response.go | 167 + pkg/github/models/user_response.go | 313 ++ .../models/user_response_escaped_schemas.go | 30 + pkg/github/models/user_role_assignment.go | 661 ++++ pkg/github/models/user_search_result_item.go | 1051 ++++++ pkg/github/models/users.go | 138 + pkg/github/models/users503_error.go | 146 + pkg/github/models/validation_error.go | 159 + .../models/validation_error_escaped_errors.go | 319 ++ pkg/github/models/validation_error_simple.go | 153 + pkg/github/models/verification.go | 167 + pkg/github/models/vulnerability.go | 168 + .../models/vulnerability_escaped_package.go | 111 + pkg/github/models/webhook_config.go | 168 + .../models/webhook_config_insecure_ssl.go | 376 ++ .../models/with_path_get_response_member1.go | 52 + pkg/github/models/workflow.go | 373 ++ pkg/github/models/workflow_escaped_state.go | 42 + pkg/github/models/workflow_run.go | 1121 ++++++ .../item_item_events_request_builder.go | 73 + .../item_with_repo_item_request_builder.go | 28 + .../networks/networks_request_builder.go | 35 + .../with_owner_item_request_builder.go | 35 + .../notifications_put_request_body.go | 110 + .../notifications_put_response.go | 80 + .../notifications_request_builder.go | 126 + ...eads_item_subscription_put_request_body.go | 80 + ...reads_item_subscription_request_builder.go | 129 + .../notifications/threads_request_builder.go | 34 + ...ith_thread_escaped_item_request_builder.go | 117 + pkg/github/octocat/octocat_request_builder.go | 61 + .../item_custom_escaped_roles_get_response.go | 122 + ...em_custom_escaped_roles_request_builder.go | 59 + .../organizations_request_builder.go | 79 + ...ganization_escaped_item_request_builder.go | 28 + ...d_patch_request_body_escaped_visibility.go | 37 + ...ps_post_request_body_escaped_visibility.go | 37 + ...ame_put_request_body_escaped_visibility.go | 37 + ...e_patch_request_body_escaped_visibility.go | 37 + ...es_post_request_body_escaped_visibility.go | 37 + .../get_include_query_parameter_type.go | 36 + .../get_order_query_parameter_type.go | 33 + ...aeabbb3d532494516c3a0f112699915950585ad.go | 37 + .../get_direction_query_parameter_type.go | 33 + .../alerts/get_sort_query_parameter_type.go | 33 + .../get_direction_query_parameter_type.go | 33 + .../alerts/get_scope_query_parameter_type.go | 33 + .../alerts/get_sort_query_parameter_type.go | 33 + ...ame_put_request_body_escaped_visibility.go | 37 + .../get_direction_query_parameter_type.go | 33 + .../issues/get_filter_query_parameter_type.go | 45 + .../issues/get_sort_query_parameter_type.go | 36 + .../issues/get_state_query_parameter_type.go | 36 + ...equest_body_escaped_query_escaped_suite.go | 34 + .../get_filter_query_parameter_type.go | 33 + .../members/get_role_query_parameter_type.go | 36 + ..._username_put_request_body_escaped_role.go | 34 + .../get_exclude_query_parameter_type.go | 31 + .../item/get_exclude_query_parameter_type.go | 31 + ...tions_post_request_body_escaped_exclude.go | 30 + .../get_filter_query_parameter_type.go | 33 + ...ckage_escaped_type_query_parameter_type.go | 45 + .../get_visibility_query_parameter_type.go | 36 + .../get_state_query_parameter_type.go | 33 + .../get_direction_query_parameter_type.go | 33 + .../get_sort_query_parameter_type.go | 30 + ...scaped_post_request_body_escaped_action.go | 34 + ...quests_post_request_body_escaped_action.go | 34 + .../get_direction_query_parameter_type.go | 33 + .../get_sort_query_parameter_type.go | 30 + ...scaped_post_request_body_escaped_action.go | 31 + ...tokens_post_request_body_escaped_action.go | 31 + .../get_direction_query_parameter_type.go | 33 + .../get_sort_query_parameter_type.go | 36 + .../get_state_query_parameter_type.go | 36 + ...request_body_escaped_value_escaped_type.go | 40 + .../get_direction_query_parameter_type.go | 33 + .../repos/get_sort_query_parameter_type.go | 39 + .../repos/get_type_query_parameter_type.go | 48 + ...ed_merge_escaped_commit_escaped_message.go | 37 + ...aped_merge_escaped_commit_escaped_title.go | 34 + ...ed_merge_escaped_commit_escaped_message.go | 37 + ...aped_merge_escaped_commit_escaped_title.go | 34 + ...os_post_request_body_escaped_visibility.go | 37 + ...escaped_put_request_body_escaped_target.go | 37 + ...lesets_post_request_body_escaped_target.go | 37 + ...ite_escaped_result_query_parameter_type.go | 39 + ...ime_escaped_period_query_parameter_type.go | 39 + .../get_direction_query_parameter_type.go | 33 + .../alerts/get_sort_query_parameter_type.go | 33 + .../alerts/get_state_query_parameter_type.go | 33 + .../get_direction_query_parameter_type.go | 33 + .../get_direction_query_parameter_type.go | 33 + .../get_content_query_parameter_type.go | 51 + ...tions_post_request_body_escaped_content.go | 52 + .../get_content_query_parameter_type.go | 51 + ...tions_post_request_body_escaped_content.go | 52 + .../members/get_role_query_parameter_type.go | 36 + ..._username_put_request_body_escaped_role.go | 34 + ...ped_put_request_body_escaped_permission.go | 37 + ...dy_escaped_notification_escaped_setting.go | 34 + ...g_patch_request_body_escaped_permission.go | 37 + ...slug_patch_request_body_escaped_privacy.go | 34 + ...dy_escaped_notification_escaped_setting.go | 34 + ...ms_post_request_body_escaped_permission.go | 34 + ...teams_post_request_body_escaped_privacy.go | 34 + ...t_escaped_repository_escaped_permission.go | 40 + .../item_actions_cache_request_builder.go | 33 + ..._cache_usage_by_repository_get_response.go | 122 + ...che_usage_by_repository_request_builder.go | 63 + ...tem_actions_cache_usage_request_builder.go | 57 + ...ions_oidc_customization_request_builder.go | 28 + ..._oidc_customization_sub_request_builder.go | 94 + .../orgs/item_actions_oidc_request_builder.go | 28 + ...em_actions_permissions_put_request_body.go | 112 + ...s_permissions_repositories_get_response.go | 122 + ...rmissions_repositories_put_request_body.go | 86 + ...ermissions_repositories_request_builder.go | 100 + ...repository_escaped_item_request_builder.go | 73 + ...tem_actions_permissions_request_builder.go | 98 + ...ssions_selected_actions_request_builder.go | 83 + ...ns_permissions_workflow_request_builder.go | 83 + .../orgs/item_actions_request_builder.go | 58 + ...item_actions_runner_groups_get_response.go | 122 + ...r_groups_item_repositories_get_response.go | 122 + ...oups_item_repositories_put_request_body.go | 86 + ...roups_item_repositories_request_builder.go | 100 + ...repository_escaped_item_request_builder.go | 73 + ...runner_groups_item_runners_get_response.go | 122 + ...er_groups_item_runners_put_request_body.go | 86 + ...ner_groups_item_runners_request_builder.go | 100 + ...ith_runner_escaped_item_request_builder.go | 73 + ...scaped_group_escaped_patch_request_body.go | 173 + ...actions_runner_groups_post_request_body.go | 243 ++ ...m_actions_runner_groups_request_builder.go | 108 + ...aped_group_escaped_item_request_builder.go | 120 + ...tions_runners_downloads_request_builder.go | 60 + ...rs_generate_jitconfig_post_request_body.go | 175 + ...unners_generate_jitconfig_post_response.go | 110 + ...ners_generate_jitconfig_request_builder.go | 67 + .../orgs/item_actions_runners_get_response.go | 122 + ...ons_runners_item_labels_delete_response.go | 122 + ...ctions_runners_item_labels_get_response.go | 122 + ...m_labels_item_with_name_delete_response.go | 122 + ...s_runners_item_labels_post_request_body.go | 86 + ...tions_runners_item_labels_post_response.go | 122 + ...ns_runners_item_labels_put_request_body.go | 86 + ...ctions_runners_item_labels_put_response.go | 122 + ...ons_runners_item_labels_request_builder.go | 178 + ...m_labels_with_name_item_request_builder.go | 63 + ...ners_registration_token_request_builder.go | 57 + ...ns_runners_remove_token_request_builder.go | 57 + .../item_actions_runners_request_builder.go | 96 + ...ith_runner_escaped_item_request_builder.go | 84 + .../orgs/item_actions_secrets_get_response.go | 122 + ..._secrets_item_repositories_get_response.go | 122 + ...rets_item_repositories_put_request_body.go | 86 + ...crets_item_repositories_request_builder.go | 100 + ...repository_escaped_item_request_builder.go | 73 + ...th_secret_escaped_name_put_request_body.go | 144 + ...ions_secrets_public_key_request_builder.go | 57 + .../item_actions_secrets_request_builder.go | 80 + ...ecret_escaped_name_item_request_builder.go | 115 + .../item_actions_variables_get_response.go | 122 + ...ariables_item_repositories_get_response.go | 122 + ...bles_item_repositories_put_request_body.go | 86 + ...ables_item_repositories_request_builder.go | 100 + ...repository_escaped_item_request_builder.go | 73 + ...ables_item_with_name_patch_request_body.go | 144 + ...tem_actions_variables_post_request_body.go | 144 + .../item_actions_variables_request_builder.go | 107 + ...ariables_with_name_item_request_builder.go | 110 + .../orgs/item_announcement_request_builder.go | 110 + .../orgs/item_audit_log_request_builder.go | 78 + ...em_code_scanning_alerts_request_builder.go | 90 + .../item_code_scanning_request_builder.go | 28 + ...em_custom_repository_roles_get_response.go | 122 + ...custom_repository_roles_request_builder.go | 105 + ..._with_role_escaped_item_request_builder.go | 120 + .../item_dependabot_alerts_request_builder.go | 98 + .../orgs/item_dependabot_request_builder.go | 33 + .../item_dependabot_secrets_get_response.go | 122 + ..._secrets_item_repositories_get_response.go | 122 + ...rets_item_repositories_put_request_body.go | 86 + ...crets_item_repositories_request_builder.go | 100 + ...repository_escaped_item_request_builder.go | 73 + ...th_secret_escaped_name_put_request_body.go | 144 + ...abot_secrets_public_key_request_builder.go | 57 + ...item_dependabot_secrets_request_builder.go | 80 + ...ecret_escaped_name_item_request_builder.go | 115 + .../item_docker_conflicts_request_builder.go | 66 + .../orgs/item_docker_request_builder.go | 28 + .../orgs/item_events_request_builder.go | 67 + .../item_external_group_request_builder.go | 34 + ...with_group_escaped_item_request_builder.go | 64 + .../item_external_groups_request_builder.go | 66 + ...em_hooks_item_config_patch_request_body.go | 168 + .../item_hooks_item_config_request_builder.go | 88 + ..._deliveries_item_attempts_post_response.go | 51 + ...eliveries_item_attempts_request_builder.go | 63 + ...m_hooks_item_deliveries_request_builder.go | 85 + ...h_delivery_escaped_item_request_builder.go | 68 + .../item_hooks_item_pings_request_builder.go | 57 + ...em_with_hook_escaped_patch_request_body.go | 173 + ...caped_patch_request_body_escaped_config.go | 169 + .../orgs/item_hooks_post_request_body.go | 173 + ..._hooks_post_request_body_escaped_config.go | 227 ++ pkg/github/orgs/item_hooks_request_builder.go | 119 + ..._with_hook_escaped_item_request_builder.go | 140 + .../orgs/item_installation_request_builder.go | 57 + .../orgs/item_installations_get_response.go | 122 + .../item_installations_request_builder.go | 63 + .../orgs/item_issues_request_builder.go | 85 + ..._item_with_enablement_post_request_body.go | 51 + ...em_with_enablement_item_request_builder.go | 58 + .../orgs/item_members_request_builder.go | 88 + ...bers_with_username_item_request_builder.go | 79 + ...ips_item_with_username_put_request_body.go | 51 + .../orgs/item_memberships_request_builder.go | 35 + ...hips_with_username_item_request_builder.go | 129 + ...migrations_item_archive_request_builder.go | 84 + ...ns_item_repos_item_lock_request_builder.go | 57 + ...m_migrations_item_repos_request_builder.go | 35 + ..._repo_escaped_name_item_request_builder.go | 28 + ...tions_item_repositories_request_builder.go | 71 + .../orgs/item_migrations_post_request_body.go | 289 ++ .../orgs/item_migrations_request_builder.go | 118 + ..._migration_escaped_item_request_builder.go | 82 + ...ine_grained_permissions_request_builder.go | 66 + .../item_organization_roles_get_response.go | 122 + ...zation_roles_item_teams_request_builder.go | 67 + ...zation_roles_item_users_request_builder.go | 67 + ...item_organization_roles_request_builder.go | 123 + ..._with_role_escaped_item_request_builder.go | 73 + ...rganization_roles_teams_request_builder.go | 35 + ..._team_escaped_slug_item_request_builder.go | 62 + ..._with_role_escaped_item_request_builder.go | 73 + ...rganization_roles_users_request_builder.go | 35 + ...sers_with_username_item_request_builder.go | 62 + ..._with_role_escaped_item_request_builder.go | 134 + ...llaborators_item_with_username422_error.go | 117 + ...ors_item_with_username_put_request_body.go | 80 + ...orators_item_with_username_put_response.go | 32 + ...e_escaped_collaborators_request_builder.go | 82 + ...tors_with_username_item_request_builder.go | 92 + ...kages_item_item_restore_request_builder.go | 66 + ...m_versions_item_restore_request_builder.go | 61 + ...ages_item_item_versions_request_builder.go | 89 + ...ed_version_escaped_item_request_builder.go | 93 + ...ckage_escaped_name_item_request_builder.go | 98 + .../orgs/item_packages_request_builder.go | 90 + ...ckage_escaped_type_item_request_builder.go | 35 + ...uests_item_repositories_request_builder.go | 75 + ...caped_request_escaped_post_request_body.go | 80 + ...access_token_requests_post_request_body.go | 115 + ...nal_access_token_requests_post_response.go | 51 + ...l_access_token_requests_request_builder.go | 145 + ...ed_request_escaped_item_request_builder.go | 72 + ...okens_item_repositories_request_builder.go | 75 + ...item_with_pat_escaped_post_request_body.go | 51 + ...ersonal_access_tokens_post_request_body.go | 86 + ...em_personal_access_tokens_post_response.go | 51 + ..._personal_access_tokens_request_builder.go | 145 + ...s_with_pat_escaped_item_request_builder.go | 72 + ...escaped_hook_escaped_patch_request_body.go | 109 + .../item_pre_receive_hooks_request_builder.go | 83 + ...caped_hook_escaped_item_request_builder.go | 114 + .../orgs/item_projects_post_request_body.go | 109 + .../orgs/item_projects_request_builder.go | 117 + .../orgs/item_properties_request_builder.go | 33 + ..._property_escaped_name_put_request_body.go | 244 ++ ...em_properties_schema_patch_request_body.go | 93 + .../item_properties_schema_request_builder.go | 118 + ...perty_escaped_name_item_request_builder.go | 129 + ...em_properties_values_patch_request_body.go | 128 + .../item_properties_values_request_builder.go | 110 + ..._public_escaped_members_request_builder.go | 79 + ...bers_with_username_item_request_builder.go | 101 + .../orgs/item_repos_post_request_body.go | 634 ++++ ..._body_escaped_custom_escaped_properties.go | 52 + pkg/github/orgs/item_repos_request_builder.go | 111 + ...ine_grained_permissions_request_builder.go | 60 + ...m_with_ruleset_escaped_put_request_body.go | 222 ++ .../orgs/item_rulesets_post_request_body.go | 222 ++ .../orgs/item_rulesets_request_builder.go | 126 + ...em_rulesets_rule_suites_request_builder.go | 95 + ...aped_suite_escaped_item_request_builder.go | 63 + ...th_ruleset_escaped_item_request_builder.go | 129 + ..._secret_scanning_alerts_request_builder.go | 90 + .../item_secret_scanning_request_builder.go | 28 + .../item_security_managers_request_builder.go | 65 + ...security_managers_teams_request_builder.go | 35 + ..._team_escaped_slug_item_request_builder.go | 73 + ...lling_advanced_security_request_builder.go | 64 + .../item_settings_billing_request_builder.go | 28 + .../orgs/item_settings_request_builder.go | 28 + ...mments_item_reactions_post_request_body.go | 51 + ...comments_item_reactions_request_builder.go | 112 + ...h_reaction_escaped_item_request_builder.go | 51 + ...mment_escaped_number_patch_request_body.go | 80 + ...ussions_item_comments_post_request_body.go | 80 + ...scussions_item_comments_request_builder.go | 112 + ...ent_escaped_number_item_request_builder.go | 115 + ...ssions_item_reactions_post_request_body.go | 51 + ...cussions_item_reactions_request_builder.go | 112 + ...h_reaction_escaped_item_request_builder.go | 51 + ...ssion_escaped_number_patch_request_body.go | 109 + ...eams_item_discussions_post_request_body.go | 138 + ..._teams_item_discussions_request_builder.go | 114 + ...ion_escaped_number_item_request_builder.go | 120 + ...item_external_groups_patch_request_body.go | 80 + ...ms_item_external_groups_request_builder.go | 110 + ...item_teams_item_members_request_builder.go | 70 + ...ips_item_with_username_put_request_body.go | 51 + ..._teams_item_memberships_request_builder.go | 35 + ...hips_with_username_item_request_builder.go | 110 + ...cts_item_with_project_escaped_403_error.go | 117 + ...m_with_project_escaped_put_request_body.go | 51 + ...tem_teams_item_projects_request_builder.go | 78 + ...th_project_escaped_item_request_builder.go | 110 + ...os_item_item_with_repo_put_request_body.go | 80 + ...pos_item_with_repo_item_request_builder.go | 105 + .../item_teams_item_repos_request_builder.go | 79 + ...m_repos_with_owner_item_request_builder.go | 35 + .../item_teams_item_teams_request_builder.go | 67 + ...th_team_escaped_slug_patch_request_body.go | 138 + .../orgs/item_teams_post_request_body.go | 237 ++ pkg/github/orgs/item_teams_request_builder.go | 120 + ..._team_escaped_slug_item_request_builder.go | 157 + .../orgs/item_with_org_delete_response.go | 51 + .../orgs/item_with_org_patch_request_body.go | 794 +++++ ...ty_escaped_product_item_request_builder.go | 36 + pkg/github/orgs/orgs_request_builder.go | 35 + .../orgs/with_org_item_request_builder.go | 311 ++ ...ived_escaped_state_query_parameter_type.go | 36 + .../columns_cards_item_moves403_error.go | 158 + ...ards_item_moves403_error_escaped_errors.go | 167 + .../columns_cards_item_moves503_error.go | 187 + ...ards_item_moves503_error_escaped_errors.go | 109 + ...umns_cards_item_moves_post_request_body.go | 109 + .../columns_cards_item_moves_post_response.go | 32 + ...olumns_cards_item_moves_request_builder.go | 70 + ..._cards_item_with_card_escaped_403_error.go | 152 + ...em_with_card_escaped_patch_request_body.go | 109 + .../projects/columns_cards_request_builder.go | 34 + ..._with_card_escaped_item_request_builder.go | 141 + ...ns_item_cards_post_request_body_member1.go | 80 + ...ns_item_cards_post_request_body_member2.go | 109 + ...olumns_item_cards_project_card503_error.go | 187 + ...ds_project_card503_error_escaped_errors.go | 109 + .../columns_item_cards_request_builder.go | 234 ++ .../columns_item_moves_post_request_body.go | 80 + .../columns_item_moves_post_response.go | 32 + .../columns_item_moves_request_builder.go | 68 + ..._with_column_escaped_patch_request_body.go | 80 + .../projects/columns_request_builder.go | 39 + ...ith_column_escaped_item_request_builder.go | 140 + .../get_affiliation_query_parameter_type.go | 36 + ...ame_put_request_body_escaped_permission.go | 37 + ...escaped_organization_escaped_permission.go | 40 + ...orators_item_permission_request_builder.go | 67 + ...ors_item_with_username_put_request_body.go | 51 + .../item_collaborators_request_builder.go | 92 + ...tors_with_username_item_request_builder.go | 105 + .../item_columns_post_request_body.go | 80 + .../projects/item_columns_request_builder.go | 112 + pkg/github/projects/item_project403_error.go | 152 + .../item_with_project_escaped_403_error.go | 152 + ...with_project_escaped_patch_request_body.go | 167 + .../projects/projects_request_builder.go | 39 + ...th_project_escaped_item_request_builder.go | 147 + .../rate_escaped_limit_request_builder.go | 61 + ...4ee9f3904b12838161aef08329acd1d15433341.go | 157 + ...20b0d29734964bd8cf755677e5074aa3595ed1f.go | 157 + ...884cd55a3b6e7fe81a9cd2b998f1b1909634428.go | 110 + ...f10daa17df7d6492a6bc9d7b42e609850615c1b.go | 81 + ...bc2e02facbf46789676a4dc678fbfc0c7285cc0.go | 86 + ...787cc369718434019f4ba4eb3b1ea1ef4d38f08.go | 86 + ...5ae1715beca9efd14c0e545568b62a18c27233f.go | 226 ++ ...9290735bf63c4cd1ecace89ae78b4eeb7f2f21d.go | 109 + ...724ec633f98e8881fefccfc0b6561eaac582274.go | 157 + ...7128090717488ce8d132dca34aa5a2475cb9e75.go | 79 + ...fdfbe23849e2fae5c8ca4d195f9213af56dfa48.go | 81 + ...99b96bdcce4f6039e3e2d90db46a68255a69ed0.go | 109 + ...737cf27d616e0818052d67c9dbb80855e1eb59d.go | 81 + ...639b41e606e1e0fc5e4f49ee0a9dcea3560f2f7.go | 225 ++ ...154d728e1e845e4d4f0daf2fad2e64d0814e2fd.go | 157 + ...0996157dffa969b443e6484fca873747b165c64.go | 86 + ...8ad594e1b68c871877fd14056bab410d7362ac8.go | 119 + .../get_direction_query_parameter_type.go | 33 + .../caches/get_sort_query_parameter_type.go | 36 + .../runs/get_status_query_parameter_type.go | 69 + .../jobs/get_filter_query_parameter_type.go | 33 + ...oyments_post_request_body_escaped_state.go | 34 + .../runs/get_status_query_parameter_type.go | 69 + ...ivity_escaped_type_query_parameter_type.go | 45 + .../get_direction_query_parameter_type.go | 33 + ...ime_escaped_period_query_parameter_type.go | 42 + ...ost_request_body_member1_escaped_status.go | 30 + ...ost_request_body_member2_escaped_status.go | 33 + ...tch_request_body_member1_escaped_status.go | 30 + ...tch_request_body_member2_escaped_status.go | 33 + .../get_filter_query_parameter_type.go | 33 + .../get_status_query_parameter_type.go | 36 + .../get_direction_query_parameter_type.go | 33 + .../alerts/get_sort_query_parameter_type.go | 33 + .../get_direction_query_parameter_type.go | 33 + .../analyses/get_sort_query_parameter_type.go | 30 + .../get_affiliation_query_parameter_type.go | 36 + .../get_permission_query_parameter_type.go | 42 + .../get_content_query_parameter_type.go | 51 + ...tions_post_request_body_escaped_content.go | 52 + .../get_filter_query_parameter_type.go | 33 + .../get_status_query_parameter_type.go | 36 + .../get_direction_query_parameter_type.go | 33 + .../alerts/get_scope_query_parameter_type.go | 33 + .../alerts/get_sort_query_parameter_type.go | 33 + ...t_body_escaped_dismissed_escaped_reason.go | 43 + ...number_patch_request_body_escaped_state.go | 34 + ...tatuses_post_request_body_escaped_state.go | 49 + .../forks/get_sort_query_parameter_type.go | 39 + .../tags_post_request_body_escaped_type.go | 37 + ..._request_body_escaped_tree_escaped_mode.go | 43 + ..._request_body_escaped_tree_escaped_type.go | 37 + ..._patch_request_body_escaped_permissions.go | 43 + .../get_direction_query_parameter_type.go | 33 + .../comments/get_sort_query_parameter_type.go | 33 + .../get_content_query_parameter_type.go | 51 + ...tions_post_request_body_escaped_content.go | 52 + .../get_direction_query_parameter_type.go | 33 + .../issues/get_sort_query_parameter_type.go | 36 + .../issues/get_state_query_parameter_type.go | 36 + ...equest_body_escaped_lock_escaped_reason.go | 40 + .../get_content_query_parameter_type.go | 51 + ...tions_post_request_body_escaped_content.go | 52 + ...number_patch_request_body_escaped_state.go | 34 + ...quest_body_escaped_state_escaped_reason.go | 37 + .../get_direction_query_parameter_type.go | 33 + .../get_sort_query_parameter_type.go | 33 + .../get_state_query_parameter_type.go | 36 + ...number_patch_request_body_escaped_state.go | 34 + ...estones_post_request_body_escaped_state.go | 34 + ...request_body_escaped_build_escaped_type.go | 34 + ...equest_body_escaped_source_escaped_path.go | 34 + ...request_body_escaped_build_escaped_type.go | 34 + ...ody_escaped_source_member1_escaped_path.go | 34 + .../get_direction_query_parameter_type.go | 33 + .../get_sort_query_parameter_type.go | 36 + ..._patch_request_body_escaped_enforcement.go | 37 + .../get_state_query_parameter_type.go | 36 + .../get_direction_query_parameter_type.go | 33 + .../comments/get_sort_query_parameter_type.go | 36 + .../get_content_query_parameter_type.go | 51 + ...tions_post_request_body_escaped_content.go | 52 + .../get_direction_query_parameter_type.go | 33 + .../pulls/get_sort_query_parameter_type.go | 39 + .../pulls/get_state_query_parameter_type.go | 36 + ...comments_post_request_body_escaped_side.go | 34 + ...request_body_escaped_start_escaped_side.go | 37 + ...quest_body_escaped_subject_escaped_type.go | 34 + .../get_direction_query_parameter_type.go | 33 + .../comments/get_sort_query_parameter_type.go | 33 + ...quest_body_escaped_merge_escaped_method.go | 37 + ...smissals_put_request_body_escaped_event.go | 30 + .../events_post_request_body_escaped_event.go | 37 + ...reviews_post_request_body_escaped_event.go | 37 + ...number_patch_request_body_escaped_state.go | 34 + .../get_content_query_parameter_type.go | 45 + ...tions_post_request_body_escaped_content.go | 46 + ...equest_body_escaped_make_escaped_latest.go | 37 + ...equest_body_escaped_make_escaped_latest.go | 37 + ...escaped_git_escaped_sync_escaped_status.go | 39 + ...ed_merge_escaped_commit_escaped_message.go | 37 + ...aped_merge_escaped_commit_escaped_title.go | 34 + ...ed_merge_escaped_commit_escaped_message.go | 37 + ...aped_merge_escaped_commit_escaped_title.go | 34 + ...o_patch_request_body_escaped_visibility.go | 37 + ...escaped_put_request_body_escaped_target.go | 37 + ...lesets_post_request_body_escaped_target.go | 37 + ...ite_escaped_result_query_parameter_type.go | 39 + ...ime_escaped_period_query_parameter_type.go | 39 + .../get_direction_query_parameter_type.go | 33 + .../alerts/get_sort_query_parameter_type.go | 33 + .../alerts/get_state_query_parameter_type.go | 33 + ...ith_sha_post_request_body_escaped_state.go | 40 + ...tem_item_actions_artifacts_get_response.go | 122 + ...ive_escaped_format_item_request_builder.go | 57 + ..._item_actions_artifacts_request_builder.go | 76 + ...h_artifact_escaped_item_request_builder.go | 91 + ...item_item_actions_cache_request_builder.go | 33 + ...ions_cache_usage_policy_request_builder.go | 83 + ...tem_actions_cache_usage_request_builder.go | 57 + ...tem_item_actions_caches_request_builder.go | 118 + ...with_cache_escaped_item_request_builder.go | 51 + ..._actions_jobs_item_logs_request_builder.go | 51 + ...tions_jobs_item_rerun_post_request_body.go | 80 + ...actions_jobs_item_rerun_request_builder.go | 65 + .../item_item_actions_jobs_request_builder.go | 34 + ...s_with_job_escaped_item_request_builder.go | 67 + ...ions_oidc_customization_request_builder.go | 28 + ...oidc_customization_sub_put_request_body.go | 116 + ..._oidc_customization_sub_request_builder.go | 102 + .../item_item_actions_oidc_request_builder.go | 28 + ...tions_organization_secrets_get_response.go | 122 + ...ns_organization_secrets_request_builder.go | 63 + ...ons_organization_variables_get_response.go | 122 + ..._organization_variables_request_builder.go | 63 + ...ions_permissions_access_request_builder.go | 83 + ...em_actions_permissions_put_request_body.go | 111 + ...tem_actions_permissions_request_builder.go | 98 + ...ssions_selected_actions_request_builder.go | 83 + ...ns_permissions_workflow_request_builder.go | 83 + .../item_item_actions_request_builder.go | 88 + ...tions_runners_downloads_request_builder.go | 60 + ...rs_generate_jitconfig_post_request_body.go | 175 + ...unners_generate_jitconfig_post_response.go | 110 + ...ners_generate_jitconfig_request_builder.go | 67 + .../item_item_actions_runners_get_response.go | 122 + ...ons_runners_item_labels_delete_response.go | 122 + ...ctions_runners_item_labels_get_response.go | 122 + ...m_labels_item_with_name_delete_response.go | 122 + ...s_runners_item_labels_post_request_body.go | 86 + ...tions_runners_item_labels_post_response.go | 122 + ...ns_runners_item_labels_put_request_body.go | 86 + ...ctions_runners_item_labels_put_response.go | 122 + ...ons_runners_item_labels_request_builder.go | 178 + ...m_labels_with_name_item_request_builder.go | 63 + ...ners_registration_token_request_builder.go | 57 + ...ns_runners_remove_token_request_builder.go | 57 + ...em_item_actions_runners_request_builder.go | 96 + ...ith_runner_escaped_item_request_builder.go | 84 + .../item_item_actions_runs_get_response.go | 122 + ...ons_runs_item_approvals_request_builder.go | 60 + ...ctions_runs_item_artifacts_get_response.go | 122 + ...ons_runs_item_artifacts_request_builder.go | 65 + ...ns_item_attempts_item_jobs_get_response.go | 122 + ...item_attempts_item_jobs_request_builder.go | 68 + ...item_attempts_item_logs_request_builder.go | 51 + ...ions_runs_item_attempts_request_builder.go | 34 + ...mpt_escaped_number_item_request_builder.go | 72 + ...ctions_runs_item_cancel_request_builder.go | 61 + ...protection_escaped_rule_request_builder.go | 193 ++ ..._runs_item_force_cancel_request_builder.go | 61 + ...tem_actions_runs_item_jobs_get_response.go | 122 + ..._actions_runs_item_jobs_request_builder.go | 66 + ..._actions_runs_item_logs_request_builder.go | 81 + ...g_escaped_deployments_post_request_body.go | 115 + ...ing_escaped_deployments_request_builder.go | 94 + ...tem_rerun_failed_jobs_post_request_body.go | 80 + ..._item_rerun_failed_jobs_request_builder.go | 61 + ...tions_runs_item_rerun_post_request_body.go | 80 + ...actions_runs_item_rerun_request_builder.go | 61 + .../item_item_actions_runs_request_builder.go | 92 + ...s_with_run_escaped_item_request_builder.go | 139 + .../item_item_actions_secrets_get_response.go | 122 + ...th_secret_escaped_name_put_request_body.go | 109 + ...ions_secrets_public_key_request_builder.go | 57 + ...em_item_actions_secrets_request_builder.go | 80 + ...ecret_escaped_name_item_request_builder.go | 110 + ...tem_item_actions_variables_get_response.go | 122 + ...ables_item_with_name_patch_request_body.go | 109 + ...tem_actions_variables_post_request_body.go | 109 + ..._item_actions_variables_request_builder.go | 107 + ...ariables_with_name_item_request_builder.go | 105 + ...tem_item_actions_workflows_get_response.go | 122 + ..._workflows_item_disable_request_builder.go | 51 + ...flows_item_dispatches_post_request_body.go | 109 + ...atches_post_request_body_escaped_inputs.go | 52 + ...rkflows_item_dispatches_request_builder.go | 55 + ...s_workflows_item_enable_request_builder.go | 51 + ...ctions_workflows_item_runs_get_response.go | 122 + ...ons_workflows_item_runs_request_builder.go | 81 + ..._item_actions_workflows_request_builder.go | 74 + ...h_workflow_escaped_item_request_builder.go | 77 + .../item_item_activity_request_builder.go | 84 + .../item_item_assignees_request_builder.go | 83 + ...nees_with_assignee_item_request_builder.go | 57 + .../item_item_autolinks_post_request_body.go | 138 + .../item_item_autolinks_request_builder.go | 106 + ...h_autolink_escaped_item_request_builder.go | 88 + ...utomated_security_fixes_request_builder.go | 57 + ..._enforce_escaped_admins_request_builder.go | 111 + ...anches_item_protection_put_request_body.go | 370 ++ ..._required_escaped_status_escaped_checks.go | 160 + ...n_put_request_body_escaped_restrictions.go | 157 + ...ranches_item_protection_request_builder.go | 152 + ...ired_escaped_signatures_request_builder.go | 119 + ...escaped_checks_contexts_request_builder.go | 577 ++++ ...tatus_escaped_checks_patch_request_body.go | 159 + ...d_status_escaped_checks_request_builder.go | 125 + ...ctions_apps_delete_request_body_member1.go | 86 + ...rictions_apps_post_request_body_member1.go | 86 + ...trictions_apps_put_request_body_member1.go | 86 + ...ction_restrictions_apps_request_builder.go | 569 +++ ...protection_restrictions_request_builder.go | 98 + ...tions_teams_delete_request_body_member1.go | 86 + ...ictions_teams_post_request_body_member1.go | 86 + ...rictions_teams_put_request_body_member1.go | 86 + ...tion_restrictions_teams_request_builder.go | 569 +++ ...tions_users_delete_request_body_member1.go | 86 + ...ictions_users_post_request_body_member1.go | 86 + ...rictions_users_put_request_body_member1.go | 86 + ...tion_restrictions_users_request_builder.go | 569 +++ ..._branches_item_rename_post_request_body.go | 80 + ...em_branches_item_rename_request_builder.go | 69 + .../item_item_branches_request_builder.go | 84 + ...anches_with_branch_item_request_builder.go | 70 + ...k_runs_item_annotations_request_builder.go | 67 + ...eck_runs_item_rerequest_request_builder.go | 65 + ..._run_escaped_patch_request_body_member1.go | 51 + ..._run_escaped_patch_request_body_member2.go | 51 + ...em_check_runs_post_request_body_member1.go | 51 + ...em_check_runs_post_request_body_member2.go | 51 + .../item_item_check_runs_request_builder.go | 192 ++ ...scaped_run_escaped_item_request_builder.go | 235 ++ ...eck_suites_item_check_runs_get_response.go | 122 + ..._suites_item_check_runs_request_builder.go | 70 + ...k_suites_item_rerequest_request_builder.go | 57 + ...tem_item_check_suites_post_request_body.go | 80 + ...k_suites_preferences_patch_request_body.go | 92 + ...ped_auto_escaped_trigger_escaped_checks.go | 109 + ...heck_suites_preferences_request_builder.go | 61 + .../item_item_check_suites_request_builder.go | 77 + ...aped_suite_escaped_item_request_builder.go | 67 + ...g_alerts_item_instances_request_builder.go | 77 + ...alert_escaped_number_patch_request_body.go | 141 + ...em_code_scanning_alerts_request_builder.go | 101 + ...ert_escaped_number_item_request_builder.go | 109 + ..._code_scanning_analyses_request_builder.go | 99 + ...h_analysis_escaped_item_request_builder.go | 107 + ..._scanning_default_setup_request_builder.go | 106 + ...item_item_code_scanning_request_builder.go | 43 + ..._code_scanning_sarifs_post_request_body.go | 207 ++ ...em_code_scanning_sarifs_request_builder.go | 81 + ...with_sarif_escaped_item_request_builder.go | 63 + ..._item_codeowners_errors_request_builder.go | 62 + .../item_item_codeowners_request_builder.go | 28 + ...orators_item_permission_request_builder.go | 61 + ...ors_item_with_username_put_request_body.go | 82 + ...item_item_collaborators_request_builder.go | 88 + ...tors_with_username_item_request_builder.go | 119 + ...mments_item_reactions_post_request_body.go | 51 + ...comments_item_reactions_request_builder.go | 120 + ...h_reaction_escaped_item_request_builder.go | 51 + ...with_comment_escaped_patch_request_body.go | 80 + .../item_item_comments_request_builder.go | 78 + ...th_comment_escaped_item_request_builder.go | 127 + ...commit_escaped_sha_item_request_builder.go | 111 + ...tem_branches_where_head_request_builder.go | 66 + ...em_commits_item_check_runs_get_response.go | 122 + ...commits_item_check_runs_request_builder.go | 71 + ..._commits_item_check_suites_get_response.go | 122 + ...mmits_item_check_suites_request_builder.go | 67 + ...commits_item_comments_post_request_body.go | 167 + ...m_commits_item_comments_request_builder.go | 104 + ...item_commits_item_pulls_request_builder.go | 71 + ...tem_commits_item_status_request_builder.go | 68 + ...m_commits_item_statuses_request_builder.go | 67 + .../item_item_commits_request_builder.go | 102 + .../item_item_compare_request_builder.go | 35 + ...pare_with_basehead_item_request_builder.go | 72 + ...ents_item_with_path_delete_request_body.go | 196 ++ ...path_delete_request_body_escaped_author.go | 110 + ...h_delete_request_body_escaped_committer.go | 110 + ...ontents_item_with_path_put_request_body.go | 225 ++ ...th_path_put_request_body_escaped_author.go | 139 + ...path_put_request_body_escaped_committer.go | 139 + .../item_item_contents_request_builder.go | 35 + ...contents_with_path_item_request_builder.go | 284 ++ .../item_item_contributors_request_builder.go | 75 + ...alert_escaped_number_patch_request_body.go | 61 + ..._item_dependabot_alerts_request_builder.go | 115 + ...ert_escaped_number_item_request_builder.go | 106 + .../item_item_dependabot_request_builder.go | 33 + ...em_item_dependabot_secrets_get_response.go | 122 + ...th_secret_escaped_name_put_request_body.go | 109 + ...abot_secrets_public_key_request_builder.go | 57 + ...item_dependabot_secrets_request_builder.go | 80 + ...ecret_escaped_name_item_request_builder.go | 110 + ...ependency_graph_compare_request_builder.go | 35 + ...pare_with_basehead_item_request_builder.go | 71 + ...m_item_dependency_graph_request_builder.go | 38 + ...m_dependency_graph_sbom_request_builder.go | 63 + ...ependency_graph_snapshots_post_response.go | 167 + ...endency_graph_snapshots_request_builder.go | 61 + ...oyments_item_statuses_post_request_body.go | 225 ++ ...ployments_item_statuses_request_builder.go | 117 + ...ith_status_escaped_item_request_builder.go | 61 + ...item_item_deployments_post_request_body.go | 322 ++ .../item_item_deployments_request_builder.go | 121 + ...deployment_escaped_item_request_builder.go | 94 + .../item_item_dispatches_post_request_body.go | 109 + ...est_body_escaped_client_escaped_payload.go | 52 + .../item_item_dispatches_request_builder.go | 63 + .../item_item_environments_get_response.go | 122 + ...deployment_branch_policies_get_response.go | 122 + ...loyment_branch_policies_request_builder.go | 106 + ...tection_escaped_rules_apps_get_response.go | 122 + ...tion_escaped_rules_apps_request_builder.go | 63 + ...d_protection_escaped_rules_get_response.go | 122 + ...tection_escaped_rules_post_request_body.go | 80 + ...rotection_escaped_rules_request_builder.go | 104 + ..._environments_item_secrets_get_response.go | 122 + ...th_secret_escaped_name_put_request_body.go | 109 + ...item_secrets_public_key_request_builder.go | 57 + ...vironments_item_secrets_request_builder.go | 80 + ...ecret_escaped_name_item_request_builder.go | 110 + ...nvironments_item_variables_get_response.go | 122 + ...ables_item_with_name_patch_request_body.go | 109 + ...nments_item_variables_post_request_body.go | 109 + ...ronments_item_variables_request_builder.go | 107 + ...ariables_with_name_item_request_builder.go | 105 + ...vironment_escaped_name_put_request_body.go | 161 + ...name_put_request_body_escaped_reviewers.go | 111 + .../item_item_environments_request_builder.go | 75 + ...nment_escaped_name_item_request_builder.go | 134 + .../repos/item_item_events_request_builder.go | 67 + .../item_item_forks_post_request_body.go | 138 + .../repos/item_item_forks_request_builder.go | 114 + .../item_item_generate_post_request_body.go | 196 ++ .../item_item_generate_request_builder.go | 61 + .../item_item_git_blobs_post_request_body.go | 111 + .../item_item_git_blobs_request_builder.go | 80 + ...h_file_escaped_sha_item_request_builder.go | 67 + ...item_item_git_commits_post_request_body.go | 231 ++ ...ommits_post_request_body_escaped_author.go | 140 + ...its_post_request_body_escaped_committer.go | 140 + .../item_item_git_commits_request_builder.go | 81 + ...commit_escaped_sha_item_request_builder.go | 63 + ..._item_git_matching_refs_request_builder.go | 35 + ...hing_refs_with_ref_item_request_builder.go | 64 + .../item_item_git_ref_request_builder.go | 35 + ...m_git_ref_with_ref_item_request_builder.go | 63 + ...t_refs_item_with_ref_patch_request_body.go | 109 + .../item_item_git_refs_post_request_body.go | 109 + .../item_item_git_refs_request_builder.go | 79 + ..._git_refs_with_ref_item_request_builder.go | 96 + .../repos/item_item_git_request_builder.go | 58 + .../item_item_git_tags_post_request_body.go | 167 + ...t_tags_post_request_body_escaped_tagger.go | 140 + .../item_item_git_tags_request_builder.go | 79 + ...th_tag_escaped_sha_item_request_builder.go | 63 + .../item_item_git_trees_post_request_body.go | 121 + ...it_trees_post_request_body_escaped_tree.go | 138 + .../item_item_git_trees_request_builder.go | 83 + ...h_tree_escaped_sha_item_request_builder.go | 70 + ...em_hooks_item_config_patch_request_body.go | 149 + ..._item_hooks_item_config_request_builder.go | 88 + ..._deliveries_item_attempts_post_response.go | 51 + ...eliveries_item_attempts_request_builder.go | 63 + ...m_hooks_item_deliveries_request_builder.go | 85 + ...h_delivery_escaped_item_request_builder.go | 68 + ...m_item_hooks_item_pings_request_builder.go | 57 + ...m_item_hooks_item_tests_request_builder.go | 57 + ...em_with_hook_escaped_patch_request_body.go | 215 ++ .../item_item_hooks_post_request_body.go | 154 + ..._hooks_post_request_body_escaped_config.go | 169 + .../repos/item_item_hooks_request_builder.go | 121 + ..._with_hook_escaped_item_request_builder.go | 144 + .../item_item_installation_request_builder.go | 61 + ...h_invitation_escaped_patch_request_body.go | 51 + .../item_item_invitations_request_builder.go | 78 + ...invitation_escaped_item_request_builder.go | 81 + ...mments_item_reactions_post_request_body.go | 51 + ...comments_item_reactions_request_builder.go | 120 + ...h_reaction_escaped_item_request_builder.go | 51 + ...with_comment_escaped_patch_request_body.go | 80 + ...em_item_issues_comments_request_builder.go | 92 + ...th_comment_escaped_item_request_builder.go | 123 + ...item_item_issues_events_request_builder.go | 82 + ...with_event_escaped_item_request_builder.go | 65 + ...sues_item_assignees_delete_request_body.go | 86 + ...issues_item_assignees_post_request_body.go | 86 + ...m_issues_item_assignees_request_builder.go | 104 + ...nees_with_assignee_item_request_builder.go | 57 + ..._issues_item_comments_post_request_body.go | 80 + ...em_issues_item_comments_request_builder.go | 117 + ...item_issues_item_events_request_builder.go | 71 + ...s_item_labels_post_request_body_member1.go | 86 + ...s_item_labels_post_request_body_member2.go | 92 + ...ost_request_body_member2_escaped_labels.go | 80 + ...s_item_labels_post_request_body_member3.go | 51 + ...es_item_labels_put_request_body_member1.go | 86 + ...es_item_labels_put_request_body_member2.go | 92 + ...put_request_body_member2_escaped_labels.go | 80 + ...es_item_labels_put_request_body_member3.go | 51 + ...item_issues_item_labels_request_builder.go | 671 ++++ ...m_labels_with_name_item_request_builder.go | 66 + ..._item_issues_item_lock_put_request_body.go | 51 + ...m_item_issues_item_lock_request_builder.go | 96 + ...issues_item_reactions_post_request_body.go | 51 + ...m_issues_item_reactions_request_builder.go | 122 + ...h_reaction_escaped_item_request_builder.go | 51 + ...em_issues_item_timeline_request_builder.go | 73 + ...issue_escaped_number_patch_request_body.go | 425 +++ .../item_item_issues_post_request_body.go | 425 +++ .../repos/item_item_issues_request_builder.go | 159 + ...sue_escaped_number_item_request_builder.go | 141 + .../repos/item_item_keys_post_request_body.go | 138 + .../repos/item_item_keys_request_builder.go | 112 + ...s_with_key_escaped_item_request_builder.go | 82 + ...abels_item_with_name_patch_request_body.go | 138 + .../item_item_labels_post_request_body.go | 138 + .../repos/item_item_labels_request_builder.go | 120 + ...m_labels_with_name_item_request_builder.go | 114 + .../item_item_languages_request_builder.go | 57 + .../repos/item_item_lfs_put_response.go | 51 + .../repos/item_item_lfs_request_builder.go | 78 + .../item_item_license_request_builder.go | 66 + ...m_item_merge_upstream_post_request_body.go | 80 + ...tem_item_merge_upstream_request_builder.go | 61 + .../item_item_merges_post_request_body.go | 138 + .../repos/item_item_merges_request_builder.go | 66 + ..._milestones_item_labels_request_builder.go | 67 + ...stone_escaped_number_patch_request_body.go | 139 + .../item_item_milestones_post_request_body.go | 139 + .../item_item_milestones_request_builder.go | 126 + ...one_escaped_number_item_request_builder.go | 123 + ...tem_item_notifications_put_request_body.go | 81 + .../item_item_notifications_put_response.go | 109 + ...item_item_notifications_request_builder.go | 107 + ...tem_pages_builds_latest_request_builder.go | 57 + .../item_item_pages_builds_request_builder.go | 110 + ...with_build_escaped_item_request_builder.go | 57 + ...deployments_item_cancel_request_builder.go | 57 + ...tem_pages_deployments_post_request_body.go | 172 + ..._item_pages_deployments_request_builder.go | 80 + ...deployment_escaped_item_request_builder.go | 66 + .../item_item_pages_post_request_body.go | 81 + ..._pages_post_request_body_escaped_source.go | 81 + .../repos/item_item_pages_put_request_body.go | 222 ++ ...put_request_body_escaped_source_member1.go | 81 + .../repos/item_item_pages_request_builder.go | 174 + ...escaped_hook_escaped_patch_request_body.go | 51 + ..._item_pre_receive_hooks_request_builder.go | 82 + ...caped_hook_escaped_item_request_builder.go | 114 + .../item_item_projects_post_request_body.go | 109 + .../item_item_projects_request_builder.go | 125 + .../item_item_properties_request_builder.go | 28 + ...em_properties_values_patch_request_body.go | 93 + ..._item_properties_values_request_builder.go | 101 + ...mments_item_reactions_post_request_body.go | 51 + ...comments_item_reactions_request_builder.go | 120 + ...h_reaction_escaped_item_request_builder.go | 51 + ...with_comment_escaped_patch_request_body.go | 80 + ...tem_item_pulls_comments_request_builder.go | 85 + ...th_comment_escaped_item_request_builder.go | 124 + ...comments_item_replies_post_request_body.go | 80 + ...m_comments_item_replies_request_builder.go | 65 + ...m_pulls_item_comments_post_request_body.go | 257 ++ ...tem_pulls_item_comments_request_builder.go | 123 + ...th_comment_escaped_item_request_builder.go | 28 + ...item_pulls_item_commits_request_builder.go | 67 + ...m_item_pulls_item_files_request_builder.go | 75 + ..._item_pulls_item_merge_put_request_body.go | 138 + ...m_item_pulls_item_merge_request_builder.go | 95 + ...item_pull_request_merge_result405_error.go | 117 + ...item_pull_request_merge_result409_error.go | 117 + ...d_escaped_reviewers_delete_request_body.go | 121 + ...ted_escaped_reviewers_post_request_body.go | 121 + ...ested_escaped_reviewers_request_builder.go | 127 + ...m_reviews_item_comments_request_builder.go | 71 + ...eviews_item_dismissals_put_request_body.go | 80 + ...reviews_item_dismissals_request_builder.go | 67 + ...m_reviews_item_events_post_request_body.go | 80 + ...tem_reviews_item_events_request_builder.go | 69 + ...em_with_review_escaped_put_request_body.go | 80 + ...em_pulls_item_reviews_post_request_body.go | 150 + ...iews_post_request_body_escaped_comments.go | 254 ++ ...item_pulls_item_reviews_request_builder.go | 115 + ...ith_review_escaped_item_request_builder.go | 144 + ...lls_item_update_branch_put_request_body.go | 80 + ...m_pulls_item_update_branch_put_response.go | 109 + ...ulls_item_update_branch_request_builder.go | 67 + ..._pull_escaped_number_patch_request_body.go | 167 + .../item_item_pulls_post_request_body.go | 283 ++ .../repos/item_item_pulls_request_builder.go | 135 + ...ull_escaped_number_item_request_builder.go | 139 + .../repos/item_item_readme_request_builder.go | 80 + ...em_readme_with_dir_item_request_builder.go | 68 + ...m_with_asset_escaped_patch_request_body.go | 138 + ...em_item_releases_assets_request_builder.go | 34 + ...with_asset_escaped_item_request_builder.go | 113 + ...leases_generate_notes_post_request_body.go | 167 + ...releases_generate_notes_request_builder.go | 65 + ...em_releases_item_assets_request_builder.go | 99 + ...leases_item_reactions_post_request_body.go | 51 + ...releases_item_reactions_request_builder.go | 120 + ...h_reaction_escaped_item_request_builder.go | 51 + ...with_release_escaped_patch_request_body.go | 225 ++ ...em_item_releases_latest_request_builder.go | 57 + .../item_item_releases_post_request_body.go | 254 ++ .../item_item_releases_request_builder.go | 137 + ...item_item_releases_tags_request_builder.go | 35 + ...ases_tags_with_tag_item_request_builder.go | 61 + ...th_release_escaped_item_request_builder.go | 120 + pkg/github/repos/item_item_replicas_caches.go | 139 + .../item_item_replicas_caches_escaped_git.go | 81 + ...em_item_replicas_caches_request_builder.go | 73 + .../item_item_replicas_request_builder.go | 28 + pkg/github/repos/item_item_repo403_error.go | 117 + .../item_item_repo_patch_request_body.go | 605 ++++ ...d_security_escaped_and_escaped_analysis.go | 139 + ...tem_item_rules_branches_request_builder.go | 35 + ...anches_with_branch_item_request_builder.go | 67 + .../repos/item_item_rules_request_builder.go | 28 + ...m_with_ruleset_escaped_put_request_body.go | 222 ++ .../item_item_rulesets_post_request_body.go | 222 ++ .../item_item_rulesets_request_builder.go | 128 + ...em_rulesets_rule_suites_request_builder.go | 93 + ...aped_suite_escaped_item_request_builder.go | 63 + ...th_ruleset_escaped_item_request_builder.go | 134 + ...g_alerts_item_locations_request_builder.go | 71 + ...alert_escaped_number_patch_request_body.go | 141 + ..._secret_scanning_alerts_request_builder.go | 99 + ...ert_escaped_number_item_request_builder.go | 101 + ...em_item_secret_scanning_request_builder.go | 28 + .../item_item_stargazers_request_builder.go | 175 + .../repos/item_item_stargazers_simple_user.go | 51 + .../repos/item_item_stargazers_stargazer.go | 51 + ..._code_escaped_frequency_request_builder.go | 57 + ...commit_escaped_activity_request_builder.go | 60 + ...item_stats_contributors_request_builder.go | 60 + ...tem_stats_participation_request_builder.go | 61 + ...tats_punch_escaped_card_request_builder.go | 57 + .../repos/item_item_stats_request_builder.go | 48 + ...tatuses_item_with_sha_post_request_body.go | 140 + .../item_item_statuses_request_builder.go | 35 + ..._statuses_with_sha_item_request_builder.go | 61 + .../item_item_subscribers_request_builder.go | 67 + ...item_item_subscription_put_request_body.go | 109 + .../item_item_subscription_request_builder.go | 114 + ..._item_tags_protection_post_request_body.go | 80 + ...em_item_tags_protection_request_builder.go | 120 + ...protection_escaped_item_request_builder.go | 62 + .../repos/item_item_tags_request_builder.go | 71 + .../item_item_tarball_request_builder.go | 35 + ...m_tarball_with_ref_item_request_builder.go | 54 + .../repos/item_item_teams_request_builder.go | 71 + .../item_item_topics_put_request_body.go | 86 + .../repos/item_item_topics_request_builder.go | 103 + .../item_item_transfer_post_request_body.go | 144 + .../item_item_transfer_request_builder.go | 61 + ...em_vulnerability_alerts_request_builder.go | 95 + .../item_item_zipball_request_builder.go | 35 + ...m_zipball_with_ref_item_request_builder.go | 54 + .../repos/item_repo_item_request_builder.go | 436 +++ .../repos/owner_item_request_builder.go | 35 + pkg/github/repos/repos_request_builder.go | 35 + .../get_visibility_query_parameter_type.go | 33 + .../repositories_request_builder.go | 71 + pkg/github/scim/scim_request_builder.go | 28 + ...enterprises_item_groups_request_builder.go | 127 + ...aped_group_escaped_item_request_builder.go | 187 + ..._enterprises_item_users_request_builder.go | 125 + ...caped_user_escaped_item_request_builder.go | 182 + .../scim/v2_enterprises_request_builder.go | 35 + ...es_with_enterprise_item_request_builder.go | 33 + pkg/github/scim/v2_request_builder.go | 28 + .../code/get_order_query_parameter_type.go | 33 + .../code/get_sort_query_parameter_type.go | 30 + pkg/github/search/code_get_response.go | 151 + pkg/github/search/code_request_builder.go | 79 + .../commits/get_order_query_parameter_type.go | 33 + .../commits/get_sort_query_parameter_type.go | 33 + pkg/github/search/commits_get_response.go | 151 + pkg/github/search/commits_request_builder.go | 70 + .../issues/get_order_query_parameter_type.go | 33 + .../issues/get_sort_query_parameter_type.go | 60 + pkg/github/search/issues_get_response.go | 151 + pkg/github/search/issues_request_builder.go | 79 + .../labels/get_order_query_parameter_type.go | 33 + .../labels/get_sort_query_parameter_type.go | 33 + pkg/github/search/labels_get_response.go | 151 + pkg/github/search/labels_request_builder.go | 81 + .../get_order_query_parameter_type.go | 33 + .../get_sort_query_parameter_type.go | 39 + .../search/repositories_get_response.go | 151 + .../search/repositories_request_builder.go | 77 + pkg/github/search/search_request_builder.go | 58 + pkg/github/search/topics_get_response.go | 151 + pkg/github/search/topics_request_builder.go | 65 + .../users/get_order_query_parameter_type.go | 33 + .../users/get_sort_query_parameter_type.go | 36 + pkg/github/search/users_get_response.go | 151 + pkg/github/search/users_request_builder.go | 77 + .../setup/api_configcheck_request_builder.go | 57 + .../setup/api_configure_request_builder.go | 51 + .../api_maintenance_post_request_body.go | 80 + .../setup/api_maintenance_request_builder.go | 88 + pkg/github/setup/api_request_builder.go | 53 + ...ngs_authorized_keys_delete_request_body.go | 80 + ...tings_authorized_keys_post_request_body.go | 80 + ...ettings_authorized_keys_request_builder.go | 127 + .../setup/api_settings_put_request_body.go | 80 + .../setup/api_settings_request_builder.go | 88 + .../setup/api_start_post_request_body.go | 138 + pkg/github/setup/api_start_request_builder.go | 55 + .../setup/api_upgrade_post_request_body.go | 80 + .../setup/api_upgrade_request_builder.go | 55 + pkg/github/setup/setup_request_builder.go | 28 + .../get_direction_query_parameter_type.go | 33 + .../get_direction_query_parameter_type.go | 33 + .../get_content_query_parameter_type.go | 51 + ...tions_post_request_body_escaped_content.go | 52 + .../get_content_query_parameter_type.go | 51 + ...tions_post_request_body_escaped_content.go | 52 + .../members/get_role_query_parameter_type.go | 36 + ..._username_put_request_body_escaped_role.go | 34 + ...ped_put_request_body_escaped_permission.go | 37 + ...epo_put_request_body_escaped_permission.go | 37 + ...dy_escaped_notification_escaped_setting.go | 34 + ...d_patch_request_body_escaped_permission.go | 37 + ...aped_patch_request_body_escaped_privacy.go | 34 + ...mments_item_reactions_post_request_body.go | 51 + ...comments_item_reactions_request_builder.go | 106 + ...mment_escaped_number_patch_request_body.go | 80 + ...ussions_item_comments_post_request_body.go | 80 + ...scussions_item_comments_request_builder.go | 118 + ...ent_escaped_number_item_request_builder.go | 122 + ...ssions_item_reactions_post_request_body.go | 51 + ...cussions_item_reactions_request_builder.go | 106 + ...ssion_escaped_number_patch_request_body.go | 109 + .../item_discussions_post_request_body.go | 138 + .../teams/item_discussions_request_builder.go | 118 + ...ion_escaped_number_item_request_builder.go | 127 + .../teams/item_members_request_builder.go | 90 + ...bers_with_username_item_request_builder.go | 108 + ...ips_item_with_username_put_request_body.go | 51 + .../teams/item_memberships_request_builder.go | 36 + ...hips_with_username_item_request_builder.go | 125 + ...cts_item_with_project_escaped_403_error.go | 117 + ...m_with_project_escaped_put_request_body.go | 51 + .../teams/item_projects_request_builder.go | 86 + ...th_project_escaped_item_request_builder.go | 128 + ...os_item_item_with_repo_put_request_body.go | 51 + ...pos_item_with_repo_item_request_builder.go | 119 + .../teams/item_repos_request_builder.go | 86 + ...m_repos_with_owner_item_request_builder.go | 36 + .../teams/item_teams_request_builder.go | 78 + ...em_with_team_escaped_patch_request_body.go | 138 + pkg/github/teams/teams_request_builder.go | 35 + .../with_team_escaped_item_request_builder.go | 166 + .../user/docker_conflicts_request_builder.go | 60 + pkg/github/user/docker_request_builder.go | 28 + .../emails_delete_request_body_member1.go | 87 + .../user/emails_post_request_body_member1.go | 86 + pkg/github/user/emails_request_builder.go | 417 +++ pkg/github/user/followers_request_builder.go | 73 + pkg/github/user/following_request_builder.go | 85 + ...wing_with_username_item_request_builder.go | 122 + .../gpg_escaped_keys_post_request_body.go | 109 + .../user/gpg_escaped_keys_request_builder.go | 127 + ...scaped_key_escaped_item_request_builder.go | 98 + pkg/github/user/installations_get_response.go | 122 + ...llations_item_repositories_get_response.go | 151 + ...tions_item_repositories_request_builder.go | 81 + ...repository_escaped_item_request_builder.go | 88 + .../user/installations_request_builder.go | 81 + ...stallation_escaped_item_request_builder.go | 28 + .../get_direction_query_parameter_type.go | 33 + .../issues/get_filter_query_parameter_type.go | 45 + .../issues/get_sort_query_parameter_type.go | 36 + .../issues/get_state_query_parameter_type.go | 36 + pkg/github/user/issues_request_builder.go | 85 + pkg/github/user/keys_post_request_body.go | 109 + pkg/github/user/keys_request_builder.go | 127 + ...s_with_key_escaped_item_request_builder.go | 96 + .../orgs/get_state_query_parameter_type.go | 33 + ...th_org_patch_request_body_escaped_state.go | 31 + ...s_orgs_item_with_org_patch_request_body.go | 51 + .../user/memberships_orgs_request_builder.go | 90 + ...hips_orgs_with_org_item_request_builder.go | 102 + .../user/memberships_request_builder.go | 28 + ...tions_post_request_body_escaped_exclude.go | 31 + ...migrations_item_archive_request_builder.go | 59 + ...tions_item_repositories_request_builder.go | 71 + .../user/migrations_post_request_body.go | 289 ++ pkg/github/user/migrations_request_builder.go | 123 + ..._migration_escaped_item_request_builder.go | 33 + pkg/github/user/orgs_request_builder.go | 73 + ...ckage_escaped_type_query_parameter_type.go | 45 + .../get_visibility_query_parameter_type.go | 36 + .../get_state_query_parameter_type.go | 33 + ...kages_item_item_restore_request_builder.go | 66 + ...m_versions_item_restore_request_builder.go | 61 + ...ages_item_item_versions_request_builder.go | 89 + ...ed_version_escaped_item_request_builder.go | 93 + ...ckage_escaped_name_item_request_builder.go | 98 + pkg/github/user/packages_request_builder.go | 84 + ...ckage_escaped_type_item_request_builder.go | 35 + pkg/github/user/projects_post_request_body.go | 109 + pkg/github/user/projects_request_builder.go | 69 + .../public_escaped_emails_request_builder.go | 75 + .../get_direction_query_parameter_type.go | 33 + .../repos/get_sort_query_parameter_type.go | 39 + .../repos/get_type_query_parameter_type.go | 42 + .../get_visibility_query_parameter_type.go | 36 + ...ed_merge_escaped_commit_escaped_message.go | 37 + ...aped_merge_escaped_commit_escaped_title.go | 34 + ...ed_merge_escaped_commit_escaped_message.go | 37 + ...aped_merge_escaped_commit_escaped_title.go | 34 + pkg/github/user/repos_post_request_body.go | 602 ++++ pkg/github/user/repos_request_builder.go | 134 + ...ory_escaped_invitations_request_builder.go | 86 + ...invitation_escaped_item_request_builder.go | 90 + ...al_escaped_accounts_delete_request_body.go | 86 + ...cial_escaped_accounts_post_request_body.go | 86 + ...social_escaped_accounts_request_builder.go | 156 + ..._signing_escaped_keys_post_request_body.go | 109 + ...ed_signing_escaped_keys_request_builder.go | 127 + ...scaped_key_escaped_item_request_builder.go | 96 + .../get_direction_query_parameter_type.go | 33 + .../starred/get_sort_query_parameter_type.go | 33 + ...red_item_with_repo_item_request_builder.go | 123 + pkg/github/user/starred_request_builder.go | 90 + ...starred_with_owner_item_request_builder.go | 35 + .../user/subscriptions_request_builder.go | 73 + pkg/github/user/teams_request_builder.go | 73 + pkg/github/user/user_patch_request_body.go | 283 ++ pkg/github/user/user_request_builder.go | 304 ++ ...th_account_escaped_item_request_builder.go | 145 + ...bject_escaped_type_query_parameter_type.go | 39 + ...ckage_escaped_type_query_parameter_type.go | 45 + .../get_visibility_query_parameter_type.go | 36 + .../get_state_query_parameter_type.go | 36 + .../get_direction_query_parameter_type.go | 33 + .../repos/get_sort_query_parameter_type.go | 39 + .../repos/get_type_query_parameter_type.go | 36 + .../get_direction_query_parameter_type.go | 33 + .../starred/get_sort_query_parameter_type.go | 33 + .../item_docker_conflicts_request_builder.go | 66 + .../users/item_docker_request_builder.go | 28 + .../users/item_events_orgs_request_builder.go | 35 + ...ents_orgs_with_org_item_request_builder.go | 67 + .../item_events_public_request_builder.go | 67 + .../users/item_events_request_builder.go | 77 + .../users/item_followers_request_builder.go | 67 + .../users/item_following_request_builder.go | 79 + ...arget_escaped_user_item_request_builder.go | 50 + .../users/item_gists_request_builder.go | 74 + .../item_gpg_escaped_keys_request_builder.go | 67 + .../users/item_hovercard_request_builder.go | 71 + .../item_installation_request_builder.go | 57 + pkg/github/users/item_keys_request_builder.go | 67 + pkg/github/users/item_orgs_request_builder.go | 67 + ...kages_item_item_restore_request_builder.go | 66 + ...m_versions_item_restore_request_builder.go | 61 + ...ages_item_item_versions_request_builder.go | 79 + ...ed_version_escaped_item_request_builder.go | 93 + ...ckage_escaped_name_item_request_builder.go | 98 + .../users/item_packages_request_builder.go | 90 + ...ckage_escaped_type_item_request_builder.go | 35 + .../users/item_projects_request_builder.go | 74 + ...d_escaped_events_public_request_builder.go | 67 + ...received_escaped_events_request_builder.go | 72 + .../users/item_repos_request_builder.go | 74 + ...item_site_escaped_admin_request_builder.go | 73 + ...social_escaped_accounts_request_builder.go | 67 + ...ed_signing_escaped_keys_request_builder.go | 67 + pkg/github/users/item_starred_repository.go | 51 + .../users/item_starred_request_builder.go | 175 + .../item_subscriptions_request_builder.go | 67 + .../item_suspended_delete_request_body.go | 80 + .../users/item_suspended_put_request_body.go | 80 + .../users/item_suspended_request_builder.go | 81 + pkg/github/users/users_request_builder.go | 79 + .../with_username_item_request_builder.go | 245 ++ pkg/github/zen/zen_request_builder.go | 56 + pkg/handlers/rate_limit_handler.go | 177 + pkg/handlers/rate_limit_handler_test.go | 463 +++ pkg/headers/header_contents.go | 23 + script/lint.sh | 9 + 2435 files changed, 337515 insertions(+), 3 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/bug.yml create mode 100644 .github/ISSUE_TEMPLATE/documentation.yml create mode 100644 .github/ISSUE_TEMPLATE/feature.yml create mode 100644 .github/ISSUE_TEMPLATE/maintenance.yml create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/add_to_octokit_project.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/immediate-response.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .gitignore create mode 100644 .golangci.toml create mode 100644 .vscode/settings.json create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 cmd/app-example/main.go create mode 100644 cmd/token-example/main.go create mode 100644 go.mod create mode 100644 go.sum create mode 100644 pkg/authentication/request.go create mode 100644 pkg/authentication/token_provider.go create mode 100644 pkg/authentication/token_provider_test.go create mode 100644 pkg/client.go create mode 100644 pkg/client_test.go create mode 100644 pkg/example_test.go create mode 100644 pkg/github/admin/67ab66da8db366423ad0facdb6f8b1e5dad61229af1b0c4ac50a251cf04595be.go create mode 100644 pkg/github/admin/775bdc99ce10383000702391eba2548e0181496ff48011378ab54206e41b5a9a.go create mode 100644 pkg/github/admin/88615ee744494439a1555e2db05d17f151781caa3c7b7bf997e5acd322956f9d.go create mode 100644 pkg/github/admin/97d9df8496f487e3095e248e106c1415abd8dcbfff770ad750d5f0326e5e07dc.go create mode 100644 pkg/github/admin/9f1e533177ee8902b054b9c7820f4f7e1f5deda2df7064e47ee7eef0a78956f9.go create mode 100644 pkg/github/admin/admin_request_builder.go create mode 100644 pkg/github/admin/hooks_item_pings_request_builder.go create mode 100644 pkg/github/admin/hooks_item_with_hook_escaped_patch_request_body.go create mode 100644 pkg/github/admin/hooks_item_with_hook_escaped_patch_request_body_escaped_config.go create mode 100644 pkg/github/admin/hooks_post_request_body.go create mode 100644 pkg/github/admin/hooks_post_request_body_escaped_config.go create mode 100644 pkg/github/admin/hooks_request_builder.go create mode 100644 pkg/github/admin/hooks_with_hook_escaped_item_request_builder.go create mode 100644 pkg/github/admin/keys/get_direction_query_parameter_type.go create mode 100644 pkg/github/admin/keys/get_sort_query_parameter_type.go create mode 100644 pkg/github/admin/keys_request_builder.go create mode 100644 pkg/github/admin/keys_with_key_escaped_ids_item_request_builder.go create mode 100644 pkg/github/admin/ldap_request_builder.go create mode 100644 pkg/github/admin/ldap_teams_item_mapping_patch_request_body.go create mode 100644 pkg/github/admin/ldap_teams_item_mapping_request_builder.go create mode 100644 pkg/github/admin/ldap_teams_item_sync_post_response.go create mode 100644 pkg/github/admin/ldap_teams_item_sync_request_builder.go create mode 100644 pkg/github/admin/ldap_teams_request_builder.go create mode 100644 pkg/github/admin/ldap_teams_with_team_escaped_item_request_builder.go create mode 100644 pkg/github/admin/ldap_users_item_mapping_patch_request_body.go create mode 100644 pkg/github/admin/ldap_users_item_mapping_request_builder.go create mode 100644 pkg/github/admin/ldap_users_item_sync_post_response.go create mode 100644 pkg/github/admin/ldap_users_item_sync_request_builder.go create mode 100644 pkg/github/admin/ldap_users_request_builder.go create mode 100644 pkg/github/admin/ldap_users_with_username_item_request_builder.go create mode 100644 pkg/github/admin/organizations_item_with_org_patch_request_body.go create mode 100644 pkg/github/admin/organizations_item_with_org_patch_response.go create mode 100644 pkg/github/admin/organizations_post_request_body.go create mode 100644 pkg/github/admin/organizations_request_builder.go create mode 100644 pkg/github/admin/organizations_with_org_item_request_builder.go create mode 100644 pkg/github/admin/pre_receive_environments_item_downloads_latest_request_builder.go create mode 100644 pkg/github/admin/pre_receive_environments_item_downloads_pre_receive_environment_download_status422_error.go create mode 100644 pkg/github/admin/pre_receive_environments_item_downloads_request_builder.go create mode 100644 pkg/github/admin/pre_receive_environments_item_pre_receive_environment422_error.go create mode 100644 pkg/github/admin/pre_receive_environments_item_pre_receive_environment422_error_escaped_errors.go create mode 100644 pkg/github/admin/pre_receive_environments_item_with_pre_escaped_receive_escaped_environment_escaped_422_error.go create mode 100644 pkg/github/admin/pre_receive_environments_post_request_body.go create mode 100644 pkg/github/admin/pre_receive_environments_request_builder.go create mode 100644 pkg/github/admin/pre_receive_environments_with_pre_escaped_receive_escaped_environment_escaped_item_request_builder.go create mode 100644 pkg/github/admin/pre_receive_hooks_item_with_pre_escaped_receive_escaped_hook_escaped_patch_request_body.go create mode 100644 pkg/github/admin/pre_receive_hooks_post_request_body.go create mode 100644 pkg/github/admin/pre_receive_hooks_post_request_body_escaped_environment.go create mode 100644 pkg/github/admin/pre_receive_hooks_post_request_body_escaped_script_escaped_repository.go create mode 100644 pkg/github/admin/pre_receive_hooks_request_builder.go create mode 100644 pkg/github/admin/pre_receive_hooks_with_pre_escaped_receive_escaped_hook_escaped_item_request_builder.go create mode 100644 pkg/github/admin/prereceiveenvironments/get_direction_query_parameter_type.go create mode 100644 pkg/github/admin/prereceiveenvironments/get_sort_query_parameter_type.go create mode 100644 pkg/github/admin/prereceivehooks/get_direction_query_parameter_type.go create mode 100644 pkg/github/admin/prereceivehooks/get_sort_query_parameter_type.go create mode 100644 pkg/github/admin/tokens_request_builder.go create mode 100644 pkg/github/admin/tokens_with_token_escaped_item_request_builder.go create mode 100644 pkg/github/admin/users_item_authorizations_post_request_body.go create mode 100644 pkg/github/admin/users_item_authorizations_request_builder.go create mode 100644 pkg/github/admin/users_item_with_username_patch_request_body.go create mode 100644 pkg/github/admin/users_item_with_username_patch_response.go create mode 100644 pkg/github/admin/users_post_request_body.go create mode 100644 pkg/github/admin/users_request_builder.go create mode 100644 pkg/github/admin/users_with_username_item_request_builder.go create mode 100644 pkg/github/advisories/advisories_request_builder.go create mode 100644 pkg/github/advisories/get_direction_query_parameter_type.go create mode 100644 pkg/github/advisories/get_severity_query_parameter_type.go create mode 100644 pkg/github/advisories/get_sort_query_parameter_type.go create mode 100644 pkg/github/advisories/get_type_query_parameter_type.go create mode 100644 pkg/github/advisories/with_ghsa_escaped_item_request_builder.go create mode 100644 pkg/github/api_client.go create mode 100644 pkg/github/app/app_request_builder.go create mode 100644 pkg/github/app/hook_config_patch_request_body.go create mode 100644 pkg/github/app/hook_config_request_builder.go create mode 100644 pkg/github/app/hook_deliveries_item_attempts_post_response.go create mode 100644 pkg/github/app/hook_deliveries_item_attempts_request_builder.go create mode 100644 pkg/github/app/hook_deliveries_request_builder.go create mode 100644 pkg/github/app/hook_deliveries_with_delivery_escaped_item_request_builder.go create mode 100644 pkg/github/app/hook_request_builder.go create mode 100644 pkg/github/app/installation_requests_request_builder.go create mode 100644 pkg/github/app/installations_item_access_escaped_tokens_post_request_body.go create mode 100644 pkg/github/app/installations_item_access_escaped_tokens_request_builder.go create mode 100644 pkg/github/app/installations_item_suspended_request_builder.go create mode 100644 pkg/github/app/installations_request_builder.go create mode 100644 pkg/github/app/installations_with_installation_escaped_item_request_builder.go create mode 100644 pkg/github/applications/applications_request_builder.go create mode 100644 pkg/github/applications/grants_request_builder.go create mode 100644 pkg/github/applications/grants_with_grant_escaped_item_request_builder.go create mode 100644 pkg/github/applications/item_grant_delete_request_body.go create mode 100644 pkg/github/applications/item_grant_request_builder.go create mode 100644 pkg/github/applications/item_token_delete_request_body.go create mode 100644 pkg/github/applications/item_token_patch_request_body.go create mode 100644 pkg/github/applications/item_token_post_request_body.go create mode 100644 pkg/github/applications/item_token_request_builder.go create mode 100644 pkg/github/applications/item_token_scoped_post_request_body.go create mode 100644 pkg/github/applications/item_token_scoped_request_builder.go create mode 100644 pkg/github/applications/with_client_escaped_item_request_builder.go create mode 100644 pkg/github/appmanifests/app_manifests_request_builder.go create mode 100644 pkg/github/appmanifests/item_conversions_integration.go create mode 100644 pkg/github/appmanifests/item_conversions_request_builder.go create mode 100644 pkg/github/appmanifests/with_code_item_request_builder.go create mode 100644 pkg/github/apps/apps_request_builder.go create mode 100644 pkg/github/apps/with_app_escaped_slug_item_request_builder.go create mode 100644 pkg/github/authorizations/authorizations_post_request_body.go create mode 100644 pkg/github/authorizations/authorizations_request_builder.go create mode 100644 pkg/github/authorizations/clients_item_item_with_fingerprint_put_request_body.go create mode 100644 pkg/github/authorizations/clients_item_with_client_escaped_put_request_body.go create mode 100644 pkg/github/authorizations/clients_item_with_fingerprint_item_request_builder.go create mode 100644 pkg/github/authorizations/clients_request_builder.go create mode 100644 pkg/github/authorizations/clients_with_client_escaped_item_request_builder.go create mode 100644 pkg/github/authorizations/item_with_authorization_escaped_patch_request_body.go create mode 100644 pkg/github/authorizations/with_authorization_escaped_item_request_builder.go create mode 100644 pkg/github/codes_of_conduct/codes_escaped_of_escaped_conduct_request_builder.go create mode 100644 pkg/github/codes_of_conduct/with_key_item_request_builder.go create mode 100644 pkg/github/emojis/emojis_get_response.go create mode 100644 pkg/github/emojis/emojis_request_builder.go create mode 100644 pkg/github/enterprise/announcement_request_builder.go create mode 100644 pkg/github/enterprise/enterprise_request_builder.go create mode 100644 pkg/github/enterprise/settings_license_request_builder.go create mode 100644 pkg/github/enterprise/settings_request_builder.go create mode 100644 pkg/github/enterprise/stats_all_request_builder.go create mode 100644 pkg/github/enterprise/stats_comments_request_builder.go create mode 100644 pkg/github/enterprise/stats_gists_request_builder.go create mode 100644 pkg/github/enterprise/stats_hooks_request_builder.go create mode 100644 pkg/github/enterprise/stats_issues_request_builder.go create mode 100644 pkg/github/enterprise/stats_milestones_request_builder.go create mode 100644 pkg/github/enterprise/stats_orgs_request_builder.go create mode 100644 pkg/github/enterprise/stats_pages_request_builder.go create mode 100644 pkg/github/enterprise/stats_pulls_request_builder.go create mode 100644 pkg/github/enterprise/stats_repos_request_builder.go create mode 100644 pkg/github/enterprise/stats_request_builder.go create mode 100644 pkg/github/enterprise/stats_security_products_request_builder.go create mode 100644 pkg/github/enterprise/stats_users_request_builder.go create mode 100644 pkg/github/enterprises/enterprises_request_builder.go create mode 100644 pkg/github/enterprises/item/actions/runnergroups/item/with_runner_escaped_group_escaped_patch_request_body_escaped_visibility.go create mode 100644 pkg/github/enterprises/item/actions/runnergroups/runner_groups_post_request_body_escaped_visibility.go create mode 100644 pkg/github/enterprises/item/auditlog/get_include_query_parameter_type.go create mode 100644 pkg/github/enterprises/item/auditlog/get_order_query_parameter_type.go create mode 100644 pkg/github/enterprises/item/codescanning/alerts/get_direction_query_parameter_type.go create mode 100644 pkg/github/enterprises/item/codescanning/alerts/get_sort_query_parameter_type.go create mode 100644 pkg/github/enterprises/item/dependabot/alerts/get_direction_query_parameter_type.go create mode 100644 pkg/github/enterprises/item/dependabot/alerts/get_scope_query_parameter_type.go create mode 100644 pkg/github/enterprises/item/dependabot/alerts/get_sort_query_parameter_type.go create mode 100644 pkg/github/enterprises/item/secretscanning/alerts/get_direction_query_parameter_type.go create mode 100644 pkg/github/enterprises/item/secretscanning/alerts/get_sort_query_parameter_type.go create mode 100644 pkg/github/enterprises/item/secretscanning/alerts/get_state_query_parameter_type.go create mode 100644 pkg/github/enterprises/item_actions_cache_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_cache_usage_policy_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_cache_usage_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_permissions_organizations_get_response.go create mode 100644 pkg/github/enterprises/item_actions_permissions_organizations_put_request_body.go create mode 100644 pkg/github/enterprises/item_actions_permissions_organizations_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_permissions_organizations_with_org_escaped_item_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_permissions_put_request_body.go create mode 100644 pkg/github/enterprises/item_actions_permissions_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_permissions_selected_actions_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_permissions_workflow_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_runner_groups_get_response.go create mode 100644 pkg/github/enterprises/item_actions_runner_groups_item_organizations_get_response.go create mode 100644 pkg/github/enterprises/item_actions_runner_groups_item_organizations_put_request_body.go create mode 100644 pkg/github/enterprises/item_actions_runner_groups_item_organizations_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_runner_groups_item_organizations_with_org_escaped_item_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_runner_groups_item_runners_get_response.go create mode 100644 pkg/github/enterprises/item_actions_runner_groups_item_runners_put_request_body.go create mode 100644 pkg/github/enterprises/item_actions_runner_groups_item_runners_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_runner_groups_item_runners_with_runner_escaped_item_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_runner_groups_item_with_runner_escaped_group_escaped_patch_request_body.go create mode 100644 pkg/github/enterprises/item_actions_runner_groups_post_request_body.go create mode 100644 pkg/github/enterprises/item_actions_runner_groups_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_runner_groups_with_runner_escaped_group_escaped_item_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_runners_downloads_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_runners_generate_jitconfig_post_request_body.go create mode 100644 pkg/github/enterprises/item_actions_runners_generate_jitconfig_post_response.go create mode 100644 pkg/github/enterprises/item_actions_runners_generate_jitconfig_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_runners_get_response.go create mode 100644 pkg/github/enterprises/item_actions_runners_item_labels_delete_response.go create mode 100644 pkg/github/enterprises/item_actions_runners_item_labels_get_response.go create mode 100644 pkg/github/enterprises/item_actions_runners_item_labels_item_with_name_delete_response.go create mode 100644 pkg/github/enterprises/item_actions_runners_item_labels_post_request_body.go create mode 100644 pkg/github/enterprises/item_actions_runners_item_labels_post_response.go create mode 100644 pkg/github/enterprises/item_actions_runners_item_labels_put_request_body.go create mode 100644 pkg/github/enterprises/item_actions_runners_item_labels_put_response.go create mode 100644 pkg/github/enterprises/item_actions_runners_item_labels_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_runners_item_labels_with_name_item_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_runners_registration_token_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_runners_remove_token_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_runners_request_builder.go create mode 100644 pkg/github/enterprises/item_actions_runners_with_runner_escaped_item_request_builder.go create mode 100644 pkg/github/enterprises/item_audit_log_request_builder.go create mode 100644 pkg/github/enterprises/item_code_escaped_security_escaped_and_escaped_analysis_patch_request_body.go create mode 100644 pkg/github/enterprises/item_code_escaped_security_escaped_and_escaped_analysis_request_builder.go create mode 100644 pkg/github/enterprises/item_code_scanning_alerts_request_builder.go create mode 100644 pkg/github/enterprises/item_code_scanning_request_builder.go create mode 100644 pkg/github/enterprises/item_dependabot_alerts_request_builder.go create mode 100644 pkg/github/enterprises/item_dependabot_request_builder.go create mode 100644 pkg/github/enterprises/item_item_with_enablement_item_request_builder.go create mode 100644 pkg/github/enterprises/item_secret_scanning_alerts_request_builder.go create mode 100644 pkg/github/enterprises/item_secret_scanning_request_builder.go create mode 100644 pkg/github/enterprises/item_settings_billing_advanced_security_request_builder.go create mode 100644 pkg/github/enterprises/item_settings_billing_request_builder.go create mode 100644 pkg/github/enterprises/item_settings_request_builder.go create mode 100644 pkg/github/enterprises/item_with_security_escaped_product_item_request_builder.go create mode 100644 pkg/github/enterprises/with_enterprise_item_request_builder.go create mode 100644 pkg/github/events/events_request_builder.go create mode 100644 pkg/github/feeds/feeds_request_builder.go create mode 100644 pkg/github/gists/gists_post_request_body.go create mode 100644 pkg/github/gists/gists_post_request_body_escaped_files.go create mode 100644 pkg/github/gists/gists_request_builder.go create mode 100644 pkg/github/gists/item_comments_item_with_comment_escaped_patch_request_body.go create mode 100644 pkg/github/gists/item_comments_post_request_body.go create mode 100644 pkg/github/gists/item_comments_request_builder.go create mode 100644 pkg/github/gists/item_comments_with_comment_escaped_item_request_builder.go create mode 100644 pkg/github/gists/item_commits_request_builder.go create mode 100644 pkg/github/gists/item_forks_request_builder.go create mode 100644 pkg/github/gists/item_star404_error.go create mode 100644 pkg/github/gists/item_star_request_builder.go create mode 100644 pkg/github/gists/item_with_gist_escaped_patch_request_body.go create mode 100644 pkg/github/gists/item_with_gist_escaped_patch_request_body_escaped_files.go create mode 100644 pkg/github/gists/item_with_sha_item_request_builder.go create mode 100644 pkg/github/gists/public_request_builder.go create mode 100644 pkg/github/gists/starred_request_builder.go create mode 100644 pkg/github/gists/with_gist_escaped_item_request_builder.go create mode 100644 pkg/github/gitignore/gitignore_request_builder.go create mode 100644 pkg/github/gitignore/templates_request_builder.go create mode 100644 pkg/github/gitignore/templates_with_name_item_request_builder.go create mode 100644 pkg/github/installation/installation_request_builder.go create mode 100644 pkg/github/installation/repositories_get_response.go create mode 100644 pkg/github/installation/repositories_request_builder.go create mode 100644 pkg/github/installation/token_request_builder.go create mode 100644 pkg/github/issues/get_direction_query_parameter_type.go create mode 100644 pkg/github/issues/get_filter_query_parameter_type.go create mode 100644 pkg/github/issues/get_sort_query_parameter_type.go create mode 100644 pkg/github/issues/get_state_query_parameter_type.go create mode 100644 pkg/github/issues/issues_request_builder.go create mode 100644 pkg/github/kiota-lock.json create mode 100644 pkg/github/licenses/licenses_request_builder.go create mode 100644 pkg/github/licenses/with_license_item_request_builder.go create mode 100644 pkg/github/manage/manage_request_builder.go create mode 100644 pkg/github/manage/v1_access_request_builder.go create mode 100644 pkg/github/manage/v1_access_ssh_request_builder.go create mode 100644 pkg/github/manage/v1_checks_request_builder.go create mode 100644 pkg/github/manage/v1_checks_system_requirements_request_builder.go create mode 100644 pkg/github/manage/v1_cluster_request_builder.go create mode 100644 pkg/github/manage/v1_cluster_status_request_builder.go create mode 100644 pkg/github/manage/v1_config_apply_events_get_response.go create mode 100644 pkg/github/manage/v1_config_apply_events_get_response_escaped_nodes.go create mode 100644 pkg/github/manage/v1_config_apply_events_get_response_escaped_nodes_escaped_events.go create mode 100644 pkg/github/manage/v1_config_apply_events_request_builder.go create mode 100644 pkg/github/manage/v1_config_apply_get_response.go create mode 100644 pkg/github/manage/v1_config_apply_get_response_escaped_nodes.go create mode 100644 pkg/github/manage/v1_config_apply_post_request_body.go create mode 100644 pkg/github/manage/v1_config_apply_post_response.go create mode 100644 pkg/github/manage/v1_config_apply_request_builder.go create mode 100644 pkg/github/manage/v1_config_init_request_builder.go create mode 100644 pkg/github/manage/v1_config_license_check_request_builder.go create mode 100644 pkg/github/manage/v1_config_license_request_builder.go create mode 100644 pkg/github/manage/v1_config_nodes_request_builder.go create mode 100644 pkg/github/manage/v1_config_request_builder.go create mode 100644 pkg/github/manage/v1_config_settings_put_request_body.go create mode 100644 pkg/github/manage/v1_config_settings_request_builder.go create mode 100644 pkg/github/manage/v1_maintenance_request_builder.go create mode 100644 pkg/github/manage/v1_replication_request_builder.go create mode 100644 pkg/github/manage/v1_replication_status_request_builder.go create mode 100644 pkg/github/manage/v1_request_builder.go create mode 100644 pkg/github/manage/v1_version_request_builder.go create mode 100644 pkg/github/markdown/markdown_post_request_body.go create mode 100644 pkg/github/markdown/markdown_post_request_body_escaped_mode.go create mode 100644 pkg/github/markdown/markdown_request_builder.go create mode 100644 pkg/github/markdown/raw_request_builder.go create mode 100644 pkg/github/meta/meta_request_builder.go create mode 100644 pkg/github/models/308da9774f804d8be6f3099a760ee922cd911e0ad8ef4aea285bf52ed3099627.go create mode 100644 pkg/github/models/actions_cache_list.go create mode 100644 pkg/github/models/actions_cache_list_escaped_actions_escaped_caches.go create mode 100644 pkg/github/models/actions_cache_usage_by_repository.go create mode 100644 pkg/github/models/actions_cache_usage_org_enterprise.go create mode 100644 pkg/github/models/actions_cache_usage_policy_enterprise.go create mode 100644 pkg/github/models/actions_cache_usage_policy_for_repository.go create mode 100644 pkg/github/models/actions_default_workflow_permissions.go create mode 100644 pkg/github/models/actions_enterprise_permissions.go create mode 100644 pkg/github/models/actions_get_default_workflow_permissions.go create mode 100644 pkg/github/models/actions_organization_permissions.go create mode 100644 pkg/github/models/actions_public_key.go create mode 100644 pkg/github/models/actions_repository_permissions.go create mode 100644 pkg/github/models/actions_secret.go create mode 100644 pkg/github/models/actions_set_default_workflow_permissions.go create mode 100644 pkg/github/models/actions_variable.go create mode 100644 pkg/github/models/actions_workflow_access_to_repository.go create mode 100644 pkg/github/models/actions_workflow_access_to_repository_escaped_access_escaped_level.go create mode 100644 pkg/github/models/activity.go create mode 100644 pkg/github/models/activity_escaped_activity_escaped_type.go create mode 100644 pkg/github/models/actor.go create mode 100644 pkg/github/models/added_to_project_issue_event.go create mode 100644 pkg/github/models/added_to_project_issue_event_escaped_project_escaped_card.go create mode 100644 pkg/github/models/advanced_security_active_committers.go create mode 100644 pkg/github/models/advanced_security_active_committers_repository.go create mode 100644 pkg/github/models/advanced_security_active_committers_user.go create mode 100644 pkg/github/models/alerts503_error.go create mode 100644 pkg/github/models/allowed_actions.go create mode 100644 pkg/github/models/analyses503_error.go create mode 100644 pkg/github/models/announcement.go create mode 100644 pkg/github/models/announcement_banner.go create mode 100644 pkg/github/models/api_overview.go create mode 100644 pkg/github/models/api_overview_escaped_domains.go create mode 100644 pkg/github/models/api_overview_escaped_domains_escaped_artifact_escaped_attestations.go create mode 100644 pkg/github/models/app_permissions.go create mode 100644 pkg/github/models/app_permissions_escaped_actions.go create mode 100644 pkg/github/models/app_permissions_escaped_administration.go create mode 100644 pkg/github/models/app_permissions_escaped_checks.go create mode 100644 pkg/github/models/app_permissions_escaped_codespaces.go create mode 100644 pkg/github/models/app_permissions_escaped_contents.go create mode 100644 pkg/github/models/app_permissions_escaped_dependabot_escaped_secrets.go create mode 100644 pkg/github/models/app_permissions_escaped_deployments.go create mode 100644 pkg/github/models/app_permissions_escaped_email_escaped_addresses.go create mode 100644 pkg/github/models/app_permissions_escaped_environments.go create mode 100644 pkg/github/models/app_permissions_escaped_followers.go create mode 100644 pkg/github/models/app_permissions_escaped_git_escaped_ssh_escaped_keys.go create mode 100644 pkg/github/models/app_permissions_escaped_gpg_escaped_keys.go create mode 100644 pkg/github/models/app_permissions_escaped_interaction_escaped_limits.go create mode 100644 pkg/github/models/app_permissions_escaped_issues.go create mode 100644 pkg/github/models/app_permissions_escaped_members.go create mode 100644 pkg/github/models/app_permissions_escaped_metadata.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_administration.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_announcement_escaped_banners.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_copilot_escaped_seat_escaped_management.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_custom_escaped_org_escaped_roles.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_custom_escaped_properties.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_custom_escaped_roles.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_events.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_hooks.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_packages.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_personal_escaped_access_escaped_token_escaped_requests.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_personal_escaped_access_escaped_tokens.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_plan.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_projects.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_secrets.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_self_escaped_hosted_escaped_runners.go create mode 100644 pkg/github/models/app_permissions_escaped_organization_escaped_user_escaped_blocking.go create mode 100644 pkg/github/models/app_permissions_escaped_packages.go create mode 100644 pkg/github/models/app_permissions_escaped_pages.go create mode 100644 pkg/github/models/app_permissions_escaped_profile.go create mode 100644 pkg/github/models/app_permissions_escaped_pull_escaped_requests.go create mode 100644 pkg/github/models/app_permissions_escaped_repository_escaped_custom_escaped_properties.go create mode 100644 pkg/github/models/app_permissions_escaped_repository_escaped_hooks.go create mode 100644 pkg/github/models/app_permissions_escaped_repository_escaped_projects.go create mode 100644 pkg/github/models/app_permissions_escaped_secret_escaped_scanning_escaped_alerts.go create mode 100644 pkg/github/models/app_permissions_escaped_secrets.go create mode 100644 pkg/github/models/app_permissions_escaped_security_escaped_events.go create mode 100644 pkg/github/models/app_permissions_escaped_single_escaped_file.go create mode 100644 pkg/github/models/app_permissions_escaped_starring.go create mode 100644 pkg/github/models/app_permissions_escaped_statuses.go create mode 100644 pkg/github/models/app_permissions_escaped_team_escaped_discussions.go create mode 100644 pkg/github/models/app_permissions_escaped_vulnerability_escaped_alerts.go create mode 100644 pkg/github/models/app_permissions_escaped_workflows.go create mode 100644 pkg/github/models/application_grant.go create mode 100644 pkg/github/models/application_grant_escaped_app.go create mode 100644 pkg/github/models/artifact.go create mode 100644 pkg/github/models/artifact_escaped_workflow_escaped_run.go create mode 100644 pkg/github/models/assigned_issue_event.go create mode 100644 pkg/github/models/audit_log_event.go create mode 100644 pkg/github/models/audit_log_event_escaped_actor_escaped_location.go create mode 100644 pkg/github/models/audit_log_event_escaped_config.go create mode 100644 pkg/github/models/audit_log_event_escaped_config_escaped_was.go create mode 100644 pkg/github/models/audit_log_event_escaped_data.go create mode 100644 pkg/github/models/audit_log_event_escaped_events.go create mode 100644 pkg/github/models/audit_log_event_escaped_events_escaped_were.go create mode 100644 pkg/github/models/authentication_token.go create mode 100644 pkg/github/models/authentication_token_escaped_permissions.go create mode 100644 pkg/github/models/authentication_token_escaped_repository_escaped_selection.go create mode 100644 pkg/github/models/author_association.go create mode 100644 pkg/github/models/authorization.go create mode 100644 pkg/github/models/authorization_escaped_app.go create mode 100644 pkg/github/models/auto_merge.go create mode 100644 pkg/github/models/auto_merge_escaped_merge_escaped_method.go create mode 100644 pkg/github/models/autolink.go create mode 100644 pkg/github/models/b72c6e1af1bcec5c809ea07762464f8551f51f3033e3a502d2d5557f57b5fb77.go create mode 100644 pkg/github/models/base_gist.go create mode 100644 pkg/github/models/base_gist_escaped_files.go create mode 100644 pkg/github/models/basic_error.go create mode 100644 pkg/github/models/blob.go create mode 100644 pkg/github/models/branch_protection.go create mode 100644 pkg/github/models/branch_protection_escaped_allow_escaped_deletions.go create mode 100644 pkg/github/models/branch_protection_escaped_allow_escaped_force_escaped_pushes.go create mode 100644 pkg/github/models/branch_protection_escaped_allow_escaped_fork_escaped_syncing.go create mode 100644 pkg/github/models/branch_protection_escaped_block_escaped_creations.go create mode 100644 pkg/github/models/branch_protection_escaped_lock_escaped_branch.go create mode 100644 pkg/github/models/branch_protection_escaped_required_escaped_conversation_escaped_resolution.go create mode 100644 pkg/github/models/branch_protection_escaped_required_escaped_linear_escaped_history.go create mode 100644 pkg/github/models/branch_protection_escaped_required_escaped_signatures.go create mode 100644 pkg/github/models/branch_restriction_policy.go create mode 100644 pkg/github/models/branch_restriction_policy_escaped_apps.go create mode 100644 pkg/github/models/branch_restriction_policy_escaped_apps_escaped_owner.go create mode 100644 pkg/github/models/branch_restriction_policy_escaped_apps_escaped_permissions.go create mode 100644 pkg/github/models/branch_restriction_policy_escaped_teams.go create mode 100644 pkg/github/models/branch_restriction_policy_escaped_users.go create mode 100644 pkg/github/models/branch_short.go create mode 100644 pkg/github/models/branch_short_escaped_commit.go create mode 100644 pkg/github/models/branch_with_protection.go create mode 100644 pkg/github/models/branch_with_protection_escaped__escaped_links.go create mode 100644 pkg/github/models/check_annotation.go create mode 100644 pkg/github/models/check_automated_security_fixes.go create mode 100644 pkg/github/models/check_run.go create mode 100644 pkg/github/models/check_run_escaped_check_escaped_suite.go create mode 100644 pkg/github/models/check_run_escaped_conclusion.go create mode 100644 pkg/github/models/check_run_escaped_output.go create mode 100644 pkg/github/models/check_run_escaped_status.go create mode 100644 pkg/github/models/check_suite.go create mode 100644 pkg/github/models/check_suite_escaped_conclusion.go create mode 100644 pkg/github/models/check_suite_escaped_status.go create mode 100644 pkg/github/models/check_suite_preference.go create mode 100644 pkg/github/models/check_suite_preference_escaped_preferences.go create mode 100644 pkg/github/models/check_suite_preference_escaped_preferences_escaped_auto_escaped_trigger_escaped_checks.go create mode 100644 pkg/github/models/code.go create mode 100644 pkg/github/models/code503_error.go create mode 100644 pkg/github/models/code_escaped_matches.go create mode 100644 pkg/github/models/code_of_conduct.go create mode 100644 pkg/github/models/code_of_conduct_simple.go create mode 100644 pkg/github/models/code_scanning_alert.go create mode 100644 pkg/github/models/code_scanning_alert503_error.go create mode 100644 pkg/github/models/code_scanning_alert_classification.go create mode 100644 pkg/github/models/code_scanning_alert_dismissed_reason.go create mode 100644 pkg/github/models/code_scanning_alert_instance.go create mode 100644 pkg/github/models/code_scanning_alert_instance_escaped_message.go create mode 100644 pkg/github/models/code_scanning_alert_items.go create mode 100644 pkg/github/models/code_scanning_alert_location.go create mode 100644 pkg/github/models/code_scanning_alert_rule.go create mode 100644 pkg/github/models/code_scanning_alert_rule_escaped_security_escaped_severity_escaped_level.go create mode 100644 pkg/github/models/code_scanning_alert_rule_escaped_severity.go create mode 100644 pkg/github/models/code_scanning_alert_rule_summary.go create mode 100644 pkg/github/models/code_scanning_alert_rule_summary_escaped_security_escaped_severity_escaped_level.go create mode 100644 pkg/github/models/code_scanning_alert_rule_summary_escaped_severity.go create mode 100644 pkg/github/models/code_scanning_alert_set_state.go create mode 100644 pkg/github/models/code_scanning_alert_severity.go create mode 100644 pkg/github/models/code_scanning_alert_state.go create mode 100644 pkg/github/models/code_scanning_alert_state_query.go create mode 100644 pkg/github/models/code_scanning_analysis.go create mode 100644 pkg/github/models/code_scanning_analysis503_error.go create mode 100644 pkg/github/models/code_scanning_analysis_deletion.go create mode 100644 pkg/github/models/code_scanning_analysis_deletion503_error.go create mode 100644 pkg/github/models/code_scanning_analysis_tool.go create mode 100644 pkg/github/models/code_scanning_default_setup.go create mode 100644 pkg/github/models/code_scanning_default_setup503_error.go create mode 100644 pkg/github/models/code_scanning_default_setup_escaped_languages.go create mode 100644 pkg/github/models/code_scanning_default_setup_escaped_query_escaped_suite.go create mode 100644 pkg/github/models/code_scanning_default_setup_escaped_schedule.go create mode 100644 pkg/github/models/code_scanning_default_setup_escaped_state.go create mode 100644 pkg/github/models/code_scanning_default_setup_update.go create mode 100644 pkg/github/models/code_scanning_default_setup_update_escaped_languages.go create mode 100644 pkg/github/models/code_scanning_default_setup_update_escaped_query_escaped_suite.go create mode 100644 pkg/github/models/code_scanning_default_setup_update_escaped_state.go create mode 100644 pkg/github/models/code_scanning_organization_alert_items.go create mode 100644 pkg/github/models/code_scanning_sarifs_receipt.go create mode 100644 pkg/github/models/code_scanning_sarifs_receipt503_error.go create mode 100644 pkg/github/models/code_scanning_sarifs_status.go create mode 100644 pkg/github/models/code_scanning_sarifs_status503_error.go create mode 100644 pkg/github/models/code_scanning_sarifs_status_escaped_processing_escaped_status.go create mode 100644 pkg/github/models/code_search_result_item.go create mode 100644 pkg/github/models/codeowners_errors.go create mode 100644 pkg/github/models/codeowners_errors_escaped_errors.go create mode 100644 pkg/github/models/collaborator.go create mode 100644 pkg/github/models/collaborator_escaped_permissions.go create mode 100644 pkg/github/models/combined_commit_status.go create mode 100644 pkg/github/models/commit.go create mode 100644 pkg/github/models/commit503_error.go create mode 100644 pkg/github/models/commit_activity.go create mode 100644 pkg/github/models/commit_comment.go create mode 100644 pkg/github/models/commit_comparison.go create mode 100644 pkg/github/models/commit_comparison503_error.go create mode 100644 pkg/github/models/commit_comparison_escaped_status.go create mode 100644 pkg/github/models/commit_escaped_commit.go create mode 100644 pkg/github/models/commit_escaped_commit_escaped_tree.go create mode 100644 pkg/github/models/commit_escaped_parents.go create mode 100644 pkg/github/models/commit_escaped_stats.go create mode 100644 pkg/github/models/commit_search_result_item.go create mode 100644 pkg/github/models/commit_search_result_item_escaped_commit.go create mode 100644 pkg/github/models/commit_search_result_item_escaped_commit_escaped_author.go create mode 100644 pkg/github/models/commit_search_result_item_escaped_commit_escaped_tree.go create mode 100644 pkg/github/models/commit_search_result_item_escaped_parents.go create mode 100644 pkg/github/models/commits.go create mode 100644 pkg/github/models/commits_escaped_matches.go create mode 100644 pkg/github/models/configuration_status.go create mode 100644 pkg/github/models/configuration_status_escaped_progress.go create mode 100644 pkg/github/models/content_file.go create mode 100644 pkg/github/models/content_file_escaped__escaped_links.go create mode 100644 pkg/github/models/content_file_escaped_type.go create mode 100644 pkg/github/models/content_submodule.go create mode 100644 pkg/github/models/content_submodule_escaped__escaped_links.go create mode 100644 pkg/github/models/content_submodule_escaped_type.go create mode 100644 pkg/github/models/content_symlink.go create mode 100644 pkg/github/models/content_symlink_escaped__escaped_links.go create mode 100644 pkg/github/models/content_symlink_escaped_type.go create mode 100644 pkg/github/models/contributor.go create mode 100644 pkg/github/models/contributor_activity.go create mode 100644 pkg/github/models/contributor_activity_escaped_weeks.go create mode 100644 pkg/github/models/converted_note_to_issue_issue_event.go create mode 100644 pkg/github/models/converted_note_to_issue_issue_event_escaped_project_escaped_card.go create mode 100644 pkg/github/models/custom_deployment_rule_app.go create mode 100644 pkg/github/models/custom_property.go create mode 100644 pkg/github/models/custom_property_escaped_value_escaped_type.go create mode 100644 pkg/github/models/custom_property_escaped_values_escaped_editable_escaped_by.go create mode 100644 pkg/github/models/custom_property_value.go create mode 100644 pkg/github/models/cvss_severities.go create mode 100644 pkg/github/models/cvss_severities_escaped_cvss_escaped_v3.go create mode 100644 pkg/github/models/cvss_severities_escaped_cvss_escaped_v4.go create mode 100644 pkg/github/models/demilestoned_issue_event.go create mode 100644 pkg/github/models/demilestoned_issue_event_escaped_milestone.go create mode 100644 pkg/github/models/dependabot_alert.go create mode 100644 pkg/github/models/dependabot_alert_escaped_dependency.go create mode 100644 pkg/github/models/dependabot_alert_escaped_dependency_escaped_scope.go create mode 100644 pkg/github/models/dependabot_alert_escaped_dismissed_escaped_reason.go create mode 100644 pkg/github/models/dependabot_alert_escaped_state.go create mode 100644 pkg/github/models/dependabot_alert_package.go create mode 100644 pkg/github/models/dependabot_alert_security_advisory.go create mode 100644 pkg/github/models/dependabot_alert_security_advisory_escaped_cvss.go create mode 100644 pkg/github/models/dependabot_alert_security_advisory_escaped_cwes.go create mode 100644 pkg/github/models/dependabot_alert_security_advisory_escaped_identifiers.go create mode 100644 pkg/github/models/dependabot_alert_security_advisory_escaped_identifiers_escaped_type.go create mode 100644 pkg/github/models/dependabot_alert_security_advisory_escaped_references.go create mode 100644 pkg/github/models/dependabot_alert_security_advisory_escaped_severity.go create mode 100644 pkg/github/models/dependabot_alert_security_vulnerability.go create mode 100644 pkg/github/models/dependabot_alert_security_vulnerability_escaped_first_escaped_patched_escaped_version.go create mode 100644 pkg/github/models/dependabot_alert_security_vulnerability_escaped_severity.go create mode 100644 pkg/github/models/dependabot_alert_with_repository.go create mode 100644 pkg/github/models/dependabot_alert_with_repository_escaped_dependency.go create mode 100644 pkg/github/models/dependabot_alert_with_repository_escaped_dependency_escaped_scope.go create mode 100644 pkg/github/models/dependabot_alert_with_repository_escaped_dismissed_escaped_reason.go create mode 100644 pkg/github/models/dependabot_alert_with_repository_escaped_state.go create mode 100644 pkg/github/models/dependabot_public_key.go create mode 100644 pkg/github/models/dependabot_secret.go create mode 100644 pkg/github/models/dependency_graph_diff.go create mode 100644 pkg/github/models/dependency_graph_diff_escaped_change_escaped_type.go create mode 100644 pkg/github/models/dependency_graph_diff_escaped_scope.go create mode 100644 pkg/github/models/dependency_graph_diff_escaped_vulnerabilities.go create mode 100644 pkg/github/models/dependency_graph_spdx_sbom.go create mode 100644 pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom.go create mode 100644 pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom_escaped_creation_info.go create mode 100644 pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom_escaped_packages.go create mode 100644 pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom_escaped_packages_escaped_external_refs.go create mode 100644 pkg/github/models/deploy_key.go create mode 100644 pkg/github/models/deployment.go create mode 100644 pkg/github/models/deployment_branch_policy.go create mode 100644 pkg/github/models/deployment_branch_policy_escaped_type.go create mode 100644 pkg/github/models/deployment_branch_policy_name_pattern.go create mode 100644 pkg/github/models/deployment_branch_policy_name_pattern_with_type.go create mode 100644 pkg/github/models/deployment_branch_policy_name_pattern_with_type_escaped_type.go create mode 100644 pkg/github/models/deployment_branch_policy_settings.go create mode 100644 pkg/github/models/deployment_protection_rule.go create mode 100644 pkg/github/models/deployment_reviewer_type.go create mode 100644 pkg/github/models/deployment_simple.go create mode 100644 pkg/github/models/deployment_status.go create mode 100644 pkg/github/models/deployment_status_escaped_state.go create mode 100644 pkg/github/models/diff_entry.go create mode 100644 pkg/github/models/diff_entry_escaped_status.go create mode 100644 pkg/github/models/email.go create mode 100644 pkg/github/models/empty_object.go create mode 100644 pkg/github/models/empty_object503_error.go create mode 100644 pkg/github/models/enabled_organizations.go create mode 100644 pkg/github/models/enabled_repositories.go create mode 100644 pkg/github/models/enterprise.go create mode 100644 pkg/github/models/enterprise_comment_overview.go create mode 100644 pkg/github/models/enterprise_gist_overview.go create mode 100644 pkg/github/models/enterprise_hook_overview.go create mode 100644 pkg/github/models/enterprise_issue_overview.go create mode 100644 pkg/github/models/enterprise_milestone_overview.go create mode 100644 pkg/github/models/enterprise_organization_overview.go create mode 100644 pkg/github/models/enterprise_overview.go create mode 100644 pkg/github/models/enterprise_page_overview.go create mode 100644 pkg/github/models/enterprise_pull_request_overview.go create mode 100644 pkg/github/models/enterprise_repository_overview.go create mode 100644 pkg/github/models/enterprise_security_analysis_settings.go create mode 100644 pkg/github/models/enterprise_security_products_overview.go create mode 100644 pkg/github/models/enterprise_settings.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_avatar.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_cas.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_collectd.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_customer.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_github_escaped_oauth.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_github_escaped_ssl.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ldap.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ldap_escaped_profile.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ldap_escaped_reconciliation.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_license.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_mapping.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ntp.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_pages.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_saml.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_smtp.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_snmp.go create mode 100644 pkg/github/models/enterprise_settings_escaped_enterprise_escaped_syslog.go create mode 100644 pkg/github/models/enterprise_user_overview.go create mode 100644 pkg/github/models/environment.go create mode 100644 pkg/github/models/environment_approvals.go create mode 100644 pkg/github/models/environment_approvals_escaped_environments.go create mode 100644 pkg/github/models/environment_approvals_escaped_state.go create mode 100644 pkg/github/models/environment_escaped_protection_escaped_rules_member1.go create mode 100644 pkg/github/models/environment_escaped_protection_escaped_rules_member2.go create mode 100644 pkg/github/models/environment_escaped_protection_escaped_rules_member2_escaped_reviewers.go create mode 100644 pkg/github/models/environment_escaped_protection_escaped_rules_member3.go create mode 100644 pkg/github/models/event.go create mode 100644 pkg/github/models/event_escaped_payload.go create mode 100644 pkg/github/models/event_escaped_payload_escaped_pages.go create mode 100644 pkg/github/models/event_escaped_repo.go create mode 100644 pkg/github/models/events503_error.go create mode 100644 pkg/github/models/external_group.go create mode 100644 pkg/github/models/external_group_escaped_members.go create mode 100644 pkg/github/models/external_group_escaped_teams.go create mode 100644 pkg/github/models/external_groups.go create mode 100644 pkg/github/models/external_groups_escaped_groups.go create mode 100644 pkg/github/models/feed.go create mode 100644 pkg/github/models/feed_escaped__escaped_links.go create mode 100644 pkg/github/models/file_commit.go create mode 100644 pkg/github/models/file_commit503_error.go create mode 100644 pkg/github/models/file_commit_escaped_commit.go create mode 100644 pkg/github/models/file_commit_escaped_commit_escaped_author.go create mode 100644 pkg/github/models/file_commit_escaped_commit_escaped_committer.go create mode 100644 pkg/github/models/file_commit_escaped_commit_escaped_parents.go create mode 100644 pkg/github/models/file_commit_escaped_commit_escaped_tree.go create mode 100644 pkg/github/models/file_commit_escaped_commit_escaped_verification.go create mode 100644 pkg/github/models/file_commit_escaped_content.go create mode 100644 pkg/github/models/file_commit_escaped_content_escaped__escaped_links.go create mode 100644 pkg/github/models/files503_error.go create mode 100644 pkg/github/models/full_repository.go create mode 100644 pkg/github/models/full_repository_escaped_custom_escaped_properties.go create mode 100644 pkg/github/models/full_repository_escaped_merge_escaped_commit_escaped_message.go create mode 100644 pkg/github/models/full_repository_escaped_merge_escaped_commit_escaped_title.go create mode 100644 pkg/github/models/full_repository_escaped_permissions.go create mode 100644 pkg/github/models/full_repository_escaped_squash_escaped_merge_escaped_commit_escaped_message.go create mode 100644 pkg/github/models/full_repository_escaped_squash_escaped_merge_escaped_commit_escaped_title.go create mode 100644 pkg/github/models/ghes_checks_result_indicator.go create mode 100644 pkg/github/models/ghes_checks_system_requirements.go create mode 100644 pkg/github/models/ghes_checks_system_requirements_escaped_nodes.go create mode 100644 pkg/github/models/ghes_checks_system_requirements_escaped_nodes_escaped_roles_escaped_status.go create mode 100644 pkg/github/models/ghes_cluster_roles.go create mode 100644 pkg/github/models/ghes_cluster_status.go create mode 100644 pkg/github/models/ghes_cluster_status_escaped_nodes.go create mode 100644 pkg/github/models/ghes_cluster_status_escaped_nodes_escaped_services.go create mode 100644 pkg/github/models/ghes_cluster_status_indicator.go create mode 100644 pkg/github/models/ghes_cluster_topology.go create mode 100644 pkg/github/models/ghes_config_init_request.go create mode 100644 pkg/github/models/ghes_config_nodes.go create mode 100644 pkg/github/models/ghes_config_nodes_escaped_nodes.go create mode 100644 pkg/github/models/ghes_delete_ssh_request.go create mode 100644 pkg/github/models/ghes_delete_ssh_response.go create mode 100644 pkg/github/models/ghes_get_maintenance.go create mode 100644 pkg/github/models/ghes_get_maintenance_escaped_connection_escaped_services.go create mode 100644 pkg/github/models/ghes_get_maintenance_escaped_status.go create mode 100644 pkg/github/models/ghes_get_settings.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_avatar.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_cas.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_collectd.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_customer.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_github_escaped_oauth.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_github_escaped_ssl.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_ldap.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_ldap_escaped_profile.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_ldap_escaped_reconciliation.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_license.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_mapping.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_ntp.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_pages.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_saml.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_smtp.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_snmp.go create mode 100644 pkg/github/models/ghes_get_settings_escaped_syslog.go create mode 100644 pkg/github/models/ghes_get_ssh.go create mode 100644 pkg/github/models/ghes_license_check.go create mode 100644 pkg/github/models/ghes_license_check_escaped_status.go create mode 100644 pkg/github/models/ghes_license_info.go create mode 100644 pkg/github/models/ghes_replication_status.go create mode 100644 pkg/github/models/ghes_replication_status_escaped_nodes.go create mode 100644 pkg/github/models/ghes_replication_status_escaped_nodes_escaped_services.go create mode 100644 pkg/github/models/ghes_replication_status_indicator.go create mode 100644 pkg/github/models/ghes_set_maintenance_request.go create mode 100644 pkg/github/models/ghes_set_maintenance_response.go create mode 100644 pkg/github/models/ghes_set_ssh_request.go create mode 100644 pkg/github/models/ghes_set_ssh_response.go create mode 100644 pkg/github/models/ghes_upload_license_request.go create mode 100644 pkg/github/models/ghes_version.go create mode 100644 pkg/github/models/ghes_version_escaped_version.go create mode 100644 pkg/github/models/ghes_version_escaped_version_escaped_platform.go create mode 100644 pkg/github/models/gist_comment.go create mode 100644 pkg/github/models/gist_comment403_error.go create mode 100644 pkg/github/models/gist_comment403_error_escaped_block.go create mode 100644 pkg/github/models/gist_commit.go create mode 100644 pkg/github/models/gist_commit_escaped_change_escaped_status.go create mode 100644 pkg/github/models/gist_history.go create mode 100644 pkg/github/models/gist_history_escaped_change_escaped_status.go create mode 100644 pkg/github/models/gist_simple.go create mode 100644 pkg/github/models/gist_simple403_error.go create mode 100644 pkg/github/models/gist_simple403_error_escaped_block.go create mode 100644 pkg/github/models/gist_simple_escaped_files.go create mode 100644 pkg/github/models/gist_simple_escaped_fork_escaped_of.go create mode 100644 pkg/github/models/gist_simple_escaped_fork_escaped_of_escaped_files.go create mode 100644 pkg/github/models/gist_simple_escaped_forks.go create mode 100644 pkg/github/models/git_commit.go create mode 100644 pkg/github/models/git_commit_escaped_author.go create mode 100644 pkg/github/models/git_commit_escaped_committer.go create mode 100644 pkg/github/models/git_commit_escaped_parents.go create mode 100644 pkg/github/models/git_commit_escaped_tree.go create mode 100644 pkg/github/models/git_commit_escaped_verification.go create mode 100644 pkg/github/models/git_ref.go create mode 100644 pkg/github/models/git_ref_escaped_object.go create mode 100644 pkg/github/models/git_tag.go create mode 100644 pkg/github/models/git_tag_escaped_object.go create mode 100644 pkg/github/models/git_tag_escaped_tagger.go create mode 100644 pkg/github/models/git_tree.go create mode 100644 pkg/github/models/git_tree_escaped_tree.go create mode 100644 pkg/github/models/gitignore_template.go create mode 100644 pkg/github/models/global_advisory.go create mode 100644 pkg/github/models/global_advisory_escaped_credits.go create mode 100644 pkg/github/models/global_advisory_escaped_cvss.go create mode 100644 pkg/github/models/global_advisory_escaped_cwes.go create mode 100644 pkg/github/models/global_advisory_escaped_epss.go create mode 100644 pkg/github/models/global_advisory_escaped_identifiers.go create mode 100644 pkg/github/models/global_advisory_escaped_identifiers_escaped_type.go create mode 100644 pkg/github/models/global_advisory_escaped_severity.go create mode 100644 pkg/github/models/global_advisory_escaped_type.go create mode 100644 pkg/github/models/global_hook.go create mode 100644 pkg/github/models/global_hook2.go create mode 100644 pkg/github/models/global_hook2_escaped_config.go create mode 100644 pkg/github/models/global_hook_escaped_config.go create mode 100644 pkg/github/models/gpg_key.go create mode 100644 pkg/github/models/gpg_key_escaped_emails.go create mode 100644 pkg/github/models/gpg_key_escaped_subkeys.go create mode 100644 pkg/github/models/gpg_key_escaped_subkeys_escaped_emails.go create mode 100644 pkg/github/models/group.go create mode 100644 pkg/github/models/group_escaped_members.go create mode 100644 pkg/github/models/group_escaped_schemas.go create mode 100644 pkg/github/models/group_response.go create mode 100644 pkg/github/models/group_response_escaped_members.go create mode 100644 pkg/github/models/group_response_escaped_schemas.go create mode 100644 pkg/github/models/hook.go create mode 100644 pkg/github/models/hook_delivery.go create mode 100644 pkg/github/models/hook_delivery_escaped_request.go create mode 100644 pkg/github/models/hook_delivery_escaped_request_escaped_headers.go create mode 100644 pkg/github/models/hook_delivery_escaped_request_escaped_payload.go create mode 100644 pkg/github/models/hook_delivery_escaped_response.go create mode 100644 pkg/github/models/hook_delivery_escaped_response_escaped_headers.go create mode 100644 pkg/github/models/hook_delivery_item.go create mode 100644 pkg/github/models/hook_response.go create mode 100644 pkg/github/models/hovercard.go create mode 100644 pkg/github/models/hovercard_escaped_contexts.go create mode 100644 pkg/github/models/installation.go create mode 100644 pkg/github/models/installation_escaped_repository_escaped_selection.go create mode 100644 pkg/github/models/installation_token.go create mode 100644 pkg/github/models/installation_token_escaped_repository_escaped_selection.go create mode 100644 pkg/github/models/instances503_error.go create mode 100644 pkg/github/models/integration.go create mode 100644 pkg/github/models/integration_escaped_permissions.go create mode 100644 pkg/github/models/integration_installation_request.go create mode 100644 pkg/github/models/issue.go create mode 100644 pkg/github/models/issue503_error.go create mode 100644 pkg/github/models/issue_comment.go create mode 100644 pkg/github/models/issue_escaped_pull_escaped_request.go create mode 100644 pkg/github/models/issue_escaped_state_escaped_reason.go create mode 100644 pkg/github/models/issue_event.go create mode 100644 pkg/github/models/issue_event_dismissed_review.go create mode 100644 pkg/github/models/issue_event_for_issue.go create mode 100644 pkg/github/models/issue_event_label.go create mode 100644 pkg/github/models/issue_event_milestone.go create mode 100644 pkg/github/models/issue_event_project_card.go create mode 100644 pkg/github/models/issue_event_rename.go create mode 100644 pkg/github/models/issue_search_result_item.go create mode 100644 pkg/github/models/issue_search_result_item_escaped_labels.go create mode 100644 pkg/github/models/issue_search_result_item_escaped_pull_escaped_request.go create mode 100644 pkg/github/models/issues.go create mode 100644 pkg/github/models/issues503_error.go create mode 100644 pkg/github/models/issues_escaped_matches.go create mode 100644 pkg/github/models/job.go create mode 100644 pkg/github/models/job_escaped_conclusion.go create mode 100644 pkg/github/models/job_escaped_status.go create mode 100644 pkg/github/models/job_escaped_steps.go create mode 100644 pkg/github/models/job_escaped_steps_escaped_status.go create mode 100644 pkg/github/models/key.go create mode 100644 pkg/github/models/key_simple.go create mode 100644 pkg/github/models/label.go create mode 100644 pkg/github/models/label_search_result_item.go create mode 100644 pkg/github/models/labeled_issue_event.go create mode 100644 pkg/github/models/labeled_issue_event_escaped_label.go create mode 100644 pkg/github/models/labels.go create mode 100644 pkg/github/models/labels_escaped_matches.go create mode 100644 pkg/github/models/language.go create mode 100644 pkg/github/models/ldap_mapping_team.go create mode 100644 pkg/github/models/ldap_mapping_user.go create mode 100644 pkg/github/models/ldap_mapping_user_escaped_plan.go create mode 100644 pkg/github/models/license.go create mode 100644 pkg/github/models/license_content.go create mode 100644 pkg/github/models/license_content_escaped__escaped_links.go create mode 100644 pkg/github/models/license_info.go create mode 100644 pkg/github/models/license_simple.go create mode 100644 pkg/github/models/link.go create mode 100644 pkg/github/models/link_with_type.go create mode 100644 pkg/github/models/locations503_error.go create mode 100644 pkg/github/models/locked_issue_event.go create mode 100644 pkg/github/models/maintenance_status.go create mode 100644 pkg/github/models/maintenance_status_escaped_connection_escaped_services.go create mode 100644 pkg/github/models/merged_upstream.go create mode 100644 pkg/github/models/merged_upstream_escaped_merge_escaped_type.go create mode 100644 pkg/github/models/meta.go create mode 100644 pkg/github/models/meta_escaped_resource_type.go create mode 100644 pkg/github/models/metadata.go create mode 100644 pkg/github/models/migration.go create mode 100644 pkg/github/models/milestone.go create mode 100644 pkg/github/models/milestone_escaped_state.go create mode 100644 pkg/github/models/milestoned_issue_event.go create mode 100644 pkg/github/models/milestoned_issue_event_escaped_milestone.go create mode 100644 pkg/github/models/minimal_repository.go create mode 100644 pkg/github/models/minimal_repository_escaped_license.go create mode 100644 pkg/github/models/minimal_repository_escaped_permissions.go create mode 100644 pkg/github/models/moved_column_in_project_issue_event.go create mode 100644 pkg/github/models/moved_column_in_project_issue_event_escaped_project_escaped_card.go create mode 100644 pkg/github/models/nullable_collaborator.go create mode 100644 pkg/github/models/nullable_collaborator_escaped_permissions.go create mode 100644 pkg/github/models/nullable_git_user.go create mode 100644 pkg/github/models/nullable_integration.go create mode 100644 pkg/github/models/nullable_integration_escaped_permissions.go create mode 100644 pkg/github/models/nullable_issue.go create mode 100644 pkg/github/models/nullable_issue_escaped_pull_escaped_request.go create mode 100644 pkg/github/models/nullable_issue_escaped_state_escaped_reason.go create mode 100644 pkg/github/models/nullable_license_simple.go create mode 100644 pkg/github/models/nullable_milestone.go create mode 100644 pkg/github/models/nullable_milestone_escaped_state.go create mode 100644 pkg/github/models/nullable_minimal_repository.go create mode 100644 pkg/github/models/nullable_minimal_repository_escaped_license.go create mode 100644 pkg/github/models/nullable_minimal_repository_escaped_permissions.go create mode 100644 pkg/github/models/nullable_repository.go create mode 100644 pkg/github/models/nullable_repository_escaped_merge_escaped_commit_escaped_message.go create mode 100644 pkg/github/models/nullable_repository_escaped_merge_escaped_commit_escaped_title.go create mode 100644 pkg/github/models/nullable_repository_escaped_permissions.go create mode 100644 pkg/github/models/nullable_repository_escaped_squash_escaped_merge_escaped_commit_escaped_message.go create mode 100644 pkg/github/models/nullable_repository_escaped_squash_escaped_merge_escaped_commit_escaped_title.go create mode 100644 pkg/github/models/nullable_scoped_installation.go create mode 100644 pkg/github/models/nullable_scoped_installation_escaped_repository_escaped_selection.go create mode 100644 pkg/github/models/nullable_simple_commit.go create mode 100644 pkg/github/models/nullable_simple_commit_escaped_author.go create mode 100644 pkg/github/models/nullable_simple_commit_escaped_committer.go create mode 100644 pkg/github/models/nullable_simple_user.go create mode 100644 pkg/github/models/nullable_team_simple.go create mode 100644 pkg/github/models/oidc_custom_sub.go create mode 100644 pkg/github/models/oidc_custom_sub_repo.go create mode 100644 pkg/github/models/org_hook.go create mode 100644 pkg/github/models/org_hook_escaped_config.go create mode 100644 pkg/github/models/org_membership.go create mode 100644 pkg/github/models/org_membership_escaped_permissions.go create mode 100644 pkg/github/models/org_membership_escaped_role.go create mode 100644 pkg/github/models/org_membership_escaped_state.go create mode 100644 pkg/github/models/org_pre_receive_hook.go create mode 100644 pkg/github/models/org_repo_custom_property_values.go create mode 100644 pkg/github/models/org_ruleset_conditions.go create mode 100644 pkg/github/models/organization_actions_secret.go create mode 100644 pkg/github/models/organization_actions_secret_escaped_visibility.go create mode 100644 pkg/github/models/organization_actions_variable.go create mode 100644 pkg/github/models/organization_actions_variable_escaped_visibility.go create mode 100644 pkg/github/models/organization_custom_organization_role_create_schema.go create mode 100644 pkg/github/models/organization_custom_organization_role_update_schema.go create mode 100644 pkg/github/models/organization_custom_repository_role.go create mode 100644 pkg/github/models/organization_custom_repository_role_create_schema.go create mode 100644 pkg/github/models/organization_custom_repository_role_create_schema_escaped_base_escaped_role.go create mode 100644 pkg/github/models/organization_custom_repository_role_escaped_base_escaped_role.go create mode 100644 pkg/github/models/organization_custom_repository_role_update_schema.go create mode 100644 pkg/github/models/organization_custom_repository_role_update_schema_escaped_base_escaped_role.go create mode 100644 pkg/github/models/organization_dependabot_secret.go create mode 100644 pkg/github/models/organization_dependabot_secret_escaped_visibility.go create mode 100644 pkg/github/models/organization_fine_grained_permission.go create mode 100644 pkg/github/models/organization_full.go create mode 100644 pkg/github/models/organization_full_escaped_plan.go create mode 100644 pkg/github/models/organization_programmatic_access_grant.go create mode 100644 pkg/github/models/organization_programmatic_access_grant_escaped_permissions.go create mode 100644 pkg/github/models/organization_programmatic_access_grant_escaped_permissions_escaped_organization.go create mode 100644 pkg/github/models/organization_programmatic_access_grant_escaped_permissions_escaped_other.go create mode 100644 pkg/github/models/organization_programmatic_access_grant_escaped_permissions_escaped_repository.go create mode 100644 pkg/github/models/organization_programmatic_access_grant_escaped_repository_escaped_selection.go create mode 100644 pkg/github/models/organization_programmatic_access_grant_request.go create mode 100644 pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions.go create mode 100644 pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions_escaped_organization.go create mode 100644 pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions_escaped_other.go create mode 100644 pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions_escaped_repository.go create mode 100644 pkg/github/models/organization_programmatic_access_grant_request_escaped_repository_escaped_selection.go create mode 100644 pkg/github/models/organization_role.go create mode 100644 pkg/github/models/organization_secret_scanning_alert.go create mode 100644 pkg/github/models/organization_secret_scanning_alert_escaped_validity.go create mode 100644 pkg/github/models/organization_simple.go create mode 100644 pkg/github/models/package_escaped.go create mode 100644 pkg/github/models/package_escaped_package_escaped_type.go create mode 100644 pkg/github/models/package_escaped_visibility.go create mode 100644 pkg/github/models/package_version.go create mode 100644 pkg/github/models/package_version_escaped_metadata.go create mode 100644 pkg/github/models/package_version_escaped_metadata_escaped_container.go create mode 100644 pkg/github/models/package_version_escaped_metadata_escaped_docker.go create mode 100644 pkg/github/models/package_version_escaped_metadata_escaped_package_escaped_type.go create mode 100644 pkg/github/models/page.go create mode 100644 pkg/github/models/page_build.go create mode 100644 pkg/github/models/page_build_escaped_error.go create mode 100644 pkg/github/models/page_build_status.go create mode 100644 pkg/github/models/page_deployment.go create mode 100644 pkg/github/models/page_escaped_build_escaped_type.go create mode 100644 pkg/github/models/page_escaped_protected_escaped_domain_escaped_state.go create mode 100644 pkg/github/models/page_escaped_status.go create mode 100644 pkg/github/models/pages_deployment_status.go create mode 100644 pkg/github/models/pages_deployment_status_escaped_status.go create mode 100644 pkg/github/models/pages_https_certificate.go create mode 100644 pkg/github/models/pages_https_certificate_escaped_state.go create mode 100644 pkg/github/models/pages_source_hash.go create mode 100644 pkg/github/models/participation_stats.go create mode 100644 pkg/github/models/patch_schema.go create mode 100644 pkg/github/models/patch_schema_escaped_operations.go create mode 100644 pkg/github/models/patch_schema_escaped_operations_escaped_op.go create mode 100644 pkg/github/models/patch_schema_escaped_schemas.go create mode 100644 pkg/github/models/pending_deployment.go create mode 100644 pkg/github/models/pending_deployment_escaped_environment.go create mode 100644 pkg/github/models/pending_deployment_escaped_reviewers.go create mode 100644 pkg/github/models/pre_receive_environment.go create mode 100644 pkg/github/models/pre_receive_environment_download_status.go create mode 100644 pkg/github/models/pre_receive_environment_escaped_download.go create mode 100644 pkg/github/models/pre_receive_hook.go create mode 100644 pkg/github/models/pre_receive_hook_escaped_environment.go create mode 100644 pkg/github/models/pre_receive_hook_escaped_environment_escaped_download.go create mode 100644 pkg/github/models/pre_receive_hook_escaped_script_escaped_repository.go create mode 100644 pkg/github/models/private_user.go create mode 100644 pkg/github/models/private_user_escaped_plan.go create mode 100644 pkg/github/models/project.go create mode 100644 pkg/github/models/project_card.go create mode 100644 pkg/github/models/project_collaborator_permission.go create mode 100644 pkg/github/models/project_column.go create mode 100644 pkg/github/models/project_escaped_organization_escaped_permission.go create mode 100644 pkg/github/models/protected_branch.go create mode 100644 pkg/github/models/protected_branch_admin_enforced.go create mode 100644 pkg/github/models/protected_branch_escaped_allow_escaped_deletions.go create mode 100644 pkg/github/models/protected_branch_escaped_allow_escaped_force_escaped_pushes.go create mode 100644 pkg/github/models/protected_branch_escaped_allow_escaped_fork_escaped_syncing.go create mode 100644 pkg/github/models/protected_branch_escaped_block_escaped_creations.go create mode 100644 pkg/github/models/protected_branch_escaped_enforce_escaped_admins.go create mode 100644 pkg/github/models/protected_branch_escaped_lock_escaped_branch.go create mode 100644 pkg/github/models/protected_branch_escaped_required_escaped_conversation_escaped_resolution.go create mode 100644 pkg/github/models/protected_branch_escaped_required_escaped_linear_escaped_history.go create mode 100644 pkg/github/models/protected_branch_escaped_required_escaped_pull_escaped_request_escaped_reviews.go create mode 100644 pkg/github/models/protected_branch_escaped_required_escaped_signatures.go create mode 100644 pkg/github/models/protected_branch_pull_request_review.go create mode 100644 pkg/github/models/protected_branch_pull_request_review_escaped_bypass_escaped_pull_escaped_request_escaped_allowances.go create mode 100644 pkg/github/models/protected_branch_pull_request_review_escaped_dismissal_escaped_restrictions.go create mode 100644 pkg/github/models/protected_branch_required_status_check.go create mode 100644 pkg/github/models/protected_branch_required_status_check_escaped_checks.go create mode 100644 pkg/github/models/public_key_full.go create mode 100644 pkg/github/models/public_user.go create mode 100644 pkg/github/models/public_user_escaped_plan.go create mode 100644 pkg/github/models/pull_request.go create mode 100644 pkg/github/models/pull_request503_error.go create mode 100644 pkg/github/models/pull_request_escaped__escaped_links.go create mode 100644 pkg/github/models/pull_request_escaped_base.go create mode 100644 pkg/github/models/pull_request_escaped_base_escaped_repo.go create mode 100644 pkg/github/models/pull_request_escaped_base_escaped_repo_escaped_owner.go create mode 100644 pkg/github/models/pull_request_escaped_base_escaped_repo_escaped_permissions.go create mode 100644 pkg/github/models/pull_request_escaped_base_escaped_user.go create mode 100644 pkg/github/models/pull_request_escaped_head.go create mode 100644 pkg/github/models/pull_request_escaped_head_escaped_repo.go create mode 100644 pkg/github/models/pull_request_escaped_head_escaped_repo_escaped_license.go create mode 100644 pkg/github/models/pull_request_escaped_head_escaped_repo_escaped_owner.go create mode 100644 pkg/github/models/pull_request_escaped_head_escaped_repo_escaped_permissions.go create mode 100644 pkg/github/models/pull_request_escaped_head_escaped_user.go create mode 100644 pkg/github/models/pull_request_escaped_labels.go create mode 100644 pkg/github/models/pull_request_escaped_state.go create mode 100644 pkg/github/models/pull_request_merge_result.go create mode 100644 pkg/github/models/pull_request_minimal.go create mode 100644 pkg/github/models/pull_request_minimal_escaped_base.go create mode 100644 pkg/github/models/pull_request_minimal_escaped_base_escaped_repo.go create mode 100644 pkg/github/models/pull_request_minimal_escaped_head.go create mode 100644 pkg/github/models/pull_request_minimal_escaped_head_escaped_repo.go create mode 100644 pkg/github/models/pull_request_review.go create mode 100644 pkg/github/models/pull_request_review_comment.go create mode 100644 pkg/github/models/pull_request_review_comment_escaped__escaped_links.go create mode 100644 pkg/github/models/pull_request_review_comment_escaped__escaped_links_escaped_html.go create mode 100644 pkg/github/models/pull_request_review_comment_escaped__escaped_links_escaped_pull_escaped_request.go create mode 100644 pkg/github/models/pull_request_review_comment_escaped__escaped_links_escaped_self.go create mode 100644 pkg/github/models/pull_request_review_comment_escaped_side.go create mode 100644 pkg/github/models/pull_request_review_comment_escaped_start_escaped_side.go create mode 100644 pkg/github/models/pull_request_review_comment_escaped_subject_escaped_type.go create mode 100644 pkg/github/models/pull_request_review_escaped__escaped_links.go create mode 100644 pkg/github/models/pull_request_review_escaped__escaped_links_escaped_html.go create mode 100644 pkg/github/models/pull_request_review_escaped__escaped_links_escaped_pull_escaped_request.go create mode 100644 pkg/github/models/pull_request_review_request.go create mode 100644 pkg/github/models/pull_request_simple.go create mode 100644 pkg/github/models/pull_request_simple_escaped__escaped_links.go create mode 100644 pkg/github/models/pull_request_simple_escaped_base.go create mode 100644 pkg/github/models/pull_request_simple_escaped_head.go create mode 100644 pkg/github/models/pull_request_simple_escaped_labels.go create mode 100644 pkg/github/models/pull_request_webhook.go create mode 100644 pkg/github/models/pull_request_webhook_escaped_merge_escaped_commit_escaped_message.go create mode 100644 pkg/github/models/pull_request_webhook_escaped_merge_escaped_commit_escaped_title.go create mode 100644 pkg/github/models/pull_request_webhook_escaped_squash_escaped_merge_escaped_commit_escaped_message.go create mode 100644 pkg/github/models/pull_request_webhook_escaped_squash_escaped_merge_escaped_commit_escaped_title.go create mode 100644 pkg/github/models/rate_limit.go create mode 100644 pkg/github/models/rate_limit_overview.go create mode 100644 pkg/github/models/rate_limit_overview_escaped_resources.go create mode 100644 pkg/github/models/reaction.go create mode 100644 pkg/github/models/reaction_escaped_content.go create mode 100644 pkg/github/models/reaction_rollup.go create mode 100644 pkg/github/models/referenced_workflow.go create mode 100644 pkg/github/models/release.go create mode 100644 pkg/github/models/release_asset.go create mode 100644 pkg/github/models/release_asset_escaped_state.go create mode 100644 pkg/github/models/release_notes_content.go create mode 100644 pkg/github/models/removed_from_project_issue_event.go create mode 100644 pkg/github/models/removed_from_project_issue_event_escaped_project_escaped_card.go create mode 100644 pkg/github/models/renamed_issue_event.go create mode 100644 pkg/github/models/renamed_issue_event_escaped_rename.go create mode 100644 pkg/github/models/repo_search_result_item.go create mode 100644 pkg/github/models/repo_search_result_item_escaped_permissions.go create mode 100644 pkg/github/models/repositories.go create mode 100644 pkg/github/models/repositories503_error.go create mode 100644 pkg/github/models/repositories_escaped_matches.go create mode 100644 pkg/github/models/repository.go create mode 100644 pkg/github/models/repository_collaborator_permission.go create mode 100644 pkg/github/models/repository_escaped_merge_escaped_commit_escaped_message.go create mode 100644 pkg/github/models/repository_escaped_merge_escaped_commit_escaped_title.go create mode 100644 pkg/github/models/repository_escaped_permissions.go create mode 100644 pkg/github/models/repository_escaped_squash_escaped_merge_escaped_commit_escaped_message.go create mode 100644 pkg/github/models/repository_escaped_squash_escaped_merge_escaped_commit_escaped_title.go create mode 100644 pkg/github/models/repository_fine_grained_permission.go create mode 100644 pkg/github/models/repository_invitation.go create mode 100644 pkg/github/models/repository_invitation_escaped_permissions.go create mode 100644 pkg/github/models/repository_pre_receive_hook.go create mode 100644 pkg/github/models/repository_rule.go create mode 100644 pkg/github/models/repository_rule_branch_name_pattern.go create mode 100644 pkg/github/models/repository_rule_branch_name_pattern_escaped_parameters.go create mode 100644 pkg/github/models/repository_rule_branch_name_pattern_escaped_parameters_escaped_operator.go create mode 100644 pkg/github/models/repository_rule_branch_name_pattern_escaped_type.go create mode 100644 pkg/github/models/repository_rule_code_scanning.go create mode 100644 pkg/github/models/repository_rule_code_scanning_escaped_parameters.go create mode 100644 pkg/github/models/repository_rule_code_scanning_escaped_type.go create mode 100644 pkg/github/models/repository_rule_commit_author_email_pattern.go create mode 100644 pkg/github/models/repository_rule_commit_author_email_pattern_escaped_parameters.go create mode 100644 pkg/github/models/repository_rule_commit_author_email_pattern_escaped_parameters_escaped_operator.go create mode 100644 pkg/github/models/repository_rule_commit_author_email_pattern_escaped_type.go create mode 100644 pkg/github/models/repository_rule_commit_message_pattern.go create mode 100644 pkg/github/models/repository_rule_commit_message_pattern_escaped_parameters.go create mode 100644 pkg/github/models/repository_rule_commit_message_pattern_escaped_parameters_escaped_operator.go create mode 100644 pkg/github/models/repository_rule_commit_message_pattern_escaped_type.go create mode 100644 pkg/github/models/repository_rule_committer_email_pattern.go create mode 100644 pkg/github/models/repository_rule_committer_email_pattern_escaped_parameters.go create mode 100644 pkg/github/models/repository_rule_committer_email_pattern_escaped_parameters_escaped_operator.go create mode 100644 pkg/github/models/repository_rule_committer_email_pattern_escaped_type.go create mode 100644 pkg/github/models/repository_rule_creation.go create mode 100644 pkg/github/models/repository_rule_creation_escaped_type.go create mode 100644 pkg/github/models/repository_rule_deletion.go create mode 100644 pkg/github/models/repository_rule_deletion_escaped_type.go create mode 100644 pkg/github/models/repository_rule_detailed.go create mode 100644 pkg/github/models/repository_rule_enforcement.go create mode 100644 pkg/github/models/repository_rule_non_fast_forward.go create mode 100644 pkg/github/models/repository_rule_non_fast_forward_escaped_type.go create mode 100644 pkg/github/models/repository_rule_params_code_scanning_tool.go create mode 100644 pkg/github/models/repository_rule_params_code_scanning_tool_escaped_alerts_escaped_threshold.go create mode 100644 pkg/github/models/repository_rule_params_code_scanning_tool_escaped_security_escaped_alerts_escaped_threshold.go create mode 100644 pkg/github/models/repository_rule_params_status_check_configuration.go create mode 100644 pkg/github/models/repository_rule_params_workflow_file_reference.go create mode 100644 pkg/github/models/repository_rule_pull_request.go create mode 100644 pkg/github/models/repository_rule_pull_request_escaped_parameters.go create mode 100644 pkg/github/models/repository_rule_pull_request_escaped_type.go create mode 100644 pkg/github/models/repository_rule_required_deployments.go create mode 100644 pkg/github/models/repository_rule_required_deployments_escaped_parameters.go create mode 100644 pkg/github/models/repository_rule_required_deployments_escaped_type.go create mode 100644 pkg/github/models/repository_rule_required_linear_history.go create mode 100644 pkg/github/models/repository_rule_required_linear_history_escaped_type.go create mode 100644 pkg/github/models/repository_rule_required_signatures.go create mode 100644 pkg/github/models/repository_rule_required_signatures_escaped_type.go create mode 100644 pkg/github/models/repository_rule_required_status_checks.go create mode 100644 pkg/github/models/repository_rule_required_status_checks_escaped_parameters.go create mode 100644 pkg/github/models/repository_rule_required_status_checks_escaped_type.go create mode 100644 pkg/github/models/repository_rule_tag_name_pattern.go create mode 100644 pkg/github/models/repository_rule_tag_name_pattern_escaped_parameters.go create mode 100644 pkg/github/models/repository_rule_tag_name_pattern_escaped_parameters_escaped_operator.go create mode 100644 pkg/github/models/repository_rule_tag_name_pattern_escaped_type.go create mode 100644 pkg/github/models/repository_rule_update.go create mode 100644 pkg/github/models/repository_rule_update_escaped_parameters.go create mode 100644 pkg/github/models/repository_rule_update_escaped_type.go create mode 100644 pkg/github/models/repository_rule_workflows.go create mode 100644 pkg/github/models/repository_rule_workflows_escaped_parameters.go create mode 100644 pkg/github/models/repository_rule_workflows_escaped_type.go create mode 100644 pkg/github/models/repository_ruleset.go create mode 100644 pkg/github/models/repository_ruleset_bypass_actor.go create mode 100644 pkg/github/models/repository_ruleset_bypass_actor_escaped_actor_escaped_type.go create mode 100644 pkg/github/models/repository_ruleset_bypass_actor_escaped_bypass_escaped_mode.go create mode 100644 pkg/github/models/repository_ruleset_conditions.go create mode 100644 pkg/github/models/repository_ruleset_conditions_escaped_ref_escaped_name.go create mode 100644 pkg/github/models/repository_ruleset_escaped__escaped_links.go create mode 100644 pkg/github/models/repository_ruleset_escaped__escaped_links_escaped_html.go create mode 100644 pkg/github/models/repository_ruleset_escaped__escaped_links_escaped_self.go create mode 100644 pkg/github/models/repository_ruleset_escaped_current_escaped_user_escaped_can_escaped_bypass.go create mode 100644 pkg/github/models/repository_ruleset_escaped_source_escaped_type.go create mode 100644 pkg/github/models/repository_ruleset_escaped_target.go create mode 100644 pkg/github/models/repository_subscription.go create mode 100644 pkg/github/models/review_comment.go create mode 100644 pkg/github/models/review_comment_escaped__escaped_links.go create mode 100644 pkg/github/models/review_comment_escaped_side.go create mode 100644 pkg/github/models/review_comment_escaped_start_escaped_side.go create mode 100644 pkg/github/models/review_custom_gates_comment_required.go create mode 100644 pkg/github/models/review_custom_gates_state_required.go create mode 100644 pkg/github/models/review_custom_gates_state_required_escaped_state.go create mode 100644 pkg/github/models/review_dismissed_issue_event.go create mode 100644 pkg/github/models/review_dismissed_issue_event_escaped_dismissed_escaped_review.go create mode 100644 pkg/github/models/review_request_removed_issue_event.go create mode 100644 pkg/github/models/review_requested_issue_event.go create mode 100644 pkg/github/models/root.go create mode 100644 pkg/github/models/rule_suite.go create mode 100644 pkg/github/models/rule_suite_escaped_evaluation_escaped_result.go create mode 100644 pkg/github/models/rule_suite_escaped_result.go create mode 100644 pkg/github/models/rule_suite_escaped_rule_escaped_evaluations.go create mode 100644 pkg/github/models/rule_suite_escaped_rule_escaped_evaluations_escaped_enforcement.go create mode 100644 pkg/github/models/rule_suite_escaped_rule_escaped_evaluations_escaped_result.go create mode 100644 pkg/github/models/rule_suite_escaped_rule_escaped_evaluations_escaped_rule_escaped_source.go create mode 100644 pkg/github/models/rule_suites.go create mode 100644 pkg/github/models/rule_suites_escaped_evaluation_escaped_result.go create mode 100644 pkg/github/models/rule_suites_escaped_result.go create mode 100644 pkg/github/models/runner.go create mode 100644 pkg/github/models/runner_application.go create mode 100644 pkg/github/models/runner_groups_enterprise.go create mode 100644 pkg/github/models/runner_groups_org.go create mode 100644 pkg/github/models/runner_label.go create mode 100644 pkg/github/models/runner_label_escaped_type.go create mode 100644 pkg/github/models/scim_enterprise_group_list.go create mode 100644 pkg/github/models/scim_enterprise_group_list_escaped_schemas.go create mode 100644 pkg/github/models/scim_enterprise_group_response.go create mode 100644 pkg/github/models/scim_enterprise_group_response_escaped_members.go create mode 100644 pkg/github/models/scim_enterprise_user_list.go create mode 100644 pkg/github/models/scim_enterprise_user_list_escaped_schemas.go create mode 100644 pkg/github/models/scim_enterprise_user_response.go create mode 100644 pkg/github/models/scim_enterprise_user_response_escaped_groups.go create mode 100644 pkg/github/models/scim_error.go create mode 100644 pkg/github/models/secret_scanning_alert.go create mode 100644 pkg/github/models/secret_scanning_alert503_error.go create mode 100644 pkg/github/models/secret_scanning_alert_escaped_validity.go create mode 100644 pkg/github/models/secret_scanning_alert_resolution.go create mode 100644 pkg/github/models/secret_scanning_alert_state.go create mode 100644 pkg/github/models/secret_scanning_location.go create mode 100644 pkg/github/models/secret_scanning_location_commit.go create mode 100644 pkg/github/models/secret_scanning_location_discussion_body.go create mode 100644 pkg/github/models/secret_scanning_location_discussion_comment.go create mode 100644 pkg/github/models/secret_scanning_location_discussion_title.go create mode 100644 pkg/github/models/secret_scanning_location_escaped_type.go create mode 100644 pkg/github/models/secret_scanning_location_issue_body.go create mode 100644 pkg/github/models/secret_scanning_location_issue_comment.go create mode 100644 pkg/github/models/secret_scanning_location_issue_title.go create mode 100644 pkg/github/models/secret_scanning_location_pull_request_body.go create mode 100644 pkg/github/models/secret_scanning_location_pull_request_comment.go create mode 100644 pkg/github/models/secret_scanning_location_pull_request_review.go create mode 100644 pkg/github/models/secret_scanning_location_pull_request_review_comment.go create mode 100644 pkg/github/models/secret_scanning_location_pull_request_title.go create mode 100644 pkg/github/models/secret_scanning_location_wiki_commit.go create mode 100644 pkg/github/models/security_advisory_credit_types.go create mode 100644 pkg/github/models/security_advisory_ecosystems.go create mode 100644 pkg/github/models/security_and_analysis.go create mode 100644 pkg/github/models/security_and_analysis_escaped_advanced_escaped_security.go create mode 100644 pkg/github/models/security_and_analysis_escaped_advanced_escaped_security_escaped_status.go create mode 100644 pkg/github/models/security_and_analysis_escaped_dependabot_escaped_security_escaped_updates.go create mode 100644 pkg/github/models/security_and_analysis_escaped_dependabot_escaped_security_escaped_updates_escaped_status.go create mode 100644 pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning.go create mode 100644 pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning_escaped_push_escaped_protection.go create mode 100644 pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning_escaped_push_escaped_protection_escaped_status.go create mode 100644 pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning_escaped_status.go create mode 100644 pkg/github/models/selected_actions.go create mode 100644 pkg/github/models/short_blob.go create mode 100644 pkg/github/models/short_branch.go create mode 100644 pkg/github/models/short_branch_escaped_commit.go create mode 100644 pkg/github/models/simple_commit.go create mode 100644 pkg/github/models/simple_commit_escaped_author.go create mode 100644 pkg/github/models/simple_commit_escaped_committer.go create mode 100644 pkg/github/models/simple_commit_status.go create mode 100644 pkg/github/models/simple_repository.go create mode 100644 pkg/github/models/simple_user.go create mode 100644 pkg/github/models/snapshot.go create mode 100644 pkg/github/models/snapshot_escaped_detector.go create mode 100644 pkg/github/models/snapshot_escaped_job.go create mode 100644 pkg/github/models/snapshot_escaped_manifests.go create mode 100644 pkg/github/models/social_account.go create mode 100644 pkg/github/models/ssh_key.go create mode 100644 pkg/github/models/ssh_signing_key.go create mode 100644 pkg/github/models/state_change_issue_event.go create mode 100644 pkg/github/models/status.go create mode 100644 pkg/github/models/status_check_policy.go create mode 100644 pkg/github/models/status_check_policy_escaped_checks.go create mode 100644 pkg/github/models/tag.go create mode 100644 pkg/github/models/tag_escaped_commit.go create mode 100644 pkg/github/models/tag_protection.go create mode 100644 pkg/github/models/team.go create mode 100644 pkg/github/models/team_discussion.go create mode 100644 pkg/github/models/team_discussion_comment.go create mode 100644 pkg/github/models/team_escaped_permissions.go create mode 100644 pkg/github/models/team_full.go create mode 100644 pkg/github/models/team_full_escaped_notification_escaped_setting.go create mode 100644 pkg/github/models/team_full_escaped_privacy.go create mode 100644 pkg/github/models/team_membership.go create mode 100644 pkg/github/models/team_membership_escaped_role.go create mode 100644 pkg/github/models/team_membership_escaped_state.go create mode 100644 pkg/github/models/team_organization.go create mode 100644 pkg/github/models/team_organization_escaped_plan.go create mode 100644 pkg/github/models/team_project.go create mode 100644 pkg/github/models/team_project_escaped_permissions.go create mode 100644 pkg/github/models/team_repository.go create mode 100644 pkg/github/models/team_repository_escaped_permissions.go create mode 100644 pkg/github/models/team_role_assignment.go create mode 100644 pkg/github/models/team_role_assignment_escaped_permissions.go create mode 100644 pkg/github/models/team_simple.go create mode 100644 pkg/github/models/thread.go create mode 100644 pkg/github/models/thread_escaped_subject.go create mode 100644 pkg/github/models/thread_subscription.go create mode 100644 pkg/github/models/timeline_assigned_issue_event.go create mode 100644 pkg/github/models/timeline_comment_event.go create mode 100644 pkg/github/models/timeline_commit_commented_event.go create mode 100644 pkg/github/models/timeline_committed_event.go create mode 100644 pkg/github/models/timeline_committed_event_escaped_author.go create mode 100644 pkg/github/models/timeline_committed_event_escaped_committer.go create mode 100644 pkg/github/models/timeline_committed_event_escaped_parents.go create mode 100644 pkg/github/models/timeline_committed_event_escaped_tree.go create mode 100644 pkg/github/models/timeline_committed_event_escaped_verification.go create mode 100644 pkg/github/models/timeline_cross_referenced_event.go create mode 100644 pkg/github/models/timeline_cross_referenced_event_escaped_source.go create mode 100644 pkg/github/models/timeline_issue_events.go create mode 100644 pkg/github/models/timeline_line_commented_event.go create mode 100644 pkg/github/models/timeline_reviewed_event.go create mode 100644 pkg/github/models/timeline_reviewed_event_escaped__escaped_links.go create mode 100644 pkg/github/models/timeline_reviewed_event_escaped__escaped_links_escaped_html.go create mode 100644 pkg/github/models/timeline_reviewed_event_escaped__escaped_links_escaped_pull_escaped_request.go create mode 100644 pkg/github/models/timeline_unassigned_issue_event.go create mode 100644 pkg/github/models/topic.go create mode 100644 pkg/github/models/topic_search_result_item.go create mode 100644 pkg/github/models/topic_search_result_item_escaped_aliases.go create mode 100644 pkg/github/models/topic_search_result_item_escaped_aliases_escaped_topic_escaped_relation.go create mode 100644 pkg/github/models/topic_search_result_item_escaped_related.go create mode 100644 pkg/github/models/topic_search_result_item_escaped_related_escaped_topic_escaped_relation.go create mode 100644 pkg/github/models/topics.go create mode 100644 pkg/github/models/topics_escaped_matches.go create mode 100644 pkg/github/models/unassigned_issue_event.go create mode 100644 pkg/github/models/unlabeled_issue_event.go create mode 100644 pkg/github/models/unlabeled_issue_event_escaped_label.go create mode 100644 pkg/github/models/user.go create mode 100644 pkg/github/models/user_escaped_schemas.go create mode 100644 pkg/github/models/user_name.go create mode 100644 pkg/github/models/user_name_response.go create mode 100644 pkg/github/models/user_response.go create mode 100644 pkg/github/models/user_response_escaped_schemas.go create mode 100644 pkg/github/models/user_role_assignment.go create mode 100644 pkg/github/models/user_search_result_item.go create mode 100644 pkg/github/models/users.go create mode 100644 pkg/github/models/users503_error.go create mode 100644 pkg/github/models/validation_error.go create mode 100644 pkg/github/models/validation_error_escaped_errors.go create mode 100644 pkg/github/models/validation_error_simple.go create mode 100644 pkg/github/models/verification.go create mode 100644 pkg/github/models/vulnerability.go create mode 100644 pkg/github/models/vulnerability_escaped_package.go create mode 100644 pkg/github/models/webhook_config.go create mode 100644 pkg/github/models/webhook_config_insecure_ssl.go create mode 100644 pkg/github/models/with_path_get_response_member1.go create mode 100644 pkg/github/models/workflow.go create mode 100644 pkg/github/models/workflow_escaped_state.go create mode 100644 pkg/github/models/workflow_run.go create mode 100644 pkg/github/networks/item_item_events_request_builder.go create mode 100644 pkg/github/networks/item_with_repo_item_request_builder.go create mode 100644 pkg/github/networks/networks_request_builder.go create mode 100644 pkg/github/networks/with_owner_item_request_builder.go create mode 100644 pkg/github/notifications/notifications_put_request_body.go create mode 100644 pkg/github/notifications/notifications_put_response.go create mode 100644 pkg/github/notifications/notifications_request_builder.go create mode 100644 pkg/github/notifications/threads_item_subscription_put_request_body.go create mode 100644 pkg/github/notifications/threads_item_subscription_request_builder.go create mode 100644 pkg/github/notifications/threads_request_builder.go create mode 100644 pkg/github/notifications/threads_with_thread_escaped_item_request_builder.go create mode 100644 pkg/github/octocat/octocat_request_builder.go create mode 100644 pkg/github/organizations/item_custom_escaped_roles_get_response.go create mode 100644 pkg/github/organizations/item_custom_escaped_roles_request_builder.go create mode 100644 pkg/github/organizations/organizations_request_builder.go create mode 100644 pkg/github/organizations/with_organization_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item/actions/runnergroups/item/with_runner_escaped_group_escaped_patch_request_body_escaped_visibility.go create mode 100644 pkg/github/orgs/item/actions/runnergroups/runner_groups_post_request_body_escaped_visibility.go create mode 100644 pkg/github/orgs/item/actions/secrets/item/with_secret_escaped_name_put_request_body_escaped_visibility.go create mode 100644 pkg/github/orgs/item/actions/variables/item/with_name_patch_request_body_escaped_visibility.go create mode 100644 pkg/github/orgs/item/actions/variables/variables_post_request_body_escaped_visibility.go create mode 100644 pkg/github/orgs/item/auditlog/get_include_query_parameter_type.go create mode 100644 pkg/github/orgs/item/auditlog/get_order_query_parameter_type.go create mode 100644 pkg/github/orgs/item/bcdc5a784bf4e6960d6d76096aeabbb3d532494516c3a0f112699915950585ad.go create mode 100644 pkg/github/orgs/item/codescanning/alerts/get_direction_query_parameter_type.go create mode 100644 pkg/github/orgs/item/codescanning/alerts/get_sort_query_parameter_type.go create mode 100644 pkg/github/orgs/item/dependabot/alerts/get_direction_query_parameter_type.go create mode 100644 pkg/github/orgs/item/dependabot/alerts/get_scope_query_parameter_type.go create mode 100644 pkg/github/orgs/item/dependabot/alerts/get_sort_query_parameter_type.go create mode 100644 pkg/github/orgs/item/dependabot/secrets/item/with_secret_escaped_name_put_request_body_escaped_visibility.go create mode 100644 pkg/github/orgs/item/issues/get_direction_query_parameter_type.go create mode 100644 pkg/github/orgs/item/issues/get_filter_query_parameter_type.go create mode 100644 pkg/github/orgs/item/issues/get_sort_query_parameter_type.go create mode 100644 pkg/github/orgs/item/issues/get_state_query_parameter_type.go create mode 100644 pkg/github/orgs/item/item/item/with_enablement_post_request_body_escaped_query_escaped_suite.go create mode 100644 pkg/github/orgs/item/members/get_filter_query_parameter_type.go create mode 100644 pkg/github/orgs/item/members/get_role_query_parameter_type.go create mode 100644 pkg/github/orgs/item/memberships/item/with_username_put_request_body_escaped_role.go create mode 100644 pkg/github/orgs/item/migrations/get_exclude_query_parameter_type.go create mode 100644 pkg/github/orgs/item/migrations/item/get_exclude_query_parameter_type.go create mode 100644 pkg/github/orgs/item/migrations/migrations_post_request_body_escaped_exclude.go create mode 100644 pkg/github/orgs/item/outside_collaborators/get_filter_query_parameter_type.go create mode 100644 pkg/github/orgs/item/packages/get_package_escaped_type_query_parameter_type.go create mode 100644 pkg/github/orgs/item/packages/get_visibility_query_parameter_type.go create mode 100644 pkg/github/orgs/item/packages/item/item/versions/get_state_query_parameter_type.go create mode 100644 pkg/github/orgs/item/personalaccesstokenrequests/get_direction_query_parameter_type.go create mode 100644 pkg/github/orgs/item/personalaccesstokenrequests/get_sort_query_parameter_type.go create mode 100644 pkg/github/orgs/item/personalaccesstokenrequests/item/with_pat_escaped_request_escaped_post_request_body_escaped_action.go create mode 100644 pkg/github/orgs/item/personalaccesstokenrequests/personal_access_token_requests_post_request_body_escaped_action.go create mode 100644 pkg/github/orgs/item/personalaccesstokens/get_direction_query_parameter_type.go create mode 100644 pkg/github/orgs/item/personalaccesstokens/get_sort_query_parameter_type.go create mode 100644 pkg/github/orgs/item/personalaccesstokens/item/with_pat_escaped_post_request_body_escaped_action.go create mode 100644 pkg/github/orgs/item/personalaccesstokens/personal_access_tokens_post_request_body_escaped_action.go create mode 100644 pkg/github/orgs/item/prereceivehooks/get_direction_query_parameter_type.go create mode 100644 pkg/github/orgs/item/prereceivehooks/get_sort_query_parameter_type.go create mode 100644 pkg/github/orgs/item/projects/get_state_query_parameter_type.go create 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/repos/get_direction_query_parameter_type.go create mode 100644 pkg/github/orgs/item/repos/get_sort_query_parameter_type.go create mode 100644 pkg/github/orgs/item/repos/get_type_query_parameter_type.go create mode 100644 pkg/github/orgs/item/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_message.go create mode 100644 pkg/github/orgs/item/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_title.go create mode 100644 pkg/github/orgs/item/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_message.go create mode 100644 pkg/github/orgs/item/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_title.go create mode 100644 pkg/github/orgs/item/repos/repos_post_request_body_escaped_visibility.go create mode 100644 pkg/github/orgs/item/rulesets/item/with_ruleset_escaped_put_request_body_escaped_target.go create mode 100644 pkg/github/orgs/item/rulesets/rulesets_post_request_body_escaped_target.go create mode 100644 pkg/github/orgs/item/rulesets/rulesuites/get_rule_escaped_suite_escaped_result_query_parameter_type.go create mode 100644 pkg/github/orgs/item/rulesets/rulesuites/get_time_escaped_period_query_parameter_type.go create mode 100644 pkg/github/orgs/item/secretscanning/alerts/get_direction_query_parameter_type.go create mode 100644 pkg/github/orgs/item/secretscanning/alerts/get_sort_query_parameter_type.go create mode 100644 pkg/github/orgs/item/secretscanning/alerts/get_state_query_parameter_type.go create mode 100644 pkg/github/orgs/item/teams/item/discussions/get_direction_query_parameter_type.go create mode 100644 pkg/github/orgs/item/teams/item/discussions/item/comments/get_direction_query_parameter_type.go create mode 100644 pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions/get_content_query_parameter_type.go create mode 100644 pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions/reactions_post_request_body_escaped_content.go create mode 100644 pkg/github/orgs/item/teams/item/discussions/item/reactions/get_content_query_parameter_type.go create mode 100644 pkg/github/orgs/item/teams/item/discussions/item/reactions/reactions_post_request_body_escaped_content.go create mode 100644 pkg/github/orgs/item/teams/item/members/get_role_query_parameter_type.go create mode 100644 pkg/github/orgs/item/teams/item/memberships/item/with_username_put_request_body_escaped_role.go create mode 100644 pkg/github/orgs/item/teams/item/projects/item/with_project_escaped_put_request_body_escaped_permission.go create mode 100644 pkg/github/orgs/item/teams/item/with_team_escaped_slug_patch_request_body_escaped_notification_escaped_setting.go create mode 100644 pkg/github/orgs/item/teams/item/with_team_escaped_slug_patch_request_body_escaped_permission.go create mode 100644 pkg/github/orgs/item/teams/item/with_team_escaped_slug_patch_request_body_escaped_privacy.go create mode 100644 pkg/github/orgs/item/teams/teams_post_request_body_escaped_notification_escaped_setting.go create mode 100644 pkg/github/orgs/item/teams/teams_post_request_body_escaped_permission.go create mode 100644 pkg/github/orgs/item/teams/teams_post_request_body_escaped_privacy.go create mode 100644 pkg/github/orgs/item/with_org_patch_request_body_escaped_default_escaped_repository_escaped_permission.go create mode 100644 pkg/github/orgs/item_actions_cache_request_builder.go create mode 100644 pkg/github/orgs/item_actions_cache_usage_by_repository_get_response.go create mode 100644 pkg/github/orgs/item_actions_cache_usage_by_repository_request_builder.go create mode 100644 pkg/github/orgs/item_actions_cache_usage_request_builder.go create mode 100644 pkg/github/orgs/item_actions_oidc_customization_request_builder.go create mode 100644 pkg/github/orgs/item_actions_oidc_customization_sub_request_builder.go create mode 100644 pkg/github/orgs/item_actions_oidc_request_builder.go create mode 100644 pkg/github/orgs/item_actions_permissions_put_request_body.go create mode 100644 pkg/github/orgs/item_actions_permissions_repositories_get_response.go create mode 100644 pkg/github/orgs/item_actions_permissions_repositories_put_request_body.go create mode 100644 pkg/github/orgs/item_actions_permissions_repositories_request_builder.go create mode 100644 pkg/github/orgs/item_actions_permissions_repositories_with_repository_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_actions_permissions_request_builder.go create mode 100644 pkg/github/orgs/item_actions_permissions_selected_actions_request_builder.go create mode 100644 pkg/github/orgs/item_actions_permissions_workflow_request_builder.go create mode 100644 pkg/github/orgs/item_actions_request_builder.go create mode 100644 pkg/github/orgs/item_actions_runner_groups_get_response.go create mode 100644 pkg/github/orgs/item_actions_runner_groups_item_repositories_get_response.go create mode 100644 pkg/github/orgs/item_actions_runner_groups_item_repositories_put_request_body.go create mode 100644 pkg/github/orgs/item_actions_runner_groups_item_repositories_request_builder.go create mode 100644 pkg/github/orgs/item_actions_runner_groups_item_repositories_with_repository_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_actions_runner_groups_item_runners_get_response.go create mode 100644 pkg/github/orgs/item_actions_runner_groups_item_runners_put_request_body.go create mode 100644 pkg/github/orgs/item_actions_runner_groups_item_runners_request_builder.go create mode 100644 pkg/github/orgs/item_actions_runner_groups_item_runners_with_runner_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_actions_runner_groups_item_with_runner_escaped_group_escaped_patch_request_body.go create mode 100644 pkg/github/orgs/item_actions_runner_groups_post_request_body.go create mode 100644 pkg/github/orgs/item_actions_runner_groups_request_builder.go create mode 100644 pkg/github/orgs/item_actions_runner_groups_with_runner_escaped_group_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_actions_runners_downloads_request_builder.go create mode 100644 pkg/github/orgs/item_actions_runners_generate_jitconfig_post_request_body.go create mode 100644 pkg/github/orgs/item_actions_runners_generate_jitconfig_post_response.go create mode 100644 pkg/github/orgs/item_actions_runners_generate_jitconfig_request_builder.go create mode 100644 pkg/github/orgs/item_actions_runners_get_response.go create mode 100644 pkg/github/orgs/item_actions_runners_item_labels_delete_response.go create mode 100644 pkg/github/orgs/item_actions_runners_item_labels_get_response.go create mode 100644 pkg/github/orgs/item_actions_runners_item_labels_item_with_name_delete_response.go create mode 100644 pkg/github/orgs/item_actions_runners_item_labels_post_request_body.go create mode 100644 pkg/github/orgs/item_actions_runners_item_labels_post_response.go create mode 100644 pkg/github/orgs/item_actions_runners_item_labels_put_request_body.go create mode 100644 pkg/github/orgs/item_actions_runners_item_labels_put_response.go create mode 100644 pkg/github/orgs/item_actions_runners_item_labels_request_builder.go create mode 100644 pkg/github/orgs/item_actions_runners_item_labels_with_name_item_request_builder.go create mode 100644 pkg/github/orgs/item_actions_runners_registration_token_request_builder.go create mode 100644 pkg/github/orgs/item_actions_runners_remove_token_request_builder.go create mode 100644 pkg/github/orgs/item_actions_runners_request_builder.go create mode 100644 pkg/github/orgs/item_actions_runners_with_runner_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_actions_secrets_get_response.go create mode 100644 pkg/github/orgs/item_actions_secrets_item_repositories_get_response.go create mode 100644 pkg/github/orgs/item_actions_secrets_item_repositories_put_request_body.go create mode 100644 pkg/github/orgs/item_actions_secrets_item_repositories_request_builder.go create mode 100644 pkg/github/orgs/item_actions_secrets_item_repositories_with_repository_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_actions_secrets_item_with_secret_escaped_name_put_request_body.go create mode 100644 pkg/github/orgs/item_actions_secrets_public_key_request_builder.go create mode 100644 pkg/github/orgs/item_actions_secrets_request_builder.go create mode 100644 pkg/github/orgs/item_actions_secrets_with_secret_escaped_name_item_request_builder.go create mode 100644 pkg/github/orgs/item_actions_variables_get_response.go create mode 100644 pkg/github/orgs/item_actions_variables_item_repositories_get_response.go create mode 100644 pkg/github/orgs/item_actions_variables_item_repositories_put_request_body.go create mode 100644 pkg/github/orgs/item_actions_variables_item_repositories_request_builder.go create mode 100644 pkg/github/orgs/item_actions_variables_item_repositories_with_repository_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_actions_variables_item_with_name_patch_request_body.go create mode 100644 pkg/github/orgs/item_actions_variables_post_request_body.go create mode 100644 pkg/github/orgs/item_actions_variables_request_builder.go create mode 100644 pkg/github/orgs/item_actions_variables_with_name_item_request_builder.go create mode 100644 pkg/github/orgs/item_announcement_request_builder.go create mode 100644 pkg/github/orgs/item_audit_log_request_builder.go create mode 100644 pkg/github/orgs/item_code_scanning_alerts_request_builder.go create mode 100644 pkg/github/orgs/item_code_scanning_request_builder.go create mode 100644 pkg/github/orgs/item_custom_repository_roles_get_response.go create mode 100644 pkg/github/orgs/item_custom_repository_roles_request_builder.go create mode 100644 pkg/github/orgs/item_custom_repository_roles_with_role_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_dependabot_alerts_request_builder.go create mode 100644 pkg/github/orgs/item_dependabot_request_builder.go create mode 100644 pkg/github/orgs/item_dependabot_secrets_get_response.go create mode 100644 pkg/github/orgs/item_dependabot_secrets_item_repositories_get_response.go create mode 100644 pkg/github/orgs/item_dependabot_secrets_item_repositories_put_request_body.go create mode 100644 pkg/github/orgs/item_dependabot_secrets_item_repositories_request_builder.go create mode 100644 pkg/github/orgs/item_dependabot_secrets_item_repositories_with_repository_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_dependabot_secrets_item_with_secret_escaped_name_put_request_body.go create mode 100644 pkg/github/orgs/item_dependabot_secrets_public_key_request_builder.go create mode 100644 pkg/github/orgs/item_dependabot_secrets_request_builder.go create mode 100644 pkg/github/orgs/item_dependabot_secrets_with_secret_escaped_name_item_request_builder.go create mode 100644 pkg/github/orgs/item_docker_conflicts_request_builder.go create mode 100644 pkg/github/orgs/item_docker_request_builder.go create mode 100644 pkg/github/orgs/item_events_request_builder.go create mode 100644 pkg/github/orgs/item_external_group_request_builder.go create mode 100644 pkg/github/orgs/item_external_group_with_group_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_external_groups_request_builder.go create mode 100644 pkg/github/orgs/item_hooks_item_config_patch_request_body.go create mode 100644 pkg/github/orgs/item_hooks_item_config_request_builder.go create mode 100644 pkg/github/orgs/item_hooks_item_deliveries_item_attempts_post_response.go create mode 100644 pkg/github/orgs/item_hooks_item_deliveries_item_attempts_request_builder.go create mode 100644 pkg/github/orgs/item_hooks_item_deliveries_request_builder.go create mode 100644 pkg/github/orgs/item_hooks_item_deliveries_with_delivery_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_hooks_item_pings_request_builder.go create mode 100644 pkg/github/orgs/item_hooks_item_with_hook_escaped_patch_request_body.go create mode 100644 pkg/github/orgs/item_hooks_item_with_hook_escaped_patch_request_body_escaped_config.go create mode 100644 pkg/github/orgs/item_hooks_post_request_body.go create mode 100644 pkg/github/orgs/item_hooks_post_request_body_escaped_config.go create mode 100644 pkg/github/orgs/item_hooks_request_builder.go create mode 100644 pkg/github/orgs/item_hooks_with_hook_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_installation_request_builder.go create mode 100644 pkg/github/orgs/item_installations_get_response.go create mode 100644 pkg/github/orgs/item_installations_request_builder.go create mode 100644 pkg/github/orgs/item_issues_request_builder.go create mode 100644 pkg/github/orgs/item_item_item_with_enablement_post_request_body.go create mode 100644 pkg/github/orgs/item_item_with_enablement_item_request_builder.go create mode 100644 pkg/github/orgs/item_members_request_builder.go create mode 100644 pkg/github/orgs/item_members_with_username_item_request_builder.go create mode 100644 pkg/github/orgs/item_memberships_item_with_username_put_request_body.go create mode 100644 pkg/github/orgs/item_memberships_request_builder.go create mode 100644 pkg/github/orgs/item_memberships_with_username_item_request_builder.go create mode 100644 pkg/github/orgs/item_migrations_item_archive_request_builder.go create mode 100644 pkg/github/orgs/item_migrations_item_repos_item_lock_request_builder.go create mode 100644 pkg/github/orgs/item_migrations_item_repos_request_builder.go create mode 100644 pkg/github/orgs/item_migrations_item_repos_with_repo_escaped_name_item_request_builder.go create mode 100644 pkg/github/orgs/item_migrations_item_repositories_request_builder.go create mode 100644 pkg/github/orgs/item_migrations_post_request_body.go create mode 100644 pkg/github/orgs/item_migrations_request_builder.go create mode 100644 pkg/github/orgs/item_migrations_with_migration_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_organization_fine_grained_permissions_request_builder.go create mode 100644 pkg/github/orgs/item_organization_roles_get_response.go create mode 100644 pkg/github/orgs/item_organization_roles_item_teams_request_builder.go create mode 100644 pkg/github/orgs/item_organization_roles_item_users_request_builder.go create mode 100644 pkg/github/orgs/item_organization_roles_request_builder.go create mode 100644 pkg/github/orgs/item_organization_roles_teams_item_with_role_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_organization_roles_teams_request_builder.go create mode 100644 pkg/github/orgs/item_organization_roles_teams_with_team_escaped_slug_item_request_builder.go create mode 100644 pkg/github/orgs/item_organization_roles_users_item_with_role_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_organization_roles_users_request_builder.go create mode 100644 pkg/github/orgs/item_organization_roles_users_with_username_item_request_builder.go create mode 100644 pkg/github/orgs/item_organization_roles_with_role_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_outside_escaped_collaborators_item_with_username422_error.go create mode 100644 pkg/github/orgs/item_outside_escaped_collaborators_item_with_username_put_request_body.go create mode 100644 pkg/github/orgs/item_outside_escaped_collaborators_item_with_username_put_response.go create mode 100644 pkg/github/orgs/item_outside_escaped_collaborators_request_builder.go create mode 100644 pkg/github/orgs/item_outside_escaped_collaborators_with_username_item_request_builder.go create mode 100644 pkg/github/orgs/item_packages_item_item_restore_request_builder.go create mode 100644 pkg/github/orgs/item_packages_item_item_versions_item_restore_request_builder.go create mode 100644 pkg/github/orgs/item_packages_item_item_versions_request_builder.go create mode 100644 pkg/github/orgs/item_packages_item_item_versions_with_package_escaped_version_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_packages_item_with_package_escaped_name_item_request_builder.go create mode 100644 pkg/github/orgs/item_packages_request_builder.go create mode 100644 pkg/github/orgs/item_packages_with_package_escaped_type_item_request_builder.go create mode 100644 pkg/github/orgs/item_personal_access_token_requests_item_repositories_request_builder.go create mode 100644 pkg/github/orgs/item_personal_access_token_requests_item_with_pat_escaped_request_escaped_post_request_body.go create mode 100644 pkg/github/orgs/item_personal_access_token_requests_post_request_body.go create mode 100644 pkg/github/orgs/item_personal_access_token_requests_post_response.go create mode 100644 pkg/github/orgs/item_personal_access_token_requests_request_builder.go create mode 100644 pkg/github/orgs/item_personal_access_token_requests_with_pat_escaped_request_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_personal_access_tokens_item_repositories_request_builder.go create mode 100644 pkg/github/orgs/item_personal_access_tokens_item_with_pat_escaped_post_request_body.go create mode 100644 pkg/github/orgs/item_personal_access_tokens_post_request_body.go create mode 100644 pkg/github/orgs/item_personal_access_tokens_post_response.go create mode 100644 pkg/github/orgs/item_personal_access_tokens_request_builder.go create mode 100644 pkg/github/orgs/item_personal_access_tokens_with_pat_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_pre_receive_hooks_item_with_pre_escaped_receive_escaped_hook_escaped_patch_request_body.go create mode 100644 pkg/github/orgs/item_pre_receive_hooks_request_builder.go create mode 100644 pkg/github/orgs/item_pre_receive_hooks_with_pre_escaped_receive_escaped_hook_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_projects_post_request_body.go create mode 100644 pkg/github/orgs/item_projects_request_builder.go create mode 100644 pkg/github/orgs/item_properties_request_builder.go create mode 100644 pkg/github/orgs/item_properties_schema_item_with_custom_escaped_property_escaped_name_put_request_body.go create mode 100644 pkg/github/orgs/item_properties_schema_patch_request_body.go create mode 100644 pkg/github/orgs/item_properties_schema_request_builder.go create mode 100644 pkg/github/orgs/item_properties_schema_with_custom_escaped_property_escaped_name_item_request_builder.go create mode 100644 pkg/github/orgs/item_properties_values_patch_request_body.go create mode 100644 pkg/github/orgs/item_properties_values_request_builder.go create mode 100644 pkg/github/orgs/item_public_escaped_members_request_builder.go create mode 100644 pkg/github/orgs/item_public_escaped_members_with_username_item_request_builder.go create mode 100644 pkg/github/orgs/item_repos_post_request_body.go create mode 100644 pkg/github/orgs/item_repos_post_request_body_escaped_custom_escaped_properties.go create mode 100644 pkg/github/orgs/item_repos_request_builder.go create mode 100644 pkg/github/orgs/item_repository_fine_grained_permissions_request_builder.go create mode 100644 pkg/github/orgs/item_rulesets_item_with_ruleset_escaped_put_request_body.go create mode 100644 pkg/github/orgs/item_rulesets_post_request_body.go create mode 100644 pkg/github/orgs/item_rulesets_request_builder.go create mode 100644 pkg/github/orgs/item_rulesets_rule_suites_request_builder.go create mode 100644 pkg/github/orgs/item_rulesets_rule_suites_with_rule_escaped_suite_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_rulesets_with_ruleset_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_secret_scanning_alerts_request_builder.go create mode 100644 pkg/github/orgs/item_secret_scanning_request_builder.go create mode 100644 pkg/github/orgs/item_security_managers_request_builder.go create mode 100644 pkg/github/orgs/item_security_managers_teams_request_builder.go create mode 100644 pkg/github/orgs/item_security_managers_teams_with_team_escaped_slug_item_request_builder.go create mode 100644 pkg/github/orgs/item_settings_billing_advanced_security_request_builder.go create mode 100644 pkg/github/orgs/item_settings_billing_request_builder.go create mode 100644 pkg/github/orgs/item_settings_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_post_request_body.go create mode 100644 pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_with_reaction_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_discussions_item_comments_item_with_comment_escaped_number_patch_request_body.go create mode 100644 pkg/github/orgs/item_teams_item_discussions_item_comments_post_request_body.go create mode 100644 pkg/github/orgs/item_teams_item_discussions_item_comments_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_discussions_item_comments_with_comment_escaped_number_item_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_discussions_item_reactions_post_request_body.go create mode 100644 pkg/github/orgs/item_teams_item_discussions_item_reactions_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_discussions_item_reactions_with_reaction_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_discussions_item_with_discussion_escaped_number_patch_request_body.go create mode 100644 pkg/github/orgs/item_teams_item_discussions_post_request_body.go create mode 100644 pkg/github/orgs/item_teams_item_discussions_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_discussions_with_discussion_escaped_number_item_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_external_groups_patch_request_body.go create mode 100644 pkg/github/orgs/item_teams_item_external_groups_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_members_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_memberships_item_with_username_put_request_body.go create mode 100644 pkg/github/orgs/item_teams_item_memberships_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_memberships_with_username_item_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_projects_item_with_project_escaped_403_error.go create mode 100644 pkg/github/orgs/item_teams_item_projects_item_with_project_escaped_put_request_body.go create mode 100644 pkg/github/orgs/item_teams_item_projects_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_projects_with_project_escaped_item_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_repos_item_item_with_repo_put_request_body.go create mode 100644 pkg/github/orgs/item_teams_item_repos_item_with_repo_item_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_repos_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_repos_with_owner_item_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_teams_request_builder.go create mode 100644 pkg/github/orgs/item_teams_item_with_team_escaped_slug_patch_request_body.go create mode 100644 pkg/github/orgs/item_teams_post_request_body.go create mode 100644 pkg/github/orgs/item_teams_request_builder.go create mode 100644 pkg/github/orgs/item_teams_with_team_escaped_slug_item_request_builder.go create mode 100644 pkg/github/orgs/item_with_org_delete_response.go create mode 100644 pkg/github/orgs/item_with_org_patch_request_body.go create mode 100644 pkg/github/orgs/item_with_security_escaped_product_item_request_builder.go create mode 100644 pkg/github/orgs/orgs_request_builder.go create mode 100644 pkg/github/orgs/with_org_item_request_builder.go create mode 100644 pkg/github/projects/columns/item/cards/get_archived_escaped_state_query_parameter_type.go create mode 100644 pkg/github/projects/columns_cards_item_moves403_error.go create mode 100644 pkg/github/projects/columns_cards_item_moves403_error_escaped_errors.go create mode 100644 pkg/github/projects/columns_cards_item_moves503_error.go create mode 100644 pkg/github/projects/columns_cards_item_moves503_error_escaped_errors.go create mode 100644 pkg/github/projects/columns_cards_item_moves_post_request_body.go create mode 100644 pkg/github/projects/columns_cards_item_moves_post_response.go create mode 100644 pkg/github/projects/columns_cards_item_moves_request_builder.go create mode 100644 pkg/github/projects/columns_cards_item_with_card_escaped_403_error.go create mode 100644 pkg/github/projects/columns_cards_item_with_card_escaped_patch_request_body.go create mode 100644 pkg/github/projects/columns_cards_request_builder.go create mode 100644 pkg/github/projects/columns_cards_with_card_escaped_item_request_builder.go create mode 100644 pkg/github/projects/columns_item_cards_post_request_body_member1.go create mode 100644 pkg/github/projects/columns_item_cards_post_request_body_member2.go create mode 100644 pkg/github/projects/columns_item_cards_project_card503_error.go create mode 100644 pkg/github/projects/columns_item_cards_project_card503_error_escaped_errors.go create mode 100644 pkg/github/projects/columns_item_cards_request_builder.go create mode 100644 pkg/github/projects/columns_item_moves_post_request_body.go create mode 100644 pkg/github/projects/columns_item_moves_post_response.go create mode 100644 pkg/github/projects/columns_item_moves_request_builder.go create mode 100644 pkg/github/projects/columns_item_with_column_escaped_patch_request_body.go create mode 100644 pkg/github/projects/columns_request_builder.go create mode 100644 pkg/github/projects/columns_with_column_escaped_item_request_builder.go create mode 100644 pkg/github/projects/item/collaborators/get_affiliation_query_parameter_type.go create mode 100644 pkg/github/projects/item/collaborators/item/with_username_put_request_body_escaped_permission.go create mode 100644 pkg/github/projects/item/with_project_escaped_patch_request_body_escaped_organization_escaped_permission.go create mode 100644 pkg/github/projects/item_collaborators_item_permission_request_builder.go create mode 100644 pkg/github/projects/item_collaborators_item_with_username_put_request_body.go create mode 100644 pkg/github/projects/item_collaborators_request_builder.go create mode 100644 pkg/github/projects/item_collaborators_with_username_item_request_builder.go create mode 100644 pkg/github/projects/item_columns_post_request_body.go create mode 100644 pkg/github/projects/item_columns_request_builder.go create mode 100644 pkg/github/projects/item_project403_error.go create mode 100644 pkg/github/projects/item_with_project_escaped_403_error.go create mode 100644 pkg/github/projects/item_with_project_escaped_patch_request_body.go create mode 100644 pkg/github/projects/projects_request_builder.go create mode 100644 pkg/github/projects/with_project_escaped_item_request_builder.go create mode 100644 pkg/github/rate_limit/rate_escaped_limit_request_builder.go create mode 100644 pkg/github/repos/01a44ffe4153188df22529fd24ee9f3904b12838161aef08329acd1d15433341.go create mode 100644 pkg/github/repos/0367740d114f7df6844bfac9b20b0d29734964bd8cf755677e5074aa3595ed1f.go create mode 100644 pkg/github/repos/1bdffa8d6eddd2724ceae2800884cd55a3b6e7fe81a9cd2b998f1b1909634428.go create mode 100644 pkg/github/repos/28e6b6a51b1b1282278ea3990f10daa17df7d6492a6bc9d7b42e609850615c1b.go create mode 100644 pkg/github/repos/4380cf32ec38d8910d515b439bc2e02facbf46789676a4dc678fbfc0c7285cc0.go create mode 100644 pkg/github/repos/45842715654374f346d333620787cc369718434019f4ba4eb3b1ea1ef4d38f08.go create mode 100644 pkg/github/repos/541d302c6d6b28965ef8197195ae1715beca9efd14c0e545568b62a18c27233f.go create mode 100644 pkg/github/repos/56259561f2530d481ddd9f21a9290735bf63c4cd1ecace89ae78b4eeb7f2f21d.go create mode 100644 pkg/github/repos/5716bbaab370064fc35315d70724ec633f98e8881fefccfc0b6561eaac582274.go create mode 100644 pkg/github/repos/5ffbe0a4d1b645f842955ddf87128090717488ce8d132dca34aa5a2475cb9e75.go create mode 100644 pkg/github/repos/7a371aff602cbaa0e7806bc10fdfbe23849e2fae5c8ca4d195f9213af56dfa48.go create mode 100644 pkg/github/repos/98b68b8af011ad874c57befae99b96bdcce4f6039e3e2d90db46a68255a69ed0.go create mode 100644 pkg/github/repos/c2ced4f7f11b2d4ec4933e4e7737cf27d616e0818052d67c9dbb80855e1eb59d.go create mode 100644 pkg/github/repos/cae48b44e47feb1c02e5eef34639b41e606e1e0fc5e4f49ee0a9dcea3560f2f7.go create mode 100644 pkg/github/repos/d3902909c3cf1832865514c8e154d728e1e845e4d4f0daf2fad2e64d0814e2fd.go create mode 100644 pkg/github/repos/d4a0f505268ca74b4bdfce6a70996157dffa969b443e6484fca873747b165c64.go create mode 100644 pkg/github/repos/ebaafbcdca770d94734922c3c8ad594e1b68c871877fd14056bab410d7362ac8.go create mode 100644 pkg/github/repos/item/item/actions/caches/get_direction_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/actions/caches/get_sort_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/actions/runs/get_status_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/actions/runs/item/jobs/get_filter_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/actions/runs/item/pending_deployments/pending_escaped_deployments_post_request_body_escaped_state.go create mode 100644 pkg/github/repos/item/item/actions/workflows/item/runs/get_status_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/activity/get_activity_escaped_type_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/activity/get_direction_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/activity/get_time_escaped_period_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/checkruns/check_runs_post_request_body_member1_escaped_status.go create mode 100644 pkg/github/repos/item/item/checkruns/check_runs_post_request_body_member2_escaped_status.go create mode 100644 pkg/github/repos/item/item/checkruns/item/with_check_escaped_run_escaped_patch_request_body_member1_escaped_status.go create mode 100644 pkg/github/repos/item/item/checkruns/item/with_check_escaped_run_escaped_patch_request_body_member2_escaped_status.go create mode 100644 pkg/github/repos/item/item/checksuites/item/checkruns/get_filter_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/checksuites/item/checkruns/get_status_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/codescanning/alerts/get_direction_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/codescanning/alerts/get_sort_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/codescanning/analyses/get_direction_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/codescanning/analyses/get_sort_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/collaborators/get_affiliation_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/collaborators/get_permission_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/comments/item/reactions/get_content_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/comments/item/reactions/reactions_post_request_body_escaped_content.go create mode 100644 pkg/github/repos/item/item/commits/item/checkruns/get_filter_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/commits/item/checkruns/get_status_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/dependabot/alerts/get_direction_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/dependabot/alerts/get_scope_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/dependabot/alerts/get_sort_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/dependabot/alerts/item/with_alert_escaped_number_patch_request_body_escaped_dismissed_escaped_reason.go create mode 100644 pkg/github/repos/item/item/dependabot/alerts/item/with_alert_escaped_number_patch_request_body_escaped_state.go create mode 100644 pkg/github/repos/item/item/deployments/item/statuses/statuses_post_request_body_escaped_state.go create mode 100644 pkg/github/repos/item/item/forks/get_sort_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/git/tags/tags_post_request_body_escaped_type.go create mode 100644 pkg/github/repos/item/item/git/trees/trees_post_request_body_escaped_tree_escaped_mode.go create mode 100644 pkg/github/repos/item/item/git/trees/trees_post_request_body_escaped_tree_escaped_type.go create mode 100644 pkg/github/repos/item/item/invitations/item/with_invitation_escaped_patch_request_body_escaped_permissions.go create mode 100644 pkg/github/repos/item/item/issues/comments/get_direction_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/issues/comments/get_sort_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/issues/comments/item/reactions/get_content_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/issues/comments/item/reactions/reactions_post_request_body_escaped_content.go create mode 100644 pkg/github/repos/item/item/issues/get_direction_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/issues/get_sort_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/issues/get_state_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/issues/item/lock/lock_put_request_body_escaped_lock_escaped_reason.go create mode 100644 pkg/github/repos/item/item/issues/item/reactions/get_content_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/issues/item/reactions/reactions_post_request_body_escaped_content.go create mode 100644 pkg/github/repos/item/item/issues/item/with_issue_escaped_number_patch_request_body_escaped_state.go create mode 100644 pkg/github/repos/item/item/issues/item/with_issue_escaped_number_patch_request_body_escaped_state_escaped_reason.go create mode 100644 pkg/github/repos/item/item/milestones/get_direction_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/milestones/get_sort_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/milestones/get_state_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/milestones/item/with_milestone_escaped_number_patch_request_body_escaped_state.go create mode 100644 pkg/github/repos/item/item/milestones/milestones_post_request_body_escaped_state.go create mode 100644 pkg/github/repos/item/item/pages/pages_post_request_body_escaped_build_escaped_type.go create mode 100644 pkg/github/repos/item/item/pages/pages_post_request_body_escaped_source_escaped_path.go create mode 100644 pkg/github/repos/item/item/pages/pages_put_request_body_escaped_build_escaped_type.go create mode 100644 pkg/github/repos/item/item/pages/pages_put_request_body_escaped_source_member1_escaped_path.go create mode 100644 pkg/github/repos/item/item/prereceivehooks/get_direction_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/prereceivehooks/get_sort_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/prereceivehooks/item/with_pre_escaped_receive_escaped_hook_escaped_patch_request_body_escaped_enforcement.go create mode 100644 pkg/github/repos/item/item/projects/get_state_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/pulls/comments/get_direction_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/pulls/comments/get_sort_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/pulls/comments/item/reactions/get_content_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/pulls/comments/item/reactions/reactions_post_request_body_escaped_content.go create mode 100644 pkg/github/repos/item/item/pulls/get_direction_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/pulls/get_sort_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/pulls/get_state_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_escaped_side.go create mode 100644 pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_escaped_start_escaped_side.go create mode 100644 pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_escaped_subject_escaped_type.go create mode 100644 pkg/github/repos/item/item/pulls/item/comments/get_direction_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/pulls/item/comments/get_sort_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/pulls/item/merge/merge_put_request_body_escaped_merge_escaped_method.go create mode 100644 pkg/github/repos/item/item/pulls/item/reviews/item/dismissals/dismissals_put_request_body_escaped_event.go create mode 100644 pkg/github/repos/item/item/pulls/item/reviews/item/events/events_post_request_body_escaped_event.go create mode 100644 pkg/github/repos/item/item/pulls/item/reviews/reviews_post_request_body_escaped_event.go create mode 100644 pkg/github/repos/item/item/pulls/item/with_pull_escaped_number_patch_request_body_escaped_state.go create mode 100644 pkg/github/repos/item/item/releases/item/reactions/get_content_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/releases/item/reactions/reactions_post_request_body_escaped_content.go create mode 100644 pkg/github/repos/item/item/releases/item/with_release_escaped_patch_request_body_escaped_make_escaped_latest.go create mode 100644 pkg/github/repos/item/item/releases/releases_post_request_body_escaped_make_escaped_latest.go create mode 100644 pkg/github/repos/item/item/replicas/caches/caches_escaped_git_escaped_sync_escaped_status.go create mode 100644 pkg/github/repos/item/item/repo_patch_request_body_escaped_merge_escaped_commit_escaped_message.go create mode 100644 pkg/github/repos/item/item/repo_patch_request_body_escaped_merge_escaped_commit_escaped_title.go create mode 100644 pkg/github/repos/item/item/repo_patch_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_message.go create mode 100644 pkg/github/repos/item/item/repo_patch_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_title.go create mode 100644 pkg/github/repos/item/item/repo_patch_request_body_escaped_visibility.go create mode 100644 pkg/github/repos/item/item/rulesets/item/with_ruleset_escaped_put_request_body_escaped_target.go create mode 100644 pkg/github/repos/item/item/rulesets/rulesets_post_request_body_escaped_target.go create mode 100644 pkg/github/repos/item/item/rulesets/rulesuites/get_rule_escaped_suite_escaped_result_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/rulesets/rulesuites/get_time_escaped_period_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/secretscanning/alerts/get_direction_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/secretscanning/alerts/get_sort_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/secretscanning/alerts/get_state_query_parameter_type.go create mode 100644 pkg/github/repos/item/item/statuses/item/with_sha_post_request_body_escaped_state.go create mode 100644 pkg/github/repos/item_item_actions_artifacts_get_response.go create mode 100644 pkg/github/repos/item_item_actions_artifacts_item_with_archive_escaped_format_item_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_artifacts_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_artifacts_with_artifact_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_cache_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_cache_usage_policy_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_cache_usage_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_caches_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_caches_with_cache_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_jobs_item_logs_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_jobs_item_rerun_post_request_body.go create mode 100644 pkg/github/repos/item_item_actions_jobs_item_rerun_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_jobs_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_jobs_with_job_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_oidc_customization_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_oidc_customization_sub_put_request_body.go create mode 100644 pkg/github/repos/item_item_actions_oidc_customization_sub_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_oidc_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_organization_secrets_get_response.go create mode 100644 pkg/github/repos/item_item_actions_organization_secrets_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_organization_variables_get_response.go create mode 100644 pkg/github/repos/item_item_actions_organization_variables_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_permissions_access_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_permissions_put_request_body.go create mode 100644 pkg/github/repos/item_item_actions_permissions_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_permissions_selected_actions_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_permissions_workflow_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runners_downloads_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runners_generate_jitconfig_post_request_body.go create mode 100644 pkg/github/repos/item_item_actions_runners_generate_jitconfig_post_response.go create mode 100644 pkg/github/repos/item_item_actions_runners_generate_jitconfig_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runners_get_response.go create mode 100644 pkg/github/repos/item_item_actions_runners_item_labels_delete_response.go create mode 100644 pkg/github/repos/item_item_actions_runners_item_labels_get_response.go create mode 100644 pkg/github/repos/item_item_actions_runners_item_labels_item_with_name_delete_response.go create mode 100644 pkg/github/repos/item_item_actions_runners_item_labels_post_request_body.go create mode 100644 pkg/github/repos/item_item_actions_runners_item_labels_post_response.go create mode 100644 pkg/github/repos/item_item_actions_runners_item_labels_put_request_body.go create mode 100644 pkg/github/repos/item_item_actions_runners_item_labels_put_response.go create mode 100644 pkg/github/repos/item_item_actions_runners_item_labels_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runners_item_labels_with_name_item_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runners_registration_token_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runners_remove_token_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runners_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runners_with_runner_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_get_response.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_approvals_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_artifacts_get_response.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_artifacts_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_get_response.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_attempts_item_logs_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_attempts_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_attempts_with_attempt_escaped_number_item_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_cancel_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_deployment_escaped_protection_escaped_rule_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_force_cancel_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_jobs_get_response.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_jobs_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_logs_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_pending_escaped_deployments_post_request_body.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_pending_escaped_deployments_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_rerun_failed_jobs_post_request_body.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_rerun_failed_jobs_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_rerun_post_request_body.go create mode 100644 pkg/github/repos/item_item_actions_runs_item_rerun_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_runs_with_run_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_secrets_get_response.go create mode 100644 pkg/github/repos/item_item_actions_secrets_item_with_secret_escaped_name_put_request_body.go create mode 100644 pkg/github/repos/item_item_actions_secrets_public_key_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_secrets_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_secrets_with_secret_escaped_name_item_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_variables_get_response.go create mode 100644 pkg/github/repos/item_item_actions_variables_item_with_name_patch_request_body.go create mode 100644 pkg/github/repos/item_item_actions_variables_post_request_body.go create mode 100644 pkg/github/repos/item_item_actions_variables_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_variables_with_name_item_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_workflows_get_response.go create mode 100644 pkg/github/repos/item_item_actions_workflows_item_disable_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_workflows_item_dispatches_post_request_body.go create mode 100644 pkg/github/repos/item_item_actions_workflows_item_dispatches_post_request_body_escaped_inputs.go create mode 100644 pkg/github/repos/item_item_actions_workflows_item_dispatches_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_workflows_item_enable_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_workflows_item_runs_get_response.go create mode 100644 pkg/github/repos/item_item_actions_workflows_item_runs_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_workflows_request_builder.go create mode 100644 pkg/github/repos/item_item_actions_workflows_with_workflow_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_activity_request_builder.go create mode 100644 pkg/github/repos/item_item_assignees_request_builder.go create mode 100644 pkg/github/repos/item_item_assignees_with_assignee_item_request_builder.go create mode 100644 pkg/github/repos/item_item_autolinks_post_request_body.go create mode 100644 pkg/github/repos/item_item_autolinks_request_builder.go create mode 100644 pkg/github/repos/item_item_autolinks_with_autolink_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_automated_security_fixes_request_builder.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_enforce_escaped_admins_request_builder.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_put_request_body.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_put_request_body_escaped_required_escaped_status_escaped_checks.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_put_request_body_escaped_restrictions.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_request_builder.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_required_escaped_signatures_request_builder.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_required_escaped_status_escaped_checks_contexts_request_builder.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_required_escaped_status_escaped_checks_patch_request_body.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_required_escaped_status_escaped_checks_request_builder.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_restrictions_apps_delete_request_body_member1.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_restrictions_apps_post_request_body_member1.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_restrictions_apps_put_request_body_member1.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_restrictions_apps_request_builder.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_restrictions_request_builder.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_restrictions_teams_delete_request_body_member1.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_restrictions_teams_post_request_body_member1.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_restrictions_teams_put_request_body_member1.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_restrictions_teams_request_builder.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_restrictions_users_delete_request_body_member1.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_restrictions_users_post_request_body_member1.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_restrictions_users_put_request_body_member1.go create mode 100644 pkg/github/repos/item_item_branches_item_protection_restrictions_users_request_builder.go create mode 100644 pkg/github/repos/item_item_branches_item_rename_post_request_body.go create mode 100644 pkg/github/repos/item_item_branches_item_rename_request_builder.go create mode 100644 pkg/github/repos/item_item_branches_request_builder.go create mode 100644 pkg/github/repos/item_item_branches_with_branch_item_request_builder.go create mode 100644 pkg/github/repos/item_item_check_runs_item_annotations_request_builder.go create mode 100644 pkg/github/repos/item_item_check_runs_item_rerequest_request_builder.go create mode 100644 pkg/github/repos/item_item_check_runs_item_with_check_escaped_run_escaped_patch_request_body_member1.go create mode 100644 pkg/github/repos/item_item_check_runs_item_with_check_escaped_run_escaped_patch_request_body_member2.go create mode 100644 pkg/github/repos/item_item_check_runs_post_request_body_member1.go create mode 100644 pkg/github/repos/item_item_check_runs_post_request_body_member2.go create mode 100644 pkg/github/repos/item_item_check_runs_request_builder.go create mode 100644 pkg/github/repos/item_item_check_runs_with_check_escaped_run_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_check_suites_item_check_runs_get_response.go create mode 100644 pkg/github/repos/item_item_check_suites_item_check_runs_request_builder.go create mode 100644 pkg/github/repos/item_item_check_suites_item_rerequest_request_builder.go create mode 100644 pkg/github/repos/item_item_check_suites_post_request_body.go create mode 100644 pkg/github/repos/item_item_check_suites_preferences_patch_request_body.go create mode 100644 pkg/github/repos/item_item_check_suites_preferences_patch_request_body_escaped_auto_escaped_trigger_escaped_checks.go create mode 100644 pkg/github/repos/item_item_check_suites_preferences_request_builder.go create mode 100644 pkg/github/repos/item_item_check_suites_request_builder.go create mode 100644 pkg/github/repos/item_item_check_suites_with_check_escaped_suite_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_code_scanning_alerts_item_instances_request_builder.go create mode 100644 pkg/github/repos/item_item_code_scanning_alerts_item_with_alert_escaped_number_patch_request_body.go create mode 100644 pkg/github/repos/item_item_code_scanning_alerts_request_builder.go create mode 100644 pkg/github/repos/item_item_code_scanning_alerts_with_alert_escaped_number_item_request_builder.go create mode 100644 pkg/github/repos/item_item_code_scanning_analyses_request_builder.go create mode 100644 pkg/github/repos/item_item_code_scanning_analyses_with_analysis_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_code_scanning_default_setup_request_builder.go create mode 100644 pkg/github/repos/item_item_code_scanning_request_builder.go create mode 100644 pkg/github/repos/item_item_code_scanning_sarifs_post_request_body.go create mode 100644 pkg/github/repos/item_item_code_scanning_sarifs_request_builder.go create mode 100644 pkg/github/repos/item_item_code_scanning_sarifs_with_sarif_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_codeowners_errors_request_builder.go create mode 100644 pkg/github/repos/item_item_codeowners_request_builder.go create mode 100644 pkg/github/repos/item_item_collaborators_item_permission_request_builder.go create mode 100644 pkg/github/repos/item_item_collaborators_item_with_username_put_request_body.go create mode 100644 pkg/github/repos/item_item_collaborators_request_builder.go create mode 100644 pkg/github/repos/item_item_collaborators_with_username_item_request_builder.go create mode 100644 pkg/github/repos/item_item_comments_item_reactions_post_request_body.go create mode 100644 pkg/github/repos/item_item_comments_item_reactions_request_builder.go create mode 100644 pkg/github/repos/item_item_comments_item_reactions_with_reaction_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_comments_item_with_comment_escaped_patch_request_body.go create mode 100644 pkg/github/repos/item_item_comments_request_builder.go create mode 100644 pkg/github/repos/item_item_comments_with_comment_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_commits_commit_escaped_sha_item_request_builder.go create mode 100644 pkg/github/repos/item_item_commits_item_branches_where_head_request_builder.go create mode 100644 pkg/github/repos/item_item_commits_item_check_runs_get_response.go create mode 100644 pkg/github/repos/item_item_commits_item_check_runs_request_builder.go create mode 100644 pkg/github/repos/item_item_commits_item_check_suites_get_response.go create mode 100644 pkg/github/repos/item_item_commits_item_check_suites_request_builder.go create mode 100644 pkg/github/repos/item_item_commits_item_comments_post_request_body.go create mode 100644 pkg/github/repos/item_item_commits_item_comments_request_builder.go create mode 100644 pkg/github/repos/item_item_commits_item_pulls_request_builder.go create mode 100644 pkg/github/repos/item_item_commits_item_status_request_builder.go create mode 100644 pkg/github/repos/item_item_commits_item_statuses_request_builder.go create mode 100644 pkg/github/repos/item_item_commits_request_builder.go create mode 100644 pkg/github/repos/item_item_compare_request_builder.go create mode 100644 pkg/github/repos/item_item_compare_with_basehead_item_request_builder.go create mode 100644 pkg/github/repos/item_item_contents_item_with_path_delete_request_body.go create mode 100644 pkg/github/repos/item_item_contents_item_with_path_delete_request_body_escaped_author.go create mode 100644 pkg/github/repos/item_item_contents_item_with_path_delete_request_body_escaped_committer.go create mode 100644 pkg/github/repos/item_item_contents_item_with_path_put_request_body.go create mode 100644 pkg/github/repos/item_item_contents_item_with_path_put_request_body_escaped_author.go create mode 100644 pkg/github/repos/item_item_contents_item_with_path_put_request_body_escaped_committer.go create mode 100644 pkg/github/repos/item_item_contents_request_builder.go create mode 100644 pkg/github/repos/item_item_contents_with_path_item_request_builder.go create mode 100644 pkg/github/repos/item_item_contributors_request_builder.go create mode 100644 pkg/github/repos/item_item_dependabot_alerts_item_with_alert_escaped_number_patch_request_body.go create mode 100644 pkg/github/repos/item_item_dependabot_alerts_request_builder.go create mode 100644 pkg/github/repos/item_item_dependabot_alerts_with_alert_escaped_number_item_request_builder.go create mode 100644 pkg/github/repos/item_item_dependabot_request_builder.go create mode 100644 pkg/github/repos/item_item_dependabot_secrets_get_response.go create mode 100644 pkg/github/repos/item_item_dependabot_secrets_item_with_secret_escaped_name_put_request_body.go create mode 100644 pkg/github/repos/item_item_dependabot_secrets_public_key_request_builder.go create mode 100644 pkg/github/repos/item_item_dependabot_secrets_request_builder.go create mode 100644 pkg/github/repos/item_item_dependabot_secrets_with_secret_escaped_name_item_request_builder.go create mode 100644 pkg/github/repos/item_item_dependency_graph_compare_request_builder.go create mode 100644 pkg/github/repos/item_item_dependency_graph_compare_with_basehead_item_request_builder.go create mode 100644 pkg/github/repos/item_item_dependency_graph_request_builder.go create mode 100644 pkg/github/repos/item_item_dependency_graph_sbom_request_builder.go create mode 100644 pkg/github/repos/item_item_dependency_graph_snapshots_post_response.go create mode 100644 pkg/github/repos/item_item_dependency_graph_snapshots_request_builder.go create mode 100644 pkg/github/repos/item_item_deployments_item_statuses_post_request_body.go create mode 100644 pkg/github/repos/item_item_deployments_item_statuses_request_builder.go create mode 100644 pkg/github/repos/item_item_deployments_item_statuses_with_status_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_deployments_post_request_body.go create mode 100644 pkg/github/repos/item_item_deployments_request_builder.go create mode 100644 pkg/github/repos/item_item_deployments_with_deployment_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_dispatches_post_request_body.go create mode 100644 pkg/github/repos/item_item_dispatches_post_request_body_escaped_client_escaped_payload.go create mode 100644 pkg/github/repos/item_item_dispatches_request_builder.go create mode 100644 pkg/github/repos/item_item_environments_get_response.go create mode 100644 pkg/github/repos/item_item_environments_item_deployment_branch_policies_get_response.go create mode 100644 pkg/github/repos/item_item_environments_item_deployment_branch_policies_request_builder.go create mode 100644 pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_apps_get_response.go create mode 100644 pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_apps_request_builder.go create mode 100644 pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_get_response.go create mode 100644 pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_post_request_body.go create mode 100644 pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_request_builder.go create mode 100644 pkg/github/repos/item_item_environments_item_secrets_get_response.go create mode 100644 pkg/github/repos/item_item_environments_item_secrets_item_with_secret_escaped_name_put_request_body.go create mode 100644 pkg/github/repos/item_item_environments_item_secrets_public_key_request_builder.go create mode 100644 pkg/github/repos/item_item_environments_item_secrets_request_builder.go create mode 100644 pkg/github/repos/item_item_environments_item_secrets_with_secret_escaped_name_item_request_builder.go create mode 100644 pkg/github/repos/item_item_environments_item_variables_get_response.go create mode 100644 pkg/github/repos/item_item_environments_item_variables_item_with_name_patch_request_body.go create mode 100644 pkg/github/repos/item_item_environments_item_variables_post_request_body.go create mode 100644 pkg/github/repos/item_item_environments_item_variables_request_builder.go create mode 100644 pkg/github/repos/item_item_environments_item_variables_with_name_item_request_builder.go create mode 100644 pkg/github/repos/item_item_environments_item_with_environment_escaped_name_put_request_body.go create mode 100644 pkg/github/repos/item_item_environments_item_with_environment_escaped_name_put_request_body_escaped_reviewers.go create mode 100644 pkg/github/repos/item_item_environments_request_builder.go create mode 100644 pkg/github/repos/item_item_environments_with_environment_escaped_name_item_request_builder.go create mode 100644 pkg/github/repos/item_item_events_request_builder.go create mode 100644 pkg/github/repos/item_item_forks_post_request_body.go create mode 100644 pkg/github/repos/item_item_forks_request_builder.go create mode 100644 pkg/github/repos/item_item_generate_post_request_body.go create mode 100644 pkg/github/repos/item_item_generate_request_builder.go create mode 100644 pkg/github/repos/item_item_git_blobs_post_request_body.go create mode 100644 pkg/github/repos/item_item_git_blobs_request_builder.go create mode 100644 pkg/github/repos/item_item_git_blobs_with_file_escaped_sha_item_request_builder.go create mode 100644 pkg/github/repos/item_item_git_commits_post_request_body.go create mode 100644 pkg/github/repos/item_item_git_commits_post_request_body_escaped_author.go create mode 100644 pkg/github/repos/item_item_git_commits_post_request_body_escaped_committer.go create mode 100644 pkg/github/repos/item_item_git_commits_request_builder.go create mode 100644 pkg/github/repos/item_item_git_commits_with_commit_escaped_sha_item_request_builder.go create mode 100644 pkg/github/repos/item_item_git_matching_refs_request_builder.go create mode 100644 pkg/github/repos/item_item_git_matching_refs_with_ref_item_request_builder.go create mode 100644 pkg/github/repos/item_item_git_ref_request_builder.go create mode 100644 pkg/github/repos/item_item_git_ref_with_ref_item_request_builder.go create mode 100644 pkg/github/repos/item_item_git_refs_item_with_ref_patch_request_body.go create mode 100644 pkg/github/repos/item_item_git_refs_post_request_body.go create mode 100644 pkg/github/repos/item_item_git_refs_request_builder.go create mode 100644 pkg/github/repos/item_item_git_refs_with_ref_item_request_builder.go create mode 100644 pkg/github/repos/item_item_git_request_builder.go create mode 100644 pkg/github/repos/item_item_git_tags_post_request_body.go create mode 100644 pkg/github/repos/item_item_git_tags_post_request_body_escaped_tagger.go create mode 100644 pkg/github/repos/item_item_git_tags_request_builder.go create mode 100644 pkg/github/repos/item_item_git_tags_with_tag_escaped_sha_item_request_builder.go create mode 100644 pkg/github/repos/item_item_git_trees_post_request_body.go create mode 100644 pkg/github/repos/item_item_git_trees_post_request_body_escaped_tree.go create mode 100644 pkg/github/repos/item_item_git_trees_request_builder.go create mode 100644 pkg/github/repos/item_item_git_trees_with_tree_escaped_sha_item_request_builder.go create mode 100644 pkg/github/repos/item_item_hooks_item_config_patch_request_body.go create mode 100644 pkg/github/repos/item_item_hooks_item_config_request_builder.go create mode 100644 pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_post_response.go create mode 100644 pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_request_builder.go create mode 100644 pkg/github/repos/item_item_hooks_item_deliveries_request_builder.go create mode 100644 pkg/github/repos/item_item_hooks_item_deliveries_with_delivery_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_hooks_item_pings_request_builder.go create mode 100644 pkg/github/repos/item_item_hooks_item_tests_request_builder.go create mode 100644 pkg/github/repos/item_item_hooks_item_with_hook_escaped_patch_request_body.go create mode 100644 pkg/github/repos/item_item_hooks_post_request_body.go create mode 100644 pkg/github/repos/item_item_hooks_post_request_body_escaped_config.go create mode 100644 pkg/github/repos/item_item_hooks_request_builder.go create mode 100644 pkg/github/repos/item_item_hooks_with_hook_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_installation_request_builder.go create mode 100644 pkg/github/repos/item_item_invitations_item_with_invitation_escaped_patch_request_body.go create mode 100644 pkg/github/repos/item_item_invitations_request_builder.go create mode 100644 pkg/github/repos/item_item_invitations_with_invitation_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_comments_item_reactions_post_request_body.go create mode 100644 pkg/github/repos/item_item_issues_comments_item_reactions_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_comments_item_reactions_with_reaction_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_comments_item_with_comment_escaped_patch_request_body.go create mode 100644 pkg/github/repos/item_item_issues_comments_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_comments_with_comment_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_events_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_events_with_event_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_item_assignees_delete_request_body.go create mode 100644 pkg/github/repos/item_item_issues_item_assignees_post_request_body.go create mode 100644 pkg/github/repos/item_item_issues_item_assignees_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_item_assignees_with_assignee_item_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_item_comments_post_request_body.go create mode 100644 pkg/github/repos/item_item_issues_item_comments_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_item_events_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_item_labels_post_request_body_member1.go create mode 100644 pkg/github/repos/item_item_issues_item_labels_post_request_body_member2.go create mode 100644 pkg/github/repos/item_item_issues_item_labels_post_request_body_member2_escaped_labels.go create mode 100644 pkg/github/repos/item_item_issues_item_labels_post_request_body_member3.go create mode 100644 pkg/github/repos/item_item_issues_item_labels_put_request_body_member1.go create mode 100644 pkg/github/repos/item_item_issues_item_labels_put_request_body_member2.go create mode 100644 pkg/github/repos/item_item_issues_item_labels_put_request_body_member2_escaped_labels.go create mode 100644 pkg/github/repos/item_item_issues_item_labels_put_request_body_member3.go create mode 100644 pkg/github/repos/item_item_issues_item_labels_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_item_labels_with_name_item_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_item_lock_put_request_body.go create mode 100644 pkg/github/repos/item_item_issues_item_lock_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_item_reactions_post_request_body.go create mode 100644 pkg/github/repos/item_item_issues_item_reactions_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_item_reactions_with_reaction_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_item_timeline_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_item_with_issue_escaped_number_patch_request_body.go create mode 100644 pkg/github/repos/item_item_issues_post_request_body.go create mode 100644 pkg/github/repos/item_item_issues_request_builder.go create mode 100644 pkg/github/repos/item_item_issues_with_issue_escaped_number_item_request_builder.go create mode 100644 pkg/github/repos/item_item_keys_post_request_body.go create mode 100644 pkg/github/repos/item_item_keys_request_builder.go create mode 100644 pkg/github/repos/item_item_keys_with_key_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_labels_item_with_name_patch_request_body.go create mode 100644 pkg/github/repos/item_item_labels_post_request_body.go create mode 100644 pkg/github/repos/item_item_labels_request_builder.go create mode 100644 pkg/github/repos/item_item_labels_with_name_item_request_builder.go create mode 100644 pkg/github/repos/item_item_languages_request_builder.go create mode 100644 pkg/github/repos/item_item_lfs_put_response.go create mode 100644 pkg/github/repos/item_item_lfs_request_builder.go create mode 100644 pkg/github/repos/item_item_license_request_builder.go create mode 100644 pkg/github/repos/item_item_merge_upstream_post_request_body.go create mode 100644 pkg/github/repos/item_item_merge_upstream_request_builder.go create mode 100644 pkg/github/repos/item_item_merges_post_request_body.go create mode 100644 pkg/github/repos/item_item_merges_request_builder.go create mode 100644 pkg/github/repos/item_item_milestones_item_labels_request_builder.go create mode 100644 pkg/github/repos/item_item_milestones_item_with_milestone_escaped_number_patch_request_body.go create mode 100644 pkg/github/repos/item_item_milestones_post_request_body.go create mode 100644 pkg/github/repos/item_item_milestones_request_builder.go create mode 100644 pkg/github/repos/item_item_milestones_with_milestone_escaped_number_item_request_builder.go create mode 100644 pkg/github/repos/item_item_notifications_put_request_body.go create mode 100644 pkg/github/repos/item_item_notifications_put_response.go create mode 100644 pkg/github/repos/item_item_notifications_request_builder.go create mode 100644 pkg/github/repos/item_item_pages_builds_latest_request_builder.go create mode 100644 pkg/github/repos/item_item_pages_builds_request_builder.go create mode 100644 pkg/github/repos/item_item_pages_builds_with_build_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_pages_deployments_item_cancel_request_builder.go create mode 100644 pkg/github/repos/item_item_pages_deployments_post_request_body.go create mode 100644 pkg/github/repos/item_item_pages_deployments_request_builder.go create mode 100644 pkg/github/repos/item_item_pages_deployments_with_pages_escaped_deployment_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_pages_post_request_body.go create mode 100644 pkg/github/repos/item_item_pages_post_request_body_escaped_source.go create mode 100644 pkg/github/repos/item_item_pages_put_request_body.go create mode 100644 pkg/github/repos/item_item_pages_put_request_body_escaped_source_member1.go create mode 100644 pkg/github/repos/item_item_pages_request_builder.go create mode 100644 pkg/github/repos/item_item_pre_receive_hooks_item_with_pre_escaped_receive_escaped_hook_escaped_patch_request_body.go create mode 100644 pkg/github/repos/item_item_pre_receive_hooks_request_builder.go create mode 100644 pkg/github/repos/item_item_pre_receive_hooks_with_pre_escaped_receive_escaped_hook_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_projects_post_request_body.go create mode 100644 pkg/github/repos/item_item_projects_request_builder.go create mode 100644 pkg/github/repos/item_item_properties_request_builder.go create mode 100644 pkg/github/repos/item_item_properties_values_patch_request_body.go create mode 100644 pkg/github/repos/item_item_properties_values_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_comments_item_reactions_post_request_body.go create mode 100644 pkg/github/repos/item_item_pulls_comments_item_reactions_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_comments_item_reactions_with_reaction_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_comments_item_with_comment_escaped_patch_request_body.go create mode 100644 pkg/github/repos/item_item_pulls_comments_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_comments_with_comment_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_item_comments_item_replies_post_request_body.go create mode 100644 pkg/github/repos/item_item_pulls_item_comments_item_replies_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_item_comments_post_request_body.go create mode 100644 pkg/github/repos/item_item_pulls_item_comments_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_item_comments_with_comment_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_item_commits_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_item_files_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_item_merge_put_request_body.go create mode 100644 pkg/github/repos/item_item_pulls_item_merge_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_item_pull_request_merge_result405_error.go create mode 100644 pkg/github/repos/item_item_pulls_item_pull_request_merge_result409_error.go create mode 100644 pkg/github/repos/item_item_pulls_item_requested_escaped_reviewers_delete_request_body.go create mode 100644 pkg/github/repos/item_item_pulls_item_requested_escaped_reviewers_post_request_body.go create mode 100644 pkg/github/repos/item_item_pulls_item_requested_escaped_reviewers_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_item_reviews_item_comments_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_item_reviews_item_dismissals_put_request_body.go create mode 100644 pkg/github/repos/item_item_pulls_item_reviews_item_dismissals_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_item_reviews_item_events_post_request_body.go create mode 100644 pkg/github/repos/item_item_pulls_item_reviews_item_events_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_item_reviews_item_with_review_escaped_put_request_body.go create mode 100644 pkg/github/repos/item_item_pulls_item_reviews_post_request_body.go create mode 100644 pkg/github/repos/item_item_pulls_item_reviews_post_request_body_escaped_comments.go create mode 100644 pkg/github/repos/item_item_pulls_item_reviews_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_item_reviews_with_review_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_item_update_branch_put_request_body.go create mode 100644 pkg/github/repos/item_item_pulls_item_update_branch_put_response.go create mode 100644 pkg/github/repos/item_item_pulls_item_update_branch_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_item_with_pull_escaped_number_patch_request_body.go create mode 100644 pkg/github/repos/item_item_pulls_post_request_body.go create mode 100644 pkg/github/repos/item_item_pulls_request_builder.go create mode 100644 pkg/github/repos/item_item_pulls_with_pull_escaped_number_item_request_builder.go create mode 100644 pkg/github/repos/item_item_readme_request_builder.go create mode 100644 pkg/github/repos/item_item_readme_with_dir_item_request_builder.go create mode 100644 pkg/github/repos/item_item_releases_assets_item_with_asset_escaped_patch_request_body.go create mode 100644 pkg/github/repos/item_item_releases_assets_request_builder.go create mode 100644 pkg/github/repos/item_item_releases_assets_with_asset_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_releases_generate_notes_post_request_body.go create mode 100644 pkg/github/repos/item_item_releases_generate_notes_request_builder.go create mode 100644 pkg/github/repos/item_item_releases_item_assets_request_builder.go create mode 100644 pkg/github/repos/item_item_releases_item_reactions_post_request_body.go create mode 100644 pkg/github/repos/item_item_releases_item_reactions_request_builder.go create mode 100644 pkg/github/repos/item_item_releases_item_reactions_with_reaction_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_releases_item_with_release_escaped_patch_request_body.go create mode 100644 pkg/github/repos/item_item_releases_latest_request_builder.go create mode 100644 pkg/github/repos/item_item_releases_post_request_body.go create mode 100644 pkg/github/repos/item_item_releases_request_builder.go create mode 100644 pkg/github/repos/item_item_releases_tags_request_builder.go create mode 100644 pkg/github/repos/item_item_releases_tags_with_tag_item_request_builder.go create mode 100644 pkg/github/repos/item_item_releases_with_release_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_replicas_caches.go create mode 100644 pkg/github/repos/item_item_replicas_caches_escaped_git.go create mode 100644 pkg/github/repos/item_item_replicas_caches_request_builder.go create mode 100644 pkg/github/repos/item_item_replicas_request_builder.go create mode 100644 pkg/github/repos/item_item_repo403_error.go create mode 100644 pkg/github/repos/item_item_repo_patch_request_body.go create mode 100644 pkg/github/repos/item_item_repo_patch_request_body_escaped_security_escaped_and_escaped_analysis.go create mode 100644 pkg/github/repos/item_item_rules_branches_request_builder.go create mode 100644 pkg/github/repos/item_item_rules_branches_with_branch_item_request_builder.go create mode 100644 pkg/github/repos/item_item_rules_request_builder.go create mode 100644 pkg/github/repos/item_item_rulesets_item_with_ruleset_escaped_put_request_body.go create mode 100644 pkg/github/repos/item_item_rulesets_post_request_body.go create mode 100644 pkg/github/repos/item_item_rulesets_request_builder.go create mode 100644 pkg/github/repos/item_item_rulesets_rule_suites_request_builder.go create mode 100644 pkg/github/repos/item_item_rulesets_rule_suites_with_rule_escaped_suite_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_rulesets_with_ruleset_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_secret_scanning_alerts_item_locations_request_builder.go create mode 100644 pkg/github/repos/item_item_secret_scanning_alerts_item_with_alert_escaped_number_patch_request_body.go create mode 100644 pkg/github/repos/item_item_secret_scanning_alerts_request_builder.go create mode 100644 pkg/github/repos/item_item_secret_scanning_alerts_with_alert_escaped_number_item_request_builder.go create mode 100644 pkg/github/repos/item_item_secret_scanning_request_builder.go create mode 100644 pkg/github/repos/item_item_stargazers_request_builder.go create mode 100644 pkg/github/repos/item_item_stargazers_simple_user.go create mode 100644 pkg/github/repos/item_item_stargazers_stargazer.go create mode 100644 pkg/github/repos/item_item_stats_code_escaped_frequency_request_builder.go create mode 100644 pkg/github/repos/item_item_stats_commit_escaped_activity_request_builder.go create mode 100644 pkg/github/repos/item_item_stats_contributors_request_builder.go create mode 100644 pkg/github/repos/item_item_stats_participation_request_builder.go create mode 100644 pkg/github/repos/item_item_stats_punch_escaped_card_request_builder.go create mode 100644 pkg/github/repos/item_item_stats_request_builder.go create mode 100644 pkg/github/repos/item_item_statuses_item_with_sha_post_request_body.go create mode 100644 pkg/github/repos/item_item_statuses_request_builder.go create mode 100644 pkg/github/repos/item_item_statuses_with_sha_item_request_builder.go create mode 100644 pkg/github/repos/item_item_subscribers_request_builder.go create mode 100644 pkg/github/repos/item_item_subscription_put_request_body.go create mode 100644 pkg/github/repos/item_item_subscription_request_builder.go create mode 100644 pkg/github/repos/item_item_tags_protection_post_request_body.go create mode 100644 pkg/github/repos/item_item_tags_protection_request_builder.go create mode 100644 pkg/github/repos/item_item_tags_protection_with_tag_escaped_protection_escaped_item_request_builder.go create mode 100644 pkg/github/repos/item_item_tags_request_builder.go create mode 100644 pkg/github/repos/item_item_tarball_request_builder.go create mode 100644 pkg/github/repos/item_item_tarball_with_ref_item_request_builder.go create mode 100644 pkg/github/repos/item_item_teams_request_builder.go create mode 100644 pkg/github/repos/item_item_topics_put_request_body.go create mode 100644 pkg/github/repos/item_item_topics_request_builder.go create mode 100644 pkg/github/repos/item_item_transfer_post_request_body.go create mode 100644 pkg/github/repos/item_item_transfer_request_builder.go create mode 100644 pkg/github/repos/item_item_vulnerability_alerts_request_builder.go create mode 100644 pkg/github/repos/item_item_zipball_request_builder.go create mode 100644 pkg/github/repos/item_item_zipball_with_ref_item_request_builder.go create mode 100644 pkg/github/repos/item_repo_item_request_builder.go create mode 100644 pkg/github/repos/owner_item_request_builder.go create mode 100644 pkg/github/repos/repos_request_builder.go create mode 100644 pkg/github/repositories/get_visibility_query_parameter_type.go create mode 100644 pkg/github/repositories/repositories_request_builder.go create mode 100644 pkg/github/scim/scim_request_builder.go create mode 100644 pkg/github/scim/v2_enterprises_item_groups_request_builder.go create mode 100644 pkg/github/scim/v2_enterprises_item_groups_with_scim_escaped_group_escaped_item_request_builder.go create mode 100644 pkg/github/scim/v2_enterprises_item_users_request_builder.go create mode 100644 pkg/github/scim/v2_enterprises_item_users_with_scim_escaped_user_escaped_item_request_builder.go create mode 100644 pkg/github/scim/v2_enterprises_request_builder.go create mode 100644 pkg/github/scim/v2_enterprises_with_enterprise_item_request_builder.go create mode 100644 pkg/github/scim/v2_request_builder.go create mode 100644 pkg/github/search/code/get_order_query_parameter_type.go create mode 100644 pkg/github/search/code/get_sort_query_parameter_type.go create mode 100644 pkg/github/search/code_get_response.go create mode 100644 pkg/github/search/code_request_builder.go create mode 100644 pkg/github/search/commits/get_order_query_parameter_type.go create mode 100644 pkg/github/search/commits/get_sort_query_parameter_type.go create mode 100644 pkg/github/search/commits_get_response.go create mode 100644 pkg/github/search/commits_request_builder.go create mode 100644 pkg/github/search/issues/get_order_query_parameter_type.go create mode 100644 pkg/github/search/issues/get_sort_query_parameter_type.go create mode 100644 pkg/github/search/issues_get_response.go create mode 100644 pkg/github/search/issues_request_builder.go create mode 100644 pkg/github/search/labels/get_order_query_parameter_type.go create mode 100644 pkg/github/search/labels/get_sort_query_parameter_type.go create mode 100644 pkg/github/search/labels_get_response.go create mode 100644 pkg/github/search/labels_request_builder.go create mode 100644 pkg/github/search/repositories/get_order_query_parameter_type.go create mode 100644 pkg/github/search/repositories/get_sort_query_parameter_type.go create mode 100644 pkg/github/search/repositories_get_response.go create mode 100644 pkg/github/search/repositories_request_builder.go create mode 100644 pkg/github/search/search_request_builder.go create mode 100644 pkg/github/search/topics_get_response.go create mode 100644 pkg/github/search/topics_request_builder.go create mode 100644 pkg/github/search/users/get_order_query_parameter_type.go create mode 100644 pkg/github/search/users/get_sort_query_parameter_type.go create mode 100644 pkg/github/search/users_get_response.go create mode 100644 pkg/github/search/users_request_builder.go create mode 100644 pkg/github/setup/api_configcheck_request_builder.go create mode 100644 pkg/github/setup/api_configure_request_builder.go create mode 100644 pkg/github/setup/api_maintenance_post_request_body.go create mode 100644 pkg/github/setup/api_maintenance_request_builder.go create mode 100644 pkg/github/setup/api_request_builder.go create mode 100644 pkg/github/setup/api_settings_authorized_keys_delete_request_body.go create mode 100644 pkg/github/setup/api_settings_authorized_keys_post_request_body.go create mode 100644 pkg/github/setup/api_settings_authorized_keys_request_builder.go create mode 100644 pkg/github/setup/api_settings_put_request_body.go create mode 100644 pkg/github/setup/api_settings_request_builder.go create mode 100644 pkg/github/setup/api_start_post_request_body.go create mode 100644 pkg/github/setup/api_start_request_builder.go create mode 100644 pkg/github/setup/api_upgrade_post_request_body.go create mode 100644 pkg/github/setup/api_upgrade_request_builder.go create mode 100644 pkg/github/setup/setup_request_builder.go create mode 100644 pkg/github/teams/item/discussions/get_direction_query_parameter_type.go create mode 100644 pkg/github/teams/item/discussions/item/comments/get_direction_query_parameter_type.go create mode 100644 pkg/github/teams/item/discussions/item/comments/item/reactions/get_content_query_parameter_type.go create mode 100644 pkg/github/teams/item/discussions/item/comments/item/reactions/reactions_post_request_body_escaped_content.go create mode 100644 pkg/github/teams/item/discussions/item/reactions/get_content_query_parameter_type.go create mode 100644 pkg/github/teams/item/discussions/item/reactions/reactions_post_request_body_escaped_content.go create mode 100644 pkg/github/teams/item/members/get_role_query_parameter_type.go create mode 100644 pkg/github/teams/item/memberships/item/with_username_put_request_body_escaped_role.go create mode 100644 pkg/github/teams/item/projects/item/with_project_escaped_put_request_body_escaped_permission.go create mode 100644 pkg/github/teams/item/repos/item/item/with_repo_put_request_body_escaped_permission.go create mode 100644 pkg/github/teams/item/with_team_escaped_patch_request_body_escaped_notification_escaped_setting.go create mode 100644 pkg/github/teams/item/with_team_escaped_patch_request_body_escaped_permission.go create mode 100644 pkg/github/teams/item/with_team_escaped_patch_request_body_escaped_privacy.go create mode 100644 pkg/github/teams/item_discussions_item_comments_item_reactions_post_request_body.go create mode 100644 pkg/github/teams/item_discussions_item_comments_item_reactions_request_builder.go create mode 100644 pkg/github/teams/item_discussions_item_comments_item_with_comment_escaped_number_patch_request_body.go create mode 100644 pkg/github/teams/item_discussions_item_comments_post_request_body.go create mode 100644 pkg/github/teams/item_discussions_item_comments_request_builder.go create mode 100644 pkg/github/teams/item_discussions_item_comments_with_comment_escaped_number_item_request_builder.go create mode 100644 pkg/github/teams/item_discussions_item_reactions_post_request_body.go create mode 100644 pkg/github/teams/item_discussions_item_reactions_request_builder.go create mode 100644 pkg/github/teams/item_discussions_item_with_discussion_escaped_number_patch_request_body.go create mode 100644 pkg/github/teams/item_discussions_post_request_body.go create mode 100644 pkg/github/teams/item_discussions_request_builder.go create mode 100644 pkg/github/teams/item_discussions_with_discussion_escaped_number_item_request_builder.go create mode 100644 pkg/github/teams/item_members_request_builder.go create mode 100644 pkg/github/teams/item_members_with_username_item_request_builder.go create mode 100644 pkg/github/teams/item_memberships_item_with_username_put_request_body.go create mode 100644 pkg/github/teams/item_memberships_request_builder.go create mode 100644 pkg/github/teams/item_memberships_with_username_item_request_builder.go create mode 100644 pkg/github/teams/item_projects_item_with_project_escaped_403_error.go create mode 100644 pkg/github/teams/item_projects_item_with_project_escaped_put_request_body.go create mode 100644 pkg/github/teams/item_projects_request_builder.go create mode 100644 pkg/github/teams/item_projects_with_project_escaped_item_request_builder.go create mode 100644 pkg/github/teams/item_repos_item_item_with_repo_put_request_body.go create mode 100644 pkg/github/teams/item_repos_item_with_repo_item_request_builder.go create mode 100644 pkg/github/teams/item_repos_request_builder.go create mode 100644 pkg/github/teams/item_repos_with_owner_item_request_builder.go create mode 100644 pkg/github/teams/item_teams_request_builder.go create mode 100644 pkg/github/teams/item_with_team_escaped_patch_request_body.go create mode 100644 pkg/github/teams/teams_request_builder.go create mode 100644 pkg/github/teams/with_team_escaped_item_request_builder.go create mode 100644 pkg/github/user/docker_conflicts_request_builder.go create mode 100644 pkg/github/user/docker_request_builder.go create mode 100644 pkg/github/user/emails_delete_request_body_member1.go create mode 100644 pkg/github/user/emails_post_request_body_member1.go create mode 100644 pkg/github/user/emails_request_builder.go create mode 100644 pkg/github/user/followers_request_builder.go create mode 100644 pkg/github/user/following_request_builder.go create mode 100644 pkg/github/user/following_with_username_item_request_builder.go create mode 100644 pkg/github/user/gpg_escaped_keys_post_request_body.go create mode 100644 pkg/github/user/gpg_escaped_keys_request_builder.go create mode 100644 pkg/github/user/gpg_escaped_keys_with_gpg_escaped_key_escaped_item_request_builder.go create mode 100644 pkg/github/user/installations_get_response.go create mode 100644 pkg/github/user/installations_item_repositories_get_response.go create mode 100644 pkg/github/user/installations_item_repositories_request_builder.go create mode 100644 pkg/github/user/installations_item_repositories_with_repository_escaped_item_request_builder.go create mode 100644 pkg/github/user/installations_request_builder.go create mode 100644 pkg/github/user/installations_with_installation_escaped_item_request_builder.go create mode 100644 pkg/github/user/issues/get_direction_query_parameter_type.go create mode 100644 pkg/github/user/issues/get_filter_query_parameter_type.go create mode 100644 pkg/github/user/issues/get_sort_query_parameter_type.go create mode 100644 pkg/github/user/issues/get_state_query_parameter_type.go create mode 100644 pkg/github/user/issues_request_builder.go create mode 100644 pkg/github/user/keys_post_request_body.go create mode 100644 pkg/github/user/keys_request_builder.go create mode 100644 pkg/github/user/keys_with_key_escaped_item_request_builder.go create mode 100644 pkg/github/user/memberships/orgs/get_state_query_parameter_type.go create mode 100644 pkg/github/user/memberships/orgs/item/with_org_patch_request_body_escaped_state.go create mode 100644 pkg/github/user/memberships_orgs_item_with_org_patch_request_body.go create mode 100644 pkg/github/user/memberships_orgs_request_builder.go create mode 100644 pkg/github/user/memberships_orgs_with_org_item_request_builder.go create mode 100644 pkg/github/user/memberships_request_builder.go create mode 100644 pkg/github/user/migrations/migrations_post_request_body_escaped_exclude.go create mode 100644 pkg/github/user/migrations_item_archive_request_builder.go create mode 100644 pkg/github/user/migrations_item_repositories_request_builder.go create mode 100644 pkg/github/user/migrations_post_request_body.go create mode 100644 pkg/github/user/migrations_request_builder.go create mode 100644 pkg/github/user/migrations_with_migration_escaped_item_request_builder.go create mode 100644 pkg/github/user/orgs_request_builder.go create mode 100644 pkg/github/user/packages/get_package_escaped_type_query_parameter_type.go create mode 100644 pkg/github/user/packages/get_visibility_query_parameter_type.go create mode 100644 pkg/github/user/packages/item/item/versions/get_state_query_parameter_type.go create mode 100644 pkg/github/user/packages_item_item_restore_request_builder.go create mode 100644 pkg/github/user/packages_item_item_versions_item_restore_request_builder.go create mode 100644 pkg/github/user/packages_item_item_versions_request_builder.go create mode 100644 pkg/github/user/packages_item_item_versions_with_package_escaped_version_escaped_item_request_builder.go create mode 100644 pkg/github/user/packages_item_with_package_escaped_name_item_request_builder.go create mode 100644 pkg/github/user/packages_request_builder.go create mode 100644 pkg/github/user/packages_with_package_escaped_type_item_request_builder.go create mode 100644 pkg/github/user/projects_post_request_body.go create mode 100644 pkg/github/user/projects_request_builder.go create mode 100644 pkg/github/user/public_escaped_emails_request_builder.go create mode 100644 pkg/github/user/repos/get_direction_query_parameter_type.go create mode 100644 pkg/github/user/repos/get_sort_query_parameter_type.go create mode 100644 pkg/github/user/repos/get_type_query_parameter_type.go create mode 100644 pkg/github/user/repos/get_visibility_query_parameter_type.go create mode 100644 pkg/github/user/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_message.go create mode 100644 pkg/github/user/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_title.go create mode 100644 pkg/github/user/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_message.go create mode 100644 pkg/github/user/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_title.go create mode 100644 pkg/github/user/repos_post_request_body.go create mode 100644 pkg/github/user/repos_request_builder.go create mode 100644 pkg/github/user/repository_escaped_invitations_request_builder.go create mode 100644 pkg/github/user/repository_escaped_invitations_with_invitation_escaped_item_request_builder.go create mode 100644 pkg/github/user/social_escaped_accounts_delete_request_body.go create mode 100644 pkg/github/user/social_escaped_accounts_post_request_body.go create mode 100644 pkg/github/user/social_escaped_accounts_request_builder.go create mode 100644 pkg/github/user/ssh_escaped_signing_escaped_keys_post_request_body.go create mode 100644 pkg/github/user/ssh_escaped_signing_escaped_keys_request_builder.go create mode 100644 pkg/github/user/ssh_escaped_signing_escaped_keys_with_ssh_escaped_signing_escaped_key_escaped_item_request_builder.go create mode 100644 pkg/github/user/starred/get_direction_query_parameter_type.go create mode 100644 pkg/github/user/starred/get_sort_query_parameter_type.go create mode 100644 pkg/github/user/starred_item_with_repo_item_request_builder.go create mode 100644 pkg/github/user/starred_request_builder.go create mode 100644 pkg/github/user/starred_with_owner_item_request_builder.go create mode 100644 pkg/github/user/subscriptions_request_builder.go create mode 100644 pkg/github/user/teams_request_builder.go create mode 100644 pkg/github/user/user_patch_request_body.go create mode 100644 pkg/github/user/user_request_builder.go create mode 100644 pkg/github/user/with_account_escaped_item_request_builder.go create mode 100644 pkg/github/users/item/hovercard/get_subject_escaped_type_query_parameter_type.go create mode 100644 pkg/github/users/item/packages/get_package_escaped_type_query_parameter_type.go create mode 100644 pkg/github/users/item/packages/get_visibility_query_parameter_type.go create mode 100644 pkg/github/users/item/projects/get_state_query_parameter_type.go create mode 100644 pkg/github/users/item/repos/get_direction_query_parameter_type.go create mode 100644 pkg/github/users/item/repos/get_sort_query_parameter_type.go create mode 100644 pkg/github/users/item/repos/get_type_query_parameter_type.go create mode 100644 pkg/github/users/item/starred/get_direction_query_parameter_type.go create mode 100644 pkg/github/users/item/starred/get_sort_query_parameter_type.go create mode 100644 pkg/github/users/item_docker_conflicts_request_builder.go create mode 100644 pkg/github/users/item_docker_request_builder.go create mode 100644 pkg/github/users/item_events_orgs_request_builder.go create mode 100644 pkg/github/users/item_events_orgs_with_org_item_request_builder.go create mode 100644 pkg/github/users/item_events_public_request_builder.go create mode 100644 pkg/github/users/item_events_request_builder.go create mode 100644 pkg/github/users/item_followers_request_builder.go create mode 100644 pkg/github/users/item_following_request_builder.go create mode 100644 pkg/github/users/item_following_with_target_escaped_user_item_request_builder.go create mode 100644 pkg/github/users/item_gists_request_builder.go create mode 100644 pkg/github/users/item_gpg_escaped_keys_request_builder.go create mode 100644 pkg/github/users/item_hovercard_request_builder.go create mode 100644 pkg/github/users/item_installation_request_builder.go create mode 100644 pkg/github/users/item_keys_request_builder.go create mode 100644 pkg/github/users/item_orgs_request_builder.go create mode 100644 pkg/github/users/item_packages_item_item_restore_request_builder.go create mode 100644 pkg/github/users/item_packages_item_item_versions_item_restore_request_builder.go create mode 100644 pkg/github/users/item_packages_item_item_versions_request_builder.go create mode 100644 pkg/github/users/item_packages_item_item_versions_with_package_escaped_version_escaped_item_request_builder.go create mode 100644 pkg/github/users/item_packages_item_with_package_escaped_name_item_request_builder.go create mode 100644 pkg/github/users/item_packages_request_builder.go create mode 100644 pkg/github/users/item_packages_with_package_escaped_type_item_request_builder.go create mode 100644 pkg/github/users/item_projects_request_builder.go create mode 100644 pkg/github/users/item_received_escaped_events_public_request_builder.go create mode 100644 pkg/github/users/item_received_escaped_events_request_builder.go create mode 100644 pkg/github/users/item_repos_request_builder.go create mode 100644 pkg/github/users/item_site_escaped_admin_request_builder.go create mode 100644 pkg/github/users/item_social_escaped_accounts_request_builder.go create mode 100644 pkg/github/users/item_ssh_escaped_signing_escaped_keys_request_builder.go create mode 100644 pkg/github/users/item_starred_repository.go create mode 100644 pkg/github/users/item_starred_request_builder.go create mode 100644 pkg/github/users/item_subscriptions_request_builder.go create mode 100644 pkg/github/users/item_suspended_delete_request_body.go create mode 100644 pkg/github/users/item_suspended_put_request_body.go create mode 100644 pkg/github/users/item_suspended_request_builder.go create mode 100644 pkg/github/users/users_request_builder.go create mode 100644 pkg/github/users/with_username_item_request_builder.go create mode 100644 pkg/github/zen/zen_request_builder.go create mode 100644 pkg/handlers/rate_limit_handler.go create mode 100644 pkg/handlers/rate_limit_handler_test.go create mode 100644 pkg/headers/header_contents.go create mode 100755 script/lint.sh diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml new file mode 100644 index 00000000..b703af14 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -0,0 +1,33 @@ +name: Bug +description: File a bug report +title: "[BUG]: " +labels: ["Type: Bug", "Status: Triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + - type: textarea + id: what-happened + attributes: + label: What happened? + description: What did you do? What happened? What did you expect to happen? + placeholder: Put your description of the bug here. + validations: + required: true + - type: textarea + id: versions + attributes: + label: Versions + description: What versions of the relevant software are you running? + placeholder: octokit/dotnet-sdk v0.0.1, .net v8.0 + validations: + required: true + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](CODE_OF_CONDUCT.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/ISSUE_TEMPLATE/documentation.yml b/.github/ISSUE_TEMPLATE/documentation.yml new file mode 100644 index 00000000..62e740d3 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/documentation.yml @@ -0,0 +1,41 @@ +name: Documentation +description: Update or add documentation +title: "[DOCS]: " +labels: ["Type: Documentation", "Status: Triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill this out! + - type: textarea + id: describe-need + attributes: + label: Describe the need + description: What do you wish was different about our docs? + placeholder: Describe the need for documentation updates here. + validations: + required: true + - type: input + id: sdk_version + attributes: + label: SDK Version + description: Do these docs apply to a specific SDK version? + placeholder: octokit/dotnet-sdk v0.0.1 + validations: + required: false + - type: input + id: api_version + attributes: + label: API Version + description: Do these docs apply to a specific version of the GitHub REST API or GraphQL API? + placeholder: ex. v1.1.1 + validations: + required: false + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](CODE_OF_CONDUCT.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml new file mode 100644 index 00000000..1d77798b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -0,0 +1,41 @@ +name: Feature +description: Suggest an idea for a new feature or enhancement +title: "[FEAT]: " +labels: ["Type: Feature", "Status: Triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill this out! + - type: textarea + id: describe-need + attributes: + label: Describe the need + description: What do you want to happen? What problem are you trying to solve? + placeholder: Describe the need for the feature. + validations: + required: true + - type: input + id: sdk_version + attributes: + label: SDK Version + description: Does this feature suggestion apply to a specific SDK version? + placeholder: octokit/dotnet-sdk v0.0.1 + validations: + required: false + - type: input + id: api_version + attributes: + label: API Version + description: Does this feature suggestion apply to a specific version of the GitHub REST API or GraphQL API? + placeholder: ex. v1.1.1 + validations: + required: false + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](CODE_OF_CONDUCT.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/ISSUE_TEMPLATE/maintenance.yml b/.github/ISSUE_TEMPLATE/maintenance.yml new file mode 100644 index 00000000..86712b2e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/maintenance.yml @@ -0,0 +1,41 @@ +name: Maintenance +description: Dependencies, cleanup, refactoring, reworking of code +title: "[MAINT]: " +labels: ["Type: Maintenance", "Status: Triage"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill this out! + - type: textarea + id: describe-need + attributes: + label: Describe the need + description: What do you want to happen? + placeholder: Describe the maintenance need here. + validations: + required: true + - type: input + id: sdk_version + attributes: + label: SDK Version + description: Does this maintenance apply to a specific SDK version? + placeholder: octokit/dotnet-sdk v0.0.1 + validations: + required: false + - type: input + id: api_version + attributes: + label: API Version + description: Does this maintenance apply to a specific version of the GitHub REST API or GraphQL API? + placeholder: ex. v1.1.1 + validations: + required: false + - type: checkboxes + id: terms + attributes: + label: Code of Conduct + description: By submitting this issue, you agree to follow our [Code of Conduct](CODE_OF_CONDUCT.md) + options: + - label: I agree to follow this project's Code of Conduct + required: true diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..0aa1f03b --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,30 @@ + + +Resolves #ISSUE_NUMBER + +---- + +### Before the change? + + +* + +### After the change? + + +* + +### Pull request checklist +- [ ] Tests for the changes have been added (for bug fixes / features) +- [ ] Docs have been reviewed and added / updated if needed (for bug fixes / features) + +### Does this introduce a breaking change? + + +Please see our docs on [breaking changes](https://github.com/octokit/.github/blob/master/community/breaking_changes.md) to help! + +- [ ] Yes +- [ ] No + +---- + diff --git a/.github/workflows/add_to_octokit_project.yml b/.github/workflows/add_to_octokit_project.yml new file mode 100644 index 00000000..936e1f4f --- /dev/null +++ b/.github/workflows/add_to_octokit_project.yml @@ -0,0 +1,20 @@ +name: Add PRs and issues to Octokit org project + +on: + issues: + types: [reopened, opened] + pull_request_target: + types: [reopened, opened] + +jobs: + add-to-project: + name: Add issue to project + runs-on: ubuntu-latest + continue-on-error: true + steps: + - uses: actions/add-to-project@v1.0.1 + with: + project-url: https://github.com/orgs/octokit/projects/10 + github-token: ${{ secrets.OCTOKITBOT_PROJECT_ACTION_TOKEN }} + labeled: "Status: Stale" + label-operator: NOT diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..a0f75437 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: "Build and validate Go generated SDK" + +on: + pull_request: + workflow_dispatch: + push: + branches: + - 3.14 + +jobs: + build: + strategy: + fail-fast: false + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - uses: actions/setup-go@v3.5.0 + with: + go-version: '1.21.4' + + - name: Build the SDK + run: go build ./... + + - name: Run unit tests + run: go test ./... diff --git a/.github/workflows/immediate-response.yml b/.github/workflows/immediate-response.yml new file mode 100644 index 00000000..8a29b200 --- /dev/null +++ b/.github/workflows/immediate-response.yml @@ -0,0 +1,29 @@ +name: Issue/PR response +permissions: + issues: write + pull-requests: write +on: + issues: + types: + - opened + pull_request_target: + types: + - opened +jobs: + respond-to-issue: + if: ${{ github.actor != 'dependabot[bot]' && github.actor != 'renovate[bot]' && github.actor != 'githubactions[bot]' && github.actor != 'octokitbot' }} + runs-on: ubuntu-latest + steps: + - name: Determine issue or PR number + id: extract + run: echo "NUMBER=${{ github.event.issue.number || github.event.pull_request.number }}" >> "$GITHUB_OUTPUT" + + - name: Respond to issue or PR + uses: peter-evans/create-or-update-comment@v4 + with: + issue-number: ${{ steps.extract.outputs.NUMBER }} + body: > + 👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! + We have a [process in place](https://github.com/octokit/.github/blob/main/community/prioritization_response.md#overview) for prioritizing and responding to your input. + Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with `Status: Up for grabs`. + You & others like you are the reason all of this works! So thank you & happy coding! 🚀 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..2f7cffe0 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,32 @@ +name: golangci-lint +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + checks: write + +jobs: + golangci: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: '1.21' + cache: false + - name: golangci-lint + uses: golangci/golangci-lint-action@v3 + with: + version: v1.55 + + # Optional: golangci-lint command line arguments. + # + # Note: By default, the `.golangci.yml` file should be at the root of the repository. + # The location of the configuration file can be changed by using `--config=` + # args: --timeout=30m --config=/my/path/.golangci.yml --issues-exit-code=0 + diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..e4d52083 --- /dev/null +++ b/.gitignore @@ -0,0 +1,97 @@ +# Kiota +.kiota.log + +# Created by https://www.toptal.com/developers/gitignore/api/visualstudiocode,go,linux,macos +# Edit at https://www.toptal.com/developers/gitignore?templates=visualstudiocode,go,linux,macos + +### Go ### +# If you prefer the allow list template instead of the deny list, see community template: +# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore +# +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +# Go workspace file +go.work + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### VisualStudioCode ### +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +!.vscode/*.code-snippets + +# Local History for Visual Studio Code +.history/ + +# Built Visual Studio Code Extensions +*.vsix + +### VisualStudioCode Patch ### +# Ignore all local history of files +.history +.ionide + +# End of https://www.toptal.com/developers/gitignore/api/visualstudiocode,go,linux,macos diff --git a/.golangci.toml b/.golangci.toml new file mode 100644 index 00000000..b3fb7e10 --- /dev/null +++ b/.golangci.toml @@ -0,0 +1,214 @@ + +[linters] + + # set all to disabled so we can manually enable only the ones we want + disable-all = true + + # This is a list is just the linters that are critical to run and pass on + # our code. These linters find bugs. If they find a problem with your code, + # you should fix it immediately. + # + # Take care when adding to this list, as any code that fails these linters + # anywhere in any repo that uses this linter will need to be fixed before + # that repo can updating the version of go-linter it's using. + enable = [ + "bodyclose", # checks whether HTTP response body is closed successfully + # Forgetting to close an HTTP body can be a memory leak + "durationcheck", # check for two durations multiplied together + # this is probably a rare bug, but should have basically zero false positives. + "exportloopref", # catch bugs resulting from referencing variables on range scope + # variables initialized in for loops change with each loop, which can cause bugs. + "gocritic", # Provides many diagnostics that check for bugs, performance and style issues. + # This is highly configurable, see the gocritic config section below. + "gosec", # Inspects source code for security problems + # high quality linter that finds real bugs + "govet", # reports suspicious constructs like printf calls that don't have the right # of arguments + # high quality, low false positives + "ineffassign", # Detects when assignments to existing variables are not used + # this finds bugs all the time, where you assign to a value but then never use + # the assigned value due to shadowing etc. + "nilerr", # Finds the code that returns nil even if it checks that the error is not nil. + # finds fairly common bug + "rowserrcheck", # checks whether Err of rows is checked successfully + # finds bugs in SQL code + "sqlclosecheck", # Checks that sql.Rows and sql.Stmt are closed. + # easy and finds bugs + ] + + # We manually enable only the linters we want, above, so we don't need a + # manual disable list as well. + disable = [] + +[run] + # options for analysis running + # Increase timeout from default 1m, first pre-cache run can take a bit in CI/CD + timeout = "5m" + + # default concurrency is the available CPU number + # concurrency = 4 + + # exit code when at least one issue was found, default is 1 + issues-exit-code = 1 + + # include test files or not, default is true + tests = true + + # list of build tags, all linters use it. Default is empty list. + build-tags = [] + + # which dirs to skip: issues from them won't be reported; + # can use regexp here: generated.*, regexp is applied on full path; + # default value is empty list, but default dirs are skipped independently + # from this option's value (see skip-dirs-use-default). + # "/" will be replaced by current OS file path separator to properly work + # on Windows. + skip-dirs = [] + + # default is true. Enables skipping of directories: + # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ + skip-dirs-use-default = true + + # which files to skip: they will be analyzed, but issues from them + # won't be reported. Default value is empty list, but there is + # no need to include all autogenerated files, we confidently recognize + # autogenerated files. If it's not please let us know. + # "/" will be replaced by current OS file path separator to properly work + # on Windows. + + # skipping pkg/github/markdown/raw_request_builder.go's error of + # "G104: Errors unhandled. + # "requestInfo.SetContentFromScalar(ctx, m.BaseRequestBuilder.RequestAdapter, "text/plain", body)" + # because it happens due to generation and is not quickly fixed. + # 'exclude' cannot be used here because the error text applies to many possible errors + # and we don't want to ignore other instances of this error + skip-files = [ "pkg/github/markdown/raw_request_builder.go" ] + + # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": + # If invoked with -mod=readonly, the go command is disallowed from the implicit + # automatic updating of go.mod described above. Instead, it fails when any changes + # to go.mod are needed. This setting is most useful to check that go.mod does + # not need updates, such as in a continuous integration and testing system. + # If invoked with -mod=vendor, the go command assumes that the vendor + # directory holds the correct copies of dependencies and ignores + # the dependency descriptions in go.mod. + modules-download-mode = "" + + # Allow multiple parallel golangci-lint instances running. + # If false (default) - golangci-lint acquires file lock on start. + allow-parallel-runners = false + +[output] + # colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions + # default is "colored-line-number" + format = "colored-line-number" + + # print lines of code with issue, default is true + print-issued-lines = true + + # print linter name in the end of issue text, default is true + print-linter-name = true + + # make issues output unique by line, default is true + uniq-by-line = true + + # add a prefix to the output file references; default is no prefix + path-prefix = "" + + # sorts results by: filepath, line and column + sort-results = true + +# options to enable differentiating between error and warning severities +[severity] + # GitHub Actions annotations support error and warning only: + # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message + default-severity = "error" + + # If set to true severity-rules regular expressions become case-sensitive. + # The default value is false. + case-sensitive = false + + # Default value is empty list. + # When a list of severity rules are provided, severity information will be added to lint + # issues. Severity rules have the same filtering capability as exclude rules except you + # are allowed to specify one matcher per severity rule. + # Only affects out formats that support setting severity information. + # [[severity.rules]] + # linters = [ + # "revive", + # ] + # severity = "warning" + +[issues] + # List of regexps of issue texts to exclude, empty list by default. + # Please document every exception here so we know what we're suppressing and why. + exclude = [] + + # Maximum issues count per one linter. Set to 0 to disable. Default is 50. + max-issues-per-linter = 0 + + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. + max-same-issues = 0 + + # The default value is false. If set to true exclude and exclude-rules + # regular expressions become case-sensitive. + # exclude-case-sensitive = false + + # This flag suppresses lint issues from several linters, overriding any other configuration you have set. + # It defaults to true. + # NEVER remove this configuration. If you want to suppress something, do so explicitly elsewhere. + exclude-use-default = false + + # The list of ids of default excludes to include or disable. By default it's empty. + # We shouldn't ever need this, since we turn off default excludes. + include = [] + + # Show only new issues: if there are unstaged changes or untracked files, + # only those changes are analyzed, else only changes in HEAD~ are analyzed. + # It's a super-useful option for integration of golangci-lint into existing + # large codebase. It's not practical to fix all existing issues at the moment + # of integration: much better don't allow issues in new code. + # Default is false. + new = false + + # Show only new issues created in git patch with set file path. + # new-from-patch = "path/to/patch/file" + + # Show only new issues created after git revision `REV` + # new-from-rev = "REV" + + # Fix found issues (if it's supported by the linter). Default is false. + fix = false + + # reduce noise in some linters that don't necessarily need to be run in tests + [[issues.exclude-rules]] + path = "_test\\.go" + linters = ["errcheck", "gosec", "noctx", "bodyclose"] + +# +# Specific Linter Settings +# + +[linters-settings.gocritic] + # Enable multiple checks by tags, run `GL_DEBUG=gocritic golangci-lint run` to see all tags and checks. + # Empty list by default. See https://github.com/go-critic/go-critic#usage -> section "Tags". + enabled-tags = [ + # "diagnostic", // enabled by default + ] + disabled-tags = ["style"] + disabled-checks = ["appendAssign"] + +[linters-settings.govet] + enable = [ "httpresponse" ] + +[linters-settings.gosec] + excludes = [ + "G110", # potential decompression bomb + "G204", # subprocess launched with variable. + "G301", # expect directory permissions to be 0750 or less. + "G302", # Expect file permissions to be 0600 or less. + "G304", # file inclusion via variable. + "G307", # deferring methods with errors. + "G404", # use of math/rand + ] +[linters-settings.gosec.config.G104] + os = ["Setenv"] diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..68af7da8 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "[go]": { + "editor.insertSpaces": false, + "editor.tabSize": 4, + "editor.formatOnSave": true + } +} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..722bb8df --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of experience, +nationality, personal appearance, race, religion, or sexual identity and +orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or +advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at [support@github.com](mailto:support@github.com). All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..fd61fb51 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,24 @@ +## How to contribute + +Please note that this project is released with a [Contributor Code of Conduct](./CODE_OF_CONDUCT.md). By participating you agree to abide by its terms. + +We appreciate you taking the time to contribute to Octokit or any of the projects in Octokit's ecosystem. Especially as a new contributor, you have a valuable perspective: you will find things confusing and run into problems that no longer occur to the maintainers. Please share them with us so we can make the experience for future contributors the best it can be. + +Thank you 💖 + +There are two types of contributions: issues and pull requests (PRs). Issues are used to track bugs and feature requests, while PRs contribute new content to the repository. + +## Creating an issue + +Before you create a new issue: +1. Search the [project's issues](https://github.com/octokit/go-sdk-enterprise-server/issues) to see if a similar issue already exists. If so, please add onto that issue rather than creating a new one. +1. If submitting a bug report, include steps and a minimal code sample that will reproduce the issue. +1. If submitting a feature request, please share the motivation for the new feature, what alternatives you considered, and any implementation suggestions. + +## Creating a pull request + +First, is your code a change to the generated source code present in `pkg/github`? If so, you'll want to go to [octokit/source-generator](https://github.com/octokit/source-generator) to modify the generation process. + +If your changes do need to be made here, fork the repository. If you're not sure how to do so, please read [the linked docs](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo). Then clone your fork and `cd` to that directory locally. + +Ensure that the `go build ./...` and `go test ./...` commands each succeed and result in no changes to the repository. Make your code changes (adding tests and documentation as necessary) and confirm the above validation steps still pass. If you'd like to debug the project, you can use VSCode's tooling to do so. When you're satisfied with your changes, follow [GitHub's docs](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) to create your PR. diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..e221025b --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Octokit + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 7833d288..6355283c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,135 @@ -# go-sdk-enterprise-server +> [!IMPORTANT] +> This SDK is not yet stable. Breaking changes may occur at any time. -Since GitHub Enterprise Server has [multiple supported versions](https://docs.github.com/en/enterprise-server/admin/all-releases) at any given time, this project uses branches to manage each version. +# github.com/octokit/go-sdk-enterprise-server -See [the repository's branches](https://github.com/octokit/go-sdk-enterprise-server/branches) to view your desired version. +An "alpha" version of a generated Go SDK for GitHub's Enterprise Server products, generated from [GitHub's OpenAPI spec](https://github.com/github/rest-api-description), built on [Kiota](https://github.com/microsoft/kiota). + +You may also want: + +- Go + - For the standard GitHub.com product + - [go-sdk repository](https://github.com/octokit/go-sdk) + - [pkg.go.dev docs link](https://pkg.go.dev/github.com/octokit/go-sdk) + - For GitHub Enterprise Cloud + - [go-sdk-enterprise-cloud repository](https://github.com/octokit/go-sdk-enterprise-cloud) + - [pkg.go.dev docs link](https://pkg.go.dev/github.com/octokit/go-sdk-enterprise-cloud) + - For GitHub Enterprise Server + - [go-sdk-enterprise-server repository](https://github.com/octokit/go-sdk-enterprise-server) + - [pkg.go.dev docs link](https://pkg.go.dev/github.com/octokit/go-sdk-enterprise-server) +- .NET + - For the standard GitHub.com product + - [dotnet-sdk repository](https://github.com/octokit/dotnet-sdk) + - [NuGet link](https://www.nuget.org/packages/GitHub.Octokit.SDK) + - For GitHub Enterprise Cloud + - [dotnet-sdk-enterprise-cloud repository](https://github.com/octokit/dotnet-sdk-enterprise-cloud) + - [NuGet link](https://www.nuget.org/packages/GitHub.Octokit.GHEC.SDK/) + - For GitHub Enterprise Server + - [dotnet-sdk-enterprise-server repository](https://github.com/octokit/dotnet-sdk-enterprise-server) + - [NuGet link](https://www.nuget.org/packages?q=GitHub.Octokit.GHES.SDK) + - For our classic non-generated, hand-maintained Octokit.net project + - [Octokit.net repository](https://github.com/octokit/octokit.net) + - [NuGet link](https://www.nuget.org/packages/Octokit/) +- [source-generator](https://github.com/octokit/source-generator) (the repository that creates these generated SDKs) + - Contributions to this repository should take place in source-generator instead, as they'll be distributed here through mechanisms there. +- For why we're building generative SDKs, see [Why a generated SDK?](#why-a-generated-sdk) below + +## How do I use it? + +See example client instantiations and requests in [example_test.go](pkg/example_test.go) or in the [cmd/ directory](cmd/). + +### Building and testing + +- Build the SDK: `go build ./...` +- Test the SDK: `go test ./...` + - Measure test coverage by package (e.g. `authentication`): `go test -v -coverpkg=./pkg/authentication -coverprofile=auth.cov ./pkg/authentication` + - Test coverage may be viewed in VS Code by running the command `Go: Toggle Test Coverage In Current Package` + - Alternately, you may run `go tool cover -html auth.cov -o auth.html` and open the generated `auth.html` file in a browser to view test coverage + +### Initializing + +Given that the GHES platform is a self hosted instance when using this SDK you'll need to initialize it with your host and protocol: + +```go +client, err := pkg.NewApiClient( + pkg.WithUserAgent("octokit/go-sdk.example-functions"), + pkg.WithRequestTimeout(5*time.Second), + pkg.WithBaseUrl("https://hosted.instance"), + pkg.WithTokenAuthentication(token), +) +``` + +or by using the `SetBaseUrl` function from the `kiotaHttp.NewNetHttpRequestAdapter` + +```go +tokenProvider := auth.NewTokenProvider( + auth.WithUserAgent("octokit/go-sdk.example-functions"), +) +adapter, err := kiotaHttp.NewNetHttpRequestAdapter(tokenProvider) +if err != nil { + log.Fatalf("Error creating request adapter: %v", err) +} +adapter.SetBaseUrl("https://hosted.instance") +client := github.NewApiClient(adapter) +``` + +Note: The examples in [the cmd/ directory in this repo](cmd/) use an enviromnent variable named `GITHUB_BASE_URL` if you'd prefer to set the base url of your hosted GitHub instance there while using the examples. + +### Authentication + +This SDK supports [Personal Access Tokens (classic)](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#personal-access-tokens-classic), [fine-grained Personal Access Tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#fine-grained-personal-access-tokens), and [GitHub Apps](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) authentication. + +In order to use either type of Personal Access token, you can use the `WithTokenAuthentication("YOUR_TOKEN_HERE")` functional option when constructing a client, like so: + +```go +client, err := pkg.NewApiClient( + pkg.WithTokenAuthentication(os.Getenv("GITHUB_TOKEN")), +) +if err != nil { + log.Fatalf("error creating client: %v", err) +} +``` + +In order to authenticate as a GitHub App, you can use the `WithGitHubAppAuthentication` functional option: + +```go +client, err := pkg.NewApiClient( + pkg.WithGitHubAppAuthentication("/path/to/your/pem/file.pem", "your-client-ID", yourInstallationIDInt), +) +if err != nil { + log.Fatalf("error creating client: %v", err) +} +``` + +To see more detailed examples, view [the cmd/ directory in this repo](cmd/). + +⚠️ **Note**: There are [three types](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/about-authentication-with-a-github-app) of GitHub App authentication: +1. [As the App itself (meta endpoints)](https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28) +1. [As an App installation](https://docs.github.com/en/rest/authentication/endpoints-available-for-github-app-installation-access-tokens?apiVersion=2022-11-28) +1. On behalf of a user + +Authenticating on behalf of a user is not supported in an SDK, as it requires a UI authentication flow with redirects. This SDK supports authenticating as the App itself and as an App installation. + +Note that the SDK **does not yet** support authenticating as the App itself and as an App installation using the same client transparently to the user. Authenticating as the App itself requires [creating a JSON Web Token (JWT)](https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-json-web-token-jwt-for-a-github-app) and using that as token authentication. For helpers to create and sign a JWT in Go, you may use the [golang-jwt/jwt](https://github.com/golang-jwt/jwt) library. + +Authenticating as an App installation can be done using the `WithGitHubAppAuthentication` functional option. Future work is planned to make the App meta endpoints vs. App installation endpoints auth schemes transparent to the user and only require one client setup. + +## Why a generated SDK? + +Please take a moment and head over to the GitHub blog to read more about the [why's and how's behind our move to Generative SDKs](https://github.blog/news-insights/product-news/our-move-to-generated-sdks/). + +## Why Go? + +We don't currently support a Go SDK and we wanted a narrow scope for the initial effort without worrying about cutting over users of an existing SDK. + +## How can I report on my experience or issues with the SDK? + +Please use this project's [issues](https://github.com/octokit/go-sdk-enterprise-server/issues)! + +## Releasing this project + +Periodically (based on the frequency of [this workflow](https://github.com/octokit/source-generator/blob/main/.github/workflows/build-go.yml)), the source-generator repository will ingest the latest version of [GitHub's OpenAPI spec](https://github.com/github/rest-api-description) and generate a new version of this SDK. If there is a diff, a PR (similar to [this one](https://github.com/octokit/go-sdk-enterprise-server/pull/22)) will be generated. + +When reviewing the PR, analyze the diff and determine whether the changes are breaking (for which a major version number must be incremented), feature additions (for which a minor version number must be incremented), or bug fixes or docs changes (for which a patch number must be incremented). For more details about how to select an appropriate semantic version, see [semver.org](https://semver.org/). In many/most cases, due to the scale of GitHub's specification and the rate of change on it, the diff will be large and the changes will be technically breaking. This will mean incrementing a major version number. If a major version is being incremented, it must be changed in the [go.mod](./go.mod) file as described in [these docs](https://go.dev/doc/modules/release-workflow#breaking). + +When changes are analyzed, change the PR title appropriately (see [this PR](https://github.com/octokit/go-sdk-enterprise-server/pull/40) for an example) and merge it. Then go to [repository releases](https://github.com/octokit/go-sdk-enterprise-server/releases), tag the release with the chosen version, title it with the chosen version, use the "Generate release notes" button to see what PRs will be included in the release, and manually edit the release notes grouping the changes under the headings `Features`, `Fixes`, `Maintenance`, and `Documentation` when appropriate. After clicking "Publish Release", the new version will be available for use! diff --git a/cmd/app-example/main.go b/cmd/app-example/main.go new file mode 100644 index 00000000..11c3197b --- /dev/null +++ b/cmd/app-example/main.go @@ -0,0 +1,54 @@ +package main + +import ( + "context" + "log" + "os" + "strconv" + "time" + + abs "github.com/microsoft/kiota-abstractions-go" + "github.com/octokit/go-sdk-enterprise-server/pkg" + "github.com/octokit/go-sdk-enterprise-server/pkg/github/installation" +) + +func main() { + installationID, err := strconv.ParseInt(os.Getenv("INSTALLATION_ID"), 10, 64) + if err != nil { + log.Fatalf("error parsing installation ID from string to int64: %v", err) + } + + baseURL := os.Getenv("GITHUB_BASE_URL") + if baseURL == "" { + baseURL = "https://api.github.com" + } + + client, err := pkg.NewApiClient( + pkg.WithUserAgent("my-user-agent"), + pkg.WithRequestTimeout(5*time.Second), + pkg.WithBaseUrl(baseURL), + pkg.WithGitHubAppAuthentication(os.Getenv("PATH_TO_PEM_FILE"), os.Getenv("CLIENT_ID"), installationID), + ) + + // equally valid: + //client, err := pkg.NewApiClient() + if err != nil { + log.Fatalf("error creating client: %v", err) + } + + queryParams := &installation.RepositoriesRequestBuilderGetQueryParameters{} + requestConfig := &abs.RequestConfiguration[installation.RepositoriesRequestBuilderGetQueryParameters]{ + QueryParameters: queryParams, + } + repos, err := client.Installation().Repositories().Get(context.Background(), requestConfig) + if err != nil { + log.Fatalf("error getting repositories: %v", err) + } + + if len(repos.GetRepositories()) > 0 { + log.Printf("Repositories:\n") + for _, repo := range repos.GetRepositories() { + log.Printf("%v\n", *repo.GetFullName()) + } + } +} diff --git a/cmd/token-example/main.go b/cmd/token-example/main.go new file mode 100644 index 00000000..ddec4fa4 --- /dev/null +++ b/cmd/token-example/main.go @@ -0,0 +1,43 @@ +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + abs "github.com/microsoft/kiota-abstractions-go" + "github.com/octokit/go-sdk-enterprise-server/pkg" +) + +func main() { + + baseURL := os.Getenv("GITHUB_BASE_URL") + if baseURL == "" { + baseURL = "https://api.github.com" + } + + client, err := pkg.NewApiClient( + pkg.WithUserAgent("my-user-agent"), + pkg.WithRequestTimeout(5*time.Second), + pkg.WithBaseUrl(baseURL), + pkg.WithTokenAuthentication(os.Getenv("GITHUB_TOKEN")), + ) + + // equally valid: + //client, err := pkg.NewApiClient() + if err != nil { + log.Fatalf("error creating client: %v", err) + } + + queryParams := &abs.DefaultQueryParameters{} + requestConfig := &abs.RequestConfiguration[abs.DefaultQueryParameters]{ + QueryParameters: queryParams, + } + zen, err := client.Zen().Get(context.Background(), requestConfig) + if err != nil { + log.Fatalf("error getting repositories: %v", err) + } + fmt.Printf("GitHub Zen principle: %v\n", *zen) +} diff --git a/go.mod b/go.mod new file mode 100644 index 00000000..dadccf36 --- /dev/null +++ b/go.mod @@ -0,0 +1,30 @@ +module github.com/octokit/go-sdk-enterprise-server + +go 1.21.5 + +require ( + github.com/google/uuid v1.6.0 + github.com/kfcampbell/ghinstallation v0.0.6 + github.com/microsoft/kiota-abstractions-go v1.7.0 + github.com/microsoft/kiota-http-go v1.4.5 + github.com/microsoft/kiota-serialization-form-go v1.0.0 + github.com/microsoft/kiota-serialization-json-go v1.0.8 + github.com/microsoft/kiota-serialization-multipart-go v1.0.0 + github.com/microsoft/kiota-serialization-text-go v1.0.0 +) + +require ( + github.com/cjlapao/common-go v0.0.39 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/go-logr/logr v1.4.1 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/golang-jwt/jwt/v5 v5.2.1 // indirect + github.com/octokit/go-sdk v0.0.13 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/std-uritemplate/std-uritemplate/go v0.0.57 // indirect + github.com/stretchr/testify v1.9.0 // indirect + go.opentelemetry.io/otel v1.24.0 // indirect + go.opentelemetry.io/otel/metric v1.24.0 // indirect + go.opentelemetry.io/otel/trace v1.24.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) diff --git a/go.sum b/go.sum new file mode 100644 index 00000000..1496afe1 --- /dev/null +++ b/go.sum @@ -0,0 +1,52 @@ +github.com/cjlapao/common-go v0.0.39 h1:bAAUrj2B9v0kMzbAOhzjSmiyDy+rd56r2sy7oEiQLlA= +github.com/cjlapao/common-go v0.0.39/go.mod h1:M3dzazLjTjEtZJbbxoA5ZDiGCiHmpwqW9l4UWaddwOA= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.1 h1:pKouT5E8xu9zeFC39JXRDukb6JFQPXM5p5I91188VAQ= +github.com/go-logr/logr v1.4.1/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/kfcampbell/ghinstallation v0.0.6 h1:L4QkjRqNosJ6Kyetymq7FswY1wUxMQO+fyYXJAWl0WY= +github.com/kfcampbell/ghinstallation v0.0.6/go.mod h1:UXWfCKaLwF+AiyCo8gxE5oA0VMQsAmCdRXgTyyRdUnA= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/microsoft/kiota-abstractions-go v1.7.0 h1:/0OKSSEe94Z1qgpcGE7ZFI9P+4iAnsDQo9v9UOk+R8E= +github.com/microsoft/kiota-abstractions-go v1.7.0/go.mod h1:FI1I2OHg0E7bK5t8DPnw+9C/CHVyLP6XeqDBT+95pTE= +github.com/microsoft/kiota-http-go v1.4.5 h1:BrI9TZ0cWiU1ucP5oSWR6UmP2vR3PaKbQ61TQ/qM5cM= +github.com/microsoft/kiota-http-go v1.4.5/go.mod h1:Kup5nMDD3a9sjdgRKHCqZWqtrv3FbprjcPaGjLR6FzM= +github.com/microsoft/kiota-serialization-form-go v1.0.0 h1:UNdrkMnLFqUCccQZerKjblsyVgifS11b3WCx+eFEsAI= +github.com/microsoft/kiota-serialization-form-go v1.0.0/go.mod h1:h4mQOO6KVTNciMF6azi1J9QB19ujSw3ULKcSNyXXOMA= +github.com/microsoft/kiota-serialization-json-go v1.0.8 h1:+aViv9k6wqaw1Fx6P49fl5GIB1hN3b6CG0McNTcUYBc= +github.com/microsoft/kiota-serialization-json-go v1.0.8/go.mod h1:O8+v11U0EUwHlCz7hrW38KxDmdhKAHfv4Q89uvsBalY= +github.com/microsoft/kiota-serialization-multipart-go v1.0.0 h1:3O5sb5Zj+moLBiJympbXNaeV07K0d46IfuEd5v9+pBs= +github.com/microsoft/kiota-serialization-multipart-go v1.0.0/go.mod h1:yauLeBTpANk4L03XD985akNysG24SnRJGaveZf+p4so= +github.com/microsoft/kiota-serialization-text-go v1.0.0 h1:XOaRhAXy+g8ZVpcq7x7a0jlETWnWrEum0RhmbYrTFnA= +github.com/microsoft/kiota-serialization-text-go v1.0.0/go.mod h1:sM1/C6ecnQ7IquQOGUrUldaO5wj+9+v7G2W3sQ3fy6M= +github.com/octokit/go-sdk v0.0.13 h1:DdJfWFeGUoFRHY82dxquRdBl9GvE1Vk7g2dVOjMyGpQ= +github.com/octokit/go-sdk v0.0.13/go.mod h1:T65KGdB1QQvRbvd9MmuNGieldRyxMj45omX1vizOUu4= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/std-uritemplate/std-uritemplate/go v0.0.57 h1:GHGjptrsmazP4IVDlUprssiEf9ESVkbjx15xQXXzvq4= +github.com/std-uritemplate/std-uritemplate/go v0.0.57/go.mod h1:rG/bqh/ThY4xE5de7Rap3vaDkYUT76B0GPJ0loYeTTc= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= +go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo= +go.opentelemetry.io/otel/metric v1.24.0 h1:6EhoGWWK28x1fbpA4tYTOWBkPefTDQnb8WSGXlc88kI= +go.opentelemetry.io/otel/metric v1.24.0/go.mod h1:VYhLe1rFfxuTXLgj4CBiyz+9WYBA8pNGJgDcSFRKBco= +go.opentelemetry.io/otel/trace v1.24.0 h1:CsKnnL4dUAr/0llH9FKuc698G04IrpWV0MQA/Y1YELI= +go.opentelemetry.io/otel/trace v1.24.0/go.mod h1:HPc3Xr/cOApsBI154IU0OI0HJexz+aw5uPdbs3UCjNU= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/authentication/request.go b/pkg/authentication/request.go new file mode 100644 index 00000000..f6c1060f --- /dev/null +++ b/pkg/authentication/request.go @@ -0,0 +1,49 @@ +package authentication + +import ( + "fmt" + + abs "github.com/microsoft/kiota-abstractions-go" + "github.com/octokit/go-sdk-enterprise-server/pkg/headers" +) + +// Request provides a wrapper around Kiota's abs.RequestInformation type +type Request struct { + *abs.RequestInformation +} + +// WithTokenAuthentication sets the Authorization header to the given token, +// prepended by the AuthType +func (r *Request) WithTokenAuthentication(token string) { + if r.Headers.ContainsKey(headers.AuthorizationKey) { + r.Headers.Remove(headers.AuthorizationKey) + } + r.Headers.Add(headers.AuthorizationKey, fmt.Sprintf("%v %v", headers.AuthType, token)) +} + +// WithUserAgent allows the caller to set the User-Agent string for each request +func (r *Request) WithUserAgent(userAgent string) { + if r.Headers.ContainsKey(headers.UserAgentKey) { + r.Headers.Remove(headers.UserAgentKey) + } + r.Headers.Add(headers.UserAgentKey, userAgent) +} + +// WithDefaultUserAgent sets the default User-Agent string for each request +func (r *Request) WithDefaultUserAgent() { + r.WithUserAgent(headers.UserAgentValue) +} + +// WithAPIVersion sets the API version header for each request +func (r *Request) WithAPIVersion(version string) { + if r.Headers.ContainsKey(headers.APIVersionKey) { + r.Headers.Remove(headers.APIVersionKey) + } + r.Headers.Add(headers.APIVersionKey, version) +} + +// WithDefaultAPIVersion sets the API version header to the default (the version used +// to generate the code) for each request +func (r *Request) WithDefaultAPIVersion() { + r.WithAPIVersion(headers.APIVersionValue) +} diff --git a/pkg/authentication/token_provider.go b/pkg/authentication/token_provider.go new file mode 100644 index 00000000..d610c8db --- /dev/null +++ b/pkg/authentication/token_provider.go @@ -0,0 +1,89 @@ +package authentication + +import ( + "context" + + abs "github.com/microsoft/kiota-abstractions-go" +) + +// TokenProvider may use a token to authenticate each request. It also can be +// used to configure UserAgent strings, API Versions, and other request configuration. +// Note that GitHub App authentication is set at the client transport level. See the +// docs for pkg.NewApiClient for more. +type TokenProvider struct { + options []TokenProviderOption +} + +// TokenProviderOption provides a functional option +// for configuring a TokenProvider. +type TokenProviderOption func(*TokenProvider, *Request) + +// WithTokenAuthentication sets the AuthorizationToken for each request to the given token. +func WithTokenAuthentication(token string) TokenProviderOption { + return func(t *TokenProvider, r *Request) { + r.WithTokenAuthentication(token) + } +} + +// WithDefaultUserAgent sets the User-Agent string sent for requests to the default +// for this SDK. +func WithDefaultUserAgent() TokenProviderOption { + return func(t *TokenProvider, r *Request) { + r.WithDefaultUserAgent() + } +} + +// WithUserAgent sets the User-Agent string sent with each request. +func WithUserAgent(userAgent string) TokenProviderOption { + return func(t *TokenProvider, r *Request) { + r.WithUserAgent(userAgent) + } +} + +// WithDefaultAPIVersion sets the API version header sent with each request. +func WithDefaultAPIVersion() TokenProviderOption { + return func(t *TokenProvider, r *Request) { + r.WithDefaultAPIVersion() + } +} + +// WithAPIVersion sets the API version header sent with each request. +func WithAPIVersion(version string) TokenProviderOption { + return func(t *TokenProvider, r *Request) { + r.WithAPIVersion(version) + } +} + +// TODO(kfcampbell): implement new constructor with allowedHosts + +// NewTokenProvider creates an instance of TokenProvider with the specified token and options. +func NewTokenProvider(options ...TokenProviderOption) *TokenProvider { + provider := &TokenProvider{ + options: options, + } + return provider +} + +// defaultHandlers contains our "sensible defaults" for TokenProvider initialization +var defaultHandlers = []TokenProviderOption{WithDefaultUserAgent(), WithDefaultAPIVersion()} + +// AuthenticateRequest applies the default options for each request, then the user's options +// (if present in the TokenProvider). User options are guaranteed to be run in the order they +// were input. +func (t *TokenProvider) AuthenticateRequest(context context.Context, request *abs.RequestInformation, additionalAuthenticationContext map[string]interface{}) error { + reqWrapper := &Request{RequestInformation: request} + + if reqWrapper.Headers == nil { + reqWrapper.Headers = abs.NewRequestHeaders() + } + + for _, option := range defaultHandlers { + option(t, reqWrapper) + } + + // apply user options after defaults + for _, option := range t.options { + option(t, reqWrapper) + } + return nil +} diff --git a/pkg/authentication/token_provider_test.go b/pkg/authentication/token_provider_test.go new file mode 100644 index 00000000..2c92e680 --- /dev/null +++ b/pkg/authentication/token_provider_test.go @@ -0,0 +1,186 @@ +package authentication_test + +import ( + "context" + "fmt" + "log" + "os" + "strings" + "testing" + "time" + + abstractions "github.com/microsoft/kiota-abstractions-go" + "github.com/octokit/go-sdk-enterprise-server/pkg" + "github.com/octokit/go-sdk-enterprise-server/pkg/authentication" + "github.com/octokit/go-sdk-enterprise-server/pkg/github/user" + "github.com/octokit/go-sdk-enterprise-server/pkg/headers" +) + +func TestTokenIsSetInAuthenticatedRequest(t *testing.T) { + token := "help i'm trapped in a Go binary" + provider := authentication.NewTokenProvider(authentication.WithTokenAuthentication(token)) + + reqInfo := abstractions.NewRequestInformation() + addtlContext := make(map[string]interface{}) + + err := provider.AuthenticateRequest(context.Background(), reqInfo, addtlContext) + if err != nil { + t.Errorf("there should be no error when calling AuthenticateRequest") + } + + if len(reqInfo.Headers.Get(headers.AuthorizationKey)) != 1 { + t.Errorf("there should be exactly one authorization key") + } + + receivedToken := reqInfo.Headers.Get(headers.AuthorizationKey)[0] + if !strings.Contains(receivedToken, token) { + t.Errorf("received token doesn't match up with given token") + } +} + +// TODO(kfcampbell): this code could be refactored to use table-based tests +func TestDefaultRequestOptions(t *testing.T) { + token := "this is not the token you're looking for" + provider := authentication.NewTokenProvider(authentication.WithTokenAuthentication(token)) + reqInfo := abstractions.NewRequestInformation() + addtlContext := make(map[string]interface{}) + + err := provider.AuthenticateRequest(context.Background(), reqInfo, addtlContext) + if err != nil { + t.Errorf("there should be no error when calling AuthenticateRequest") + } + + apiVersions := reqInfo.Headers.Get(headers.APIVersionKey) + if len(apiVersions) != 1 { + t.Errorf("exactly one API version should be present in the request") + } + + if apiVersions[0] != headers.APIVersionValue { + t.Errorf("default API version is set incorrectly") + } + + userAgents := reqInfo.Headers.Get(headers.UserAgentKey) + if len(userAgents) != 1 { + t.Errorf("exactly one user agent string should be present in the request") + } + + if userAgents[0] != headers.UserAgentValue { + t.Errorf("default user agent string is set incorrectly") + } +} + +func TestOverwritingDefaultRequestOptions(t *testing.T) { + token := "i'm totally a real token" + apiVersion := "i'm totally a real API version" + userAgent := "i'm totally a real user agent" + provider := authentication.NewTokenProvider( + authentication.WithTokenAuthentication(token), + authentication.WithAPIVersion(apiVersion), + authentication.WithUserAgent(userAgent)) + + reqInfo := abstractions.NewRequestInformation() + addtlContext := make(map[string]interface{}) + + err := provider.AuthenticateRequest(context.Background(), reqInfo, addtlContext) + if err != nil { + t.Errorf("should be no error when calling authenticated request") + } + + apiVersions := reqInfo.Headers.Get(headers.APIVersionKey) + if len(apiVersions) != 1 { + t.Errorf("exactly one API version should be present in the request") + } + + if apiVersions[0] != apiVersion { + t.Errorf("default API version is set incorrectly") + } + + userAgents := reqInfo.Headers.Get(headers.UserAgentKey) + if len(userAgents) != 1 { + t.Errorf("exactly one user agent string should be present in the request") + } + + if userAgents[0] != userAgent { + t.Errorf("default user agent string is set incorrectly") + } + +} + +func TestAnonymousAuthIsAllowed(t *testing.T) { + provider := authentication.NewTokenProvider() + reqInfo := abstractions.NewRequestInformation() + addtlContext := make(map[string]interface{}) + + err := provider.AuthenticateRequest(context.Background(), reqInfo, addtlContext) + if err != nil { + t.Errorf("should be no error when calling authenticated request") + } + + authorizations := reqInfo.Headers.Get(headers.AuthorizationKey) + if len(authorizations) != 0 { + t.Errorf("no authorization header should be present in the request") + } +} + +func TestTokenSetInRequestIsNotOverwritten(t *testing.T) { + providerToken := "dit dit dit / dat dat dat / dit dit dit" + provider := authentication.NewTokenProvider( + authentication.WithTokenAuthentication(providerToken), + ) + + requestToken := "dit dit dit dit / dit / dit dat dit dit / dit dat dat dit" + requestHeaders := abstractions.NewRequestHeaders() + requestHeaders.Add(headers.AuthType, requestToken) + + reqInfo := abstractions.NewRequestInformation() + reqInfo.Headers = requestHeaders + addtlContext := make(map[string]interface{}) + + err := provider.AuthenticateRequest(context.Background(), reqInfo, addtlContext) + if err != nil { + t.Errorf("AuthenticateRequest should not error") + } + reqInfoToken := reqInfo.Headers.Get(headers.AuthorizationKey)[0] + + if !strings.Contains(reqInfoToken, providerToken) { + t.Errorf("received token doesn't match up with given token") + } +} + +// TODO(kfcampbell): make a more permanent decision about how to structure +// and separately run unit vs. integration tests +func TestHappyPathIntegration(t *testing.T) { + token := os.Getenv("GITHUB_TOKEN") + if token == "" { + t.Skip("in order to run integration tests, ensure a valid GITHUB_TOKEN exists in the environment") + } + + // TODO: Rework this test to fit the platform needs of GHES + client, err := pkg.NewApiClient( + pkg.WithUserAgent("octokit/go-sdk.example-functions"), + pkg.WithRequestTimeout(5*time.Second), + pkg.WithBaseUrl("https://api.github.com"), + pkg.WithTokenAuthentication(token), + ) + + if err != nil { + log.Fatalf("error creating client: %v", err) + } + + headers := abstractions.NewRequestHeaders() + _ = headers.TryAdd("Accept", "application/vnd.github.v3+json") + + // Create a new instance of abstractions.RequestConfiguration + requestConfig := &abstractions.RequestConfiguration[user.EmailsRequestBuilderGetQueryParameters]{ + Headers: headers, + } + + userEmails, err := client.User().Emails().Get(context.Background(), requestConfig) + if err != nil { + log.Fatalf("%v\n", err) + } + + for _, v := range userEmails { + fmt.Printf("%v\n", *v.GetEmail()) + } +} diff --git a/pkg/client.go b/pkg/client.go new file mode 100644 index 00000000..e9d9ce46 --- /dev/null +++ b/pkg/client.go @@ -0,0 +1,194 @@ +package pkg + +import ( + "fmt" + "net/http" + "time" + + "github.com/kfcampbell/ghinstallation" + kiotaHttp "github.com/microsoft/kiota-http-go" + auth "github.com/octokit/go-sdk-enterprise-server/pkg/authentication" + "github.com/octokit/go-sdk-enterprise-server/pkg/github" + "github.com/octokit/go-sdk-enterprise-server/pkg/handlers" +) + +// NewApiClient is a convenience constructor to create a new instance of a +// Client (wrapper of *github.ApiClient) with the provided option functions. +// By default, it includes a rate limiting middleware. +func NewApiClient(optionFuncs ...ClientOptionFunc) (*Client, error) { + options, err := GetDefaultClientOptions() + if err != nil { + return nil, fmt.Errorf("failed to get default client options: %v", err) + } + for _, optionFunc := range optionFuncs { + optionFunc(options) + } + + rateLimitHandler := handlers.NewRateLimitHandler() + middlewares := options.Middleware + middlewares = append(middlewares, rateLimitHandler) + defaultTransport := kiotaHttp.GetDefaultTransport() + netHttpClient := &http.Client{ + Transport: defaultTransport, + } + + if options.RequestTimeout != 0 { + netHttpClient.Timeout = options.RequestTimeout + } + + if (options.GitHubAppID != 0 || options.GitHubAppClientID != "") && options.GitHubAppInstallationID != 0 && options.GitHubAppPemFilePath != "" { + existingTransport := netHttpClient.Transport + var appTransport *ghinstallation.Transport + var err error + + if options.GitHubAppClientID != "" { + appTransport, err = ghinstallation.NewKeyFromFile(existingTransport, options.GitHubAppClientID, options.GitHubAppInstallationID, options.GitHubAppPemFilePath) + } else { + appTransport, err = ghinstallation.NewKeyFromFileWithAppID(existingTransport, options.GitHubAppID, options.GitHubAppInstallationID, options.GitHubAppPemFilePath) + } + + if err != nil { + return nil, fmt.Errorf("failed to create transport from GitHub App: %v", err) + } + + netHttpClient.Transport = appTransport + } + + // Middleware must be applied after App transport is set, otherwise App token will fail to be + // renewed with a 400 Bad Request error (even though the request is identical to a successful one.) + finalTransport := kiotaHttp.NewCustomTransportWithParentTransport(netHttpClient.Transport, middlewares...) + netHttpClient.Transport = finalTransport + + tokenProviderOptions := []auth.TokenProviderOption{ + auth.WithAPIVersion(options.APIVersion), + auth.WithUserAgent(options.UserAgent), + } + + // If a PAT is provided and GitHub App information is not, configure token authentication + if options.Token != "" && (options.GitHubAppInstallationID == 0 && options.GitHubAppPemFilePath == "") { + tokenProviderOptions = append(tokenProviderOptions, auth.WithTokenAuthentication(options.Token)) + } + + tokenProvider := auth.NewTokenProvider(tokenProviderOptions...) + + adapter, err := kiotaHttp.NewNetHttpRequestAdapterWithParseNodeFactoryAndSerializationWriterFactoryAndHttpClient(tokenProvider, nil, nil, netHttpClient) + if err != nil { + return nil, fmt.Errorf("failed to create request adapter: %v", err) + } + if options.BaseURL != "" { + adapter.SetBaseUrl(options.BaseURL) + } + + client := github.NewApiClient(adapter) + sdkClient := &Client{ + ApiClient: client, + } + + return sdkClient, nil +} + +// Client wraps github.ApiClient so that we may provide neater constructors and ease of use +type Client struct { + *github.ApiClient +} + +// ClientOptions contains every setting we could possibly want to set for the token provider, +// the netHttpClient, the middleware, and the adapter. If we can possibly override it, it should +// be in this struct. +// In the constructor, when helper functions apply options, they'll be applied to this struct. +// Then later in the constructor when that chain of objects is put together, all configuration +// will be drawn from this (hydrated) struct. +type ClientOptions struct { + UserAgent string + APIVersion string + RequestTimeout time.Duration + Middleware []kiotaHttp.Middleware + BaseURL string + + // Token should be left blank if GitHub App auth or an unauthenticated client is desired. + Token string + + // GitHubAppPemFilePath should be left blank if token auth or an unauthenticated client is desired. + GitHubAppPemFilePath string + // GitHubAppID should be left blank if token auth or an unauthenticated client is desired. + // Deprecated: Use GitHubAppClientID instead. + GitHubAppID int64 + // GitHubAppClientID should be left blank if token auth or an unauthenticated client is desired. + GitHubAppClientID string + // GitHubAppInstallationID should be left blank if token auth or an unauthenticated client is desired. + GitHubAppInstallationID int64 +} + +// GetDefaultClientOptions returns a new instance of ClientOptions with default values. +// This is used in the NewApiClient constructor before applying user-defined custom options. +func GetDefaultClientOptions() (*ClientOptions, error) { + turnOffCompression := kiotaHttp.NewCompressionOptions(false) + middlewares, err := kiotaHttp.GetDefaultMiddlewaresWithOptions(&turnOffCompression) + if err != nil { + return nil, fmt.Errorf("failed to get middleware with compression turned off: %v", err) + } + return &ClientOptions{ + UserAgent: "octokit/go-sdk", + APIVersion: "2022-11-28", + Middleware: middlewares, + }, nil +} + +// ClientOptionFunc provides a functional pattern for client configuration +type ClientOptionFunc func(*ClientOptions) + +// WithUserAgent configures the client with the given user agent string. +func WithUserAgent(userAgent string) ClientOptionFunc { + return func(c *ClientOptions) { + c.UserAgent = userAgent + } +} + +// WithRequestTimeout configures the client with the given request timeout. +func WithRequestTimeout(timeout time.Duration) ClientOptionFunc { + return func(c *ClientOptions) { + c.RequestTimeout = timeout + } +} + +// WithBaseUrl configures the client with the given base URL. +func WithBaseUrl(baseURL string) ClientOptionFunc { + return func(c *ClientOptions) { + c.BaseURL = baseURL + } +} + +// WithTokenAuthentication configures the client with the given +// Personal Authorization Token. +func WithTokenAuthentication(token string) ClientOptionFunc { + return func(c *ClientOptions) { + c.Token = token + } +} + +// WithAPIVersion configures the client with the given API version. +func WithAPIVersion(version string) ClientOptionFunc { + return func(c *ClientOptions) { + c.APIVersion = version + } +} + +// WithGitHubAppAuthenticationUsingAppID configures the client with the given GitHub App +// auth. Deprecated: Use WithGitHubAppAuthentication instead, which takes in a clientID +// string instead of an appID integer. +func WithGitHubAppAuthenticationUsingAppID(pemFilePath string, appID int64, installationID int64) ClientOptionFunc { + return func(c *ClientOptions) { + c.GitHubAppPemFilePath = pemFilePath + c.GitHubAppID = appID + c.GitHubAppInstallationID = installationID + } +} + +// WithGitHubAppAuthentication configures the client with the given GitHub App auth. +func WithGitHubAppAuthentication(pemFilePath string, clientID string, installationID int64) ClientOptionFunc { + return func(c *ClientOptions) { + c.GitHubAppPemFilePath = pemFilePath + c.GitHubAppClientID = clientID + c.GitHubAppInstallationID = installationID + } +} diff --git a/pkg/client_test.go b/pkg/client_test.go new file mode 100644 index 00000000..a7e3af8d --- /dev/null +++ b/pkg/client_test.go @@ -0,0 +1,135 @@ +package pkg + +import ( + "os" + "testing" + + "github.com/octokit/go-sdk-enterprise-server/pkg/headers" +) + +const ( + installationID = 1234 + clientID = "testClientID" + pemFileName = "testPemFile" + token = "testToken" + appID = 123 +) + +// test key taken from Go source code at +// https://go.dev/src/crypto/rsa/rsa_test.go +var key = []byte(`-----BEGIN TESTING KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDNoyFUYeDuqw+k +iyv47iBy/udbWmQdpbUZ8JobHv8uQrvL7sQN6l83teHgNJsXqtiLF3MC+K+XI6Dq +hxUWfQwLip8WEnv7Jx/+53S8yp/CS4Jw86Q1bQHbZjFDpcoqSuwAxlegw18HNZCY +fpipYnA1lYCm+MTjtgXJQbjA0dwUGCf4BDMqt+76Jk3XZF5975rftbkGoT9eu8Jt +Xs5F5Xkwd8q3fkQz+fpLW4u9jrfFyQ61RRFkYrCjlhtGjYIzBHGgQM4n/sNXhiy5 +h0tA7Xa6NyYrN/OXe/Y1K8Rz/tzlvbMoxgZgtBuKo1N3m8ckFi7hUVK2eNv7GoAb +teTTPrg/AgMBAAECggEAAnfsVpmsL3R0Bh4gXRpPeM63H6e1a8B8kyVwiO9o0cXX +gKp9+P39izfB0Kt6lyCj/Wg+wOQT7rg5qy1yIw7fBHGmcjquxh3uN0s3YZ+Vcym6 +SAY5f0vh/OyJN9r3Uv8+Pc4jtb7So7QDzdWeZurssBmUB0avAMRdGNFGP5SyILcz +l3Q59hTxQ4czRHKjZ06L1/sA+tFVbO1j39FN8nMOU/ovLF4lAmZTkQ6AP6n6XPHP +B8Nq7jSYz6RDO200jzp6UsdrnjjkJRbzOxN/fn+ckCP+WYuq+y/d05ET9PdVa4qI +Jyr80D9QgHmfztcecvYwoskGnkb2F4Tmp0WnAj/xVQKBgQD4TrMLyyHdbAr5hoSi +p+r7qBQxnHxPe2FKO7aqagi4iPEHauEDgwPIcsOYota1ACiSs3BaESdJAClbqPYd +HDI4c2DZ6opux6WYkSju+tVXYW6qarR3fzrP3fUCdz2c2NfruWOqq8YmjzAhTNPm +YzvtzTdwheNYV0Vi71t1SfZmfQKBgQDUAgSUcrgXdGDnSbaNe6KwjY5oZWOQfZe2 +DUhqfN/JRFZj+EMfIIh6OQXnZqkp0FeRdfRAFl8Yz8ESHEs4j+TikLJEeOdfmYLS +TWxlMPDTUGbUvSf4g358NJ8TlfYA7dYpSTNPXMRSLtsz1palmaDBTE/V2xKtTH6p +VglRNRUKawKBgCPqBh2TkN9czC2RFkgMb4FcqycN0jEQ0F6TSnVVhtNiAzKmc8s1 +POvWJZJDIzjkv/mP+JUeXAdD/bdjNc26EU126rA6KzGgsMPjYv9FymusDPybGGUc +Qt5j5RcpNgEkn/5ZPyAlXjCfjz+RxChTfAyGHRmqU9qoLMIFir3pJ7llAoGBAMNH +sIxENwlzqyafoUUlEq/pU7kZWuJmrO2FwqRDraYoCiM/NCRhxRQ/ng6NY1gejepw +abD2alXiV4alBSxubne6rFmhvA00y2mG40c6Ezmxn2ZpbX3dMQ6bMcPKp7QnXtLc +mCSL4FGK02ImUNDsd0RVVFw51DRId4rmsuJYMK9NAoGAKlYdc4784ixTD2ZICIOC +ZWPxPAyQUEA7EkuUhAX1bVNG6UJTYA8kmGcUCG4jPTgWzi00IyUUr8jK7efyU/zs +qiJuVs1bia+flYIQpysMl1VzZh8gW1nkB4SVPm5l2wBvVJDIr9Mc6rueC/oVNkh2 +fLVGuFoTVIu2bF0cWAjNNMg= +-----END TESTING KEY-----`) + +func TestNewApiClientUnauthenticatedHappyPath(t *testing.T) { + client, err := NewApiClient( + WithAPIVersion(headers.APIVersionValue), + ) + if err != nil { + t.Fatalf("error creating client: %v", err) + } + if client == nil { + t.Fatalf("client is nil") + } +} + +func TestNewApiClientTokenAuthHappyPath(t *testing.T) { + client, err := NewApiClient(WithTokenAuthentication(token)) + if err != nil { + t.Fatalf("error creating client: %v", err) + } + if client == nil { + t.Fatalf("client is nil") + } +} + +func TestNewApiClientAppAuthHappyPath(t *testing.T) { + tmpfile, err := os.CreateTemp("", pemFileName) + if err != nil { + t.Fatal(err) + } + defer os.Remove(tmpfile.Name()) + + if _, err := tmpfile.Write(key); err != nil { + t.Fatal(err) + } + if err := tmpfile.Close(); err != nil { + t.Fatal(err) + } + + client, err := NewApiClient(WithGitHubAppAuthentication(tmpfile.Name(), clientID, installationID)) + if err != nil { + t.Fatalf("error creating client: %v", err) + } + if client == nil { + t.Fatalf("client is nil") + } +} + +func TestNewApiClientAppAuthErrorGettingKeyFromFile(t *testing.T) { + client, err := NewApiClient(WithGitHubAppAuthentication("pem/file/does/not/exist.pem", clientID, installationID)) + if err == nil { + t.Fatalf("expected error creating client") + } + if client != nil { + t.Fatalf("client is not nil") + } +} + +func TestNewApiClientAppAuthWithAppIDHappyPath(t *testing.T) { + tmpfile, err := os.CreateTemp("", pemFileName) + if err != nil { + t.Fatal(err) + } + defer os.Remove(tmpfile.Name()) + + if _, err := tmpfile.Write(key); err != nil { + t.Fatal(err) + } + if err := tmpfile.Close(); err != nil { + t.Fatal(err) + } + + client, err := NewApiClient(WithGitHubAppAuthenticationUsingAppID(tmpfile.Name(), appID, installationID)) + if err != nil { + t.Fatalf("error creating client: %v", err) + } + if client == nil { + t.Fatalf("client is nil") + } +} + +func TestNewApiClientAppAuthWithAppIDErrorGettingKeyFromFile(t *testing.T) { + client, err := NewApiClient(WithGitHubAppAuthenticationUsingAppID("pem/file/does/not/exist.pem", appID, installationID)) + if err == nil { + t.Fatalf("expected error creating client") + } + if client != nil { + t.Fatalf("client is not nil") + } +} diff --git a/pkg/example_test.go b/pkg/example_test.go new file mode 100644 index 00000000..fa583322 --- /dev/null +++ b/pkg/example_test.go @@ -0,0 +1,152 @@ +package pkg_test + +import ( + "context" + "fmt" + "log" + "os" + "time" + + abs "github.com/microsoft/kiota-abstractions-go" + kiotaHttp "github.com/microsoft/kiota-http-go" + "github.com/octokit/go-sdk-enterprise-server/pkg" + auth "github.com/octokit/go-sdk-enterprise-server/pkg/authentication" + "github.com/octokit/go-sdk-enterprise-server/pkg/github" + "github.com/octokit/go-sdk-enterprise-server/pkg/github/octocat" +) + +// ExampleApiClient_Octocat constructs an unauthenticated API client +// and makes a simple API request. +func ExampleApiClient_Octocat() { + + baseURL := os.Getenv("GITHUB_BASE_URL") + if baseURL == "" { + baseURL = "https://api.github.com" + } + + client, err := pkg.NewApiClient( + pkg.WithUserAgent("octokit/go-sdk.example-functions"), + pkg.WithRequestTimeout(5*time.Second), + pkg.WithBaseUrl(baseURL), + pkg.WithTokenAuthentication(os.Getenv("GITHUB_TOKEN")), + ) + + // equally valid: + //client, err := pkg.NewApiClient() + if err != nil { + log.Fatalf("error creating client: %v", err) + } + + s := "Salutations" + + // create headers that accept json back; GitHub's OpenAPI definition says + // octet-stream but that's not actually what the API returns in this case + headers := abs.NewRequestHeaders() + _ = headers.TryAdd("Accept", "application/vnd.github.v3+json") + + octocatRequestConfig := &abs.RequestConfiguration[octocat.OctocatRequestBuilderGetQueryParameters]{ + QueryParameters: &octocat.OctocatRequestBuilderGetQueryParameters{ + S: &s, + }, + Headers: headers, + } + + cat, err := client.Octocat().Get(context.Background(), octocatRequestConfig) + if err != nil { + log.Fatalf("error getting octocat: %v", err) + } + fmt.Printf("%v\n", string(cat)) + // Output: + // MMM. .MMM + // MMMMMMMMMMMMMMMMMMM + // MMMMMMMMMMMMMMMMMMM _____________ + // MMMMMMMMMMMMMMMMMMMMM | | + // MMMMMMMMMMMMMMMMMMMMMMM | Salutations | + // MMMMMMMMMMMMMMMMMMMMMMMM |_ _________| + // MMMM::- -:::::::- -::MMMM |/ + // MM~:~ 00~:::::~ 00~:~MM + // .. MMMMM::.00:::+:::.00::MMMMM .. + // .MM::::: ._. :::::MM. + // MMMM;:::::;MMMM + // -MM MMMMMMM + // ^ M+ MMMMMMMMM + // MMMMMMM MM MM MM + // MM MM MM MM + // MM MM MM MM + // .~~MM~MM~MM~MM~~. + // ~~~~MM:~MM~~~MM~:MM~~~~ + // ~~~~~~==~==~~~==~==~~~~~~ + // ~~~~~~==~==~==~==~~~~~~ + // :~==~==~==~==~~ +} + +// ExampleApiClient_Octocat_withoutConvenienceConstructor shows how to +// initialize an unauthenticated API client without using the helpers +// provided in pkg/client.go, then makes a simple API request. +func ExampleApiClient_Octocat_withoutConvenienceConstructor() { + tokenProvider := auth.NewTokenProvider( + // to create an authenticated provider, uncomment the below line and pass in your token + // auth.WithTokenAuthentication("ghp_your_token"), + auth.WithUserAgent("octokit/go-sdk.example-functions"), + ) + adapter, err := kiotaHttp.NewNetHttpRequestAdapter(tokenProvider) + if err != nil { + log.Fatalf("Error creating request adapter: %v", err) + } + + // TODO: Rework this test to fit the platform needs of GHES + baseUrl := adapter.GetBaseUrl() + + if baseUrl == "" { + // Note: This SDK should be used against a GitHub Enterprise instance, and the below URL is the public GitHub one. It's here only so that tests pass when running `go test ./...`, as the OpenAPI schema for GHES understandably does not include a baseURL. + // When setting up this package for your own usage, call `adapter.SetBaseUrl` or `pkg.WithBaseUrl` with your own GHES base URL. + baseURL := os.Getenv("GITHUB_BASE_URL") + if baseURL == "" { + baseURL = "https://api.github.com" + } + adapter.SetBaseUrl(baseURL) + } + client := github.NewApiClient(adapter) + + s := "Salutations" + + // create headers that accept json back; GitHub's OpenAPI definition says + // octet-stream but that's not actually what the API returns in this case + headers := abs.NewRequestHeaders() + _ = headers.TryAdd("Accept", "application/vnd.github.v3+json") + + octocatRequestConfig := &abs.RequestConfiguration[octocat.OctocatRequestBuilderGetQueryParameters]{ + QueryParameters: &octocat.OctocatRequestBuilderGetQueryParameters{ + S: &s, + }, + Headers: headers, + } + + cat, err := client.Octocat().Get(context.Background(), octocatRequestConfig) + if err != nil { + log.Fatalf("error getting octocat: %v", err) + } + fmt.Printf("%v\n", string(cat)) + // Output: + // MMM. .MMM + // MMMMMMMMMMMMMMMMMMM + // MMMMMMMMMMMMMMMMMMM _____________ + // MMMMMMMMMMMMMMMMMMMMM | | + // MMMMMMMMMMMMMMMMMMMMMMM | Salutations | + // MMMMMMMMMMMMMMMMMMMMMMMM |_ _________| + // MMMM::- -:::::::- -::MMMM |/ + // MM~:~ 00~:::::~ 00~:~MM + // .. MMMMM::.00:::+:::.00::MMMMM .. + // .MM::::: ._. :::::MM. + // MMMM;:::::;MMMM + // -MM MMMMMMM + // ^ M+ MMMMMMMMM + // MMMMMMM MM MM MM + // MM MM MM MM + // MM MM MM MM + // .~~MM~MM~MM~MM~~. + // ~~~~MM:~MM~~~MM~:MM~~~~ + // ~~~~~~==~==~~~==~==~~~~~~ + // ~~~~~~==~==~==~==~~~~~~ + // :~==~==~==~==~~ +} diff --git a/pkg/github/admin/67ab66da8db366423ad0facdb6f8b1e5dad61229af1b0c4ac50a251cf04595be.go b/pkg/github/admin/67ab66da8db366423ad0facdb6f8b1e5dad61229af1b0c4ac50a251cf04595be.go new file mode 100644 index 00000000..fd7a0b5c --- /dev/null +++ b/pkg/github/admin/67ab66da8db366423ad0facdb6f8b1e5dad61229af1b0c4ac50a251cf04595be.go @@ -0,0 +1,138 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors 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 code property + code *string + // The message property + message *string + // The resource property + resource *string +} +// NewPreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors instantiates a new PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors and sets the default values. +func NewPreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors()(*PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors) { + m := &PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors(), 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 *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors) GetCode()(*string) { + return m.code +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors) 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["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["resource"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResource(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors) GetMessage()(*string) { + return m.message +} +// GetResource gets the resource property value. The resource property +// returns a *string when successful +func (m *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors) GetResource()(*string) { + return m.resource +} +// Serialize serializes information the current object +func (m *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resource", m.GetResource()) + 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 *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors) SetCode(value *string)() { + m.code = value +} +// SetMessage sets the message property value. The message property +func (m *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors) SetMessage(value *string)() { + m.message = value +} +// SetResource sets the resource property value. The resource property +func (m *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errors) SetResource(value *string)() { + m.resource = value +} +type PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetMessage()(*string) + GetResource()(*string) + SetCode(value *string)() + SetMessage(value *string)() + SetResource(value *string)() +} diff --git a/pkg/github/admin/775bdc99ce10383000702391eba2548e0181496ff48011378ab54206e41b5a9a.go b/pkg/github/admin/775bdc99ce10383000702391eba2548e0181496ff48011378ab54206e41b5a9a.go new file mode 100644 index 00000000..3c26c309 --- /dev/null +++ b/pkg/github/admin/775bdc99ce10383000702391eba2548e0181496ff48011378ab54206e41b5a9a.go @@ -0,0 +1,109 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // URL from which to download a tarball of this environment. + image_url *string + // This pre-receive environment's new name. + name *string +} +// NewPreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody instantiates a new PreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody and sets the default values. +func NewPreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody()(*PreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody) { + m := &PreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody(), 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 *PreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody) 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 *PreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["image_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetImageUrl(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 +} +// GetImageUrl gets the image_url property value. URL from which to download a tarball of this environment. +// returns a *string when successful +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody) GetImageUrl()(*string) { + return m.image_url +} +// GetName gets the name property value. This pre-receive environment's new name. +// returns a *string when successful +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("image_url", m.GetImageUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *PreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetImageUrl sets the image_url property value. URL from which to download a tarball of this environment. +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody) SetImageUrl(value *string)() { + m.image_url = value +} +// SetName sets the name property value. This pre-receive environment's new name. +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBody) SetName(value *string)() { + m.name = value +} +type PreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetImageUrl()(*string) + GetName()(*string) + SetImageUrl(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/admin/88615ee744494439a1555e2db05d17f151781caa3c7b7bf997e5acd322956f9d.go b/pkg/github/admin/88615ee744494439a1555e2db05d17f151781caa3c7b7bf997e5acd322956f9d.go new file mode 100644 index 00000000..33046ceb --- /dev/null +++ b/pkg/github/admin/88615ee744494439a1555e2db05d17f151781caa3c7b7bf997e5acd322956f9d.go @@ -0,0 +1,52 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environment the pre-receive environment where the script is executed. +type PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environment instantiates a new PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environment and sets the default values. +func NewPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environment()(*PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environment) { + m := &PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environment(), 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 *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environment) 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 *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environment) 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 *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environment) 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 *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/admin/97d9df8496f487e3095e248e106c1415abd8dcbfff770ad750d5f0326e5e07dc.go b/pkg/github/admin/97d9df8496f487e3095e248e106c1415abd8dcbfff770ad750d5f0326e5e07dc.go new file mode 100644 index 00000000..9a4930c2 --- /dev/null +++ b/pkg/github/admin/97d9df8496f487e3095e248e106c1415abd8dcbfff770ad750d5f0326e5e07dc.go @@ -0,0 +1,52 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repository the GitHub repository where the script is kept. +type PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repository instantiates a new PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repository and sets the default values. +func NewPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repository()(*PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repository) { + m := &PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repository(), 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 *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repository) 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 *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repository) 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 *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repository) 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 *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/admin/9f1e533177ee8902b054b9c7820f4f7e1f5deda2df7064e47ee7eef0a78956f9.go b/pkg/github/admin/9f1e533177ee8902b054b9c7820f4f7e1f5deda2df7064e47ee7eef0a78956f9.go new file mode 100644 index 00000000..908302ce --- /dev/null +++ b/pkg/github/admin/9f1e533177ee8902b054b9c7820f4f7e1f5deda2df7064e47ee7eef0a78956f9.go @@ -0,0 +1,138 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors 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 code property + code *string + // The message property + message *string + // The resource property + resource *string +} +// NewPreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors instantiates a new PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors and sets the default values. +func NewPreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors()(*PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors) { + m := &PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors(), 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 *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors) GetCode()(*string) { + return m.code +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors) 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["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["resource"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResource(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors) GetMessage()(*string) { + return m.message +} +// GetResource gets the resource property value. The resource property +// returns a *string when successful +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors) GetResource()(*string) { + return m.resource +} +// Serialize serializes information the current object +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resource", m.GetResource()) + 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 *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors) SetCode(value *string)() { + m.code = value +} +// SetMessage sets the message property value. The message property +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors) SetMessage(value *string)() { + m.message = value +} +// SetResource sets the resource property value. The resource property +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errors) SetResource(value *string)() { + m.resource = value +} +type PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetMessage()(*string) + GetResource()(*string) + SetCode(value *string)() + SetMessage(value *string)() + SetResource(value *string)() +} diff --git a/pkg/github/admin/admin_request_builder.go b/pkg/github/admin/admin_request_builder.go new file mode 100644 index 00000000..82c4d6c2 --- /dev/null +++ b/pkg/github/admin/admin_request_builder.go @@ -0,0 +1,63 @@ +package admin + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// AdminRequestBuilder builds and executes requests for operations under \admin +type AdminRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewAdminRequestBuilderInternal instantiates a new AdminRequestBuilder and sets the default values. +func NewAdminRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AdminRequestBuilder) { + m := &AdminRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin", pathParameters), + } + return m +} +// NewAdminRequestBuilder instantiates a new AdminRequestBuilder and sets the default values. +func NewAdminRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AdminRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAdminRequestBuilderInternal(urlParams, requestAdapter) +} +// Hooks the hooks property +// returns a *HooksRequestBuilder when successful +func (m *AdminRequestBuilder) Hooks()(*HooksRequestBuilder) { + return NewHooksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Keys the keys property +// returns a *KeysRequestBuilder when successful +func (m *AdminRequestBuilder) Keys()(*KeysRequestBuilder) { + return NewKeysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Ldap the ldap property +// returns a *LdapRequestBuilder when successful +func (m *AdminRequestBuilder) Ldap()(*LdapRequestBuilder) { + return NewLdapRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Organizations the organizations property +// returns a *OrganizationsRequestBuilder when successful +func (m *AdminRequestBuilder) Organizations()(*OrganizationsRequestBuilder) { + return NewOrganizationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// PreReceiveEnvironments the preReceiveEnvironments property +// returns a *PreReceiveEnvironmentsRequestBuilder when successful +func (m *AdminRequestBuilder) PreReceiveEnvironments()(*PreReceiveEnvironmentsRequestBuilder) { + return NewPreReceiveEnvironmentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// PreReceiveHooks the preReceiveHooks property +// returns a *PreReceiveHooksRequestBuilder when successful +func (m *AdminRequestBuilder) PreReceiveHooks()(*PreReceiveHooksRequestBuilder) { + return NewPreReceiveHooksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Tokens the tokens property +// returns a *TokensRequestBuilder when successful +func (m *AdminRequestBuilder) Tokens()(*TokensRequestBuilder) { + return NewTokensRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Users the users property +// returns a *UsersRequestBuilder when successful +func (m *AdminRequestBuilder) Users()(*UsersRequestBuilder) { + return NewUsersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/admin/hooks_item_pings_request_builder.go b/pkg/github/admin/hooks_item_pings_request_builder.go new file mode 100644 index 00000000..20dc6030 --- /dev/null +++ b/pkg/github/admin/hooks_item_pings_request_builder.go @@ -0,0 +1,51 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// HooksItemPingsRequestBuilder builds and executes requests for operations under \admin\hooks\{hook_id}\pings +type HooksItemPingsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewHooksItemPingsRequestBuilderInternal instantiates a new HooksItemPingsRequestBuilder and sets the default values. +func NewHooksItemPingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HooksItemPingsRequestBuilder) { + m := &HooksItemPingsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/hooks/{hook_id}/pings", pathParameters), + } + return m +} +// NewHooksItemPingsRequestBuilder instantiates a new HooksItemPingsRequestBuilder and sets the default values. +func NewHooksItemPingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HooksItemPingsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewHooksItemPingsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post this will trigger a [ping event](https://docs.github.com/enterprise-server@3.14/webhooks/#ping-event) to be sent to the webhook. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#ping-a-global-webhook +func (m *HooksItemPingsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation this will trigger a [ping event](https://docs.github.com/enterprise-server@3.14/webhooks/#ping-event) to be sent to the webhook. +// returns a *RequestInformation when successful +func (m *HooksItemPingsRequestBuilder) 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) + 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 *HooksItemPingsRequestBuilder when successful +func (m *HooksItemPingsRequestBuilder) WithUrl(rawUrl string)(*HooksItemPingsRequestBuilder) { + return NewHooksItemPingsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/hooks_item_with_hook_escaped_patch_request_body.go b/pkg/github/admin/hooks_item_with_hook_escaped_patch_request_body.go new file mode 100644 index 00000000..2706b4d6 --- /dev/null +++ b/pkg/github/admin/hooks_item_with_hook_escaped_patch_request_body.go @@ -0,0 +1,144 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type HooksItemWithHook_PatchRequestBody struct { + // Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + active *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Key/value pairs to provide settings for this webhook. + config HooksItemWithHook_PatchRequestBody_configable + // The [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) that trigger this webhook. A global webhook can be triggered by `user` and `organization` events. Default: `user` and `organization`. + events []string +} +// NewHooksItemWithHook_PatchRequestBody instantiates a new HooksItemWithHook_PatchRequestBody and sets the default values. +func NewHooksItemWithHook_PatchRequestBody()(*HooksItemWithHook_PatchRequestBody) { + m := &HooksItemWithHook_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHooksItemWithHook_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHooksItemWithHook_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHooksItemWithHook_PatchRequestBody(), nil +} +// GetActive gets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +// returns a *bool when successful +func (m *HooksItemWithHook_PatchRequestBody) GetActive()(*bool) { + return m.active +} +// 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 *HooksItemWithHook_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfig gets the config property value. Key/value pairs to provide settings for this webhook. +// returns a HooksItemWithHook_PatchRequestBody_configable when successful +func (m *HooksItemWithHook_PatchRequestBody) GetConfig()(HooksItemWithHook_PatchRequestBody_configable) { + return m.config +} +// GetEvents gets the events property value. The [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) that trigger this webhook. A global webhook can be triggered by `user` and `organization` events. Default: `user` and `organization`. +// returns a []string when successful +func (m *HooksItemWithHook_PatchRequestBody) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HooksItemWithHook_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateHooksItemWithHook_PatchRequestBody_configFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(HooksItemWithHook_PatchRequestBody_configable)) + } + return nil + } + res["events"] = 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.SetEvents(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *HooksItemWithHook_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +func (m *HooksItemWithHook_PatchRequestBody) SetActive(value *bool)() { + m.active = 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 *HooksItemWithHook_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfig sets the config property value. Key/value pairs to provide settings for this webhook. +func (m *HooksItemWithHook_PatchRequestBody) SetConfig(value HooksItemWithHook_PatchRequestBody_configable)() { + m.config = value +} +// SetEvents sets the events property value. The [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) that trigger this webhook. A global webhook can be triggered by `user` and `organization` events. Default: `user` and `organization`. +func (m *HooksItemWithHook_PatchRequestBody) SetEvents(value []string)() { + m.events = value +} +type HooksItemWithHook_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetConfig()(HooksItemWithHook_PatchRequestBody_configable) + GetEvents()([]string) + SetActive(value *bool)() + SetConfig(value HooksItemWithHook_PatchRequestBody_configable)() + SetEvents(value []string)() +} diff --git a/pkg/github/admin/hooks_item_with_hook_escaped_patch_request_body_escaped_config.go b/pkg/github/admin/hooks_item_with_hook_escaped_patch_request_body_escaped_config.go new file mode 100644 index 00000000..128d5a40 --- /dev/null +++ b/pkg/github/admin/hooks_item_with_hook_escaped_patch_request_body_escaped_config.go @@ -0,0 +1,168 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// HooksItemWithHook_PatchRequestBody_config key/value pairs to provide settings for this webhook. +type HooksItemWithHook_PatchRequestBody_config 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 media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.** + insecure_ssl *string + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value in the [`X-Hub-Signature`](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers) header. + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewHooksItemWithHook_PatchRequestBody_config instantiates a new HooksItemWithHook_PatchRequestBody_config and sets the default values. +func NewHooksItemWithHook_PatchRequestBody_config()(*HooksItemWithHook_PatchRequestBody_config) { + m := &HooksItemWithHook_PatchRequestBody_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHooksItemWithHook_PatchRequestBody_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHooksItemWithHook_PatchRequestBody_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHooksItemWithHook_PatchRequestBody_config(), 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 *HooksItemWithHook_PatchRequestBody_config) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *HooksItemWithHook_PatchRequestBody_config) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HooksItemWithHook_PatchRequestBody_config) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.** +// returns a *string when successful +func (m *HooksItemWithHook_PatchRequestBody_config) GetInsecureSsl()(*string) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value in the [`X-Hub-Signature`](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers) header. +// returns a *string when successful +func (m *HooksItemWithHook_PatchRequestBody_config) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *HooksItemWithHook_PatchRequestBody_config) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *HooksItemWithHook_PatchRequestBody_config) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *HooksItemWithHook_PatchRequestBody_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *HooksItemWithHook_PatchRequestBody_config) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.** +func (m *HooksItemWithHook_PatchRequestBody_config) SetInsecureSsl(value *string)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value in the [`X-Hub-Signature`](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers) header. +func (m *HooksItemWithHook_PatchRequestBody_config) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *HooksItemWithHook_PatchRequestBody_config) SetUrl(value *string)() { + m.url = value +} +type HooksItemWithHook_PatchRequestBody_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(*string) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value *string)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/admin/hooks_post_request_body.go b/pkg/github/admin/hooks_post_request_body.go new file mode 100644 index 00000000..173cdb65 --- /dev/null +++ b/pkg/github/admin/hooks_post_request_body.go @@ -0,0 +1,173 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type HooksPostRequestBody struct { + // Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + active *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Key/value pairs to provide settings for this webhook. + config HooksPostRequestBody_configable + // The [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) that trigger this webhook. A global webhook can be triggered by `user` and `organization` events. Default: `user` and `organization`. + events []string + // Must be passed as "web". + name *string +} +// NewHooksPostRequestBody instantiates a new HooksPostRequestBody and sets the default values. +func NewHooksPostRequestBody()(*HooksPostRequestBody) { + m := &HooksPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHooksPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHooksPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHooksPostRequestBody(), nil +} +// GetActive gets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +// returns a *bool when successful +func (m *HooksPostRequestBody) GetActive()(*bool) { + return m.active +} +// 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 *HooksPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfig gets the config property value. Key/value pairs to provide settings for this webhook. +// returns a HooksPostRequestBody_configable when successful +func (m *HooksPostRequestBody) GetConfig()(HooksPostRequestBody_configable) { + return m.config +} +// GetEvents gets the events property value. The [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) that trigger this webhook. A global webhook can be triggered by `user` and `organization` events. Default: `user` and `organization`. +// returns a []string when successful +func (m *HooksPostRequestBody) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HooksPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateHooksPostRequestBody_configFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(HooksPostRequestBody_configable)) + } + return nil + } + res["events"] = 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.SetEvents(res) + } + 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. Must be passed as "web". +// returns a *string when successful +func (m *HooksPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *HooksPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +func (m *HooksPostRequestBody) SetActive(value *bool)() { + m.active = 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 *HooksPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfig sets the config property value. Key/value pairs to provide settings for this webhook. +func (m *HooksPostRequestBody) SetConfig(value HooksPostRequestBody_configable)() { + m.config = value +} +// SetEvents sets the events property value. The [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) that trigger this webhook. A global webhook can be triggered by `user` and `organization` events. Default: `user` and `organization`. +func (m *HooksPostRequestBody) SetEvents(value []string)() { + m.events = value +} +// SetName sets the name property value. Must be passed as "web". +func (m *HooksPostRequestBody) SetName(value *string)() { + m.name = value +} +type HooksPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetConfig()(HooksPostRequestBody_configable) + GetEvents()([]string) + GetName()(*string) + SetActive(value *bool)() + SetConfig(value HooksPostRequestBody_configable)() + SetEvents(value []string)() + SetName(value *string)() +} diff --git a/pkg/github/admin/hooks_post_request_body_escaped_config.go b/pkg/github/admin/hooks_post_request_body_escaped_config.go new file mode 100644 index 00000000..1f894907 --- /dev/null +++ b/pkg/github/admin/hooks_post_request_body_escaped_config.go @@ -0,0 +1,168 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// HooksPostRequestBody_config key/value pairs to provide settings for this webhook. +type HooksPostRequestBody_config 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 media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.** + insecure_ssl *string + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value in the [`X-Hub-Signature`](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers) header. + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewHooksPostRequestBody_config instantiates a new HooksPostRequestBody_config and sets the default values. +func NewHooksPostRequestBody_config()(*HooksPostRequestBody_config) { + m := &HooksPostRequestBody_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHooksPostRequestBody_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHooksPostRequestBody_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHooksPostRequestBody_config(), 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 *HooksPostRequestBody_config) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *HooksPostRequestBody_config) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HooksPostRequestBody_config) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.** +// returns a *string when successful +func (m *HooksPostRequestBody_config) GetInsecureSsl()(*string) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value in the [`X-Hub-Signature`](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers) header. +// returns a *string when successful +func (m *HooksPostRequestBody_config) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *HooksPostRequestBody_config) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *HooksPostRequestBody_config) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *HooksPostRequestBody_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *HooksPostRequestBody_config) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.** +func (m *HooksPostRequestBody_config) SetInsecureSsl(value *string)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value in the [`X-Hub-Signature`](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers) header. +func (m *HooksPostRequestBody_config) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *HooksPostRequestBody_config) SetUrl(value *string)() { + m.url = value +} +type HooksPostRequestBody_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(*string) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value *string)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/admin/hooks_request_builder.go b/pkg/github/admin/hooks_request_builder.go new file mode 100644 index 00000000..92fc1a28 --- /dev/null +++ b/pkg/github/admin/hooks_request_builder.go @@ -0,0 +1,107 @@ +package admin + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// HooksRequestBuilder builds and executes requests for operations under \admin\hooks +type HooksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// HooksRequestBuilderGetQueryParameters list global webhooks +type HooksRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByHook_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.admin.hooks.item collection +// returns a *HooksWithHook_ItemRequestBuilder when successful +func (m *HooksRequestBuilder) ByHook_id(hook_id int32)(*HooksWithHook_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["hook_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(hook_id), 10) + return NewHooksWithHook_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewHooksRequestBuilderInternal instantiates a new HooksRequestBuilder and sets the default values. +func NewHooksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HooksRequestBuilder) { + m := &HooksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/hooks{?page*,per_page*}", pathParameters), + } + return m +} +// NewHooksRequestBuilder instantiates a new HooksRequestBuilder and sets the default values. +func NewHooksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HooksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewHooksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list global webhooks +// returns a []GlobalHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#list-global-webhooks +func (m *HooksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[HooksRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GlobalHookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGlobalHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GlobalHookable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GlobalHookable) + } + } + return val, nil +} +// Post create a global webhook +// returns a GlobalHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#create-a-global-webhook +func (m *HooksRequestBuilder) Post(ctx context.Context, body HooksPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GlobalHookable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGlobalHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GlobalHookable), nil +} +// returns a *RequestInformation when successful +func (m *HooksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[HooksRequestBuilderGetQueryParameters])(*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 +} +// returns a *RequestInformation when successful +func (m *HooksRequestBuilder) ToPostRequestInformation(ctx context.Context, body HooksPostRequestBodyable, 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 *HooksRequestBuilder when successful +func (m *HooksRequestBuilder) WithUrl(rawUrl string)(*HooksRequestBuilder) { + return NewHooksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/hooks_with_hook_escaped_item_request_builder.go b/pkg/github/admin/hooks_with_hook_escaped_item_request_builder.go new file mode 100644 index 00000000..e759bfbb --- /dev/null +++ b/pkg/github/admin/hooks_with_hook_escaped_item_request_builder.go @@ -0,0 +1,113 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// HooksWithHook_ItemRequestBuilder builds and executes requests for operations under \admin\hooks\{hook_id} +type HooksWithHook_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewHooksWithHook_ItemRequestBuilderInternal instantiates a new HooksWithHook_ItemRequestBuilder and sets the default values. +func NewHooksWithHook_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HooksWithHook_ItemRequestBuilder) { + m := &HooksWithHook_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/hooks/{hook_id}", pathParameters), + } + return m +} +// NewHooksWithHook_ItemRequestBuilder instantiates a new HooksWithHook_ItemRequestBuilder and sets the default values. +func NewHooksWithHook_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HooksWithHook_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewHooksWithHook_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a global webhook +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#delete-a-global-webhook +func (m *HooksWithHook_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get get a global webhook +// returns a GlobalHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#get-a-global-webhook +func (m *HooksWithHook_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GlobalHookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGlobalHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GlobalHookable), nil +} +// Patch parameters that are not provided will be overwritten with the default value or removed if no default exists. +// returns a GlobalHook2able when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/global-webhooks#update-a-global-webhook +func (m *HooksWithHook_ItemRequestBuilder) Patch(ctx context.Context, body HooksItemWithHook_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GlobalHook2able, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGlobalHook2FromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GlobalHook2able), nil +} +// Pings the pings property +// returns a *HooksItemPingsRequestBuilder when successful +func (m *HooksWithHook_ItemRequestBuilder) Pings()(*HooksItemPingsRequestBuilder) { + return NewHooksItemPingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// returns a *RequestInformation when successful +func (m *HooksWithHook_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) + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *HooksWithHook_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 parameters that are not provided will be overwritten with the default value or removed if no default exists. +// returns a *RequestInformation when successful +func (m *HooksWithHook_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body HooksItemWithHook_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 *HooksWithHook_ItemRequestBuilder when successful +func (m *HooksWithHook_ItemRequestBuilder) WithUrl(rawUrl string)(*HooksWithHook_ItemRequestBuilder) { + return NewHooksWithHook_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/keys/get_direction_query_parameter_type.go b/pkg/github/admin/keys/get_direction_query_parameter_type.go new file mode 100644 index 00000000..9ff85d87 --- /dev/null +++ b/pkg/github/admin/keys/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package keys +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/admin/keys/get_sort_query_parameter_type.go b/pkg/github/admin/keys/get_sort_query_parameter_type.go new file mode 100644 index 00000000..b1f26cf6 --- /dev/null +++ b/pkg/github/admin/keys/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package keys +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + ACCESSED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "accessed"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "accessed": + result = ACCESSED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/admin/keys_request_builder.go b/pkg/github/admin/keys_request_builder.go new file mode 100644 index 00000000..5fb86cc9 --- /dev/null +++ b/pkg/github/admin/keys_request_builder.go @@ -0,0 +1,84 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i7b5e92fdca75c4784d3f41cbe18fab270185eef539028487994d96e4d2495c56 "github.com/octokit/go-sdk-enterprise-server/pkg/github/admin/keys" +) + +// KeysRequestBuilder builds and executes requests for operations under \admin\keys +type KeysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// KeysRequestBuilderGetQueryParameters list public keys +type KeysRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i7b5e92fdca75c4784d3f41cbe18fab270185eef539028487994d96e4d2495c56.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show public keys accessed after the given time. + Since *string `uriparametername:"since"` + Sort *i7b5e92fdca75c4784d3f41cbe18fab270185eef539028487994d96e4d2495c56.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByKey_ids gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.admin.keys.item collection +// returns a *KeysWithKey_idsItemRequestBuilder when successful +func (m *KeysRequestBuilder) ByKey_ids(key_ids string)(*KeysWithKey_idsItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if key_ids != "" { + urlTplParams["key_ids"] = key_ids + } + return NewKeysWithKey_idsItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewKeysRequestBuilderInternal instantiates a new KeysRequestBuilder and sets the default values. +func NewKeysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeysRequestBuilder) { + m := &KeysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/keys{?direction*,page*,per_page*,since*,sort*}", pathParameters), + } + return m +} +// NewKeysRequestBuilder instantiates a new KeysRequestBuilder and sets the default values. +func NewKeysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewKeysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list public keys +// returns a []PublicKeyFullable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#list-public-keys +func (m *KeysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[KeysRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicKeyFullable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePublicKeyFullFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicKeyFullable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicKeyFullable) + } + } + return val, nil +} +// returns a *RequestInformation when successful +func (m *KeysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[KeysRequestBuilderGetQueryParameters])(*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 *KeysRequestBuilder when successful +func (m *KeysRequestBuilder) WithUrl(rawUrl string)(*KeysRequestBuilder) { + return NewKeysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/keys_with_key_escaped_ids_item_request_builder.go b/pkg/github/admin/keys_with_key_escaped_ids_item_request_builder.go new file mode 100644 index 00000000..3f938a6c --- /dev/null +++ b/pkg/github/admin/keys_with_key_escaped_ids_item_request_builder.go @@ -0,0 +1,50 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// KeysWithKey_idsItemRequestBuilder builds and executes requests for operations under \admin\keys\{key_ids} +type KeysWithKey_idsItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewKeysWithKey_idsItemRequestBuilderInternal instantiates a new KeysWithKey_idsItemRequestBuilder and sets the default values. +func NewKeysWithKey_idsItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeysWithKey_idsItemRequestBuilder) { + m := &KeysWithKey_idsItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/keys/{key_ids}", pathParameters), + } + return m +} +// NewKeysWithKey_idsItemRequestBuilder instantiates a new KeysWithKey_idsItemRequestBuilder and sets the default values. +func NewKeysWithKey_idsItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeysWithKey_idsItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewKeysWithKey_idsItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a public key +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-a-public-key +func (m *KeysWithKey_idsItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// returns a *RequestInformation when successful +func (m *KeysWithKey_idsItemRequestBuilder) 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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *KeysWithKey_idsItemRequestBuilder when successful +func (m *KeysWithKey_idsItemRequestBuilder) WithUrl(rawUrl string)(*KeysWithKey_idsItemRequestBuilder) { + return NewKeysWithKey_idsItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/ldap_request_builder.go b/pkg/github/admin/ldap_request_builder.go new file mode 100644 index 00000000..e7c400fc --- /dev/null +++ b/pkg/github/admin/ldap_request_builder.go @@ -0,0 +1,33 @@ +package admin + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// LdapRequestBuilder builds and executes requests for operations under \admin\ldap +type LdapRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewLdapRequestBuilderInternal instantiates a new LdapRequestBuilder and sets the default values. +func NewLdapRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapRequestBuilder) { + m := &LdapRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/ldap", pathParameters), + } + return m +} +// NewLdapRequestBuilder instantiates a new LdapRequestBuilder and sets the default values. +func NewLdapRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewLdapRequestBuilderInternal(urlParams, requestAdapter) +} +// Teams the teams property +// returns a *LdapTeamsRequestBuilder when successful +func (m *LdapRequestBuilder) Teams()(*LdapTeamsRequestBuilder) { + return NewLdapTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Users the users property +// returns a *LdapUsersRequestBuilder when successful +func (m *LdapRequestBuilder) Users()(*LdapUsersRequestBuilder) { + return NewLdapUsersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/admin/ldap_teams_item_mapping_patch_request_body.go b/pkg/github/admin/ldap_teams_item_mapping_patch_request_body.go new file mode 100644 index 00000000..83f16613 --- /dev/null +++ b/pkg/github/admin/ldap_teams_item_mapping_patch_request_body.go @@ -0,0 +1,80 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type LdapTeamsItemMappingPatchRequestBody 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 [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. + ldap_dn *string +} +// NewLdapTeamsItemMappingPatchRequestBody instantiates a new LdapTeamsItemMappingPatchRequestBody and sets the default values. +func NewLdapTeamsItemMappingPatchRequestBody()(*LdapTeamsItemMappingPatchRequestBody) { + m := &LdapTeamsItemMappingPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLdapTeamsItemMappingPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLdapTeamsItemMappingPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLdapTeamsItemMappingPatchRequestBody(), 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 *LdapTeamsItemMappingPatchRequestBody) 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 *LdapTeamsItemMappingPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ldap_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLdapDn(val) + } + return nil + } + return res +} +// GetLdapDn gets the ldap_dn property value. The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. +// returns a *string when successful +func (m *LdapTeamsItemMappingPatchRequestBody) GetLdapDn()(*string) { + return m.ldap_dn +} +// Serialize serializes information the current object +func (m *LdapTeamsItemMappingPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("ldap_dn", m.GetLdapDn()) + 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 *LdapTeamsItemMappingPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLdapDn sets the ldap_dn property value. The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. +func (m *LdapTeamsItemMappingPatchRequestBody) SetLdapDn(value *string)() { + m.ldap_dn = value +} +type LdapTeamsItemMappingPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLdapDn()(*string) + SetLdapDn(value *string)() +} diff --git a/pkg/github/admin/ldap_teams_item_mapping_request_builder.go b/pkg/github/admin/ldap_teams_item_mapping_request_builder.go new file mode 100644 index 00000000..571312f7 --- /dev/null +++ b/pkg/github/admin/ldap_teams_item_mapping_request_builder.go @@ -0,0 +1,61 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// LdapTeamsItemMappingRequestBuilder builds and executes requests for operations under \admin\ldap\teams\{team_id}\mapping +type LdapTeamsItemMappingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewLdapTeamsItemMappingRequestBuilderInternal instantiates a new LdapTeamsItemMappingRequestBuilder and sets the default values. +func NewLdapTeamsItemMappingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapTeamsItemMappingRequestBuilder) { + m := &LdapTeamsItemMappingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/ldap/teams/{team_id}/mapping", pathParameters), + } + return m +} +// NewLdapTeamsItemMappingRequestBuilder instantiates a new LdapTeamsItemMappingRequestBuilder and sets the default values. +func NewLdapTeamsItemMappingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapTeamsItemMappingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewLdapTeamsItemMappingRequestBuilderInternal(urlParams, requestAdapter) +} +// Patch updates the [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. [LDAP synchronization](https://docs.github.com/enterprise-server@3.14/admin/identity-and-access-management/using-ldap-for-enterprise-iam/using-ldap#enabling-ldap-sync) must be enabled to map LDAP entries to a team. Use the [Create a team](https://docs.github.com/enterprise-server@3.14/rest/teams/teams/#create-a-team) endpoint to create a team with LDAP mapping. +// returns a LdapMappingTeamable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team +func (m *LdapTeamsItemMappingRequestBuilder) Patch(ctx context.Context, body LdapTeamsItemMappingPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LdapMappingTeamable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLdapMappingTeamFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LdapMappingTeamable), nil +} +// ToPatchRequestInformation updates the [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. [LDAP synchronization](https://docs.github.com/enterprise-server@3.14/admin/identity-and-access-management/using-ldap-for-enterprise-iam/using-ldap#enabling-ldap-sync) must be enabled to map LDAP entries to a team. Use the [Create a team](https://docs.github.com/enterprise-server@3.14/rest/teams/teams/#create-a-team) endpoint to create a team with LDAP mapping. +// returns a *RequestInformation when successful +func (m *LdapTeamsItemMappingRequestBuilder) ToPatchRequestInformation(ctx context.Context, body LdapTeamsItemMappingPatchRequestBodyable, 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 *LdapTeamsItemMappingRequestBuilder when successful +func (m *LdapTeamsItemMappingRequestBuilder) WithUrl(rawUrl string)(*LdapTeamsItemMappingRequestBuilder) { + return NewLdapTeamsItemMappingRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/ldap_teams_item_sync_post_response.go b/pkg/github/admin/ldap_teams_item_sync_post_response.go new file mode 100644 index 00000000..74a7bfdf --- /dev/null +++ b/pkg/github/admin/ldap_teams_item_sync_post_response.go @@ -0,0 +1,80 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type LdapTeamsItemSyncPostResponse 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 status property + status *string +} +// NewLdapTeamsItemSyncPostResponse instantiates a new LdapTeamsItemSyncPostResponse and sets the default values. +func NewLdapTeamsItemSyncPostResponse()(*LdapTeamsItemSyncPostResponse) { + m := &LdapTeamsItemSyncPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLdapTeamsItemSyncPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLdapTeamsItemSyncPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLdapTeamsItemSyncPostResponse(), 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 *LdapTeamsItemSyncPostResponse) 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 *LdapTeamsItemSyncPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *LdapTeamsItemSyncPostResponse) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *LdapTeamsItemSyncPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *LdapTeamsItemSyncPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The status property +func (m *LdapTeamsItemSyncPostResponse) SetStatus(value *string)() { + m.status = value +} +type LdapTeamsItemSyncPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + SetStatus(value *string)() +} diff --git a/pkg/github/admin/ldap_teams_item_sync_request_builder.go b/pkg/github/admin/ldap_teams_item_sync_request_builder.go new file mode 100644 index 00000000..47726669 --- /dev/null +++ b/pkg/github/admin/ldap_teams_item_sync_request_builder.go @@ -0,0 +1,56 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// LdapTeamsItemSyncRequestBuilder builds and executes requests for operations under \admin\ldap\teams\{team_id}\sync +type LdapTeamsItemSyncRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewLdapTeamsItemSyncRequestBuilderInternal instantiates a new LdapTeamsItemSyncRequestBuilder and sets the default values. +func NewLdapTeamsItemSyncRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapTeamsItemSyncRequestBuilder) { + m := &LdapTeamsItemSyncRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/ldap/teams/{team_id}/sync", pathParameters), + } + return m +} +// NewLdapTeamsItemSyncRequestBuilder instantiates a new LdapTeamsItemSyncRequestBuilder and sets the default values. +func NewLdapTeamsItemSyncRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapTeamsItemSyncRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewLdapTeamsItemSyncRequestBuilderInternal(urlParams, requestAdapter) +} +// Post note that this API call does not automatically initiate an LDAP sync. Rather, if a `201` is returned, the sync job is queued successfully, and is performed when the instance is ready. +// returns a LdapTeamsItemSyncPostResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-team +func (m *LdapTeamsItemSyncRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(LdapTeamsItemSyncPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateLdapTeamsItemSyncPostResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(LdapTeamsItemSyncPostResponseable), nil +} +// ToPostRequestInformation note that this API call does not automatically initiate an LDAP sync. Rather, if a `201` is returned, the sync job is queued successfully, and is performed when the instance is ready. +// returns a *RequestInformation when successful +func (m *LdapTeamsItemSyncRequestBuilder) 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 *LdapTeamsItemSyncRequestBuilder when successful +func (m *LdapTeamsItemSyncRequestBuilder) WithUrl(rawUrl string)(*LdapTeamsItemSyncRequestBuilder) { + return NewLdapTeamsItemSyncRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/ldap_teams_request_builder.go b/pkg/github/admin/ldap_teams_request_builder.go new file mode 100644 index 00000000..64fd4efc --- /dev/null +++ b/pkg/github/admin/ldap_teams_request_builder.go @@ -0,0 +1,34 @@ +package admin + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// LdapTeamsRequestBuilder builds and executes requests for operations under \admin\ldap\teams +type LdapTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTeam_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.admin.ldap.teams.item collection +// returns a *LdapTeamsWithTeam_ItemRequestBuilder when successful +func (m *LdapTeamsRequestBuilder) ByTeam_id(team_id int32)(*LdapTeamsWithTeam_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["team_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(team_id), 10) + return NewLdapTeamsWithTeam_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewLdapTeamsRequestBuilderInternal instantiates a new LdapTeamsRequestBuilder and sets the default values. +func NewLdapTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapTeamsRequestBuilder) { + m := &LdapTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/ldap/teams", pathParameters), + } + return m +} +// NewLdapTeamsRequestBuilder instantiates a new LdapTeamsRequestBuilder and sets the default values. +func NewLdapTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewLdapTeamsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/admin/ldap_teams_with_team_escaped_item_request_builder.go b/pkg/github/admin/ldap_teams_with_team_escaped_item_request_builder.go new file mode 100644 index 00000000..dc497f70 --- /dev/null +++ b/pkg/github/admin/ldap_teams_with_team_escaped_item_request_builder.go @@ -0,0 +1,33 @@ +package admin + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// LdapTeamsWithTeam_ItemRequestBuilder builds and executes requests for operations under \admin\ldap\teams\{team_id} +type LdapTeamsWithTeam_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewLdapTeamsWithTeam_ItemRequestBuilderInternal instantiates a new LdapTeamsWithTeam_ItemRequestBuilder and sets the default values. +func NewLdapTeamsWithTeam_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapTeamsWithTeam_ItemRequestBuilder) { + m := &LdapTeamsWithTeam_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/ldap/teams/{team_id}", pathParameters), + } + return m +} +// NewLdapTeamsWithTeam_ItemRequestBuilder instantiates a new LdapTeamsWithTeam_ItemRequestBuilder and sets the default values. +func NewLdapTeamsWithTeam_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapTeamsWithTeam_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewLdapTeamsWithTeam_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Mapping the mapping property +// returns a *LdapTeamsItemMappingRequestBuilder when successful +func (m *LdapTeamsWithTeam_ItemRequestBuilder) Mapping()(*LdapTeamsItemMappingRequestBuilder) { + return NewLdapTeamsItemMappingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Sync the sync property +// returns a *LdapTeamsItemSyncRequestBuilder when successful +func (m *LdapTeamsWithTeam_ItemRequestBuilder) Sync()(*LdapTeamsItemSyncRequestBuilder) { + return NewLdapTeamsItemSyncRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/admin/ldap_users_item_mapping_patch_request_body.go b/pkg/github/admin/ldap_users_item_mapping_patch_request_body.go new file mode 100644 index 00000000..cd50731d --- /dev/null +++ b/pkg/github/admin/ldap_users_item_mapping_patch_request_body.go @@ -0,0 +1,80 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type LdapUsersItemMappingPatchRequestBody 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 [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. + ldap_dn *string +} +// NewLdapUsersItemMappingPatchRequestBody instantiates a new LdapUsersItemMappingPatchRequestBody and sets the default values. +func NewLdapUsersItemMappingPatchRequestBody()(*LdapUsersItemMappingPatchRequestBody) { + m := &LdapUsersItemMappingPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLdapUsersItemMappingPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLdapUsersItemMappingPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLdapUsersItemMappingPatchRequestBody(), 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 *LdapUsersItemMappingPatchRequestBody) 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 *LdapUsersItemMappingPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ldap_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLdapDn(val) + } + return nil + } + return res +} +// GetLdapDn gets the ldap_dn property value. The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. +// returns a *string when successful +func (m *LdapUsersItemMappingPatchRequestBody) GetLdapDn()(*string) { + return m.ldap_dn +} +// Serialize serializes information the current object +func (m *LdapUsersItemMappingPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("ldap_dn", m.GetLdapDn()) + 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 *LdapUsersItemMappingPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLdapDn sets the ldap_dn property value. The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. +func (m *LdapUsersItemMappingPatchRequestBody) SetLdapDn(value *string)() { + m.ldap_dn = value +} +type LdapUsersItemMappingPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLdapDn()(*string) + SetLdapDn(value *string)() +} diff --git a/pkg/github/admin/ldap_users_item_mapping_request_builder.go b/pkg/github/admin/ldap_users_item_mapping_request_builder.go new file mode 100644 index 00000000..ae33806a --- /dev/null +++ b/pkg/github/admin/ldap_users_item_mapping_request_builder.go @@ -0,0 +1,60 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// LdapUsersItemMappingRequestBuilder builds and executes requests for operations under \admin\ldap\users\{username}\mapping +type LdapUsersItemMappingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewLdapUsersItemMappingRequestBuilderInternal instantiates a new LdapUsersItemMappingRequestBuilder and sets the default values. +func NewLdapUsersItemMappingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapUsersItemMappingRequestBuilder) { + m := &LdapUsersItemMappingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/ldap/users/{username}/mapping", pathParameters), + } + return m +} +// NewLdapUsersItemMappingRequestBuilder instantiates a new LdapUsersItemMappingRequestBuilder and sets the default values. +func NewLdapUsersItemMappingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapUsersItemMappingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewLdapUsersItemMappingRequestBuilderInternal(urlParams, requestAdapter) +} +// Patch update LDAP mapping for a user +// returns a LdapMappingUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user +func (m *LdapUsersItemMappingRequestBuilder) Patch(ctx context.Context, body LdapUsersItemMappingPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LdapMappingUserable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLdapMappingUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LdapMappingUserable), nil +} +// returns a *RequestInformation when successful +func (m *LdapUsersItemMappingRequestBuilder) ToPatchRequestInformation(ctx context.Context, body LdapUsersItemMappingPatchRequestBodyable, 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 *LdapUsersItemMappingRequestBuilder when successful +func (m *LdapUsersItemMappingRequestBuilder) WithUrl(rawUrl string)(*LdapUsersItemMappingRequestBuilder) { + return NewLdapUsersItemMappingRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/ldap_users_item_sync_post_response.go b/pkg/github/admin/ldap_users_item_sync_post_response.go new file mode 100644 index 00000000..71efdca6 --- /dev/null +++ b/pkg/github/admin/ldap_users_item_sync_post_response.go @@ -0,0 +1,80 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type LdapUsersItemSyncPostResponse 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 status property + status *string +} +// NewLdapUsersItemSyncPostResponse instantiates a new LdapUsersItemSyncPostResponse and sets the default values. +func NewLdapUsersItemSyncPostResponse()(*LdapUsersItemSyncPostResponse) { + m := &LdapUsersItemSyncPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLdapUsersItemSyncPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLdapUsersItemSyncPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLdapUsersItemSyncPostResponse(), 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 *LdapUsersItemSyncPostResponse) 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 *LdapUsersItemSyncPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *LdapUsersItemSyncPostResponse) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *LdapUsersItemSyncPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *LdapUsersItemSyncPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The status property +func (m *LdapUsersItemSyncPostResponse) SetStatus(value *string)() { + m.status = value +} +type LdapUsersItemSyncPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + SetStatus(value *string)() +} diff --git a/pkg/github/admin/ldap_users_item_sync_request_builder.go b/pkg/github/admin/ldap_users_item_sync_request_builder.go new file mode 100644 index 00000000..d63918eb --- /dev/null +++ b/pkg/github/admin/ldap_users_item_sync_request_builder.go @@ -0,0 +1,56 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// LdapUsersItemSyncRequestBuilder builds and executes requests for operations under \admin\ldap\users\{username}\sync +type LdapUsersItemSyncRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewLdapUsersItemSyncRequestBuilderInternal instantiates a new LdapUsersItemSyncRequestBuilder and sets the default values. +func NewLdapUsersItemSyncRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapUsersItemSyncRequestBuilder) { + m := &LdapUsersItemSyncRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/ldap/users/{username}/sync", pathParameters), + } + return m +} +// NewLdapUsersItemSyncRequestBuilder instantiates a new LdapUsersItemSyncRequestBuilder and sets the default values. +func NewLdapUsersItemSyncRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapUsersItemSyncRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewLdapUsersItemSyncRequestBuilderInternal(urlParams, requestAdapter) +} +// Post note that this API call does not automatically initiate an LDAP sync. Rather, if a `201` is returned, the sync job is queued successfully, and is performed when the instance is ready. +// returns a LdapUsersItemSyncPostResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#sync-ldap-mapping-for-a-user +func (m *LdapUsersItemSyncRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(LdapUsersItemSyncPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateLdapUsersItemSyncPostResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(LdapUsersItemSyncPostResponseable), nil +} +// ToPostRequestInformation note that this API call does not automatically initiate an LDAP sync. Rather, if a `201` is returned, the sync job is queued successfully, and is performed when the instance is ready. +// returns a *RequestInformation when successful +func (m *LdapUsersItemSyncRequestBuilder) 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 *LdapUsersItemSyncRequestBuilder when successful +func (m *LdapUsersItemSyncRequestBuilder) WithUrl(rawUrl string)(*LdapUsersItemSyncRequestBuilder) { + return NewLdapUsersItemSyncRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/ldap_users_request_builder.go b/pkg/github/admin/ldap_users_request_builder.go new file mode 100644 index 00000000..75aa7a85 --- /dev/null +++ b/pkg/github/admin/ldap_users_request_builder.go @@ -0,0 +1,35 @@ +package admin + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// LdapUsersRequestBuilder builds and executes requests for operations under \admin\ldap\users +type LdapUsersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByUsername gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.admin.ldap.users.item collection +// returns a *LdapUsersWithUsernameItemRequestBuilder when successful +func (m *LdapUsersRequestBuilder) ByUsername(username string)(*LdapUsersWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewLdapUsersWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewLdapUsersRequestBuilderInternal instantiates a new LdapUsersRequestBuilder and sets the default values. +func NewLdapUsersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapUsersRequestBuilder) { + m := &LdapUsersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/ldap/users", pathParameters), + } + return m +} +// NewLdapUsersRequestBuilder instantiates a new LdapUsersRequestBuilder and sets the default values. +func NewLdapUsersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapUsersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewLdapUsersRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/admin/ldap_users_with_username_item_request_builder.go b/pkg/github/admin/ldap_users_with_username_item_request_builder.go new file mode 100644 index 00000000..5b811ca9 --- /dev/null +++ b/pkg/github/admin/ldap_users_with_username_item_request_builder.go @@ -0,0 +1,33 @@ +package admin + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// LdapUsersWithUsernameItemRequestBuilder builds and executes requests for operations under \admin\ldap\users\{username} +type LdapUsersWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewLdapUsersWithUsernameItemRequestBuilderInternal instantiates a new LdapUsersWithUsernameItemRequestBuilder and sets the default values. +func NewLdapUsersWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapUsersWithUsernameItemRequestBuilder) { + m := &LdapUsersWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/ldap/users/{username}", pathParameters), + } + return m +} +// NewLdapUsersWithUsernameItemRequestBuilder instantiates a new LdapUsersWithUsernameItemRequestBuilder and sets the default values. +func NewLdapUsersWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LdapUsersWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewLdapUsersWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Mapping the mapping property +// returns a *LdapUsersItemMappingRequestBuilder when successful +func (m *LdapUsersWithUsernameItemRequestBuilder) Mapping()(*LdapUsersItemMappingRequestBuilder) { + return NewLdapUsersItemMappingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Sync the sync property +// returns a *LdapUsersItemSyncRequestBuilder when successful +func (m *LdapUsersWithUsernameItemRequestBuilder) Sync()(*LdapUsersItemSyncRequestBuilder) { + return NewLdapUsersItemSyncRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/admin/organizations_item_with_org_patch_request_body.go b/pkg/github/admin/organizations_item_with_org_patch_request_body.go new file mode 100644 index 00000000..222b6bee --- /dev/null +++ b/pkg/github/admin/organizations_item_with_org_patch_request_body.go @@ -0,0 +1,80 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationsItemWithOrgPatchRequestBody 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 organization's new name. + login *string +} +// NewOrganizationsItemWithOrgPatchRequestBody instantiates a new OrganizationsItemWithOrgPatchRequestBody and sets the default values. +func NewOrganizationsItemWithOrgPatchRequestBody()(*OrganizationsItemWithOrgPatchRequestBody) { + m := &OrganizationsItemWithOrgPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationsItemWithOrgPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationsItemWithOrgPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationsItemWithOrgPatchRequestBody(), 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 *OrganizationsItemWithOrgPatchRequestBody) 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 *OrganizationsItemWithOrgPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + return res +} +// GetLogin gets the login property value. The organization's new name. +// returns a *string when successful +func (m *OrganizationsItemWithOrgPatchRequestBody) GetLogin()(*string) { + return m.login +} +// Serialize serializes information the current object +func (m *OrganizationsItemWithOrgPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("login", m.GetLogin()) + 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 *OrganizationsItemWithOrgPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLogin sets the login property value. The organization's new name. +func (m *OrganizationsItemWithOrgPatchRequestBody) SetLogin(value *string)() { + m.login = value +} +type OrganizationsItemWithOrgPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLogin()(*string) + SetLogin(value *string)() +} diff --git a/pkg/github/admin/organizations_item_with_org_patch_response.go b/pkg/github/admin/organizations_item_with_org_patch_response.go new file mode 100644 index 00000000..42c21495 --- /dev/null +++ b/pkg/github/admin/organizations_item_with_org_patch_response.go @@ -0,0 +1,109 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationsItemWithOrgPatchResponse 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 message property + message *string + // The url property + url *string +} +// NewOrganizationsItemWithOrgPatchResponse instantiates a new OrganizationsItemWithOrgPatchResponse and sets the default values. +func NewOrganizationsItemWithOrgPatchResponse()(*OrganizationsItemWithOrgPatchResponse) { + m := &OrganizationsItemWithOrgPatchResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationsItemWithOrgPatchResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationsItemWithOrgPatchResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationsItemWithOrgPatchResponse(), 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 *OrganizationsItemWithOrgPatchResponse) 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 *OrganizationsItemWithOrgPatchResponse) 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *OrganizationsItemWithOrgPatchResponse) GetMessage()(*string) { + return m.message +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *OrganizationsItemWithOrgPatchResponse) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *OrganizationsItemWithOrgPatchResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *OrganizationsItemWithOrgPatchResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The message property +func (m *OrganizationsItemWithOrgPatchResponse) SetMessage(value *string)() { + m.message = value +} +// SetUrl sets the url property value. The url property +func (m *OrganizationsItemWithOrgPatchResponse) SetUrl(value *string)() { + m.url = value +} +type OrganizationsItemWithOrgPatchResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + GetUrl()(*string) + SetMessage(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/admin/organizations_post_request_body.go b/pkg/github/admin/organizations_post_request_body.go new file mode 100644 index 00000000..23f56c30 --- /dev/null +++ b/pkg/github/admin/organizations_post_request_body.go @@ -0,0 +1,138 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationsPostRequestBody 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 login of the user who will manage this organization. + admin *string + // The organization's username. + login *string + // The organization's display name. + profile_name *string +} +// NewOrganizationsPostRequestBody instantiates a new OrganizationsPostRequestBody and sets the default values. +func NewOrganizationsPostRequestBody()(*OrganizationsPostRequestBody) { + m := &OrganizationsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationsPostRequestBody(), 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 *OrganizationsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The login of the user who will manage this organization. +// returns a *string when successful +func (m *OrganizationsPostRequestBody) GetAdmin()(*string) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["profile_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProfileName(val) + } + return nil + } + return res +} +// GetLogin gets the login property value. The organization's username. +// returns a *string when successful +func (m *OrganizationsPostRequestBody) GetLogin()(*string) { + return m.login +} +// GetProfileName gets the profile_name property value. The organization's display name. +// returns a *string when successful +func (m *OrganizationsPostRequestBody) GetProfileName()(*string) { + return m.profile_name +} +// Serialize serializes information the current object +func (m *OrganizationsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("profile_name", m.GetProfileName()) + 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 *OrganizationsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The login of the user who will manage this organization. +func (m *OrganizationsPostRequestBody) SetAdmin(value *string)() { + m.admin = value +} +// SetLogin sets the login property value. The organization's username. +func (m *OrganizationsPostRequestBody) SetLogin(value *string)() { + m.login = value +} +// SetProfileName sets the profile_name property value. The organization's display name. +func (m *OrganizationsPostRequestBody) SetProfileName(value *string)() { + m.profile_name = value +} +type OrganizationsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*string) + GetLogin()(*string) + GetProfileName()(*string) + SetAdmin(value *string)() + SetLogin(value *string)() + SetProfileName(value *string)() +} diff --git a/pkg/github/admin/organizations_request_builder.go b/pkg/github/admin/organizations_request_builder.go new file mode 100644 index 00000000..fb674721 --- /dev/null +++ b/pkg/github/admin/organizations_request_builder.go @@ -0,0 +1,72 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// OrganizationsRequestBuilder builds and executes requests for operations under \admin\organizations +type OrganizationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByOrg gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.admin.organizations.item collection +// returns a *OrganizationsWithOrgItemRequestBuilder when successful +func (m *OrganizationsRequestBuilder) ByOrg(org string)(*OrganizationsWithOrgItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if org != "" { + urlTplParams["org"] = org + } + return NewOrganizationsWithOrgItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewOrganizationsRequestBuilderInternal instantiates a new OrganizationsRequestBuilder and sets the default values. +func NewOrganizationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrganizationsRequestBuilder) { + m := &OrganizationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/organizations", pathParameters), + } + return m +} +// NewOrganizationsRequestBuilder instantiates a new OrganizationsRequestBuilder and sets the default values. +func NewOrganizationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrganizationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewOrganizationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post create an organization +// returns a OrganizationSimpleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#create-an-organization +func (m *OrganizationsRequestBuilder) Post(ctx context.Context, body OrganizationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationSimpleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable), nil +} +// returns a *RequestInformation when successful +func (m *OrganizationsRequestBuilder) ToPostRequestInformation(ctx context.Context, body OrganizationsPostRequestBodyable, 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 *OrganizationsRequestBuilder when successful +func (m *OrganizationsRequestBuilder) WithUrl(rawUrl string)(*OrganizationsRequestBuilder) { + return NewOrganizationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/organizations_with_org_item_request_builder.go b/pkg/github/admin/organizations_with_org_item_request_builder.go new file mode 100644 index 00000000..6d44c4e1 --- /dev/null +++ b/pkg/github/admin/organizations_with_org_item_request_builder.go @@ -0,0 +1,59 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// OrganizationsWithOrgItemRequestBuilder builds and executes requests for operations under \admin\organizations\{org} +type OrganizationsWithOrgItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewOrganizationsWithOrgItemRequestBuilderInternal instantiates a new OrganizationsWithOrgItemRequestBuilder and sets the default values. +func NewOrganizationsWithOrgItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrganizationsWithOrgItemRequestBuilder) { + m := &OrganizationsWithOrgItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/organizations/{org}", pathParameters), + } + return m +} +// NewOrganizationsWithOrgItemRequestBuilder instantiates a new OrganizationsWithOrgItemRequestBuilder and sets the default values. +func NewOrganizationsWithOrgItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrganizationsWithOrgItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewOrganizationsWithOrgItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Patch update an organization name +// returns a OrganizationsItemWithOrgPatchResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/orgs#update-an-organization-name +func (m *OrganizationsWithOrgItemRequestBuilder) Patch(ctx context.Context, body OrganizationsItemWithOrgPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(OrganizationsItemWithOrgPatchResponseable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateOrganizationsItemWithOrgPatchResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(OrganizationsItemWithOrgPatchResponseable), nil +} +// returns a *RequestInformation when successful +func (m *OrganizationsWithOrgItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body OrganizationsItemWithOrgPatchRequestBodyable, 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 *OrganizationsWithOrgItemRequestBuilder when successful +func (m *OrganizationsWithOrgItemRequestBuilder) WithUrl(rawUrl string)(*OrganizationsWithOrgItemRequestBuilder) { + return NewOrganizationsWithOrgItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/pre_receive_environments_item_downloads_latest_request_builder.go b/pkg/github/admin/pre_receive_environments_item_downloads_latest_request_builder.go new file mode 100644 index 00000000..4773546a --- /dev/null +++ b/pkg/github/admin/pre_receive_environments_item_downloads_latest_request_builder.go @@ -0,0 +1,57 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// PreReceiveEnvironmentsItemDownloadsLatestRequestBuilder builds and executes requests for operations under \admin\pre-receive-environments\{pre_receive_environment_id}\downloads\latest +type PreReceiveEnvironmentsItemDownloadsLatestRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewPreReceiveEnvironmentsItemDownloadsLatestRequestBuilderInternal instantiates a new PreReceiveEnvironmentsItemDownloadsLatestRequestBuilder and sets the default values. +func NewPreReceiveEnvironmentsItemDownloadsLatestRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PreReceiveEnvironmentsItemDownloadsLatestRequestBuilder) { + m := &PreReceiveEnvironmentsItemDownloadsLatestRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/pre-receive-environments/{pre_receive_environment_id}/downloads/latest", pathParameters), + } + return m +} +// NewPreReceiveEnvironmentsItemDownloadsLatestRequestBuilder instantiates a new PreReceiveEnvironmentsItemDownloadsLatestRequestBuilder and sets the default values. +func NewPreReceiveEnvironmentsItemDownloadsLatestRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PreReceiveEnvironmentsItemDownloadsLatestRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPreReceiveEnvironmentsItemDownloadsLatestRequestBuilderInternal(urlParams, requestAdapter) +} +// Get in addition to seeing the download status at the "[Get a pre-receive environment](#get-a-pre-receive-environment)" endpoint, there is also this separate endpoint for just the download status. +// returns a PreReceiveEnvironmentDownloadStatusable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#get-the-download-status-for-a-pre-receive-environment +func (m *PreReceiveEnvironmentsItemDownloadsLatestRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveEnvironmentDownloadStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePreReceiveEnvironmentDownloadStatusFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveEnvironmentDownloadStatusable), nil +} +// ToGetRequestInformation in addition to seeing the download status at the "[Get a pre-receive environment](#get-a-pre-receive-environment)" endpoint, there is also this separate endpoint for just the download status. +// returns a *RequestInformation when successful +func (m *PreReceiveEnvironmentsItemDownloadsLatestRequestBuilder) 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 *PreReceiveEnvironmentsItemDownloadsLatestRequestBuilder when successful +func (m *PreReceiveEnvironmentsItemDownloadsLatestRequestBuilder) WithUrl(rawUrl string)(*PreReceiveEnvironmentsItemDownloadsLatestRequestBuilder) { + return NewPreReceiveEnvironmentsItemDownloadsLatestRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/pre_receive_environments_item_downloads_pre_receive_environment_download_status422_error.go b/pkg/github/admin/pre_receive_environments_item_downloads_pre_receive_environment_download_status422_error.go new file mode 100644 index 00000000..7bb7a428 --- /dev/null +++ b/pkg/github/admin/pre_receive_environments_item_downloads_pre_receive_environment_download_status422_error.go @@ -0,0 +1,129 @@ +package admin + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error 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 errors property + errors []PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errorsable + // The message property + message *string +} +// NewPreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error instantiates a new PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error and sets the default values. +func NewPreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error()(*PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error) { + m := &PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error) 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 *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetErrors gets the errors property value. The errors property +// returns a []PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errorsable when successful +func (m *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error) GetErrors()([]PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errorsable) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errorsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errorsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errorsable) + } + } + m.SetErrors(res) + } + 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 *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetErrors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetErrors())) + for i, v := range m.GetErrors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("errors", cast) + 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 *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetErrors sets the errors property value. The errors property +func (m *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error) SetErrors(value []PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errorsable)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error) SetMessage(value *string)() { + m.message = value +} +type PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetErrors()([]PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errorsable) + GetMessage()(*string) + SetErrors(value []PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error_errorsable)() + SetMessage(value *string)() +} diff --git a/pkg/github/admin/pre_receive_environments_item_downloads_request_builder.go b/pkg/github/admin/pre_receive_environments_item_downloads_request_builder.go new file mode 100644 index 00000000..5eba5253 --- /dev/null +++ b/pkg/github/admin/pre_receive_environments_item_downloads_request_builder.go @@ -0,0 +1,66 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// PreReceiveEnvironmentsItemDownloadsRequestBuilder builds and executes requests for operations under \admin\pre-receive-environments\{pre_receive_environment_id}\downloads +type PreReceiveEnvironmentsItemDownloadsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewPreReceiveEnvironmentsItemDownloadsRequestBuilderInternal instantiates a new PreReceiveEnvironmentsItemDownloadsRequestBuilder and sets the default values. +func NewPreReceiveEnvironmentsItemDownloadsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PreReceiveEnvironmentsItemDownloadsRequestBuilder) { + m := &PreReceiveEnvironmentsItemDownloadsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/pre-receive-environments/{pre_receive_environment_id}/downloads", pathParameters), + } + return m +} +// NewPreReceiveEnvironmentsItemDownloadsRequestBuilder instantiates a new PreReceiveEnvironmentsItemDownloadsRequestBuilder and sets the default values. +func NewPreReceiveEnvironmentsItemDownloadsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PreReceiveEnvironmentsItemDownloadsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPreReceiveEnvironmentsItemDownloadsRequestBuilderInternal(urlParams, requestAdapter) +} +// Latest the latest property +// returns a *PreReceiveEnvironmentsItemDownloadsLatestRequestBuilder when successful +func (m *PreReceiveEnvironmentsItemDownloadsRequestBuilder) Latest()(*PreReceiveEnvironmentsItemDownloadsLatestRequestBuilder) { + return NewPreReceiveEnvironmentsItemDownloadsLatestRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Post triggers a new download of the environment tarball from the environment's `image_url`. When the download is finished, the newly downloaded tarball will overwrite the existing environment.If a download cannot be triggered, you will receive a `422 Unprocessable Entity` response.The possible error messages are:* _Cannot modify or delete the default environment_* _Can not start a new download when a download is in progress_ +// returns a PreReceiveEnvironmentDownloadStatusable when successful +// returns a PreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422Error error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#start-a-pre-receive-environment-download +func (m *PreReceiveEnvironmentsItemDownloadsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveEnvironmentDownloadStatusable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": CreatePreReceiveEnvironmentsItemDownloadsPreReceiveEnvironmentDownloadStatus422ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePreReceiveEnvironmentDownloadStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveEnvironmentDownloadStatusable), nil +} +// ToPostRequestInformation triggers a new download of the environment tarball from the environment's `image_url`. When the download is finished, the newly downloaded tarball will overwrite the existing environment.If a download cannot be triggered, you will receive a `422 Unprocessable Entity` response.The possible error messages are:* _Cannot modify or delete the default environment_* _Can not start a new download when a download is in progress_ +// returns a *RequestInformation when successful +func (m *PreReceiveEnvironmentsItemDownloadsRequestBuilder) 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 *PreReceiveEnvironmentsItemDownloadsRequestBuilder when successful +func (m *PreReceiveEnvironmentsItemDownloadsRequestBuilder) WithUrl(rawUrl string)(*PreReceiveEnvironmentsItemDownloadsRequestBuilder) { + return NewPreReceiveEnvironmentsItemDownloadsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/pre_receive_environments_item_pre_receive_environment422_error.go b/pkg/github/admin/pre_receive_environments_item_pre_receive_environment422_error.go new file mode 100644 index 00000000..3b7849b3 --- /dev/null +++ b/pkg/github/admin/pre_receive_environments_item_pre_receive_environment422_error.go @@ -0,0 +1,129 @@ +package admin + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveEnvironmentsItemPreReceiveEnvironment422Error 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 errors property + errors []PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errorsable + // The message property + message *string +} +// NewPreReceiveEnvironmentsItemPreReceiveEnvironment422Error instantiates a new PreReceiveEnvironmentsItemPreReceiveEnvironment422Error and sets the default values. +func NewPreReceiveEnvironmentsItemPreReceiveEnvironment422Error()(*PreReceiveEnvironmentsItemPreReceiveEnvironment422Error) { + m := &PreReceiveEnvironmentsItemPreReceiveEnvironment422Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveEnvironmentsItemPreReceiveEnvironment422ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveEnvironmentsItemPreReceiveEnvironment422ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveEnvironmentsItemPreReceiveEnvironment422Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error) 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 *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetErrors gets the errors property value. The errors property +// returns a []PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errorsable when successful +func (m *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error) GetErrors()([]PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errorsable) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errorsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errorsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errorsable) + } + } + m.SetErrors(res) + } + 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 *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetErrors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetErrors())) + for i, v := range m.GetErrors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("errors", cast) + 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 *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetErrors sets the errors property value. The errors property +func (m *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error) SetErrors(value []PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errorsable)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error) SetMessage(value *string)() { + m.message = value +} +type PreReceiveEnvironmentsItemPreReceiveEnvironment422Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetErrors()([]PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errorsable) + GetMessage()(*string) + SetErrors(value []PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errorsable)() + SetMessage(value *string)() +} diff --git a/pkg/github/admin/pre_receive_environments_item_pre_receive_environment422_error_escaped_errors.go b/pkg/github/admin/pre_receive_environments_item_pre_receive_environment422_error_escaped_errors.go new file mode 100644 index 00000000..7bb5945a --- /dev/null +++ b/pkg/github/admin/pre_receive_environments_item_pre_receive_environment422_error_escaped_errors.go @@ -0,0 +1,138 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors 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 code property + code *string + // The message property + message *string + // The resource property + resource *string +} +// NewPreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors instantiates a new PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors and sets the default values. +func NewPreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors()(*PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors) { + m := &PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors(), 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 *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors) GetCode()(*string) { + return m.code +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors) 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["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMessage(val) + } + return nil + } + res["resource"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResource(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors) GetMessage()(*string) { + return m.message +} +// GetResource gets the resource property value. The resource property +// returns a *string when successful +func (m *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors) GetResource()(*string) { + return m.resource +} +// Serialize serializes information the current object +func (m *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resource", m.GetResource()) + 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 *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors) SetCode(value *string)() { + m.code = value +} +// SetMessage sets the message property value. The message property +func (m *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors) SetMessage(value *string)() { + m.message = value +} +// SetResource sets the resource property value. The resource property +func (m *PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errors) SetResource(value *string)() { + m.resource = value +} +type PreReceiveEnvironmentsItemPreReceiveEnvironment422Error_errorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetMessage()(*string) + GetResource()(*string) + SetCode(value *string)() + SetMessage(value *string)() + SetResource(value *string)() +} diff --git a/pkg/github/admin/pre_receive_environments_item_with_pre_escaped_receive_escaped_environment_escaped_422_error.go b/pkg/github/admin/pre_receive_environments_item_with_pre_escaped_receive_escaped_environment_escaped_422_error.go new file mode 100644 index 00000000..2a80db09 --- /dev/null +++ b/pkg/github/admin/pre_receive_environments_item_with_pre_escaped_receive_escaped_environment_escaped_422_error.go @@ -0,0 +1,129 @@ +package admin + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveEnvironmentsItemWithPre_receive_environment_422Error 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 errors property + errors []PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errorsable + // The message property + message *string +} +// NewPreReceiveEnvironmentsItemWithPre_receive_environment_422Error instantiates a new PreReceiveEnvironmentsItemWithPre_receive_environment_422Error and sets the default values. +func NewPreReceiveEnvironmentsItemWithPre_receive_environment_422Error()(*PreReceiveEnvironmentsItemWithPre_receive_environment_422Error) { + m := &PreReceiveEnvironmentsItemWithPre_receive_environment_422Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveEnvironmentsItemWithPre_receive_environment_422ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveEnvironmentsItemWithPre_receive_environment_422ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveEnvironmentsItemWithPre_receive_environment_422Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error) 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 *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetErrors gets the errors property value. The errors property +// returns a []PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errorsable when successful +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error) GetErrors()([]PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errorsable) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errorsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errorsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errorsable) + } + } + m.SetErrors(res) + } + 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 *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetErrors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetErrors())) + for i, v := range m.GetErrors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("errors", cast) + 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 *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetErrors sets the errors property value. The errors property +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error) SetErrors(value []PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errorsable)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *PreReceiveEnvironmentsItemWithPre_receive_environment_422Error) SetMessage(value *string)() { + m.message = value +} +type PreReceiveEnvironmentsItemWithPre_receive_environment_422Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetErrors()([]PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errorsable) + GetMessage()(*string) + SetErrors(value []PreReceiveEnvironmentsItemWithPre_receive_environment_422Error_errorsable)() + SetMessage(value *string)() +} diff --git a/pkg/github/admin/pre_receive_environments_post_request_body.go b/pkg/github/admin/pre_receive_environments_post_request_body.go new file mode 100644 index 00000000..2df719f0 --- /dev/null +++ b/pkg/github/admin/pre_receive_environments_post_request_body.go @@ -0,0 +1,109 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveEnvironmentsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // URL from which to download a tarball of this environment. + image_url *string + // The new pre-receive environment's name. + name *string +} +// NewPreReceiveEnvironmentsPostRequestBody instantiates a new PreReceiveEnvironmentsPostRequestBody and sets the default values. +func NewPreReceiveEnvironmentsPostRequestBody()(*PreReceiveEnvironmentsPostRequestBody) { + m := &PreReceiveEnvironmentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveEnvironmentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveEnvironmentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveEnvironmentsPostRequestBody(), 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 *PreReceiveEnvironmentsPostRequestBody) 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 *PreReceiveEnvironmentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["image_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetImageUrl(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 +} +// GetImageUrl gets the image_url property value. URL from which to download a tarball of this environment. +// returns a *string when successful +func (m *PreReceiveEnvironmentsPostRequestBody) GetImageUrl()(*string) { + return m.image_url +} +// GetName gets the name property value. The new pre-receive environment's name. +// returns a *string when successful +func (m *PreReceiveEnvironmentsPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *PreReceiveEnvironmentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("image_url", m.GetImageUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *PreReceiveEnvironmentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetImageUrl sets the image_url property value. URL from which to download a tarball of this environment. +func (m *PreReceiveEnvironmentsPostRequestBody) SetImageUrl(value *string)() { + m.image_url = value +} +// SetName sets the name property value. The new pre-receive environment's name. +func (m *PreReceiveEnvironmentsPostRequestBody) SetName(value *string)() { + m.name = value +} +type PreReceiveEnvironmentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetImageUrl()(*string) + GetName()(*string) + SetImageUrl(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/admin/pre_receive_environments_request_builder.go b/pkg/github/admin/pre_receive_environments_request_builder.go new file mode 100644 index 00000000..6ea33e3d --- /dev/null +++ b/pkg/github/admin/pre_receive_environments_request_builder.go @@ -0,0 +1,111 @@ +package admin + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ia19977d2cea6ae9d082220e4d6bf123ad448b9e828531d1ac9afdbee0875c77b "github.com/octokit/go-sdk-enterprise-server/pkg/github/admin/prereceiveenvironments" +) + +// PreReceiveEnvironmentsRequestBuilder builds and executes requests for operations under \admin\pre-receive-environments +type PreReceiveEnvironmentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// PreReceiveEnvironmentsRequestBuilderGetQueryParameters list pre-receive environments +type PreReceiveEnvironmentsRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *ia19977d2cea6ae9d082220e4d6bf123ad448b9e828531d1ac9afdbee0875c77b.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + Sort *ia19977d2cea6ae9d082220e4d6bf123ad448b9e828531d1ac9afdbee0875c77b.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByPre_receive_environment_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.admin.preReceiveEnvironments.item collection +// returns a *PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder when successful +func (m *PreReceiveEnvironmentsRequestBuilder) ByPre_receive_environment_id(pre_receive_environment_id int32)(*PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["pre_receive_environment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(pre_receive_environment_id), 10) + return NewPreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewPreReceiveEnvironmentsRequestBuilderInternal instantiates a new PreReceiveEnvironmentsRequestBuilder and sets the default values. +func NewPreReceiveEnvironmentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PreReceiveEnvironmentsRequestBuilder) { + m := &PreReceiveEnvironmentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/pre-receive-environments{?direction*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewPreReceiveEnvironmentsRequestBuilder instantiates a new PreReceiveEnvironmentsRequestBuilder and sets the default values. +func NewPreReceiveEnvironmentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PreReceiveEnvironmentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPreReceiveEnvironmentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list pre-receive environments +// returns a []PreReceiveEnvironmentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#list-pre-receive-environments +func (m *PreReceiveEnvironmentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PreReceiveEnvironmentsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveEnvironmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePreReceiveEnvironmentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveEnvironmentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveEnvironmentable) + } + } + return val, nil +} +// Post create a pre-receive environment +// returns a PreReceiveEnvironmentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#create-a-pre-receive-environment +func (m *PreReceiveEnvironmentsRequestBuilder) Post(ctx context.Context, body PreReceiveEnvironmentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveEnvironmentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePreReceiveEnvironmentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveEnvironmentable), nil +} +// returns a *RequestInformation when successful +func (m *PreReceiveEnvironmentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PreReceiveEnvironmentsRequestBuilderGetQueryParameters])(*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 +} +// returns a *RequestInformation when successful +func (m *PreReceiveEnvironmentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body PreReceiveEnvironmentsPostRequestBodyable, 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 *PreReceiveEnvironmentsRequestBuilder when successful +func (m *PreReceiveEnvironmentsRequestBuilder) WithUrl(rawUrl string)(*PreReceiveEnvironmentsRequestBuilder) { + return NewPreReceiveEnvironmentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/pre_receive_environments_with_pre_escaped_receive_escaped_environment_escaped_item_request_builder.go b/pkg/github/admin/pre_receive_environments_with_pre_escaped_receive_escaped_environment_escaped_item_request_builder.go new file mode 100644 index 00000000..5a7f4363 --- /dev/null +++ b/pkg/github/admin/pre_receive_environments_with_pre_escaped_receive_escaped_environment_escaped_item_request_builder.go @@ -0,0 +1,123 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder builds and executes requests for operations under \admin\pre-receive-environments\{pre_receive_environment_id} +type PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewPreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilderInternal instantiates a new PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder and sets the default values. +func NewPreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder) { + m := &PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/pre-receive-environments/{pre_receive_environment_id}", pathParameters), + } + return m +} +// NewPreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder instantiates a new PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder and sets the default values. +func NewPreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete if you attempt to delete an environment that cannot be deleted, you will receive a `422 Unprocessable Entity` response.The possible error messages are:* _Cannot modify or delete the default environment_* _Cannot delete environment that has hooks_* _Cannot delete environment when download is in progress_ +// returns a PreReceiveEnvironmentsItemWithPre_receive_environment_422Error error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#delete-a-pre-receive-environment +func (m *PreReceiveEnvironmentsWithPre_receive_environment_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 { + "422": CreatePreReceiveEnvironmentsItemWithPre_receive_environment_422ErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Downloads the downloads property +// returns a *PreReceiveEnvironmentsItemDownloadsRequestBuilder when successful +func (m *PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder) Downloads()(*PreReceiveEnvironmentsItemDownloadsRequestBuilder) { + return NewPreReceiveEnvironmentsItemDownloadsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get get a pre-receive environment +// returns a PreReceiveEnvironmentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#get-a-pre-receive-environment +func (m *PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveEnvironmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePreReceiveEnvironmentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveEnvironmentable), nil +} +// Patch you cannot modify the default environment. If you attempt to modify the default environment, you will receive a `422 Unprocessable Entity` response. +// returns a PreReceiveEnvironmentable when successful +// returns a PreReceiveEnvironmentsItemPreReceiveEnvironment422Error error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-environments#update-a-pre-receive-environment +func (m *PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder) Patch(ctx context.Context, body PreReceiveEnvironmentsItemWithPre_receive_environment_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveEnvironmentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": CreatePreReceiveEnvironmentsItemPreReceiveEnvironment422ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePreReceiveEnvironmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveEnvironmentable), nil +} +// ToDeleteRequestInformation if you attempt to delete an environment that cannot be deleted, you will receive a `422 Unprocessable Entity` response.The possible error messages are:* _Cannot modify or delete the default environment_* _Cannot delete environment that has hooks_* _Cannot delete environment when download is in progress_ +// returns a *RequestInformation when successful +func (m *PreReceiveEnvironmentsWithPre_receive_environment_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") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *PreReceiveEnvironmentsWithPre_receive_environment_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 you cannot modify the default environment. If you attempt to modify the default environment, you will receive a `422 Unprocessable Entity` response. +// returns a *RequestInformation when successful +func (m *PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body PreReceiveEnvironmentsItemWithPre_receive_environment_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 *PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder when successful +func (m *PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder) WithUrl(rawUrl string)(*PreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder) { + return NewPreReceiveEnvironmentsWithPre_receive_environment_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/pre_receive_hooks_item_with_pre_escaped_receive_escaped_hook_escaped_patch_request_body.go b/pkg/github/admin/pre_receive_hooks_item_with_pre_escaped_receive_escaped_hook_escaped_patch_request_body.go new file mode 100644 index 00000000..8f4cb653 --- /dev/null +++ b/pkg/github/admin/pre_receive_hooks_item_with_pre_escaped_receive_escaped_hook_escaped_patch_request_body.go @@ -0,0 +1,225 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody 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 enforcement can be overridden at the org or repo level. + allow_downstream_configuration *bool + // The state of enforcement for this hook. + enforcement *string + // The pre-receive environment where the script is executed. + environment PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environmentable + // The name of the hook. + name *string + // The script that the hook runs. + script *string + // The GitHub repository where the script is kept. + script_repository PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repositoryable +} +// NewPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody instantiates a new PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody and sets the default values. +func NewPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody()(*PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) { + m := &PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveHooksItemWithPre_receive_hook_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveHooksItemWithPre_receive_hook_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody(), 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 *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowDownstreamConfiguration gets the allow_downstream_configuration property value. Whether enforcement can be overridden at the org or repo level. +// returns a *bool when successful +func (m *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) GetAllowDownstreamConfiguration()(*bool) { + return m.allow_downstream_configuration +} +// GetEnforcement gets the enforcement property value. The state of enforcement for this hook. +// returns a *string when successful +func (m *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) GetEnforcement()(*string) { + return m.enforcement +} +// GetEnvironment gets the environment property value. The pre-receive environment where the script is executed. +// returns a PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environmentable when successful +func (m *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) GetEnvironment()(PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environmentable) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_downstream_configuration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowDownstreamConfiguration(val) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environmentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val.(PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environmentable)) + } + 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["script"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetScript(val) + } + return nil + } + res["script_repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetScriptRepository(val.(PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repositoryable)) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the hook. +// returns a *string when successful +func (m *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) GetName()(*string) { + return m.name +} +// GetScript gets the script property value. The script that the hook runs. +// returns a *string when successful +func (m *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) GetScript()(*string) { + return m.script +} +// GetScriptRepository gets the script_repository property value. The GitHub repository where the script is kept. +// returns a PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repositoryable when successful +func (m *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) GetScriptRepository()(PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repositoryable) { + return m.script_repository +} +// Serialize serializes information the current object +func (m *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_downstream_configuration", m.GetAllowDownstreamConfiguration()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("enforcement", m.GetEnforcement()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("script", m.GetScript()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("script_repository", m.GetScriptRepository()) + 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 *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowDownstreamConfiguration sets the allow_downstream_configuration property value. Whether enforcement can be overridden at the org or repo level. +func (m *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) SetAllowDownstreamConfiguration(value *bool)() { + m.allow_downstream_configuration = value +} +// SetEnforcement sets the enforcement property value. The state of enforcement for this hook. +func (m *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) SetEnforcement(value *string)() { + m.enforcement = value +} +// SetEnvironment sets the environment property value. The pre-receive environment where the script is executed. +func (m *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) SetEnvironment(value PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environmentable)() { + m.environment = value +} +// SetName sets the name property value. The name of the hook. +func (m *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetScript sets the script property value. The script that the hook runs. +func (m *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) SetScript(value *string)() { + m.script = value +} +// SetScriptRepository sets the script_repository property value. The GitHub repository where the script is kept. +func (m *PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) SetScriptRepository(value PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repositoryable)() { + m.script_repository = value +} +type PreReceiveHooksItemWithPre_receive_hook_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowDownstreamConfiguration()(*bool) + GetEnforcement()(*string) + GetEnvironment()(PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environmentable) + GetName()(*string) + GetScript()(*string) + GetScriptRepository()(PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repositoryable) + SetAllowDownstreamConfiguration(value *bool)() + SetEnforcement(value *string)() + SetEnvironment(value PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_environmentable)() + SetName(value *string)() + SetScript(value *string)() + SetScriptRepository(value PreReceiveHooksItemWithPre_receive_hook_PatchRequestBody_script_repositoryable)() +} diff --git a/pkg/github/admin/pre_receive_hooks_post_request_body.go b/pkg/github/admin/pre_receive_hooks_post_request_body.go new file mode 100644 index 00000000..2e9b95c0 --- /dev/null +++ b/pkg/github/admin/pre_receive_hooks_post_request_body.go @@ -0,0 +1,225 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveHooksPostRequestBody 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 enforcement can be overridden at the org or repo level. default: `false` + allow_downstream_configuration *bool + // The state of enforcement for this hook. default: `disabled` + enforcement *string + // The pre-receive environment where the script is executed. + environment PreReceiveHooksPostRequestBody_environmentable + // The name of the hook. + name *string + // The script that the hook runs. + script *string + // The GitHub repository where the script is kept. + script_repository PreReceiveHooksPostRequestBody_script_repositoryable +} +// NewPreReceiveHooksPostRequestBody instantiates a new PreReceiveHooksPostRequestBody and sets the default values. +func NewPreReceiveHooksPostRequestBody()(*PreReceiveHooksPostRequestBody) { + m := &PreReceiveHooksPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveHooksPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveHooksPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveHooksPostRequestBody(), 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 *PreReceiveHooksPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowDownstreamConfiguration gets the allow_downstream_configuration property value. Whether enforcement can be overridden at the org or repo level. default: `false` +// returns a *bool when successful +func (m *PreReceiveHooksPostRequestBody) GetAllowDownstreamConfiguration()(*bool) { + return m.allow_downstream_configuration +} +// GetEnforcement gets the enforcement property value. The state of enforcement for this hook. default: `disabled` +// returns a *string when successful +func (m *PreReceiveHooksPostRequestBody) GetEnforcement()(*string) { + return m.enforcement +} +// GetEnvironment gets the environment property value. The pre-receive environment where the script is executed. +// returns a PreReceiveHooksPostRequestBody_environmentable when successful +func (m *PreReceiveHooksPostRequestBody) GetEnvironment()(PreReceiveHooksPostRequestBody_environmentable) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PreReceiveHooksPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_downstream_configuration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowDownstreamConfiguration(val) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePreReceiveHooksPostRequestBody_environmentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val.(PreReceiveHooksPostRequestBody_environmentable)) + } + 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["script"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetScript(val) + } + return nil + } + res["script_repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePreReceiveHooksPostRequestBody_script_repositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetScriptRepository(val.(PreReceiveHooksPostRequestBody_script_repositoryable)) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the hook. +// returns a *string when successful +func (m *PreReceiveHooksPostRequestBody) GetName()(*string) { + return m.name +} +// GetScript gets the script property value. The script that the hook runs. +// returns a *string when successful +func (m *PreReceiveHooksPostRequestBody) GetScript()(*string) { + return m.script +} +// GetScriptRepository gets the script_repository property value. The GitHub repository where the script is kept. +// returns a PreReceiveHooksPostRequestBody_script_repositoryable when successful +func (m *PreReceiveHooksPostRequestBody) GetScriptRepository()(PreReceiveHooksPostRequestBody_script_repositoryable) { + return m.script_repository +} +// Serialize serializes information the current object +func (m *PreReceiveHooksPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_downstream_configuration", m.GetAllowDownstreamConfiguration()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("enforcement", m.GetEnforcement()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("script", m.GetScript()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("script_repository", m.GetScriptRepository()) + 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 *PreReceiveHooksPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowDownstreamConfiguration sets the allow_downstream_configuration property value. Whether enforcement can be overridden at the org or repo level. default: `false` +func (m *PreReceiveHooksPostRequestBody) SetAllowDownstreamConfiguration(value *bool)() { + m.allow_downstream_configuration = value +} +// SetEnforcement sets the enforcement property value. The state of enforcement for this hook. default: `disabled` +func (m *PreReceiveHooksPostRequestBody) SetEnforcement(value *string)() { + m.enforcement = value +} +// SetEnvironment sets the environment property value. The pre-receive environment where the script is executed. +func (m *PreReceiveHooksPostRequestBody) SetEnvironment(value PreReceiveHooksPostRequestBody_environmentable)() { + m.environment = value +} +// SetName sets the name property value. The name of the hook. +func (m *PreReceiveHooksPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetScript sets the script property value. The script that the hook runs. +func (m *PreReceiveHooksPostRequestBody) SetScript(value *string)() { + m.script = value +} +// SetScriptRepository sets the script_repository property value. The GitHub repository where the script is kept. +func (m *PreReceiveHooksPostRequestBody) SetScriptRepository(value PreReceiveHooksPostRequestBody_script_repositoryable)() { + m.script_repository = value +} +type PreReceiveHooksPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowDownstreamConfiguration()(*bool) + GetEnforcement()(*string) + GetEnvironment()(PreReceiveHooksPostRequestBody_environmentable) + GetName()(*string) + GetScript()(*string) + GetScriptRepository()(PreReceiveHooksPostRequestBody_script_repositoryable) + SetAllowDownstreamConfiguration(value *bool)() + SetEnforcement(value *string)() + SetEnvironment(value PreReceiveHooksPostRequestBody_environmentable)() + SetName(value *string)() + SetScript(value *string)() + SetScriptRepository(value PreReceiveHooksPostRequestBody_script_repositoryable)() +} diff --git a/pkg/github/admin/pre_receive_hooks_post_request_body_escaped_environment.go b/pkg/github/admin/pre_receive_hooks_post_request_body_escaped_environment.go new file mode 100644 index 00000000..7b7a286e --- /dev/null +++ b/pkg/github/admin/pre_receive_hooks_post_request_body_escaped_environment.go @@ -0,0 +1,52 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PreReceiveHooksPostRequestBody_environment the pre-receive environment where the script is executed. +type PreReceiveHooksPostRequestBody_environment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewPreReceiveHooksPostRequestBody_environment instantiates a new PreReceiveHooksPostRequestBody_environment and sets the default values. +func NewPreReceiveHooksPostRequestBody_environment()(*PreReceiveHooksPostRequestBody_environment) { + m := &PreReceiveHooksPostRequestBody_environment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveHooksPostRequestBody_environmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveHooksPostRequestBody_environmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveHooksPostRequestBody_environment(), 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 *PreReceiveHooksPostRequestBody_environment) 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 *PreReceiveHooksPostRequestBody_environment) 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 *PreReceiveHooksPostRequestBody_environment) 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 *PreReceiveHooksPostRequestBody_environment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type PreReceiveHooksPostRequestBody_environmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/admin/pre_receive_hooks_post_request_body_escaped_script_escaped_repository.go b/pkg/github/admin/pre_receive_hooks_post_request_body_escaped_script_escaped_repository.go new file mode 100644 index 00000000..15ab5045 --- /dev/null +++ b/pkg/github/admin/pre_receive_hooks_post_request_body_escaped_script_escaped_repository.go @@ -0,0 +1,52 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PreReceiveHooksPostRequestBody_script_repository the GitHub repository where the script is kept. +type PreReceiveHooksPostRequestBody_script_repository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewPreReceiveHooksPostRequestBody_script_repository instantiates a new PreReceiveHooksPostRequestBody_script_repository and sets the default values. +func NewPreReceiveHooksPostRequestBody_script_repository()(*PreReceiveHooksPostRequestBody_script_repository) { + m := &PreReceiveHooksPostRequestBody_script_repository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveHooksPostRequestBody_script_repositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveHooksPostRequestBody_script_repositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveHooksPostRequestBody_script_repository(), 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 *PreReceiveHooksPostRequestBody_script_repository) 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 *PreReceiveHooksPostRequestBody_script_repository) 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 *PreReceiveHooksPostRequestBody_script_repository) 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 *PreReceiveHooksPostRequestBody_script_repository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type PreReceiveHooksPostRequestBody_script_repositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/admin/pre_receive_hooks_request_builder.go b/pkg/github/admin/pre_receive_hooks_request_builder.go new file mode 100644 index 00000000..c27d6752 --- /dev/null +++ b/pkg/github/admin/pre_receive_hooks_request_builder.go @@ -0,0 +1,112 @@ +package admin + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i24ee6165ab19c8a2e0c2d9a788ca00150f57243a6a5375502e37e96ab12549d1 "github.com/octokit/go-sdk-enterprise-server/pkg/github/admin/prereceivehooks" +) + +// PreReceiveHooksRequestBuilder builds and executes requests for operations under \admin\pre-receive-hooks +type PreReceiveHooksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// PreReceiveHooksRequestBuilderGetQueryParameters list pre-receive hooks +type PreReceiveHooksRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i24ee6165ab19c8a2e0c2d9a788ca00150f57243a6a5375502e37e96ab12549d1.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The property to sort the results by. + Sort *i24ee6165ab19c8a2e0c2d9a788ca00150f57243a6a5375502e37e96ab12549d1.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByPre_receive_hook_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.admin.preReceiveHooks.item collection +// returns a *PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder when successful +func (m *PreReceiveHooksRequestBuilder) ByPre_receive_hook_id(pre_receive_hook_id int32)(*PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["pre_receive_hook_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(pre_receive_hook_id), 10) + return NewPreReceiveHooksWithPre_receive_hook_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewPreReceiveHooksRequestBuilderInternal instantiates a new PreReceiveHooksRequestBuilder and sets the default values. +func NewPreReceiveHooksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PreReceiveHooksRequestBuilder) { + m := &PreReceiveHooksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/pre-receive-hooks{?direction*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewPreReceiveHooksRequestBuilder instantiates a new PreReceiveHooksRequestBuilder and sets the default values. +func NewPreReceiveHooksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PreReceiveHooksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPreReceiveHooksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list pre-receive hooks +// returns a []PreReceiveHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#list-pre-receive-hooks +func (m *PreReceiveHooksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PreReceiveHooksRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveHookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePreReceiveHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveHookable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveHookable) + } + } + return val, nil +} +// Post create a pre-receive hook +// returns a PreReceiveHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#create-a-pre-receive-hook +func (m *PreReceiveHooksRequestBuilder) Post(ctx context.Context, body PreReceiveHooksPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveHookable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePreReceiveHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveHookable), nil +} +// returns a *RequestInformation when successful +func (m *PreReceiveHooksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PreReceiveHooksRequestBuilderGetQueryParameters])(*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 +} +// returns a *RequestInformation when successful +func (m *PreReceiveHooksRequestBuilder) ToPostRequestInformation(ctx context.Context, body PreReceiveHooksPostRequestBodyable, 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 *PreReceiveHooksRequestBuilder when successful +func (m *PreReceiveHooksRequestBuilder) WithUrl(rawUrl string)(*PreReceiveHooksRequestBuilder) { + return NewPreReceiveHooksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/pre_receive_hooks_with_pre_escaped_receive_escaped_hook_escaped_item_request_builder.go b/pkg/github/admin/pre_receive_hooks_with_pre_escaped_receive_escaped_hook_escaped_item_request_builder.go new file mode 100644 index 00000000..34fbcb81 --- /dev/null +++ b/pkg/github/admin/pre_receive_hooks_with_pre_escaped_receive_escaped_hook_escaped_item_request_builder.go @@ -0,0 +1,107 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder builds and executes requests for operations under \admin\pre-receive-hooks\{pre_receive_hook_id} +type PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewPreReceiveHooksWithPre_receive_hook_ItemRequestBuilderInternal instantiates a new PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder and sets the default values. +func NewPreReceiveHooksWithPre_receive_hook_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) { + m := &PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/pre-receive-hooks/{pre_receive_hook_id}", pathParameters), + } + return m +} +// NewPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder instantiates a new PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder and sets the default values. +func NewPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPreReceiveHooksWithPre_receive_hook_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a pre-receive hook +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#delete-a-pre-receive-hook +func (m *PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get get a pre-receive hook +// returns a PreReceiveHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#get-a-pre-receive-hook +func (m *PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveHookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePreReceiveHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveHookable), nil +} +// Patch update a pre-receive hook +// returns a PreReceiveHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/pre-receive-hooks#update-a-pre-receive-hook +func (m *PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) Patch(ctx context.Context, body PreReceiveHooksItemWithPre_receive_hook_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveHookable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePreReceiveHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PreReceiveHookable), nil +} +// returns a *RequestInformation when successful +func (m *PreReceiveHooksWithPre_receive_hook_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) + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *PreReceiveHooksWithPre_receive_hook_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 +} +// returns a *RequestInformation when successful +func (m *PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body PreReceiveHooksItemWithPre_receive_hook_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 *PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder when successful +func (m *PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) WithUrl(rawUrl string)(*PreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) { + return NewPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/prereceiveenvironments/get_direction_query_parameter_type.go b/pkg/github/admin/prereceiveenvironments/get_direction_query_parameter_type.go new file mode 100644 index 00000000..34ae7f9f --- /dev/null +++ b/pkg/github/admin/prereceiveenvironments/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package prereceiveenvironments +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/admin/prereceiveenvironments/get_sort_query_parameter_type.go b/pkg/github/admin/prereceiveenvironments/get_sort_query_parameter_type.go new file mode 100644 index 00000000..0bcde586 --- /dev/null +++ b/pkg/github/admin/prereceiveenvironments/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package prereceiveenvironments +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + NAME_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "name"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "name": + result = NAME_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/admin/prereceivehooks/get_direction_query_parameter_type.go b/pkg/github/admin/prereceivehooks/get_direction_query_parameter_type.go new file mode 100644 index 00000000..cf3c4186 --- /dev/null +++ b/pkg/github/admin/prereceivehooks/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package prereceivehooks +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/admin/prereceivehooks/get_sort_query_parameter_type.go b/pkg/github/admin/prereceivehooks/get_sort_query_parameter_type.go new file mode 100644 index 00000000..ea9591b1 --- /dev/null +++ b/pkg/github/admin/prereceivehooks/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package prereceivehooks +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + NAME_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "name"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "name": + result = NAME_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/admin/tokens_request_builder.go b/pkg/github/admin/tokens_request_builder.go new file mode 100644 index 00000000..b3a1efeb --- /dev/null +++ b/pkg/github/admin/tokens_request_builder.go @@ -0,0 +1,78 @@ +package admin + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// TokensRequestBuilder builds and executes requests for operations under \admin\tokens +type TokensRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// TokensRequestBuilderGetQueryParameters lists personal access tokens for all users, including admin users. +type TokensRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByToken_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.admin.tokens.item collection +// returns a *TokensWithToken_ItemRequestBuilder when successful +func (m *TokensRequestBuilder) ByToken_id(token_id int32)(*TokensWithToken_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["token_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(token_id), 10) + return NewTokensWithToken_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewTokensRequestBuilderInternal instantiates a new TokensRequestBuilder and sets the default values. +func NewTokensRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TokensRequestBuilder) { + m := &TokensRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/tokens{?page*,per_page*}", pathParameters), + } + return m +} +// NewTokensRequestBuilder instantiates a new TokensRequestBuilder and sets the default values. +func NewTokensRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TokensRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTokensRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists personal access tokens for all users, including admin users. +// returns a []Authorizationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#list-personal-access-tokens +func (m *TokensRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[TokensRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthorizationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable) + } + } + return val, nil +} +// ToGetRequestInformation lists personal access tokens for all users, including admin users. +// returns a *RequestInformation when successful +func (m *TokensRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[TokensRequestBuilderGetQueryParameters])(*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 *TokensRequestBuilder when successful +func (m *TokensRequestBuilder) WithUrl(rawUrl string)(*TokensRequestBuilder) { + return NewTokensRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/tokens_with_token_escaped_item_request_builder.go b/pkg/github/admin/tokens_with_token_escaped_item_request_builder.go new file mode 100644 index 00000000..b780a8a6 --- /dev/null +++ b/pkg/github/admin/tokens_with_token_escaped_item_request_builder.go @@ -0,0 +1,51 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// TokensWithToken_ItemRequestBuilder builds and executes requests for operations under \admin\tokens\{token_id} +type TokensWithToken_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewTokensWithToken_ItemRequestBuilderInternal instantiates a new TokensWithToken_ItemRequestBuilder and sets the default values. +func NewTokensWithToken_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TokensWithToken_ItemRequestBuilder) { + m := &TokensWithToken_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/tokens/{token_id}", pathParameters), + } + return m +} +// NewTokensWithToken_ItemRequestBuilder instantiates a new TokensWithToken_ItemRequestBuilder and sets the default values. +func NewTokensWithToken_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TokensWithToken_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTokensWithToken_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a personal access token. Returns a `403 - Forbidden` status when a personal access token is in use. For example, if you access this endpoint with the same personal access token that you are trying to delete, you will receive this error. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-a-personal-access-token +func (m *TokensWithToken_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation deletes a personal access token. Returns a `403 - Forbidden` status when a personal access token is in use. For example, if you access this endpoint with the same personal access token that you are trying to delete, you will receive this error. +// returns a *RequestInformation when successful +func (m *TokensWithToken_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) + 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 *TokensWithToken_ItemRequestBuilder when successful +func (m *TokensWithToken_ItemRequestBuilder) WithUrl(rawUrl string)(*TokensWithToken_ItemRequestBuilder) { + return NewTokensWithToken_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/users_item_authorizations_post_request_body.go b/pkg/github/admin/users_item_authorizations_post_request_body.go new file mode 100644 index 00000000..e8de50d6 --- /dev/null +++ b/pkg/github/admin/users_item_authorizations_post_request_body.go @@ -0,0 +1,86 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type UsersItemAuthorizationsPostRequestBody 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 list of [scopes](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). + scopes []string +} +// NewUsersItemAuthorizationsPostRequestBody instantiates a new UsersItemAuthorizationsPostRequestBody and sets the default values. +func NewUsersItemAuthorizationsPostRequestBody()(*UsersItemAuthorizationsPostRequestBody) { + m := &UsersItemAuthorizationsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUsersItemAuthorizationsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsersItemAuthorizationsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUsersItemAuthorizationsPostRequestBody(), 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 *UsersItemAuthorizationsPostRequestBody) 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 *UsersItemAuthorizationsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["scopes"] = 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.SetScopes(res) + } + return nil + } + return res +} +// GetScopes gets the scopes property value. A list of [scopes](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). +// returns a []string when successful +func (m *UsersItemAuthorizationsPostRequestBody) GetScopes()([]string) { + return m.scopes +} +// Serialize serializes information the current object +func (m *UsersItemAuthorizationsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetScopes() != nil { + err := writer.WriteCollectionOfStringValues("scopes", m.GetScopes()) + 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 *UsersItemAuthorizationsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetScopes sets the scopes property value. A list of [scopes](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/understanding-scopes-for-oauth-apps/). +func (m *UsersItemAuthorizationsPostRequestBody) SetScopes(value []string)() { + m.scopes = value +} +type UsersItemAuthorizationsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetScopes()([]string) + SetScopes(value []string)() +} diff --git a/pkg/github/admin/users_item_authorizations_request_builder.go b/pkg/github/admin/users_item_authorizations_request_builder.go new file mode 100644 index 00000000..4719ff40 --- /dev/null +++ b/pkg/github/admin/users_item_authorizations_request_builder.go @@ -0,0 +1,81 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// UsersItemAuthorizationsRequestBuilder builds and executes requests for operations under \admin\users\{username}\authorizations +type UsersItemAuthorizationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewUsersItemAuthorizationsRequestBuilderInternal instantiates a new UsersItemAuthorizationsRequestBuilder and sets the default values. +func NewUsersItemAuthorizationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UsersItemAuthorizationsRequestBuilder) { + m := &UsersItemAuthorizationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/users/{username}/authorizations", pathParameters), + } + return m +} +// NewUsersItemAuthorizationsRequestBuilder instantiates a new UsersItemAuthorizationsRequestBuilder and sets the default values. +func NewUsersItemAuthorizationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UsersItemAuthorizationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewUsersItemAuthorizationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete an impersonation OAuth token +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-an-impersonation-oauth-token +func (m *UsersItemAuthorizationsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Post create an impersonation OAuth token +// returns a Authorizationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-an-impersonation-oauth-token +func (m *UsersItemAuthorizationsRequestBuilder) Post(ctx context.Context, body UsersItemAuthorizationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthorizationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable), nil +} +// returns a *RequestInformation when successful +func (m *UsersItemAuthorizationsRequestBuilder) 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 +} +// returns a *RequestInformation when successful +func (m *UsersItemAuthorizationsRequestBuilder) ToPostRequestInformation(ctx context.Context, body UsersItemAuthorizationsPostRequestBodyable, 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 *UsersItemAuthorizationsRequestBuilder when successful +func (m *UsersItemAuthorizationsRequestBuilder) WithUrl(rawUrl string)(*UsersItemAuthorizationsRequestBuilder) { + return NewUsersItemAuthorizationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/users_item_with_username_patch_request_body.go b/pkg/github/admin/users_item_with_username_patch_request_body.go new file mode 100644 index 00000000..4c6c0724 --- /dev/null +++ b/pkg/github/admin/users_item_with_username_patch_request_body.go @@ -0,0 +1,80 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type UsersItemWithUsernamePatchRequestBody 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 user's new username. + login *string +} +// NewUsersItemWithUsernamePatchRequestBody instantiates a new UsersItemWithUsernamePatchRequestBody and sets the default values. +func NewUsersItemWithUsernamePatchRequestBody()(*UsersItemWithUsernamePatchRequestBody) { + m := &UsersItemWithUsernamePatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUsersItemWithUsernamePatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsersItemWithUsernamePatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUsersItemWithUsernamePatchRequestBody(), 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 *UsersItemWithUsernamePatchRequestBody) 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 *UsersItemWithUsernamePatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + return res +} +// GetLogin gets the login property value. The user's new username. +// returns a *string when successful +func (m *UsersItemWithUsernamePatchRequestBody) GetLogin()(*string) { + return m.login +} +// Serialize serializes information the current object +func (m *UsersItemWithUsernamePatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("login", m.GetLogin()) + 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 *UsersItemWithUsernamePatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLogin sets the login property value. The user's new username. +func (m *UsersItemWithUsernamePatchRequestBody) SetLogin(value *string)() { + m.login = value +} +type UsersItemWithUsernamePatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLogin()(*string) + SetLogin(value *string)() +} diff --git a/pkg/github/admin/users_item_with_username_patch_response.go b/pkg/github/admin/users_item_with_username_patch_response.go new file mode 100644 index 00000000..f3f2c271 --- /dev/null +++ b/pkg/github/admin/users_item_with_username_patch_response.go @@ -0,0 +1,109 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type UsersItemWithUsernamePatchResponse 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 message property + message *string + // The url property + url *string +} +// NewUsersItemWithUsernamePatchResponse instantiates a new UsersItemWithUsernamePatchResponse and sets the default values. +func NewUsersItemWithUsernamePatchResponse()(*UsersItemWithUsernamePatchResponse) { + m := &UsersItemWithUsernamePatchResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUsersItemWithUsernamePatchResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsersItemWithUsernamePatchResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUsersItemWithUsernamePatchResponse(), 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 *UsersItemWithUsernamePatchResponse) 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 *UsersItemWithUsernamePatchResponse) 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *UsersItemWithUsernamePatchResponse) GetMessage()(*string) { + return m.message +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *UsersItemWithUsernamePatchResponse) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *UsersItemWithUsernamePatchResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *UsersItemWithUsernamePatchResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The message property +func (m *UsersItemWithUsernamePatchResponse) SetMessage(value *string)() { + m.message = value +} +// SetUrl sets the url property value. The url property +func (m *UsersItemWithUsernamePatchResponse) SetUrl(value *string)() { + m.url = value +} +type UsersItemWithUsernamePatchResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + GetUrl()(*string) + SetMessage(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/admin/users_post_request_body.go b/pkg/github/admin/users_post_request_body.go new file mode 100644 index 00000000..98dd38c5 --- /dev/null +++ b/pkg/github/admin/users_post_request_body.go @@ -0,0 +1,138 @@ +package admin + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type UsersPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // **Required for built-in authentication.** The user's emailaddress. This parameter can be omitted when using CAS, LDAP, or SAML.For more information, see "[About authentication for your enterprise](https://docs.github.com/enterprise-server@3.14/admin/identity-and-access-management/managing-iam-for-your-enterprise/about-authentication-for-your-enterprise)." + email *string + // The user's username. + login *string + // Whether to set the user as suspended when the user is created. + suspended *bool +} +// NewUsersPostRequestBody instantiates a new UsersPostRequestBody and sets the default values. +func NewUsersPostRequestBody()(*UsersPostRequestBody) { + m := &UsersPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUsersPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsersPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUsersPostRequestBody(), 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 *UsersPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. **Required for built-in authentication.** The user's emailaddress. This parameter can be omitted when using CAS, LDAP, or SAML.For more information, see "[About authentication for your enterprise](https://docs.github.com/enterprise-server@3.14/admin/identity-and-access-management/managing-iam-for-your-enterprise/about-authentication-for-your-enterprise)." +// returns a *string when successful +func (m *UsersPostRequestBody) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UsersPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["suspended"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSuspended(val) + } + return nil + } + return res +} +// GetLogin gets the login property value. The user's username. +// returns a *string when successful +func (m *UsersPostRequestBody) GetLogin()(*string) { + return m.login +} +// GetSuspended gets the suspended property value. Whether to set the user as suspended when the user is created. +// returns a *bool when successful +func (m *UsersPostRequestBody) GetSuspended()(*bool) { + return m.suspended +} +// Serialize serializes information the current object +func (m *UsersPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("suspended", m.GetSuspended()) + 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 *UsersPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. **Required for built-in authentication.** The user's emailaddress. This parameter can be omitted when using CAS, LDAP, or SAML.For more information, see "[About authentication for your enterprise](https://docs.github.com/enterprise-server@3.14/admin/identity-and-access-management/managing-iam-for-your-enterprise/about-authentication-for-your-enterprise)." +func (m *UsersPostRequestBody) SetEmail(value *string)() { + m.email = value +} +// SetLogin sets the login property value. The user's username. +func (m *UsersPostRequestBody) SetLogin(value *string)() { + m.login = value +} +// SetSuspended sets the suspended property value. Whether to set the user as suspended when the user is created. +func (m *UsersPostRequestBody) SetSuspended(value *bool)() { + m.suspended = value +} +type UsersPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetLogin()(*string) + GetSuspended()(*bool) + SetEmail(value *string)() + SetLogin(value *string)() + SetSuspended(value *bool)() +} diff --git a/pkg/github/admin/users_request_builder.go b/pkg/github/admin/users_request_builder.go new file mode 100644 index 00000000..88c10ce2 --- /dev/null +++ b/pkg/github/admin/users_request_builder.go @@ -0,0 +1,73 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// UsersRequestBuilder builds and executes requests for operations under \admin\users +type UsersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByUsername gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.admin.users.item collection +// returns a *UsersWithUsernameItemRequestBuilder when successful +func (m *UsersRequestBuilder) ByUsername(username string)(*UsersWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewUsersWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewUsersRequestBuilderInternal instantiates a new UsersRequestBuilder and sets the default values. +func NewUsersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UsersRequestBuilder) { + m := &UsersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/users", pathParameters), + } + return m +} +// NewUsersRequestBuilder instantiates a new UsersRequestBuilder and sets the default values. +func NewUsersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UsersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewUsersRequestBuilderInternal(urlParams, requestAdapter) +} +// Post if an external authentication mechanism is used, the login name should match the login name in the external system. If you are using LDAP authentication, you should also [update the LDAP mapping](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user) for the user.The login name will be normalized to only contain alphanumeric characters or single hyphens. For example, if you send `"octo_cat"` as the login, a user named `"octo-cat"` will be created.If the login name or email address is already associated with an account, the server will return a `422` response. +// returns a SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#create-a-user +func (m *UsersRequestBuilder) Post(ctx context.Context, body UsersPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable), nil +} +// ToPostRequestInformation if an external authentication mechanism is used, the login name should match the login name in the external system. If you are using LDAP authentication, you should also [update the LDAP mapping](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-user) for the user.The login name will be normalized to only contain alphanumeric characters or single hyphens. For example, if you send `"octo_cat"` as the login, a user named `"octo-cat"` will be created.If the login name or email address is already associated with an account, the server will return a `422` response. +// returns a *RequestInformation when successful +func (m *UsersRequestBuilder) ToPostRequestInformation(ctx context.Context, body UsersPostRequestBodyable, 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 *UsersRequestBuilder when successful +func (m *UsersRequestBuilder) WithUrl(rawUrl string)(*UsersRequestBuilder) { + return NewUsersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/admin/users_with_username_item_request_builder.go b/pkg/github/admin/users_with_username_item_request_builder.go new file mode 100644 index 00000000..25037318 --- /dev/null +++ b/pkg/github/admin/users_with_username_item_request_builder.go @@ -0,0 +1,86 @@ +package admin + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// UsersWithUsernameItemRequestBuilder builds and executes requests for operations under \admin\users\{username} +type UsersWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Authorizations the authorizations property +// returns a *UsersItemAuthorizationsRequestBuilder when successful +func (m *UsersWithUsernameItemRequestBuilder) Authorizations()(*UsersItemAuthorizationsRequestBuilder) { + return NewUsersItemAuthorizationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewUsersWithUsernameItemRequestBuilderInternal instantiates a new UsersWithUsernameItemRequestBuilder and sets the default values. +func NewUsersWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UsersWithUsernameItemRequestBuilder) { + m := &UsersWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/admin/users/{username}", pathParameters), + } + return m +} +// NewUsersWithUsernameItemRequestBuilder instantiates a new UsersWithUsernameItemRequestBuilder and sets the default values. +func NewUsersWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UsersWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewUsersWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deleting a user will delete all their repositories, gists, applications, and personal settings. [Suspending a user](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#suspend-a-user) is often a better option.You can delete any user account except your own. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#delete-a-user +func (m *UsersWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Patch update the username for a user +// returns a UsersItemWithUsernamePatchResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#update-the-username-for-a-user +func (m *UsersWithUsernameItemRequestBuilder) Patch(ctx context.Context, body UsersItemWithUsernamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(UsersItemWithUsernamePatchResponseable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateUsersItemWithUsernamePatchResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(UsersItemWithUsernamePatchResponseable), nil +} +// ToDeleteRequestInformation deleting a user will delete all their repositories, gists, applications, and personal settings. [Suspending a user](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#suspend-a-user) is often a better option.You can delete any user account except your own. +// returns a *RequestInformation when successful +func (m *UsersWithUsernameItemRequestBuilder) 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 +} +// returns a *RequestInformation when successful +func (m *UsersWithUsernameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body UsersItemWithUsernamePatchRequestBodyable, 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 *UsersWithUsernameItemRequestBuilder when successful +func (m *UsersWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*UsersWithUsernameItemRequestBuilder) { + return NewUsersWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/advisories/advisories_request_builder.go b/pkg/github/advisories/advisories_request_builder.go new file mode 100644 index 00000000..ee1ad5b2 --- /dev/null +++ b/pkg/github/advisories/advisories_request_builder.go @@ -0,0 +1,117 @@ +package advisories + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// AdvisoriesRequestBuilder builds and executes requests for operations under \advisories +type AdvisoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// AdvisoriesRequestBuilderGetQueryParameters lists all global security advisories that match the specified parameters. If no other parameters are defined, the request will return only GitHub-reviewed advisories that are not malware.By default, all responses will exclude advisories for malware, because malware are not standard vulnerabilities. To list advisories for malware, you must include the `type` parameter in your request, with the value `malware`. For more information about the different types of security advisories, see "[About the GitHub Advisory database](https://docs.github.com/enterprise-server@3.14/code-security/security-advisories/global-security-advisories/about-the-github-advisory-database#about-types-of-security-advisories)." +type AdvisoriesRequestBuilderGetQueryParameters struct { + // If specified, only return advisories that affect any of `package` or `package@version`. A maximum of 1000 packages can be specified.If the query parameter causes the URL to exceed the maximum URL length supported by your client, you must specify fewer packages.Example: `affects=package1,package2@1.0.0,package3@^2.0.0` or `affects[]=package1&affects[]=package2@1.0.0` + Affects *string `uriparametername:"affects"` + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Before *string `uriparametername:"before"` + // If specified, only advisories with this CVE (Common Vulnerabilities and Exposures) identifier will be returned. + Cve_id *string `uriparametername:"cve_id"` + // If specified, only advisories with these Common Weakness Enumerations (CWEs) will be returned.Example: `cwes=79,284,22` or `cwes[]=79&cwes[]=284&cwes[]=22` + Cwes *string `uriparametername:"cwes"` + // The direction to sort the results by. + Direction *GetDirectionQueryParameterType `uriparametername:"direction"` + // If specified, only advisories for these ecosystems will be returned. + Ecosystem *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecurityAdvisoryEcosystems `uriparametername:"ecosystem"` + // If specified, only return advisories that have an EPSS percentage score that matches the provided value.The EPSS percentage represents the likelihood of a CVE being exploited. + Epss_percentage *string `uriparametername:"epss_percentage"` + // If specified, only return advisories that have an EPSS percentile score that matches the provided value.The EPSS percentile represents the relative rank of the CVE's likelihood of being exploited compared to other CVEs. + Epss_percentile *string `uriparametername:"epss_percentile"` + // If specified, only advisories with this GHSA (GitHub Security Advisory) identifier will be returned. + Ghsa_id *string `uriparametername:"ghsa_id"` + // Whether to only return advisories that have been withdrawn. + Is_withdrawn *bool `uriparametername:"is_withdrawn"` + // If specified, only show advisories that were updated or published on a date or date range.For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/enterprise-server@3.14/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." + Modified *string `uriparametername:"modified"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // If specified, only return advisories that were published on a date or date range.For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/enterprise-server@3.14/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." + Published *string `uriparametername:"published"` + // If specified, only advisories with these severities will be returned. + Severity *GetSeverityQueryParameterType `uriparametername:"severity"` + // The property to sort the results by. + Sort *GetSortQueryParameterType `uriparametername:"sort"` + // If specified, only advisories of this type will be returned. By default, a request with no other parameters defined will only return reviewed advisories that are not malware. + Type *GetTypeQueryParameterType `uriparametername:"type"` + // If specified, only return advisories that were updated on a date or date range.For more information on the syntax of the date range, see "[Understanding the search syntax](https://docs.github.com/enterprise-server@3.14/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." + Updated *string `uriparametername:"updated"` +} +// ByGhsa_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.advisories.item collection +// returns a *WithGhsa_ItemRequestBuilder when successful +func (m *AdvisoriesRequestBuilder) ByGhsa_id(ghsa_id string)(*WithGhsa_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ghsa_id != "" { + urlTplParams["ghsa_id"] = ghsa_id + } + return NewWithGhsa_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewAdvisoriesRequestBuilderInternal instantiates a new AdvisoriesRequestBuilder and sets the default values. +func NewAdvisoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AdvisoriesRequestBuilder) { + m := &AdvisoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/advisories{?affects*,after*,before*,cve_id*,cwes*,direction*,ecosystem*,epss_percentage*,epss_percentile*,ghsa_id*,is_withdrawn*,modified*,per_page*,published*,severity*,sort*,type*,updated*}", pathParameters), + } + return m +} +// NewAdvisoriesRequestBuilder instantiates a new AdvisoriesRequestBuilder and sets the default values. +func NewAdvisoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AdvisoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAdvisoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all global security advisories that match the specified parameters. If no other parameters are defined, the request will return only GitHub-reviewed advisories that are not malware.By default, all responses will exclude advisories for malware, because malware are not standard vulnerabilities. To list advisories for malware, you must include the `type` parameter in your request, with the value `malware`. For more information about the different types of security advisories, see "[About the GitHub Advisory database](https://docs.github.com/enterprise-server@3.14/code-security/security-advisories/global-security-advisories/about-the-github-advisory-database#about-types-of-security-advisories)." +// returns a []GlobalAdvisoryable when successful +// returns a ValidationErrorSimple error when the service returns a 422 status code +// returns a BasicError error when the service returns a 429 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/security-advisories/global-advisories#list-global-security-advisories +func (m *AdvisoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[AdvisoriesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GlobalAdvisoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + "429": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGlobalAdvisoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GlobalAdvisoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GlobalAdvisoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists all global security advisories that match the specified parameters. If no other parameters are defined, the request will return only GitHub-reviewed advisories that are not malware.By default, all responses will exclude advisories for malware, because malware are not standard vulnerabilities. To list advisories for malware, you must include the `type` parameter in your request, with the value `malware`. For more information about the different types of security advisories, see "[About the GitHub Advisory database](https://docs.github.com/enterprise-server@3.14/code-security/security-advisories/global-security-advisories/about-the-github-advisory-database#about-types-of-security-advisories)." +// returns a *RequestInformation when successful +func (m *AdvisoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[AdvisoriesRequestBuilderGetQueryParameters])(*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 *AdvisoriesRequestBuilder when successful +func (m *AdvisoriesRequestBuilder) WithUrl(rawUrl string)(*AdvisoriesRequestBuilder) { + return NewAdvisoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/advisories/get_direction_query_parameter_type.go b/pkg/github/advisories/get_direction_query_parameter_type.go new file mode 100644 index 00000000..45e84b47 --- /dev/null +++ b/pkg/github/advisories/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package advisories +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/advisories/get_severity_query_parameter_type.go b/pkg/github/advisories/get_severity_query_parameter_type.go new file mode 100644 index 00000000..d8ca6f66 --- /dev/null +++ b/pkg/github/advisories/get_severity_query_parameter_type.go @@ -0,0 +1,42 @@ +package advisories +type GetSeverityQueryParameterType int + +const ( + UNKNOWN_GETSEVERITYQUERYPARAMETERTYPE GetSeverityQueryParameterType = iota + LOW_GETSEVERITYQUERYPARAMETERTYPE + MEDIUM_GETSEVERITYQUERYPARAMETERTYPE + HIGH_GETSEVERITYQUERYPARAMETERTYPE + CRITICAL_GETSEVERITYQUERYPARAMETERTYPE +) + +func (i GetSeverityQueryParameterType) String() string { + return []string{"unknown", "low", "medium", "high", "critical"}[i] +} +func ParseGetSeverityQueryParameterType(v string) (any, error) { + result := UNKNOWN_GETSEVERITYQUERYPARAMETERTYPE + switch v { + case "unknown": + result = UNKNOWN_GETSEVERITYQUERYPARAMETERTYPE + case "low": + result = LOW_GETSEVERITYQUERYPARAMETERTYPE + case "medium": + result = MEDIUM_GETSEVERITYQUERYPARAMETERTYPE + case "high": + result = HIGH_GETSEVERITYQUERYPARAMETERTYPE + case "critical": + result = CRITICAL_GETSEVERITYQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSeverityQueryParameterType(values []GetSeverityQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSeverityQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/advisories/get_sort_query_parameter_type.go b/pkg/github/advisories/get_sort_query_parameter_type.go new file mode 100644 index 00000000..76c1cd0a --- /dev/null +++ b/pkg/github/advisories/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package advisories +type GetSortQueryParameterType int + +const ( + UPDATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + PUBLISHED_GETSORTQUERYPARAMETERTYPE + EPSS_PERCENTAGE_GETSORTQUERYPARAMETERTYPE + EPSS_PERCENTILE_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"updated", "published", "epss_percentage", "epss_percentile"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := UPDATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "published": + result = PUBLISHED_GETSORTQUERYPARAMETERTYPE + case "epss_percentage": + result = EPSS_PERCENTAGE_GETSORTQUERYPARAMETERTYPE + case "epss_percentile": + result = EPSS_PERCENTILE_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/advisories/get_type_query_parameter_type.go b/pkg/github/advisories/get_type_query_parameter_type.go new file mode 100644 index 00000000..b189c0be --- /dev/null +++ b/pkg/github/advisories/get_type_query_parameter_type.go @@ -0,0 +1,36 @@ +package advisories +type GetTypeQueryParameterType int + +const ( + REVIEWED_GETTYPEQUERYPARAMETERTYPE GetTypeQueryParameterType = iota + MALWARE_GETTYPEQUERYPARAMETERTYPE + UNREVIEWED_GETTYPEQUERYPARAMETERTYPE +) + +func (i GetTypeQueryParameterType) String() string { + return []string{"reviewed", "malware", "unreviewed"}[i] +} +func ParseGetTypeQueryParameterType(v string) (any, error) { + result := REVIEWED_GETTYPEQUERYPARAMETERTYPE + switch v { + case "reviewed": + result = REVIEWED_GETTYPEQUERYPARAMETERTYPE + case "malware": + result = MALWARE_GETTYPEQUERYPARAMETERTYPE + case "unreviewed": + result = UNREVIEWED_GETTYPEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetTypeQueryParameterType(values []GetTypeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTypeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/advisories/with_ghsa_escaped_item_request_builder.go b/pkg/github/advisories/with_ghsa_escaped_item_request_builder.go new file mode 100644 index 00000000..e6073872 --- /dev/null +++ b/pkg/github/advisories/with_ghsa_escaped_item_request_builder.go @@ -0,0 +1,61 @@ +package advisories + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// WithGhsa_ItemRequestBuilder builds and executes requests for operations under \advisories\{ghsa_id} +type WithGhsa_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithGhsa_ItemRequestBuilderInternal instantiates a new WithGhsa_ItemRequestBuilder and sets the default values. +func NewWithGhsa_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithGhsa_ItemRequestBuilder) { + m := &WithGhsa_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/advisories/{ghsa_id}", pathParameters), + } + return m +} +// NewWithGhsa_ItemRequestBuilder instantiates a new WithGhsa_ItemRequestBuilder and sets the default values. +func NewWithGhsa_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithGhsa_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithGhsa_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a global security advisory using its GitHub Security Advisory (GHSA) identifier. +// returns a GlobalAdvisoryable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/security-advisories/global-advisories#get-a-global-security-advisory +func (m *WithGhsa_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GlobalAdvisoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGlobalAdvisoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GlobalAdvisoryable), nil +} +// ToGetRequestInformation gets a global security advisory using its GitHub Security Advisory (GHSA) identifier. +// returns a *RequestInformation when successful +func (m *WithGhsa_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *WithGhsa_ItemRequestBuilder when successful +func (m *WithGhsa_ItemRequestBuilder) WithUrl(rawUrl string)(*WithGhsa_ItemRequestBuilder) { + return NewWithGhsa_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/api_client.go b/pkg/github/api_client.go new file mode 100644 index 00000000..78a603fc --- /dev/null +++ b/pkg/github/api_client.go @@ -0,0 +1,284 @@ +package github + +import ( + "context" + i25911dc319edd61cbac496af7eab5ef20b6069a42515e22ec6a9bc97bf598488 "github.com/microsoft/kiota-serialization-json-go" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i4bcdc892e61ac17e2afc10b5e2b536b29f4fd6c1ad30f4a5a68df47495db3347 "github.com/microsoft/kiota-serialization-form-go" + i56887720f41ac882814261620b1c8459c4a992a0207af547c4453dd39fabc426 "github.com/microsoft/kiota-serialization-multipart-go" + i7294a22093d408fdca300f11b81a887d89c47b764af06c8b803e2323973fdb83 "github.com/microsoft/kiota-serialization-text-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + i019b368180824531ee10a9fabd22410b95ccd81f7e1b1f8416c99a317b24aff0 "github.com/octokit/go-sdk-enterprise-server/pkg/github/search" + i18df8a9d03a66fdd1437c9a40ea0f9e0a7c520e50037e2c547caa46c8d57621c "github.com/octokit/go-sdk-enterprise-server/pkg/github/applications" + i1920a84396ec87b264b65c3d4feffd636cd814025614ed8fc6837257346128db "github.com/octokit/go-sdk-enterprise-server/pkg/github/user" + i19256e8e3069f58ac9e1484a0b995f1de29bf1316e48c80e893c8e451770516d "github.com/octokit/go-sdk-enterprise-server/pkg/github/admin" + i1da9ff71b80748c2ffa3444d6d942401f510a5d59e7d0b85fba3f675a84cd93a "github.com/octokit/go-sdk-enterprise-server/pkg/github/setup" + i204bf8331d9b4bbcba744334dc5275abce98054b6b9396febb5ec4627553393a "github.com/octokit/go-sdk-enterprise-server/pkg/github/installation" + i22bad5e37e0fdcc5f6386ac06d16691f9e070a95085db42b968fccb55bb22a62 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos" + i242b26146724e60c7c0c92e35852ec04f99105c6d9e5042280fcf7b36048b9de "github.com/octokit/go-sdk-enterprise-server/pkg/github/enterprise" + i2553c08de368b7330dccbb084609f22b761d7062044d70c34052481b283f5b9a "github.com/octokit/go-sdk-enterprise-server/pkg/github/projects" + i2ae21604fdbb7f04d11551ec8fc6db64b2d62842c0aafe38bc4bb2acbbcc1166 "github.com/octokit/go-sdk-enterprise-server/pkg/github/networks" + i2c3692ea706dc939eb1fccbfa1f444338ef9d1dea009a854d1a90faa7e1f24f3 "github.com/octokit/go-sdk-enterprise-server/pkg/github/events" + i390649da93a8a4e2b2f499d2309963d032a52c104175e7dcd881d14d0ca62db2 "github.com/octokit/go-sdk-enterprise-server/pkg/github/gitignore" + i39384a1e70757d633c2ee950921fb9439950b78857111cb2dbd68b33f9d8830c "github.com/octokit/go-sdk-enterprise-server/pkg/github/advisories" + i435ec22ab9e6920515f1fb3655f10415d71afd100ccd097f650723a910916999 "github.com/octokit/go-sdk-enterprise-server/pkg/github/meta" + i4476ec40ff84502e96456ccdf4d8f7a9e12c4834106e8ad35b4847c7cb8ea9f4 "github.com/octokit/go-sdk-enterprise-server/pkg/github/gists" + i46a0b04ed3ba56ba62fbc553ce7cfe242cedfc763368fc6fff06a19d3cbe08c2 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs" + i486611744201264ade6725e5c8b2be0c591c652d6fc7fde3bb8f77e6aa092114 "github.com/octokit/go-sdk-enterprise-server/pkg/github/markdown" + i49aedbb6755a36d523c6f1f052735019f327e57cdd3408684ba45f2e885bd980 "github.com/octokit/go-sdk-enterprise-server/pkg/github/emojis" + i516aafeb513add23cb0b85066636cf037269fe65da463faa134b8956732972ba "github.com/octokit/go-sdk-enterprise-server/pkg/github/octocat" + i673f92a3a3e280895e22213d6efe43f261bc8c75f7ebd72e9afaba3d99f8a4df "github.com/octokit/go-sdk-enterprise-server/pkg/github/authorizations" + i802736a68ae4a9f1242e056c805d91c3644e113ac0ed67708a7aafae694512f3 "github.com/octokit/go-sdk-enterprise-server/pkg/github/licenses" + i88fc4f9ae1e68a7b479fa733a4c07fcea06906379a8f840f4d9d0356a0bfcb43 "github.com/octokit/go-sdk-enterprise-server/pkg/github/appmanifests" + ia6bb22cd55a47079901290dbf3289a756984a02dbba6d3c8afe677eb2abcb352 "github.com/octokit/go-sdk-enterprise-server/pkg/github/apps" + iab4fa88f4cfb41b10ba8be6db9ff835cabee88e1b3ebd8ca2a24889bd9a2bb66 "github.com/octokit/go-sdk-enterprise-server/pkg/github/teams" + iac93f8f095011ae884edfdf015eb4bd77cd2c4073c9001899baf6e5394f67d26 "github.com/octokit/go-sdk-enterprise-server/pkg/github/issues" + ib43f1d21bad1eaccb3220a6895cc4da70307341b670b60c2aa631d2995e47b3e "github.com/octokit/go-sdk-enterprise-server/pkg/github/rate_limit" + ibd0b9c8a18deb92eb077cd9e715af68e5f543021a34f53d8c5ece9d4e750477c "github.com/octokit/go-sdk-enterprise-server/pkg/github/feeds" + ic673ef3b555c335d84c8f292c04b9634308a76034507b576e75efb6aa8060af4 "github.com/octokit/go-sdk-enterprise-server/pkg/github/manage" + icbde3b6cc6b306eaac2200351e57ca9a3b13479fa37b08baaeb4b17445835c36 "github.com/octokit/go-sdk-enterprise-server/pkg/github/scim" + id285ec6c22949b7f657f9a7661f6e6849ef305c2114d4e0a5f1e0c0ce386d17a "github.com/octokit/go-sdk-enterprise-server/pkg/github/notifications" + idaa4e03303c4f6a0851c16c06625aac826d0830582346e4b614c29f34eacbd22 "github.com/octokit/go-sdk-enterprise-server/pkg/github/enterprises" + ideee9aaead60f0751b30729fcf84e07ef70a2f387455613efaccc0a48908813a "github.com/octokit/go-sdk-enterprise-server/pkg/github/zen" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ie2d2dc6169f03de2523572263aecda4690557f5da4d9eb8a3e4ad057f1e00609 "github.com/octokit/go-sdk-enterprise-server/pkg/github/app" + ie80ab2c4f62921be85b8d011cd12092ac3cfcc2e38bbf97c34edad846cd82460 "github.com/octokit/go-sdk-enterprise-server/pkg/github/organizations" + ieb3561664edbcd472a4089a7b601c05b4d7de53178c12aa3e14e0d6f1fcb91a7 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repositories" + if155ce7328d65c6829538f8121c72e07753ee85681edf8f539ba03b35a5b2a44 "github.com/octokit/go-sdk-enterprise-server/pkg/github/users" + if280428a0c8dabdeeed4742ac65d1e1798c574dfe8b7088e61badb601f707afa "github.com/octokit/go-sdk-enterprise-server/pkg/github/codes_of_conduct" +) + +// ApiClient the main entry point of the SDK, exposes the configuration and the fluent API. +type ApiClient struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Admin the admin property +// returns a *AdminRequestBuilder when successful +func (m *ApiClient) Admin()(*i19256e8e3069f58ac9e1484a0b995f1de29bf1316e48c80e893c8e451770516d.AdminRequestBuilder) { + return i19256e8e3069f58ac9e1484a0b995f1de29bf1316e48c80e893c8e451770516d.NewAdminRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Advisories the advisories property +// returns a *AdvisoriesRequestBuilder when successful +func (m *ApiClient) Advisories()(*i39384a1e70757d633c2ee950921fb9439950b78857111cb2dbd68b33f9d8830c.AdvisoriesRequestBuilder) { + return i39384a1e70757d633c2ee950921fb9439950b78857111cb2dbd68b33f9d8830c.NewAdvisoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// App the app property +// returns a *AppRequestBuilder when successful +func (m *ApiClient) App()(*ie2d2dc6169f03de2523572263aecda4690557f5da4d9eb8a3e4ad057f1e00609.AppRequestBuilder) { + return ie2d2dc6169f03de2523572263aecda4690557f5da4d9eb8a3e4ad057f1e00609.NewAppRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Applications the applications property +// returns a *ApplicationsRequestBuilder when successful +func (m *ApiClient) Applications()(*i18df8a9d03a66fdd1437c9a40ea0f9e0a7c520e50037e2c547caa46c8d57621c.ApplicationsRequestBuilder) { + return i18df8a9d03a66fdd1437c9a40ea0f9e0a7c520e50037e2c547caa46c8d57621c.NewApplicationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// AppManifests the appManifests property +// returns a *AppManifestsRequestBuilder when successful +func (m *ApiClient) AppManifests()(*i88fc4f9ae1e68a7b479fa733a4c07fcea06906379a8f840f4d9d0356a0bfcb43.AppManifestsRequestBuilder) { + return i88fc4f9ae1e68a7b479fa733a4c07fcea06906379a8f840f4d9d0356a0bfcb43.NewAppManifestsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Apps the apps property +// returns a *AppsRequestBuilder when successful +func (m *ApiClient) Apps()(*ia6bb22cd55a47079901290dbf3289a756984a02dbba6d3c8afe677eb2abcb352.AppsRequestBuilder) { + return ia6bb22cd55a47079901290dbf3289a756984a02dbba6d3c8afe677eb2abcb352.NewAppsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Authorizations the authorizations property +// returns a *AuthorizationsRequestBuilder when successful +func (m *ApiClient) Authorizations()(*i673f92a3a3e280895e22213d6efe43f261bc8c75f7ebd72e9afaba3d99f8a4df.AuthorizationsRequestBuilder) { + return i673f92a3a3e280895e22213d6efe43f261bc8c75f7ebd72e9afaba3d99f8a4df.NewAuthorizationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Codes_of_conduct the codes_of_conduct property +// returns a *Codes_of_conductRequestBuilder when successful +func (m *ApiClient) Codes_of_conduct()(*if280428a0c8dabdeeed4742ac65d1e1798c574dfe8b7088e61badb601f707afa.Codes_of_conductRequestBuilder) { + return if280428a0c8dabdeeed4742ac65d1e1798c574dfe8b7088e61badb601f707afa.NewCodes_of_conductRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewApiClient instantiates a new ApiClient and sets the default values. +func NewApiClient(requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiClient) { + m := &ApiClient{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}", map[string]string{}), + } + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RegisterDefaultSerializer(func() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriterFactory { return i25911dc319edd61cbac496af7eab5ef20b6069a42515e22ec6a9bc97bf598488.NewJsonSerializationWriterFactory() }) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RegisterDefaultSerializer(func() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriterFactory { return i7294a22093d408fdca300f11b81a887d89c47b764af06c8b803e2323973fdb83.NewTextSerializationWriterFactory() }) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RegisterDefaultSerializer(func() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriterFactory { return i4bcdc892e61ac17e2afc10b5e2b536b29f4fd6c1ad30f4a5a68df47495db3347.NewFormSerializationWriterFactory() }) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RegisterDefaultSerializer(func() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriterFactory { return i56887720f41ac882814261620b1c8459c4a992a0207af547c4453dd39fabc426.NewMultipartSerializationWriterFactory() }) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RegisterDefaultDeserializer(func() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNodeFactory { return i25911dc319edd61cbac496af7eab5ef20b6069a42515e22ec6a9bc97bf598488.NewJsonParseNodeFactory() }) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RegisterDefaultDeserializer(func() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNodeFactory { return i7294a22093d408fdca300f11b81a887d89c47b764af06c8b803e2323973fdb83.NewTextParseNodeFactory() }) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RegisterDefaultDeserializer(func() i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNodeFactory { return i4bcdc892e61ac17e2afc10b5e2b536b29f4fd6c1ad30f4a5a68df47495db3347.NewFormParseNodeFactory() }) + if m.BaseRequestBuilder.RequestAdapter.GetBaseUrl() == "" { + m.BaseRequestBuilder.RequestAdapter.SetBaseUrl("{protocol}://{hostname}/api/v3") + } + m.BaseRequestBuilder.PathParameters["baseurl"] = m.BaseRequestBuilder.RequestAdapter.GetBaseUrl() + return m +} +// Emojis the emojis property +// returns a *EmojisRequestBuilder when successful +func (m *ApiClient) Emojis()(*i49aedbb6755a36d523c6f1f052735019f327e57cdd3408684ba45f2e885bd980.EmojisRequestBuilder) { + return i49aedbb6755a36d523c6f1f052735019f327e57cdd3408684ba45f2e885bd980.NewEmojisRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Enterprise the enterprise property +// returns a *EnterpriseRequestBuilder when successful +func (m *ApiClient) Enterprise()(*i242b26146724e60c7c0c92e35852ec04f99105c6d9e5042280fcf7b36048b9de.EnterpriseRequestBuilder) { + return i242b26146724e60c7c0c92e35852ec04f99105c6d9e5042280fcf7b36048b9de.NewEnterpriseRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Enterprises the enterprises property +// returns a *EnterprisesRequestBuilder when successful +func (m *ApiClient) Enterprises()(*idaa4e03303c4f6a0851c16c06625aac826d0830582346e4b614c29f34eacbd22.EnterprisesRequestBuilder) { + return idaa4e03303c4f6a0851c16c06625aac826d0830582346e4b614c29f34eacbd22.NewEnterprisesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Events the events property +// returns a *EventsRequestBuilder when successful +func (m *ApiClient) Events()(*i2c3692ea706dc939eb1fccbfa1f444338ef9d1dea009a854d1a90faa7e1f24f3.EventsRequestBuilder) { + return i2c3692ea706dc939eb1fccbfa1f444338ef9d1dea009a854d1a90faa7e1f24f3.NewEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Feeds the feeds property +// returns a *FeedsRequestBuilder when successful +func (m *ApiClient) Feeds()(*ibd0b9c8a18deb92eb077cd9e715af68e5f543021a34f53d8c5ece9d4e750477c.FeedsRequestBuilder) { + return ibd0b9c8a18deb92eb077cd9e715af68e5f543021a34f53d8c5ece9d4e750477c.NewFeedsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get get Hypermedia links to resources accessible in GitHub's REST API +// returns a Rootable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/meta/meta#github-api-root +func (m *ApiClient) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Rootable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRootFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Rootable), nil +} +// Gists the gists property +// returns a *GistsRequestBuilder when successful +func (m *ApiClient) Gists()(*i4476ec40ff84502e96456ccdf4d8f7a9e12c4834106e8ad35b4847c7cb8ea9f4.GistsRequestBuilder) { + return i4476ec40ff84502e96456ccdf4d8f7a9e12c4834106e8ad35b4847c7cb8ea9f4.NewGistsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Gitignore the gitignore property +// returns a *GitignoreRequestBuilder when successful +func (m *ApiClient) Gitignore()(*i390649da93a8a4e2b2f499d2309963d032a52c104175e7dcd881d14d0ca62db2.GitignoreRequestBuilder) { + return i390649da93a8a4e2b2f499d2309963d032a52c104175e7dcd881d14d0ca62db2.NewGitignoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installation the installation property +// returns a *InstallationRequestBuilder when successful +func (m *ApiClient) Installation()(*i204bf8331d9b4bbcba744334dc5275abce98054b6b9396febb5ec4627553393a.InstallationRequestBuilder) { + return i204bf8331d9b4bbcba744334dc5275abce98054b6b9396febb5ec4627553393a.NewInstallationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Issues the issues property +// returns a *IssuesRequestBuilder when successful +func (m *ApiClient) Issues()(*iac93f8f095011ae884edfdf015eb4bd77cd2c4073c9001899baf6e5394f67d26.IssuesRequestBuilder) { + return iac93f8f095011ae884edfdf015eb4bd77cd2c4073c9001899baf6e5394f67d26.NewIssuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Licenses the licenses property +// returns a *LicensesRequestBuilder when successful +func (m *ApiClient) Licenses()(*i802736a68ae4a9f1242e056c805d91c3644e113ac0ed67708a7aafae694512f3.LicensesRequestBuilder) { + return i802736a68ae4a9f1242e056c805d91c3644e113ac0ed67708a7aafae694512f3.NewLicensesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Manage the manage property +// returns a *ManageRequestBuilder when successful +func (m *ApiClient) Manage()(*ic673ef3b555c335d84c8f292c04b9634308a76034507b576e75efb6aa8060af4.ManageRequestBuilder) { + return ic673ef3b555c335d84c8f292c04b9634308a76034507b576e75efb6aa8060af4.NewManageRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Markdown the markdown property +// returns a *MarkdownRequestBuilder when successful +func (m *ApiClient) Markdown()(*i486611744201264ade6725e5c8b2be0c591c652d6fc7fde3bb8f77e6aa092114.MarkdownRequestBuilder) { + return i486611744201264ade6725e5c8b2be0c591c652d6fc7fde3bb8f77e6aa092114.NewMarkdownRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Meta the meta property +// returns a *MetaRequestBuilder when successful +func (m *ApiClient) Meta()(*i435ec22ab9e6920515f1fb3655f10415d71afd100ccd097f650723a910916999.MetaRequestBuilder) { + return i435ec22ab9e6920515f1fb3655f10415d71afd100ccd097f650723a910916999.NewMetaRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Networks the networks property +// returns a *NetworksRequestBuilder when successful +func (m *ApiClient) Networks()(*i2ae21604fdbb7f04d11551ec8fc6db64b2d62842c0aafe38bc4bb2acbbcc1166.NetworksRequestBuilder) { + return i2ae21604fdbb7f04d11551ec8fc6db64b2d62842c0aafe38bc4bb2acbbcc1166.NewNetworksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Notifications the notifications property +// returns a *NotificationsRequestBuilder when successful +func (m *ApiClient) Notifications()(*id285ec6c22949b7f657f9a7661f6e6849ef305c2114d4e0a5f1e0c0ce386d17a.NotificationsRequestBuilder) { + return id285ec6c22949b7f657f9a7661f6e6849ef305c2114d4e0a5f1e0c0ce386d17a.NewNotificationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Octocat the octocat property +// returns a *OctocatRequestBuilder when successful +func (m *ApiClient) Octocat()(*i516aafeb513add23cb0b85066636cf037269fe65da463faa134b8956732972ba.OctocatRequestBuilder) { + return i516aafeb513add23cb0b85066636cf037269fe65da463faa134b8956732972ba.NewOctocatRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Organizations the organizations property +// returns a *OrganizationsRequestBuilder when successful +func (m *ApiClient) Organizations()(*ie80ab2c4f62921be85b8d011cd12092ac3cfcc2e38bbf97c34edad846cd82460.OrganizationsRequestBuilder) { + return ie80ab2c4f62921be85b8d011cd12092ac3cfcc2e38bbf97c34edad846cd82460.NewOrganizationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Orgs the orgs property +// returns a *OrgsRequestBuilder when successful +func (m *ApiClient) Orgs()(*i46a0b04ed3ba56ba62fbc553ce7cfe242cedfc763368fc6fff06a19d3cbe08c2.OrgsRequestBuilder) { + return i46a0b04ed3ba56ba62fbc553ce7cfe242cedfc763368fc6fff06a19d3cbe08c2.NewOrgsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Projects the projects property +// returns a *ProjectsRequestBuilder when successful +func (m *ApiClient) Projects()(*i2553c08de368b7330dccbb084609f22b761d7062044d70c34052481b283f5b9a.ProjectsRequestBuilder) { + return i2553c08de368b7330dccbb084609f22b761d7062044d70c34052481b283f5b9a.NewProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rate_limit the rate_limit property +// returns a *Rate_limitRequestBuilder when successful +func (m *ApiClient) Rate_limit()(*ib43f1d21bad1eaccb3220a6895cc4da70307341b670b60c2aa631d2995e47b3e.Rate_limitRequestBuilder) { + return ib43f1d21bad1eaccb3220a6895cc4da70307341b670b60c2aa631d2995e47b3e.NewRate_limitRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repos the repos property +// returns a *ReposRequestBuilder when successful +func (m *ApiClient) Repos()(*i22bad5e37e0fdcc5f6386ac06d16691f9e070a95085db42b968fccb55bb22a62.ReposRequestBuilder) { + return i22bad5e37e0fdcc5f6386ac06d16691f9e070a95085db42b968fccb55bb22a62.NewReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repositories the repositories property +// returns a *RepositoriesRequestBuilder when successful +func (m *ApiClient) Repositories()(*ieb3561664edbcd472a4089a7b601c05b4d7de53178c12aa3e14e0d6f1fcb91a7.RepositoriesRequestBuilder) { + return ieb3561664edbcd472a4089a7b601c05b4d7de53178c12aa3e14e0d6f1fcb91a7.NewRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Scim the scim property +// returns a *ScimRequestBuilder when successful +func (m *ApiClient) Scim()(*icbde3b6cc6b306eaac2200351e57ca9a3b13479fa37b08baaeb4b17445835c36.ScimRequestBuilder) { + return icbde3b6cc6b306eaac2200351e57ca9a3b13479fa37b08baaeb4b17445835c36.NewScimRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Search the search property +// returns a *SearchRequestBuilder when successful +func (m *ApiClient) Search()(*i019b368180824531ee10a9fabd22410b95ccd81f7e1b1f8416c99a317b24aff0.SearchRequestBuilder) { + return i019b368180824531ee10a9fabd22410b95ccd81f7e1b1f8416c99a317b24aff0.NewSearchRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Setup the setup property +// returns a *SetupRequestBuilder when successful +func (m *ApiClient) Setup()(*i1da9ff71b80748c2ffa3444d6d942401f510a5d59e7d0b85fba3f675a84cd93a.SetupRequestBuilder) { + return i1da9ff71b80748c2ffa3444d6d942401f510a5d59e7d0b85fba3f675a84cd93a.NewSetupRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Teams the teams property +// returns a *TeamsRequestBuilder when successful +func (m *ApiClient) Teams()(*iab4fa88f4cfb41b10ba8be6db9ff835cabee88e1b3ebd8ca2a24889bd9a2bb66.TeamsRequestBuilder) { + return iab4fa88f4cfb41b10ba8be6db9ff835cabee88e1b3ebd8ca2a24889bd9a2bb66.NewTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation get Hypermedia links to resources accessible in GitHub's REST API +// returns a *RequestInformation when successful +func (m *ApiClient) 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 +} +// User the user property +// returns a *UserRequestBuilder when successful +func (m *ApiClient) User()(*i1920a84396ec87b264b65c3d4feffd636cd814025614ed8fc6837257346128db.UserRequestBuilder) { + return i1920a84396ec87b264b65c3d4feffd636cd814025614ed8fc6837257346128db.NewUserRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Users the users property +// returns a *UsersRequestBuilder when successful +func (m *ApiClient) Users()(*if155ce7328d65c6829538f8121c72e07753ee85681edf8f539ba03b35a5b2a44.UsersRequestBuilder) { + return if155ce7328d65c6829538f8121c72e07753ee85681edf8f539ba03b35a5b2a44.NewUsersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Zen the zen property +// returns a *ZenRequestBuilder when successful +func (m *ApiClient) Zen()(*ideee9aaead60f0751b30729fcf84e07ef70a2f387455613efaccc0a48908813a.ZenRequestBuilder) { + return ideee9aaead60f0751b30729fcf84e07ef70a2f387455613efaccc0a48908813a.NewZenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/app/app_request_builder.go b/pkg/github/app/app_request_builder.go new file mode 100644 index 00000000..cc7514a0 --- /dev/null +++ b/pkg/github/app/app_request_builder.go @@ -0,0 +1,72 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// AppRequestBuilder builds and executes requests for operations under \app +type AppRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewAppRequestBuilderInternal instantiates a new AppRequestBuilder and sets the default values. +func NewAppRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AppRequestBuilder) { + m := &AppRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app", pathParameters), + } + return m +} +// NewAppRequestBuilder instantiates a new AppRequestBuilder and sets the default values. +func NewAppRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AppRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAppRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#list-installations-for-the-authenticated-app)" endpoint.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a Integrationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/apps#get-the-authenticated-app +func (m *AppRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIntegrationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable), nil +} +// Hook the hook property +// returns a *HookRequestBuilder when successful +func (m *AppRequestBuilder) Hook()(*HookRequestBuilder) { + return NewHookRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// InstallationRequests the installationRequests property +// returns a *InstallationRequestsRequestBuilder when successful +func (m *AppRequestBuilder) InstallationRequests()(*InstallationRequestsRequestBuilder) { + return NewInstallationRequestsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installations the installations property +// returns a *InstallationsRequestBuilder when successful +func (m *AppRequestBuilder) Installations()(*InstallationsRequestBuilder) { + return NewInstallationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation returns the GitHub App associated with the authentication credentials used. To see how many app installations are associated with this GitHub App, see the `installations_count` in the response. For more details about your app's installations, see the "[List installations for the authenticated app](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#list-installations-for-the-authenticated-app)" endpoint.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *AppRequestBuilder) 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 *AppRequestBuilder when successful +func (m *AppRequestBuilder) WithUrl(rawUrl string)(*AppRequestBuilder) { + return NewAppRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/app/hook_config_patch_request_body.go b/pkg/github/app/hook_config_patch_request_body.go new file mode 100644 index 00000000..d9aab620 --- /dev/null +++ b/pkg/github/app/hook_config_patch_request_body.go @@ -0,0 +1,168 @@ +package app + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type HookConfigPatchRequestBody 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 media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewHookConfigPatchRequestBody instantiates a new HookConfigPatchRequestBody and sets the default values. +func NewHookConfigPatchRequestBody()(*HookConfigPatchRequestBody) { + m := &HookConfigPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookConfigPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookConfigPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookConfigPatchRequestBody(), 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 *HookConfigPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *HookConfigPatchRequestBody) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HookConfigPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a WebhookConfigInsecureSslable when successful +func (m *HookConfigPatchRequestBody) GetInsecureSsl()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). +// returns a *string when successful +func (m *HookConfigPatchRequestBody) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *HookConfigPatchRequestBody) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *HookConfigPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *HookConfigPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *HookConfigPatchRequestBody) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *HookConfigPatchRequestBody) SetInsecureSsl(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). +func (m *HookConfigPatchRequestBody) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *HookConfigPatchRequestBody) SetUrl(value *string)() { + m.url = value +} +type HookConfigPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/app/hook_config_request_builder.go b/pkg/github/app/hook_config_request_builder.go new file mode 100644 index 00000000..6fb5291c --- /dev/null +++ b/pkg/github/app/hook_config_request_builder.go @@ -0,0 +1,88 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// HookConfigRequestBuilder builds and executes requests for operations under \app\hook\config +type HookConfigRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewHookConfigRequestBuilderInternal instantiates a new HookConfigRequestBuilder and sets the default values. +func NewHookConfigRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookConfigRequestBuilder) { + m := &HookConfigRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/hook/config", pathParameters), + } + return m +} +// NewHookConfigRequestBuilder instantiates a new HookConfigRequestBuilder and sets the default values. +func NewHookConfigRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookConfigRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewHookConfigRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)."You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a WebhookConfigable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/webhooks#get-a-webhook-configuration-for-an-app +func (m *HookConfigRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWebhookConfigFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable), nil +} +// Patch updates the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)."You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a WebhookConfigable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/webhooks#update-a-webhook-configuration-for-an-app +func (m *HookConfigRequestBuilder) Patch(ctx context.Context, body HookConfigPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWebhookConfigFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable), nil +} +// ToGetRequestInformation returns the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)."You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *HookConfigRequestBuilder) 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 the webhook configuration for a GitHub App. For more information about configuring a webhook for your app, see "[Creating a GitHub App](/developers/apps/creating-a-github-app)."You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *HookConfigRequestBuilder) ToPatchRequestInformation(ctx context.Context, body HookConfigPatchRequestBodyable, 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 *HookConfigRequestBuilder when successful +func (m *HookConfigRequestBuilder) WithUrl(rawUrl string)(*HookConfigRequestBuilder) { + return NewHookConfigRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/app/hook_deliveries_item_attempts_post_response.go b/pkg/github/app/hook_deliveries_item_attempts_post_response.go new file mode 100644 index 00000000..8ca2fc59 --- /dev/null +++ b/pkg/github/app/hook_deliveries_item_attempts_post_response.go @@ -0,0 +1,51 @@ +package app + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type HookDeliveriesItemAttemptsPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewHookDeliveriesItemAttemptsPostResponse instantiates a new HookDeliveriesItemAttemptsPostResponse and sets the default values. +func NewHookDeliveriesItemAttemptsPostResponse()(*HookDeliveriesItemAttemptsPostResponse) { + m := &HookDeliveriesItemAttemptsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDeliveriesItemAttemptsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDeliveriesItemAttemptsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDeliveriesItemAttemptsPostResponse(), 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 *HookDeliveriesItemAttemptsPostResponse) 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 *HookDeliveriesItemAttemptsPostResponse) 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 *HookDeliveriesItemAttemptsPostResponse) 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 *HookDeliveriesItemAttemptsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type HookDeliveriesItemAttemptsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/app/hook_deliveries_item_attempts_request_builder.go b/pkg/github/app/hook_deliveries_item_attempts_request_builder.go new file mode 100644 index 00000000..d9dde756 --- /dev/null +++ b/pkg/github/app/hook_deliveries_item_attempts_request_builder.go @@ -0,0 +1,63 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// HookDeliveriesItemAttemptsRequestBuilder builds and executes requests for operations under \app\hook\deliveries\{delivery_id}\attempts +type HookDeliveriesItemAttemptsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewHookDeliveriesItemAttemptsRequestBuilderInternal instantiates a new HookDeliveriesItemAttemptsRequestBuilder and sets the default values. +func NewHookDeliveriesItemAttemptsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookDeliveriesItemAttemptsRequestBuilder) { + m := &HookDeliveriesItemAttemptsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/hook/deliveries/{delivery_id}/attempts", pathParameters), + } + return m +} +// NewHookDeliveriesItemAttemptsRequestBuilder instantiates a new HookDeliveriesItemAttemptsRequestBuilder and sets the default values. +func NewHookDeliveriesItemAttemptsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookDeliveriesItemAttemptsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewHookDeliveriesItemAttemptsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post redeliver a delivery for the webhook configured for a GitHub App.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a HookDeliveriesItemAttemptsPostResponseable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/webhooks#redeliver-a-delivery-for-an-app-webhook +func (m *HookDeliveriesItemAttemptsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(HookDeliveriesItemAttemptsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateHookDeliveriesItemAttemptsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(HookDeliveriesItemAttemptsPostResponseable), nil +} +// ToPostRequestInformation redeliver a delivery for the webhook configured for a GitHub App.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *HookDeliveriesItemAttemptsRequestBuilder) 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 *HookDeliveriesItemAttemptsRequestBuilder when successful +func (m *HookDeliveriesItemAttemptsRequestBuilder) WithUrl(rawUrl string)(*HookDeliveriesItemAttemptsRequestBuilder) { + return NewHookDeliveriesItemAttemptsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/app/hook_deliveries_request_builder.go b/pkg/github/app/hook_deliveries_request_builder.go new file mode 100644 index 00000000..cf0b3617 --- /dev/null +++ b/pkg/github/app/hook_deliveries_request_builder.go @@ -0,0 +1,85 @@ +package app + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// HookDeliveriesRequestBuilder builds and executes requests for operations under \app\hook\deliveries +type HookDeliveriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// HookDeliveriesRequestBuilderGetQueryParameters returns a list of webhook deliveries for the webhook configured for a GitHub App.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +type HookDeliveriesRequestBuilderGetQueryParameters struct { + // Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + Cursor *string `uriparametername:"cursor"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + Redelivery *bool `uriparametername:"redelivery"` +} +// ByDelivery_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.app.hook.deliveries.item collection +// returns a *HookDeliveriesWithDelivery_ItemRequestBuilder when successful +func (m *HookDeliveriesRequestBuilder) ByDelivery_id(delivery_id int32)(*HookDeliveriesWithDelivery_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["delivery_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(delivery_id), 10) + return NewHookDeliveriesWithDelivery_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewHookDeliveriesRequestBuilderInternal instantiates a new HookDeliveriesRequestBuilder and sets the default values. +func NewHookDeliveriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookDeliveriesRequestBuilder) { + m := &HookDeliveriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/hook/deliveries{?cursor*,per_page*,redelivery*}", pathParameters), + } + return m +} +// NewHookDeliveriesRequestBuilder instantiates a new HookDeliveriesRequestBuilder and sets the default values. +func NewHookDeliveriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookDeliveriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewHookDeliveriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a list of webhook deliveries for the webhook configured for a GitHub App.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a []HookDeliveryItemable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/webhooks#list-deliveries-for-an-app-webhook +func (m *HookDeliveriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[HookDeliveriesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryItemable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateHookDeliveryItemFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryItemable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryItemable) + } + } + return val, nil +} +// ToGetRequestInformation returns a list of webhook deliveries for the webhook configured for a GitHub App.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *HookDeliveriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[HookDeliveriesRequestBuilderGetQueryParameters])(*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 *HookDeliveriesRequestBuilder when successful +func (m *HookDeliveriesRequestBuilder) WithUrl(rawUrl string)(*HookDeliveriesRequestBuilder) { + return NewHookDeliveriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/app/hook_deliveries_with_delivery_escaped_item_request_builder.go b/pkg/github/app/hook_deliveries_with_delivery_escaped_item_request_builder.go new file mode 100644 index 00000000..732c581e --- /dev/null +++ b/pkg/github/app/hook_deliveries_with_delivery_escaped_item_request_builder.go @@ -0,0 +1,68 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// HookDeliveriesWithDelivery_ItemRequestBuilder builds and executes requests for operations under \app\hook\deliveries\{delivery_id} +type HookDeliveriesWithDelivery_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Attempts the attempts property +// returns a *HookDeliveriesItemAttemptsRequestBuilder when successful +func (m *HookDeliveriesWithDelivery_ItemRequestBuilder) Attempts()(*HookDeliveriesItemAttemptsRequestBuilder) { + return NewHookDeliveriesItemAttemptsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewHookDeliveriesWithDelivery_ItemRequestBuilderInternal instantiates a new HookDeliveriesWithDelivery_ItemRequestBuilder and sets the default values. +func NewHookDeliveriesWithDelivery_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookDeliveriesWithDelivery_ItemRequestBuilder) { + m := &HookDeliveriesWithDelivery_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/hook/deliveries/{delivery_id}", pathParameters), + } + return m +} +// NewHookDeliveriesWithDelivery_ItemRequestBuilder instantiates a new HookDeliveriesWithDelivery_ItemRequestBuilder and sets the default values. +func NewHookDeliveriesWithDelivery_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookDeliveriesWithDelivery_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewHookDeliveriesWithDelivery_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a delivery for the webhook configured for a GitHub App.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a HookDeliveryable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/webhooks#get-a-delivery-for-an-app-webhook +func (m *HookDeliveriesWithDelivery_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateHookDeliveryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryable), nil +} +// ToGetRequestInformation returns a delivery for the webhook configured for a GitHub App.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *HookDeliveriesWithDelivery_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *HookDeliveriesWithDelivery_ItemRequestBuilder when successful +func (m *HookDeliveriesWithDelivery_ItemRequestBuilder) WithUrl(rawUrl string)(*HookDeliveriesWithDelivery_ItemRequestBuilder) { + return NewHookDeliveriesWithDelivery_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/app/hook_request_builder.go b/pkg/github/app/hook_request_builder.go new file mode 100644 index 00000000..60ac8c40 --- /dev/null +++ b/pkg/github/app/hook_request_builder.go @@ -0,0 +1,33 @@ +package app + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// HookRequestBuilder builds and executes requests for operations under \app\hook +type HookRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Config the config property +// returns a *HookConfigRequestBuilder when successful +func (m *HookRequestBuilder) Config()(*HookConfigRequestBuilder) { + return NewHookConfigRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewHookRequestBuilderInternal instantiates a new HookRequestBuilder and sets the default values. +func NewHookRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookRequestBuilder) { + m := &HookRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/hook", pathParameters), + } + return m +} +// NewHookRequestBuilder instantiates a new HookRequestBuilder and sets the default values. +func NewHookRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*HookRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewHookRequestBuilderInternal(urlParams, requestAdapter) +} +// Deliveries the deliveries property +// returns a *HookDeliveriesRequestBuilder when successful +func (m *HookRequestBuilder) Deliveries()(*HookDeliveriesRequestBuilder) { + return NewHookDeliveriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/app/installation_requests_request_builder.go b/pkg/github/app/installation_requests_request_builder.go new file mode 100644 index 00000000..ae3d15c9 --- /dev/null +++ b/pkg/github/app/installation_requests_request_builder.go @@ -0,0 +1,71 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// InstallationRequestsRequestBuilder builds and executes requests for operations under \app\installation-requests +type InstallationRequestsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// InstallationRequestsRequestBuilderGetQueryParameters lists all the pending installation requests for the authenticated GitHub App. +type InstallationRequestsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewInstallationRequestsRequestBuilderInternal instantiates a new InstallationRequestsRequestBuilder and sets the default values. +func NewInstallationRequestsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationRequestsRequestBuilder) { + m := &InstallationRequestsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/installation-requests{?page*,per_page*}", pathParameters), + } + return m +} +// NewInstallationRequestsRequestBuilder instantiates a new InstallationRequestsRequestBuilder and sets the default values. +func NewInstallationRequestsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationRequestsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationRequestsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all the pending installation requests for the authenticated GitHub App. +// returns a []IntegrationInstallationRequestable when successful +// returns a BasicError error when the service returns a 401 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/apps#list-installation-requests-for-the-authenticated-app +func (m *InstallationRequestsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationRequestsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IntegrationInstallationRequestable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIntegrationInstallationRequestFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IntegrationInstallationRequestable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IntegrationInstallationRequestable) + } + } + return val, nil +} +// ToGetRequestInformation lists all the pending installation requests for the authenticated GitHub App. +// returns a *RequestInformation when successful +func (m *InstallationRequestsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationRequestsRequestBuilderGetQueryParameters])(*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 *InstallationRequestsRequestBuilder when successful +func (m *InstallationRequestsRequestBuilder) WithUrl(rawUrl string)(*InstallationRequestsRequestBuilder) { + return NewInstallationRequestsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/app/installations_item_access_escaped_tokens_post_request_body.go b/pkg/github/app/installations_item_access_escaped_tokens_post_request_body.go new file mode 100644 index 00000000..b09b90d0 --- /dev/null +++ b/pkg/github/app/installations_item_access_escaped_tokens_post_request_body.go @@ -0,0 +1,151 @@ +package app + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type InstallationsItemAccess_tokensPostRequestBody 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 permissions granted to the user access token. + permissions ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AppPermissionsable + // List of repository names that the token should have access to + repositories []string + // List of repository IDs that the token should have access to + repository_ids []int32 +} +// NewInstallationsItemAccess_tokensPostRequestBody instantiates a new InstallationsItemAccess_tokensPostRequestBody and sets the default values. +func NewInstallationsItemAccess_tokensPostRequestBody()(*InstallationsItemAccess_tokensPostRequestBody) { + m := &InstallationsItemAccess_tokensPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateInstallationsItemAccess_tokensPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInstallationsItemAccess_tokensPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInstallationsItemAccess_tokensPostRequestBody(), 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 *InstallationsItemAccess_tokensPostRequestBody) 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 *InstallationsItemAccess_tokensPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAppPermissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AppPermissionsable)) + } + return nil + } + res["repositories"] = 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.SetRepositories(res) + } + return nil + } + res["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.SetRepositoryIds(res) + } + return nil + } + return res +} +// GetPermissions gets the permissions property value. The permissions granted to the user access token. +// returns a AppPermissionsable when successful +func (m *InstallationsItemAccess_tokensPostRequestBody) GetPermissions()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AppPermissionsable) { + return m.permissions +} +// GetRepositories gets the repositories property value. List of repository names that the token should have access to +// returns a []string when successful +func (m *InstallationsItemAccess_tokensPostRequestBody) GetRepositories()([]string) { + return m.repositories +} +// GetRepositoryIds gets the repository_ids property value. List of repository IDs that the token should have access to +// returns a []int32 when successful +func (m *InstallationsItemAccess_tokensPostRequestBody) GetRepositoryIds()([]int32) { + return m.repository_ids +} +// Serialize serializes information the current object +func (m *InstallationsItemAccess_tokensPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + err := writer.WriteCollectionOfStringValues("repositories", m.GetRepositories()) + if err != nil { + return err + } + } + if m.GetRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("repository_ids", m.GetRepositoryIds()) + 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 *InstallationsItemAccess_tokensPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPermissions sets the permissions property value. The permissions granted to the user access token. +func (m *InstallationsItemAccess_tokensPostRequestBody) SetPermissions(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AppPermissionsable)() { + m.permissions = value +} +// SetRepositories sets the repositories property value. List of repository names that the token should have access to +func (m *InstallationsItemAccess_tokensPostRequestBody) SetRepositories(value []string)() { + m.repositories = value +} +// SetRepositoryIds sets the repository_ids property value. List of repository IDs that the token should have access to +func (m *InstallationsItemAccess_tokensPostRequestBody) SetRepositoryIds(value []int32)() { + m.repository_ids = value +} +type InstallationsItemAccess_tokensPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPermissions()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AppPermissionsable) + GetRepositories()([]string) + GetRepositoryIds()([]int32) + SetPermissions(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AppPermissionsable)() + SetRepositories(value []string)() + SetRepositoryIds(value []int32)() +} diff --git a/pkg/github/app/installations_item_access_escaped_tokens_request_builder.go b/pkg/github/app/installations_item_access_escaped_tokens_request_builder.go new file mode 100644 index 00000000..9904edc3 --- /dev/null +++ b/pkg/github/app/installations_item_access_escaped_tokens_request_builder.go @@ -0,0 +1,71 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// InstallationsItemAccess_tokensRequestBuilder builds and executes requests for operations under \app\installations\{installation_id}\access_tokens +type InstallationsItemAccess_tokensRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewInstallationsItemAccess_tokensRequestBuilderInternal instantiates a new InstallationsItemAccess_tokensRequestBuilder and sets the default values. +func NewInstallationsItemAccess_tokensRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemAccess_tokensRequestBuilder) { + m := &InstallationsItemAccess_tokensRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/installations/{installation_id}/access_tokens", pathParameters), + } + return m +} +// NewInstallationsItemAccess_tokensRequestBuilder instantiates a new InstallationsItemAccess_tokensRequestBuilder and sets the default values. +func NewInstallationsItemAccess_tokensRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemAccess_tokensRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsItemAccess_tokensRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access.Optionally, you can use the `repositories` or `repository_ids` body parameters to specify individual repositories that the installation access token can access. If you don't use `repositories` or `repository_ids` to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.When using the repository or permission parameters to reduce the access of the token, the complexity of the token is increased due to both the number of permissions in the request and the number of repositories the token will have access to. If the complexity is too large, the token will fail to be issued. If this occurs, the error message will indicate the maximum number of repositories that should be requested. For the average application requesting 8 permissions, this limit is around 5000 repositories. With fewer permissions requested, more repositories are supported.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a InstallationTokenable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/apps#create-an-installation-access-token-for-an-app +func (m *InstallationsItemAccess_tokensRequestBuilder) Post(ctx context.Context, body InstallationsItemAccess_tokensPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.InstallationTokenable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateInstallationTokenFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.InstallationTokenable), nil +} +// ToPostRequestInformation creates an installation access token that enables a GitHub App to make authenticated API requests for the app's installation on an organization or individual account. Installation tokens expire one hour from the time you create them. Using an expired token produces a status code of `401 - Unauthorized`, and requires creating a new installation token. By default the installation token has access to all repositories that the installation can access.Optionally, you can use the `repositories` or `repository_ids` body parameters to specify individual repositories that the installation access token can access. If you don't use `repositories` or `repository_ids` to grant access to specific repositories, the installation access token will have access to all repositories that the installation was granted access to. The installation access token cannot be granted access to repositories that the installation was not granted access to. Up to 500 repositories can be listed in this manner.Optionally, use the `permissions` body parameter to specify the permissions that the installation access token should have. If `permissions` is not specified, the installation access token will have all of the permissions that were granted to the app. The installation access token cannot be granted permissions that the app was not granted.When using the repository or permission parameters to reduce the access of the token, the complexity of the token is increased due to both the number of permissions in the request and the number of repositories the token will have access to. If the complexity is too large, the token will fail to be issued. If this occurs, the error message will indicate the maximum number of repositories that should be requested. For the average application requesting 8 permissions, this limit is around 5000 repositories. With fewer permissions requested, more repositories are supported.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *InstallationsItemAccess_tokensRequestBuilder) ToPostRequestInformation(ctx context.Context, body InstallationsItemAccess_tokensPostRequestBodyable, 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 *InstallationsItemAccess_tokensRequestBuilder when successful +func (m *InstallationsItemAccess_tokensRequestBuilder) WithUrl(rawUrl string)(*InstallationsItemAccess_tokensRequestBuilder) { + return NewInstallationsItemAccess_tokensRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/app/installations_item_suspended_request_builder.go b/pkg/github/app/installations_item_suspended_request_builder.go new file mode 100644 index 00000000..e828986d --- /dev/null +++ b/pkg/github/app/installations_item_suspended_request_builder.go @@ -0,0 +1,84 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// InstallationsItemSuspendedRequestBuilder builds and executes requests for operations under \app\installations\{installation_id}\suspended +type InstallationsItemSuspendedRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewInstallationsItemSuspendedRequestBuilderInternal instantiates a new InstallationsItemSuspendedRequestBuilder and sets the default values. +func NewInstallationsItemSuspendedRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemSuspendedRequestBuilder) { + m := &InstallationsItemSuspendedRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/installations/{installation_id}/suspended", pathParameters), + } + return m +} +// NewInstallationsItemSuspendedRequestBuilder instantiates a new InstallationsItemSuspendedRequestBuilder and sets the default values. +func NewInstallationsItemSuspendedRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemSuspendedRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsItemSuspendedRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a GitHub App installation suspension.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/apps#unsuspend-an-app-installation +func (m *InstallationsItemSuspendedRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub Enterprise Server API or webhook events is blocked for that account.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/apps#suspend-an-app-installation +func (m *InstallationsItemSuspendedRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a GitHub App installation suspension.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *InstallationsItemSuspendedRequestBuilder) 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") + return requestInfo, nil +} +// ToPutRequestInformation suspends a GitHub App on a user, organization, or business account, which blocks the app from accessing the account's resources. When a GitHub App is suspended, the app's access to the GitHub Enterprise Server API or webhook events is blocked for that account.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *InstallationsItemSuspendedRequestBuilder) ToPutRequestInformation(ctx context.Context, 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") + 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 *InstallationsItemSuspendedRequestBuilder when successful +func (m *InstallationsItemSuspendedRequestBuilder) WithUrl(rawUrl string)(*InstallationsItemSuspendedRequestBuilder) { + return NewInstallationsItemSuspendedRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/app/installations_request_builder.go b/pkg/github/app/installations_request_builder.go new file mode 100644 index 00000000..93ed5a64 --- /dev/null +++ b/pkg/github/app/installations_request_builder.go @@ -0,0 +1,82 @@ +package app + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// InstallationsRequestBuilder builds and executes requests for operations under \app\installations +type InstallationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// InstallationsRequestBuilderGetQueryParameters the permissions the installation has are included under the `permissions` key.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +type InstallationsRequestBuilderGetQueryParameters struct { + Outdated *string `uriparametername:"outdated"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// ByInstallation_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.app.installations.item collection +// returns a *InstallationsWithInstallation_ItemRequestBuilder when successful +func (m *InstallationsRequestBuilder) ByInstallation_id(installation_id int32)(*InstallationsWithInstallation_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["installation_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(installation_id), 10) + return NewInstallationsWithInstallation_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewInstallationsRequestBuilderInternal instantiates a new InstallationsRequestBuilder and sets the default values. +func NewInstallationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsRequestBuilder) { + m := &InstallationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/installations{?outdated*,page*,per_page*,since*}", pathParameters), + } + return m +} +// NewInstallationsRequestBuilder instantiates a new InstallationsRequestBuilder and sets the default values. +func NewInstallationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get the permissions the installation has are included under the `permissions` key.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a []Installationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/apps#list-installations-for-the-authenticated-app +func (m *InstallationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateInstallationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable) + } + } + return val, nil +} +// ToGetRequestInformation the permissions the installation has are included under the `permissions` key.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *InstallationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationsRequestBuilderGetQueryParameters])(*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 *InstallationsRequestBuilder when successful +func (m *InstallationsRequestBuilder) WithUrl(rawUrl string)(*InstallationsRequestBuilder) { + return NewInstallationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/app/installations_with_installation_escaped_item_request_builder.go b/pkg/github/app/installations_with_installation_escaped_item_request_builder.go new file mode 100644 index 00000000..a43a2567 --- /dev/null +++ b/pkg/github/app/installations_with_installation_escaped_item_request_builder.go @@ -0,0 +1,98 @@ +package app + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// InstallationsWithInstallation_ItemRequestBuilder builds and executes requests for operations under \app\installations\{installation_id} +type InstallationsWithInstallation_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Access_tokens the access_tokens property +// returns a *InstallationsItemAccess_tokensRequestBuilder when successful +func (m *InstallationsWithInstallation_ItemRequestBuilder) Access_tokens()(*InstallationsItemAccess_tokensRequestBuilder) { + return NewInstallationsItemAccess_tokensRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewInstallationsWithInstallation_ItemRequestBuilderInternal instantiates a new InstallationsWithInstallation_ItemRequestBuilder and sets the default values. +func NewInstallationsWithInstallation_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsWithInstallation_ItemRequestBuilder) { + m := &InstallationsWithInstallation_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app/installations/{installation_id}", pathParameters), + } + return m +} +// NewInstallationsWithInstallation_ItemRequestBuilder instantiates a new InstallationsWithInstallation_ItemRequestBuilder and sets the default values. +func NewInstallationsWithInstallation_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsWithInstallation_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsWithInstallation_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#suspend-an-app-installation)" endpoint.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/apps#delete-an-installation-for-the-authenticated-app +func (m *InstallationsWithInstallation_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 { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get enables an authenticated GitHub App to find an installation's information using the installation id.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a Installationable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/apps#get-an-installation-for-the-authenticated-app +func (m *InstallationsWithInstallation_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateInstallationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable), nil +} +// Suspended the suspended property +// returns a *InstallationsItemSuspendedRequestBuilder when successful +func (m *InstallationsWithInstallation_ItemRequestBuilder) Suspended()(*InstallationsItemSuspendedRequestBuilder) { + return NewInstallationsItemSuspendedRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation uninstalls a GitHub App on a user, organization, or business account. If you prefer to temporarily suspend an app's access to your account's resources, then we recommend the "[Suspend an app installation](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#suspend-an-app-installation)" endpoint.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *InstallationsWithInstallation_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") + return requestInfo, nil +} +// ToGetRequestInformation enables an authenticated GitHub App to find an installation's information using the installation id.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *InstallationsWithInstallation_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *InstallationsWithInstallation_ItemRequestBuilder when successful +func (m *InstallationsWithInstallation_ItemRequestBuilder) WithUrl(rawUrl string)(*InstallationsWithInstallation_ItemRequestBuilder) { + return NewInstallationsWithInstallation_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/applications/applications_request_builder.go b/pkg/github/applications/applications_request_builder.go new file mode 100644 index 00000000..5c212b75 --- /dev/null +++ b/pkg/github/applications/applications_request_builder.go @@ -0,0 +1,40 @@ +package applications + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ApplicationsRequestBuilder builds and executes requests for operations under \applications +type ApplicationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByClient_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.applications.item collection +// returns a *WithClient_ItemRequestBuilder when successful +func (m *ApplicationsRequestBuilder) ByClient_id(client_id string)(*WithClient_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if client_id != "" { + urlTplParams["client_id"] = client_id + } + return NewWithClient_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewApplicationsRequestBuilderInternal instantiates a new ApplicationsRequestBuilder and sets the default values. +func NewApplicationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApplicationsRequestBuilder) { + m := &ApplicationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/applications", pathParameters), + } + return m +} +// NewApplicationsRequestBuilder instantiates a new ApplicationsRequestBuilder and sets the default values. +func NewApplicationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApplicationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewApplicationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Grants the grants property +// returns a *GrantsRequestBuilder when successful +func (m *ApplicationsRequestBuilder) Grants()(*GrantsRequestBuilder) { + return NewGrantsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/applications/grants_request_builder.go b/pkg/github/applications/grants_request_builder.go new file mode 100644 index 00000000..b90904a5 --- /dev/null +++ b/pkg/github/applications/grants_request_builder.go @@ -0,0 +1,92 @@ +package applications + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// GrantsRequestBuilder builds and executes requests for operations under \applications\grants +type GrantsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// GrantsRequestBuilderGetQueryParameters > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The `scopes` returned are the union of scopes authorized for the application. For example, if an application has one token with `repo` scope and another token with `user` scope, the grant will return `["repo", "user"]`. +type GrantsRequestBuilderGetQueryParameters struct { + // The client ID of your GitHub app. + Client_id *string `uriparametername:"client_id"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByGrant_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.applications.grants.item collection +// Deprecated: +// returns a *GrantsWithGrant_ItemRequestBuilder when successful +func (m *GrantsRequestBuilder) ByGrant_id(grant_id int32)(*GrantsWithGrant_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["grant_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(grant_id), 10) + return NewGrantsWithGrant_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewGrantsRequestBuilderInternal instantiates a new GrantsRequestBuilder and sets the default values. +func NewGrantsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GrantsRequestBuilder) { + m := &GrantsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/applications/grants{?client_id*,page*,per_page*}", pathParameters), + } + return m +} +// NewGrantsRequestBuilder instantiates a new GrantsRequestBuilder and sets the default values. +func NewGrantsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GrantsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewGrantsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The `scopes` returned are the union of scopes authorized for the application. For example, if an application has one token with `repo` scope and another token with `user` scope, the grant will return `["repo", "user"]`. +// Deprecated: +// returns a []ApplicationGrantable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#list-your-grants +func (m *GrantsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[GrantsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ApplicationGrantable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateApplicationGrantFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ApplicationGrantable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ApplicationGrantable) + } + } + return val, nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).You can use this API to list the set of OAuth applications that have been granted access to your account. Unlike the [list your authorizations](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations) API, this API does not manage individual tokens. This API will return one entry for each OAuth application that has been granted access to your account, regardless of the number of tokens an application has generated for your user. The list of OAuth applications returned matches what is shown on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). The `scopes` returned are the union of scopes authorized for the application. For example, if an application has one token with `repo` scope and another token with `user` scope, the grant will return `["repo", "user"]`. +// Deprecated: +// returns a *RequestInformation when successful +func (m *GrantsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[GrantsRequestBuilderGetQueryParameters])(*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. +// Deprecated: +// returns a *GrantsRequestBuilder when successful +func (m *GrantsRequestBuilder) WithUrl(rawUrl string)(*GrantsRequestBuilder) { + return NewGrantsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/applications/grants_with_grant_escaped_item_request_builder.go b/pkg/github/applications/grants_with_grant_escaped_item_request_builder.go new file mode 100644 index 00000000..0d16e079 --- /dev/null +++ b/pkg/github/applications/grants_with_grant_escaped_item_request_builder.go @@ -0,0 +1,97 @@ +package applications + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// GrantsWithGrant_ItemRequestBuilder builds and executes requests for operations under \applications\grants\{grant_id} +type GrantsWithGrant_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewGrantsWithGrant_ItemRequestBuilderInternal instantiates a new GrantsWithGrant_ItemRequestBuilder and sets the default values. +func NewGrantsWithGrant_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GrantsWithGrant_ItemRequestBuilder) { + m := &GrantsWithGrant_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/applications/grants/{grant_id}", pathParameters), + } + return m +} +// NewGrantsWithGrant_ItemRequestBuilder instantiates a new GrantsWithGrant_ItemRequestBuilder and sets the default values. +func NewGrantsWithGrant_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GrantsWithGrant_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewGrantsWithGrant_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations/) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). +// Deprecated: +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#delete-a-grant +func (m *GrantsWithGrant_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 { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). +// Deprecated: +// returns a ApplicationGrantable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#get-a-single-grant +func (m *GrantsWithGrant_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ApplicationGrantable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateApplicationGrantFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ApplicationGrantable), nil +} +// ToDeleteRequestInformation > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations/) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).Deleting an OAuth application's grant will also delete all OAuth tokens associated with the application for your user. Once deleted, the application has no access to your account and is no longer listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). +// Deprecated: +// returns a *RequestInformation when successful +func (m *GrantsWithGrant_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") + return requestInfo, nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). +// Deprecated: +// returns a *RequestInformation when successful +func (m *GrantsWithGrant_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 +} +// 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 *GrantsWithGrant_ItemRequestBuilder when successful +func (m *GrantsWithGrant_ItemRequestBuilder) WithUrl(rawUrl string)(*GrantsWithGrant_ItemRequestBuilder) { + return NewGrantsWithGrant_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/applications/item_grant_delete_request_body.go b/pkg/github/applications/item_grant_delete_request_body.go new file mode 100644 index 00000000..e9942179 --- /dev/null +++ b/pkg/github/applications/item_grant_delete_request_body.go @@ -0,0 +1,80 @@ +package applications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemGrantDeleteRequestBody struct { + // The OAuth access token used to authenticate to the GitHub API. + access_token *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemGrantDeleteRequestBody instantiates a new ItemGrantDeleteRequestBody and sets the default values. +func NewItemGrantDeleteRequestBody()(*ItemGrantDeleteRequestBody) { + m := &ItemGrantDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemGrantDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemGrantDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemGrantDeleteRequestBody(), nil +} +// GetAccessToken gets the access_token property value. The OAuth access token used to authenticate to the GitHub API. +// returns a *string when successful +func (m *ItemGrantDeleteRequestBody) GetAccessToken()(*string) { + return m.access_token +} +// 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 *ItemGrantDeleteRequestBody) 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 *ItemGrantDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccessToken(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemGrantDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("access_token", m.GetAccessToken()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessToken sets the access_token property value. The OAuth access token used to authenticate to the GitHub API. +func (m *ItemGrantDeleteRequestBody) SetAccessToken(value *string)() { + m.access_token = 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 *ItemGrantDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemGrantDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessToken()(*string) + SetAccessToken(value *string)() +} diff --git a/pkg/github/applications/item_grant_request_builder.go b/pkg/github/applications/item_grant_request_builder.go new file mode 100644 index 00000000..2c8f8b8b --- /dev/null +++ b/pkg/github/applications/item_grant_request_builder.go @@ -0,0 +1,61 @@ +package applications + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemGrantRequestBuilder builds and executes requests for operations under \applications\{client_id}\grant +type ItemGrantRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemGrantRequestBuilderInternal instantiates a new ItemGrantRequestBuilder and sets the default values. +func NewItemGrantRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemGrantRequestBuilder) { + m := &ItemGrantRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/applications/{client_id}/grant", pathParameters), + } + return m +} +// NewItemGrantRequestBuilder instantiates a new ItemGrantRequestBuilder and sets the default values. +func NewItemGrantRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemGrantRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemGrantRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete oAuth and GitHub application owners can revoke a grant for their application and a specific user. You must provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted.Deleting an application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/oauth-applications#delete-an-app-authorization +func (m *ItemGrantRequestBuilder) Delete(ctx context.Context, body ItemGrantDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation oAuth and GitHub application owners can revoke a grant for their application and a specific user. You must provide a valid OAuth `access_token` as an input parameter and the grant for the token's owner will be deleted.Deleting an application's grant will also delete all OAuth tokens associated with the application for the user. Once deleted, the application will have no access to the user's account and will no longer be listed on [the application authorizations settings screen within GitHub](https://github.com/settings/applications#authorized). +// returns a *RequestInformation when successful +func (m *ItemGrantRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ItemGrantDeleteRequestBodyable, 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") + 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 *ItemGrantRequestBuilder when successful +func (m *ItemGrantRequestBuilder) WithUrl(rawUrl string)(*ItemGrantRequestBuilder) { + return NewItemGrantRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/applications/item_token_delete_request_body.go b/pkg/github/applications/item_token_delete_request_body.go new file mode 100644 index 00000000..3e3ee81c --- /dev/null +++ b/pkg/github/applications/item_token_delete_request_body.go @@ -0,0 +1,80 @@ +package applications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTokenDeleteRequestBody struct { + // The OAuth access token used to authenticate to the GitHub API. + access_token *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemTokenDeleteRequestBody instantiates a new ItemTokenDeleteRequestBody and sets the default values. +func NewItemTokenDeleteRequestBody()(*ItemTokenDeleteRequestBody) { + m := &ItemTokenDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTokenDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTokenDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTokenDeleteRequestBody(), nil +} +// GetAccessToken gets the access_token property value. The OAuth access token used to authenticate to the GitHub API. +// returns a *string when successful +func (m *ItemTokenDeleteRequestBody) GetAccessToken()(*string) { + return m.access_token +} +// 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 *ItemTokenDeleteRequestBody) 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 *ItemTokenDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccessToken(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemTokenDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("access_token", m.GetAccessToken()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessToken sets the access_token property value. The OAuth access token used to authenticate to the GitHub API. +func (m *ItemTokenDeleteRequestBody) SetAccessToken(value *string)() { + m.access_token = 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 *ItemTokenDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemTokenDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessToken()(*string) + SetAccessToken(value *string)() +} diff --git a/pkg/github/applications/item_token_patch_request_body.go b/pkg/github/applications/item_token_patch_request_body.go new file mode 100644 index 00000000..4119cfae --- /dev/null +++ b/pkg/github/applications/item_token_patch_request_body.go @@ -0,0 +1,80 @@ +package applications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTokenPatchRequestBody struct { + // The access_token of the OAuth or GitHub application. + access_token *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemTokenPatchRequestBody instantiates a new ItemTokenPatchRequestBody and sets the default values. +func NewItemTokenPatchRequestBody()(*ItemTokenPatchRequestBody) { + m := &ItemTokenPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTokenPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTokenPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTokenPatchRequestBody(), nil +} +// GetAccessToken gets the access_token property value. The access_token of the OAuth or GitHub application. +// returns a *string when successful +func (m *ItemTokenPatchRequestBody) GetAccessToken()(*string) { + return m.access_token +} +// 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 *ItemTokenPatchRequestBody) 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 *ItemTokenPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccessToken(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemTokenPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("access_token", m.GetAccessToken()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessToken sets the access_token property value. The access_token of the OAuth or GitHub application. +func (m *ItemTokenPatchRequestBody) SetAccessToken(value *string)() { + m.access_token = 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 *ItemTokenPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemTokenPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessToken()(*string) + SetAccessToken(value *string)() +} diff --git a/pkg/github/applications/item_token_post_request_body.go b/pkg/github/applications/item_token_post_request_body.go new file mode 100644 index 00000000..fc2a4c5f --- /dev/null +++ b/pkg/github/applications/item_token_post_request_body.go @@ -0,0 +1,80 @@ +package applications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTokenPostRequestBody struct { + // The access_token of the OAuth or GitHub application. + access_token *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemTokenPostRequestBody instantiates a new ItemTokenPostRequestBody and sets the default values. +func NewItemTokenPostRequestBody()(*ItemTokenPostRequestBody) { + m := &ItemTokenPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTokenPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTokenPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTokenPostRequestBody(), nil +} +// GetAccessToken gets the access_token property value. The access_token of the OAuth or GitHub application. +// returns a *string when successful +func (m *ItemTokenPostRequestBody) GetAccessToken()(*string) { + return m.access_token +} +// 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 *ItemTokenPostRequestBody) 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 *ItemTokenPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccessToken(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemTokenPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("access_token", m.GetAccessToken()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessToken sets the access_token property value. The access_token of the OAuth or GitHub application. +func (m *ItemTokenPostRequestBody) SetAccessToken(value *string)() { + m.access_token = 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 *ItemTokenPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemTokenPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessToken()(*string) + SetAccessToken(value *string)() +} diff --git a/pkg/github/applications/item_token_request_builder.go b/pkg/github/applications/item_token_request_builder.go new file mode 100644 index 00000000..f64ec760 --- /dev/null +++ b/pkg/github/applications/item_token_request_builder.go @@ -0,0 +1,138 @@ +package applications + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemTokenRequestBuilder builds and executes requests for operations under \applications\{client_id}\token +type ItemTokenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTokenRequestBuilderInternal instantiates a new ItemTokenRequestBuilder and sets the default values. +func NewItemTokenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTokenRequestBuilder) { + m := &ItemTokenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/applications/{client_id}/token", pathParameters), + } + return m +} +// NewItemTokenRequestBuilder instantiates a new ItemTokenRequestBuilder and sets the default values. +func NewItemTokenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTokenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTokenRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete oAuth or GitHub application owners can revoke a single token for an OAuth application or a GitHub application with an OAuth authorization. +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/oauth-applications#delete-an-app-token +func (m *ItemTokenRequestBuilder) Delete(ctx context.Context, body ItemTokenDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Patch oAuth applications and GitHub applications with OAuth authorizations can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. Invalid tokens will return `404 NOT FOUND`. +// returns a Authorizationable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/oauth-applications#reset-a-token +func (m *ItemTokenRequestBuilder) Patch(ctx context.Context, body ItemTokenPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthorizationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable), nil +} +// Post oAuth applications and GitHub applications with OAuth authorizations can use this API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. Invalid tokens will return `404 NOT FOUND`. +// returns a Authorizationable 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/enterprise-server@3.14/rest/apps/oauth-applications#check-a-token +func (m *ItemTokenRequestBuilder) Post(ctx context.Context, body ItemTokenPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthorizationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable), nil +} +// Scoped the scoped property +// returns a *ItemTokenScopedRequestBuilder when successful +func (m *ItemTokenRequestBuilder) Scoped()(*ItemTokenScopedRequestBuilder) { + return NewItemTokenScopedRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation oAuth or GitHub application owners can revoke a single token for an OAuth application or a GitHub application with an OAuth authorization. +// returns a *RequestInformation when successful +func (m *ItemTokenRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ItemTokenDeleteRequestBodyable, 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") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPatchRequestInformation oAuth applications and GitHub applications with OAuth authorizations can use this API method to reset a valid OAuth token without end-user involvement. Applications must save the "token" property in the response because changes take effect immediately. Invalid tokens will return `404 NOT FOUND`. +// returns a *RequestInformation when successful +func (m *ItemTokenRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemTokenPatchRequestBodyable, 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 +} +// ToPostRequestInformation oAuth applications and GitHub applications with OAuth authorizations can use this API method for checking OAuth token validity without exceeding the normal rate limits for failed login attempts. Authentication works differently with this particular endpoint. Invalid tokens will return `404 NOT FOUND`. +// returns a *RequestInformation when successful +func (m *ItemTokenRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTokenPostRequestBodyable, 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 *ItemTokenRequestBuilder when successful +func (m *ItemTokenRequestBuilder) WithUrl(rawUrl string)(*ItemTokenRequestBuilder) { + return NewItemTokenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/applications/item_token_scoped_post_request_body.go b/pkg/github/applications/item_token_scoped_post_request_body.go new file mode 100644 index 00000000..6378bcc0 --- /dev/null +++ b/pkg/github/applications/item_token_scoped_post_request_body.go @@ -0,0 +1,238 @@ +package applications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemTokenScopedPostRequestBody struct { + // The access token used to authenticate to the GitHub API. + access_token *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The permissions granted to the user access token. + permissions ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AppPermissionsable + // The list of repository names to scope the user access token to. `repositories` may not be specified if `repository_ids` is specified. + repositories []string + // The list of repository IDs to scope the user access token to. `repository_ids` may not be specified if `repositories` is specified. + repository_ids []int32 + // The name of the user or organization to scope the user access token to. **Required** unless `target_id` is specified. + target *string + // The ID of the user or organization to scope the user access token to. **Required** unless `target` is specified. + target_id *int32 +} +// NewItemTokenScopedPostRequestBody instantiates a new ItemTokenScopedPostRequestBody and sets the default values. +func NewItemTokenScopedPostRequestBody()(*ItemTokenScopedPostRequestBody) { + m := &ItemTokenScopedPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTokenScopedPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTokenScopedPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTokenScopedPostRequestBody(), nil +} +// GetAccessToken gets the access_token property value. The access token used to authenticate to the GitHub API. +// returns a *string when successful +func (m *ItemTokenScopedPostRequestBody) GetAccessToken()(*string) { + return m.access_token +} +// 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 *ItemTokenScopedPostRequestBody) 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 *ItemTokenScopedPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccessToken(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAppPermissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AppPermissionsable)) + } + return nil + } + res["repositories"] = 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.SetRepositories(res) + } + return nil + } + res["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.SetRepositoryIds(res) + } + return nil + } + res["target"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTarget(val) + } + return nil + } + res["target_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTargetId(val) + } + return nil + } + return res +} +// GetPermissions gets the permissions property value. The permissions granted to the user access token. +// returns a AppPermissionsable when successful +func (m *ItemTokenScopedPostRequestBody) GetPermissions()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AppPermissionsable) { + return m.permissions +} +// GetRepositories gets the repositories property value. The list of repository names to scope the user access token to. `repositories` may not be specified if `repository_ids` is specified. +// returns a []string when successful +func (m *ItemTokenScopedPostRequestBody) GetRepositories()([]string) { + return m.repositories +} +// GetRepositoryIds gets the repository_ids property value. The list of repository IDs to scope the user access token to. `repository_ids` may not be specified if `repositories` is specified. +// returns a []int32 when successful +func (m *ItemTokenScopedPostRequestBody) GetRepositoryIds()([]int32) { + return m.repository_ids +} +// GetTarget gets the target property value. The name of the user or organization to scope the user access token to. **Required** unless `target_id` is specified. +// returns a *string when successful +func (m *ItemTokenScopedPostRequestBody) GetTarget()(*string) { + return m.target +} +// GetTargetId gets the target_id property value. The ID of the user or organization to scope the user access token to. **Required** unless `target` is specified. +// returns a *int32 when successful +func (m *ItemTokenScopedPostRequestBody) GetTargetId()(*int32) { + return m.target_id +} +// Serialize serializes information the current object +func (m *ItemTokenScopedPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("access_token", m.GetAccessToken()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + err := writer.WriteCollectionOfStringValues("repositories", m.GetRepositories()) + if err != nil { + return err + } + } + if m.GetRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("repository_ids", m.GetRepositoryIds()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target", m.GetTarget()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("target_id", m.GetTargetId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessToken sets the access_token property value. The access token used to authenticate to the GitHub API. +func (m *ItemTokenScopedPostRequestBody) SetAccessToken(value *string)() { + m.access_token = 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 *ItemTokenScopedPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPermissions sets the permissions property value. The permissions granted to the user access token. +func (m *ItemTokenScopedPostRequestBody) SetPermissions(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AppPermissionsable)() { + m.permissions = value +} +// SetRepositories sets the repositories property value. The list of repository names to scope the user access token to. `repositories` may not be specified if `repository_ids` is specified. +func (m *ItemTokenScopedPostRequestBody) SetRepositories(value []string)() { + m.repositories = value +} +// SetRepositoryIds sets the repository_ids property value. The list of repository IDs to scope the user access token to. `repository_ids` may not be specified if `repositories` is specified. +func (m *ItemTokenScopedPostRequestBody) SetRepositoryIds(value []int32)() { + m.repository_ids = value +} +// SetTarget sets the target property value. The name of the user or organization to scope the user access token to. **Required** unless `target_id` is specified. +func (m *ItemTokenScopedPostRequestBody) SetTarget(value *string)() { + m.target = value +} +// SetTargetId sets the target_id property value. The ID of the user or organization to scope the user access token to. **Required** unless `target` is specified. +func (m *ItemTokenScopedPostRequestBody) SetTargetId(value *int32)() { + m.target_id = value +} +type ItemTokenScopedPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessToken()(*string) + GetPermissions()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AppPermissionsable) + GetRepositories()([]string) + GetRepositoryIds()([]int32) + GetTarget()(*string) + GetTargetId()(*int32) + SetAccessToken(value *string)() + SetPermissions(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AppPermissionsable)() + SetRepositories(value []string)() + SetRepositoryIds(value []int32)() + SetTarget(value *string)() + SetTargetId(value *int32)() +} diff --git a/pkg/github/applications/item_token_scoped_request_builder.go b/pkg/github/applications/item_token_scoped_request_builder.go new file mode 100644 index 00000000..f838bd81 --- /dev/null +++ b/pkg/github/applications/item_token_scoped_request_builder.go @@ -0,0 +1,71 @@ +package applications + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemTokenScopedRequestBuilder builds and executes requests for operations under \applications\{client_id}\token\scoped +type ItemTokenScopedRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTokenScopedRequestBuilderInternal instantiates a new ItemTokenScopedRequestBuilder and sets the default values. +func NewItemTokenScopedRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTokenScopedRequestBuilder) { + m := &ItemTokenScopedRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/applications/{client_id}/token/scoped", pathParameters), + } + return m +} +// NewItemTokenScopedRequestBuilder instantiates a new ItemTokenScopedRequestBuilder and sets the default values. +func NewItemTokenScopedRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTokenScopedRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTokenScopedRequestBuilderInternal(urlParams, requestAdapter) +} +// Post use a non-scoped user access token to create a repository-scoped and/or permission-scoped user access token. You can specifywhich repositories the token can access and which permissions are granted to thetoken.Invalid tokens will return `404 NOT FOUND`. +// returns a Authorizationable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/apps#create-a-scoped-access-token +func (m *ItemTokenScopedRequestBuilder) Post(ctx context.Context, body ItemTokenScopedPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthorizationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable), nil +} +// ToPostRequestInformation use a non-scoped user access token to create a repository-scoped and/or permission-scoped user access token. You can specifywhich repositories the token can access and which permissions are granted to thetoken.Invalid tokens will return `404 NOT FOUND`. +// returns a *RequestInformation when successful +func (m *ItemTokenScopedRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTokenScopedPostRequestBodyable, 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 *ItemTokenScopedRequestBuilder when successful +func (m *ItemTokenScopedRequestBuilder) WithUrl(rawUrl string)(*ItemTokenScopedRequestBuilder) { + return NewItemTokenScopedRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/applications/with_client_escaped_item_request_builder.go b/pkg/github/applications/with_client_escaped_item_request_builder.go new file mode 100644 index 00000000..8867db6c --- /dev/null +++ b/pkg/github/applications/with_client_escaped_item_request_builder.go @@ -0,0 +1,33 @@ +package applications + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// WithClient_ItemRequestBuilder builds and executes requests for operations under \applications\{client_id} +type WithClient_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithClient_ItemRequestBuilderInternal instantiates a new WithClient_ItemRequestBuilder and sets the default values. +func NewWithClient_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithClient_ItemRequestBuilder) { + m := &WithClient_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/applications/{client_id}", pathParameters), + } + return m +} +// NewWithClient_ItemRequestBuilder instantiates a new WithClient_ItemRequestBuilder and sets the default values. +func NewWithClient_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithClient_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithClient_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Grant the grant property +// returns a *ItemGrantRequestBuilder when successful +func (m *WithClient_ItemRequestBuilder) Grant()(*ItemGrantRequestBuilder) { + return NewItemGrantRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Token the token property +// returns a *ItemTokenRequestBuilder when successful +func (m *WithClient_ItemRequestBuilder) Token()(*ItemTokenRequestBuilder) { + return NewItemTokenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/appmanifests/app_manifests_request_builder.go b/pkg/github/appmanifests/app_manifests_request_builder.go new file mode 100644 index 00000000..9ccead17 --- /dev/null +++ b/pkg/github/appmanifests/app_manifests_request_builder.go @@ -0,0 +1,35 @@ +package appmanifests + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// AppManifestsRequestBuilder builds and executes requests for operations under \app-manifests +type AppManifestsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByCode gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.appManifests.item collection +// returns a *WithCodeItemRequestBuilder when successful +func (m *AppManifestsRequestBuilder) ByCode(code string)(*WithCodeItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if code != "" { + urlTplParams["code"] = code + } + return NewWithCodeItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewAppManifestsRequestBuilderInternal instantiates a new AppManifestsRequestBuilder and sets the default values. +func NewAppManifestsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AppManifestsRequestBuilder) { + m := &AppManifestsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app-manifests", pathParameters), + } + return m +} +// NewAppManifestsRequestBuilder instantiates a new AppManifestsRequestBuilder and sets the default values. +func NewAppManifestsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AppManifestsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAppManifestsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/appmanifests/item_conversions_integration.go b/pkg/github/appmanifests/item_conversions_integration.go new file mode 100644 index 00000000..3b8d350c --- /dev/null +++ b/pkg/github/appmanifests/item_conversions_integration.go @@ -0,0 +1,69 @@ +package appmanifests + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemConversionsIntegration struct { + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integration + // The client_id property + client_id *string +} +// NewItemConversionsIntegration instantiates a new ItemConversionsIntegration and sets the default values. +func NewItemConversionsIntegration()(*ItemConversionsIntegration) { + m := &ItemConversionsIntegration{ + Integration: *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.NewIntegration(), + } + return m +} +// CreateItemConversionsIntegrationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemConversionsIntegrationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemConversionsIntegration(), nil +} +// GetClientId gets the client_id property value. The client_id property +// returns a *string when successful +func (m *ItemConversionsIntegration) GetClientId()(*string) { + return m.client_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemConversionsIntegration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := m.Integration.GetFieldDeserializers() + res["client_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientId(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemConversionsIntegration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + err := m.Integration.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteStringValue("client_id", m.GetClientId()) + if err != nil { + return err + } + } + return nil +} +// SetClientId sets the client_id property value. The client_id property +func (m *ItemConversionsIntegration) SetClientId(value *string)() { + m.client_id = value +} +type ItemConversionsIntegrationable interface { + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientId()(*string) + SetClientId(value *string)() +} diff --git a/pkg/github/appmanifests/item_conversions_request_builder.go b/pkg/github/appmanifests/item_conversions_request_builder.go new file mode 100644 index 00000000..47800931 --- /dev/null +++ b/pkg/github/appmanifests/item_conversions_request_builder.go @@ -0,0 +1,63 @@ +package appmanifests + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemConversionsRequestBuilder builds and executes requests for operations under \app-manifests\{code}\conversions +type ItemConversionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemConversionsRequestBuilderInternal instantiates a new ItemConversionsRequestBuilder and sets the default values. +func NewItemConversionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemConversionsRequestBuilder) { + m := &ItemConversionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app-manifests/{code}/conversions", pathParameters), + } + return m +} +// NewItemConversionsRequestBuilder instantiates a new ItemConversionsRequestBuilder and sets the default values. +func NewItemConversionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemConversionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemConversionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`. +// returns a ItemConversionsIntegrationable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/apps#create-a-github-app-from-a-manifest +func (m *ItemConversionsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemConversionsIntegrationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemConversionsIntegrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemConversionsIntegrationable), nil +} +// ToPostRequestInformation use this endpoint to complete the handshake necessary when implementing the [GitHub App Manifest flow](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/creating-github-apps-from-a-manifest/). When you create a GitHub App with the manifest flow, you receive a temporary `code` used to retrieve the GitHub App's `id`, `pem` (private key), and `webhook_secret`. +// returns a *RequestInformation when successful +func (m *ItemConversionsRequestBuilder) 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 *ItemConversionsRequestBuilder when successful +func (m *ItemConversionsRequestBuilder) WithUrl(rawUrl string)(*ItemConversionsRequestBuilder) { + return NewItemConversionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/appmanifests/with_code_item_request_builder.go b/pkg/github/appmanifests/with_code_item_request_builder.go new file mode 100644 index 00000000..4748a6bf --- /dev/null +++ b/pkg/github/appmanifests/with_code_item_request_builder.go @@ -0,0 +1,28 @@ +package appmanifests + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// WithCodeItemRequestBuilder builds and executes requests for operations under \app-manifests\{code} +type WithCodeItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithCodeItemRequestBuilderInternal instantiates a new WithCodeItemRequestBuilder and sets the default values. +func NewWithCodeItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithCodeItemRequestBuilder) { + m := &WithCodeItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/app-manifests/{code}", pathParameters), + } + return m +} +// NewWithCodeItemRequestBuilder instantiates a new WithCodeItemRequestBuilder and sets the default values. +func NewWithCodeItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithCodeItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithCodeItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Conversions the conversions property +// returns a *ItemConversionsRequestBuilder when successful +func (m *WithCodeItemRequestBuilder) Conversions()(*ItemConversionsRequestBuilder) { + return NewItemConversionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/apps/apps_request_builder.go b/pkg/github/apps/apps_request_builder.go new file mode 100644 index 00000000..f42cc694 --- /dev/null +++ b/pkg/github/apps/apps_request_builder.go @@ -0,0 +1,35 @@ +package apps + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// AppsRequestBuilder builds and executes requests for operations under \apps +type AppsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByApp_slug gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.apps.item collection +// returns a *WithApp_slugItemRequestBuilder when successful +func (m *AppsRequestBuilder) ByApp_slug(app_slug string)(*WithApp_slugItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if app_slug != "" { + urlTplParams["app_slug"] = app_slug + } + return NewWithApp_slugItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewAppsRequestBuilderInternal instantiates a new AppsRequestBuilder and sets the default values. +func NewAppsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AppsRequestBuilder) { + m := &AppsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/apps", pathParameters), + } + return m +} +// NewAppsRequestBuilder instantiates a new AppsRequestBuilder and sets the default values. +func NewAppsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AppsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAppsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/apps/with_app_escaped_slug_item_request_builder.go b/pkg/github/apps/with_app_escaped_slug_item_request_builder.go new file mode 100644 index 00000000..5dceb322 --- /dev/null +++ b/pkg/github/apps/with_app_escaped_slug_item_request_builder.go @@ -0,0 +1,63 @@ +package apps + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// WithApp_slugItemRequestBuilder builds and executes requests for operations under \apps\{app_slug} +type WithApp_slugItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithApp_slugItemRequestBuilderInternal instantiates a new WithApp_slugItemRequestBuilder and sets the default values. +func NewWithApp_slugItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithApp_slugItemRequestBuilder) { + m := &WithApp_slugItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/apps/{app_slug}", pathParameters), + } + return m +} +// NewWithApp_slugItemRequestBuilder instantiates a new WithApp_slugItemRequestBuilder and sets the default values. +func NewWithApp_slugItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithApp_slugItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithApp_slugItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!NOTE]> The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`). +// returns a Integrationable 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/enterprise-server@3.14/rest/apps/apps#get-an-app +func (m *WithApp_slugItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIntegrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable), nil +} +// ToGetRequestInformation > [!NOTE]> The `:app_slug` is just the URL-friendly name of your GitHub App. You can find this on the settings page for your GitHub App (e.g., `https://github.com/settings/apps/:app_slug`). +// returns a *RequestInformation when successful +func (m *WithApp_slugItemRequestBuilder) 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 *WithApp_slugItemRequestBuilder when successful +func (m *WithApp_slugItemRequestBuilder) WithUrl(rawUrl string)(*WithApp_slugItemRequestBuilder) { + return NewWithApp_slugItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/authorizations/authorizations_post_request_body.go b/pkg/github/authorizations/authorizations_post_request_body.go new file mode 100644 index 00000000..b9999b2d --- /dev/null +++ b/pkg/github/authorizations/authorizations_post_request_body.go @@ -0,0 +1,231 @@ +package authorizations + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AuthorizationsPostRequestBody 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 OAuth app client key for which to create the token. + client_id *string + // The OAuth app client secret for which to create the token. + client_secret *string + // A unique string to distinguish an authorization from others created for the same client ID and user. + fingerprint *string + // A note to remind you what the OAuth token is for. + note *string + // A URL to remind you what app the OAuth token is for. + note_url *string + // A list of scopes that this authorization is in. + scopes []string +} +// NewAuthorizationsPostRequestBody instantiates a new AuthorizationsPostRequestBody and sets the default values. +func NewAuthorizationsPostRequestBody()(*AuthorizationsPostRequestBody) { + m := &AuthorizationsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuthorizationsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuthorizationsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuthorizationsPostRequestBody(), 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 *AuthorizationsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientId gets the client_id property value. The OAuth app client key for which to create the token. +// returns a *string when successful +func (m *AuthorizationsPostRequestBody) GetClientId()(*string) { + return m.client_id +} +// GetClientSecret gets the client_secret property value. The OAuth app client secret for which to create the token. +// returns a *string when successful +func (m *AuthorizationsPostRequestBody) GetClientSecret()(*string) { + return m.client_secret +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AuthorizationsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientId(val) + } + return nil + } + res["client_secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientSecret(val) + } + return nil + } + res["fingerprint"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFingerprint(val) + } + return nil + } + res["note"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNote(val) + } + return nil + } + res["note_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNoteUrl(val) + } + return nil + } + res["scopes"] = 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.SetScopes(res) + } + return nil + } + return res +} +// GetFingerprint gets the fingerprint property value. A unique string to distinguish an authorization from others created for the same client ID and user. +// returns a *string when successful +func (m *AuthorizationsPostRequestBody) GetFingerprint()(*string) { + return m.fingerprint +} +// GetNote gets the note property value. A note to remind you what the OAuth token is for. +// returns a *string when successful +func (m *AuthorizationsPostRequestBody) GetNote()(*string) { + return m.note +} +// GetNoteUrl gets the note_url property value. A URL to remind you what app the OAuth token is for. +// returns a *string when successful +func (m *AuthorizationsPostRequestBody) GetNoteUrl()(*string) { + return m.note_url +} +// GetScopes gets the scopes property value. A list of scopes that this authorization is in. +// returns a []string when successful +func (m *AuthorizationsPostRequestBody) GetScopes()([]string) { + return m.scopes +} +// Serialize serializes information the current object +func (m *AuthorizationsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_id", m.GetClientId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("client_secret", m.GetClientSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("fingerprint", m.GetFingerprint()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note", m.GetNote()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note_url", m.GetNoteUrl()) + if err != nil { + return err + } + } + if m.GetScopes() != nil { + err := writer.WriteCollectionOfStringValues("scopes", m.GetScopes()) + 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 *AuthorizationsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientId sets the client_id property value. The OAuth app client key for which to create the token. +func (m *AuthorizationsPostRequestBody) SetClientId(value *string)() { + m.client_id = value +} +// SetClientSecret sets the client_secret property value. The OAuth app client secret for which to create the token. +func (m *AuthorizationsPostRequestBody) SetClientSecret(value *string)() { + m.client_secret = value +} +// SetFingerprint sets the fingerprint property value. A unique string to distinguish an authorization from others created for the same client ID and user. +func (m *AuthorizationsPostRequestBody) SetFingerprint(value *string)() { + m.fingerprint = value +} +// SetNote sets the note property value. A note to remind you what the OAuth token is for. +func (m *AuthorizationsPostRequestBody) SetNote(value *string)() { + m.note = value +} +// SetNoteUrl sets the note_url property value. A URL to remind you what app the OAuth token is for. +func (m *AuthorizationsPostRequestBody) SetNoteUrl(value *string)() { + m.note_url = value +} +// SetScopes sets the scopes property value. A list of scopes that this authorization is in. +func (m *AuthorizationsPostRequestBody) SetScopes(value []string)() { + m.scopes = value +} +type AuthorizationsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientId()(*string) + GetClientSecret()(*string) + GetFingerprint()(*string) + GetNote()(*string) + GetNoteUrl()(*string) + GetScopes()([]string) + SetClientId(value *string)() + SetClientSecret(value *string)() + SetFingerprint(value *string)() + SetNote(value *string)() + SetNoteUrl(value *string)() + SetScopes(value []string)() +} diff --git a/pkg/github/authorizations/authorizations_request_builder.go b/pkg/github/authorizations/authorizations_request_builder.go new file mode 100644 index 00000000..416b310c --- /dev/null +++ b/pkg/github/authorizations/authorizations_request_builder.go @@ -0,0 +1,140 @@ +package authorizations + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// AuthorizationsRequestBuilder builds and executes requests for operations under \authorizations +type AuthorizationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// AuthorizationsRequestBuilderGetQueryParameters > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). +type AuthorizationsRequestBuilderGetQueryParameters struct { + // The client ID of your GitHub app. + Client_id *string `uriparametername:"client_id"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByAuthorization_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.authorizations.item collection +// Deprecated: +// returns a *WithAuthorization_ItemRequestBuilder when successful +func (m *AuthorizationsRequestBuilder) ByAuthorization_id(authorization_id int32)(*WithAuthorization_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["authorization_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(authorization_id), 10) + return NewWithAuthorization_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// Clients the clients property +// returns a *ClientsRequestBuilder when successful +func (m *AuthorizationsRequestBuilder) Clients()(*ClientsRequestBuilder) { + return NewClientsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewAuthorizationsRequestBuilderInternal instantiates a new AuthorizationsRequestBuilder and sets the default values. +func NewAuthorizationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AuthorizationsRequestBuilder) { + m := &AuthorizationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/authorizations{?client_id*,page*,per_page*}", pathParameters), + } + return m +} +// NewAuthorizationsRequestBuilder instantiates a new AuthorizationsRequestBuilder and sets the default values. +func NewAuthorizationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AuthorizationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAuthorizationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). +// Deprecated: +// returns a []Authorizationable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#list-your-authorizations +func (m *AuthorizationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[AuthorizationsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthorizationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable) + } + } + return val, nil +} +// Post > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).> [!WARNING]> Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).Creates OAuth tokens using [Basic Authentication](https://docs.github.com/enterprise-server@3.14/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.14/rest/overview/other-authentication-methods#working-with-two-factor-authentication)."To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use `fingerprint` to differentiate between them.You can also create tokens on GitHub Enterprise Server from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://docs.github.com/enterprise-server@3.14/articles/creating-an-access-token-for-command-line-use).Organizations that enforce SAML SSO require personal access tokens to be allowed. For more information, see "[About identity and access management with SAML single sign-on](https://docs.github.com/enterprise-server@3.14/enterprise-cloud@latest/organizations/managing-saml-single-sign-on-for-your-organization/about-identity-and-access-management-with-saml-single-sign-on)" in the GitHub Enterprise Cloud documentation. +// Deprecated: +// returns a Authorizationable 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 410 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#create-a-new-authorization +func (m *AuthorizationsRequestBuilder) Post(ctx context.Context, body AuthorizationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthorizationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable), nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). +// Deprecated: +// returns a *RequestInformation when successful +func (m *AuthorizationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[AuthorizationsRequestBuilderGetQueryParameters])(*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 > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).> [!WARNING]> Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).Creates OAuth tokens using [Basic Authentication](https://docs.github.com/enterprise-server@3.14/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication). If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.14/rest/overview/other-authentication-methods#working-with-two-factor-authentication)."To create tokens for a particular OAuth application using this endpoint, you must authenticate as the user you want to create an authorization for and provide the app's client ID and secret, found on your OAuth application's settings page. If your OAuth application intends to create multiple tokens for one user, use `fingerprint` to differentiate between them.You can also create tokens on GitHub Enterprise Server from the [personal access tokens settings](https://github.com/settings/tokens) page. Read more about these tokens in [the GitHub Help documentation](https://docs.github.com/enterprise-server@3.14/articles/creating-an-access-token-for-command-line-use).Organizations that enforce SAML SSO require personal access tokens to be allowed. For more information, see "[About identity and access management with SAML single sign-on](https://docs.github.com/enterprise-server@3.14/enterprise-cloud@latest/organizations/managing-saml-single-sign-on-for-your-organization/about-identity-and-access-management-with-saml-single-sign-on)" in the GitHub Enterprise Cloud documentation. +// Deprecated: +// returns a *RequestInformation when successful +func (m *AuthorizationsRequestBuilder) ToPostRequestInformation(ctx context.Context, body AuthorizationsPostRequestBodyable, 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. +// Deprecated: +// returns a *AuthorizationsRequestBuilder when successful +func (m *AuthorizationsRequestBuilder) WithUrl(rawUrl string)(*AuthorizationsRequestBuilder) { + return NewAuthorizationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/authorizations/clients_item_item_with_fingerprint_put_request_body.go b/pkg/github/authorizations/clients_item_item_with_fingerprint_put_request_body.go new file mode 100644 index 00000000..065596d3 --- /dev/null +++ b/pkg/github/authorizations/clients_item_item_with_fingerprint_put_request_body.go @@ -0,0 +1,173 @@ +package authorizations + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ClientsItemItemWithFingerprintPutRequestBody 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 OAuth app client secret for which to create the token. + client_secret *string + // A note to remind you what the OAuth token is for. + note *string + // A URL to remind you what app the OAuth token is for. + note_url *string + // A list of scopes that this authorization is in. + scopes []string +} +// NewClientsItemItemWithFingerprintPutRequestBody instantiates a new ClientsItemItemWithFingerprintPutRequestBody and sets the default values. +func NewClientsItemItemWithFingerprintPutRequestBody()(*ClientsItemItemWithFingerprintPutRequestBody) { + m := &ClientsItemItemWithFingerprintPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateClientsItemItemWithFingerprintPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateClientsItemItemWithFingerprintPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewClientsItemItemWithFingerprintPutRequestBody(), 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 *ClientsItemItemWithFingerprintPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientSecret gets the client_secret property value. The OAuth app client secret for which to create the token. +// returns a *string when successful +func (m *ClientsItemItemWithFingerprintPutRequestBody) GetClientSecret()(*string) { + return m.client_secret +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ClientsItemItemWithFingerprintPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientSecret(val) + } + return nil + } + res["note"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNote(val) + } + return nil + } + res["note_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNoteUrl(val) + } + return nil + } + res["scopes"] = 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.SetScopes(res) + } + return nil + } + return res +} +// GetNote gets the note property value. A note to remind you what the OAuth token is for. +// returns a *string when successful +func (m *ClientsItemItemWithFingerprintPutRequestBody) GetNote()(*string) { + return m.note +} +// GetNoteUrl gets the note_url property value. A URL to remind you what app the OAuth token is for. +// returns a *string when successful +func (m *ClientsItemItemWithFingerprintPutRequestBody) GetNoteUrl()(*string) { + return m.note_url +} +// GetScopes gets the scopes property value. A list of scopes that this authorization is in. +// returns a []string when successful +func (m *ClientsItemItemWithFingerprintPutRequestBody) GetScopes()([]string) { + return m.scopes +} +// Serialize serializes information the current object +func (m *ClientsItemItemWithFingerprintPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_secret", m.GetClientSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note", m.GetNote()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note_url", m.GetNoteUrl()) + if err != nil { + return err + } + } + if m.GetScopes() != nil { + err := writer.WriteCollectionOfStringValues("scopes", m.GetScopes()) + 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 *ClientsItemItemWithFingerprintPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientSecret sets the client_secret property value. The OAuth app client secret for which to create the token. +func (m *ClientsItemItemWithFingerprintPutRequestBody) SetClientSecret(value *string)() { + m.client_secret = value +} +// SetNote sets the note property value. A note to remind you what the OAuth token is for. +func (m *ClientsItemItemWithFingerprintPutRequestBody) SetNote(value *string)() { + m.note = value +} +// SetNoteUrl sets the note_url property value. A URL to remind you what app the OAuth token is for. +func (m *ClientsItemItemWithFingerprintPutRequestBody) SetNoteUrl(value *string)() { + m.note_url = value +} +// SetScopes sets the scopes property value. A list of scopes that this authorization is in. +func (m *ClientsItemItemWithFingerprintPutRequestBody) SetScopes(value []string)() { + m.scopes = value +} +type ClientsItemItemWithFingerprintPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientSecret()(*string) + GetNote()(*string) + GetNoteUrl()(*string) + GetScopes()([]string) + SetClientSecret(value *string)() + SetNote(value *string)() + SetNoteUrl(value *string)() + SetScopes(value []string)() +} diff --git a/pkg/github/authorizations/clients_item_with_client_escaped_put_request_body.go b/pkg/github/authorizations/clients_item_with_client_escaped_put_request_body.go new file mode 100644 index 00000000..9a5020f9 --- /dev/null +++ b/pkg/github/authorizations/clients_item_with_client_escaped_put_request_body.go @@ -0,0 +1,202 @@ +package authorizations + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ClientsItemWithClient_PutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The OAuth app client secret for which to create the token. + client_secret *string + // A unique string to distinguish an authorization from others created for the same client ID and user. + fingerprint *string + // A note to remind you what the OAuth token is for. + note *string + // A URL to remind you what app the OAuth token is for. + note_url *string + // A list of scopes that this authorization is in. + scopes []string +} +// NewClientsItemWithClient_PutRequestBody instantiates a new ClientsItemWithClient_PutRequestBody and sets the default values. +func NewClientsItemWithClient_PutRequestBody()(*ClientsItemWithClient_PutRequestBody) { + m := &ClientsItemWithClient_PutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateClientsItemWithClient_PutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateClientsItemWithClient_PutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewClientsItemWithClient_PutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ClientsItemWithClient_PutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientSecret gets the client_secret property value. The OAuth app client secret for which to create the token. +// returns a *string when successful +func (m *ClientsItemWithClient_PutRequestBody) GetClientSecret()(*string) { + return m.client_secret +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ClientsItemWithClient_PutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientSecret(val) + } + return nil + } + res["fingerprint"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFingerprint(val) + } + return nil + } + res["note"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNote(val) + } + return nil + } + res["note_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNoteUrl(val) + } + return nil + } + res["scopes"] = 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.SetScopes(res) + } + return nil + } + return res +} +// GetFingerprint gets the fingerprint property value. A unique string to distinguish an authorization from others created for the same client ID and user. +// returns a *string when successful +func (m *ClientsItemWithClient_PutRequestBody) GetFingerprint()(*string) { + return m.fingerprint +} +// GetNote gets the note property value. A note to remind you what the OAuth token is for. +// returns a *string when successful +func (m *ClientsItemWithClient_PutRequestBody) GetNote()(*string) { + return m.note +} +// GetNoteUrl gets the note_url property value. A URL to remind you what app the OAuth token is for. +// returns a *string when successful +func (m *ClientsItemWithClient_PutRequestBody) GetNoteUrl()(*string) { + return m.note_url +} +// GetScopes gets the scopes property value. A list of scopes that this authorization is in. +// returns a []string when successful +func (m *ClientsItemWithClient_PutRequestBody) GetScopes()([]string) { + return m.scopes +} +// Serialize serializes information the current object +func (m *ClientsItemWithClient_PutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_secret", m.GetClientSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("fingerprint", m.GetFingerprint()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note", m.GetNote()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note_url", m.GetNoteUrl()) + if err != nil { + return err + } + } + if m.GetScopes() != nil { + err := writer.WriteCollectionOfStringValues("scopes", m.GetScopes()) + 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 *ClientsItemWithClient_PutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientSecret sets the client_secret property value. The OAuth app client secret for which to create the token. +func (m *ClientsItemWithClient_PutRequestBody) SetClientSecret(value *string)() { + m.client_secret = value +} +// SetFingerprint sets the fingerprint property value. A unique string to distinguish an authorization from others created for the same client ID and user. +func (m *ClientsItemWithClient_PutRequestBody) SetFingerprint(value *string)() { + m.fingerprint = value +} +// SetNote sets the note property value. A note to remind you what the OAuth token is for. +func (m *ClientsItemWithClient_PutRequestBody) SetNote(value *string)() { + m.note = value +} +// SetNoteUrl sets the note_url property value. A URL to remind you what app the OAuth token is for. +func (m *ClientsItemWithClient_PutRequestBody) SetNoteUrl(value *string)() { + m.note_url = value +} +// SetScopes sets the scopes property value. A list of scopes that this authorization is in. +func (m *ClientsItemWithClient_PutRequestBody) SetScopes(value []string)() { + m.scopes = value +} +type ClientsItemWithClient_PutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientSecret()(*string) + GetFingerprint()(*string) + GetNote()(*string) + GetNoteUrl()(*string) + GetScopes()([]string) + SetClientSecret(value *string)() + SetFingerprint(value *string)() + SetNote(value *string)() + SetNoteUrl(value *string)() + SetScopes(value []string)() +} diff --git a/pkg/github/authorizations/clients_item_with_fingerprint_item_request_builder.go b/pkg/github/authorizations/clients_item_with_fingerprint_item_request_builder.go new file mode 100644 index 00000000..ec6724db --- /dev/null +++ b/pkg/github/authorizations/clients_item_with_fingerprint_item_request_builder.go @@ -0,0 +1,68 @@ +package authorizations + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ClientsItemWithFingerprintItemRequestBuilder builds and executes requests for operations under \authorizations\clients\{client_id}\{fingerprint} +type ClientsItemWithFingerprintItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewClientsItemWithFingerprintItemRequestBuilderInternal instantiates a new ClientsItemWithFingerprintItemRequestBuilder and sets the default values. +func NewClientsItemWithFingerprintItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ClientsItemWithFingerprintItemRequestBuilder) { + m := &ClientsItemWithFingerprintItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/authorizations/clients/{client_id}/{fingerprint}", pathParameters), + } + return m +} +// NewClientsItemWithFingerprintItemRequestBuilder instantiates a new ClientsItemWithFingerprintItemRequestBuilder and sets the default values. +func NewClientsItemWithFingerprintItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ClientsItemWithFingerprintItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewClientsItemWithFingerprintItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Put > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).> [!WARNING]> Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. `fingerprint` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one.If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.14/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." +// Deprecated: +// returns a Authorizationable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app-and-fingerprint +func (m *ClientsItemWithFingerprintItemRequestBuilder) Put(ctx context.Context, body ClientsItemItemWithFingerprintPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthorizationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable), nil +} +// ToPutRequestInformation > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).> [!WARNING]> Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).This method will create a new authorization for the specified OAuth application, only if an authorization for that application and fingerprint do not already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. `fingerprint` is a unique string to distinguish an authorization from others created for the same client ID and user. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one.If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.14/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." +// Deprecated: +// returns a *RequestInformation when successful +func (m *ClientsItemWithFingerprintItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ClientsItemItemWithFingerprintPutRequestBodyable, 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. +// Deprecated: +// returns a *ClientsItemWithFingerprintItemRequestBuilder when successful +func (m *ClientsItemWithFingerprintItemRequestBuilder) WithUrl(rawUrl string)(*ClientsItemWithFingerprintItemRequestBuilder) { + return NewClientsItemWithFingerprintItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/authorizations/clients_request_builder.go b/pkg/github/authorizations/clients_request_builder.go new file mode 100644 index 00000000..dbb77209 --- /dev/null +++ b/pkg/github/authorizations/clients_request_builder.go @@ -0,0 +1,36 @@ +package authorizations + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ClientsRequestBuilder builds and executes requests for operations under \authorizations\clients +type ClientsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByClient_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.authorizations.clients.item collection +// Deprecated: +// returns a *ClientsWithClient_ItemRequestBuilder when successful +func (m *ClientsRequestBuilder) ByClient_id(client_id string)(*ClientsWithClient_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if client_id != "" { + urlTplParams["client_id"] = client_id + } + return NewClientsWithClient_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewClientsRequestBuilderInternal instantiates a new ClientsRequestBuilder and sets the default values. +func NewClientsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ClientsRequestBuilder) { + m := &ClientsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/authorizations/clients", pathParameters), + } + return m +} +// NewClientsRequestBuilder instantiates a new ClientsRequestBuilder and sets the default values. +func NewClientsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ClientsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewClientsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/authorizations/clients_with_client_escaped_item_request_builder.go b/pkg/github/authorizations/clients_with_client_escaped_item_request_builder.go new file mode 100644 index 00000000..57d41151 --- /dev/null +++ b/pkg/github/authorizations/clients_with_client_escaped_item_request_builder.go @@ -0,0 +1,85 @@ +package authorizations + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ClientsWithClient_ItemRequestBuilder builds and executes requests for operations under \authorizations\clients\{client_id} +type ClientsWithClient_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByFingerprint gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.authorizations.clients.item.item collection +// Deprecated: +// returns a *ClientsItemWithFingerprintItemRequestBuilder when successful +func (m *ClientsWithClient_ItemRequestBuilder) ByFingerprint(fingerprint string)(*ClientsItemWithFingerprintItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if fingerprint != "" { + urlTplParams["fingerprint"] = fingerprint + } + return NewClientsItemWithFingerprintItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewClientsWithClient_ItemRequestBuilderInternal instantiates a new ClientsWithClient_ItemRequestBuilder and sets the default values. +func NewClientsWithClient_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ClientsWithClient_ItemRequestBuilder) { + m := &ClientsWithClient_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/authorizations/clients/{client_id}", pathParameters), + } + return m +} +// NewClientsWithClient_ItemRequestBuilder instantiates a new ClientsWithClient_ItemRequestBuilder and sets the default values. +func NewClientsWithClient_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ClientsWithClient_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewClientsWithClient_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Put > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).> [!WARNING]> Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one.If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.14/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." +// Deprecated: +// returns a Authorizationable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#get-or-create-an-authorization-for-a-specific-app +func (m *ClientsWithClient_ItemRequestBuilder) Put(ctx context.Context, body ClientsItemWithClient_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthorizationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable), nil +} +// ToPutRequestInformation > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).> [!WARNING]> Apps must use the [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow) to obtain OAuth tokens that work with GitHub Enterprise Server SAML organizations. OAuth tokens created using the Authorizations API will be unable to access GitHub Enterprise Server SAML organizations. For more information, see the [blog post](https://developer.github.com/changes/2019-11-05-deprecated-passwords-and-authorizations-api).Creates a new authorization for the specified OAuth application, only if an authorization for that application doesn't already exist for the user. The URL includes the 20 character client ID for the OAuth app that is requesting the token. It returns the user's existing authorization for the application if one is present. Otherwise, it creates and returns a new one.If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.14/rest/overview/other-authentication-methods#working-with-two-factor-authentication)." +// Deprecated: +// returns a *RequestInformation when successful +func (m *ClientsWithClient_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ClientsItemWithClient_PutRequestBodyable, 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. +// Deprecated: +// returns a *ClientsWithClient_ItemRequestBuilder when successful +func (m *ClientsWithClient_ItemRequestBuilder) WithUrl(rawUrl string)(*ClientsWithClient_ItemRequestBuilder) { + return NewClientsWithClient_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/authorizations/item_with_authorization_escaped_patch_request_body.go b/pkg/github/authorizations/item_with_authorization_escaped_patch_request_body.go new file mode 100644 index 00000000..17fb758c --- /dev/null +++ b/pkg/github/authorizations/item_with_authorization_escaped_patch_request_body.go @@ -0,0 +1,243 @@ +package authorizations + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemWithAuthorization_PatchRequestBody struct { + // A list of scopes to add to this authorization. + add_scopes []string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A unique string to distinguish an authorization from others created for the same client ID and user. + fingerprint *string + // A note to remind you what the OAuth token is for. + note *string + // A URL to remind you what app the OAuth token is for. + note_url *string + // A list of scopes to remove from this authorization. + remove_scopes []string + // A list of scopes that this authorization is in. + scopes []string +} +// NewItemWithAuthorization_PatchRequestBody instantiates a new ItemWithAuthorization_PatchRequestBody and sets the default values. +func NewItemWithAuthorization_PatchRequestBody()(*ItemWithAuthorization_PatchRequestBody) { + m := &ItemWithAuthorization_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithAuthorization_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithAuthorization_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithAuthorization_PatchRequestBody(), 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 *ItemWithAuthorization_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAddScopes gets the add_scopes property value. A list of scopes to add to this authorization. +// returns a []string when successful +func (m *ItemWithAuthorization_PatchRequestBody) GetAddScopes()([]string) { + return m.add_scopes +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemWithAuthorization_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["add_scopes"] = 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.SetAddScopes(res) + } + return nil + } + res["fingerprint"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFingerprint(val) + } + return nil + } + res["note"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNote(val) + } + return nil + } + res["note_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNoteUrl(val) + } + return nil + } + res["remove_scopes"] = 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.SetRemoveScopes(res) + } + return nil + } + res["scopes"] = 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.SetScopes(res) + } + return nil + } + return res +} +// GetFingerprint gets the fingerprint property value. A unique string to distinguish an authorization from others created for the same client ID and user. +// returns a *string when successful +func (m *ItemWithAuthorization_PatchRequestBody) GetFingerprint()(*string) { + return m.fingerprint +} +// GetNote gets the note property value. A note to remind you what the OAuth token is for. +// returns a *string when successful +func (m *ItemWithAuthorization_PatchRequestBody) GetNote()(*string) { + return m.note +} +// GetNoteUrl gets the note_url property value. A URL to remind you what app the OAuth token is for. +// returns a *string when successful +func (m *ItemWithAuthorization_PatchRequestBody) GetNoteUrl()(*string) { + return m.note_url +} +// GetRemoveScopes gets the remove_scopes property value. A list of scopes to remove from this authorization. +// returns a []string when successful +func (m *ItemWithAuthorization_PatchRequestBody) GetRemoveScopes()([]string) { + return m.remove_scopes +} +// GetScopes gets the scopes property value. A list of scopes that this authorization is in. +// returns a []string when successful +func (m *ItemWithAuthorization_PatchRequestBody) GetScopes()([]string) { + return m.scopes +} +// Serialize serializes information the current object +func (m *ItemWithAuthorization_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAddScopes() != nil { + err := writer.WriteCollectionOfStringValues("add_scopes", m.GetAddScopes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("fingerprint", m.GetFingerprint()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note", m.GetNote()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note_url", m.GetNoteUrl()) + if err != nil { + return err + } + } + if m.GetRemoveScopes() != nil { + err := writer.WriteCollectionOfStringValues("remove_scopes", m.GetRemoveScopes()) + if err != nil { + return err + } + } + if m.GetScopes() != nil { + err := writer.WriteCollectionOfStringValues("scopes", m.GetScopes()) + 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 *ItemWithAuthorization_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAddScopes sets the add_scopes property value. A list of scopes to add to this authorization. +func (m *ItemWithAuthorization_PatchRequestBody) SetAddScopes(value []string)() { + m.add_scopes = value +} +// SetFingerprint sets the fingerprint property value. A unique string to distinguish an authorization from others created for the same client ID and user. +func (m *ItemWithAuthorization_PatchRequestBody) SetFingerprint(value *string)() { + m.fingerprint = value +} +// SetNote sets the note property value. A note to remind you what the OAuth token is for. +func (m *ItemWithAuthorization_PatchRequestBody) SetNote(value *string)() { + m.note = value +} +// SetNoteUrl sets the note_url property value. A URL to remind you what app the OAuth token is for. +func (m *ItemWithAuthorization_PatchRequestBody) SetNoteUrl(value *string)() { + m.note_url = value +} +// SetRemoveScopes sets the remove_scopes property value. A list of scopes to remove from this authorization. +func (m *ItemWithAuthorization_PatchRequestBody) SetRemoveScopes(value []string)() { + m.remove_scopes = value +} +// SetScopes sets the scopes property value. A list of scopes that this authorization is in. +func (m *ItemWithAuthorization_PatchRequestBody) SetScopes(value []string)() { + m.scopes = value +} +type ItemWithAuthorization_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAddScopes()([]string) + GetFingerprint()(*string) + GetNote()(*string) + GetNoteUrl()(*string) + GetRemoveScopes()([]string) + GetScopes()([]string) + SetAddScopes(value []string)() + SetFingerprint(value *string)() + SetNote(value *string)() + SetNoteUrl(value *string)() + SetRemoveScopes(value []string)() + SetScopes(value []string)() +} diff --git a/pkg/github/authorizations/with_authorization_escaped_item_request_builder.go b/pkg/github/authorizations/with_authorization_escaped_item_request_builder.go new file mode 100644 index 00000000..15144dfd --- /dev/null +++ b/pkg/github/authorizations/with_authorization_escaped_item_request_builder.go @@ -0,0 +1,134 @@ +package authorizations + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// WithAuthorization_ItemRequestBuilder builds and executes requests for operations under \authorizations\{authorization_id} +type WithAuthorization_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithAuthorization_ItemRequestBuilderInternal instantiates a new WithAuthorization_ItemRequestBuilder and sets the default values. +func NewWithAuthorization_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithAuthorization_ItemRequestBuilder) { + m := &WithAuthorization_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/authorizations/{authorization_id}", pathParameters), + } + return m +} +// NewWithAuthorization_ItemRequestBuilder instantiates a new WithAuthorization_ItemRequestBuilder and sets the default values. +func NewWithAuthorization_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithAuthorization_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithAuthorization_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). +// Deprecated: +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#delete-an-authorization +func (m *WithAuthorization_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 { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). +// Deprecated: +// returns a Authorizationable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#get-a-single-authorization +func (m *WithAuthorization_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthorizationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable), nil +} +// Patch > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.14/rest/overview/other-authentication-methods#working-with-two-factor-authentication)."You can only send one of these scope keys at a time. +// Deprecated: +// returns a Authorizationable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations#update-an-existing-authorization +func (m *WithAuthorization_ItemRequestBuilder) Patch(ctx context.Context, body ItemWithAuthorization_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthorizationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Authorizationable), nil +} +// ToDeleteRequestInformation > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). +// Deprecated: +// returns a *RequestInformation when successful +func (m *WithAuthorization_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") + return requestInfo, nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/apps/building-oauth-apps/authorizing-oauth-apps/#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/). +// Deprecated: +// returns a *RequestInformation when successful +func (m *WithAuthorization_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 > [!WARNING]> **Deprecation notice:** GitHub Enterprise Server will discontinue the [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations/), which is used by integrations to create personal access tokens and OAuth tokens, and you must now create these tokens using our [web application flow](https://docs.github.com/enterprise-server@3.14/developers/apps/authorizing-oauth-apps#web-application-flow). The [OAuth Authorizations API](https://docs.github.com/enterprise-server@3.14/rest/oauth-authorizations/oauth-authorizations) will be removed on November 13, 2020. For more information, including scheduled brownouts, see the [blog post](https://developer.github.com/changes/2020-02-14-deprecating-oauth-auth-endpoint/).If you have two-factor authentication setup, Basic Authentication for this endpoint requires that you use a one-time password (OTP) and your username and password instead of tokens. For more information, see "[Working with two-factor authentication](https://docs.github.com/enterprise-server@3.14/rest/overview/other-authentication-methods#working-with-two-factor-authentication)."You can only send one of these scope keys at a time. +// Deprecated: +// returns a *RequestInformation when successful +func (m *WithAuthorization_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemWithAuthorization_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. +// Deprecated: +// returns a *WithAuthorization_ItemRequestBuilder when successful +func (m *WithAuthorization_ItemRequestBuilder) WithUrl(rawUrl string)(*WithAuthorization_ItemRequestBuilder) { + return NewWithAuthorization_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/codes_of_conduct/codes_escaped_of_escaped_conduct_request_builder.go b/pkg/github/codes_of_conduct/codes_escaped_of_escaped_conduct_request_builder.go new file mode 100644 index 00000000..71082a8f --- /dev/null +++ b/pkg/github/codes_of_conduct/codes_escaped_of_escaped_conduct_request_builder.go @@ -0,0 +1,72 @@ +package codes_of_conduct + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// Codes_of_conductRequestBuilder builds and executes requests for operations under \codes_of_conduct +type Codes_of_conductRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByKey gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.codes_of_conduct.item collection +// returns a *WithKeyItemRequestBuilder when successful +func (m *Codes_of_conductRequestBuilder) ByKey(key string)(*WithKeyItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if key != "" { + urlTplParams["key"] = key + } + return NewWithKeyItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewCodes_of_conductRequestBuilderInternal instantiates a new Codes_of_conductRequestBuilder and sets the default values. +func NewCodes_of_conductRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Codes_of_conductRequestBuilder) { + m := &Codes_of_conductRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/codes_of_conduct", pathParameters), + } + return m +} +// NewCodes_of_conductRequestBuilder instantiates a new Codes_of_conductRequestBuilder and sets the default values. +func NewCodes_of_conductRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Codes_of_conductRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodes_of_conductRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns array of all GitHub's codes of conduct. +// returns a []CodeOfConductable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/codes-of-conduct/codes-of-conduct#get-all-codes-of-conduct +func (m *Codes_of_conductRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeOfConductable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeOfConductFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeOfConductable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeOfConductable) + } + } + return val, nil +} +// ToGetRequestInformation returns array of all GitHub's codes of conduct. +// returns a *RequestInformation when successful +func (m *Codes_of_conductRequestBuilder) 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 *Codes_of_conductRequestBuilder when successful +func (m *Codes_of_conductRequestBuilder) WithUrl(rawUrl string)(*Codes_of_conductRequestBuilder) { + return NewCodes_of_conductRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/codes_of_conduct/with_key_item_request_builder.go b/pkg/github/codes_of_conduct/with_key_item_request_builder.go new file mode 100644 index 00000000..d2a7faf6 --- /dev/null +++ b/pkg/github/codes_of_conduct/with_key_item_request_builder.go @@ -0,0 +1,61 @@ +package codes_of_conduct + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// WithKeyItemRequestBuilder builds and executes requests for operations under \codes_of_conduct\{key} +type WithKeyItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithKeyItemRequestBuilderInternal instantiates a new WithKeyItemRequestBuilder and sets the default values. +func NewWithKeyItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithKeyItemRequestBuilder) { + m := &WithKeyItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/codes_of_conduct/{key}", pathParameters), + } + return m +} +// NewWithKeyItemRequestBuilder instantiates a new WithKeyItemRequestBuilder and sets the default values. +func NewWithKeyItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithKeyItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithKeyItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns information about the specified GitHub code of conduct. +// returns a CodeOfConductable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/codes-of-conduct/codes-of-conduct#get-a-code-of-conduct +func (m *WithKeyItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeOfConductable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeOfConductFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeOfConductable), nil +} +// ToGetRequestInformation returns information about the specified GitHub code of conduct. +// returns a *RequestInformation when successful +func (m *WithKeyItemRequestBuilder) 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 *WithKeyItemRequestBuilder when successful +func (m *WithKeyItemRequestBuilder) WithUrl(rawUrl string)(*WithKeyItemRequestBuilder) { + return NewWithKeyItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/emojis/emojis_get_response.go b/pkg/github/emojis/emojis_get_response.go new file mode 100644 index 00000000..fa4455a2 --- /dev/null +++ b/pkg/github/emojis/emojis_get_response.go @@ -0,0 +1,51 @@ +package emojis + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EmojisGetResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewEmojisGetResponse instantiates a new EmojisGetResponse and sets the default values. +func NewEmojisGetResponse()(*EmojisGetResponse) { + m := &EmojisGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEmojisGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmojisGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEmojisGetResponse(), 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 *EmojisGetResponse) 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 *EmojisGetResponse) 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 *EmojisGetResponse) 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 *EmojisGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type EmojisGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/emojis/emojis_request_builder.go b/pkg/github/emojis/emojis_request_builder.go new file mode 100644 index 00000000..5a2cc8b4 --- /dev/null +++ b/pkg/github/emojis/emojis_request_builder.go @@ -0,0 +1,56 @@ +package emojis + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// EmojisRequestBuilder builds and executes requests for operations under \emojis +type EmojisRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewEmojisRequestBuilderInternal instantiates a new EmojisRequestBuilder and sets the default values. +func NewEmojisRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EmojisRequestBuilder) { + m := &EmojisRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/emojis", pathParameters), + } + return m +} +// NewEmojisRequestBuilder instantiates a new EmojisRequestBuilder and sets the default values. +func NewEmojisRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EmojisRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewEmojisRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all the emojis available to use on GitHub Enterprise Server. +// returns a EmojisGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/emojis/emojis#get-emojis +func (m *EmojisRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(EmojisGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateEmojisGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(EmojisGetResponseable), nil +} +// ToGetRequestInformation lists all the emojis available to use on GitHub Enterprise Server. +// returns a *RequestInformation when successful +func (m *EmojisRequestBuilder) 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 *EmojisRequestBuilder when successful +func (m *EmojisRequestBuilder) WithUrl(rawUrl string)(*EmojisRequestBuilder) { + return NewEmojisRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprise/announcement_request_builder.go b/pkg/github/enterprise/announcement_request_builder.go new file mode 100644 index 00000000..4aa79b1a --- /dev/null +++ b/pkg/github/enterprise/announcement_request_builder.go @@ -0,0 +1,110 @@ +package enterprise + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// AnnouncementRequestBuilder builds and executes requests for operations under \enterprise\announcement +type AnnouncementRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewAnnouncementRequestBuilderInternal instantiates a new AnnouncementRequestBuilder and sets the default values. +func NewAnnouncementRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AnnouncementRequestBuilder) { + m := &AnnouncementRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/announcement", pathParameters), + } + return m +} +// NewAnnouncementRequestBuilder instantiates a new AnnouncementRequestBuilder and sets the default values. +func NewAnnouncementRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*AnnouncementRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewAnnouncementRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes the global announcement banner in your enterprise. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/announcement#remove-the-global-announcement-banner +func (m *AnnouncementRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets the current message and expiration date of the global announcement banner in your enterprise. +// returns a Announcementable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/announcement#get-the-global-announcement-banner +func (m *AnnouncementRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Announcementable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAnnouncementFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Announcementable), nil +} +// Patch sets the message and expiration time for the global announcement banner in your enterprise. +// returns a Announcementable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/announcement#set-the-global-announcement-banner +func (m *AnnouncementRequestBuilder) Patch(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Announcementable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Announcementable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAnnouncementFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Announcementable), nil +} +// ToDeleteRequestInformation removes the global announcement banner in your enterprise. +// returns a *RequestInformation when successful +func (m *AnnouncementRequestBuilder) 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 +} +// ToGetRequestInformation gets the current message and expiration date of the global announcement banner in your enterprise. +// returns a *RequestInformation when successful +func (m *AnnouncementRequestBuilder) 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 sets the message and expiration time for the global announcement banner in your enterprise. +// returns a *RequestInformation when successful +func (m *AnnouncementRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Announcementable, 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 *AnnouncementRequestBuilder when successful +func (m *AnnouncementRequestBuilder) WithUrl(rawUrl string)(*AnnouncementRequestBuilder) { + return NewAnnouncementRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprise/enterprise_request_builder.go b/pkg/github/enterprise/enterprise_request_builder.go new file mode 100644 index 00000000..497702db --- /dev/null +++ b/pkg/github/enterprise/enterprise_request_builder.go @@ -0,0 +1,38 @@ +package enterprise + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// EnterpriseRequestBuilder builds and executes requests for operations under \enterprise +type EnterpriseRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Announcement the announcement property +// returns a *AnnouncementRequestBuilder when successful +func (m *EnterpriseRequestBuilder) Announcement()(*AnnouncementRequestBuilder) { + return NewAnnouncementRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewEnterpriseRequestBuilderInternal instantiates a new EnterpriseRequestBuilder and sets the default values. +func NewEnterpriseRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EnterpriseRequestBuilder) { + m := &EnterpriseRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise", pathParameters), + } + return m +} +// NewEnterpriseRequestBuilder instantiates a new EnterpriseRequestBuilder and sets the default values. +func NewEnterpriseRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EnterpriseRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewEnterpriseRequestBuilderInternal(urlParams, requestAdapter) +} +// Settings the settings property +// returns a *SettingsRequestBuilder when successful +func (m *EnterpriseRequestBuilder) Settings()(*SettingsRequestBuilder) { + return NewSettingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Stats the stats property +// returns a *StatsRequestBuilder when successful +func (m *EnterpriseRequestBuilder) Stats()(*StatsRequestBuilder) { + return NewStatsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/enterprise/settings_license_request_builder.go b/pkg/github/enterprise/settings_license_request_builder.go new file mode 100644 index 00000000..425a6d5b --- /dev/null +++ b/pkg/github/enterprise/settings_license_request_builder.go @@ -0,0 +1,56 @@ +package enterprise + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// SettingsLicenseRequestBuilder builds and executes requests for operations under \enterprise\settings\license +type SettingsLicenseRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewSettingsLicenseRequestBuilderInternal instantiates a new SettingsLicenseRequestBuilder and sets the default values. +func NewSettingsLicenseRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SettingsLicenseRequestBuilder) { + m := &SettingsLicenseRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/settings/license", pathParameters), + } + return m +} +// NewSettingsLicenseRequestBuilder instantiates a new SettingsLicenseRequestBuilder and sets the default values. +func NewSettingsLicenseRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SettingsLicenseRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewSettingsLicenseRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get license information +// returns a LicenseInfoable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/license#get-license-information +func (m *SettingsLicenseRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LicenseInfoable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLicenseInfoFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LicenseInfoable), nil +} +// returns a *RequestInformation when successful +func (m *SettingsLicenseRequestBuilder) 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 *SettingsLicenseRequestBuilder when successful +func (m *SettingsLicenseRequestBuilder) WithUrl(rawUrl string)(*SettingsLicenseRequestBuilder) { + return NewSettingsLicenseRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprise/settings_request_builder.go b/pkg/github/enterprise/settings_request_builder.go new file mode 100644 index 00000000..6b08f922 --- /dev/null +++ b/pkg/github/enterprise/settings_request_builder.go @@ -0,0 +1,28 @@ +package enterprise + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// SettingsRequestBuilder builds and executes requests for operations under \enterprise\settings +type SettingsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewSettingsRequestBuilderInternal instantiates a new SettingsRequestBuilder and sets the default values. +func NewSettingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SettingsRequestBuilder) { + m := &SettingsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/settings", pathParameters), + } + return m +} +// NewSettingsRequestBuilder instantiates a new SettingsRequestBuilder and sets the default values. +func NewSettingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SettingsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewSettingsRequestBuilderInternal(urlParams, requestAdapter) +} +// License the license property +// returns a *SettingsLicenseRequestBuilder when successful +func (m *SettingsRequestBuilder) License()(*SettingsLicenseRequestBuilder) { + return NewSettingsLicenseRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/enterprise/stats_all_request_builder.go b/pkg/github/enterprise/stats_all_request_builder.go new file mode 100644 index 00000000..21dbda86 --- /dev/null +++ b/pkg/github/enterprise/stats_all_request_builder.go @@ -0,0 +1,56 @@ +package enterprise + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// StatsAllRequestBuilder builds and executes requests for operations under \enterprise\stats\all +type StatsAllRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStatsAllRequestBuilderInternal instantiates a new StatsAllRequestBuilder and sets the default values. +func NewStatsAllRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsAllRequestBuilder) { + m := &StatsAllRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/stats/all", pathParameters), + } + return m +} +// NewStatsAllRequestBuilder instantiates a new StatsAllRequestBuilder and sets the default values. +func NewStatsAllRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsAllRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStatsAllRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get all statistics +// returns a EnterpriseOverviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-all-statistics +func (m *StatsAllRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnterpriseOverviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseOverviewable), nil +} +// returns a *RequestInformation when successful +func (m *StatsAllRequestBuilder) 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 *StatsAllRequestBuilder when successful +func (m *StatsAllRequestBuilder) WithUrl(rawUrl string)(*StatsAllRequestBuilder) { + return NewStatsAllRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprise/stats_comments_request_builder.go b/pkg/github/enterprise/stats_comments_request_builder.go new file mode 100644 index 00000000..143fc3d7 --- /dev/null +++ b/pkg/github/enterprise/stats_comments_request_builder.go @@ -0,0 +1,56 @@ +package enterprise + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// StatsCommentsRequestBuilder builds and executes requests for operations under \enterprise\stats\comments +type StatsCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStatsCommentsRequestBuilderInternal instantiates a new StatsCommentsRequestBuilder and sets the default values. +func NewStatsCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsCommentsRequestBuilder) { + m := &StatsCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/stats/comments", pathParameters), + } + return m +} +// NewStatsCommentsRequestBuilder instantiates a new StatsCommentsRequestBuilder and sets the default values. +func NewStatsCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStatsCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get comment statistics +// returns a EnterpriseCommentOverviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-comment-statistics +func (m *StatsCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseCommentOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnterpriseCommentOverviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseCommentOverviewable), nil +} +// returns a *RequestInformation when successful +func (m *StatsCommentsRequestBuilder) 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 *StatsCommentsRequestBuilder when successful +func (m *StatsCommentsRequestBuilder) WithUrl(rawUrl string)(*StatsCommentsRequestBuilder) { + return NewStatsCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprise/stats_gists_request_builder.go b/pkg/github/enterprise/stats_gists_request_builder.go new file mode 100644 index 00000000..bca884c0 --- /dev/null +++ b/pkg/github/enterprise/stats_gists_request_builder.go @@ -0,0 +1,56 @@ +package enterprise + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// StatsGistsRequestBuilder builds and executes requests for operations under \enterprise\stats\gists +type StatsGistsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStatsGistsRequestBuilderInternal instantiates a new StatsGistsRequestBuilder and sets the default values. +func NewStatsGistsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsGistsRequestBuilder) { + m := &StatsGistsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/stats/gists", pathParameters), + } + return m +} +// NewStatsGistsRequestBuilder instantiates a new StatsGistsRequestBuilder and sets the default values. +func NewStatsGistsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsGistsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStatsGistsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get gist statistics +// returns a EnterpriseGistOverviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-gist-statistics +func (m *StatsGistsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseGistOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnterpriseGistOverviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseGistOverviewable), nil +} +// returns a *RequestInformation when successful +func (m *StatsGistsRequestBuilder) 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 *StatsGistsRequestBuilder when successful +func (m *StatsGistsRequestBuilder) WithUrl(rawUrl string)(*StatsGistsRequestBuilder) { + return NewStatsGistsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprise/stats_hooks_request_builder.go b/pkg/github/enterprise/stats_hooks_request_builder.go new file mode 100644 index 00000000..2f527902 --- /dev/null +++ b/pkg/github/enterprise/stats_hooks_request_builder.go @@ -0,0 +1,57 @@ +package enterprise + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// StatsHooksRequestBuilder builds and executes requests for operations under \enterprise\stats\hooks +type StatsHooksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStatsHooksRequestBuilderInternal instantiates a new StatsHooksRequestBuilder and sets the default values. +func NewStatsHooksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsHooksRequestBuilder) { + m := &StatsHooksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/stats/hooks", pathParameters), + } + return m +} +// NewStatsHooksRequestBuilder instantiates a new StatsHooksRequestBuilder and sets the default values. +func NewStatsHooksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsHooksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStatsHooksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get hooks statistics +// returns a EnterpriseHookOverviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-hooks-statistics +func (m *StatsHooksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseHookOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnterpriseHookOverviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseHookOverviewable), nil +} +// ToGetRequestInformation get hooks statistics +// returns a *RequestInformation when successful +func (m *StatsHooksRequestBuilder) 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 *StatsHooksRequestBuilder when successful +func (m *StatsHooksRequestBuilder) WithUrl(rawUrl string)(*StatsHooksRequestBuilder) { + return NewStatsHooksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprise/stats_issues_request_builder.go b/pkg/github/enterprise/stats_issues_request_builder.go new file mode 100644 index 00000000..ff13f1cf --- /dev/null +++ b/pkg/github/enterprise/stats_issues_request_builder.go @@ -0,0 +1,56 @@ +package enterprise + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// StatsIssuesRequestBuilder builds and executes requests for operations under \enterprise\stats\issues +type StatsIssuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStatsIssuesRequestBuilderInternal instantiates a new StatsIssuesRequestBuilder and sets the default values. +func NewStatsIssuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsIssuesRequestBuilder) { + m := &StatsIssuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/stats/issues", pathParameters), + } + return m +} +// NewStatsIssuesRequestBuilder instantiates a new StatsIssuesRequestBuilder and sets the default values. +func NewStatsIssuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsIssuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStatsIssuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get issue statistics +// returns a EnterpriseIssueOverviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-issue-statistics +func (m *StatsIssuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseIssueOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnterpriseIssueOverviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseIssueOverviewable), nil +} +// returns a *RequestInformation when successful +func (m *StatsIssuesRequestBuilder) 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 *StatsIssuesRequestBuilder when successful +func (m *StatsIssuesRequestBuilder) WithUrl(rawUrl string)(*StatsIssuesRequestBuilder) { + return NewStatsIssuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprise/stats_milestones_request_builder.go b/pkg/github/enterprise/stats_milestones_request_builder.go new file mode 100644 index 00000000..752b97df --- /dev/null +++ b/pkg/github/enterprise/stats_milestones_request_builder.go @@ -0,0 +1,56 @@ +package enterprise + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// StatsMilestonesRequestBuilder builds and executes requests for operations under \enterprise\stats\milestones +type StatsMilestonesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStatsMilestonesRequestBuilderInternal instantiates a new StatsMilestonesRequestBuilder and sets the default values. +func NewStatsMilestonesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsMilestonesRequestBuilder) { + m := &StatsMilestonesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/stats/milestones", pathParameters), + } + return m +} +// NewStatsMilestonesRequestBuilder instantiates a new StatsMilestonesRequestBuilder and sets the default values. +func NewStatsMilestonesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsMilestonesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStatsMilestonesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get milestone statistics +// returns a EnterpriseMilestoneOverviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-milestone-statistics +func (m *StatsMilestonesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseMilestoneOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnterpriseMilestoneOverviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseMilestoneOverviewable), nil +} +// returns a *RequestInformation when successful +func (m *StatsMilestonesRequestBuilder) 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 *StatsMilestonesRequestBuilder when successful +func (m *StatsMilestonesRequestBuilder) WithUrl(rawUrl string)(*StatsMilestonesRequestBuilder) { + return NewStatsMilestonesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprise/stats_orgs_request_builder.go b/pkg/github/enterprise/stats_orgs_request_builder.go new file mode 100644 index 00000000..40dd5004 --- /dev/null +++ b/pkg/github/enterprise/stats_orgs_request_builder.go @@ -0,0 +1,56 @@ +package enterprise + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// StatsOrgsRequestBuilder builds and executes requests for operations under \enterprise\stats\orgs +type StatsOrgsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStatsOrgsRequestBuilderInternal instantiates a new StatsOrgsRequestBuilder and sets the default values. +func NewStatsOrgsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsOrgsRequestBuilder) { + m := &StatsOrgsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/stats/orgs", pathParameters), + } + return m +} +// NewStatsOrgsRequestBuilder instantiates a new StatsOrgsRequestBuilder and sets the default values. +func NewStatsOrgsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsOrgsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStatsOrgsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get organization statistics +// returns a EnterpriseOrganizationOverviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-organization-statistics +func (m *StatsOrgsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseOrganizationOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnterpriseOrganizationOverviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseOrganizationOverviewable), nil +} +// returns a *RequestInformation when successful +func (m *StatsOrgsRequestBuilder) 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 *StatsOrgsRequestBuilder when successful +func (m *StatsOrgsRequestBuilder) WithUrl(rawUrl string)(*StatsOrgsRequestBuilder) { + return NewStatsOrgsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprise/stats_pages_request_builder.go b/pkg/github/enterprise/stats_pages_request_builder.go new file mode 100644 index 00000000..f1bf964e --- /dev/null +++ b/pkg/github/enterprise/stats_pages_request_builder.go @@ -0,0 +1,56 @@ +package enterprise + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// StatsPagesRequestBuilder builds and executes requests for operations under \enterprise\stats\pages +type StatsPagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStatsPagesRequestBuilderInternal instantiates a new StatsPagesRequestBuilder and sets the default values. +func NewStatsPagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsPagesRequestBuilder) { + m := &StatsPagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/stats/pages", pathParameters), + } + return m +} +// NewStatsPagesRequestBuilder instantiates a new StatsPagesRequestBuilder and sets the default values. +func NewStatsPagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsPagesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStatsPagesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get pages statistics +// returns a EnterprisePageOverviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-pages-statistics +func (m *StatsPagesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterprisePageOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnterprisePageOverviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterprisePageOverviewable), nil +} +// returns a *RequestInformation when successful +func (m *StatsPagesRequestBuilder) 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 *StatsPagesRequestBuilder when successful +func (m *StatsPagesRequestBuilder) WithUrl(rawUrl string)(*StatsPagesRequestBuilder) { + return NewStatsPagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprise/stats_pulls_request_builder.go b/pkg/github/enterprise/stats_pulls_request_builder.go new file mode 100644 index 00000000..9b70b91d --- /dev/null +++ b/pkg/github/enterprise/stats_pulls_request_builder.go @@ -0,0 +1,56 @@ +package enterprise + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// StatsPullsRequestBuilder builds and executes requests for operations under \enterprise\stats\pulls +type StatsPullsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStatsPullsRequestBuilderInternal instantiates a new StatsPullsRequestBuilder and sets the default values. +func NewStatsPullsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsPullsRequestBuilder) { + m := &StatsPullsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/stats/pulls", pathParameters), + } + return m +} +// NewStatsPullsRequestBuilder instantiates a new StatsPullsRequestBuilder and sets the default values. +func NewStatsPullsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsPullsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStatsPullsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get pull request statistics +// returns a EnterprisePullRequestOverviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-pull-request-statistics +func (m *StatsPullsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterprisePullRequestOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnterprisePullRequestOverviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterprisePullRequestOverviewable), nil +} +// returns a *RequestInformation when successful +func (m *StatsPullsRequestBuilder) 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 *StatsPullsRequestBuilder when successful +func (m *StatsPullsRequestBuilder) WithUrl(rawUrl string)(*StatsPullsRequestBuilder) { + return NewStatsPullsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprise/stats_repos_request_builder.go b/pkg/github/enterprise/stats_repos_request_builder.go new file mode 100644 index 00000000..dfff69a9 --- /dev/null +++ b/pkg/github/enterprise/stats_repos_request_builder.go @@ -0,0 +1,57 @@ +package enterprise + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// StatsReposRequestBuilder builds and executes requests for operations under \enterprise\stats\repos +type StatsReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStatsReposRequestBuilderInternal instantiates a new StatsReposRequestBuilder and sets the default values. +func NewStatsReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsReposRequestBuilder) { + m := &StatsReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/stats/repos", pathParameters), + } + return m +} +// NewStatsReposRequestBuilder instantiates a new StatsReposRequestBuilder and sets the default values. +func NewStatsReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStatsReposRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get repository statistics +// returns a EnterpriseRepositoryOverviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-repository-statistics +func (m *StatsReposRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseRepositoryOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnterpriseRepositoryOverviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseRepositoryOverviewable), nil +} +// ToGetRequestInformation get repository statistics +// returns a *RequestInformation when successful +func (m *StatsReposRequestBuilder) 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 *StatsReposRequestBuilder when successful +func (m *StatsReposRequestBuilder) WithUrl(rawUrl string)(*StatsReposRequestBuilder) { + return NewStatsReposRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprise/stats_request_builder.go b/pkg/github/enterprise/stats_request_builder.go new file mode 100644 index 00000000..b6e40af6 --- /dev/null +++ b/pkg/github/enterprise/stats_request_builder.go @@ -0,0 +1,83 @@ +package enterprise + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// StatsRequestBuilder builds and executes requests for operations under \enterprise\stats +type StatsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// All the all property +// returns a *StatsAllRequestBuilder when successful +func (m *StatsRequestBuilder) All()(*StatsAllRequestBuilder) { + return NewStatsAllRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *StatsCommentsRequestBuilder when successful +func (m *StatsRequestBuilder) Comments()(*StatsCommentsRequestBuilder) { + return NewStatsCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewStatsRequestBuilderInternal instantiates a new StatsRequestBuilder and sets the default values. +func NewStatsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsRequestBuilder) { + m := &StatsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/stats", pathParameters), + } + return m +} +// NewStatsRequestBuilder instantiates a new StatsRequestBuilder and sets the default values. +func NewStatsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStatsRequestBuilderInternal(urlParams, requestAdapter) +} +// Gists the gists property +// returns a *StatsGistsRequestBuilder when successful +func (m *StatsRequestBuilder) Gists()(*StatsGistsRequestBuilder) { + return NewStatsGistsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Hooks the hooks property +// returns a *StatsHooksRequestBuilder when successful +func (m *StatsRequestBuilder) Hooks()(*StatsHooksRequestBuilder) { + return NewStatsHooksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Issues the issues property +// returns a *StatsIssuesRequestBuilder when successful +func (m *StatsRequestBuilder) Issues()(*StatsIssuesRequestBuilder) { + return NewStatsIssuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Milestones the milestones property +// returns a *StatsMilestonesRequestBuilder when successful +func (m *StatsRequestBuilder) Milestones()(*StatsMilestonesRequestBuilder) { + return NewStatsMilestonesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Orgs the orgs property +// returns a *StatsOrgsRequestBuilder when successful +func (m *StatsRequestBuilder) Orgs()(*StatsOrgsRequestBuilder) { + return NewStatsOrgsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Pages the pages property +// returns a *StatsPagesRequestBuilder when successful +func (m *StatsRequestBuilder) Pages()(*StatsPagesRequestBuilder) { + return NewStatsPagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Pulls the pulls property +// returns a *StatsPullsRequestBuilder when successful +func (m *StatsRequestBuilder) Pulls()(*StatsPullsRequestBuilder) { + return NewStatsPullsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repos the repos property +// returns a *StatsReposRequestBuilder when successful +func (m *StatsRequestBuilder) Repos()(*StatsReposRequestBuilder) { + return NewStatsReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecurityProducts the securityProducts property +// returns a *StatsSecurityProductsRequestBuilder when successful +func (m *StatsRequestBuilder) SecurityProducts()(*StatsSecurityProductsRequestBuilder) { + return NewStatsSecurityProductsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Users the users property +// returns a *StatsUsersRequestBuilder when successful +func (m *StatsRequestBuilder) Users()(*StatsUsersRequestBuilder) { + return NewStatsUsersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/enterprise/stats_security_products_request_builder.go b/pkg/github/enterprise/stats_security_products_request_builder.go new file mode 100644 index 00000000..04d8060c --- /dev/null +++ b/pkg/github/enterprise/stats_security_products_request_builder.go @@ -0,0 +1,57 @@ +package enterprise + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// StatsSecurityProductsRequestBuilder builds and executes requests for operations under \enterprise\stats\security-products +type StatsSecurityProductsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStatsSecurityProductsRequestBuilderInternal instantiates a new StatsSecurityProductsRequestBuilder and sets the default values. +func NewStatsSecurityProductsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsSecurityProductsRequestBuilder) { + m := &StatsSecurityProductsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/stats/security-products", pathParameters), + } + return m +} +// NewStatsSecurityProductsRequestBuilder instantiates a new StatsSecurityProductsRequestBuilder and sets the default values. +func NewStatsSecurityProductsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsSecurityProductsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStatsSecurityProductsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the statistics about security products for a GitHub Enterprise Server instance.To use this endpoint, you must be a site admin. +// returns a EnterpriseSecurityProductsOverviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-security-products-statistics +func (m *StatsSecurityProductsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseSecurityProductsOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnterpriseSecurityProductsOverviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseSecurityProductsOverviewable), nil +} +// ToGetRequestInformation gets the statistics about security products for a GitHub Enterprise Server instance.To use this endpoint, you must be a site admin. +// returns a *RequestInformation when successful +func (m *StatsSecurityProductsRequestBuilder) 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 *StatsSecurityProductsRequestBuilder when successful +func (m *StatsSecurityProductsRequestBuilder) WithUrl(rawUrl string)(*StatsSecurityProductsRequestBuilder) { + return NewStatsSecurityProductsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprise/stats_users_request_builder.go b/pkg/github/enterprise/stats_users_request_builder.go new file mode 100644 index 00000000..5095102c --- /dev/null +++ b/pkg/github/enterprise/stats_users_request_builder.go @@ -0,0 +1,56 @@ +package enterprise + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// StatsUsersRequestBuilder builds and executes requests for operations under \enterprise\stats\users +type StatsUsersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStatsUsersRequestBuilderInternal instantiates a new StatsUsersRequestBuilder and sets the default values. +func NewStatsUsersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsUsersRequestBuilder) { + m := &StatsUsersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprise/stats/users", pathParameters), + } + return m +} +// NewStatsUsersRequestBuilder instantiates a new StatsUsersRequestBuilder and sets the default values. +func NewStatsUsersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StatsUsersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStatsUsersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get users statistics +// returns a EnterpriseUserOverviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/admin-stats#get-users-statistics +func (m *StatsUsersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseUserOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnterpriseUserOverviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseUserOverviewable), nil +} +// returns a *RequestInformation when successful +func (m *StatsUsersRequestBuilder) 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 *StatsUsersRequestBuilder when successful +func (m *StatsUsersRequestBuilder) WithUrl(rawUrl string)(*StatsUsersRequestBuilder) { + return NewStatsUsersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/enterprises_request_builder.go b/pkg/github/enterprises/enterprises_request_builder.go new file mode 100644 index 00000000..3366863e --- /dev/null +++ b/pkg/github/enterprises/enterprises_request_builder.go @@ -0,0 +1,35 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// EnterprisesRequestBuilder builds and executes requests for operations under \enterprises +type EnterprisesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByEnterprise gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.enterprises.item collection +// returns a *WithEnterpriseItemRequestBuilder when successful +func (m *EnterprisesRequestBuilder) ByEnterprise(enterprise string)(*WithEnterpriseItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if enterprise != "" { + urlTplParams["enterprise"] = enterprise + } + return NewWithEnterpriseItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewEnterprisesRequestBuilderInternal instantiates a new EnterprisesRequestBuilder and sets the default values. +func NewEnterprisesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EnterprisesRequestBuilder) { + m := &EnterprisesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises", pathParameters), + } + return m +} +// NewEnterprisesRequestBuilder instantiates a new EnterprisesRequestBuilder and sets the default values. +func NewEnterprisesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EnterprisesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewEnterprisesRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/enterprises/item/actions/runnergroups/item/with_runner_escaped_group_escaped_patch_request_body_escaped_visibility.go b/pkg/github/enterprises/item/actions/runnergroups/item/with_runner_escaped_group_escaped_patch_request_body_escaped_visibility.go new file mode 100644 index 00000000..79958d0b --- /dev/null +++ b/pkg/github/enterprises/item/actions/runnergroups/item/with_runner_escaped_group_escaped_patch_request_body_escaped_visibility.go @@ -0,0 +1,34 @@ +package item +// Visibility of a runner group. You can select all organizations or select individual organizations. +type WithRunner_group_PatchRequestBody_visibility int + +const ( + SELECTED_WITHRUNNER_GROUP_PATCHREQUESTBODY_VISIBILITY WithRunner_group_PatchRequestBody_visibility = iota + ALL_WITHRUNNER_GROUP_PATCHREQUESTBODY_VISIBILITY +) + +func (i WithRunner_group_PatchRequestBody_visibility) String() string { + return []string{"selected", "all"}[i] +} +func ParseWithRunner_group_PatchRequestBody_visibility(v string) (any, error) { + result := SELECTED_WITHRUNNER_GROUP_PATCHREQUESTBODY_VISIBILITY + switch v { + case "selected": + result = SELECTED_WITHRUNNER_GROUP_PATCHREQUESTBODY_VISIBILITY + case "all": + result = ALL_WITHRUNNER_GROUP_PATCHREQUESTBODY_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeWithRunner_group_PatchRequestBody_visibility(values []WithRunner_group_PatchRequestBody_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithRunner_group_PatchRequestBody_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/actions/runnergroups/runner_groups_post_request_body_escaped_visibility.go b/pkg/github/enterprises/item/actions/runnergroups/runner_groups_post_request_body_escaped_visibility.go new file mode 100644 index 00000000..46114843 --- /dev/null +++ b/pkg/github/enterprises/item/actions/runnergroups/runner_groups_post_request_body_escaped_visibility.go @@ -0,0 +1,34 @@ +package runnergroups +// Visibility of a runner group. You can select all organizations or select individual organization. +type RunnerGroupsPostRequestBody_visibility int + +const ( + SELECTED_RUNNERGROUPSPOSTREQUESTBODY_VISIBILITY RunnerGroupsPostRequestBody_visibility = iota + ALL_RUNNERGROUPSPOSTREQUESTBODY_VISIBILITY +) + +func (i RunnerGroupsPostRequestBody_visibility) String() string { + return []string{"selected", "all"}[i] +} +func ParseRunnerGroupsPostRequestBody_visibility(v string) (any, error) { + result := SELECTED_RUNNERGROUPSPOSTREQUESTBODY_VISIBILITY + switch v { + case "selected": + result = SELECTED_RUNNERGROUPSPOSTREQUESTBODY_VISIBILITY + case "all": + result = ALL_RUNNERGROUPSPOSTREQUESTBODY_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeRunnerGroupsPostRequestBody_visibility(values []RunnerGroupsPostRequestBody_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RunnerGroupsPostRequestBody_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/auditlog/get_include_query_parameter_type.go b/pkg/github/enterprises/item/auditlog/get_include_query_parameter_type.go new file mode 100644 index 00000000..28012aff --- /dev/null +++ b/pkg/github/enterprises/item/auditlog/get_include_query_parameter_type.go @@ -0,0 +1,36 @@ +package auditlog +type GetIncludeQueryParameterType int + +const ( + WEB_GETINCLUDEQUERYPARAMETERTYPE GetIncludeQueryParameterType = iota + GIT_GETINCLUDEQUERYPARAMETERTYPE + ALL_GETINCLUDEQUERYPARAMETERTYPE +) + +func (i GetIncludeQueryParameterType) String() string { + return []string{"web", "git", "all"}[i] +} +func ParseGetIncludeQueryParameterType(v string) (any, error) { + result := WEB_GETINCLUDEQUERYPARAMETERTYPE + switch v { + case "web": + result = WEB_GETINCLUDEQUERYPARAMETERTYPE + case "git": + result = GIT_GETINCLUDEQUERYPARAMETERTYPE + case "all": + result = ALL_GETINCLUDEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetIncludeQueryParameterType(values []GetIncludeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetIncludeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/auditlog/get_order_query_parameter_type.go b/pkg/github/enterprises/item/auditlog/get_order_query_parameter_type.go new file mode 100644 index 00000000..2ba54de5 --- /dev/null +++ b/pkg/github/enterprises/item/auditlog/get_order_query_parameter_type.go @@ -0,0 +1,33 @@ +package auditlog +type GetOrderQueryParameterType int + +const ( + DESC_GETORDERQUERYPARAMETERTYPE GetOrderQueryParameterType = iota + ASC_GETORDERQUERYPARAMETERTYPE +) + +func (i GetOrderQueryParameterType) String() string { + return []string{"desc", "asc"}[i] +} +func ParseGetOrderQueryParameterType(v string) (any, error) { + result := DESC_GETORDERQUERYPARAMETERTYPE + switch v { + case "desc": + result = DESC_GETORDERQUERYPARAMETERTYPE + case "asc": + result = ASC_GETORDERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetOrderQueryParameterType(values []GetOrderQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetOrderQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codescanning/alerts/get_direction_query_parameter_type.go b/pkg/github/enterprises/item/codescanning/alerts/get_direction_query_parameter_type.go new file mode 100644 index 00000000..0606c6d4 --- /dev/null +++ b/pkg/github/enterprises/item/codescanning/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/codescanning/alerts/get_sort_query_parameter_type.go b/pkg/github/enterprises/item/codescanning/alerts/get_sort_query_parameter_type.go new file mode 100644 index 00000000..719c5fb3 --- /dev/null +++ b/pkg/github/enterprises/item/codescanning/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/dependabot/alerts/get_direction_query_parameter_type.go b/pkg/github/enterprises/item/dependabot/alerts/get_direction_query_parameter_type.go new file mode 100644 index 00000000..0606c6d4 --- /dev/null +++ b/pkg/github/enterprises/item/dependabot/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/dependabot/alerts/get_scope_query_parameter_type.go b/pkg/github/enterprises/item/dependabot/alerts/get_scope_query_parameter_type.go new file mode 100644 index 00000000..5d3e9a31 --- /dev/null +++ b/pkg/github/enterprises/item/dependabot/alerts/get_scope_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetScopeQueryParameterType int + +const ( + DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE GetScopeQueryParameterType = iota + RUNTIME_GETSCOPEQUERYPARAMETERTYPE +) + +func (i GetScopeQueryParameterType) String() string { + return []string{"development", "runtime"}[i] +} +func ParseGetScopeQueryParameterType(v string) (any, error) { + result := DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE + switch v { + case "development": + result = DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE + case "runtime": + result = RUNTIME_GETSCOPEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetScopeQueryParameterType(values []GetScopeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetScopeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/dependabot/alerts/get_sort_query_parameter_type.go b/pkg/github/enterprises/item/dependabot/alerts/get_sort_query_parameter_type.go new file mode 100644 index 00000000..719c5fb3 --- /dev/null +++ b/pkg/github/enterprises/item/dependabot/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/secretscanning/alerts/get_direction_query_parameter_type.go b/pkg/github/enterprises/item/secretscanning/alerts/get_direction_query_parameter_type.go new file mode 100644 index 00000000..0606c6d4 --- /dev/null +++ b/pkg/github/enterprises/item/secretscanning/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/secretscanning/alerts/get_sort_query_parameter_type.go b/pkg/github/enterprises/item/secretscanning/alerts/get_sort_query_parameter_type.go new file mode 100644 index 00000000..719c5fb3 --- /dev/null +++ b/pkg/github/enterprises/item/secretscanning/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item/secretscanning/alerts/get_state_query_parameter_type.go b/pkg/github/enterprises/item/secretscanning/alerts/get_state_query_parameter_type.go new file mode 100644 index 00000000..ae552fb1 --- /dev/null +++ b/pkg/github/enterprises/item/secretscanning/alerts/get_state_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + RESOLVED_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "resolved"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "resolved": + result = RESOLVED_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/enterprises/item_actions_cache_request_builder.go b/pkg/github/enterprises/item_actions_cache_request_builder.go new file mode 100644 index 00000000..cd4ce66b --- /dev/null +++ b/pkg/github/enterprises/item_actions_cache_request_builder.go @@ -0,0 +1,33 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsCacheRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\cache +type ItemActionsCacheRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsCacheRequestBuilderInternal instantiates a new ItemActionsCacheRequestBuilder and sets the default values. +func NewItemActionsCacheRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheRequestBuilder) { + m := &ItemActionsCacheRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/cache", pathParameters), + } + return m +} +// NewItemActionsCacheRequestBuilder instantiates a new ItemActionsCacheRequestBuilder and sets the default values. +func NewItemActionsCacheRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsCacheRequestBuilderInternal(urlParams, requestAdapter) +} +// Usage the usage property +// returns a *ItemActionsCacheUsageRequestBuilder when successful +func (m *ItemActionsCacheRequestBuilder) Usage()(*ItemActionsCacheUsageRequestBuilder) { + return NewItemActionsCacheUsageRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// UsagePolicy the usagePolicy property +// returns a *ItemActionsCacheUsagePolicyRequestBuilder when successful +func (m *ItemActionsCacheRequestBuilder) UsagePolicy()(*ItemActionsCacheUsagePolicyRequestBuilder) { + return NewItemActionsCacheUsagePolicyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/enterprises/item_actions_cache_usage_policy_request_builder.go b/pkg/github/enterprises/item_actions_cache_usage_policy_request_builder.go new file mode 100644 index 00000000..40eafa05 --- /dev/null +++ b/pkg/github/enterprises/item_actions_cache_usage_policy_request_builder.go @@ -0,0 +1,83 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsCacheUsagePolicyRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\cache\usage-policy +type ItemActionsCacheUsagePolicyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsCacheUsagePolicyRequestBuilderInternal instantiates a new ItemActionsCacheUsagePolicyRequestBuilder and sets the default values. +func NewItemActionsCacheUsagePolicyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheUsagePolicyRequestBuilder) { + m := &ItemActionsCacheUsagePolicyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/cache/usage-policy", pathParameters), + } + return m +} +// NewItemActionsCacheUsagePolicyRequestBuilder instantiates a new ItemActionsCacheUsagePolicyRequestBuilder and sets the default values. +func NewItemActionsCacheUsagePolicyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheUsagePolicyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsCacheUsagePolicyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the GitHub Actions cache usage policy for an enterprise.OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a ActionsCacheUsagePolicyEnterpriseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#get-github-actions-cache-usage-policy-for-an-enterprise +func (m *ItemActionsCacheUsagePolicyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsagePolicyEnterpriseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsCacheUsagePolicyEnterpriseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsagePolicyEnterpriseable), nil +} +// Patch sets the GitHub Actions cache usage policy for an enterprise.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#set-github-actions-cache-usage-policy-for-an-enterprise +func (m *ItemActionsCacheUsagePolicyRequestBuilder) Patch(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsagePolicyEnterpriseable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets the GitHub Actions cache usage policy for an enterprise.OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsCacheUsagePolicyRequestBuilder) 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 sets the GitHub Actions cache usage policy for an enterprise.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsCacheUsagePolicyRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsagePolicyEnterpriseable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsCacheUsagePolicyRequestBuilder when successful +func (m *ItemActionsCacheUsagePolicyRequestBuilder) WithUrl(rawUrl string)(*ItemActionsCacheUsagePolicyRequestBuilder) { + return NewItemActionsCacheUsagePolicyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_cache_usage_request_builder.go b/pkg/github/enterprises/item_actions_cache_usage_request_builder.go new file mode 100644 index 00000000..40a43da3 --- /dev/null +++ b/pkg/github/enterprises/item_actions_cache_usage_request_builder.go @@ -0,0 +1,57 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsCacheUsageRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\cache\usage +type ItemActionsCacheUsageRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsCacheUsageRequestBuilderInternal instantiates a new ItemActionsCacheUsageRequestBuilder and sets the default values. +func NewItemActionsCacheUsageRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheUsageRequestBuilder) { + m := &ItemActionsCacheUsageRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/cache/usage", pathParameters), + } + return m +} +// NewItemActionsCacheUsageRequestBuilder instantiates a new ItemActionsCacheUsageRequestBuilder and sets the default values. +func NewItemActionsCacheUsageRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheUsageRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsCacheUsageRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the total GitHub Actions cache usage for an enterprise.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a ActionsCacheUsageOrgEnterpriseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#get-github-actions-cache-usage-for-an-enterprise +func (m *ItemActionsCacheUsageRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsageOrgEnterpriseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsCacheUsageOrgEnterpriseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsageOrgEnterpriseable), nil +} +// ToGetRequestInformation gets the total GitHub Actions cache usage for an enterprise.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsCacheUsageRequestBuilder) 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 *ItemActionsCacheUsageRequestBuilder when successful +func (m *ItemActionsCacheUsageRequestBuilder) WithUrl(rawUrl string)(*ItemActionsCacheUsageRequestBuilder) { + return NewItemActionsCacheUsageRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_permissions_organizations_get_response.go b/pkg/github/enterprises/item_actions_permissions_organizations_get_response.go new file mode 100644 index 00000000..bfc8d51c --- /dev/null +++ b/pkg/github/enterprises/item_actions_permissions_organizations_get_response.go @@ -0,0 +1,122 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsPermissionsOrganizationsGetResponse 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 organizations property + organizations []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable + // The total_count property + total_count *float64 +} +// NewItemActionsPermissionsOrganizationsGetResponse instantiates a new ItemActionsPermissionsOrganizationsGetResponse and sets the default values. +func NewItemActionsPermissionsOrganizationsGetResponse()(*ItemActionsPermissionsOrganizationsGetResponse) { + m := &ItemActionsPermissionsOrganizationsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsPermissionsOrganizationsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsPermissionsOrganizationsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsPermissionsOrganizationsGetResponse(), 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 *ItemActionsPermissionsOrganizationsGetResponse) 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 *ItemActionsPermissionsOrganizationsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["organizations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable) + } + } + m.SetOrganizations(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetOrganizations gets the organizations property value. The organizations property +// returns a []OrganizationSimpleable when successful +func (m *ItemActionsPermissionsOrganizationsGetResponse) GetOrganizations()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable) { + return m.organizations +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *float64 when successful +func (m *ItemActionsPermissionsOrganizationsGetResponse) GetTotalCount()(*float64) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsPermissionsOrganizationsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetOrganizations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetOrganizations())) + for i, v := range m.GetOrganizations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("organizations", cast) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("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 *ItemActionsPermissionsOrganizationsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetOrganizations sets the organizations property value. The organizations property +func (m *ItemActionsPermissionsOrganizationsGetResponse) SetOrganizations(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable)() { + m.organizations = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsPermissionsOrganizationsGetResponse) SetTotalCount(value *float64)() { + m.total_count = value +} +type ItemActionsPermissionsOrganizationsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOrganizations()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable) + GetTotalCount()(*float64) + SetOrganizations(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable)() + SetTotalCount(value *float64)() +} diff --git a/pkg/github/enterprises/item_actions_permissions_organizations_put_request_body.go b/pkg/github/enterprises/item_actions_permissions_organizations_put_request_body.go new file mode 100644 index 00000000..49f5b73f --- /dev/null +++ b/pkg/github/enterprises/item_actions_permissions_organizations_put_request_body.go @@ -0,0 +1,86 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsPermissionsOrganizationsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // List of organization IDs to enable for GitHub Actions. + selected_organization_ids []int32 +} +// NewItemActionsPermissionsOrganizationsPutRequestBody instantiates a new ItemActionsPermissionsOrganizationsPutRequestBody and sets the default values. +func NewItemActionsPermissionsOrganizationsPutRequestBody()(*ItemActionsPermissionsOrganizationsPutRequestBody) { + m := &ItemActionsPermissionsOrganizationsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsPermissionsOrganizationsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsPermissionsOrganizationsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsPermissionsOrganizationsPutRequestBody(), 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 *ItemActionsPermissionsOrganizationsPutRequestBody) 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 *ItemActionsPermissionsOrganizationsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_organization_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.SetSelectedOrganizationIds(res) + } + return nil + } + return res +} +// GetSelectedOrganizationIds gets the selected_organization_ids property value. List of organization IDs to enable for GitHub Actions. +// returns a []int32 when successful +func (m *ItemActionsPermissionsOrganizationsPutRequestBody) GetSelectedOrganizationIds()([]int32) { + return m.selected_organization_ids +} +// Serialize serializes information the current object +func (m *ItemActionsPermissionsOrganizationsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedOrganizationIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_organization_ids", m.GetSelectedOrganizationIds()) + 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 *ItemActionsPermissionsOrganizationsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedOrganizationIds sets the selected_organization_ids property value. List of organization IDs to enable for GitHub Actions. +func (m *ItemActionsPermissionsOrganizationsPutRequestBody) SetSelectedOrganizationIds(value []int32)() { + m.selected_organization_ids = value +} +type ItemActionsPermissionsOrganizationsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedOrganizationIds()([]int32) + SetSelectedOrganizationIds(value []int32)() +} diff --git a/pkg/github/enterprises/item_actions_permissions_organizations_request_builder.go b/pkg/github/enterprises/item_actions_permissions_organizations_request_builder.go new file mode 100644 index 00000000..39c43e75 --- /dev/null +++ b/pkg/github/enterprises/item_actions_permissions_organizations_request_builder.go @@ -0,0 +1,100 @@ +package enterprises + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsPermissionsOrganizationsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\permissions\organizations +type ItemActionsPermissionsOrganizationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsPermissionsOrganizationsRequestBuilderGetQueryParameters lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +type ItemActionsPermissionsOrganizationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByOrg_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.enterprises.item.actions.permissions.organizations.item collection +// returns a *ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder when successful +func (m *ItemActionsPermissionsOrganizationsRequestBuilder) ByOrg_id(org_id int32)(*ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["org_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(org_id), 10) + return NewItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsPermissionsOrganizationsRequestBuilderInternal instantiates a new ItemActionsPermissionsOrganizationsRequestBuilder and sets the default values. +func NewItemActionsPermissionsOrganizationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsOrganizationsRequestBuilder) { + m := &ItemActionsPermissionsOrganizationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/permissions/organizations{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsPermissionsOrganizationsRequestBuilder instantiates a new ItemActionsPermissionsOrganizationsRequestBuilder and sets the default values. +func NewItemActionsPermissionsOrganizationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsOrganizationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsOrganizationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a ItemActionsPermissionsOrganizationsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#list-selected-organizations-enabled-for-github-actions-in-an-enterprise +func (m *ItemActionsPermissionsOrganizationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsPermissionsOrganizationsRequestBuilderGetQueryParameters])(ItemActionsPermissionsOrganizationsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsPermissionsOrganizationsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsPermissionsOrganizationsGetResponseable), nil +} +// Put replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#set-selected-organizations-enabled-for-github-actions-in-an-enterprise +func (m *ItemActionsPermissionsOrganizationsRequestBuilder) Put(ctx context.Context, body ItemActionsPermissionsOrganizationsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists the organizations that are selected to have GitHub Actions enabled in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsOrganizationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsPermissionsOrganizationsRequestBuilderGetQueryParameters])(*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 +} +// ToPutRequestInformation replaces the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsOrganizationsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsPermissionsOrganizationsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsPermissionsOrganizationsRequestBuilder when successful +func (m *ItemActionsPermissionsOrganizationsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsOrganizationsRequestBuilder) { + return NewItemActionsPermissionsOrganizationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_permissions_organizations_with_org_escaped_item_request_builder.go b/pkg/github/enterprises/item_actions_permissions_organizations_with_org_escaped_item_request_builder.go new file mode 100644 index 00000000..74f41489 --- /dev/null +++ b/pkg/github/enterprises/item_actions_permissions_organizations_with_org_escaped_item_request_builder.go @@ -0,0 +1,73 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\permissions\organizations\{org_id} +type ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilderInternal instantiates a new ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder and sets the default values. +func NewItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder) { + m := &ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/permissions/organizations/{org_id}", pathParameters), + } + return m +} +// NewItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder instantiates a new ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder and sets the default values. +func NewItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#disable-a-selected-organization-for-github-actions-in-an-enterprise +func (m *ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#enable-a-selected-organization-for-github-actions-in-an-enterprise +func (m *ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes an organization from the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsOrganizationsWithOrg_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) + return requestInfo, nil +} +// ToPutRequestInformation adds an organization to the list of selected organizations that are enabled for GitHub Actions in an enterprise. To use this endpoint, the enterprise permission policy for `enabled_organizations` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder when successful +func (m *ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder) { + return NewItemActionsPermissionsOrganizationsWithOrg_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_permissions_put_request_body.go b/pkg/github/enterprises/item_actions_permissions_put_request_body.go new file mode 100644 index 00000000..fb767cbd --- /dev/null +++ b/pkg/github/enterprises/item_actions_permissions_put_request_body.go @@ -0,0 +1,112 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsPermissionsPutRequestBody 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 permissions policy that controls the actions that are allowed to run. + allowed_actions *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions + // The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. + enabled_organizations *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnabledOrganizations +} +// NewItemActionsPermissionsPutRequestBody instantiates a new ItemActionsPermissionsPutRequestBody and sets the default values. +func NewItemActionsPermissionsPutRequestBody()(*ItemActionsPermissionsPutRequestBody) { + m := &ItemActionsPermissionsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsPermissionsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsPermissionsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsPermissionsPutRequestBody(), 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 *ItemActionsPermissionsPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedActions gets the allowed_actions property value. The permissions policy that controls the actions that are allowed to run. +// returns a *AllowedActions when successful +func (m *ItemActionsPermissionsPutRequestBody) GetAllowedActions()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions) { + return m.allowed_actions +} +// GetEnabledOrganizations gets the enabled_organizations property value. The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. +// returns a *EnabledOrganizations when successful +func (m *ItemActionsPermissionsPutRequestBody) GetEnabledOrganizations()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnabledOrganizations) { + return m.enabled_organizations +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsPermissionsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_actions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParseAllowedActions) + if err != nil { + return err + } + if val != nil { + m.SetAllowedActions(val.(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions)) + } + return nil + } + res["enabled_organizations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParseEnabledOrganizations) + if err != nil { + return err + } + if val != nil { + m.SetEnabledOrganizations(val.(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnabledOrganizations)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemActionsPermissionsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedActions() != nil { + cast := (*m.GetAllowedActions()).String() + err := writer.WriteStringValue("allowed_actions", &cast) + if err != nil { + return err + } + } + if m.GetEnabledOrganizations() != nil { + cast := (*m.GetEnabledOrganizations()).String() + err := writer.WriteStringValue("enabled_organizations", &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 *ItemActionsPermissionsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedActions sets the allowed_actions property value. The permissions policy that controls the actions that are allowed to run. +func (m *ItemActionsPermissionsPutRequestBody) SetAllowedActions(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions)() { + m.allowed_actions = value +} +// SetEnabledOrganizations sets the enabled_organizations property value. The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. +func (m *ItemActionsPermissionsPutRequestBody) SetEnabledOrganizations(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnabledOrganizations)() { + m.enabled_organizations = value +} +type ItemActionsPermissionsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedActions()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions) + GetEnabledOrganizations()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnabledOrganizations) + SetAllowedActions(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions)() + SetEnabledOrganizations(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnabledOrganizations)() +} diff --git a/pkg/github/enterprises/item_actions_permissions_request_builder.go b/pkg/github/enterprises/item_actions_permissions_request_builder.go new file mode 100644 index 00000000..e1dd290a --- /dev/null +++ b/pkg/github/enterprises/item_actions_permissions_request_builder.go @@ -0,0 +1,98 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsPermissionsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\permissions +type ItemActionsPermissionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsPermissionsRequestBuilderInternal instantiates a new ItemActionsPermissionsRequestBuilder and sets the default values. +func NewItemActionsPermissionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsRequestBuilder) { + m := &ItemActionsPermissionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/permissions", pathParameters), + } + return m +} +// NewItemActionsPermissionsRequestBuilder instantiates a new ItemActionsPermissionsRequestBuilder and sets the default values. +func NewItemActionsPermissionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a ActionsEnterprisePermissionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#get-github-actions-permissions-for-an-enterprise +func (m *ItemActionsPermissionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsEnterprisePermissionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsEnterprisePermissionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsEnterprisePermissionsable), nil +} +// Organizations the organizations property +// returns a *ItemActionsPermissionsOrganizationsRequestBuilder when successful +func (m *ItemActionsPermissionsRequestBuilder) Organizations()(*ItemActionsPermissionsOrganizationsRequestBuilder) { + return NewItemActionsPermissionsOrganizationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Put sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#set-github-actions-permissions-for-an-enterprise +func (m *ItemActionsPermissionsRequestBuilder) Put(ctx context.Context, body ItemActionsPermissionsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// SelectedActions the selectedActions property +// returns a *ItemActionsPermissionsSelectedActionsRequestBuilder when successful +func (m *ItemActionsPermissionsRequestBuilder) SelectedActions()(*ItemActionsPermissionsSelectedActionsRequestBuilder) { + return NewItemActionsPermissionsSelectedActionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsRequestBuilder) 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 +} +// ToPutRequestInformation sets the GitHub Actions permissions policy for organizations and allowed actions in an enterprise.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsPermissionsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsPermissionsRequestBuilder when successful +func (m *ItemActionsPermissionsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsRequestBuilder) { + return NewItemActionsPermissionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} +// Workflow the workflow property +// returns a *ItemActionsPermissionsWorkflowRequestBuilder when successful +func (m *ItemActionsPermissionsRequestBuilder) Workflow()(*ItemActionsPermissionsWorkflowRequestBuilder) { + return NewItemActionsPermissionsWorkflowRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/enterprises/item_actions_permissions_selected_actions_request_builder.go b/pkg/github/enterprises/item_actions_permissions_selected_actions_request_builder.go new file mode 100644 index 00000000..8f990a56 --- /dev/null +++ b/pkg/github/enterprises/item_actions_permissions_selected_actions_request_builder.go @@ -0,0 +1,83 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsPermissionsSelectedActionsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\permissions\selected-actions +type ItemActionsPermissionsSelectedActionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsPermissionsSelectedActionsRequestBuilderInternal instantiates a new ItemActionsPermissionsSelectedActionsRequestBuilder and sets the default values. +func NewItemActionsPermissionsSelectedActionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsSelectedActionsRequestBuilder) { + m := &ItemActionsPermissionsSelectedActionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/permissions/selected-actions", pathParameters), + } + return m +} +// NewItemActionsPermissionsSelectedActionsRequestBuilder instantiates a new ItemActionsPermissionsSelectedActionsRequestBuilder and sets the default values. +func NewItemActionsPermissionsSelectedActionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsSelectedActionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsSelectedActionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a SelectedActionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-enterprise +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SelectedActionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSelectedActionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SelectedActionsable), nil +} +// Put sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-enterprise +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) Put(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SelectedActionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets the selected actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) 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 +} +// ToPutRequestInformation sets the actions that are allowed in an enterprise. To use this endpoint, the enterprise permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an enterprise](#set-github-actions-permissions-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SelectedActionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsPermissionsSelectedActionsRequestBuilder when successful +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsSelectedActionsRequestBuilder) { + return NewItemActionsPermissionsSelectedActionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_permissions_workflow_request_builder.go b/pkg/github/enterprises/item_actions_permissions_workflow_request_builder.go new file mode 100644 index 00000000..8bacc88b --- /dev/null +++ b/pkg/github/enterprises/item_actions_permissions_workflow_request_builder.go @@ -0,0 +1,83 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsPermissionsWorkflowRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\permissions\workflow +type ItemActionsPermissionsWorkflowRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsPermissionsWorkflowRequestBuilderInternal instantiates a new ItemActionsPermissionsWorkflowRequestBuilder and sets the default values. +func NewItemActionsPermissionsWorkflowRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsWorkflowRequestBuilder) { + m := &ItemActionsPermissionsWorkflowRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/permissions/workflow", pathParameters), + } + return m +} +// NewItemActionsPermissionsWorkflowRequestBuilder instantiates a new ItemActionsPermissionsWorkflowRequestBuilder and sets the default values. +func NewItemActionsPermissionsWorkflowRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsWorkflowRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsWorkflowRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an enterprise,as well as whether GitHub Actions can submit approving pull request reviews. For more information, see"[Enforcing a policy for workflow permissions in your enterprise](https://docs.github.com/enterprise-server@3.14/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise#enforcing-a-policy-for-workflow-permissions-in-your-enterprise)."OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a ActionsGetDefaultWorkflowPermissionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#get-default-workflow-permissions-for-an-enterprise +func (m *ItemActionsPermissionsWorkflowRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsGetDefaultWorkflowPermissionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsGetDefaultWorkflowPermissionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsGetDefaultWorkflowPermissionsable), nil +} +// Put sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an enterprise, and setswhether GitHub Actions can submit approving pull request reviews. For more information, see"[Enforcing a policy for workflow permissions in your enterprise](https://docs.github.com/enterprise-server@3.14/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise#enforcing-a-policy-for-workflow-permissions-in-your-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#set-default-workflow-permissions-for-an-enterprise +func (m *ItemActionsPermissionsWorkflowRequestBuilder) Put(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSetDefaultWorkflowPermissionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an enterprise,as well as whether GitHub Actions can submit approving pull request reviews. For more information, see"[Enforcing a policy for workflow permissions in your enterprise](https://docs.github.com/enterprise-server@3.14/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise#enforcing-a-policy-for-workflow-permissions-in-your-enterprise)."OAuth tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsWorkflowRequestBuilder) 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 +} +// ToPutRequestInformation sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an enterprise, and setswhether GitHub Actions can submit approving pull request reviews. For more information, see"[Enforcing a policy for workflow permissions in your enterprise](https://docs.github.com/enterprise-server@3.14/admin/policies/enforcing-policies-for-your-enterprise/enforcing-policies-for-github-actions-in-your-enterprise#enforcing-a-policy-for-workflow-permissions-in-your-enterprise)."OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsWorkflowRequestBuilder) ToPutRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSetDefaultWorkflowPermissionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsPermissionsWorkflowRequestBuilder when successful +func (m *ItemActionsPermissionsWorkflowRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsWorkflowRequestBuilder) { + return NewItemActionsPermissionsWorkflowRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_request_builder.go b/pkg/github/enterprises/item_actions_request_builder.go new file mode 100644 index 00000000..dbe22102 --- /dev/null +++ b/pkg/github/enterprises/item_actions_request_builder.go @@ -0,0 +1,43 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions +type ItemActionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Cache the cache property +// returns a *ItemActionsCacheRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Cache()(*ItemActionsCacheRequestBuilder) { + return NewItemActionsCacheRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRequestBuilderInternal instantiates a new ItemActionsRequestBuilder and sets the default values. +func NewItemActionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRequestBuilder) { + m := &ItemActionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions", pathParameters), + } + return m +} +// NewItemActionsRequestBuilder instantiates a new ItemActionsRequestBuilder and sets the default values. +func NewItemActionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Permissions the permissions property +// returns a *ItemActionsPermissionsRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Permissions()(*ItemActionsPermissionsRequestBuilder) { + return NewItemActionsPermissionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// RunnerGroups the runnerGroups property +// returns a *ItemActionsRunnerGroupsRequestBuilder when successful +func (m *ItemActionsRequestBuilder) RunnerGroups()(*ItemActionsRunnerGroupsRequestBuilder) { + return NewItemActionsRunnerGroupsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Runners the runners property +// returns a *ItemActionsRunnersRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Runners()(*ItemActionsRunnersRequestBuilder) { + return NewItemActionsRunnersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/enterprises/item_actions_runner_groups_get_response.go b/pkg/github/enterprises/item_actions_runner_groups_get_response.go new file mode 100644 index 00000000..1f6bd354 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runner_groups_get_response.go @@ -0,0 +1,122 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnerGroupsGetResponse 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 runner_groups property + runner_groups []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsEnterpriseable + // The total_count property + total_count *float64 +} +// NewItemActionsRunnerGroupsGetResponse instantiates a new ItemActionsRunnerGroupsGetResponse and sets the default values. +func NewItemActionsRunnerGroupsGetResponse()(*ItemActionsRunnerGroupsGetResponse) { + m := &ItemActionsRunnerGroupsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnerGroupsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnerGroupsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnerGroupsGetResponse(), 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 *ItemActionsRunnerGroupsGetResponse) 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 *ItemActionsRunnerGroupsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["runner_groups"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerGroupsEnterpriseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsEnterpriseable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsEnterpriseable) + } + } + m.SetRunnerGroups(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRunnerGroups gets the runner_groups property value. The runner_groups property +// returns a []RunnerGroupsEnterpriseable when successful +func (m *ItemActionsRunnerGroupsGetResponse) GetRunnerGroups()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsEnterpriseable) { + return m.runner_groups +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *float64 when successful +func (m *ItemActionsRunnerGroupsGetResponse) GetTotalCount()(*float64) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnerGroupsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRunnerGroups() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRunnerGroups())) + for i, v := range m.GetRunnerGroups() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("runner_groups", cast) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("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 *ItemActionsRunnerGroupsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRunnerGroups sets the runner_groups property value. The runner_groups property +func (m *ItemActionsRunnerGroupsGetResponse) SetRunnerGroups(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsEnterpriseable)() { + m.runner_groups = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnerGroupsGetResponse) SetTotalCount(value *float64)() { + m.total_count = value +} +type ItemActionsRunnerGroupsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRunnerGroups()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsEnterpriseable) + GetTotalCount()(*float64) + SetRunnerGroups(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsEnterpriseable)() + SetTotalCount(value *float64)() +} diff --git a/pkg/github/enterprises/item_actions_runner_groups_item_organizations_get_response.go b/pkg/github/enterprises/item_actions_runner_groups_item_organizations_get_response.go new file mode 100644 index 00000000..6a50cb51 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runner_groups_item_organizations_get_response.go @@ -0,0 +1,122 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnerGroupsItemOrganizationsGetResponse 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 organizations property + organizations []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable + // The total_count property + total_count *float64 +} +// NewItemActionsRunnerGroupsItemOrganizationsGetResponse instantiates a new ItemActionsRunnerGroupsItemOrganizationsGetResponse and sets the default values. +func NewItemActionsRunnerGroupsItemOrganizationsGetResponse()(*ItemActionsRunnerGroupsItemOrganizationsGetResponse) { + m := &ItemActionsRunnerGroupsItemOrganizationsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnerGroupsItemOrganizationsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnerGroupsItemOrganizationsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnerGroupsItemOrganizationsGetResponse(), 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 *ItemActionsRunnerGroupsItemOrganizationsGetResponse) 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 *ItemActionsRunnerGroupsItemOrganizationsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["organizations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable) + } + } + m.SetOrganizations(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetOrganizations gets the organizations property value. The organizations property +// returns a []OrganizationSimpleable when successful +func (m *ItemActionsRunnerGroupsItemOrganizationsGetResponse) GetOrganizations()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable) { + return m.organizations +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *float64 when successful +func (m *ItemActionsRunnerGroupsItemOrganizationsGetResponse) GetTotalCount()(*float64) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnerGroupsItemOrganizationsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetOrganizations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetOrganizations())) + for i, v := range m.GetOrganizations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("organizations", cast) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("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 *ItemActionsRunnerGroupsItemOrganizationsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetOrganizations sets the organizations property value. The organizations property +func (m *ItemActionsRunnerGroupsItemOrganizationsGetResponse) SetOrganizations(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable)() { + m.organizations = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnerGroupsItemOrganizationsGetResponse) SetTotalCount(value *float64)() { + m.total_count = value +} +type ItemActionsRunnerGroupsItemOrganizationsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOrganizations()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable) + GetTotalCount()(*float64) + SetOrganizations(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable)() + SetTotalCount(value *float64)() +} diff --git a/pkg/github/enterprises/item_actions_runner_groups_item_organizations_put_request_body.go b/pkg/github/enterprises/item_actions_runner_groups_item_organizations_put_request_body.go new file mode 100644 index 00000000..1fee7a9f --- /dev/null +++ b/pkg/github/enterprises/item_actions_runner_groups_item_organizations_put_request_body.go @@ -0,0 +1,86 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnerGroupsItemOrganizationsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // List of organization IDs that can access the runner group. + selected_organization_ids []int32 +} +// NewItemActionsRunnerGroupsItemOrganizationsPutRequestBody instantiates a new ItemActionsRunnerGroupsItemOrganizationsPutRequestBody and sets the default values. +func NewItemActionsRunnerGroupsItemOrganizationsPutRequestBody()(*ItemActionsRunnerGroupsItemOrganizationsPutRequestBody) { + m := &ItemActionsRunnerGroupsItemOrganizationsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnerGroupsItemOrganizationsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnerGroupsItemOrganizationsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnerGroupsItemOrganizationsPutRequestBody(), 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 *ItemActionsRunnerGroupsItemOrganizationsPutRequestBody) 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 *ItemActionsRunnerGroupsItemOrganizationsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["selected_organization_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.SetSelectedOrganizationIds(res) + } + return nil + } + return res +} +// GetSelectedOrganizationIds gets the selected_organization_ids property value. List of organization IDs that can access the runner group. +// returns a []int32 when successful +func (m *ItemActionsRunnerGroupsItemOrganizationsPutRequestBody) GetSelectedOrganizationIds()([]int32) { + return m.selected_organization_ids +} +// Serialize serializes information the current object +func (m *ItemActionsRunnerGroupsItemOrganizationsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedOrganizationIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_organization_ids", m.GetSelectedOrganizationIds()) + 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 *ItemActionsRunnerGroupsItemOrganizationsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedOrganizationIds sets the selected_organization_ids property value. List of organization IDs that can access the runner group. +func (m *ItemActionsRunnerGroupsItemOrganizationsPutRequestBody) SetSelectedOrganizationIds(value []int32)() { + m.selected_organization_ids = value +} +type ItemActionsRunnerGroupsItemOrganizationsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedOrganizationIds()([]int32) + SetSelectedOrganizationIds(value []int32)() +} diff --git a/pkg/github/enterprises/item_actions_runner_groups_item_organizations_request_builder.go b/pkg/github/enterprises/item_actions_runner_groups_item_organizations_request_builder.go new file mode 100644 index 00000000..372fd5fe --- /dev/null +++ b/pkg/github/enterprises/item_actions_runner_groups_item_organizations_request_builder.go @@ -0,0 +1,100 @@ +package enterprises + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsRunnerGroupsItemOrganizationsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\runner-groups\{runner_group_id}\organizations +type ItemActionsRunnerGroupsItemOrganizationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsRunnerGroupsItemOrganizationsRequestBuilderGetQueryParameters lists the organizations with access to a self-hosted runner group.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +type ItemActionsRunnerGroupsItemOrganizationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByOrg_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.enterprises.item.actions.runnerGroups.item.organizations.item collection +// returns a *ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder when successful +func (m *ItemActionsRunnerGroupsItemOrganizationsRequestBuilder) ByOrg_id(org_id int32)(*ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["org_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(org_id), 10) + return NewItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRunnerGroupsItemOrganizationsRequestBuilderInternal instantiates a new ItemActionsRunnerGroupsItemOrganizationsRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemOrganizationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemOrganizationsRequestBuilder) { + m := &ItemActionsRunnerGroupsItemOrganizationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsRunnerGroupsItemOrganizationsRequestBuilder instantiates a new ItemActionsRunnerGroupsItemOrganizationsRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemOrganizationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemOrganizationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnerGroupsItemOrganizationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the organizations with access to a self-hosted runner group.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a ItemActionsRunnerGroupsItemOrganizationsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#list-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +func (m *ItemActionsRunnerGroupsItemOrganizationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnerGroupsItemOrganizationsRequestBuilderGetQueryParameters])(ItemActionsRunnerGroupsItemOrganizationsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnerGroupsItemOrganizationsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnerGroupsItemOrganizationsGetResponseable), nil +} +// Put replaces the list of organizations that have access to a self-hosted runner configured in an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#set-organization-access-for-a-self-hosted-runner-group-in-an-enterprise +func (m *ItemActionsRunnerGroupsItemOrganizationsRequestBuilder) Put(ctx context.Context, body ItemActionsRunnerGroupsItemOrganizationsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists the organizations with access to a self-hosted runner group.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemOrganizationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnerGroupsItemOrganizationsRequestBuilderGetQueryParameters])(*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 +} +// ToPutRequestInformation replaces the list of organizations that have access to a self-hosted runner configured in an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemOrganizationsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsRunnerGroupsItemOrganizationsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsRunnerGroupsItemOrganizationsRequestBuilder when successful +func (m *ItemActionsRunnerGroupsItemOrganizationsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnerGroupsItemOrganizationsRequestBuilder) { + return NewItemActionsRunnerGroupsItemOrganizationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_runner_groups_item_organizations_with_org_escaped_item_request_builder.go b/pkg/github/enterprises/item_actions_runner_groups_item_organizations_with_org_escaped_item_request_builder.go new file mode 100644 index 00000000..917e9087 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runner_groups_item_organizations_with_org_escaped_item_request_builder.go @@ -0,0 +1,73 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\runner-groups\{runner_group_id}\organizations\{org_id} +type ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilderInternal instantiates a new ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder) { + m := &ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/organizations/{org_id}", pathParameters), + } + return m +} +// NewItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder instantiates a new ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#remove-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +func (m *ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#add-organization-access-to-a-self-hosted-runner-group-in-an-enterprise +func (m *ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes an organization from the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemOrganizationsWithOrg_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) + return requestInfo, nil +} +// ToPutRequestInformation adds an organization to the list of selected organizations that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an enterprise](#create-a-self-hosted-runner-group-for-an-enterprise)."OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder when successful +func (m *ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder) { + return NewItemActionsRunnerGroupsItemOrganizationsWithOrg_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_runner_groups_item_runners_get_response.go b/pkg/github/enterprises/item_actions_runner_groups_item_runners_get_response.go new file mode 100644 index 00000000..6e4d235c --- /dev/null +++ b/pkg/github/enterprises/item_actions_runner_groups_item_runners_get_response.go @@ -0,0 +1,122 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnerGroupsItemRunnersGetResponse 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 runners property + runners []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable + // The total_count property + total_count *float64 +} +// NewItemActionsRunnerGroupsItemRunnersGetResponse instantiates a new ItemActionsRunnerGroupsItemRunnersGetResponse and sets the default values. +func NewItemActionsRunnerGroupsItemRunnersGetResponse()(*ItemActionsRunnerGroupsItemRunnersGetResponse) { + m := &ItemActionsRunnerGroupsItemRunnersGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnerGroupsItemRunnersGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnerGroupsItemRunnersGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnerGroupsItemRunnersGetResponse(), 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 *ItemActionsRunnerGroupsItemRunnersGetResponse) 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 *ItemActionsRunnerGroupsItemRunnersGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["runners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) + } + } + m.SetRunners(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRunners gets the runners property value. The runners property +// returns a []Runnerable when successful +func (m *ItemActionsRunnerGroupsItemRunnersGetResponse) GetRunners()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) { + return m.runners +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *float64 when successful +func (m *ItemActionsRunnerGroupsItemRunnersGetResponse) GetTotalCount()(*float64) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnerGroupsItemRunnersGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRunners() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRunners())) + for i, v := range m.GetRunners() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("runners", cast) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("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 *ItemActionsRunnerGroupsItemRunnersGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRunners sets the runners property value. The runners property +func (m *ItemActionsRunnerGroupsItemRunnersGetResponse) SetRunners(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() { + m.runners = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnerGroupsItemRunnersGetResponse) SetTotalCount(value *float64)() { + m.total_count = value +} +type ItemActionsRunnerGroupsItemRunnersGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRunners()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) + GetTotalCount()(*float64) + SetRunners(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() + SetTotalCount(value *float64)() +} diff --git a/pkg/github/enterprises/item_actions_runner_groups_item_runners_put_request_body.go b/pkg/github/enterprises/item_actions_runner_groups_item_runners_put_request_body.go new file mode 100644 index 00000000..c01da42a --- /dev/null +++ b/pkg/github/enterprises/item_actions_runner_groups_item_runners_put_request_body.go @@ -0,0 +1,86 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnerGroupsItemRunnersPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // List of runner IDs to add to the runner group. + runners []int32 +} +// NewItemActionsRunnerGroupsItemRunnersPutRequestBody instantiates a new ItemActionsRunnerGroupsItemRunnersPutRequestBody and sets the default values. +func NewItemActionsRunnerGroupsItemRunnersPutRequestBody()(*ItemActionsRunnerGroupsItemRunnersPutRequestBody) { + m := &ItemActionsRunnerGroupsItemRunnersPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnerGroupsItemRunnersPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnerGroupsItemRunnersPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnerGroupsItemRunnersPutRequestBody(), 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 *ItemActionsRunnerGroupsItemRunnersPutRequestBody) 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 *ItemActionsRunnerGroupsItemRunnersPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["runners"] = 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.SetRunners(res) + } + return nil + } + return res +} +// GetRunners gets the runners property value. List of runner IDs to add to the runner group. +// returns a []int32 when successful +func (m *ItemActionsRunnerGroupsItemRunnersPutRequestBody) GetRunners()([]int32) { + return m.runners +} +// Serialize serializes information the current object +func (m *ItemActionsRunnerGroupsItemRunnersPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRunners() != nil { + err := writer.WriteCollectionOfInt32Values("runners", m.GetRunners()) + 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 *ItemActionsRunnerGroupsItemRunnersPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRunners sets the runners property value. List of runner IDs to add to the runner group. +func (m *ItemActionsRunnerGroupsItemRunnersPutRequestBody) SetRunners(value []int32)() { + m.runners = value +} +type ItemActionsRunnerGroupsItemRunnersPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRunners()([]int32) + SetRunners(value []int32)() +} diff --git a/pkg/github/enterprises/item_actions_runner_groups_item_runners_request_builder.go b/pkg/github/enterprises/item_actions_runner_groups_item_runners_request_builder.go new file mode 100644 index 00000000..7513ada6 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runner_groups_item_runners_request_builder.go @@ -0,0 +1,100 @@ +package enterprises + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsRunnerGroupsItemRunnersRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\runner-groups\{runner_group_id}\runners +type ItemActionsRunnerGroupsItemRunnersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsRunnerGroupsItemRunnersRequestBuilderGetQueryParameters lists the self-hosted runners that are in a specific enterprise group.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +type ItemActionsRunnerGroupsItemRunnersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRunner_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.enterprises.item.actions.runnerGroups.item.runners.item collection +// returns a *ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder when successful +func (m *ItemActionsRunnerGroupsItemRunnersRequestBuilder) ByRunner_id(runner_id int32)(*ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["runner_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(runner_id), 10) + return NewItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRunnerGroupsItemRunnersRequestBuilderInternal instantiates a new ItemActionsRunnerGroupsItemRunnersRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemRunnersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemRunnersRequestBuilder) { + m := &ItemActionsRunnerGroupsItemRunnersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsRunnerGroupsItemRunnersRequestBuilder instantiates a new ItemActionsRunnerGroupsItemRunnersRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemRunnersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemRunnersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnerGroupsItemRunnersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the self-hosted runners that are in a specific enterprise group.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a ItemActionsRunnerGroupsItemRunnersGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-enterprise +func (m *ItemActionsRunnerGroupsItemRunnersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnerGroupsItemRunnersRequestBuilderGetQueryParameters])(ItemActionsRunnerGroupsItemRunnersGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnerGroupsItemRunnersGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnerGroupsItemRunnersGetResponseable), nil +} +// Put replaces the list of self-hosted runners that are part of an enterprise runner group.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-enterprise +func (m *ItemActionsRunnerGroupsItemRunnersRequestBuilder) Put(ctx context.Context, body ItemActionsRunnerGroupsItemRunnersPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists the self-hosted runners that are in a specific enterprise group.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemRunnersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnerGroupsItemRunnersRequestBuilderGetQueryParameters])(*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 +} +// ToPutRequestInformation replaces the list of self-hosted runners that are part of an enterprise runner group.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemRunnersRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsRunnerGroupsItemRunnersPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsRunnerGroupsItemRunnersRequestBuilder when successful +func (m *ItemActionsRunnerGroupsItemRunnersRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnerGroupsItemRunnersRequestBuilder) { + return NewItemActionsRunnerGroupsItemRunnersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_runner_groups_item_runners_with_runner_escaped_item_request_builder.go b/pkg/github/enterprises/item_actions_runner_groups_item_runners_with_runner_escaped_item_request_builder.go new file mode 100644 index 00000000..e2ddb0c1 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runner_groups_item_runners_with_runner_escaped_item_request_builder.go @@ -0,0 +1,73 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\runner-groups\{runner_group_id}\runners\{runner_id} +type ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilderInternal instantiates a new ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) { + m := &ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}/runners/{runner_id}", pathParameters), + } + return m +} +// NewItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder instantiates a new ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-enterprise +func (m *ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put adds a self-hosted runner to a runner group configured in an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-enterprise +func (m *ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a self-hosted runner from a group configured in an enterprise. The runner is then returned to the default group.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemRunnersWithRunner_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) + return requestInfo, nil +} +// ToPutRequestInformation adds a self-hosted runner to a runner group configured in an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder when successful +func (m *ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) { + return NewItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_runner_groups_item_with_runner_escaped_group_escaped_patch_request_body.go b/pkg/github/enterprises/item_actions_runner_groups_item_with_runner_escaped_group_escaped_patch_request_body.go new file mode 100644 index 00000000..4131e5d8 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runner_groups_item_with_runner_escaped_group_escaped_patch_request_body.go @@ -0,0 +1,173 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody 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 the runner group can be used by `public` repositories. + allows_public_repositories *bool + // Name of the runner group. + name *string + // If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + restricted_to_workflows *bool + // List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + selected_workflows []string +} +// NewItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody instantiates a new ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody and sets the default values. +func NewItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody()(*ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) { + m := &ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody(), 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 *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowsPublicRepositories gets the allows_public_repositories property value. Whether the runner group can be used by `public` repositories. +// returns a *bool when successful +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) GetAllowsPublicRepositories()(*bool) { + return m.allows_public_repositories +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allows_public_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowsPublicRepositories(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["restricted_to_workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRestrictedToWorkflows(val) + } + return nil + } + res["selected_workflows"] = 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.SetSelectedWorkflows(res) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the runner group. +// returns a *string when successful +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) GetName()(*string) { + return m.name +} +// GetRestrictedToWorkflows gets the restricted_to_workflows property value. If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. +// returns a *bool when successful +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) GetRestrictedToWorkflows()(*bool) { + return m.restricted_to_workflows +} +// GetSelectedWorkflows gets the selected_workflows property value. List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +// returns a []string when successful +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) GetSelectedWorkflows()([]string) { + return m.selected_workflows +} +// Serialize serializes information the current object +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allows_public_repositories", m.GetAllowsPublicRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("restricted_to_workflows", m.GetRestrictedToWorkflows()) + if err != nil { + return err + } + } + if m.GetSelectedWorkflows() != nil { + err := writer.WriteCollectionOfStringValues("selected_workflows", m.GetSelectedWorkflows()) + 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 *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowsPublicRepositories sets the allows_public_repositories property value. Whether the runner group can be used by `public` repositories. +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) SetAllowsPublicRepositories(value *bool)() { + m.allows_public_repositories = value +} +// SetName sets the name property value. Name of the runner group. +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetRestrictedToWorkflows sets the restricted_to_workflows property value. If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) SetRestrictedToWorkflows(value *bool)() { + m.restricted_to_workflows = value +} +// SetSelectedWorkflows sets the selected_workflows property value. List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) SetSelectedWorkflows(value []string)() { + m.selected_workflows = value +} +type ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowsPublicRepositories()(*bool) + GetName()(*string) + GetRestrictedToWorkflows()(*bool) + GetSelectedWorkflows()([]string) + SetAllowsPublicRepositories(value *bool)() + SetName(value *string)() + SetRestrictedToWorkflows(value *bool)() + SetSelectedWorkflows(value []string)() +} diff --git a/pkg/github/enterprises/item_actions_runner_groups_post_request_body.go b/pkg/github/enterprises/item_actions_runner_groups_post_request_body.go new file mode 100644 index 00000000..fa812a78 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runner_groups_post_request_body.go @@ -0,0 +1,243 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnerGroupsPostRequestBody 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 the runner group can be used by `public` repositories. + allows_public_repositories *bool + // Name of the runner group. + name *string + // If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + restricted_to_workflows *bool + // List of runner IDs to add to the runner group. + runners []int32 + // List of organization IDs that can access the runner group. + selected_organization_ids []int32 + // List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + selected_workflows []string +} +// NewItemActionsRunnerGroupsPostRequestBody instantiates a new ItemActionsRunnerGroupsPostRequestBody and sets the default values. +func NewItemActionsRunnerGroupsPostRequestBody()(*ItemActionsRunnerGroupsPostRequestBody) { + m := &ItemActionsRunnerGroupsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnerGroupsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnerGroupsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnerGroupsPostRequestBody(), 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 *ItemActionsRunnerGroupsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowsPublicRepositories gets the allows_public_repositories property value. Whether the runner group can be used by `public` repositories. +// returns a *bool when successful +func (m *ItemActionsRunnerGroupsPostRequestBody) GetAllowsPublicRepositories()(*bool) { + return m.allows_public_repositories +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnerGroupsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allows_public_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowsPublicRepositories(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["restricted_to_workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRestrictedToWorkflows(val) + } + return nil + } + res["runners"] = 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.SetRunners(res) + } + return nil + } + res["selected_organization_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.SetSelectedOrganizationIds(res) + } + return nil + } + res["selected_workflows"] = 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.SetSelectedWorkflows(res) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the runner group. +// returns a *string when successful +func (m *ItemActionsRunnerGroupsPostRequestBody) GetName()(*string) { + return m.name +} +// GetRestrictedToWorkflows gets the restricted_to_workflows property value. If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. +// returns a *bool when successful +func (m *ItemActionsRunnerGroupsPostRequestBody) GetRestrictedToWorkflows()(*bool) { + return m.restricted_to_workflows +} +// GetRunners gets the runners property value. List of runner IDs to add to the runner group. +// returns a []int32 when successful +func (m *ItemActionsRunnerGroupsPostRequestBody) GetRunners()([]int32) { + return m.runners +} +// GetSelectedOrganizationIds gets the selected_organization_ids property value. List of organization IDs that can access the runner group. +// returns a []int32 when successful +func (m *ItemActionsRunnerGroupsPostRequestBody) GetSelectedOrganizationIds()([]int32) { + return m.selected_organization_ids +} +// GetSelectedWorkflows gets the selected_workflows property value. List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +// returns a []string when successful +func (m *ItemActionsRunnerGroupsPostRequestBody) GetSelectedWorkflows()([]string) { + return m.selected_workflows +} +// Serialize serializes information the current object +func (m *ItemActionsRunnerGroupsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allows_public_repositories", m.GetAllowsPublicRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("restricted_to_workflows", m.GetRestrictedToWorkflows()) + if err != nil { + return err + } + } + if m.GetRunners() != nil { + err := writer.WriteCollectionOfInt32Values("runners", m.GetRunners()) + if err != nil { + return err + } + } + if m.GetSelectedOrganizationIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_organization_ids", m.GetSelectedOrganizationIds()) + if err != nil { + return err + } + } + if m.GetSelectedWorkflows() != nil { + err := writer.WriteCollectionOfStringValues("selected_workflows", m.GetSelectedWorkflows()) + 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 *ItemActionsRunnerGroupsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowsPublicRepositories sets the allows_public_repositories property value. Whether the runner group can be used by `public` repositories. +func (m *ItemActionsRunnerGroupsPostRequestBody) SetAllowsPublicRepositories(value *bool)() { + m.allows_public_repositories = value +} +// SetName sets the name property value. Name of the runner group. +func (m *ItemActionsRunnerGroupsPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetRestrictedToWorkflows sets the restricted_to_workflows property value. If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. +func (m *ItemActionsRunnerGroupsPostRequestBody) SetRestrictedToWorkflows(value *bool)() { + m.restricted_to_workflows = value +} +// SetRunners sets the runners property value. List of runner IDs to add to the runner group. +func (m *ItemActionsRunnerGroupsPostRequestBody) SetRunners(value []int32)() { + m.runners = value +} +// SetSelectedOrganizationIds sets the selected_organization_ids property value. List of organization IDs that can access the runner group. +func (m *ItemActionsRunnerGroupsPostRequestBody) SetSelectedOrganizationIds(value []int32)() { + m.selected_organization_ids = value +} +// SetSelectedWorkflows sets the selected_workflows property value. List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +func (m *ItemActionsRunnerGroupsPostRequestBody) SetSelectedWorkflows(value []string)() { + m.selected_workflows = value +} +type ItemActionsRunnerGroupsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowsPublicRepositories()(*bool) + GetName()(*string) + GetRestrictedToWorkflows()(*bool) + GetRunners()([]int32) + GetSelectedOrganizationIds()([]int32) + GetSelectedWorkflows()([]string) + SetAllowsPublicRepositories(value *bool)() + SetName(value *string)() + SetRestrictedToWorkflows(value *bool)() + SetRunners(value []int32)() + SetSelectedOrganizationIds(value []int32)() + SetSelectedWorkflows(value []string)() +} diff --git a/pkg/github/enterprises/item_actions_runner_groups_request_builder.go b/pkg/github/enterprises/item_actions_runner_groups_request_builder.go new file mode 100644 index 00000000..63d68ace --- /dev/null +++ b/pkg/github/enterprises/item_actions_runner_groups_request_builder.go @@ -0,0 +1,108 @@ +package enterprises + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnerGroupsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\runner-groups +type ItemActionsRunnerGroupsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsRunnerGroupsRequestBuilderGetQueryParameters lists all self-hosted runner groups for an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +type ItemActionsRunnerGroupsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only return runner groups that are allowed to be used by this organization. + Visible_to_organization *string `uriparametername:"visible_to_organization"` +} +// ByRunner_group_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.enterprises.item.actions.runnerGroups.item collection +// returns a *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder when successful +func (m *ItemActionsRunnerGroupsRequestBuilder) ByRunner_group_id(runner_group_id int32)(*ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["runner_group_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(runner_group_id), 10) + return NewItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRunnerGroupsRequestBuilderInternal instantiates a new ItemActionsRunnerGroupsRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsRequestBuilder) { + m := &ItemActionsRunnerGroupsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/runner-groups{?page*,per_page*,visible_to_organization*}", pathParameters), + } + return m +} +// NewItemActionsRunnerGroupsRequestBuilder instantiates a new ItemActionsRunnerGroupsRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnerGroupsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all self-hosted runner groups for an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a ItemActionsRunnerGroupsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-enterprise +func (m *ItemActionsRunnerGroupsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnerGroupsRequestBuilderGetQueryParameters])(ItemActionsRunnerGroupsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnerGroupsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnerGroupsGetResponseable), nil +} +// Post creates a new self-hosted runner group for an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a RunnerGroupsEnterpriseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-enterprise +func (m *ItemActionsRunnerGroupsRequestBuilder) Post(ctx context.Context, body ItemActionsRunnerGroupsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsEnterpriseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerGroupsEnterpriseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsEnterpriseable), nil +} +// ToGetRequestInformation lists all self-hosted runner groups for an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnerGroupsRequestBuilderGetQueryParameters])(*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 new self-hosted runner group for an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemActionsRunnerGroupsPostRequestBodyable, 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 *ItemActionsRunnerGroupsRequestBuilder when successful +func (m *ItemActionsRunnerGroupsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnerGroupsRequestBuilder) { + return NewItemActionsRunnerGroupsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_runner_groups_with_runner_escaped_group_escaped_item_request_builder.go b/pkg/github/enterprises/item_actions_runner_groups_with_runner_escaped_group_escaped_item_request_builder.go new file mode 100644 index 00000000..71e1e046 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runner_groups_with_runner_escaped_group_escaped_item_request_builder.go @@ -0,0 +1,120 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\runner-groups\{runner_group_id} +type ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilderInternal instantiates a new ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) { + m := &ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/runner-groups/{runner_group_id}", pathParameters), + } + return m +} +// NewItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder instantiates a new ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a self-hosted runner group for an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-enterprise +func (m *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific self-hosted runner group for an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a RunnerGroupsEnterpriseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-enterprise +func (m *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsEnterpriseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerGroupsEnterpriseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsEnterpriseable), nil +} +// Organizations the organizations property +// returns a *ItemActionsRunnerGroupsItemOrganizationsRequestBuilder when successful +func (m *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) Organizations()(*ItemActionsRunnerGroupsItemOrganizationsRequestBuilder) { + return NewItemActionsRunnerGroupsItemOrganizationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch updates the `name` and `visibility` of a self-hosted runner group in an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a RunnerGroupsEnterpriseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-enterprise +func (m *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) Patch(ctx context.Context, body ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsEnterpriseable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerGroupsEnterpriseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsEnterpriseable), nil +} +// Runners the runners property +// returns a *ItemActionsRunnerGroupsItemRunnersRequestBuilder when successful +func (m *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) Runners()(*ItemActionsRunnerGroupsItemRunnersRequestBuilder) { + return NewItemActionsRunnerGroupsItemRunnersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a self-hosted runner group for an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsWithRunner_group_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific self-hosted runner group for an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsWithRunner_group_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 the `name` and `visibility` of a self-hosted runner group in an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemActionsRunnerGroupsItemWithRunner_group_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 *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder when successful +func (m *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) { + return NewItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_runners_downloads_request_builder.go b/pkg/github/enterprises/item_actions_runners_downloads_request_builder.go new file mode 100644 index 00000000..2aee42ee --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_downloads_request_builder.go @@ -0,0 +1,60 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnersDownloadsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\runners\downloads +type ItemActionsRunnersDownloadsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersDownloadsRequestBuilderInternal instantiates a new ItemActionsRunnersDownloadsRequestBuilder and sets the default values. +func NewItemActionsRunnersDownloadsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersDownloadsRequestBuilder) { + m := &ItemActionsRunnersDownloadsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/runners/downloads", pathParameters), + } + return m +} +// NewItemActionsRunnersDownloadsRequestBuilder instantiates a new ItemActionsRunnersDownloadsRequestBuilder and sets the default values. +func NewItemActionsRunnersDownloadsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersDownloadsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersDownloadsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists binaries for the runner application that you can download and run.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a []RunnerApplicationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#list-runner-applications-for-an-enterprise +func (m *ItemActionsRunnersDownloadsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerApplicationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerApplicationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerApplicationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerApplicationable) + } + } + return val, nil +} +// ToGetRequestInformation lists binaries for the runner application that you can download and run.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersDownloadsRequestBuilder) 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 *ItemActionsRunnersDownloadsRequestBuilder when successful +func (m *ItemActionsRunnersDownloadsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersDownloadsRequestBuilder) { + return NewItemActionsRunnersDownloadsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_runners_generate_jitconfig_post_request_body.go b/pkg/github/enterprises/item_actions_runners_generate_jitconfig_post_request_body.go new file mode 100644 index 00000000..35dadf74 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_generate_jitconfig_post_request_body.go @@ -0,0 +1,175 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnersGenerateJitconfigPostRequestBody 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 names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. + labels []string + // The name of the new runner. + name *string + // The ID of the runner group to register the runner to. + runner_group_id *int32 + // The working directory to be used for job execution, relative to the runner install directory. + work_folder *string +} +// NewItemActionsRunnersGenerateJitconfigPostRequestBody instantiates a new ItemActionsRunnersGenerateJitconfigPostRequestBody and sets the default values. +func NewItemActionsRunnersGenerateJitconfigPostRequestBody()(*ItemActionsRunnersGenerateJitconfigPostRequestBody) { + m := &ItemActionsRunnersGenerateJitconfigPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + work_folderValue := "_work" + m.SetWorkFolder(&work_folderValue) + return m +} +// CreateItemActionsRunnersGenerateJitconfigPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersGenerateJitconfigPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersGenerateJitconfigPostRequestBody(), 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 *ItemActionsRunnersGenerateJitconfigPostRequestBody) 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 *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = 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.SetLabels(res) + } + 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["runner_group_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunnerGroupId(val) + } + return nil + } + res["work_folder"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkFolder(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. +// returns a []string when successful +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetLabels()([]string) { + return m.labels +} +// GetName gets the name property value. The name of the new runner. +// returns a *string when successful +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetName()(*string) { + return m.name +} +// GetRunnerGroupId gets the runner_group_id property value. The ID of the runner group to register the runner to. +// returns a *int32 when successful +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetRunnerGroupId()(*int32) { + return m.runner_group_id +} +// GetWorkFolder gets the work_folder property value. The working directory to be used for job execution, relative to the runner install directory. +// returns a *string when successful +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetWorkFolder()(*string) { + return m.work_folder +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("runner_group_id", m.GetRunnerGroupId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("work_folder", m.GetWorkFolder()) + 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 *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetLabels(value []string)() { + m.labels = value +} +// SetName sets the name property value. The name of the new runner. +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetRunnerGroupId sets the runner_group_id property value. The ID of the runner group to register the runner to. +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetRunnerGroupId(value *int32)() { + m.runner_group_id = value +} +// SetWorkFolder sets the work_folder property value. The working directory to be used for job execution, relative to the runner install directory. +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetWorkFolder(value *string)() { + m.work_folder = value +} +type ItemActionsRunnersGenerateJitconfigPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + GetName()(*string) + GetRunnerGroupId()(*int32) + GetWorkFolder()(*string) + SetLabels(value []string)() + SetName(value *string)() + SetRunnerGroupId(value *int32)() + SetWorkFolder(value *string)() +} diff --git a/pkg/github/enterprises/item_actions_runners_generate_jitconfig_post_response.go b/pkg/github/enterprises/item_actions_runners_generate_jitconfig_post_response.go new file mode 100644 index 00000000..e1fcec37 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_generate_jitconfig_post_response.go @@ -0,0 +1,110 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnersGenerateJitconfigPostResponse 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 runner configuration. + encoded_jit_config *string + // A self hosted runner + runner ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable +} +// NewItemActionsRunnersGenerateJitconfigPostResponse instantiates a new ItemActionsRunnersGenerateJitconfigPostResponse and sets the default values. +func NewItemActionsRunnersGenerateJitconfigPostResponse()(*ItemActionsRunnersGenerateJitconfigPostResponse) { + m := &ItemActionsRunnersGenerateJitconfigPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersGenerateJitconfigPostResponse(), 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 *ItemActionsRunnersGenerateJitconfigPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncodedJitConfig gets the encoded_jit_config property value. The base64 encoded runner configuration. +// returns a *string when successful +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) GetEncodedJitConfig()(*string) { + return m.encoded_jit_config +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encoded_jit_config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncodedJitConfig(val) + } + return nil + } + res["runner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRunner(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)) + } + return nil + } + return res +} +// GetRunner gets the runner property value. A self hosted runner +// returns a Runnerable when successful +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) GetRunner()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) { + return m.runner +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encoded_jit_config", m.GetEncodedJitConfig()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("runner", m.GetRunner()) + 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 *ItemActionsRunnersGenerateJitconfigPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncodedJitConfig sets the encoded_jit_config property value. The base64 encoded runner configuration. +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) SetEncodedJitConfig(value *string)() { + m.encoded_jit_config = value +} +// SetRunner sets the runner property value. A self hosted runner +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) SetRunner(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() { + m.runner = value +} +type ItemActionsRunnersGenerateJitconfigPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncodedJitConfig()(*string) + GetRunner()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) + SetEncodedJitConfig(value *string)() + SetRunner(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() +} diff --git a/pkg/github/enterprises/item_actions_runners_generate_jitconfig_request_builder.go b/pkg/github/enterprises/item_actions_runners_generate_jitconfig_request_builder.go new file mode 100644 index 00000000..ebd9dba9 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_generate_jitconfig_request_builder.go @@ -0,0 +1,67 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnersGenerateJitconfigRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\runners\generate-jitconfig +type ItemActionsRunnersGenerateJitconfigRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersGenerateJitconfigRequestBuilderInternal instantiates a new ItemActionsRunnersGenerateJitconfigRequestBuilder and sets the default values. +func NewItemActionsRunnersGenerateJitconfigRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersGenerateJitconfigRequestBuilder) { + m := &ItemActionsRunnersGenerateJitconfigRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/runners/generate-jitconfig", pathParameters), + } + return m +} +// NewItemActionsRunnersGenerateJitconfigRequestBuilder instantiates a new ItemActionsRunnersGenerateJitconfigRequestBuilder and sets the default values. +func NewItemActionsRunnersGenerateJitconfigRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersGenerateJitconfigRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersGenerateJitconfigRequestBuilderInternal(urlParams, requestAdapter) +} +// Post generates a configuration that can be passed to the runner application at startup.OAuth tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a ItemActionsRunnersGenerateJitconfigPostResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-enterprise +func (m *ItemActionsRunnersGenerateJitconfigRequestBuilder) Post(ctx context.Context, body ItemActionsRunnersGenerateJitconfigPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersGenerateJitconfigPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersGenerateJitconfigPostResponseable), nil +} +// ToPostRequestInformation generates a configuration that can be passed to the runner application at startup.OAuth tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersGenerateJitconfigRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemActionsRunnersGenerateJitconfigPostRequestBodyable, 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 *ItemActionsRunnersGenerateJitconfigRequestBuilder when successful +func (m *ItemActionsRunnersGenerateJitconfigRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersGenerateJitconfigRequestBuilder) { + return NewItemActionsRunnersGenerateJitconfigRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_runners_get_response.go b/pkg/github/enterprises/item_actions_runners_get_response.go new file mode 100644 index 00000000..58ba480c --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_get_response.go @@ -0,0 +1,122 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnersGetResponse 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 runners property + runners []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable + // The total_count property + total_count *float64 +} +// NewItemActionsRunnersGetResponse instantiates a new ItemActionsRunnersGetResponse and sets the default values. +func NewItemActionsRunnersGetResponse()(*ItemActionsRunnersGetResponse) { + m := &ItemActionsRunnersGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersGetResponse(), 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 *ItemActionsRunnersGetResponse) 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 *ItemActionsRunnersGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["runners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) + } + } + m.SetRunners(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRunners gets the runners property value. The runners property +// returns a []Runnerable when successful +func (m *ItemActionsRunnersGetResponse) GetRunners()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) { + return m.runners +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *float64 when successful +func (m *ItemActionsRunnersGetResponse) GetTotalCount()(*float64) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRunners() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRunners())) + for i, v := range m.GetRunners() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("runners", cast) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("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 *ItemActionsRunnersGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRunners sets the runners property value. The runners property +func (m *ItemActionsRunnersGetResponse) SetRunners(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() { + m.runners = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersGetResponse) SetTotalCount(value *float64)() { + m.total_count = value +} +type ItemActionsRunnersGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRunners()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) + GetTotalCount()(*float64) + SetRunners(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() + SetTotalCount(value *float64)() +} diff --git a/pkg/github/enterprises/item_actions_runners_item_labels_delete_response.go b/pkg/github/enterprises/item_actions_runners_item_labels_delete_response.go new file mode 100644 index 00000000..ce76f530 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_item_labels_delete_response.go @@ -0,0 +1,122 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsDeleteResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsDeleteResponse instantiates a new ItemActionsRunnersItemLabelsDeleteResponse and sets the default values. +func NewItemActionsRunnersItemLabelsDeleteResponse()(*ItemActionsRunnersItemLabelsDeleteResponse) { + m := &ItemActionsRunnersItemLabelsDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsDeleteResponse(), 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 *ItemActionsRunnersItemLabelsDeleteResponse) 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 *ItemActionsRunnersItemLabelsDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsDeleteResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsDeleteResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemActionsRunnersItemLabelsDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsDeleteResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsDeleteResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/enterprises/item_actions_runners_item_labels_get_response.go b/pkg/github/enterprises/item_actions_runners_item_labels_get_response.go new file mode 100644 index 00000000..21f0ff82 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_item_labels_get_response.go @@ -0,0 +1,122 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsGetResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsGetResponse instantiates a new ItemActionsRunnersItemLabelsGetResponse and sets the default values. +func NewItemActionsRunnersItemLabelsGetResponse()(*ItemActionsRunnersItemLabelsGetResponse) { + m := &ItemActionsRunnersItemLabelsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsGetResponse(), 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 *ItemActionsRunnersItemLabelsGetResponse) 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 *ItemActionsRunnersItemLabelsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsGetResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemActionsRunnersItemLabelsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsGetResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/enterprises/item_actions_runners_item_labels_item_with_name_delete_response.go b/pkg/github/enterprises/item_actions_runners_item_labels_item_with_name_delete_response.go new file mode 100644 index 00000000..90e6d356 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_item_labels_item_with_name_delete_response.go @@ -0,0 +1,122 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsItemWithNameDeleteResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsItemWithNameDeleteResponse instantiates a new ItemActionsRunnersItemLabelsItemWithNameDeleteResponse and sets the default values. +func NewItemActionsRunnersItemLabelsItemWithNameDeleteResponse()(*ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) { + m := &ItemActionsRunnersItemLabelsItemWithNameDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsItemWithNameDeleteResponse(), 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 *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) 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 *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsItemWithNameDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/enterprises/item_actions_runners_item_labels_post_request_body.go b/pkg/github/enterprises/item_actions_runners_item_labels_post_request_body.go new file mode 100644 index 00000000..8246fdd6 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_item_labels_post_request_body.go @@ -0,0 +1,86 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnersItemLabelsPostRequestBody 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 names of the custom labels to add to the runner. + labels []string +} +// NewItemActionsRunnersItemLabelsPostRequestBody instantiates a new ItemActionsRunnersItemLabelsPostRequestBody and sets the default values. +func NewItemActionsRunnersItemLabelsPostRequestBody()(*ItemActionsRunnersItemLabelsPostRequestBody) { + m := &ItemActionsRunnersItemLabelsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsPostRequestBody(), 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 *ItemActionsRunnersItemLabelsPostRequestBody) 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 *ItemActionsRunnersItemLabelsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = 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.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to add to the runner. +// returns a []string when successful +func (m *ItemActionsRunnersItemLabelsPostRequestBody) GetLabels()([]string) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + 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 *ItemActionsRunnersItemLabelsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to add to the runner. +func (m *ItemActionsRunnersItemLabelsPostRequestBody) SetLabels(value []string)() { + m.labels = value +} +type ItemActionsRunnersItemLabelsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + SetLabels(value []string)() +} diff --git a/pkg/github/enterprises/item_actions_runners_item_labels_post_response.go b/pkg/github/enterprises/item_actions_runners_item_labels_post_response.go new file mode 100644 index 00000000..9c5b2410 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_item_labels_post_response.go @@ -0,0 +1,122 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsPostResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsPostResponse instantiates a new ItemActionsRunnersItemLabelsPostResponse and sets the default values. +func NewItemActionsRunnersItemLabelsPostResponse()(*ItemActionsRunnersItemLabelsPostResponse) { + m := &ItemActionsRunnersItemLabelsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsPostResponse(), 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 *ItemActionsRunnersItemLabelsPostResponse) 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 *ItemActionsRunnersItemLabelsPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsPostResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsPostResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemActionsRunnersItemLabelsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsPostResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsPostResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/enterprises/item_actions_runners_item_labels_put_request_body.go b/pkg/github/enterprises/item_actions_runners_item_labels_put_request_body.go new file mode 100644 index 00000000..75363271 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_item_labels_put_request_body.go @@ -0,0 +1,86 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnersItemLabelsPutRequestBody 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 names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. + labels []string +} +// NewItemActionsRunnersItemLabelsPutRequestBody instantiates a new ItemActionsRunnersItemLabelsPutRequestBody and sets the default values. +func NewItemActionsRunnersItemLabelsPutRequestBody()(*ItemActionsRunnersItemLabelsPutRequestBody) { + m := &ItemActionsRunnersItemLabelsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsPutRequestBody(), 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 *ItemActionsRunnersItemLabelsPutRequestBody) 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 *ItemActionsRunnersItemLabelsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = 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.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. +// returns a []string when successful +func (m *ItemActionsRunnersItemLabelsPutRequestBody) GetLabels()([]string) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + 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 *ItemActionsRunnersItemLabelsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. +func (m *ItemActionsRunnersItemLabelsPutRequestBody) SetLabels(value []string)() { + m.labels = value +} +type ItemActionsRunnersItemLabelsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + SetLabels(value []string)() +} diff --git a/pkg/github/enterprises/item_actions_runners_item_labels_put_response.go b/pkg/github/enterprises/item_actions_runners_item_labels_put_response.go new file mode 100644 index 00000000..bb941ae9 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_item_labels_put_response.go @@ -0,0 +1,122 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsPutResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsPutResponse instantiates a new ItemActionsRunnersItemLabelsPutResponse and sets the default values. +func NewItemActionsRunnersItemLabelsPutResponse()(*ItemActionsRunnersItemLabelsPutResponse) { + m := &ItemActionsRunnersItemLabelsPutResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsPutResponse(), 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 *ItemActionsRunnersItemLabelsPutResponse) 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 *ItemActionsRunnersItemLabelsPutResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsPutResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsPutResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsPutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemActionsRunnersItemLabelsPutResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsPutResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsPutResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsPutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/enterprises/item_actions_runners_item_labels_request_builder.go b/pkg/github/enterprises/item_actions_runners_item_labels_request_builder.go new file mode 100644 index 00000000..09d87bc0 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_item_labels_request_builder.go @@ -0,0 +1,180 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnersItemLabelsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\runners\{runner_id}\labels +type ItemActionsRunnersItemLabelsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByName gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.enterprises.item.actions.runners.item.labels.item collection +// returns a *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) ByName(name string)(*ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRunnersItemLabelsRequestBuilderInternal instantiates a new ItemActionsRunnersItemLabelsRequestBuilder and sets the default values. +func NewItemActionsRunnersItemLabelsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersItemLabelsRequestBuilder) { + m := &ItemActionsRunnersItemLabelsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/runners/{runner_id}/labels", pathParameters), + } + return m +} +// NewItemActionsRunnersItemLabelsRequestBuilder instantiates a new ItemActionsRunnersItemLabelsRequestBuilder and sets the default values. +func NewItemActionsRunnersItemLabelsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersItemLabelsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersItemLabelsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete remove all custom labels from a self-hosted runner configured in anenterprise. Returns the remaining read-only labels from the runner.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a ItemActionsRunnersItemLabelsDeleteResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-enterprise +func (m *ItemActionsRunnersItemLabelsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsDeleteResponseable), nil +} +// Get lists all labels for a self-hosted runner configured in an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a ItemActionsRunnersItemLabelsGetResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-enterprise +func (m *ItemActionsRunnersItemLabelsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsGetResponseable), nil +} +// Post add custom labels to a self-hosted runner configured in an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a ItemActionsRunnersItemLabelsPostResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-enterprise +func (m *ItemActionsRunnersItemLabelsRequestBuilder) Post(ctx context.Context, body ItemActionsRunnersItemLabelsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsPostResponseable), nil +} +// Put remove all previous custom labels and set the new custom labels for a specificself-hosted runner configured in an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a ItemActionsRunnersItemLabelsPutResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-enterprise +func (m *ItemActionsRunnersItemLabelsRequestBuilder) Put(ctx context.Context, body ItemActionsRunnersItemLabelsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsPutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsPutResponseable), nil +} +// ToDeleteRequestInformation remove all custom labels from a self-hosted runner configured in anenterprise. Returns the remaining read-only labels from the runner.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation lists all labels for a self-hosted runner configured in an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) 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 add custom labels to a self-hosted runner configured in an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemActionsRunnersItemLabelsPostRequestBodyable, 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 +} +// ToPutRequestInformation remove all previous custom labels and set the new custom labels for a specificself-hosted runner configured in an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsRunnersItemLabelsPutRequestBodyable, 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 *ItemActionsRunnersItemLabelsRequestBuilder when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersItemLabelsRequestBuilder) { + return NewItemActionsRunnersItemLabelsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_runners_item_labels_with_name_item_request_builder.go b/pkg/github/enterprises/item_actions_runners_item_labels_with_name_item_request_builder.go new file mode 100644 index 00000000..b15ac1fd --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_item_labels_with_name_item_request_builder.go @@ -0,0 +1,63 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnersItemLabelsWithNameItemRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\runners\{runner_id}\labels\{name} +type ItemActionsRunnersItemLabelsWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal instantiates a new ItemActionsRunnersItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + m := &ItemActionsRunnersItemLabelsWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/runners/{runner_id}/labels/{name}", pathParameters), + } + return m +} +// NewItemActionsRunnersItemLabelsWithNameItemRequestBuilder instantiates a new ItemActionsRunnersItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemActionsRunnersItemLabelsWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete remove a custom label from a self-hosted runner configuredin an enterprise. Returns the remaining labels from the runner.This endpoint returns a `404 Not Found` status if the custom label is notpresent on the runner.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a ItemActionsRunnersItemLabelsItemWithNameDeleteResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-enterprise +func (m *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsItemWithNameDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsItemWithNameDeleteResponseable), nil +} +// ToDeleteRequestInformation remove a custom label from a self-hosted runner configuredin an enterprise. Returns the remaining labels from the runner.This endpoint returns a `404 Not Found` status if the custom label is notpresent on the runner.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) 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") + 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 *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + return NewItemActionsRunnersItemLabelsWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_runners_registration_token_request_builder.go b/pkg/github/enterprises/item_actions_runners_registration_token_request_builder.go new file mode 100644 index 00000000..ffb33a95 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_registration_token_request_builder.go @@ -0,0 +1,57 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnersRegistrationTokenRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\runners\registration-token +type ItemActionsRunnersRegistrationTokenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersRegistrationTokenRequestBuilderInternal instantiates a new ItemActionsRunnersRegistrationTokenRequestBuilder and sets the default values. +func NewItemActionsRunnersRegistrationTokenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRegistrationTokenRequestBuilder) { + m := &ItemActionsRunnersRegistrationTokenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/runners/registration-token", pathParameters), + } + return m +} +// NewItemActionsRunnersRegistrationTokenRequestBuilder instantiates a new ItemActionsRunnersRegistrationTokenRequestBuilder and sets the default values. +func NewItemActionsRunnersRegistrationTokenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRegistrationTokenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersRegistrationTokenRequestBuilderInternal(urlParams, requestAdapter) +} +// Post returns a token that you can pass to the `config` script. The token expires after one hour.Example using registration token:Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.```./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN```OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a AuthenticationTokenable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#create-a-registration-token-for-an-enterprise +func (m *ItemActionsRunnersRegistrationTokenRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuthenticationTokenable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthenticationTokenFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuthenticationTokenable), nil +} +// ToPostRequestInformation returns a token that you can pass to the `config` script. The token expires after one hour.Example using registration token:Configure your self-hosted runner, replacing `TOKEN` with the registration token provided by this endpoint.```./config.sh --url https://github.com/enterprises/octo-enterprise --token TOKEN```OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersRegistrationTokenRequestBuilder) 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 *ItemActionsRunnersRegistrationTokenRequestBuilder when successful +func (m *ItemActionsRunnersRegistrationTokenRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersRegistrationTokenRequestBuilder) { + return NewItemActionsRunnersRegistrationTokenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_runners_remove_token_request_builder.go b/pkg/github/enterprises/item_actions_runners_remove_token_request_builder.go new file mode 100644 index 00000000..45dca18e --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_remove_token_request_builder.go @@ -0,0 +1,57 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnersRemoveTokenRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\runners\remove-token +type ItemActionsRunnersRemoveTokenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersRemoveTokenRequestBuilderInternal instantiates a new ItemActionsRunnersRemoveTokenRequestBuilder and sets the default values. +func NewItemActionsRunnersRemoveTokenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRemoveTokenRequestBuilder) { + m := &ItemActionsRunnersRemoveTokenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/runners/remove-token", pathParameters), + } + return m +} +// NewItemActionsRunnersRemoveTokenRequestBuilder instantiates a new ItemActionsRunnersRemoveTokenRequestBuilder and sets the default values. +func NewItemActionsRunnersRemoveTokenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRemoveTokenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersRemoveTokenRequestBuilderInternal(urlParams, requestAdapter) +} +// Post returns a token that you can pass to the `config` script to remove a self-hosted runner from an enterprise. The token expires after one hour.Example using remove token:To remove your self-hosted runner from an enterprise, replace `TOKEN` with the remove token provided by thisendpoint.```./config.sh remove --token TOKEN```OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a AuthenticationTokenable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#create-a-remove-token-for-an-enterprise +func (m *ItemActionsRunnersRemoveTokenRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuthenticationTokenable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthenticationTokenFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuthenticationTokenable), nil +} +// ToPostRequestInformation returns a token that you can pass to the `config` script to remove a self-hosted runner from an enterprise. The token expires after one hour.Example using remove token:To remove your self-hosted runner from an enterprise, replace `TOKEN` with the remove token provided by thisendpoint.```./config.sh remove --token TOKEN```OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersRemoveTokenRequestBuilder) 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 *ItemActionsRunnersRemoveTokenRequestBuilder when successful +func (m *ItemActionsRunnersRemoveTokenRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersRemoveTokenRequestBuilder) { + return NewItemActionsRunnersRemoveTokenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_runners_request_builder.go b/pkg/github/enterprises/item_actions_runners_request_builder.go new file mode 100644 index 00000000..46dca8a2 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_request_builder.go @@ -0,0 +1,96 @@ +package enterprises + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsRunnersRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\runners +type ItemActionsRunnersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsRunnersRequestBuilderGetQueryParameters lists all self-hosted runners configured for an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +type ItemActionsRunnersRequestBuilderGetQueryParameters struct { + // The name of a self-hosted runner. + Name *string `uriparametername:"name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRunner_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.enterprises.item.actions.runners.item collection +// returns a *ItemActionsRunnersWithRunner_ItemRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) ByRunner_id(runner_id int32)(*ItemActionsRunnersWithRunner_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["runner_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(runner_id), 10) + return NewItemActionsRunnersWithRunner_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRunnersRequestBuilderInternal instantiates a new ItemActionsRunnersRequestBuilder and sets the default values. +func NewItemActionsRunnersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRequestBuilder) { + m := &ItemActionsRunnersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/runners{?name*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsRunnersRequestBuilder instantiates a new ItemActionsRunnersRequestBuilder and sets the default values. +func NewItemActionsRunnersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersRequestBuilderInternal(urlParams, requestAdapter) +} +// Downloads the downloads property +// returns a *ItemActionsRunnersDownloadsRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) Downloads()(*ItemActionsRunnersDownloadsRequestBuilder) { + return NewItemActionsRunnersDownloadsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// GenerateJitconfig the generateJitconfig property +// returns a *ItemActionsRunnersGenerateJitconfigRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) GenerateJitconfig()(*ItemActionsRunnersGenerateJitconfigRequestBuilder) { + return NewItemActionsRunnersGenerateJitconfigRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get lists all self-hosted runners configured for an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a ItemActionsRunnersGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-enterprise +func (m *ItemActionsRunnersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnersRequestBuilderGetQueryParameters])(ItemActionsRunnersGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersGetResponseable), nil +} +// RegistrationToken the registrationToken property +// returns a *ItemActionsRunnersRegistrationTokenRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) RegistrationToken()(*ItemActionsRunnersRegistrationTokenRequestBuilder) { + return NewItemActionsRunnersRegistrationTokenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// RemoveToken the removeToken property +// returns a *ItemActionsRunnersRemoveTokenRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) RemoveToken()(*ItemActionsRunnersRemoveTokenRequestBuilder) { + return NewItemActionsRunnersRemoveTokenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all self-hosted runners configured for an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnersRequestBuilderGetQueryParameters])(*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 *ItemActionsRunnersRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersRequestBuilder) { + return NewItemActionsRunnersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_actions_runners_with_runner_escaped_item_request_builder.go b/pkg/github/enterprises/item_actions_runners_with_runner_escaped_item_request_builder.go new file mode 100644 index 00000000..e004aad6 --- /dev/null +++ b/pkg/github/enterprises/item_actions_runners_with_runner_escaped_item_request_builder.go @@ -0,0 +1,84 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnersWithRunner_ItemRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\actions\runners\{runner_id} +type ItemActionsRunnersWithRunner_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersWithRunner_ItemRequestBuilderInternal instantiates a new ItemActionsRunnersWithRunner_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnersWithRunner_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersWithRunner_ItemRequestBuilder) { + m := &ItemActionsRunnersWithRunner_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/actions/runners/{runner_id}", pathParameters), + } + return m +} +// NewItemActionsRunnersWithRunner_ItemRequestBuilder instantiates a new ItemActionsRunnersWithRunner_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnersWithRunner_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersWithRunner_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersWithRunner_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-enterprise +func (m *ItemActionsRunnersWithRunner_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific self-hosted runner configured in an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a Runnerable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-enterprise +func (m *ItemActionsRunnersWithRunner_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable), nil +} +// Labels the labels property +// returns a *ItemActionsRunnersItemLabelsRequestBuilder when successful +func (m *ItemActionsRunnersWithRunner_ItemRequestBuilder) Labels()(*ItemActionsRunnersItemLabelsRequestBuilder) { + return NewItemActionsRunnersItemLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation forces the removal of a self-hosted runner from an enterprise. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersWithRunner_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific self-hosted runner configured in an enterprise.OAuth app tokens and personal access tokens (classic) need the `manage_runners:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersWithRunner_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsRunnersWithRunner_ItemRequestBuilder when successful +func (m *ItemActionsRunnersWithRunner_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersWithRunner_ItemRequestBuilder) { + return NewItemActionsRunnersWithRunner_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_audit_log_request_builder.go b/pkg/github/enterprises/item_audit_log_request_builder.go new file mode 100644 index 00000000..f38f11ac --- /dev/null +++ b/pkg/github/enterprises/item_audit_log_request_builder.go @@ -0,0 +1,78 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ia5b56a324dabaabc88906ce951d195a926d514d542852d6ef1858a0d0dfc3641 "github.com/octokit/go-sdk-enterprise-server/pkg/github/enterprises/item/auditlog" +) + +// ItemAuditLogRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\audit-log +type ItemAuditLogRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemAuditLogRequestBuilderGetQueryParameters gets the audit log for an enterprise.The authenticated user must be an enterprise admin to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +type ItemAuditLogRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events before this cursor. + Before *string `uriparametername:"before"` + // The event types to include:- `web` - returns web (non-Git) events.- `git` - returns Git events.- `all` - returns both web and Git events.The default is `web`. + Include *ia5b56a324dabaabc88906ce951d195a926d514d542852d6ef1858a0d0dfc3641.GetIncludeQueryParameterType `uriparametername:"include"` + // The order of audit log events. To list newest events first, specify `desc`. To list oldest events first, specify `asc`.The default is `desc`. + Order *ia5b56a324dabaabc88906ce951d195a926d514d542852d6ef1858a0d0dfc3641.GetOrderQueryParameterType `uriparametername:"order"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // A search phrase. For more information, see [Searching the audit log](https://docs.github.com/enterprise-server@3.14/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/searching-the-audit-log-for-your-enterprise#searching-the-audit-log). + Phrase *string `uriparametername:"phrase"` +} +// NewItemAuditLogRequestBuilderInternal instantiates a new ItemAuditLogRequestBuilder and sets the default values. +func NewItemAuditLogRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAuditLogRequestBuilder) { + m := &ItemAuditLogRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/audit-log{?after*,before*,include*,order*,page*,per_page*,phrase*}", pathParameters), + } + return m +} +// NewItemAuditLogRequestBuilder instantiates a new ItemAuditLogRequestBuilder and sets the default values. +func NewItemAuditLogRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAuditLogRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemAuditLogRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the audit log for an enterprise.The authenticated user must be an enterprise admin to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a []AuditLogEventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/audit-log#get-the-audit-log-for-an-enterprise +func (m *ItemAuditLogRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemAuditLogRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuditLogEventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuditLogEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuditLogEventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuditLogEventable) + } + } + return val, nil +} +// ToGetRequestInformation gets the audit log for an enterprise.The authenticated user must be an enterprise admin 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 *ItemAuditLogRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemAuditLogRequestBuilderGetQueryParameters])(*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 *ItemAuditLogRequestBuilder when successful +func (m *ItemAuditLogRequestBuilder) WithUrl(rawUrl string)(*ItemAuditLogRequestBuilder) { + return NewItemAuditLogRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_code_escaped_security_escaped_and_escaped_analysis_patch_request_body.go b/pkg/github/enterprises/item_code_escaped_security_escaped_and_escaped_analysis_patch_request_body.go new file mode 100644 index 00000000..e0ca5104 --- /dev/null +++ b/pkg/github/enterprises/item_code_escaped_security_escaped_and_escaped_analysis_patch_request_body.go @@ -0,0 +1,225 @@ +package enterprises + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCode_security_and_analysisPatchRequestBody 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 GitHub Advanced Security is automatically enabled for new repositories. For more information, see "[About GitHub Advanced Security](https://docs.github.com/enterprise-server@3.14/get-started/learning-about-github/about-github-advanced-security)." + advanced_security_enabled_for_new_repositories *bool + // Whether GitHub Advanced Security is automatically enabled for new user namespace repositories. For more information, see "[About GitHub Advanced Security](https://docs.github.com/enterprise-server@3.14/get-started/learning-about-github/about-github-advanced-security)." + advanced_security_enabled_new_user_namespace_repos *bool + // Whether Dependabot alerts are automatically enabled for new repositories. For more information, see "[About Dependabot alerts](https://docs.github.com/enterprise-server@3.14/code-security/dependabot/dependabot-alerts/about-dependabot-alerts)." + dependabot_alerts_enabled_for_new_repositories *bool + // Whether secret scanning is automatically enabled for new repositories. For more information, see "[About secret scanning](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/about-secret-scanning)." + secret_scanning_enabled_for_new_repositories *bool + // The URL that will be displayed to contributors who are blocked from pushing a secret. For more information, see "[Protecting pushes with secret scanning](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/protecting-pushes-with-secret-scanning)."To disable this functionality, set this field to `null`. + secret_scanning_push_protection_custom_link *string + // Whether secret scanning push protection is automatically enabled for new repositories. For more information, see "[Protecting pushes with secret scanning](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." + secret_scanning_push_protection_enabled_for_new_repositories *bool +} +// NewItemCode_security_and_analysisPatchRequestBody instantiates a new ItemCode_security_and_analysisPatchRequestBody and sets the default values. +func NewItemCode_security_and_analysisPatchRequestBody()(*ItemCode_security_and_analysisPatchRequestBody) { + m := &ItemCode_security_and_analysisPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCode_security_and_analysisPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCode_security_and_analysisPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCode_security_and_analysisPatchRequestBody(), 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 *ItemCode_security_and_analysisPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurityEnabledForNewRepositories gets the advanced_security_enabled_for_new_repositories property value. Whether GitHub Advanced Security is automatically enabled for new repositories. For more information, see "[About GitHub Advanced Security](https://docs.github.com/enterprise-server@3.14/get-started/learning-about-github/about-github-advanced-security)." +// returns a *bool when successful +func (m *ItemCode_security_and_analysisPatchRequestBody) GetAdvancedSecurityEnabledForNewRepositories()(*bool) { + return m.advanced_security_enabled_for_new_repositories +} +// GetAdvancedSecurityEnabledNewUserNamespaceRepos gets the advanced_security_enabled_new_user_namespace_repos property value. Whether GitHub Advanced Security is automatically enabled for new user namespace repositories. For more information, see "[About GitHub Advanced Security](https://docs.github.com/enterprise-server@3.14/get-started/learning-about-github/about-github-advanced-security)." +// returns a *bool when successful +func (m *ItemCode_security_and_analysisPatchRequestBody) GetAdvancedSecurityEnabledNewUserNamespaceRepos()(*bool) { + return m.advanced_security_enabled_new_user_namespace_repos +} +// GetDependabotAlertsEnabledForNewRepositories gets the dependabot_alerts_enabled_for_new_repositories property value. Whether Dependabot alerts are automatically enabled for new repositories. For more information, see "[About Dependabot alerts](https://docs.github.com/enterprise-server@3.14/code-security/dependabot/dependabot-alerts/about-dependabot-alerts)." +// returns a *bool when successful +func (m *ItemCode_security_and_analysisPatchRequestBody) GetDependabotAlertsEnabledForNewRepositories()(*bool) { + return m.dependabot_alerts_enabled_for_new_repositories +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCode_security_and_analysisPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advanced_security_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurityEnabledForNewRepositories(val) + } + return nil + } + res["advanced_security_enabled_new_user_namespace_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurityEnabledNewUserNamespaceRepos(val) + } + return nil + } + res["dependabot_alerts_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDependabotAlertsEnabledForNewRepositories(val) + } + return nil + } + res["secret_scanning_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningEnabledForNewRepositories(val) + } + return nil + } + res["secret_scanning_push_protection_custom_link"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionCustomLink(val) + } + return nil + } + res["secret_scanning_push_protection_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionEnabledForNewRepositories(val) + } + return nil + } + return res +} +// GetSecretScanningEnabledForNewRepositories gets the secret_scanning_enabled_for_new_repositories property value. Whether secret scanning is automatically enabled for new repositories. For more information, see "[About secret scanning](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/about-secret-scanning)." +// returns a *bool when successful +func (m *ItemCode_security_and_analysisPatchRequestBody) GetSecretScanningEnabledForNewRepositories()(*bool) { + return m.secret_scanning_enabled_for_new_repositories +} +// GetSecretScanningPushProtectionCustomLink gets the secret_scanning_push_protection_custom_link property value. The URL that will be displayed to contributors who are blocked from pushing a secret. For more information, see "[Protecting pushes with secret scanning](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/protecting-pushes-with-secret-scanning)."To disable this functionality, set this field to `null`. +// returns a *string when successful +func (m *ItemCode_security_and_analysisPatchRequestBody) GetSecretScanningPushProtectionCustomLink()(*string) { + return m.secret_scanning_push_protection_custom_link +} +// GetSecretScanningPushProtectionEnabledForNewRepositories gets the secret_scanning_push_protection_enabled_for_new_repositories property value. Whether secret scanning push protection is automatically enabled for new repositories. For more information, see "[Protecting pushes with secret scanning](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." +// returns a *bool when successful +func (m *ItemCode_security_and_analysisPatchRequestBody) GetSecretScanningPushProtectionEnabledForNewRepositories()(*bool) { + return m.secret_scanning_push_protection_enabled_for_new_repositories +} +// Serialize serializes information the current object +func (m *ItemCode_security_and_analysisPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("advanced_security_enabled_for_new_repositories", m.GetAdvancedSecurityEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("advanced_security_enabled_new_user_namespace_repos", m.GetAdvancedSecurityEnabledNewUserNamespaceRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dependabot_alerts_enabled_for_new_repositories", m.GetDependabotAlertsEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_enabled_for_new_repositories", m.GetSecretScanningEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_scanning_push_protection_custom_link", m.GetSecretScanningPushProtectionCustomLink()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_push_protection_enabled_for_new_repositories", m.GetSecretScanningPushProtectionEnabledForNewRepositories()) + 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 *ItemCode_security_and_analysisPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurityEnabledForNewRepositories sets the advanced_security_enabled_for_new_repositories property value. Whether GitHub Advanced Security is automatically enabled for new repositories. For more information, see "[About GitHub Advanced Security](https://docs.github.com/enterprise-server@3.14/get-started/learning-about-github/about-github-advanced-security)." +func (m *ItemCode_security_and_analysisPatchRequestBody) SetAdvancedSecurityEnabledForNewRepositories(value *bool)() { + m.advanced_security_enabled_for_new_repositories = value +} +// SetAdvancedSecurityEnabledNewUserNamespaceRepos sets the advanced_security_enabled_new_user_namespace_repos property value. Whether GitHub Advanced Security is automatically enabled for new user namespace repositories. For more information, see "[About GitHub Advanced Security](https://docs.github.com/enterprise-server@3.14/get-started/learning-about-github/about-github-advanced-security)." +func (m *ItemCode_security_and_analysisPatchRequestBody) SetAdvancedSecurityEnabledNewUserNamespaceRepos(value *bool)() { + m.advanced_security_enabled_new_user_namespace_repos = value +} +// SetDependabotAlertsEnabledForNewRepositories sets the dependabot_alerts_enabled_for_new_repositories property value. Whether Dependabot alerts are automatically enabled for new repositories. For more information, see "[About Dependabot alerts](https://docs.github.com/enterprise-server@3.14/code-security/dependabot/dependabot-alerts/about-dependabot-alerts)." +func (m *ItemCode_security_and_analysisPatchRequestBody) SetDependabotAlertsEnabledForNewRepositories(value *bool)() { + m.dependabot_alerts_enabled_for_new_repositories = value +} +// SetSecretScanningEnabledForNewRepositories sets the secret_scanning_enabled_for_new_repositories property value. Whether secret scanning is automatically enabled for new repositories. For more information, see "[About secret scanning](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/about-secret-scanning)." +func (m *ItemCode_security_and_analysisPatchRequestBody) SetSecretScanningEnabledForNewRepositories(value *bool)() { + m.secret_scanning_enabled_for_new_repositories = value +} +// SetSecretScanningPushProtectionCustomLink sets the secret_scanning_push_protection_custom_link property value. The URL that will be displayed to contributors who are blocked from pushing a secret. For more information, see "[Protecting pushes with secret scanning](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/protecting-pushes-with-secret-scanning)."To disable this functionality, set this field to `null`. +func (m *ItemCode_security_and_analysisPatchRequestBody) SetSecretScanningPushProtectionCustomLink(value *string)() { + m.secret_scanning_push_protection_custom_link = value +} +// SetSecretScanningPushProtectionEnabledForNewRepositories sets the secret_scanning_push_protection_enabled_for_new_repositories property value. Whether secret scanning push protection is automatically enabled for new repositories. For more information, see "[Protecting pushes with secret scanning](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." +func (m *ItemCode_security_and_analysisPatchRequestBody) SetSecretScanningPushProtectionEnabledForNewRepositories(value *bool)() { + m.secret_scanning_push_protection_enabled_for_new_repositories = value +} +type ItemCode_security_and_analysisPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurityEnabledForNewRepositories()(*bool) + GetAdvancedSecurityEnabledNewUserNamespaceRepos()(*bool) + GetDependabotAlertsEnabledForNewRepositories()(*bool) + GetSecretScanningEnabledForNewRepositories()(*bool) + GetSecretScanningPushProtectionCustomLink()(*string) + GetSecretScanningPushProtectionEnabledForNewRepositories()(*bool) + SetAdvancedSecurityEnabledForNewRepositories(value *bool)() + SetAdvancedSecurityEnabledNewUserNamespaceRepos(value *bool)() + SetDependabotAlertsEnabledForNewRepositories(value *bool)() + SetSecretScanningEnabledForNewRepositories(value *bool)() + SetSecretScanningPushProtectionCustomLink(value *string)() + SetSecretScanningPushProtectionEnabledForNewRepositories(value *bool)() +} diff --git a/pkg/github/enterprises/item_code_escaped_security_escaped_and_escaped_analysis_request_builder.go b/pkg/github/enterprises/item_code_escaped_security_escaped_and_escaped_analysis_request_builder.go new file mode 100644 index 00000000..c2cfb227 --- /dev/null +++ b/pkg/github/enterprises/item_code_escaped_security_escaped_and_escaped_analysis_request_builder.go @@ -0,0 +1,92 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemCode_security_and_analysisRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\code_security_and_analysis +type ItemCode_security_and_analysisRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCode_security_and_analysisRequestBuilderInternal instantiates a new ItemCode_security_and_analysisRequestBuilder and sets the default values. +func NewItemCode_security_and_analysisRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCode_security_and_analysisRequestBuilder) { + m := &ItemCode_security_and_analysisRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code_security_and_analysis", pathParameters), + } + return m +} +// NewItemCode_security_and_analysisRequestBuilder instantiates a new ItemCode_security_and_analysisRequestBuilder and sets the default values. +func NewItemCode_security_and_analysisRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCode_security_and_analysisRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCode_security_and_analysisRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets code security and analysis settings for the specified 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 EnterpriseSecurityAnalysisSettingsable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/code-security-and-analysis#get-code-security-and-analysis-features-for-an-enterprise +func (m *ItemCode_security_and_analysisRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseSecurityAnalysisSettingsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnterpriseSecurityAnalysisSettingsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseSecurityAnalysisSettingsable), nil +} +// Patch updates the settings for advanced security, Dependabot alerts, secret scanning, and push protection for new repositories in an enterprise.The authenticated user must be an administrator of 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 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/code-security-and-analysis#update-code-security-and-analysis-features-for-an-enterprise +func (m *ItemCode_security_and_analysisRequestBuilder) Patch(ctx context.Context, body ItemCode_security_and_analysisPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets code security and analysis settings for the specified 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 *ItemCode_security_and_analysisRequestBuilder) 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 the settings for advanced security, Dependabot alerts, secret scanning, and push protection for new repositories in an enterprise.The authenticated user must be an administrator of 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 *ItemCode_security_and_analysisRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemCode_security_and_analysisPatchRequestBodyable, 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 *ItemCode_security_and_analysisRequestBuilder when successful +func (m *ItemCode_security_and_analysisRequestBuilder) WithUrl(rawUrl string)(*ItemCode_security_and_analysisRequestBuilder) { + return NewItemCode_security_and_analysisRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_code_scanning_alerts_request_builder.go b/pkg/github/enterprises/item_code_scanning_alerts_request_builder.go new file mode 100644 index 00000000..f8f3cba7 --- /dev/null +++ b/pkg/github/enterprises/item_code_scanning_alerts_request_builder.go @@ -0,0 +1,88 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + iabd26451e4a1bb45e6130c193e3f79df452a56173590088fd4049127fc32a095 "github.com/octokit/go-sdk-enterprise-server/pkg/github/enterprises/item/codescanning/alerts" +) + +// ItemCodeScanningAlertsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\code-scanning\alerts +type ItemCodeScanningAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCodeScanningAlertsRequestBuilderGetQueryParameters lists code scanning alerts for the default branch for all eligible repositories in an enterprise. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be a member of the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` or `repo` scope to use this endpoint. +type ItemCodeScanningAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *iabd26451e4a1bb45e6130c193e3f79df452a56173590088fd4049127fc32a095.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The property by which to sort the results. + Sort *iabd26451e4a1bb45e6130c193e3f79df452a56173590088fd4049127fc32a095.GetSortQueryParameterType `uriparametername:"sort"` + // If specified, only code scanning alerts with this state will be returned. + State *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertStateQuery `uriparametername:"state"` + // The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. + Tool_guid *string `uriparametername:"tool_guid"` + // The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. + Tool_name *string `uriparametername:"tool_name"` +} +// NewItemCodeScanningAlertsRequestBuilderInternal instantiates a new ItemCodeScanningAlertsRequestBuilder and sets the default values. +func NewItemCodeScanningAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeScanningAlertsRequestBuilder) { + m := &ItemCodeScanningAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-scanning/alerts{?after*,before*,direction*,page*,per_page*,sort*,state*,tool_guid*,tool_name*}", pathParameters), + } + return m +} +// NewItemCodeScanningAlertsRequestBuilder instantiates a new ItemCodeScanningAlertsRequestBuilder and sets the default values. +func NewItemCodeScanningAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeScanningAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeScanningAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists code scanning alerts for the default branch for all eligible repositories in an enterprise. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be a member of the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` or `repo` scope to use this endpoint. +// returns a []CodeScanningOrganizationAlertItemsable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a Alerts503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-enterprise +func (m *ItemCodeScanningAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodeScanningAlertsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningOrganizationAlertItemsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAlerts503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningOrganizationAlertItemsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningOrganizationAlertItemsable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningOrganizationAlertItemsable) + } + } + return val, nil +} +// ToGetRequestInformation lists code scanning alerts for the default branch for all eligible repositories in an enterprise. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be a member of the enterprise to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` or `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCodeScanningAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodeScanningAlertsRequestBuilderGetQueryParameters])(*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 *ItemCodeScanningAlertsRequestBuilder when successful +func (m *ItemCodeScanningAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemCodeScanningAlertsRequestBuilder) { + return NewItemCodeScanningAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_code_scanning_request_builder.go b/pkg/github/enterprises/item_code_scanning_request_builder.go new file mode 100644 index 00000000..e9087a2e --- /dev/null +++ b/pkg/github/enterprises/item_code_scanning_request_builder.go @@ -0,0 +1,28 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemCodeScanningRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\code-scanning +type ItemCodeScanningRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemCodeScanningAlertsRequestBuilder when successful +func (m *ItemCodeScanningRequestBuilder) Alerts()(*ItemCodeScanningAlertsRequestBuilder) { + return NewItemCodeScanningAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCodeScanningRequestBuilderInternal instantiates a new ItemCodeScanningRequestBuilder and sets the default values. +func NewItemCodeScanningRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeScanningRequestBuilder) { + m := &ItemCodeScanningRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/code-scanning", pathParameters), + } + return m +} +// NewItemCodeScanningRequestBuilder instantiates a new ItemCodeScanningRequestBuilder and sets the default values. +func NewItemCodeScanningRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeScanningRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeScanningRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/enterprises/item_dependabot_alerts_request_builder.go b/pkg/github/enterprises/item_dependabot_alerts_request_builder.go new file mode 100644 index 00000000..13bb1733 --- /dev/null +++ b/pkg/github/enterprises/item_dependabot_alerts_request_builder.go @@ -0,0 +1,96 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i1a72be8a2e171acbad39b8b772b6f76dcb853adcf2d0dac77f84acd8a56c4c26 "github.com/octokit/go-sdk-enterprise-server/pkg/github/enterprises/item/dependabot/alerts" +) + +// ItemDependabotAlertsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\dependabot\alerts +type ItemDependabotAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDependabotAlertsRequestBuilderGetQueryParameters lists Dependabot alerts for repositories that are owned by the specified enterprise.The authenticated user must be a member of the enterprise to use this endpoint.Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. +type ItemDependabotAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *i1a72be8a2e171acbad39b8b772b6f76dcb853adcf2d0dac77f84acd8a56c4c26.GetDirectionQueryParameterType `uriparametername:"direction"` + // A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned.Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust` + Ecosystem *string `uriparametername:"ecosystem"` + // **Deprecated**. The number of results per page (max 100), starting from the first matching result.This parameter must not be used in combination with `last`.Instead, use `per_page` in combination with `after` to fetch the first page of results. + First *int32 `uriparametername:"first"` + // **Deprecated**. The number of results per page (max 100), starting from the last matching result.This parameter must not be used in combination with `first`.Instead, use `per_page` in combination with `before` to fetch the last page of results. + Last *int32 `uriparametername:"last"` + // A comma-separated list of package names. If specified, only alerts for these packages will be returned. + Package *string `uriparametername:"package"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. + Scope *i1a72be8a2e171acbad39b8b772b6f76dcb853adcf2d0dac77f84acd8a56c4c26.GetScopeQueryParameterType `uriparametername:"scope"` + // A comma-separated list of severities. If specified, only alerts with these severities will be returned.Can be: `low`, `medium`, `high`, `critical` + Severity *string `uriparametername:"severity"` + // The property by which to sort the results.`created` means when the alert was created.`updated` means when the alert's state last changed. + Sort *i1a72be8a2e171acbad39b8b772b6f76dcb853adcf2d0dac77f84acd8a56c4c26.GetSortQueryParameterType `uriparametername:"sort"` + // A comma-separated list of states. If specified, only alerts with these states will be returned.Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` + State *string `uriparametername:"state"` +} +// NewItemDependabotAlertsRequestBuilderInternal instantiates a new ItemDependabotAlertsRequestBuilder and sets the default values. +func NewItemDependabotAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotAlertsRequestBuilder) { + m := &ItemDependabotAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/dependabot/alerts{?after*,before*,direction*,ecosystem*,first*,last*,package*,per_page*,scope*,severity*,sort*,state*}", pathParameters), + } + return m +} +// NewItemDependabotAlertsRequestBuilder instantiates a new ItemDependabotAlertsRequestBuilder and sets the default values. +func NewItemDependabotAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists Dependabot alerts for repositories that are owned by the specified enterprise.The authenticated user must be a member of the enterprise to use this endpoint.Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. +// returns a []DependabotAlertWithRepositoryable 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 ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/alerts#list-dependabot-alerts-for-an-enterprise +func (m *ItemDependabotAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotAlertsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotAlertWithRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDependabotAlertWithRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotAlertWithRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotAlertWithRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists Dependabot alerts for repositories that are owned by the specified enterprise.The authenticated user must be a member of the enterprise to use this endpoint.Alerts are only returned for organizations in the enterprise for which you are an organization owner or a security manager. For more information about security managers, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotAlertsRequestBuilderGetQueryParameters])(*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 *ItemDependabotAlertsRequestBuilder when successful +func (m *ItemDependabotAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemDependabotAlertsRequestBuilder) { + return NewItemDependabotAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_dependabot_request_builder.go b/pkg/github/enterprises/item_dependabot_request_builder.go new file mode 100644 index 00000000..d8039c85 --- /dev/null +++ b/pkg/github/enterprises/item_dependabot_request_builder.go @@ -0,0 +1,28 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemDependabotRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\dependabot +type ItemDependabotRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemDependabotAlertsRequestBuilder when successful +func (m *ItemDependabotRequestBuilder) Alerts()(*ItemDependabotAlertsRequestBuilder) { + return NewItemDependabotAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDependabotRequestBuilderInternal instantiates a new ItemDependabotRequestBuilder and sets the default values. +func NewItemDependabotRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotRequestBuilder) { + m := &ItemDependabotRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/dependabot", pathParameters), + } + return m +} +// NewItemDependabotRequestBuilder instantiates a new ItemDependabotRequestBuilder and sets the default values. +func NewItemDependabotRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/enterprises/item_item_with_enablement_item_request_builder.go b/pkg/github/enterprises/item_item_with_enablement_item_request_builder.go new file mode 100644 index 00000000..296d23d7 --- /dev/null +++ b/pkg/github/enterprises/item_item_with_enablement_item_request_builder.go @@ -0,0 +1,57 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemWithEnablementItemRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\{security_product}\{enablement} +type ItemItemWithEnablementItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemWithEnablementItemRequestBuilderInternal instantiates a new ItemItemWithEnablementItemRequestBuilder and sets the default values. +func NewItemItemWithEnablementItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemWithEnablementItemRequestBuilder) { + m := &ItemItemWithEnablementItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/{security_product}/{enablement}", pathParameters), + } + return m +} +// NewItemItemWithEnablementItemRequestBuilder instantiates a new ItemItemWithEnablementItemRequestBuilder and sets the default values. +func NewItemItemWithEnablementItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemWithEnablementItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemWithEnablementItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Post enables or disables the specified security feature for all repositories in an enterprise.The authenticated user must be an administrator of 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 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/code-security-and-analysis#enable-or-disable-a-security-feature +func (m *ItemItemWithEnablementItemRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation enables or disables the specified security feature for all repositories in an enterprise.The authenticated user must be an administrator of 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 *ItemItemWithEnablementItemRequestBuilder) 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 *ItemItemWithEnablementItemRequestBuilder when successful +func (m *ItemItemWithEnablementItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemWithEnablementItemRequestBuilder) { + return NewItemItemWithEnablementItemRequestBuilder(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 new file mode 100644 index 00000000..4e93cc14 --- /dev/null +++ b/pkg/github/enterprises/item_secret_scanning_alerts_request_builder.go @@ -0,0 +1,88 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ie731c1b19a2e5cc53591a2f3e26c1721bd2d17fb9da2b8efca9e1e81c4c05962 "github.com/octokit/go-sdk-enterprise-server/pkg/github/enterprises/item/secretscanning/alerts" +) + +// ItemSecretScanningAlertsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\secret-scanning\alerts +type ItemSecretScanningAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemSecretScanningAlertsRequestBuilderGetQueryParameters lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.To use this endpoint, you must be a member of the enterprise, and you must use an access token with the `repo` scope or `security_events` scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a [security manager](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization), or for personal account repositories. +type ItemSecretScanningAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *ie731c1b19a2e5cc53591a2f3e26c1721bd2d17fb9da2b8efca9e1e81c4c05962.GetDirectionQueryParameterType `uriparametername:"direction"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + 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/enterprise-server@3.14/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 *ie731c1b19a2e5cc53591a2f3e26c1721bd2d17fb9da2b8efca9e1e81c4c05962.GetSortQueryParameterType `uriparametername:"sort"` + // Set to `open` or `resolved` to only list secret scanning alerts in a specific state. + State *ie731c1b19a2e5cc53591a2f3e26c1721bd2d17fb9da2b8efca9e1e81c4c05962.GetStateQueryParameterType `uriparametername:"state"` + // A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. + Validity *string `uriparametername:"validity"` +} +// NewItemSecretScanningAlertsRequestBuilderInternal instantiates a new ItemSecretScanningAlertsRequestBuilder and sets the default values. +func NewItemSecretScanningAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningAlertsRequestBuilder) { + m := &ItemSecretScanningAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/secret-scanning/alerts{?after*,before*,direction*,per_page*,resolution*,secret_type*,sort*,state*,validity*}", pathParameters), + } + return m +} +// NewItemSecretScanningAlertsRequestBuilder instantiates a new ItemSecretScanningAlertsRequestBuilder and sets the default values. +func NewItemSecretScanningAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSecretScanningAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.To use this endpoint, you must be a member of the enterprise, and you must use an access token with the `repo` scope or `security_events` scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a [security manager](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization), or for personal account repositories. +// returns a []OrganizationSecretScanningAlertable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a Alerts503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-enterprise +func (m *ItemSecretScanningAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSecretScanningAlertsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSecretScanningAlertable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAlerts503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationSecretScanningAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSecretScanningAlertable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSecretScanningAlertable) + } + } + return val, nil +} +// ToGetRequestInformation lists secret scanning alerts for eligible repositories in an enterprise, from newest to oldest.To use this endpoint, you must be a member of the enterprise, and you must use an access token with the `repo` scope or `security_events` scope. Alerts are only returned for organizations in the enterprise for which you are an organization owner or a [security manager](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization), or for personal account repositories. +// returns a *RequestInformation when successful +func (m *ItemSecretScanningAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSecretScanningAlertsRequestBuilderGetQueryParameters])(*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 *ItemSecretScanningAlertsRequestBuilder when successful +func (m *ItemSecretScanningAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemSecretScanningAlertsRequestBuilder) { + return NewItemSecretScanningAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_secret_scanning_request_builder.go b/pkg/github/enterprises/item_secret_scanning_request_builder.go new file mode 100644 index 00000000..fee78157 --- /dev/null +++ b/pkg/github/enterprises/item_secret_scanning_request_builder.go @@ -0,0 +1,28 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSecretScanningRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\secret-scanning +type ItemSecretScanningRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemSecretScanningAlertsRequestBuilder when successful +func (m *ItemSecretScanningRequestBuilder) Alerts()(*ItemSecretScanningAlertsRequestBuilder) { + return NewItemSecretScanningAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemSecretScanningRequestBuilderInternal instantiates a new ItemSecretScanningRequestBuilder and sets the default values. +func NewItemSecretScanningRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningRequestBuilder) { + m := &ItemSecretScanningRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/secret-scanning", pathParameters), + } + return m +} +// NewItemSecretScanningRequestBuilder instantiates a new ItemSecretScanningRequestBuilder and sets the default values. +func NewItemSecretScanningRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSecretScanningRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/enterprises/item_settings_billing_advanced_security_request_builder.go b/pkg/github/enterprises/item_settings_billing_advanced_security_request_builder.go new file mode 100644 index 00000000..69c66a4c --- /dev/null +++ b/pkg/github/enterprises/item_settings_billing_advanced_security_request_builder.go @@ -0,0 +1,64 @@ +package enterprises + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemSettingsBillingAdvancedSecurityRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\settings\billing\advanced-security +type ItemSettingsBillingAdvancedSecurityRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemSettingsBillingAdvancedSecurityRequestBuilderGetQueryParameters gets the GitHub Advanced Security active committers for an enterprise per repository.Each distinct user login across all repositories is counted as a single Advanced Security seat, so the `total_advanced_security_committers` is not the sum of active_users for each repository.The total number of repositories with committer information is tracked by the `total_count` field. +type ItemSettingsBillingAdvancedSecurityRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemSettingsBillingAdvancedSecurityRequestBuilderInternal instantiates a new ItemSettingsBillingAdvancedSecurityRequestBuilder and sets the default values. +func NewItemSettingsBillingAdvancedSecurityRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingAdvancedSecurityRequestBuilder) { + m := &ItemSettingsBillingAdvancedSecurityRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/settings/billing/advanced-security{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemSettingsBillingAdvancedSecurityRequestBuilder instantiates a new ItemSettingsBillingAdvancedSecurityRequestBuilder and sets the default values. +func NewItemSettingsBillingAdvancedSecurityRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingAdvancedSecurityRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsBillingAdvancedSecurityRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the GitHub Advanced Security active committers for an enterprise per repository.Each distinct user login across all repositories is counted as a single Advanced Security seat, so the `total_advanced_security_committers` is not the sum of active_users for each repository.The total number of repositories with committer information is tracked by the `total_count` field. +// returns a AdvancedSecurityActiveCommittersable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/billing#get-github-advanced-security-active-committers-for-an-enterprise +func (m *ItemSettingsBillingAdvancedSecurityRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSettingsBillingAdvancedSecurityRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AdvancedSecurityActiveCommittersable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAdvancedSecurityActiveCommittersFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AdvancedSecurityActiveCommittersable), nil +} +// ToGetRequestInformation gets the GitHub Advanced Security active committers for an enterprise per repository.Each distinct user login across all repositories is counted as a single Advanced Security seat, so the `total_advanced_security_committers` is not the sum of active_users for each repository.The total number of repositories with committer information is tracked by the `total_count` field. +// returns a *RequestInformation when successful +func (m *ItemSettingsBillingAdvancedSecurityRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSettingsBillingAdvancedSecurityRequestBuilderGetQueryParameters])(*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 *ItemSettingsBillingAdvancedSecurityRequestBuilder when successful +func (m *ItemSettingsBillingAdvancedSecurityRequestBuilder) WithUrl(rawUrl string)(*ItemSettingsBillingAdvancedSecurityRequestBuilder) { + return NewItemSettingsBillingAdvancedSecurityRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/enterprises/item_settings_billing_request_builder.go b/pkg/github/enterprises/item_settings_billing_request_builder.go new file mode 100644 index 00000000..470bd9c0 --- /dev/null +++ b/pkg/github/enterprises/item_settings_billing_request_builder.go @@ -0,0 +1,28 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSettingsBillingRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\settings\billing +type ItemSettingsBillingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// AdvancedSecurity the advancedSecurity property +// returns a *ItemSettingsBillingAdvancedSecurityRequestBuilder when successful +func (m *ItemSettingsBillingRequestBuilder) AdvancedSecurity()(*ItemSettingsBillingAdvancedSecurityRequestBuilder) { + return NewItemSettingsBillingAdvancedSecurityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemSettingsBillingRequestBuilderInternal instantiates a new ItemSettingsBillingRequestBuilder and sets the default values. +func NewItemSettingsBillingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingRequestBuilder) { + m := &ItemSettingsBillingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/settings/billing", pathParameters), + } + return m +} +// NewItemSettingsBillingRequestBuilder instantiates a new ItemSettingsBillingRequestBuilder and sets the default values. +func NewItemSettingsBillingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsBillingRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/enterprises/item_settings_request_builder.go b/pkg/github/enterprises/item_settings_request_builder.go new file mode 100644 index 00000000..c7b06c0a --- /dev/null +++ b/pkg/github/enterprises/item_settings_request_builder.go @@ -0,0 +1,28 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSettingsRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\settings +type ItemSettingsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Billing the billing property +// returns a *ItemSettingsBillingRequestBuilder when successful +func (m *ItemSettingsRequestBuilder) Billing()(*ItemSettingsBillingRequestBuilder) { + return NewItemSettingsBillingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemSettingsRequestBuilderInternal instantiates a new ItemSettingsRequestBuilder and sets the default values. +func NewItemSettingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsRequestBuilder) { + m := &ItemSettingsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/settings", pathParameters), + } + return m +} +// NewItemSettingsRequestBuilder instantiates a new ItemSettingsRequestBuilder and sets the default values. +func NewItemSettingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/enterprises/item_with_security_escaped_product_item_request_builder.go b/pkg/github/enterprises/item_with_security_escaped_product_item_request_builder.go new file mode 100644 index 00000000..4eb2bb9e --- /dev/null +++ b/pkg/github/enterprises/item_with_security_escaped_product_item_request_builder.go @@ -0,0 +1,35 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemWithSecurity_productItemRequestBuilder builds and executes requests for operations under \enterprises\{enterprise}\{security_product} +type ItemWithSecurity_productItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByEnablement gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.enterprises.item.item.item collection +// returns a *ItemItemWithEnablementItemRequestBuilder when successful +func (m *ItemWithSecurity_productItemRequestBuilder) ByEnablement(enablement string)(*ItemItemWithEnablementItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if enablement != "" { + urlTplParams["enablement"] = enablement + } + return NewItemItemWithEnablementItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemWithSecurity_productItemRequestBuilderInternal instantiates a new ItemWithSecurity_productItemRequestBuilder and sets the default values. +func NewItemWithSecurity_productItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithSecurity_productItemRequestBuilder) { + m := &ItemWithSecurity_productItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}/{security_product}", pathParameters), + } + return m +} +// NewItemWithSecurity_productItemRequestBuilder instantiates a new ItemWithSecurity_productItemRequestBuilder and sets the default values. +func NewItemWithSecurity_productItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithSecurity_productItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemWithSecurity_productItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/enterprises/with_enterprise_item_request_builder.go b/pkg/github/enterprises/with_enterprise_item_request_builder.go new file mode 100644 index 00000000..1660e449 --- /dev/null +++ b/pkg/github/enterprises/with_enterprise_item_request_builder.go @@ -0,0 +1,70 @@ +package enterprises + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// WithEnterpriseItemRequestBuilder builds and executes requests for operations under \enterprises\{enterprise} +type WithEnterpriseItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Actions the actions property +// returns a *ItemActionsRequestBuilder when successful +func (m *WithEnterpriseItemRequestBuilder) Actions()(*ItemActionsRequestBuilder) { + return NewItemActionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// AuditLog the auditLog property +// returns a *ItemAuditLogRequestBuilder when successful +func (m *WithEnterpriseItemRequestBuilder) AuditLog()(*ItemAuditLogRequestBuilder) { + return NewItemAuditLogRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// BySecurity_product gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.enterprises.item.item collection +// returns a *ItemWithSecurity_productItemRequestBuilder when successful +func (m *WithEnterpriseItemRequestBuilder) BySecurity_product(security_product string)(*ItemWithSecurity_productItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if security_product != "" { + urlTplParams["security_product"] = security_product + } + return NewItemWithSecurity_productItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// Code_security_and_analysis the code_security_and_analysis property +// returns a *ItemCode_security_and_analysisRequestBuilder when successful +func (m *WithEnterpriseItemRequestBuilder) Code_security_and_analysis()(*ItemCode_security_and_analysisRequestBuilder) { + return NewItemCode_security_and_analysisRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CodeScanning the codeScanning property +// returns a *ItemCodeScanningRequestBuilder when successful +func (m *WithEnterpriseItemRequestBuilder) CodeScanning()(*ItemCodeScanningRequestBuilder) { + return NewItemCodeScanningRequestBuilderInternal(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{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/enterprises/{enterprise}", pathParameters), + } + return m +} +// NewWithEnterpriseItemRequestBuilder instantiates a new WithEnterpriseItemRequestBuilder and sets the default values. +func NewWithEnterpriseItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithEnterpriseItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithEnterpriseItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Dependabot the dependabot property +// returns a *ItemDependabotRequestBuilder when successful +func (m *WithEnterpriseItemRequestBuilder) Dependabot()(*ItemDependabotRequestBuilder) { + return NewItemDependabotRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecretScanning the secretScanning property +// returns a *ItemSecretScanningRequestBuilder when successful +func (m *WithEnterpriseItemRequestBuilder) SecretScanning()(*ItemSecretScanningRequestBuilder) { + return NewItemSecretScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Settings the settings property +// returns a *ItemSettingsRequestBuilder when successful +func (m *WithEnterpriseItemRequestBuilder) Settings()(*ItemSettingsRequestBuilder) { + return NewItemSettingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/events/events_request_builder.go b/pkg/github/events/events_request_builder.go new file mode 100644 index 00000000..082fb9d9 --- /dev/null +++ b/pkg/github/events/events_request_builder.go @@ -0,0 +1,73 @@ +package events + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// EventsRequestBuilder builds and executes requests for operations under \events +type EventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// EventsRequestBuilderGetQueryParameters > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +type EventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewEventsRequestBuilderInternal instantiates a new EventsRequestBuilder and sets the default values. +func NewEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EventsRequestBuilder) { + m := &EventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/events{?page*,per_page*}", pathParameters), + } + return m +} +// NewEventsRequestBuilder instantiates a new EventsRequestBuilder and sets the default values. +func NewEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a []Eventable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a Events503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/events#list-public-events +func (m *EventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[EventsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEvents503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEventFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable) + } + } + return val, nil +} +// ToGetRequestInformation > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a *RequestInformation when successful +func (m *EventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[EventsRequestBuilderGetQueryParameters])(*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 *EventsRequestBuilder when successful +func (m *EventsRequestBuilder) WithUrl(rawUrl string)(*EventsRequestBuilder) { + return NewEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/feeds/feeds_request_builder.go b/pkg/github/feeds/feeds_request_builder.go new file mode 100644 index 00000000..10a8df83 --- /dev/null +++ b/pkg/github/feeds/feeds_request_builder.go @@ -0,0 +1,57 @@ +package feeds + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// FeedsRequestBuilder builds and executes requests for operations under \feeds +type FeedsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewFeedsRequestBuilderInternal instantiates a new FeedsRequestBuilder and sets the default values. +func NewFeedsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FeedsRequestBuilder) { + m := &FeedsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/feeds", pathParameters), + } + return m +} +// NewFeedsRequestBuilder instantiates a new FeedsRequestBuilder and sets the default values. +func NewFeedsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FeedsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewFeedsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the feeds available to the authenticated user. The response provides a URL for each feed. You can then get a specific feed by sending a request to one of the feed URLs.* **Timeline**: The GitHub Enterprise Server global public timeline* **User**: The public timeline for any user, using `uri_template`. For more information, see "[Hypermedia](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia)."* **Current user public**: The public timeline for the authenticated user* **Current user**: The private timeline for the authenticated user* **Current user actor**: The private timeline for activity created by the authenticated user* **Current user organizations**: The private timeline for the organizations the authenticated user is a member of.* **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub Enterprise Server.By default, timeline resources are returned in JSON. You can specify the `application/atom+xml` type in the `Accept` header to return timeline resources in Atom format. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."> [!NOTE]> Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/enterprise-server@3.14/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) since current feed URIs use the older, non revocable auth tokens. +// returns a Feedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/feeds#get-feeds +func (m *FeedsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Feedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateFeedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Feedable), nil +} +// ToGetRequestInformation lists the feeds available to the authenticated user. The response provides a URL for each feed. You can then get a specific feed by sending a request to one of the feed URLs.* **Timeline**: The GitHub Enterprise Server global public timeline* **User**: The public timeline for any user, using `uri_template`. For more information, see "[Hypermedia](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia)."* **Current user public**: The public timeline for the authenticated user* **Current user**: The private timeline for the authenticated user* **Current user actor**: The private timeline for activity created by the authenticated user* **Current user organizations**: The private timeline for the organizations the authenticated user is a member of.* **Security advisories**: A collection of public announcements that provide information about security-related vulnerabilities in software on GitHub Enterprise Server.By default, timeline resources are returned in JSON. You can specify the `application/atom+xml` type in the `Accept` header to return timeline resources in Atom format. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."> [!NOTE]> Private feeds are only returned when [authenticating via Basic Auth](https://docs.github.com/enterprise-server@3.14/rest/authentication/authenticating-to-the-rest-api#using-basic-authentication) since current feed URIs use the older, non revocable auth tokens. +// returns a *RequestInformation when successful +func (m *FeedsRequestBuilder) 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 *FeedsRequestBuilder when successful +func (m *FeedsRequestBuilder) WithUrl(rawUrl string)(*FeedsRequestBuilder) { + return NewFeedsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/gists/gists_post_request_body.go b/pkg/github/gists/gists_post_request_body.go new file mode 100644 index 00000000..c36f92d4 --- /dev/null +++ b/pkg/github/gists/gists_post_request_body.go @@ -0,0 +1,232 @@ +package gists + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Description of the gist + description *string + // Names and content for the files that make up the gist + files GistsPostRequestBody_filesable + // The public property + public GistsPostRequestBody_GistsPostRequestBody_publicable +} +// GistsPostRequestBody_GistsPostRequestBody_public composed type wrapper for classes bool, string +type GistsPostRequestBody_GistsPostRequestBody_public struct { + // Composed type representation for type bool + boolean *bool + // Composed type representation for type string + string *string +} +// NewGistsPostRequestBody_GistsPostRequestBody_public instantiates a new GistsPostRequestBody_GistsPostRequestBody_public and sets the default values. +func NewGistsPostRequestBody_GistsPostRequestBody_public()(*GistsPostRequestBody_GistsPostRequestBody_public) { + m := &GistsPostRequestBody_GistsPostRequestBody_public{ + } + return m +} +// CreateGistsPostRequestBody_GistsPostRequestBody_publicFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistsPostRequestBody_GistsPostRequestBody_publicFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewGistsPostRequestBody_GistsPostRequestBody_public() + 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.GetBoolValue(); val != nil { + if err != nil { + return nil, err + } + result.SetBoolean(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetBoolean gets the boolean property value. Composed type representation for type bool +// returns a *bool when successful +func (m *GistsPostRequestBody_GistsPostRequestBody_public) GetBoolean()(*bool) { + return m.boolean +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistsPostRequestBody_GistsPostRequestBody_public) 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 *GistsPostRequestBody_GistsPostRequestBody_public) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *GistsPostRequestBody_GistsPostRequestBody_public) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *GistsPostRequestBody_GistsPostRequestBody_public) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBoolean() != nil { + err := writer.WriteBoolValue("", m.GetBoolean()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetBoolean sets the boolean property value. Composed type representation for type bool +func (m *GistsPostRequestBody_GistsPostRequestBody_public) SetBoolean(value *bool)() { + m.boolean = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *GistsPostRequestBody_GistsPostRequestBody_public) SetString(value *string)() { + m.string = value +} +type GistsPostRequestBody_GistsPostRequestBody_publicable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBoolean()(*bool) + GetString()(*string) + SetBoolean(value *bool)() + SetString(value *string)() +} +// NewGistsPostRequestBody instantiates a new GistsPostRequestBody and sets the default values. +func NewGistsPostRequestBody()(*GistsPostRequestBody) { + m := &GistsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistsPostRequestBody(), 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 *GistsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. Description of the gist +// returns a *string when successful +func (m *GistsPostRequestBody) 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 *GistsPostRequestBody) 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["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistsPostRequestBody_filesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetFiles(val.(GistsPostRequestBody_filesable)) + } + return nil + } + res["public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistsPostRequestBody_GistsPostRequestBody_publicFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPublic(val.(GistsPostRequestBody_GistsPostRequestBody_publicable)) + } + return nil + } + return res +} +// GetFiles gets the files property value. Names and content for the files that make up the gist +// returns a GistsPostRequestBody_filesable when successful +func (m *GistsPostRequestBody) GetFiles()(GistsPostRequestBody_filesable) { + return m.files +} +// GetPublic gets the public property value. The public property +// returns a GistsPostRequestBody_GistsPostRequestBody_publicable when successful +func (m *GistsPostRequestBody) GetPublic()(GistsPostRequestBody_GistsPostRequestBody_publicable) { + return m.public +} +// Serialize serializes information the current object +func (m *GistsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("files", m.GetFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("public", m.GetPublic()) + 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 *GistsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. Description of the gist +func (m *GistsPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetFiles sets the files property value. Names and content for the files that make up the gist +func (m *GistsPostRequestBody) SetFiles(value GistsPostRequestBody_filesable)() { + m.files = value +} +// SetPublic sets the public property value. The public property +func (m *GistsPostRequestBody) SetPublic(value GistsPostRequestBody_GistsPostRequestBody_publicable)() { + m.public = value +} +type GistsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetFiles()(GistsPostRequestBody_filesable) + GetPublic()(GistsPostRequestBody_GistsPostRequestBody_publicable) + SetDescription(value *string)() + SetFiles(value GistsPostRequestBody_filesable)() + SetPublic(value GistsPostRequestBody_GistsPostRequestBody_publicable)() +} diff --git a/pkg/github/gists/gists_post_request_body_escaped_files.go b/pkg/github/gists/gists_post_request_body_escaped_files.go new file mode 100644 index 00000000..41da470d --- /dev/null +++ b/pkg/github/gists/gists_post_request_body_escaped_files.go @@ -0,0 +1,52 @@ +package gists + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GistsPostRequestBody_files names and content for the files that make up the gist +type GistsPostRequestBody_files struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewGistsPostRequestBody_files instantiates a new GistsPostRequestBody_files and sets the default values. +func NewGistsPostRequestBody_files()(*GistsPostRequestBody_files) { + m := &GistsPostRequestBody_files{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistsPostRequestBody_filesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistsPostRequestBody_filesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistsPostRequestBody_files(), 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 *GistsPostRequestBody_files) 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 *GistsPostRequestBody_files) 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 *GistsPostRequestBody_files) 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 *GistsPostRequestBody_files) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type GistsPostRequestBody_filesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/gists/gists_request_builder.go b/pkg/github/gists/gists_request_builder.go new file mode 100644 index 00000000..3cf2e5fe --- /dev/null +++ b/pkg/github/gists/gists_request_builder.go @@ -0,0 +1,135 @@ +package gists + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// GistsRequestBuilder builds and executes requests for operations under \gists +type GistsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// GistsRequestBuilderGetQueryParameters lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: +type GistsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// ByGist_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.gists.item collection +// returns a *WithGist_ItemRequestBuilder when successful +func (m *GistsRequestBuilder) ByGist_id(gist_id string)(*WithGist_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if gist_id != "" { + urlTplParams["gist_id"] = gist_id + } + return NewWithGist_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewGistsRequestBuilderInternal instantiates a new GistsRequestBuilder and sets the default values. +func NewGistsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GistsRequestBuilder) { + m := &GistsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists{?page*,per_page*,since*}", pathParameters), + } + return m +} +// NewGistsRequestBuilder instantiates a new GistsRequestBuilder and sets the default values. +func NewGistsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GistsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewGistsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: +// returns a []BaseGistable when successful +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/gists/gists#list-gists-for-the-authenticated-user +func (m *GistsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[GistsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BaseGistable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBaseGistFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BaseGistable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BaseGistable) + } + } + return val, nil +} +// Post allows you to add a new gist with one or more files.> [!NOTE]> Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally. +// returns a GistSimpleable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/gists/gists#create-a-gist +func (m *GistsRequestBuilder) Post(ctx context.Context, body GistsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistSimpleable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGistSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistSimpleable), nil +} +// Public the public property +// returns a *PublicRequestBuilder when successful +func (m *GistsRequestBuilder) Public()(*PublicRequestBuilder) { + return NewPublicRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Starred the starred property +// returns a *StarredRequestBuilder when successful +func (m *GistsRequestBuilder) Starred()(*StarredRequestBuilder) { + return NewStarredRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists the authenticated user's gists or if called anonymously, this endpoint returns all public gists: +// returns a *RequestInformation when successful +func (m *GistsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[GistsRequestBuilderGetQueryParameters])(*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 allows you to add a new gist with one or more files.> [!NOTE]> Don't name your files "gistfile" with a numerical suffix. This is the format of the automatic naming scheme that Gist uses internally. +// returns a *RequestInformation when successful +func (m *GistsRequestBuilder) ToPostRequestInformation(ctx context.Context, body GistsPostRequestBodyable, 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 *GistsRequestBuilder when successful +func (m *GistsRequestBuilder) WithUrl(rawUrl string)(*GistsRequestBuilder) { + return NewGistsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/gists/item_comments_item_with_comment_escaped_patch_request_body.go b/pkg/github/gists/item_comments_item_with_comment_escaped_patch_request_body.go new file mode 100644 index 00000000..d4c89fbf --- /dev/null +++ b/pkg/github/gists/item_comments_item_with_comment_escaped_patch_request_body.go @@ -0,0 +1,80 @@ +package gists + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCommentsItemWithComment_PatchRequestBody 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 comment text. + body *string +} +// NewItemCommentsItemWithComment_PatchRequestBody instantiates a new ItemCommentsItemWithComment_PatchRequestBody and sets the default values. +func NewItemCommentsItemWithComment_PatchRequestBody()(*ItemCommentsItemWithComment_PatchRequestBody) { + m := &ItemCommentsItemWithComment_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCommentsItemWithComment_PatchRequestBody(), 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 *ItemCommentsItemWithComment_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The comment text. +// returns a *string when successful +func (m *ItemCommentsItemWithComment_PatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCommentsItemWithComment_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemCommentsItemWithComment_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemCommentsItemWithComment_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The comment text. +func (m *ItemCommentsItemWithComment_PatchRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemCommentsItemWithComment_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/pkg/github/gists/item_comments_post_request_body.go b/pkg/github/gists/item_comments_post_request_body.go new file mode 100644 index 00000000..edf31508 --- /dev/null +++ b/pkg/github/gists/item_comments_post_request_body.go @@ -0,0 +1,80 @@ +package gists + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCommentsPostRequestBody 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 comment text. + body *string +} +// NewItemCommentsPostRequestBody instantiates a new ItemCommentsPostRequestBody and sets the default values. +func NewItemCommentsPostRequestBody()(*ItemCommentsPostRequestBody) { + m := &ItemCommentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCommentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCommentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCommentsPostRequestBody(), 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 *ItemCommentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The comment text. +// returns a *string when successful +func (m *ItemCommentsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCommentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemCommentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemCommentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The comment text. +func (m *ItemCommentsPostRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemCommentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/pkg/github/gists/item_comments_request_builder.go b/pkg/github/gists/item_comments_request_builder.go new file mode 100644 index 00000000..1aedbfba --- /dev/null +++ b/pkg/github/gists/item_comments_request_builder.go @@ -0,0 +1,121 @@ +package gists + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemCommentsRequestBuilder builds and executes requests for operations under \gists\{gist_id}\comments +type ItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCommentsRequestBuilderGetQueryParameters lists the comments on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +type ItemCommentsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByComment_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.gists.item.comments.item collection +// returns a *ItemCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemCommentsRequestBuilder) ByComment_id(comment_id int64)(*ItemCommentsWithComment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["comment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(comment_id, 10) + return NewItemCommentsWithComment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCommentsRequestBuilderInternal instantiates a new ItemCommentsRequestBuilder and sets the default values. +func NewItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCommentsRequestBuilder) { + m := &ItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/{gist_id}/comments{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemCommentsRequestBuilder instantiates a new ItemCommentsRequestBuilder and sets the default values. +func NewItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the comments on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a []GistCommentable 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/enterprise-server@3.14/rest/gists/comments#list-gist-comments +func (m *ItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCommentsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGistCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistCommentable) + } + } + return val, nil +} +// Post creates a comment on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a GistCommentable 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/enterprise-server@3.14/rest/gists/comments#create-a-gist-comment +func (m *ItemCommentsRequestBuilder) Post(ctx context.Context, body ItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistCommentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGistCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistCommentable), nil +} +// ToGetRequestInformation lists the comments on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a *RequestInformation when successful +func (m *ItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCommentsRequestBuilderGetQueryParameters])(*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 comment on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a *RequestInformation when successful +func (m *ItemCommentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemCommentsPostRequestBodyable, 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 *ItemCommentsRequestBuilder when successful +func (m *ItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemCommentsRequestBuilder) { + return NewItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/gists/item_comments_with_comment_escaped_item_request_builder.go b/pkg/github/gists/item_comments_with_comment_escaped_item_request_builder.go new file mode 100644 index 00000000..777eed14 --- /dev/null +++ b/pkg/github/gists/item_comments_with_comment_escaped_item_request_builder.go @@ -0,0 +1,126 @@ +package gists + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemCommentsWithComment_ItemRequestBuilder builds and executes requests for operations under \gists\{gist_id}\comments\{comment_id} +type ItemCommentsWithComment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCommentsWithComment_ItemRequestBuilderInternal instantiates a new ItemCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemCommentsWithComment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCommentsWithComment_ItemRequestBuilder) { + m := &ItemCommentsWithComment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/{gist_id}/comments/{comment_id}", pathParameters), + } + return m +} +// NewItemCommentsWithComment_ItemRequestBuilder instantiates a new ItemCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemCommentsWithComment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCommentsWithComment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCommentsWithComment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a gist comment +// 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/enterprise-server@3.14/rest/gists/comments#delete-a-gist-comment +func (m *ItemCommentsWithComment_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 { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a comment on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a GistCommentable when successful +// returns a GistComment403Error 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/enterprise-server@3.14/rest/gists/comments#get-a-gist-comment +func (m *ItemCommentsWithComment_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGistComment403ErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGistCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistCommentable), nil +} +// Patch updates a comment on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a GistCommentable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/gists/comments#update-a-gist-comment +func (m *ItemCommentsWithComment_ItemRequestBuilder) Patch(ctx context.Context, body ItemCommentsItemWithComment_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistCommentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGistCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistCommentable), nil +} +// returns a *RequestInformation when successful +func (m *ItemCommentsWithComment_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") + return requestInfo, nil +} +// ToGetRequestInformation gets a comment on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a *RequestInformation when successful +func (m *ItemCommentsWithComment_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 comment on a gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a *RequestInformation when successful +func (m *ItemCommentsWithComment_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemCommentsItemWithComment_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 *ItemCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemCommentsWithComment_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemCommentsWithComment_ItemRequestBuilder) { + return NewItemCommentsWithComment_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/gists/item_commits_request_builder.go b/pkg/github/gists/item_commits_request_builder.go new file mode 100644 index 00000000..2c1dbe37 --- /dev/null +++ b/pkg/github/gists/item_commits_request_builder.go @@ -0,0 +1,72 @@ +package gists + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemCommitsRequestBuilder builds and executes requests for operations under \gists\{gist_id}\commits +type ItemCommitsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCommitsRequestBuilderGetQueryParameters list gist commits +type ItemCommitsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemCommitsRequestBuilderInternal instantiates a new ItemCommitsRequestBuilder and sets the default values. +func NewItemCommitsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCommitsRequestBuilder) { + m := &ItemCommitsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/{gist_id}/commits{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemCommitsRequestBuilder instantiates a new ItemCommitsRequestBuilder and sets the default values. +func NewItemCommitsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCommitsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCommitsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list gist commits +// returns a []GistCommitable 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/enterprise-server@3.14/rest/gists/gists#list-gist-commits +func (m *ItemCommitsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCommitsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistCommitable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGistCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistCommitable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistCommitable) + } + } + return val, nil +} +// returns a *RequestInformation when successful +func (m *ItemCommitsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCommitsRequestBuilderGetQueryParameters])(*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 *ItemCommitsRequestBuilder when successful +func (m *ItemCommitsRequestBuilder) WithUrl(rawUrl string)(*ItemCommitsRequestBuilder) { + return NewItemCommitsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/gists/item_forks_request_builder.go b/pkg/github/gists/item_forks_request_builder.go new file mode 100644 index 00000000..e849c066 --- /dev/null +++ b/pkg/github/gists/item_forks_request_builder.go @@ -0,0 +1,106 @@ +package gists + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemForksRequestBuilder builds and executes requests for operations under \gists\{gist_id}\forks +type ItemForksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemForksRequestBuilderGetQueryParameters list gist forks +type ItemForksRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemForksRequestBuilderInternal instantiates a new ItemForksRequestBuilder and sets the default values. +func NewItemForksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemForksRequestBuilder) { + m := &ItemForksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/{gist_id}/forks{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemForksRequestBuilder instantiates a new ItemForksRequestBuilder and sets the default values. +func NewItemForksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemForksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemForksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list gist forks +// returns a []GistSimpleable 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/enterprise-server@3.14/rest/gists/gists#list-gist-forks +func (m *ItemForksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemForksRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGistSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistSimpleable) + } + } + return val, nil +} +// Post fork a gist +// returns a BaseGistable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/gists/gists#fork-a-gist +func (m *ItemForksRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BaseGistable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBaseGistFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BaseGistable), nil +} +// returns a *RequestInformation when successful +func (m *ItemForksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemForksRequestBuilderGetQueryParameters])(*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 +} +// returns a *RequestInformation when successful +func (m *ItemForksRequestBuilder) 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 *ItemForksRequestBuilder when successful +func (m *ItemForksRequestBuilder) WithUrl(rawUrl string)(*ItemForksRequestBuilder) { + return NewItemForksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/gists/item_star404_error.go b/pkg/github/gists/item_star404_error.go new file mode 100644 index 00000000..34d3a62e --- /dev/null +++ b/pkg/github/gists/item_star404_error.go @@ -0,0 +1,40 @@ +package gists + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemStar404Error struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ApiError +} +// NewItemStar404Error instantiates a new ItemStar404Error and sets the default values. +func NewItemStar404Error()(*ItemStar404Error) { + m := &ItemStar404Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + return m +} +// CreateItemStar404ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemStar404ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemStar404Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemStar404Error) Error()(string) { + return m.ApiError.Error() +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemStar404Error) 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 *ItemStar404Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +type ItemStar404Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/gists/item_star_request_builder.go b/pkg/github/gists/item_star_request_builder.go new file mode 100644 index 00000000..a593d27f --- /dev/null +++ b/pkg/github/gists/item_star_request_builder.go @@ -0,0 +1,115 @@ +package gists + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemStarRequestBuilder builds and executes requests for operations under \gists\{gist_id}\star +type ItemStarRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemStarRequestBuilderInternal instantiates a new ItemStarRequestBuilder and sets the default values. +func NewItemStarRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemStarRequestBuilder) { + m := &ItemStarRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/{gist_id}/star", pathParameters), + } + return m +} +// NewItemStarRequestBuilder instantiates a new ItemStarRequestBuilder and sets the default values. +func NewItemStarRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemStarRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemStarRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete unstar a gist +// 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/enterprise-server@3.14/rest/gists/gists#unstar-a-gist +func (m *ItemStarRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get check if a gist is starred +// returns a BasicError error when the service returns a 403 status code +// returns a ItemStar404Error error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/gists/gists#check-if-a-gist-is-starred +func (m *ItemStarRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": CreateItemStar404ErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// 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/enterprise-server@3.14/rest/gists/gists#star-a-gist +func (m *ItemStarRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// returns a *RequestInformation when successful +func (m *ItemStarRequestBuilder) 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") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ItemStarRequestBuilder) 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 +} +// ToPutRequestInformation note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a *RequestInformation when successful +func (m *ItemStarRequestBuilder) ToPutRequestInformation(ctx context.Context, 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") + 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 *ItemStarRequestBuilder when successful +func (m *ItemStarRequestBuilder) WithUrl(rawUrl string)(*ItemStarRequestBuilder) { + return NewItemStarRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/gists/item_with_gist_escaped_patch_request_body.go b/pkg/github/gists/item_with_gist_escaped_patch_request_body.go new file mode 100644 index 00000000..9b5c888a --- /dev/null +++ b/pkg/github/gists/item_with_gist_escaped_patch_request_body.go @@ -0,0 +1,109 @@ +package gists + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemWithGist_PatchRequestBody 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 the gist. + description *string + // The gist files to be updated, renamed, or deleted. Each `key` must match the current filename(including extension) of the targeted gist file. For example: `hello.py`.To delete a file, set the whole file to null. For example: `hello.py : null`. The file will also bedeleted if the specified object does not contain at least one of `content` or `filename`. + files ItemWithGist_PatchRequestBody_filesable +} +// NewItemWithGist_PatchRequestBody instantiates a new ItemWithGist_PatchRequestBody and sets the default values. +func NewItemWithGist_PatchRequestBody()(*ItemWithGist_PatchRequestBody) { + m := &ItemWithGist_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithGist_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithGist_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithGist_PatchRequestBody(), 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 *ItemWithGist_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description of the gist. +// returns a *string when successful +func (m *ItemWithGist_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 *ItemWithGist_PatchRequestBody) 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["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemWithGist_PatchRequestBody_filesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetFiles(val.(ItemWithGist_PatchRequestBody_filesable)) + } + return nil + } + return res +} +// GetFiles gets the files property value. The gist files to be updated, renamed, or deleted. Each `key` must match the current filename(including extension) of the targeted gist file. For example: `hello.py`.To delete a file, set the whole file to null. For example: `hello.py : null`. The file will also bedeleted if the specified object does not contain at least one of `content` or `filename`. +// returns a ItemWithGist_PatchRequestBody_filesable when successful +func (m *ItemWithGist_PatchRequestBody) GetFiles()(ItemWithGist_PatchRequestBody_filesable) { + return m.files +} +// Serialize serializes information the current object +func (m *ItemWithGist_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("files", m.GetFiles()) + 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 *ItemWithGist_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description of the gist. +func (m *ItemWithGist_PatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetFiles sets the files property value. The gist files to be updated, renamed, or deleted. Each `key` must match the current filename(including extension) of the targeted gist file. For example: `hello.py`.To delete a file, set the whole file to null. For example: `hello.py : null`. The file will also bedeleted if the specified object does not contain at least one of `content` or `filename`. +func (m *ItemWithGist_PatchRequestBody) SetFiles(value ItemWithGist_PatchRequestBody_filesable)() { + m.files = value +} +type ItemWithGist_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetFiles()(ItemWithGist_PatchRequestBody_filesable) + SetDescription(value *string)() + SetFiles(value ItemWithGist_PatchRequestBody_filesable)() +} diff --git a/pkg/github/gists/item_with_gist_escaped_patch_request_body_escaped_files.go b/pkg/github/gists/item_with_gist_escaped_patch_request_body_escaped_files.go new file mode 100644 index 00000000..4546effa --- /dev/null +++ b/pkg/github/gists/item_with_gist_escaped_patch_request_body_escaped_files.go @@ -0,0 +1,52 @@ +package gists + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemWithGist_PatchRequestBody_files the gist files to be updated, renamed, or deleted. Each `key` must match the current filename(including extension) of the targeted gist file. For example: `hello.py`.To delete a file, set the whole file to null. For example: `hello.py : null`. The file will also bedeleted if the specified object does not contain at least one of `content` or `filename`. +type ItemWithGist_PatchRequestBody_files struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemWithGist_PatchRequestBody_files instantiates a new ItemWithGist_PatchRequestBody_files and sets the default values. +func NewItemWithGist_PatchRequestBody_files()(*ItemWithGist_PatchRequestBody_files) { + m := &ItemWithGist_PatchRequestBody_files{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithGist_PatchRequestBody_filesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithGist_PatchRequestBody_filesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithGist_PatchRequestBody_files(), 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 *ItemWithGist_PatchRequestBody_files) 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 *ItemWithGist_PatchRequestBody_files) 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 *ItemWithGist_PatchRequestBody_files) 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 *ItemWithGist_PatchRequestBody_files) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemWithGist_PatchRequestBody_filesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/gists/item_with_sha_item_request_builder.go b/pkg/github/gists/item_with_sha_item_request_builder.go new file mode 100644 index 00000000..ecd474b9 --- /dev/null +++ b/pkg/github/gists/item_with_sha_item_request_builder.go @@ -0,0 +1,65 @@ +package gists + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemWithShaItemRequestBuilder builds and executes requests for operations under \gists\{gist_id}\{sha} +type ItemWithShaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemWithShaItemRequestBuilderInternal instantiates a new ItemWithShaItemRequestBuilder and sets the default values. +func NewItemWithShaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithShaItemRequestBuilder) { + m := &ItemWithShaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/{gist_id}/{sha}", pathParameters), + } + return m +} +// NewItemWithShaItemRequestBuilder instantiates a new ItemWithShaItemRequestBuilder and sets the default values. +func NewItemWithShaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithShaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemWithShaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a specified gist revision.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a GistSimpleable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/gists/gists#get-a-gist-revision +func (m *ItemWithShaItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGistSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistSimpleable), nil +} +// ToGetRequestInformation gets a specified gist revision.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a *RequestInformation when successful +func (m *ItemWithShaItemRequestBuilder) 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 *ItemWithShaItemRequestBuilder when successful +func (m *ItemWithShaItemRequestBuilder) WithUrl(rawUrl string)(*ItemWithShaItemRequestBuilder) { + return NewItemWithShaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/gists/public_request_builder.go b/pkg/github/gists/public_request_builder.go new file mode 100644 index 00000000..8930668c --- /dev/null +++ b/pkg/github/gists/public_request_builder.go @@ -0,0 +1,76 @@ +package gists + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// PublicRequestBuilder builds and executes requests for operations under \gists\public +type PublicRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// PublicRequestBuilderGetQueryParameters list public gists sorted by most recently updated to least recently updated.Note: With [pagination](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. +type PublicRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// NewPublicRequestBuilderInternal instantiates a new PublicRequestBuilder and sets the default values. +func NewPublicRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PublicRequestBuilder) { + m := &PublicRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/public{?page*,per_page*,since*}", pathParameters), + } + return m +} +// NewPublicRequestBuilder instantiates a new PublicRequestBuilder and sets the default values. +func NewPublicRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PublicRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPublicRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list public gists sorted by most recently updated to least recently updated.Note: With [pagination](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. +// returns a []BaseGistable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/gists/gists#list-public-gists +func (m *PublicRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PublicRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BaseGistable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBaseGistFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BaseGistable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BaseGistable) + } + } + return val, nil +} +// ToGetRequestInformation list public gists sorted by most recently updated to least recently updated.Note: With [pagination](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api), you can fetch up to 3000 gists. For example, you can fetch 100 pages with 30 gists per page or 30 pages with 100 gists per page. +// returns a *RequestInformation when successful +func (m *PublicRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PublicRequestBuilderGetQueryParameters])(*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 *PublicRequestBuilder when successful +func (m *PublicRequestBuilder) WithUrl(rawUrl string)(*PublicRequestBuilder) { + return NewPublicRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/gists/starred_request_builder.go b/pkg/github/gists/starred_request_builder.go new file mode 100644 index 00000000..8f526c96 --- /dev/null +++ b/pkg/github/gists/starred_request_builder.go @@ -0,0 +1,76 @@ +package gists + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// StarredRequestBuilder builds and executes requests for operations under \gists\starred +type StarredRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// StarredRequestBuilderGetQueryParameters list the authenticated user's starred gists: +type StarredRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// NewStarredRequestBuilderInternal instantiates a new StarredRequestBuilder and sets the default values. +func NewStarredRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredRequestBuilder) { + m := &StarredRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/starred{?page*,per_page*,since*}", pathParameters), + } + return m +} +// NewStarredRequestBuilder instantiates a new StarredRequestBuilder and sets the default values. +func NewStarredRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStarredRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the authenticated user's starred gists: +// returns a []BaseGistable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/gists/gists#list-starred-gists +func (m *StarredRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[StarredRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BaseGistable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBaseGistFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BaseGistable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BaseGistable) + } + } + return val, nil +} +// ToGetRequestInformation list the authenticated user's starred gists: +// returns a *RequestInformation when successful +func (m *StarredRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[StarredRequestBuilderGetQueryParameters])(*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 *StarredRequestBuilder when successful +func (m *StarredRequestBuilder) WithUrl(rawUrl string)(*StarredRequestBuilder) { + return NewStarredRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/gists/with_gist_escaped_item_request_builder.go b/pkg/github/gists/with_gist_escaped_item_request_builder.go new file mode 100644 index 00000000..0d5e7881 --- /dev/null +++ b/pkg/github/gists/with_gist_escaped_item_request_builder.go @@ -0,0 +1,160 @@ +package gists + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// WithGist_ItemRequestBuilder builds and executes requests for operations under \gists\{gist_id} +type WithGist_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// BySha gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.gists.item.item collection +// returns a *ItemWithShaItemRequestBuilder when successful +func (m *WithGist_ItemRequestBuilder) BySha(sha string)(*ItemWithShaItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if sha != "" { + urlTplParams["sha"] = sha + } + return NewItemWithShaItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemCommentsRequestBuilder when successful +func (m *WithGist_ItemRequestBuilder) Comments()(*ItemCommentsRequestBuilder) { + return NewItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Commits the commits property +// returns a *ItemCommitsRequestBuilder when successful +func (m *WithGist_ItemRequestBuilder) Commits()(*ItemCommitsRequestBuilder) { + return NewItemCommitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewWithGist_ItemRequestBuilderInternal instantiates a new WithGist_ItemRequestBuilder and sets the default values. +func NewWithGist_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithGist_ItemRequestBuilder) { + m := &WithGist_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gists/{gist_id}", pathParameters), + } + return m +} +// NewWithGist_ItemRequestBuilder instantiates a new WithGist_ItemRequestBuilder and sets the default values. +func NewWithGist_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithGist_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithGist_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a gist +// 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/enterprise-server@3.14/rest/gists/gists#delete-a-gist +func (m *WithGist_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 { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Forks the forks property +// returns a *ItemForksRequestBuilder when successful +func (m *WithGist_ItemRequestBuilder) Forks()(*ItemForksRequestBuilder) { + return NewItemForksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get gets a specified gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a GistSimpleable when successful +// returns a GistSimple403Error 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/enterprise-server@3.14/rest/gists/gists#get-a-gist +func (m *WithGist_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGistSimple403ErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGistSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistSimpleable), nil +} +// Patch allows you to update a gist's description and to update, delete, or rename gist files. Filesfrom the previous version of the gist that aren't explicitly changed during an editare unchanged.At least one of `description` or `files` is required.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a GistSimpleable 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/enterprise-server@3.14/rest/gists/gists#update-a-gist +func (m *WithGist_ItemRequestBuilder) Patch(ctx context.Context, body ItemWithGist_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistSimpleable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGistSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GistSimpleable), nil +} +// Star the star property +// returns a *ItemStarRequestBuilder when successful +func (m *WithGist_ItemRequestBuilder) Star()(*ItemStarRequestBuilder) { + return NewItemStarRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// returns a *RequestInformation when successful +func (m *WithGist_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") + return requestInfo, nil +} +// ToGetRequestInformation gets a specified gist.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a *RequestInformation when successful +func (m *WithGist_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 allows you to update a gist's description and to update, delete, or rename gist files. Filesfrom the previous version of the gist that aren't explicitly changed during an editare unchanged.At least one of `description` or `files` is required.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown. This is the default if you do not pass any specific media type.- **`application/vnd.github.base64+json`**: Returns the base64-encoded contents. This can be useful if your gist contains any invalid UTF-8 sequences. +// returns a *RequestInformation when successful +func (m *WithGist_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemWithGist_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 *WithGist_ItemRequestBuilder when successful +func (m *WithGist_ItemRequestBuilder) WithUrl(rawUrl string)(*WithGist_ItemRequestBuilder) { + return NewWithGist_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/gitignore/gitignore_request_builder.go b/pkg/github/gitignore/gitignore_request_builder.go new file mode 100644 index 00000000..1f096980 --- /dev/null +++ b/pkg/github/gitignore/gitignore_request_builder.go @@ -0,0 +1,28 @@ +package gitignore + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// GitignoreRequestBuilder builds and executes requests for operations under \gitignore +type GitignoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewGitignoreRequestBuilderInternal instantiates a new GitignoreRequestBuilder and sets the default values. +func NewGitignoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GitignoreRequestBuilder) { + m := &GitignoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gitignore", pathParameters), + } + return m +} +// NewGitignoreRequestBuilder instantiates a new GitignoreRequestBuilder and sets the default values. +func NewGitignoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*GitignoreRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewGitignoreRequestBuilderInternal(urlParams, requestAdapter) +} +// Templates the templates property +// returns a *TemplatesRequestBuilder when successful +func (m *GitignoreRequestBuilder) Templates()(*TemplatesRequestBuilder) { + return NewTemplatesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/gitignore/templates_request_builder.go b/pkg/github/gitignore/templates_request_builder.go new file mode 100644 index 00000000..e1d20b85 --- /dev/null +++ b/pkg/github/gitignore/templates_request_builder.go @@ -0,0 +1,71 @@ +package gitignore + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// TemplatesRequestBuilder builds and executes requests for operations under \gitignore\templates +type TemplatesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByName gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.gitignore.templates.item collection +// returns a *TemplatesWithNameItemRequestBuilder when successful +func (m *TemplatesRequestBuilder) ByName(name string)(*TemplatesWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewTemplatesWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewTemplatesRequestBuilderInternal instantiates a new TemplatesRequestBuilder and sets the default values. +func NewTemplatesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TemplatesRequestBuilder) { + m := &TemplatesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gitignore/templates", pathParameters), + } + return m +} +// NewTemplatesRequestBuilder instantiates a new TemplatesRequestBuilder and sets the default values. +func NewTemplatesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TemplatesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTemplatesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all templates available to pass as an option when [creating a repository](https://docs.github.com/enterprise-server@3.14/rest/repos/repos#create-a-repository-for-the-authenticated-user). +// returns a []string when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/gitignore/gitignore#get-all-gitignore-templates +func (m *TemplatesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]string, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitiveCollection(ctx, requestInfo, "string", nil) + if err != nil { + return nil, err + } + val := make([]string, len(res)) + for i, v := range res { + if v != nil { + val[i] = *(v.(*string)) + } + } + return val, nil +} +// ToGetRequestInformation list all templates available to pass as an option when [creating a repository](https://docs.github.com/enterprise-server@3.14/rest/repos/repos#create-a-repository-for-the-authenticated-user). +// returns a *RequestInformation when successful +func (m *TemplatesRequestBuilder) 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 *TemplatesRequestBuilder when successful +func (m *TemplatesRequestBuilder) WithUrl(rawUrl string)(*TemplatesRequestBuilder) { + return NewTemplatesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/gitignore/templates_with_name_item_request_builder.go b/pkg/github/gitignore/templates_with_name_item_request_builder.go new file mode 100644 index 00000000..6ec0d030 --- /dev/null +++ b/pkg/github/gitignore/templates_with_name_item_request_builder.go @@ -0,0 +1,57 @@ +package gitignore + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// TemplatesWithNameItemRequestBuilder builds and executes requests for operations under \gitignore\templates\{name} +type TemplatesWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewTemplatesWithNameItemRequestBuilderInternal instantiates a new TemplatesWithNameItemRequestBuilder and sets the default values. +func NewTemplatesWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TemplatesWithNameItemRequestBuilder) { + m := &TemplatesWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/gitignore/templates/{name}", pathParameters), + } + return m +} +// NewTemplatesWithNameItemRequestBuilder instantiates a new TemplatesWithNameItemRequestBuilder and sets the default values. +func NewTemplatesWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TemplatesWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTemplatesWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get the content of a gitignore template.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw .gitignore contents. +// returns a GitignoreTemplateable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/gitignore/gitignore#get-a-gitignore-template +func (m *TemplatesWithNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitignoreTemplateable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGitignoreTemplateFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitignoreTemplateable), nil +} +// ToGetRequestInformation get the content of a gitignore template.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw .gitignore contents. +// returns a *RequestInformation when successful +func (m *TemplatesWithNameItemRequestBuilder) 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 *TemplatesWithNameItemRequestBuilder when successful +func (m *TemplatesWithNameItemRequestBuilder) WithUrl(rawUrl string)(*TemplatesWithNameItemRequestBuilder) { + return NewTemplatesWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/installation/installation_request_builder.go b/pkg/github/installation/installation_request_builder.go new file mode 100644 index 00000000..5a20731e --- /dev/null +++ b/pkg/github/installation/installation_request_builder.go @@ -0,0 +1,33 @@ +package installation + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// InstallationRequestBuilder builds and executes requests for operations under \installation +type InstallationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewInstallationRequestBuilderInternal instantiates a new InstallationRequestBuilder and sets the default values. +func NewInstallationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationRequestBuilder) { + m := &InstallationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/installation", pathParameters), + } + return m +} +// NewInstallationRequestBuilder instantiates a new InstallationRequestBuilder and sets the default values. +func NewInstallationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationRequestBuilderInternal(urlParams, requestAdapter) +} +// Repositories the repositories property +// returns a *RepositoriesRequestBuilder when successful +func (m *InstallationRequestBuilder) Repositories()(*RepositoriesRequestBuilder) { + return NewRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Token the token property +// returns a *TokenRequestBuilder when successful +func (m *InstallationRequestBuilder) Token()(*TokenRequestBuilder) { + return NewTokenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/installation/repositories_get_response.go b/pkg/github/installation/repositories_get_response.go new file mode 100644 index 00000000..422e9eb8 --- /dev/null +++ b/pkg/github/installation/repositories_get_response.go @@ -0,0 +1,151 @@ +package installation + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type RepositoriesGetResponse 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 repositories property + repositories []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable + // The repository_selection property + repository_selection *string + // The total_count property + total_count *int32 +} +// NewRepositoriesGetResponse instantiates a new RepositoriesGetResponse and sets the default values. +func NewRepositoriesGetResponse()(*RepositoriesGetResponse) { + m := &RepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoriesGetResponse(), 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 *RepositoriesGetResponse) 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 *RepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val) + } + 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 +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []Repositoryable when successful +func (m *RepositoriesGetResponse) GetRepositories()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable) { + return m.repositories +} +// GetRepositorySelection gets the repository_selection property value. The repository_selection property +// returns a *string when successful +func (m *RepositoriesGetResponse) GetRepositorySelection()(*string) { + return m.repository_selection +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *RepositoriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *RepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_selection", m.GetRepositorySelection()) + 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 *RepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *RepositoriesGetResponse) SetRepositories(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable)() { + m.repositories = value +} +// SetRepositorySelection sets the repository_selection property value. The repository_selection property +func (m *RepositoriesGetResponse) SetRepositorySelection(value *string)() { + m.repository_selection = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *RepositoriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type RepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable) + GetRepositorySelection()(*string) + GetTotalCount()(*int32) + SetRepositories(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable)() + SetRepositorySelection(value *string)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/installation/repositories_request_builder.go b/pkg/github/installation/repositories_request_builder.go new file mode 100644 index 00000000..3bdc368f --- /dev/null +++ b/pkg/github/installation/repositories_request_builder.go @@ -0,0 +1,70 @@ +package installation + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// RepositoriesRequestBuilder builds and executes requests for operations under \installation\repositories +type RepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// RepositoriesRequestBuilderGetQueryParameters list repositories that an app installation can access. +type RepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewRepositoriesRequestBuilderInternal instantiates a new RepositoriesRequestBuilder and sets the default values. +func NewRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RepositoriesRequestBuilder) { + m := &RepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/installation/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewRepositoriesRequestBuilder instantiates a new RepositoriesRequestBuilder and sets the default values. +func NewRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list repositories that an app installation can access. +// returns a RepositoriesGetResponseable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/installations#list-repositories-accessible-to-the-app-installation +func (m *RepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[RepositoriesRequestBuilderGetQueryParameters])(RepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateRepositoriesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(RepositoriesGetResponseable), nil +} +// ToGetRequestInformation list repositories that an app installation can access. +// returns a *RequestInformation when successful +func (m *RepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[RepositoriesRequestBuilderGetQueryParameters])(*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 *RepositoriesRequestBuilder when successful +func (m *RepositoriesRequestBuilder) WithUrl(rawUrl string)(*RepositoriesRequestBuilder) { + return NewRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/installation/token_request_builder.go b/pkg/github/installation/token_request_builder.go new file mode 100644 index 00000000..627219ab --- /dev/null +++ b/pkg/github/installation/token_request_builder.go @@ -0,0 +1,51 @@ +package installation + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// TokenRequestBuilder builds and executes requests for operations under \installation\token +type TokenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewTokenRequestBuilderInternal instantiates a new TokenRequestBuilder and sets the default values. +func NewTokenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TokenRequestBuilder) { + m := &TokenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/installation/token", pathParameters), + } + return m +} +// NewTokenRequestBuilder instantiates a new TokenRequestBuilder and sets the default values. +func NewTokenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TokenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTokenRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete revokes the installation token you're using to authenticate as an installation and access this endpoint.Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#create-an-installation-access-token-for-an-app)" endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/installations#revoke-an-installation-access-token +func (m *TokenRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation revokes the installation token you're using to authenticate as an installation and access this endpoint.Once an installation token is revoked, the token is invalidated and cannot be used. Other endpoints that require the revoked installation token must have a new installation token to work. You can create a new token using the "[Create an installation access token for an app](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#create-an-installation-access-token-for-an-app)" endpoint. +// returns a *RequestInformation when successful +func (m *TokenRequestBuilder) 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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *TokenRequestBuilder when successful +func (m *TokenRequestBuilder) WithUrl(rawUrl string)(*TokenRequestBuilder) { + return NewTokenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/issues/get_direction_query_parameter_type.go b/pkg/github/issues/get_direction_query_parameter_type.go new file mode 100644 index 00000000..f176c1cc --- /dev/null +++ b/pkg/github/issues/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package issues +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/issues/get_filter_query_parameter_type.go b/pkg/github/issues/get_filter_query_parameter_type.go new file mode 100644 index 00000000..0c77b959 --- /dev/null +++ b/pkg/github/issues/get_filter_query_parameter_type.go @@ -0,0 +1,45 @@ +package issues +type GetFilterQueryParameterType int + +const ( + ASSIGNED_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + CREATED_GETFILTERQUERYPARAMETERTYPE + MENTIONED_GETFILTERQUERYPARAMETERTYPE + SUBSCRIBED_GETFILTERQUERYPARAMETERTYPE + REPOS_GETFILTERQUERYPARAMETERTYPE + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"assigned", "created", "mentioned", "subscribed", "repos", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := ASSIGNED_GETFILTERQUERYPARAMETERTYPE + switch v { + case "assigned": + result = ASSIGNED_GETFILTERQUERYPARAMETERTYPE + case "created": + result = CREATED_GETFILTERQUERYPARAMETERTYPE + case "mentioned": + result = MENTIONED_GETFILTERQUERYPARAMETERTYPE + case "subscribed": + result = SUBSCRIBED_GETFILTERQUERYPARAMETERTYPE + case "repos": + result = REPOS_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/issues/get_sort_query_parameter_type.go b/pkg/github/issues/get_sort_query_parameter_type.go new file mode 100644 index 00000000..10b7912a --- /dev/null +++ b/pkg/github/issues/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package issues +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + COMMENTS_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "comments"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "comments": + result = COMMENTS_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/issues/get_state_query_parameter_type.go b/pkg/github/issues/get_state_query_parameter_type.go new file mode 100644 index 00000000..065faf93 --- /dev/null +++ b/pkg/github/issues/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package issues +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/issues/issues_request_builder.go b/pkg/github/issues/issues_request_builder.go new file mode 100644 index 00000000..50e577eb --- /dev/null +++ b/pkg/github/issues/issues_request_builder.go @@ -0,0 +1,90 @@ +package issues + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// IssuesRequestBuilder builds and executes requests for operations under \issues +type IssuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// IssuesRequestBuilderGetQueryParameters list issues assigned to the authenticated user across all visible repositories including owned repositories, memberrepositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are notnecessarily assigned to you.> [!NOTE]> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type IssuesRequestBuilderGetQueryParameters struct { + Collab *bool `uriparametername:"collab"` + // The direction to sort the results by. + Direction *GetDirectionQueryParameterType `uriparametername:"direction"` + // Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. + Filter *GetFilterQueryParameterType `uriparametername:"filter"` + // A list of comma separated label names. Example: `bug,ui,@high` + Labels *string `uriparametername:"labels"` + Orgs *bool `uriparametername:"orgs"` + Owned *bool `uriparametername:"owned"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + Pulls *bool `uriparametername:"pulls"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // What to sort results by. + Sort *GetSortQueryParameterType `uriparametername:"sort"` + // Indicates the state of the issues to return. + State *GetStateQueryParameterType `uriparametername:"state"` +} +// NewIssuesRequestBuilderInternal instantiates a new IssuesRequestBuilder and sets the default values. +func NewIssuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IssuesRequestBuilder) { + m := &IssuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/issues{?collab*,direction*,filter*,labels*,orgs*,owned*,page*,per_page*,pulls*,since*,sort*,state*}", pathParameters), + } + return m +} +// NewIssuesRequestBuilder instantiates a new IssuesRequestBuilder and sets the default values. +func NewIssuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IssuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewIssuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list issues assigned to the authenticated user across all visible repositories including owned repositories, memberrepositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are notnecessarily assigned to you.> [!NOTE]> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []Issueable 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/enterprise-server@3.14/rest/issues/issues#list-issues-assigned-to-the-authenticated-user +func (m *IssuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[IssuesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable) + } + } + return val, nil +} +// ToGetRequestInformation list issues assigned to the authenticated user across all visible repositories including owned repositories, memberrepositories, and organization repositories. You can use the `filter` query parameter to fetch issues that are notnecessarily assigned to you.> [!NOTE]> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *IssuesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[IssuesRequestBuilderGetQueryParameters])(*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 *IssuesRequestBuilder when successful +func (m *IssuesRequestBuilder) WithUrl(rawUrl string)(*IssuesRequestBuilder) { + return NewIssuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/kiota-lock.json b/pkg/github/kiota-lock.json new file mode 100644 index 00000000..8b73fffc --- /dev/null +++ b/pkg/github/kiota-lock.json @@ -0,0 +1,33 @@ +{ + "descriptionHash": "A7010F4C25A6E478ADD3F3A541C16766BDE5080E4F3A031B75213252E13A3558AAD25EFC6EC6902616F3066807192AEABEB3E53CDF7965AEC66D6FBD974BBF3C", + "descriptionLocation": "../../../../../schemas/ghes-3.14.json", + "lockFileVersion": "1.0.0", + "kiotaVersion": "1.18.0", + "clientClassName": "ApiClient", + "clientNamespaceName": "github.com/octokit/go-sdk-enterprise-server/pkg/github", + "language": "Go", + "usesBackingStore": false, + "excludeBackwardCompatible": true, + "includeAdditionalData": true, + "disableSSLValidation": false, + "serializers": [ + "Microsoft.Kiota.Serialization.Json.JsonSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Text.TextSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Form.FormSerializationWriterFactory", + "Microsoft.Kiota.Serialization.Multipart.MultipartSerializationWriterFactory" + ], + "deserializers": [ + "Microsoft.Kiota.Serialization.Json.JsonParseNodeFactory", + "Microsoft.Kiota.Serialization.Text.TextParseNodeFactory", + "Microsoft.Kiota.Serialization.Form.FormParseNodeFactory" + ], + "structuredMimeTypes": [ + "application/json", + "text/plain;q=0.9", + "application/x-www-form-urlencoded;q=0.2", + "multipart/form-data;q=0.1" + ], + "includePatterns": [], + "excludePatterns": [], + "disabledValidationRules": [] +} \ No newline at end of file diff --git a/pkg/github/licenses/licenses_request_builder.go b/pkg/github/licenses/licenses_request_builder.go new file mode 100644 index 00000000..c63f2c53 --- /dev/null +++ b/pkg/github/licenses/licenses_request_builder.go @@ -0,0 +1,80 @@ +package licenses + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// LicensesRequestBuilder builds and executes requests for operations under \licenses +type LicensesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// LicensesRequestBuilderGetQueryParameters lists the most commonly used licenses on GitHub. For more information, see "[Licensing a repository ](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)." +type LicensesRequestBuilderGetQueryParameters struct { + Featured *bool `uriparametername:"featured"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByLicense gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.licenses.item collection +// returns a *WithLicenseItemRequestBuilder when successful +func (m *LicensesRequestBuilder) ByLicense(license string)(*WithLicenseItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if license != "" { + urlTplParams["license"] = license + } + return NewWithLicenseItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewLicensesRequestBuilderInternal instantiates a new LicensesRequestBuilder and sets the default values. +func NewLicensesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LicensesRequestBuilder) { + m := &LicensesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/licenses{?featured*,page*,per_page*}", pathParameters), + } + return m +} +// NewLicensesRequestBuilder instantiates a new LicensesRequestBuilder and sets the default values. +func NewLicensesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LicensesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewLicensesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the most commonly used licenses on GitHub. For more information, see "[Licensing a repository ](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)." +// returns a []LicenseSimpleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/licenses/licenses#get-all-commonly-used-licenses +func (m *LicensesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[LicensesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LicenseSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLicenseSimpleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LicenseSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LicenseSimpleable) + } + } + return val, nil +} +// ToGetRequestInformation lists the most commonly used licenses on GitHub. For more information, see "[Licensing a repository ](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)." +// returns a *RequestInformation when successful +func (m *LicensesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[LicensesRequestBuilderGetQueryParameters])(*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 *LicensesRequestBuilder when successful +func (m *LicensesRequestBuilder) WithUrl(rawUrl string)(*LicensesRequestBuilder) { + return NewLicensesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/licenses/with_license_item_request_builder.go b/pkg/github/licenses/with_license_item_request_builder.go new file mode 100644 index 00000000..fbb328d8 --- /dev/null +++ b/pkg/github/licenses/with_license_item_request_builder.go @@ -0,0 +1,63 @@ +package licenses + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// WithLicenseItemRequestBuilder builds and executes requests for operations under \licenses\{license} +type WithLicenseItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithLicenseItemRequestBuilderInternal instantiates a new WithLicenseItemRequestBuilder and sets the default values. +func NewWithLicenseItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithLicenseItemRequestBuilder) { + m := &WithLicenseItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/licenses/{license}", pathParameters), + } + return m +} +// NewWithLicenseItemRequestBuilder instantiates a new WithLicenseItemRequestBuilder and sets the default values. +func NewWithLicenseItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithLicenseItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithLicenseItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets information about a specific license. For more information, see "[Licensing a repository ](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)." +// returns a Licenseable 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/enterprise-server@3.14/rest/licenses/licenses#get-a-license +func (m *WithLicenseItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Licenseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLicenseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Licenseable), nil +} +// ToGetRequestInformation gets information about a specific license. For more information, see "[Licensing a repository ](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/licensing-a-repository)." +// returns a *RequestInformation when successful +func (m *WithLicenseItemRequestBuilder) 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 *WithLicenseItemRequestBuilder when successful +func (m *WithLicenseItemRequestBuilder) WithUrl(rawUrl string)(*WithLicenseItemRequestBuilder) { + return NewWithLicenseItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/manage/manage_request_builder.go b/pkg/github/manage/manage_request_builder.go new file mode 100644 index 00000000..67a9599a --- /dev/null +++ b/pkg/github/manage/manage_request_builder.go @@ -0,0 +1,28 @@ +package manage + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ManageRequestBuilder builds and executes requests for operations under \manage +type ManageRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewManageRequestBuilderInternal instantiates a new ManageRequestBuilder and sets the default values. +func NewManageRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ManageRequestBuilder) { + m := &ManageRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage", pathParameters), + } + return m +} +// NewManageRequestBuilder instantiates a new ManageRequestBuilder and sets the default values. +func NewManageRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ManageRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewManageRequestBuilderInternal(urlParams, requestAdapter) +} +// V1 the v1 property +// returns a *V1RequestBuilder when successful +func (m *ManageRequestBuilder) V1()(*V1RequestBuilder) { + return NewV1RequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/manage/v1_access_request_builder.go b/pkg/github/manage/v1_access_request_builder.go new file mode 100644 index 00000000..ab5f8a6d --- /dev/null +++ b/pkg/github/manage/v1_access_request_builder.go @@ -0,0 +1,28 @@ +package manage + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// V1AccessRequestBuilder builds and executes requests for operations under \manage\v1\access +type V1AccessRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewV1AccessRequestBuilderInternal instantiates a new V1AccessRequestBuilder and sets the default values. +func NewV1AccessRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1AccessRequestBuilder) { + m := &V1AccessRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/access", pathParameters), + } + return m +} +// NewV1AccessRequestBuilder instantiates a new V1AccessRequestBuilder and sets the default values. +func NewV1AccessRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1AccessRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1AccessRequestBuilderInternal(urlParams, requestAdapter) +} +// Ssh the ssh property +// returns a *V1AccessSshRequestBuilder when successful +func (m *V1AccessRequestBuilder) Ssh()(*V1AccessSshRequestBuilder) { + return NewV1AccessSshRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/manage/v1_access_ssh_request_builder.go b/pkg/github/manage/v1_access_ssh_request_builder.go new file mode 100644 index 00000000..97b670fb --- /dev/null +++ b/pkg/github/manage/v1_access_ssh_request_builder.go @@ -0,0 +1,128 @@ +package manage + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V1AccessSshRequestBuilder builds and executes requests for operations under \manage\v1\access\ssh +type V1AccessSshRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewV1AccessSshRequestBuilderInternal instantiates a new V1AccessSshRequestBuilder and sets the default values. +func NewV1AccessSshRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1AccessSshRequestBuilder) { + m := &V1AccessSshRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/access/ssh", pathParameters), + } + return m +} +// NewV1AccessSshRequestBuilder instantiates a new V1AccessSshRequestBuilder and sets the default values. +func NewV1AccessSshRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1AccessSshRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1AccessSshRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a SSH key from the `authorized_keys` file for your GitHub Enterprise Server instance. This will remove access via SSH to your instance. For more information, see "[Accessing the administrative shell (SSH)](https://docs.github.com/enterprise-server@3.14/admin/administering-your-instance/administering-your-instance-from-the-command-line/accessing-the-administrative-shell-ssh)." +// returns a []GhesDeleteSshResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#delete-a-ssh-key +func (m *V1AccessSshRequestBuilder) Delete(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesDeleteSshRequestable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesDeleteSshResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGhesDeleteSshResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesDeleteSshResponseable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesDeleteSshResponseable) + } + } + return val, nil +} +// Get gets the configured SSH keys on all available nodes. For more information, see "[Accessing the administrative shell (SSH)](https://docs.github.com/enterprise-server@3.14/admin/administering-your-instance/administering-your-instance-from-the-command-line/accessing-the-administrative-shell-ssh)." +// returns a []GhesGetSshable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-configured-ssh-keys +func (m *V1AccessSshRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesGetSshable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGhesGetSshFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesGetSshable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesGetSshable) + } + } + return val, nil +} +// Post adds a SSH key to the `authorized_keys` file for your GitHub Enterprise Server instance. This will grant access via SSH to your instance. For more information, see "[Accessing the administrative shell (SSH)](https://docs.github.com/enterprise-server@3.14/admin/administering-your-instance/administering-your-instance-from-the-command-line/accessing-the-administrative-shell-ssh)." +// returns a []GhesSetSshResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#set-a-new-ssh-key +func (m *V1AccessSshRequestBuilder) Post(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesSetSshRequestable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesSetSshResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGhesSetSshResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesSetSshResponseable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesSetSshResponseable) + } + } + return val, nil +} +// ToDeleteRequestInformation deletes a SSH key from the `authorized_keys` file for your GitHub Enterprise Server instance. This will remove access via SSH to your instance. For more information, see "[Accessing the administrative shell (SSH)](https://docs.github.com/enterprise-server@3.14/admin/administering-your-instance/administering-your-instance-from-the-command-line/accessing-the-administrative-shell-ssh)." +// returns a *RequestInformation when successful +func (m *V1AccessSshRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesDeleteSshRequestable, 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") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation gets the configured SSH keys on all available nodes. For more information, see "[Accessing the administrative shell (SSH)](https://docs.github.com/enterprise-server@3.14/admin/administering-your-instance/administering-your-instance-from-the-command-line/accessing-the-administrative-shell-ssh)." +// returns a *RequestInformation when successful +func (m *V1AccessSshRequestBuilder) 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 adds a SSH key to the `authorized_keys` file for your GitHub Enterprise Server instance. This will grant access via SSH to your instance. For more information, see "[Accessing the administrative shell (SSH)](https://docs.github.com/enterprise-server@3.14/admin/administering-your-instance/administering-your-instance-from-the-command-line/accessing-the-administrative-shell-ssh)." +// returns a *RequestInformation when successful +func (m *V1AccessSshRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesSetSshRequestable, 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 *V1AccessSshRequestBuilder when successful +func (m *V1AccessSshRequestBuilder) WithUrl(rawUrl string)(*V1AccessSshRequestBuilder) { + return NewV1AccessSshRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/manage/v1_checks_request_builder.go b/pkg/github/manage/v1_checks_request_builder.go new file mode 100644 index 00000000..0b15983f --- /dev/null +++ b/pkg/github/manage/v1_checks_request_builder.go @@ -0,0 +1,28 @@ +package manage + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// V1ChecksRequestBuilder builds and executes requests for operations under \manage\v1\checks +type V1ChecksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewV1ChecksRequestBuilderInternal instantiates a new V1ChecksRequestBuilder and sets the default values. +func NewV1ChecksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ChecksRequestBuilder) { + m := &V1ChecksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/checks", pathParameters), + } + return m +} +// NewV1ChecksRequestBuilder instantiates a new V1ChecksRequestBuilder and sets the default values. +func NewV1ChecksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ChecksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1ChecksRequestBuilderInternal(urlParams, requestAdapter) +} +// SystemRequirements the systemRequirements property +// returns a *V1ChecksSystemRequirementsRequestBuilder when successful +func (m *V1ChecksRequestBuilder) SystemRequirements()(*V1ChecksSystemRequirementsRequestBuilder) { + return NewV1ChecksSystemRequirementsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/manage/v1_checks_system_requirements_request_builder.go b/pkg/github/manage/v1_checks_system_requirements_request_builder.go new file mode 100644 index 00000000..e9736af6 --- /dev/null +++ b/pkg/github/manage/v1_checks_system_requirements_request_builder.go @@ -0,0 +1,57 @@ +package manage + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V1ChecksSystemRequirementsRequestBuilder builds and executes requests for operations under \manage\v1\checks\system-requirements +type V1ChecksSystemRequirementsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewV1ChecksSystemRequirementsRequestBuilderInternal instantiates a new V1ChecksSystemRequirementsRequestBuilder and sets the default values. +func NewV1ChecksSystemRequirementsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ChecksSystemRequirementsRequestBuilder) { + m := &V1ChecksSystemRequirementsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/checks/system-requirements", pathParameters), + } + return m +} +// NewV1ChecksSystemRequirementsRequestBuilder instantiates a new V1ChecksSystemRequirementsRequestBuilder and sets the default values. +func NewV1ChecksSystemRequirementsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ChecksSystemRequirementsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1ChecksSystemRequirementsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get checks if the minimum requirements for system hardware resources are met on each configured cluster node.This endpoint may take several seconds to reply. +// returns a GhesChecksSystemRequirementsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-system-requirement-check-results-for-configured-cluster-nodes +func (m *V1ChecksSystemRequirementsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesChecksSystemRequirementsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGhesChecksSystemRequirementsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesChecksSystemRequirementsable), nil +} +// ToGetRequestInformation checks if the minimum requirements for system hardware resources are met on each configured cluster node.This endpoint may take several seconds to reply. +// returns a *RequestInformation when successful +func (m *V1ChecksSystemRequirementsRequestBuilder) 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 *V1ChecksSystemRequirementsRequestBuilder when successful +func (m *V1ChecksSystemRequirementsRequestBuilder) WithUrl(rawUrl string)(*V1ChecksSystemRequirementsRequestBuilder) { + return NewV1ChecksSystemRequirementsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/manage/v1_cluster_request_builder.go b/pkg/github/manage/v1_cluster_request_builder.go new file mode 100644 index 00000000..b782177a --- /dev/null +++ b/pkg/github/manage/v1_cluster_request_builder.go @@ -0,0 +1,28 @@ +package manage + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// V1ClusterRequestBuilder builds and executes requests for operations under \manage\v1\cluster +type V1ClusterRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewV1ClusterRequestBuilderInternal instantiates a new V1ClusterRequestBuilder and sets the default values. +func NewV1ClusterRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ClusterRequestBuilder) { + m := &V1ClusterRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/cluster", pathParameters), + } + return m +} +// NewV1ClusterRequestBuilder instantiates a new V1ClusterRequestBuilder and sets the default values. +func NewV1ClusterRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ClusterRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1ClusterRequestBuilderInternal(urlParams, requestAdapter) +} +// Status the status property +// returns a *V1ClusterStatusRequestBuilder when successful +func (m *V1ClusterRequestBuilder) Status()(*V1ClusterStatusRequestBuilder) { + return NewV1ClusterStatusRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/manage/v1_cluster_status_request_builder.go b/pkg/github/manage/v1_cluster_status_request_builder.go new file mode 100644 index 00000000..422520d0 --- /dev/null +++ b/pkg/github/manage/v1_cluster_status_request_builder.go @@ -0,0 +1,57 @@ +package manage + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V1ClusterStatusRequestBuilder builds and executes requests for operations under \manage\v1\cluster\status +type V1ClusterStatusRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewV1ClusterStatusRequestBuilderInternal instantiates a new V1ClusterStatusRequestBuilder and sets the default values. +func NewV1ClusterStatusRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ClusterStatusRequestBuilder) { + m := &V1ClusterStatusRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/cluster/status", pathParameters), + } + return m +} +// NewV1ClusterStatusRequestBuilder instantiates a new V1ClusterStatusRequestBuilder and sets the default values. +func NewV1ClusterStatusRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ClusterStatusRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1ClusterStatusRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the status of all services running on each cluster node.This endpoint may take several seconds to reply. +// returns a GhesClusterStatusable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-cluster-nodes +func (m *V1ClusterStatusRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesClusterStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGhesClusterStatusFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesClusterStatusable), nil +} +// ToGetRequestInformation gets the status of all services running on each cluster node.This endpoint may take several seconds to reply. +// returns a *RequestInformation when successful +func (m *V1ClusterStatusRequestBuilder) 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 *V1ClusterStatusRequestBuilder when successful +func (m *V1ClusterStatusRequestBuilder) WithUrl(rawUrl string)(*V1ClusterStatusRequestBuilder) { + return NewV1ClusterStatusRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/manage/v1_config_apply_events_get_response.go b/pkg/github/manage/v1_config_apply_events_get_response.go new file mode 100644 index 00000000..188e39f2 --- /dev/null +++ b/pkg/github/manage/v1_config_apply_events_get_response.go @@ -0,0 +1,92 @@ +package manage + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type V1ConfigApplyEventsGetResponse 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 nodes property + nodes []V1ConfigApplyEventsGetResponse_nodesable +} +// NewV1ConfigApplyEventsGetResponse instantiates a new V1ConfigApplyEventsGetResponse and sets the default values. +func NewV1ConfigApplyEventsGetResponse()(*V1ConfigApplyEventsGetResponse) { + m := &V1ConfigApplyEventsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateV1ConfigApplyEventsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateV1ConfigApplyEventsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewV1ConfigApplyEventsGetResponse(), 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 *V1ConfigApplyEventsGetResponse) 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 *V1ConfigApplyEventsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["nodes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateV1ConfigApplyEventsGetResponse_nodesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]V1ConfigApplyEventsGetResponse_nodesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(V1ConfigApplyEventsGetResponse_nodesable) + } + } + m.SetNodes(res) + } + return nil + } + return res +} +// GetNodes gets the nodes property value. The nodes property +// returns a []V1ConfigApplyEventsGetResponse_nodesable when successful +func (m *V1ConfigApplyEventsGetResponse) GetNodes()([]V1ConfigApplyEventsGetResponse_nodesable) { + return m.nodes +} +// Serialize serializes information the current object +func (m *V1ConfigApplyEventsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetNodes() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetNodes())) + for i, v := range m.GetNodes() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("nodes", 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 *V1ConfigApplyEventsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNodes sets the nodes property value. The nodes property +func (m *V1ConfigApplyEventsGetResponse) SetNodes(value []V1ConfigApplyEventsGetResponse_nodesable)() { + m.nodes = value +} +type V1ConfigApplyEventsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNodes()([]V1ConfigApplyEventsGetResponse_nodesable) + SetNodes(value []V1ConfigApplyEventsGetResponse_nodesable)() +} diff --git a/pkg/github/manage/v1_config_apply_events_get_response_escaped_nodes.go b/pkg/github/manage/v1_config_apply_events_get_response_escaped_nodes.go new file mode 100644 index 00000000..82d30ed8 --- /dev/null +++ b/pkg/github/manage/v1_config_apply_events_get_response_escaped_nodes.go @@ -0,0 +1,150 @@ +package manage + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type V1ConfigApplyEventsGetResponse_nodes 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 events property + events []V1ConfigApplyEventsGetResponse_nodes_eventsable + // Unique ID of the last response from a host used for pagination + last_request_id *string + // Hostname of the node + node *string +} +// NewV1ConfigApplyEventsGetResponse_nodes instantiates a new V1ConfigApplyEventsGetResponse_nodes and sets the default values. +func NewV1ConfigApplyEventsGetResponse_nodes()(*V1ConfigApplyEventsGetResponse_nodes) { + m := &V1ConfigApplyEventsGetResponse_nodes{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateV1ConfigApplyEventsGetResponse_nodesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateV1ConfigApplyEventsGetResponse_nodesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewV1ConfigApplyEventsGetResponse_nodes(), 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 *V1ConfigApplyEventsGetResponse_nodes) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEvents gets the events property value. The events property +// returns a []V1ConfigApplyEventsGetResponse_nodes_eventsable when successful +func (m *V1ConfigApplyEventsGetResponse_nodes) GetEvents()([]V1ConfigApplyEventsGetResponse_nodes_eventsable) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *V1ConfigApplyEventsGetResponse_nodes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateV1ConfigApplyEventsGetResponse_nodes_eventsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]V1ConfigApplyEventsGetResponse_nodes_eventsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(V1ConfigApplyEventsGetResponse_nodes_eventsable) + } + } + m.SetEvents(res) + } + return nil + } + res["last_request_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLastRequestId(val) + } + return nil + } + res["node"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNode(val) + } + return nil + } + return res +} +// GetLastRequestId gets the last_request_id property value. Unique ID of the last response from a host used for pagination +// returns a *string when successful +func (m *V1ConfigApplyEventsGetResponse_nodes) GetLastRequestId()(*string) { + return m.last_request_id +} +// GetNode gets the node property value. Hostname of the node +// returns a *string when successful +func (m *V1ConfigApplyEventsGetResponse_nodes) GetNode()(*string) { + return m.node +} +// Serialize serializes information the current object +func (m *V1ConfigApplyEventsGetResponse_nodes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEvents() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetEvents())) + for i, v := range m.GetEvents() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("events", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("last_request_id", m.GetLastRequestId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node", m.GetNode()) + 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 *V1ConfigApplyEventsGetResponse_nodes) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEvents sets the events property value. The events property +func (m *V1ConfigApplyEventsGetResponse_nodes) SetEvents(value []V1ConfigApplyEventsGetResponse_nodes_eventsable)() { + m.events = value +} +// SetLastRequestId sets the last_request_id property value. Unique ID of the last response from a host used for pagination +func (m *V1ConfigApplyEventsGetResponse_nodes) SetLastRequestId(value *string)() { + m.last_request_id = value +} +// SetNode sets the node property value. Hostname of the node +func (m *V1ConfigApplyEventsGetResponse_nodes) SetNode(value *string)() { + m.node = value +} +type V1ConfigApplyEventsGetResponse_nodesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEvents()([]V1ConfigApplyEventsGetResponse_nodes_eventsable) + GetLastRequestId()(*string) + GetNode()(*string) + SetEvents(value []V1ConfigApplyEventsGetResponse_nodes_eventsable)() + SetLastRequestId(value *string)() + SetNode(value *string)() +} diff --git a/pkg/github/manage/v1_config_apply_events_get_response_escaped_nodes_escaped_events.go b/pkg/github/manage/v1_config_apply_events_get_response_escaped_nodes_escaped_events.go new file mode 100644 index 00000000..b68ca444 --- /dev/null +++ b/pkg/github/manage/v1_config_apply_events_get_response_escaped_nodes_escaped_events.go @@ -0,0 +1,370 @@ +package manage + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type V1ConfigApplyEventsGetResponse_nodes_events 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 body property + body *string + // The config_run_id property + config_run_id *string + // The event_name property + event_name *string + // The hostname property + hostname *string + // The severity_text property + severity_text *string + // The span_depth property + span_depth *int32 + // The span_id property + span_id *string + // The span_parent_id property + span_parent_id *string + // The timestamp property + timestamp *string + // The topology property + topology *string + // The trace_id property + trace_id *string +} +// NewV1ConfigApplyEventsGetResponse_nodes_events instantiates a new V1ConfigApplyEventsGetResponse_nodes_events and sets the default values. +func NewV1ConfigApplyEventsGetResponse_nodes_events()(*V1ConfigApplyEventsGetResponse_nodes_events) { + m := &V1ConfigApplyEventsGetResponse_nodes_events{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateV1ConfigApplyEventsGetResponse_nodes_eventsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateV1ConfigApplyEventsGetResponse_nodes_eventsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewV1ConfigApplyEventsGetResponse_nodes_events(), 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 *V1ConfigApplyEventsGetResponse_nodes_events) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *V1ConfigApplyEventsGetResponse_nodes_events) GetBody()(*string) { + return m.body +} +// GetConfigRunId gets the config_run_id property value. The config_run_id property +// returns a *string when successful +func (m *V1ConfigApplyEventsGetResponse_nodes_events) GetConfigRunId()(*string) { + return m.config_run_id +} +// GetEventName gets the event_name property value. The event_name property +// returns a *string when successful +func (m *V1ConfigApplyEventsGetResponse_nodes_events) GetEventName()(*string) { + return m.event_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *V1ConfigApplyEventsGetResponse_nodes_events) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["config_run_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetConfigRunId(val) + } + return nil + } + res["event_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventName(val) + } + return nil + } + res["hostname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHostname(val) + } + return nil + } + res["severity_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSeverityText(val) + } + return nil + } + res["span_depth"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSpanDepth(val) + } + return nil + } + res["span_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpanId(val) + } + return nil + } + res["span_parent_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpanParentId(val) + } + return nil + } + res["timestamp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTimestamp(val) + } + return nil + } + res["topology"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTopology(val) + } + return nil + } + res["trace_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTraceId(val) + } + return nil + } + return res +} +// GetHostname gets the hostname property value. The hostname property +// returns a *string when successful +func (m *V1ConfigApplyEventsGetResponse_nodes_events) GetHostname()(*string) { + return m.hostname +} +// GetSeverityText gets the severity_text property value. The severity_text property +// returns a *string when successful +func (m *V1ConfigApplyEventsGetResponse_nodes_events) GetSeverityText()(*string) { + return m.severity_text +} +// GetSpanDepth gets the span_depth property value. The span_depth property +// returns a *int32 when successful +func (m *V1ConfigApplyEventsGetResponse_nodes_events) GetSpanDepth()(*int32) { + return m.span_depth +} +// GetSpanId gets the span_id property value. The span_id property +// returns a *string when successful +func (m *V1ConfigApplyEventsGetResponse_nodes_events) GetSpanId()(*string) { + return m.span_id +} +// GetSpanParentId gets the span_parent_id property value. The span_parent_id property +// returns a *string when successful +func (m *V1ConfigApplyEventsGetResponse_nodes_events) GetSpanParentId()(*string) { + return m.span_parent_id +} +// GetTimestamp gets the timestamp property value. The timestamp property +// returns a *string when successful +func (m *V1ConfigApplyEventsGetResponse_nodes_events) GetTimestamp()(*string) { + return m.timestamp +} +// GetTopology gets the topology property value. The topology property +// returns a *string when successful +func (m *V1ConfigApplyEventsGetResponse_nodes_events) GetTopology()(*string) { + return m.topology +} +// GetTraceId gets the trace_id property value. The trace_id property +// returns a *string when successful +func (m *V1ConfigApplyEventsGetResponse_nodes_events) GetTraceId()(*string) { + return m.trace_id +} +// Serialize serializes information the current object +func (m *V1ConfigApplyEventsGetResponse_nodes_events) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("config_run_id", m.GetConfigRunId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event_name", m.GetEventName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hostname", m.GetHostname()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("severity_text", m.GetSeverityText()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("span_depth", m.GetSpanDepth()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("span_id", m.GetSpanId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("span_parent_id", m.GetSpanParentId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("timestamp", m.GetTimestamp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("topology", m.GetTopology()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trace_id", m.GetTraceId()) + 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 *V1ConfigApplyEventsGetResponse_nodes_events) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The body property +func (m *V1ConfigApplyEventsGetResponse_nodes_events) SetBody(value *string)() { + m.body = value +} +// SetConfigRunId sets the config_run_id property value. The config_run_id property +func (m *V1ConfigApplyEventsGetResponse_nodes_events) SetConfigRunId(value *string)() { + m.config_run_id = value +} +// SetEventName sets the event_name property value. The event_name property +func (m *V1ConfigApplyEventsGetResponse_nodes_events) SetEventName(value *string)() { + m.event_name = value +} +// SetHostname sets the hostname property value. The hostname property +func (m *V1ConfigApplyEventsGetResponse_nodes_events) SetHostname(value *string)() { + m.hostname = value +} +// SetSeverityText sets the severity_text property value. The severity_text property +func (m *V1ConfigApplyEventsGetResponse_nodes_events) SetSeverityText(value *string)() { + m.severity_text = value +} +// SetSpanDepth sets the span_depth property value. The span_depth property +func (m *V1ConfigApplyEventsGetResponse_nodes_events) SetSpanDepth(value *int32)() { + m.span_depth = value +} +// SetSpanId sets the span_id property value. The span_id property +func (m *V1ConfigApplyEventsGetResponse_nodes_events) SetSpanId(value *string)() { + m.span_id = value +} +// SetSpanParentId sets the span_parent_id property value. The span_parent_id property +func (m *V1ConfigApplyEventsGetResponse_nodes_events) SetSpanParentId(value *string)() { + m.span_parent_id = value +} +// SetTimestamp sets the timestamp property value. The timestamp property +func (m *V1ConfigApplyEventsGetResponse_nodes_events) SetTimestamp(value *string)() { + m.timestamp = value +} +// SetTopology sets the topology property value. The topology property +func (m *V1ConfigApplyEventsGetResponse_nodes_events) SetTopology(value *string)() { + m.topology = value +} +// SetTraceId sets the trace_id property value. The trace_id property +func (m *V1ConfigApplyEventsGetResponse_nodes_events) SetTraceId(value *string)() { + m.trace_id = value +} +type V1ConfigApplyEventsGetResponse_nodes_eventsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetConfigRunId()(*string) + GetEventName()(*string) + GetHostname()(*string) + GetSeverityText()(*string) + GetSpanDepth()(*int32) + GetSpanId()(*string) + GetSpanParentId()(*string) + GetTimestamp()(*string) + GetTopology()(*string) + GetTraceId()(*string) + SetBody(value *string)() + SetConfigRunId(value *string)() + SetEventName(value *string)() + SetHostname(value *string)() + SetSeverityText(value *string)() + SetSpanDepth(value *int32)() + SetSpanId(value *string)() + SetSpanParentId(value *string)() + SetTimestamp(value *string)() + SetTopology(value *string)() + SetTraceId(value *string)() +} diff --git a/pkg/github/manage/v1_config_apply_events_request_builder.go b/pkg/github/manage/v1_config_apply_events_request_builder.go new file mode 100644 index 00000000..3cc65903 --- /dev/null +++ b/pkg/github/manage/v1_config_apply_events_request_builder.go @@ -0,0 +1,61 @@ +package manage + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// V1ConfigApplyEventsRequestBuilder builds and executes requests for operations under \manage\v1\config\apply\events +type V1ConfigApplyEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// V1ConfigApplyEventsRequestBuilderGetQueryParameters lists events from an in-process `ghe-config-apply` run on your Github Enterprise Server instance. +type V1ConfigApplyEventsRequestBuilderGetQueryParameters struct { + // The unique ID of the last response from a host, used for pagination. + Last_request_id *string `uriparametername:"last_request_id"` +} +// NewV1ConfigApplyEventsRequestBuilderInternal instantiates a new V1ConfigApplyEventsRequestBuilder and sets the default values. +func NewV1ConfigApplyEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigApplyEventsRequestBuilder) { + m := &V1ConfigApplyEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/config/apply/events{?last_request_id*}", pathParameters), + } + return m +} +// NewV1ConfigApplyEventsRequestBuilder instantiates a new V1ConfigApplyEventsRequestBuilder and sets the default values. +func NewV1ConfigApplyEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigApplyEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1ConfigApplyEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists events from an in-process `ghe-config-apply` run on your Github Enterprise Server instance. +// returns a V1ConfigApplyEventsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#list-events-from-ghe-config-apply +func (m *V1ConfigApplyEventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V1ConfigApplyEventsRequestBuilderGetQueryParameters])(V1ConfigApplyEventsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateV1ConfigApplyEventsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(V1ConfigApplyEventsGetResponseable), nil +} +// ToGetRequestInformation lists events from an in-process `ghe-config-apply` run on your Github Enterprise Server instance. +// returns a *RequestInformation when successful +func (m *V1ConfigApplyEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V1ConfigApplyEventsRequestBuilderGetQueryParameters])(*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 *V1ConfigApplyEventsRequestBuilder when successful +func (m *V1ConfigApplyEventsRequestBuilder) WithUrl(rawUrl string)(*V1ConfigApplyEventsRequestBuilder) { + return NewV1ConfigApplyEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/manage/v1_config_apply_get_response.go b/pkg/github/manage/v1_config_apply_get_response.go new file mode 100644 index 00000000..e0cb1ee8 --- /dev/null +++ b/pkg/github/manage/v1_config_apply_get_response.go @@ -0,0 +1,150 @@ +package manage + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type V1ConfigApplyGetResponse 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 nodes property + nodes []V1ConfigApplyGetResponse_nodesable + // Whether the ghe-config-apply run is still running in the environment + running *bool + // Whether the ghe-config-apply run was successful in the environment + successful *bool +} +// NewV1ConfigApplyGetResponse instantiates a new V1ConfigApplyGetResponse and sets the default values. +func NewV1ConfigApplyGetResponse()(*V1ConfigApplyGetResponse) { + m := &V1ConfigApplyGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateV1ConfigApplyGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateV1ConfigApplyGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewV1ConfigApplyGetResponse(), 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 *V1ConfigApplyGetResponse) 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 *V1ConfigApplyGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["nodes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateV1ConfigApplyGetResponse_nodesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]V1ConfigApplyGetResponse_nodesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(V1ConfigApplyGetResponse_nodesable) + } + } + m.SetNodes(res) + } + return nil + } + res["running"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRunning(val) + } + return nil + } + res["successful"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSuccessful(val) + } + return nil + } + return res +} +// GetNodes gets the nodes property value. The nodes property +// returns a []V1ConfigApplyGetResponse_nodesable when successful +func (m *V1ConfigApplyGetResponse) GetNodes()([]V1ConfigApplyGetResponse_nodesable) { + return m.nodes +} +// GetRunning gets the running property value. Whether the ghe-config-apply run is still running in the environment +// returns a *bool when successful +func (m *V1ConfigApplyGetResponse) GetRunning()(*bool) { + return m.running +} +// GetSuccessful gets the successful property value. Whether the ghe-config-apply run was successful in the environment +// returns a *bool when successful +func (m *V1ConfigApplyGetResponse) GetSuccessful()(*bool) { + return m.successful +} +// Serialize serializes information the current object +func (m *V1ConfigApplyGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetNodes() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetNodes())) + for i, v := range m.GetNodes() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("nodes", cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("running", m.GetRunning()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("successful", m.GetSuccessful()) + 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 *V1ConfigApplyGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNodes sets the nodes property value. The nodes property +func (m *V1ConfigApplyGetResponse) SetNodes(value []V1ConfigApplyGetResponse_nodesable)() { + m.nodes = value +} +// SetRunning sets the running property value. Whether the ghe-config-apply run is still running in the environment +func (m *V1ConfigApplyGetResponse) SetRunning(value *bool)() { + m.running = value +} +// SetSuccessful sets the successful property value. Whether the ghe-config-apply run was successful in the environment +func (m *V1ConfigApplyGetResponse) SetSuccessful(value *bool)() { + m.successful = value +} +type V1ConfigApplyGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNodes()([]V1ConfigApplyGetResponse_nodesable) + GetRunning()(*bool) + GetSuccessful()(*bool) + SetNodes(value []V1ConfigApplyGetResponse_nodesable)() + SetRunning(value *bool)() + SetSuccessful(value *bool)() +} diff --git a/pkg/github/manage/v1_config_apply_get_response_escaped_nodes.go b/pkg/github/manage/v1_config_apply_get_response_escaped_nodes.go new file mode 100644 index 00000000..6babd0d7 --- /dev/null +++ b/pkg/github/manage/v1_config_apply_get_response_escaped_nodes.go @@ -0,0 +1,167 @@ +package manage + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type V1ConfigApplyGetResponse_nodes 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 hostname of the node + hostname *string + // The unique Run ID of the ghe-config-apply run on the host + run_id *string + // Whether the ghe-config-apply run is still running on the host + running *bool + // Whether the ghe-config-apply run was successful on the host + successful *bool +} +// NewV1ConfigApplyGetResponse_nodes instantiates a new V1ConfigApplyGetResponse_nodes and sets the default values. +func NewV1ConfigApplyGetResponse_nodes()(*V1ConfigApplyGetResponse_nodes) { + m := &V1ConfigApplyGetResponse_nodes{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateV1ConfigApplyGetResponse_nodesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateV1ConfigApplyGetResponse_nodesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewV1ConfigApplyGetResponse_nodes(), 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 *V1ConfigApplyGetResponse_nodes) 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 *V1ConfigApplyGetResponse_nodes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["hostname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHostname(val) + } + return nil + } + res["run_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRunId(val) + } + return nil + } + res["running"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRunning(val) + } + return nil + } + res["successful"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSuccessful(val) + } + return nil + } + return res +} +// GetHostname gets the hostname property value. The hostname of the node +// returns a *string when successful +func (m *V1ConfigApplyGetResponse_nodes) GetHostname()(*string) { + return m.hostname +} +// GetRunId gets the run_id property value. The unique Run ID of the ghe-config-apply run on the host +// returns a *string when successful +func (m *V1ConfigApplyGetResponse_nodes) GetRunId()(*string) { + return m.run_id +} +// GetRunning gets the running property value. Whether the ghe-config-apply run is still running on the host +// returns a *bool when successful +func (m *V1ConfigApplyGetResponse_nodes) GetRunning()(*bool) { + return m.running +} +// GetSuccessful gets the successful property value. Whether the ghe-config-apply run was successful on the host +// returns a *bool when successful +func (m *V1ConfigApplyGetResponse_nodes) GetSuccessful()(*bool) { + return m.successful +} +// Serialize serializes information the current object +func (m *V1ConfigApplyGetResponse_nodes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("hostname", m.GetHostname()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("running", m.GetRunning()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("run_id", m.GetRunId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("successful", m.GetSuccessful()) + 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 *V1ConfigApplyGetResponse_nodes) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHostname sets the hostname property value. The hostname of the node +func (m *V1ConfigApplyGetResponse_nodes) SetHostname(value *string)() { + m.hostname = value +} +// SetRunId sets the run_id property value. The unique Run ID of the ghe-config-apply run on the host +func (m *V1ConfigApplyGetResponse_nodes) SetRunId(value *string)() { + m.run_id = value +} +// SetRunning sets the running property value. Whether the ghe-config-apply run is still running on the host +func (m *V1ConfigApplyGetResponse_nodes) SetRunning(value *bool)() { + m.running = value +} +// SetSuccessful sets the successful property value. Whether the ghe-config-apply run was successful on the host +func (m *V1ConfigApplyGetResponse_nodes) SetSuccessful(value *bool)() { + m.successful = value +} +type V1ConfigApplyGetResponse_nodesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHostname()(*string) + GetRunId()(*string) + GetRunning()(*bool) + GetSuccessful()(*bool) + SetHostname(value *string)() + SetRunId(value *string)() + SetRunning(value *bool)() + SetSuccessful(value *bool)() +} diff --git a/pkg/github/manage/v1_config_apply_post_request_body.go b/pkg/github/manage/v1_config_apply_post_request_body.go new file mode 100644 index 00000000..5822db08 --- /dev/null +++ b/pkg/github/manage/v1_config_apply_post_request_body.go @@ -0,0 +1,80 @@ +package manage + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type V1ConfigApplyPostRequestBody 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 run ID to execute `ghe-config-apply` with. If not provided, a run ID will be generated randomly. + run_id *string +} +// NewV1ConfigApplyPostRequestBody instantiates a new V1ConfigApplyPostRequestBody and sets the default values. +func NewV1ConfigApplyPostRequestBody()(*V1ConfigApplyPostRequestBody) { + m := &V1ConfigApplyPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateV1ConfigApplyPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateV1ConfigApplyPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewV1ConfigApplyPostRequestBody(), 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 *V1ConfigApplyPostRequestBody) 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 *V1ConfigApplyPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["run_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRunId(val) + } + return nil + } + return res +} +// GetRunId gets the run_id property value. The run ID to execute `ghe-config-apply` with. If not provided, a run ID will be generated randomly. +// returns a *string when successful +func (m *V1ConfigApplyPostRequestBody) GetRunId()(*string) { + return m.run_id +} +// Serialize serializes information the current object +func (m *V1ConfigApplyPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("run_id", m.GetRunId()) + 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 *V1ConfigApplyPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRunId sets the run_id property value. The run ID to execute `ghe-config-apply` with. If not provided, a run ID will be generated randomly. +func (m *V1ConfigApplyPostRequestBody) SetRunId(value *string)() { + m.run_id = value +} +type V1ConfigApplyPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRunId()(*string) + SetRunId(value *string)() +} diff --git a/pkg/github/manage/v1_config_apply_post_response.go b/pkg/github/manage/v1_config_apply_post_response.go new file mode 100644 index 00000000..5012c3cf --- /dev/null +++ b/pkg/github/manage/v1_config_apply_post_response.go @@ -0,0 +1,80 @@ +package manage + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type V1ConfigApplyPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Run ID the job was launched with + run_id *string +} +// NewV1ConfigApplyPostResponse instantiates a new V1ConfigApplyPostResponse and sets the default values. +func NewV1ConfigApplyPostResponse()(*V1ConfigApplyPostResponse) { + m := &V1ConfigApplyPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateV1ConfigApplyPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateV1ConfigApplyPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewV1ConfigApplyPostResponse(), 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 *V1ConfigApplyPostResponse) 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 *V1ConfigApplyPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["run_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRunId(val) + } + return nil + } + return res +} +// GetRunId gets the run_id property value. Run ID the job was launched with +// returns a *string when successful +func (m *V1ConfigApplyPostResponse) GetRunId()(*string) { + return m.run_id +} +// Serialize serializes information the current object +func (m *V1ConfigApplyPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("run_id", m.GetRunId()) + 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 *V1ConfigApplyPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRunId sets the run_id property value. Run ID the job was launched with +func (m *V1ConfigApplyPostResponse) SetRunId(value *string)() { + m.run_id = value +} +type V1ConfigApplyPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRunId()(*string) + SetRunId(value *string)() +} diff --git a/pkg/github/manage/v1_config_apply_request_builder.go b/pkg/github/manage/v1_config_apply_request_builder.go new file mode 100644 index 00000000..4924be14 --- /dev/null +++ b/pkg/github/manage/v1_config_apply_request_builder.go @@ -0,0 +1,97 @@ +package manage + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// V1ConfigApplyRequestBuilder builds and executes requests for operations under \manage\v1\config\apply +type V1ConfigApplyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// V1ConfigApplyRequestBuilderGetQueryParameters displays the current status of `ghe-config-apply` in the environment or the status of a historical run by ID. +type V1ConfigApplyRequestBuilderGetQueryParameters struct { + // The unique run ID of the `ghe-config-apply` run. + Run_id *string `uriparametername:"run_id"` +} +// NewV1ConfigApplyRequestBuilderInternal instantiates a new V1ConfigApplyRequestBuilder and sets the default values. +func NewV1ConfigApplyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigApplyRequestBuilder) { + m := &V1ConfigApplyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/config/apply{?run_id*}", pathParameters), + } + return m +} +// NewV1ConfigApplyRequestBuilder instantiates a new V1ConfigApplyRequestBuilder and sets the default values. +func NewV1ConfigApplyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigApplyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1ConfigApplyRequestBuilderInternal(urlParams, requestAdapter) +} +// Events the events property +// returns a *V1ConfigApplyEventsRequestBuilder when successful +func (m *V1ConfigApplyRequestBuilder) Events()(*V1ConfigApplyEventsRequestBuilder) { + return NewV1ConfigApplyEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get displays the current status of `ghe-config-apply` in the environment or the status of a historical run by ID. +// returns a V1ConfigApplyGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-status-of-a-ghe-config-apply-run +func (m *V1ConfigApplyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V1ConfigApplyRequestBuilderGetQueryParameters])(V1ConfigApplyGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateV1ConfigApplyGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(V1ConfigApplyGetResponseable), nil +} +// Post triggers a run of `ghe-config-apply` from the `ghes-manage` agent on your Nomad Delegate instance.You can provide a run ID or allow one to be generated randomly. +// returns a V1ConfigApplyPostResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#trigger-a-ghe-config-apply-run +func (m *V1ConfigApplyRequestBuilder) Post(ctx context.Context, body V1ConfigApplyPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(V1ConfigApplyPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateV1ConfigApplyPostResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(V1ConfigApplyPostResponseable), nil +} +// ToGetRequestInformation displays the current status of `ghe-config-apply` in the environment or the status of a historical run by ID. +// returns a *RequestInformation when successful +func (m *V1ConfigApplyRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V1ConfigApplyRequestBuilderGetQueryParameters])(*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 triggers a run of `ghe-config-apply` from the `ghes-manage` agent on your Nomad Delegate instance.You can provide a run ID or allow one to be generated randomly. +// returns a *RequestInformation when successful +func (m *V1ConfigApplyRequestBuilder) ToPostRequestInformation(ctx context.Context, body V1ConfigApplyPostRequestBodyable, 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 *V1ConfigApplyRequestBuilder when successful +func (m *V1ConfigApplyRequestBuilder) WithUrl(rawUrl string)(*V1ConfigApplyRequestBuilder) { + return NewV1ConfigApplyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/manage/v1_config_init_request_builder.go b/pkg/github/manage/v1_config_init_request_builder.go new file mode 100644 index 00000000..5f46e191 --- /dev/null +++ b/pkg/github/manage/v1_config_init_request_builder.go @@ -0,0 +1,56 @@ +package manage + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V1ConfigInitRequestBuilder builds and executes requests for operations under \manage\v1\config\init +type V1ConfigInitRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewV1ConfigInitRequestBuilderInternal instantiates a new V1ConfigInitRequestBuilder and sets the default values. +func NewV1ConfigInitRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigInitRequestBuilder) { + m := &V1ConfigInitRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/config/init", pathParameters), + } + return m +} +// NewV1ConfigInitRequestBuilder instantiates a new V1ConfigInitRequestBuilder and sets the default values. +func NewV1ConfigInitRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigInitRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1ConfigInitRequestBuilderInternal(urlParams, requestAdapter) +} +// Post when you boot a GitHub instance for the first time, you can use this endpoint to upload a license.Note that you afterwards need to `POST` to [`/manage/v1/config/apply`](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#start-configuration-apply-process) to start the actual configuration process.This endpoint also sets the root site administrator password which is used to authenticate with the GHES Manage API and the Management Console.> [!NOTE]> The request body for this operation must be submitted as `multipart/form-data` data. You can can reference the license file by prefixing the filename with the `@` symbol using `curl`. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#-F). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#initialize-instance-configuration-with-license-upload +func (m *V1ConfigInitRequestBuilder) Post(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesConfigInitRequestable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation when you boot a GitHub instance for the first time, you can use this endpoint to upload a license.Note that you afterwards need to `POST` to [`/manage/v1/config/apply`](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#start-configuration-apply-process) to start the actual configuration process.This endpoint also sets the root site administrator password which is used to authenticate with the GHES Manage API and the Management Console.> [!NOTE]> The request body for this operation must be submitted as `multipart/form-data` data. You can can reference the license file by prefixing the filename with the `@` symbol using `curl`. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#-F). +// returns a *RequestInformation when successful +func (m *V1ConfigInitRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesConfigInitRequestable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "multipart/form-data", 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 *V1ConfigInitRequestBuilder when successful +func (m *V1ConfigInitRequestBuilder) WithUrl(rawUrl string)(*V1ConfigInitRequestBuilder) { + return NewV1ConfigInitRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/manage/v1_config_license_check_request_builder.go b/pkg/github/manage/v1_config_license_check_request_builder.go new file mode 100644 index 00000000..6c528b9c --- /dev/null +++ b/pkg/github/manage/v1_config_license_check_request_builder.go @@ -0,0 +1,57 @@ +package manage + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V1ConfigLicenseCheckRequestBuilder builds and executes requests for operations under \manage\v1\config\license\check +type V1ConfigLicenseCheckRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewV1ConfigLicenseCheckRequestBuilderInternal instantiates a new V1ConfigLicenseCheckRequestBuilder and sets the default values. +func NewV1ConfigLicenseCheckRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigLicenseCheckRequestBuilder) { + m := &V1ConfigLicenseCheckRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/config/license/check", pathParameters), + } + return m +} +// NewV1ConfigLicenseCheckRequestBuilder instantiates a new V1ConfigLicenseCheckRequestBuilder and sets the default values. +func NewV1ConfigLicenseCheckRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigLicenseCheckRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1ConfigLicenseCheckRequestBuilderInternal(urlParams, requestAdapter) +} +// Get check the status of the license that is currently set for the enterprise. +// returns a GhesLicenseCheckable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#check-a-license +func (m *V1ConfigLicenseCheckRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesLicenseCheckable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGhesLicenseCheckFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesLicenseCheckable), nil +} +// ToGetRequestInformation check the status of the license that is currently set for the enterprise. +// returns a *RequestInformation when successful +func (m *V1ConfigLicenseCheckRequestBuilder) 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 *V1ConfigLicenseCheckRequestBuilder when successful +func (m *V1ConfigLicenseCheckRequestBuilder) WithUrl(rawUrl string)(*V1ConfigLicenseCheckRequestBuilder) { + return NewV1ConfigLicenseCheckRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/manage/v1_config_license_request_builder.go b/pkg/github/manage/v1_config_license_request_builder.go new file mode 100644 index 00000000..35f3c92c --- /dev/null +++ b/pkg/github/manage/v1_config_license_request_builder.go @@ -0,0 +1,93 @@ +package manage + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V1ConfigLicenseRequestBuilder builds and executes requests for operations under \manage\v1\config\license +type V1ConfigLicenseRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// V1ConfigLicenseRequestBuilderPutQueryParameters uploads an enterprise license. This operation does not automatically activate the license.> [!NOTE]> The request body for this operation must be submitted as `multipart/form-data` data. You can can reference the license file by prefixing the filename with the `@` symbol using `curl`. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#-F). +type V1ConfigLicenseRequestBuilderPutQueryParameters struct { + // Whether to apply changes from the license. Uploading a license does not automatically apply changes. To make the changes effective, you can specify to apply the license too. + Apply *bool `uriparametername:"apply"` +} +// Check the check property +// returns a *V1ConfigLicenseCheckRequestBuilder when successful +func (m *V1ConfigLicenseRequestBuilder) Check()(*V1ConfigLicenseCheckRequestBuilder) { + return NewV1ConfigLicenseCheckRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewV1ConfigLicenseRequestBuilderInternal instantiates a new V1ConfigLicenseRequestBuilder and sets the default values. +func NewV1ConfigLicenseRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigLicenseRequestBuilder) { + m := &V1ConfigLicenseRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/config/license{?apply*}", pathParameters), + } + return m +} +// NewV1ConfigLicenseRequestBuilder instantiates a new V1ConfigLicenseRequestBuilder and sets the default values. +func NewV1ConfigLicenseRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigLicenseRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1ConfigLicenseRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets information about the license that is currently set for the enterprise. +// returns a GhesLicenseInfoable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-enterprise-license-information +func (m *V1ConfigLicenseRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesLicenseInfoable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGhesLicenseInfoFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesLicenseInfoable), nil +} +// Put uploads an enterprise license. This operation does not automatically activate the license.> [!NOTE]> The request body for this operation must be submitted as `multipart/form-data` data. You can can reference the license file by prefixing the filename with the `@` symbol using `curl`. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#-F). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#upload-an-enterprise-license +func (m *V1ConfigLicenseRequestBuilder) Put(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesUploadLicenseRequestable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V1ConfigLicenseRequestBuilderPutQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets information about the license that is currently set for the enterprise. +// returns a *RequestInformation when successful +func (m *V1ConfigLicenseRequestBuilder) 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 +} +// ToPutRequestInformation uploads an enterprise license. This operation does not automatically activate the license.> [!NOTE]> The request body for this operation must be submitted as `multipart/form-data` data. You can can reference the license file by prefixing the filename with the `@` symbol using `curl`. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#-F). +// returns a *RequestInformation when successful +func (m *V1ConfigLicenseRequestBuilder) ToPutRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesUploadLicenseRequestable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V1ConfigLicenseRequestBuilderPutQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "multipart/form-data", 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 *V1ConfigLicenseRequestBuilder when successful +func (m *V1ConfigLicenseRequestBuilder) WithUrl(rawUrl string)(*V1ConfigLicenseRequestBuilder) { + return NewV1ConfigLicenseRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/manage/v1_config_nodes_request_builder.go b/pkg/github/manage/v1_config_nodes_request_builder.go new file mode 100644 index 00000000..5fe9117e --- /dev/null +++ b/pkg/github/manage/v1_config_nodes_request_builder.go @@ -0,0 +1,64 @@ +package manage + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V1ConfigNodesRequestBuilder builds and executes requests for operations under \manage\v1\config\nodes +type V1ConfigNodesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// V1ConfigNodesRequestBuilderGetQueryParameters get node metadata for all configured nodes in the current cluster. For more information, see "[About clustering](https://docs.github.com/enterprise-server@3.14/admin/enterprise-management/configuring-clustering/about-clustering)." +type V1ConfigNodesRequestBuilderGetQueryParameters struct { + // The cluster roles from the cluster configuration file. + Cluster_roles *string `uriparametername:"cluster_roles"` + // The UUID which identifies a node. + Uuid *string `uriparametername:"uuid"` +} +// NewV1ConfigNodesRequestBuilderInternal instantiates a new V1ConfigNodesRequestBuilder and sets the default values. +func NewV1ConfigNodesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigNodesRequestBuilder) { + m := &V1ConfigNodesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/config/nodes{?cluster_roles*,uuid*}", pathParameters), + } + return m +} +// NewV1ConfigNodesRequestBuilder instantiates a new V1ConfigNodesRequestBuilder and sets the default values. +func NewV1ConfigNodesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigNodesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1ConfigNodesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get node metadata for all configured nodes in the current cluster. For more information, see "[About clustering](https://docs.github.com/enterprise-server@3.14/admin/enterprise-management/configuring-clustering/about-clustering)." +// returns a GhesConfigNodesable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-ghes-node-metadata-for-all-nodes +func (m *V1ConfigNodesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V1ConfigNodesRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesConfigNodesable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGhesConfigNodesFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesConfigNodesable), nil +} +// ToGetRequestInformation get node metadata for all configured nodes in the current cluster. For more information, see "[About clustering](https://docs.github.com/enterprise-server@3.14/admin/enterprise-management/configuring-clustering/about-clustering)." +// returns a *RequestInformation when successful +func (m *V1ConfigNodesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V1ConfigNodesRequestBuilderGetQueryParameters])(*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 *V1ConfigNodesRequestBuilder when successful +func (m *V1ConfigNodesRequestBuilder) WithUrl(rawUrl string)(*V1ConfigNodesRequestBuilder) { + return NewV1ConfigNodesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/manage/v1_config_request_builder.go b/pkg/github/manage/v1_config_request_builder.go new file mode 100644 index 00000000..7fe113a4 --- /dev/null +++ b/pkg/github/manage/v1_config_request_builder.go @@ -0,0 +1,48 @@ +package manage + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// V1ConfigRequestBuilder builds and executes requests for operations under \manage\v1\config +type V1ConfigRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Apply the apply property +// returns a *V1ConfigApplyRequestBuilder when successful +func (m *V1ConfigRequestBuilder) Apply()(*V1ConfigApplyRequestBuilder) { + return NewV1ConfigApplyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewV1ConfigRequestBuilderInternal instantiates a new V1ConfigRequestBuilder and sets the default values. +func NewV1ConfigRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigRequestBuilder) { + m := &V1ConfigRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/config", pathParameters), + } + return m +} +// NewV1ConfigRequestBuilder instantiates a new V1ConfigRequestBuilder and sets the default values. +func NewV1ConfigRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1ConfigRequestBuilderInternal(urlParams, requestAdapter) +} +// Init the init property +// returns a *V1ConfigInitRequestBuilder when successful +func (m *V1ConfigRequestBuilder) Init()(*V1ConfigInitRequestBuilder) { + return NewV1ConfigInitRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// License the license property +// returns a *V1ConfigLicenseRequestBuilder when successful +func (m *V1ConfigRequestBuilder) License()(*V1ConfigLicenseRequestBuilder) { + return NewV1ConfigLicenseRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Nodes the nodes property +// returns a *V1ConfigNodesRequestBuilder when successful +func (m *V1ConfigRequestBuilder) Nodes()(*V1ConfigNodesRequestBuilder) { + return NewV1ConfigNodesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Settings the settings property +// returns a *V1ConfigSettingsRequestBuilder when successful +func (m *V1ConfigRequestBuilder) Settings()(*V1ConfigSettingsRequestBuilder) { + return NewV1ConfigSettingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/manage/v1_config_settings_put_request_body.go b/pkg/github/manage/v1_config_settings_put_request_body.go new file mode 100644 index 00000000..f176505f --- /dev/null +++ b/pkg/github/manage/v1_config_settings_put_request_body.go @@ -0,0 +1,51 @@ +package manage + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type V1ConfigSettingsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewV1ConfigSettingsPutRequestBody instantiates a new V1ConfigSettingsPutRequestBody and sets the default values. +func NewV1ConfigSettingsPutRequestBody()(*V1ConfigSettingsPutRequestBody) { + m := &V1ConfigSettingsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateV1ConfigSettingsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateV1ConfigSettingsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewV1ConfigSettingsPutRequestBody(), 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 *V1ConfigSettingsPutRequestBody) 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 *V1ConfigSettingsPutRequestBody) 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 *V1ConfigSettingsPutRequestBody) 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 *V1ConfigSettingsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type V1ConfigSettingsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/manage/v1_config_settings_request_builder.go b/pkg/github/manage/v1_config_settings_request_builder.go new file mode 100644 index 00000000..8f5396db --- /dev/null +++ b/pkg/github/manage/v1_config_settings_request_builder.go @@ -0,0 +1,83 @@ +package manage + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V1ConfigSettingsRequestBuilder builds and executes requests for operations under \manage\v1\config\settings +type V1ConfigSettingsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewV1ConfigSettingsRequestBuilderInternal instantiates a new V1ConfigSettingsRequestBuilder and sets the default values. +func NewV1ConfigSettingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigSettingsRequestBuilder) { + m := &V1ConfigSettingsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/config/settings", pathParameters), + } + return m +} +// NewV1ConfigSettingsRequestBuilder instantiates a new V1ConfigSettingsRequestBuilder and sets the default values. +func NewV1ConfigSettingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ConfigSettingsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1ConfigSettingsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a list of settings for a GitHub Enterprise Server instance. +// returns a GhesGetSettingsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-ghes-settings +func (m *V1ConfigSettingsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesGetSettingsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGhesGetSettingsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesGetSettingsable), nil +} +// Put updates the settings on your instance. For a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-settings).**Notes:**- The request body only requires the settings parameters that should be updated to be specified, all other parameters will be unmodified or populated from the default values.- You cannot set the Management Console root site administrator password with this API endpoint. Use the `ghe-set-password` utility to change the management console password. For more information, see "[Command-line utilities](https://docs.github.com/enterprise-server@3.14/admin/configuration/configuring-your-enterprise/command-line-utilities#ghe-set-password)." +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#set-settings +func (m *V1ConfigSettingsRequestBuilder) Put(ctx context.Context, body V1ConfigSettingsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets a list of settings for a GitHub Enterprise Server instance. +// returns a *RequestInformation when successful +func (m *V1ConfigSettingsRequestBuilder) 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 +} +// ToPutRequestInformation updates the settings on your instance. For a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-settings).**Notes:**- The request body only requires the settings parameters that should be updated to be specified, all other parameters will be unmodified or populated from the default values.- You cannot set the Management Console root site administrator password with this API endpoint. Use the `ghe-set-password` utility to change the management console password. For more information, see "[Command-line utilities](https://docs.github.com/enterprise-server@3.14/admin/configuration/configuring-your-enterprise/command-line-utilities#ghe-set-password)." +// returns a *RequestInformation when successful +func (m *V1ConfigSettingsRequestBuilder) ToPutRequestInformation(ctx context.Context, body V1ConfigSettingsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *V1ConfigSettingsRequestBuilder when successful +func (m *V1ConfigSettingsRequestBuilder) WithUrl(rawUrl string)(*V1ConfigSettingsRequestBuilder) { + return NewV1ConfigSettingsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/manage/v1_maintenance_request_builder.go b/pkg/github/manage/v1_maintenance_request_builder.go new file mode 100644 index 00000000..0c49a2d1 --- /dev/null +++ b/pkg/github/manage/v1_maintenance_request_builder.go @@ -0,0 +1,101 @@ +package manage + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V1MaintenanceRequestBuilder builds and executes requests for operations under \manage\v1\maintenance +type V1MaintenanceRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// V1MaintenanceRequestBuilderGetQueryParameters gets the status and details of maintenance mode on all available nodes. For more information, see "[Enabling and scheduling maintenance mode](https://docs.github.com/enterprise-server@3.14/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode)." +type V1MaintenanceRequestBuilderGetQueryParameters struct { + // The cluster roles from the cluster configuration file. + Cluster_roles *string `uriparametername:"cluster_roles"` + // The UUID which identifies a node. + Uuid *string `uriparametername:"uuid"` +} +// NewV1MaintenanceRequestBuilderInternal instantiates a new V1MaintenanceRequestBuilder and sets the default values. +func NewV1MaintenanceRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1MaintenanceRequestBuilder) { + m := &V1MaintenanceRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/maintenance{?cluster_roles*,uuid*}", pathParameters), + } + return m +} +// NewV1MaintenanceRequestBuilder instantiates a new V1MaintenanceRequestBuilder and sets the default values. +func NewV1MaintenanceRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1MaintenanceRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1MaintenanceRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the status and details of maintenance mode on all available nodes. For more information, see "[Enabling and scheduling maintenance mode](https://docs.github.com/enterprise-server@3.14/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode)." +// returns a []GhesGetMaintenanceable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-status-of-maintenance-mode +func (m *V1MaintenanceRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V1MaintenanceRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesGetMaintenanceable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGhesGetMaintenanceFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesGetMaintenanceable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesGetMaintenanceable) + } + } + return val, nil +} +// Post sets or schedules the maintenance mode. For more information, see "[Enabling and scheduling maintenance mode](https://docs.github.com/enterprise-server@3.14/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode)." +// returns a []GhesSetMaintenanceResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#set-the-status-of-maintenance-mode +func (m *V1MaintenanceRequestBuilder) Post(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesSetMaintenanceRequestable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesSetMaintenanceResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGhesSetMaintenanceResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesSetMaintenanceResponseable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesSetMaintenanceResponseable) + } + } + return val, nil +} +// ToGetRequestInformation gets the status and details of maintenance mode on all available nodes. For more information, see "[Enabling and scheduling maintenance mode](https://docs.github.com/enterprise-server@3.14/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode)." +// returns a *RequestInformation when successful +func (m *V1MaintenanceRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V1MaintenanceRequestBuilderGetQueryParameters])(*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 sets or schedules the maintenance mode. For more information, see "[Enabling and scheduling maintenance mode](https://docs.github.com/enterprise-server@3.14/admin/configuration/configuring-your-enterprise/enabling-and-scheduling-maintenance-mode)." +// returns a *RequestInformation when successful +func (m *V1MaintenanceRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesSetMaintenanceRequestable, 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 *V1MaintenanceRequestBuilder when successful +func (m *V1MaintenanceRequestBuilder) WithUrl(rawUrl string)(*V1MaintenanceRequestBuilder) { + return NewV1MaintenanceRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/manage/v1_replication_request_builder.go b/pkg/github/manage/v1_replication_request_builder.go new file mode 100644 index 00000000..5d64beda --- /dev/null +++ b/pkg/github/manage/v1_replication_request_builder.go @@ -0,0 +1,28 @@ +package manage + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// V1ReplicationRequestBuilder builds and executes requests for operations under \manage\v1\replication +type V1ReplicationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewV1ReplicationRequestBuilderInternal instantiates a new V1ReplicationRequestBuilder and sets the default values. +func NewV1ReplicationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ReplicationRequestBuilder) { + m := &V1ReplicationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/replication", pathParameters), + } + return m +} +// NewV1ReplicationRequestBuilder instantiates a new V1ReplicationRequestBuilder and sets the default values. +func NewV1ReplicationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ReplicationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1ReplicationRequestBuilderInternal(urlParams, requestAdapter) +} +// Status the status property +// returns a *V1ReplicationStatusRequestBuilder when successful +func (m *V1ReplicationRequestBuilder) Status()(*V1ReplicationStatusRequestBuilder) { + return NewV1ReplicationStatusRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/manage/v1_replication_status_request_builder.go b/pkg/github/manage/v1_replication_status_request_builder.go new file mode 100644 index 00000000..2f384f52 --- /dev/null +++ b/pkg/github/manage/v1_replication_status_request_builder.go @@ -0,0 +1,64 @@ +package manage + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V1ReplicationStatusRequestBuilder builds and executes requests for operations under \manage\v1\replication\status +type V1ReplicationStatusRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// V1ReplicationStatusRequestBuilderGetQueryParameters gets the status of all services running on each replica node.This endpoint may take several seconds to reply. +type V1ReplicationStatusRequestBuilderGetQueryParameters struct { + // The cluster roles from the cluster configuration file. + Cluster_roles *string `uriparametername:"cluster_roles"` + // The UUID which identifies a node. + Uuid *string `uriparametername:"uuid"` +} +// NewV1ReplicationStatusRequestBuilderInternal instantiates a new V1ReplicationStatusRequestBuilder and sets the default values. +func NewV1ReplicationStatusRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ReplicationStatusRequestBuilder) { + m := &V1ReplicationStatusRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/replication/status{?cluster_roles*,uuid*}", pathParameters), + } + return m +} +// NewV1ReplicationStatusRequestBuilder instantiates a new V1ReplicationStatusRequestBuilder and sets the default values. +func NewV1ReplicationStatusRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1ReplicationStatusRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1ReplicationStatusRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the status of all services running on each replica node.This endpoint may take several seconds to reply. +// returns a GhesReplicationStatusable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-the-status-of-services-running-on-all-replica-nodes +func (m *V1ReplicationStatusRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V1ReplicationStatusRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesReplicationStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGhesReplicationStatusFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesReplicationStatusable), nil +} +// ToGetRequestInformation gets the status of all services running on each replica node.This endpoint may take several seconds to reply. +// returns a *RequestInformation when successful +func (m *V1ReplicationStatusRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V1ReplicationStatusRequestBuilderGetQueryParameters])(*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 *V1ReplicationStatusRequestBuilder when successful +func (m *V1ReplicationStatusRequestBuilder) WithUrl(rawUrl string)(*V1ReplicationStatusRequestBuilder) { + return NewV1ReplicationStatusRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/manage/v1_request_builder.go b/pkg/github/manage/v1_request_builder.go new file mode 100644 index 00000000..f157eaf7 --- /dev/null +++ b/pkg/github/manage/v1_request_builder.go @@ -0,0 +1,58 @@ +package manage + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// V1RequestBuilder builds and executes requests for operations under \manage\v1 +type V1RequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Access the access property +// returns a *V1AccessRequestBuilder when successful +func (m *V1RequestBuilder) Access()(*V1AccessRequestBuilder) { + return NewV1AccessRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Checks the checks property +// returns a *V1ChecksRequestBuilder when successful +func (m *V1RequestBuilder) Checks()(*V1ChecksRequestBuilder) { + return NewV1ChecksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Cluster the cluster property +// returns a *V1ClusterRequestBuilder when successful +func (m *V1RequestBuilder) Cluster()(*V1ClusterRequestBuilder) { + return NewV1ClusterRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Config the config property +// returns a *V1ConfigRequestBuilder when successful +func (m *V1RequestBuilder) Config()(*V1ConfigRequestBuilder) { + return NewV1ConfigRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewV1RequestBuilderInternal instantiates a new V1RequestBuilder and sets the default values. +func NewV1RequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1RequestBuilder) { + m := &V1RequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1", pathParameters), + } + return m +} +// NewV1RequestBuilder instantiates a new V1RequestBuilder and sets the default values. +func NewV1RequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1RequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1RequestBuilderInternal(urlParams, requestAdapter) +} +// Maintenance the maintenance property +// returns a *V1MaintenanceRequestBuilder when successful +func (m *V1RequestBuilder) Maintenance()(*V1MaintenanceRequestBuilder) { + return NewV1MaintenanceRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Replication the replication property +// returns a *V1ReplicationRequestBuilder when successful +func (m *V1RequestBuilder) Replication()(*V1ReplicationRequestBuilder) { + return NewV1ReplicationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Version the version property +// returns a *V1VersionRequestBuilder when successful +func (m *V1RequestBuilder) Version()(*V1VersionRequestBuilder) { + return NewV1VersionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/manage/v1_version_request_builder.go b/pkg/github/manage/v1_version_request_builder.go new file mode 100644 index 00000000..ad8463e9 --- /dev/null +++ b/pkg/github/manage/v1_version_request_builder.go @@ -0,0 +1,67 @@ +package manage + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V1VersionRequestBuilder builds and executes requests for operations under \manage\v1\version +type V1VersionRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// V1VersionRequestBuilderGetQueryParameters gets the GitHub Enterprise Server release versions that are currently installed on all available nodes. For more information, see "[GitHub Enterprise Server releases](https://docs.github.com/enterprise-server@3.14/admin/all-releases)." +type V1VersionRequestBuilderGetQueryParameters struct { + // The cluster roles from the cluster configuration file. + Cluster_roles *string `uriparametername:"cluster_roles"` + // The UUID which identifies a node. + Uuid *string `uriparametername:"uuid"` +} +// NewV1VersionRequestBuilderInternal instantiates a new V1VersionRequestBuilder and sets the default values. +func NewV1VersionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1VersionRequestBuilder) { + m := &V1VersionRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/manage/v1/version{?cluster_roles*,uuid*}", pathParameters), + } + return m +} +// NewV1VersionRequestBuilder instantiates a new V1VersionRequestBuilder and sets the default values. +func NewV1VersionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V1VersionRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV1VersionRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the GitHub Enterprise Server release versions that are currently installed on all available nodes. For more information, see "[GitHub Enterprise Server releases](https://docs.github.com/enterprise-server@3.14/admin/all-releases)." +// returns a []GhesVersionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/manage-ghes#get-all-ghes-release-versions-for-all-nodes +func (m *V1VersionRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V1VersionRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGhesVersionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesVersionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GhesVersionable) + } + } + return val, nil +} +// ToGetRequestInformation gets the GitHub Enterprise Server release versions that are currently installed on all available nodes. For more information, see "[GitHub Enterprise Server releases](https://docs.github.com/enterprise-server@3.14/admin/all-releases)." +// returns a *RequestInformation when successful +func (m *V1VersionRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V1VersionRequestBuilderGetQueryParameters])(*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 *V1VersionRequestBuilder when successful +func (m *V1VersionRequestBuilder) WithUrl(rawUrl string)(*V1VersionRequestBuilder) { + return NewV1VersionRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/markdown/markdown_post_request_body.go b/pkg/github/markdown/markdown_post_request_body.go new file mode 100644 index 00000000..b6aa988a --- /dev/null +++ b/pkg/github/markdown/markdown_post_request_body.go @@ -0,0 +1,141 @@ +package markdown + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MarkdownPostRequestBody 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 repository context to use when creating references in `gfm` mode. For example, setting `context` to `octo-org/octo-repo` will change the text `#42` into an HTML link to issue 42 in the `octo-org/octo-repo` repository. + context *string + // The rendering mode. + mode *MarkdownPostRequestBody_mode + // The Markdown text to render in HTML. + text *string +} +// NewMarkdownPostRequestBody instantiates a new MarkdownPostRequestBody and sets the default values. +func NewMarkdownPostRequestBody()(*MarkdownPostRequestBody) { + m := &MarkdownPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + modeValue := MARKDOWN_MARKDOWNPOSTREQUESTBODY_MODE + m.SetMode(&modeValue) + return m +} +// CreateMarkdownPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMarkdownPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMarkdownPostRequestBody(), 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 *MarkdownPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContext gets the context property value. The repository context to use when creating references in `gfm` mode. For example, setting `context` to `octo-org/octo-repo` will change the text `#42` into an HTML link to issue 42 in the `octo-org/octo-repo` repository. +// returns a *string when successful +func (m *MarkdownPostRequestBody) GetContext()(*string) { + return m.context +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MarkdownPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + res["mode"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseMarkdownPostRequestBody_mode) + if err != nil { + return err + } + if val != nil { + m.SetMode(val.(*MarkdownPostRequestBody_mode)) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetMode gets the mode property value. The rendering mode. +// returns a *MarkdownPostRequestBody_mode when successful +func (m *MarkdownPostRequestBody) GetMode()(*MarkdownPostRequestBody_mode) { + return m.mode +} +// GetText gets the text property value. The Markdown text to render in HTML. +// returns a *string when successful +func (m *MarkdownPostRequestBody) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *MarkdownPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("context", m.GetContext()) + if err != nil { + return err + } + } + if m.GetMode() != nil { + cast := (*m.GetMode()).String() + err := writer.WriteStringValue("mode", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *MarkdownPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContext sets the context property value. The repository context to use when creating references in `gfm` mode. For example, setting `context` to `octo-org/octo-repo` will change the text `#42` into an HTML link to issue 42 in the `octo-org/octo-repo` repository. +func (m *MarkdownPostRequestBody) SetContext(value *string)() { + m.context = value +} +// SetMode sets the mode property value. The rendering mode. +func (m *MarkdownPostRequestBody) SetMode(value *MarkdownPostRequestBody_mode)() { + m.mode = value +} +// SetText sets the text property value. The Markdown text to render in HTML. +func (m *MarkdownPostRequestBody) SetText(value *string)() { + m.text = value +} +type MarkdownPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContext()(*string) + GetMode()(*MarkdownPostRequestBody_mode) + GetText()(*string) + SetContext(value *string)() + SetMode(value *MarkdownPostRequestBody_mode)() + SetText(value *string)() +} diff --git a/pkg/github/markdown/markdown_post_request_body_escaped_mode.go b/pkg/github/markdown/markdown_post_request_body_escaped_mode.go new file mode 100644 index 00000000..03cab170 --- /dev/null +++ b/pkg/github/markdown/markdown_post_request_body_escaped_mode.go @@ -0,0 +1,34 @@ +package markdown +// The rendering mode. +type MarkdownPostRequestBody_mode int + +const ( + MARKDOWN_MARKDOWNPOSTREQUESTBODY_MODE MarkdownPostRequestBody_mode = iota + GFM_MARKDOWNPOSTREQUESTBODY_MODE +) + +func (i MarkdownPostRequestBody_mode) String() string { + return []string{"markdown", "gfm"}[i] +} +func ParseMarkdownPostRequestBody_mode(v string) (any, error) { + result := MARKDOWN_MARKDOWNPOSTREQUESTBODY_MODE + switch v { + case "markdown": + result = MARKDOWN_MARKDOWNPOSTREQUESTBODY_MODE + case "gfm": + result = GFM_MARKDOWNPOSTREQUESTBODY_MODE + default: + return nil, nil + } + return &result, nil +} +func SerializeMarkdownPostRequestBody_mode(values []MarkdownPostRequestBody_mode) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i MarkdownPostRequestBody_mode) isMultiValue() bool { + return false +} diff --git a/pkg/github/markdown/markdown_request_builder.go b/pkg/github/markdown/markdown_request_builder.go new file mode 100644 index 00000000..6e9d6fb6 --- /dev/null +++ b/pkg/github/markdown/markdown_request_builder.go @@ -0,0 +1,60 @@ +package markdown + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// MarkdownRequestBuilder builds and executes requests for operations under \markdown +type MarkdownRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewMarkdownRequestBuilderInternal instantiates a new MarkdownRequestBuilder and sets the default values. +func NewMarkdownRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MarkdownRequestBuilder) { + m := &MarkdownRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/markdown", pathParameters), + } + return m +} +// NewMarkdownRequestBuilder instantiates a new MarkdownRequestBuilder and sets the default values. +func NewMarkdownRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MarkdownRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMarkdownRequestBuilderInternal(urlParams, requestAdapter) +} +// Post render a Markdown document +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/markdown/markdown#render-a-markdown-document +func (m *MarkdownRequestBuilder) Post(ctx context.Context, body MarkdownPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Raw the raw property +// returns a *RawRequestBuilder when successful +func (m *MarkdownRequestBuilder) Raw()(*RawRequestBuilder) { + return NewRawRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// returns a *RequestInformation when successful +func (m *MarkdownRequestBuilder) ToPostRequestInformation(ctx context.Context, body MarkdownPostRequestBodyable, 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", "text/html") + 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 *MarkdownRequestBuilder when successful +func (m *MarkdownRequestBuilder) WithUrl(rawUrl string)(*MarkdownRequestBuilder) { + return NewMarkdownRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/markdown/raw_request_builder.go b/pkg/github/markdown/raw_request_builder.go new file mode 100644 index 00000000..e996b32f --- /dev/null +++ b/pkg/github/markdown/raw_request_builder.go @@ -0,0 +1,53 @@ +package markdown + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// RawRequestBuilder builds and executes requests for operations under \markdown\raw +type RawRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewRawRequestBuilderInternal instantiates a new RawRequestBuilder and sets the default values. +func NewRawRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RawRequestBuilder) { + m := &RawRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/markdown/raw", pathParameters), + } + return m +} +// NewRawRequestBuilder instantiates a new RawRequestBuilder and sets the default values. +func NewRawRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RawRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewRawRequestBuilderInternal(urlParams, requestAdapter) +} +// Post you must send Markdown as plain text (using a `Content-Type` header of `text/plain` or `text/x-markdown`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/markdown/markdown#render-a-markdown-document-in-raw-mode +func (m *RawRequestBuilder) Post(ctx context.Context, body *string, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation you must send Markdown as plain text (using a `Content-Type` header of `text/plain` or `text/x-markdown`) to this endpoint, rather than using JSON format. In raw mode, [GitHub Flavored Markdown](https://github.github.com/gfm/) is not supported and Markdown will be rendered in plain format like a README.md file. Markdown content must be 400 KB or less. +// returns a *RequestInformation when successful +func (m *RawRequestBuilder) ToPostRequestInformation(ctx context.Context, body *string, 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", "text/html") + requestInfo.SetContentFromScalar(ctx, m.BaseRequestBuilder.RequestAdapter, "text/plain", body) + 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 *RawRequestBuilder when successful +func (m *RawRequestBuilder) WithUrl(rawUrl string)(*RawRequestBuilder) { + return NewRawRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/meta/meta_request_builder.go b/pkg/github/meta/meta_request_builder.go new file mode 100644 index 00000000..04085f31 --- /dev/null +++ b/pkg/github/meta/meta_request_builder.go @@ -0,0 +1,56 @@ +package meta + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// MetaRequestBuilder builds and executes requests for operations under \meta +type MetaRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewMetaRequestBuilderInternal instantiates a new MetaRequestBuilder and sets the default values. +func NewMetaRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MetaRequestBuilder) { + m := &MetaRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/meta", pathParameters), + } + return m +} +// NewMetaRequestBuilder instantiates a new MetaRequestBuilder and sets the default values. +func NewMetaRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MetaRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMetaRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get GitHub Enterprise Server meta information +// returns a ApiOverviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/meta/meta#get-apiname-meta-information +func (m *MetaRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ApiOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateApiOverviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ApiOverviewable), nil +} +// returns a *RequestInformation when successful +func (m *MetaRequestBuilder) 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 *MetaRequestBuilder when successful +func (m *MetaRequestBuilder) WithUrl(rawUrl string)(*MetaRequestBuilder) { + return NewMetaRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/models/308da9774f804d8be6f3099a760ee922cd911e0ad8ef4aea285bf52ed3099627.go b/pkg/github/models/308da9774f804d8be6f3099a760ee922cd911e0ad8ef4aea285bf52ed3099627.go new file mode 100644 index 00000000..9bb12639 --- /dev/null +++ b/pkg/github/models/308da9774f804d8be6f3099a760ee922cd911e0ad8ef4aea285bf52ed3099627.go @@ -0,0 +1,261 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_required_pull_request_reviews_dismissal_restrictions 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 apps property + apps []Integrationable + // The teams property + teams []Teamable + // The teams_url property + teams_url *string + // The url property + url *string + // The users property + users []SimpleUserable + // The users_url property + users_url *string +} +// NewProtectedBranch_required_pull_request_reviews_dismissal_restrictions instantiates a new ProtectedBranch_required_pull_request_reviews_dismissal_restrictions and sets the default values. +func NewProtectedBranch_required_pull_request_reviews_dismissal_restrictions()(*ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) { + m := &ProtectedBranch_required_pull_request_reviews_dismissal_restrictions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranch_required_pull_request_reviews_dismissal_restrictionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_required_pull_request_reviews_dismissal_restrictionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_required_pull_request_reviews_dismissal_restrictions(), 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 *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The apps property +// returns a []Integrationable when successful +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetApps()([]Integrationable) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Integrationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Integrationable) + } + } + m.SetApps(res) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Teamable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Teamable) + } + } + m.SetTeams(res) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetUsers(res) + } + return nil + } + res["users_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUsersUrl(val) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The teams property +// returns a []Teamable when successful +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetTeams()([]Teamable) { + return m.teams +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetUrl()(*string) { + return m.url +} +// GetUsers gets the users property value. The users property +// returns a []SimpleUserable when successful +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetUsers()([]SimpleUserable) { + return m.users +} +// GetUsersUrl gets the users_url property value. The users_url property +// returns a *string when successful +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) GetUsersUrl()(*string) { + return m.users_url +} +// Serialize serializes information the current object +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetApps())) + for i, v := range m.GetApps() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("apps", cast) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTeams())) + for i, v := range m.GetTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("teams", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUsers())) + for i, v := range m.GetUsers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("users", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("users_url", m.GetUsersUrl()) + 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 *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The apps property +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) SetApps(value []Integrationable)() { + m.apps = value +} +// SetTeams sets the teams property value. The teams property +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) SetTeams(value []Teamable)() { + m.teams = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) SetUrl(value *string)() { + m.url = value +} +// SetUsers sets the users property value. The users property +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) SetUsers(value []SimpleUserable)() { + m.users = value +} +// SetUsersUrl sets the users_url property value. The users_url property +func (m *ProtectedBranch_required_pull_request_reviews_dismissal_restrictions) SetUsersUrl(value *string)() { + m.users_url = value +} +type ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]Integrationable) + GetTeams()([]Teamable) + GetTeamsUrl()(*string) + GetUrl()(*string) + GetUsers()([]SimpleUserable) + GetUsersUrl()(*string) + SetApps(value []Integrationable)() + SetTeams(value []Teamable)() + SetTeamsUrl(value *string)() + SetUrl(value *string)() + SetUsers(value []SimpleUserable)() + SetUsersUrl(value *string)() +} diff --git a/pkg/github/models/actions_cache_list.go b/pkg/github/models/actions_cache_list.go new file mode 100644 index 00000000..4642274a --- /dev/null +++ b/pkg/github/models/actions_cache_list.go @@ -0,0 +1,122 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ActionsCacheList repository actions caches +type ActionsCacheList struct { + // Array of caches + actions_caches []ActionsCacheList_actions_cachesable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Total number of caches + total_count *int32 +} +// NewActionsCacheList instantiates a new ActionsCacheList and sets the default values. +func NewActionsCacheList()(*ActionsCacheList) { + m := &ActionsCacheList{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsCacheListFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsCacheListFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsCacheList(), nil +} +// GetActionsCaches gets the actions_caches property value. Array of caches +// returns a []ActionsCacheList_actions_cachesable when successful +func (m *ActionsCacheList) GetActionsCaches()([]ActionsCacheList_actions_cachesable) { + return m.actions_caches +} +// 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 *ActionsCacheList) 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 *ActionsCacheList) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actions_caches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateActionsCacheList_actions_cachesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ActionsCacheList_actions_cachesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ActionsCacheList_actions_cachesable) + } + } + m.SetActionsCaches(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. Total number of caches +// returns a *int32 when successful +func (m *ActionsCacheList) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ActionsCacheList) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetActionsCaches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetActionsCaches())) + for i, v := range m.GetActionsCaches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("actions_caches", 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 +} +// SetActionsCaches sets the actions_caches property value. Array of caches +func (m *ActionsCacheList) SetActionsCaches(value []ActionsCacheList_actions_cachesable)() { + m.actions_caches = 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 *ActionsCacheList) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. Total number of caches +func (m *ActionsCacheList) SetTotalCount(value *int32)() { + m.total_count = value +} +type ActionsCacheListable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActionsCaches()([]ActionsCacheList_actions_cachesable) + GetTotalCount()(*int32) + SetActionsCaches(value []ActionsCacheList_actions_cachesable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/models/actions_cache_list_escaped_actions_escaped_caches.go b/pkg/github/models/actions_cache_list_escaped_actions_escaped_caches.go new file mode 100644 index 00000000..d13178dc --- /dev/null +++ b/pkg/github/models/actions_cache_list_escaped_actions_escaped_caches.go @@ -0,0 +1,255 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsCacheList_actions_caches 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 id property + id *int32 + // The key property + key *string + // The last_accessed_at property + last_accessed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The ref property + ref *string + // The size_in_bytes property + size_in_bytes *int32 + // The version property + version *string +} +// NewActionsCacheList_actions_caches instantiates a new ActionsCacheList_actions_caches and sets the default values. +func NewActionsCacheList_actions_caches()(*ActionsCacheList_actions_caches) { + m := &ActionsCacheList_actions_caches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsCacheList_actions_cachesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsCacheList_actions_cachesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsCacheList_actions_caches(), 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 *ActionsCacheList_actions_caches) 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 *ActionsCacheList_actions_caches) 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 *ActionsCacheList_actions_caches) 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + 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["last_accessed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastAccessedAt(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["size_in_bytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSizeInBytes(val) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ActionsCacheList_actions_caches) GetId()(*int32) { + return m.id +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *ActionsCacheList_actions_caches) GetKey()(*string) { + return m.key +} +// GetLastAccessedAt gets the last_accessed_at property value. The last_accessed_at property +// returns a *Time when successful +func (m *ActionsCacheList_actions_caches) GetLastAccessedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_accessed_at +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *ActionsCacheList_actions_caches) GetRef()(*string) { + return m.ref +} +// GetSizeInBytes gets the size_in_bytes property value. The size_in_bytes property +// returns a *int32 when successful +func (m *ActionsCacheList_actions_caches) GetSizeInBytes()(*int32) { + return m.size_in_bytes +} +// GetVersion gets the version property value. The version property +// returns a *string when successful +func (m *ActionsCacheList_actions_caches) GetVersion()(*string) { + return m.version +} +// Serialize serializes information the current object +func (m *ActionsCacheList_actions_caches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("last_accessed_at", m.GetLastAccessedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size_in_bytes", m.GetSizeInBytes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("version", m.GetVersion()) + 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 *ActionsCacheList_actions_caches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ActionsCacheList_actions_caches) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *ActionsCacheList_actions_caches) SetId(value *int32)() { + m.id = value +} +// SetKey sets the key property value. The key property +func (m *ActionsCacheList_actions_caches) SetKey(value *string)() { + m.key = value +} +// SetLastAccessedAt sets the last_accessed_at property value. The last_accessed_at property +func (m *ActionsCacheList_actions_caches) SetLastAccessedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_accessed_at = value +} +// SetRef sets the ref property value. The ref property +func (m *ActionsCacheList_actions_caches) SetRef(value *string)() { + m.ref = value +} +// SetSizeInBytes sets the size_in_bytes property value. The size_in_bytes property +func (m *ActionsCacheList_actions_caches) SetSizeInBytes(value *int32)() { + m.size_in_bytes = value +} +// SetVersion sets the version property value. The version property +func (m *ActionsCacheList_actions_caches) SetVersion(value *string)() { + m.version = value +} +type ActionsCacheList_actions_cachesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetKey()(*string) + GetLastAccessedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetRef()(*string) + GetSizeInBytes()(*int32) + GetVersion()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetKey(value *string)() + SetLastAccessedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetRef(value *string)() + SetSizeInBytes(value *int32)() + SetVersion(value *string)() +} diff --git a/pkg/github/models/actions_cache_usage_by_repository.go b/pkg/github/models/actions_cache_usage_by_repository.go new file mode 100644 index 00000000..956fa877 --- /dev/null +++ b/pkg/github/models/actions_cache_usage_by_repository.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ActionsCacheUsageByRepository gitHub Actions Cache Usage by repository. +type ActionsCacheUsageByRepository struct { + // The number of active caches in the repository. + active_caches_count *int32 + // The sum of the size in bytes of all the active cache items in the repository. + active_caches_size_in_bytes *int32 + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The repository owner and name for the cache usage being shown. + full_name *string +} +// NewActionsCacheUsageByRepository instantiates a new ActionsCacheUsageByRepository and sets the default values. +func NewActionsCacheUsageByRepository()(*ActionsCacheUsageByRepository) { + m := &ActionsCacheUsageByRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsCacheUsageByRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsCacheUsageByRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsCacheUsageByRepository(), nil +} +// GetActiveCachesCount gets the active_caches_count property value. The number of active caches in the repository. +// returns a *int32 when successful +func (m *ActionsCacheUsageByRepository) GetActiveCachesCount()(*int32) { + return m.active_caches_count +} +// GetActiveCachesSizeInBytes gets the active_caches_size_in_bytes property value. The sum of the size in bytes of all the active cache items in the repository. +// returns a *int32 when successful +func (m *ActionsCacheUsageByRepository) GetActiveCachesSizeInBytes()(*int32) { + return m.active_caches_size_in_bytes +} +// 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 *ActionsCacheUsageByRepository) 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 *ActionsCacheUsageByRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active_caches_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActiveCachesCount(val) + } + return nil + } + res["active_caches_size_in_bytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActiveCachesSizeInBytes(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + return res +} +// GetFullName gets the full_name property value. The repository owner and name for the cache usage being shown. +// returns a *string when successful +func (m *ActionsCacheUsageByRepository) GetFullName()(*string) { + return m.full_name +} +// Serialize serializes information the current object +func (m *ActionsCacheUsageByRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("active_caches_count", m.GetActiveCachesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("active_caches_size_in_bytes", m.GetActiveCachesSizeInBytes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveCachesCount sets the active_caches_count property value. The number of active caches in the repository. +func (m *ActionsCacheUsageByRepository) SetActiveCachesCount(value *int32)() { + m.active_caches_count = value +} +// SetActiveCachesSizeInBytes sets the active_caches_size_in_bytes property value. The sum of the size in bytes of all the active cache items in the repository. +func (m *ActionsCacheUsageByRepository) SetActiveCachesSizeInBytes(value *int32)() { + m.active_caches_size_in_bytes = 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 *ActionsCacheUsageByRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFullName sets the full_name property value. The repository owner and name for the cache usage being shown. +func (m *ActionsCacheUsageByRepository) SetFullName(value *string)() { + m.full_name = value +} +type ActionsCacheUsageByRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveCachesCount()(*int32) + GetActiveCachesSizeInBytes()(*int32) + GetFullName()(*string) + SetActiveCachesCount(value *int32)() + SetActiveCachesSizeInBytes(value *int32)() + SetFullName(value *string)() +} diff --git a/pkg/github/models/actions_cache_usage_org_enterprise.go b/pkg/github/models/actions_cache_usage_org_enterprise.go new file mode 100644 index 00000000..a1927d98 --- /dev/null +++ b/pkg/github/models/actions_cache_usage_org_enterprise.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsCacheUsageOrgEnterprise 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 count of active caches across all repositories of an enterprise or an organization. + total_active_caches_count *int32 + // The total size in bytes of all active cache items across all repositories of an enterprise or an organization. + total_active_caches_size_in_bytes *int32 +} +// NewActionsCacheUsageOrgEnterprise instantiates a new ActionsCacheUsageOrgEnterprise and sets the default values. +func NewActionsCacheUsageOrgEnterprise()(*ActionsCacheUsageOrgEnterprise) { + m := &ActionsCacheUsageOrgEnterprise{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsCacheUsageOrgEnterpriseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsCacheUsageOrgEnterpriseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsCacheUsageOrgEnterprise(), 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 *ActionsCacheUsageOrgEnterprise) 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 *ActionsCacheUsageOrgEnterprise) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_active_caches_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalActiveCachesCount(val) + } + return nil + } + res["total_active_caches_size_in_bytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalActiveCachesSizeInBytes(val) + } + return nil + } + return res +} +// GetTotalActiveCachesCount gets the total_active_caches_count property value. The count of active caches across all repositories of an enterprise or an organization. +// returns a *int32 when successful +func (m *ActionsCacheUsageOrgEnterprise) GetTotalActiveCachesCount()(*int32) { + return m.total_active_caches_count +} +// GetTotalActiveCachesSizeInBytes gets the total_active_caches_size_in_bytes property value. The total size in bytes of all active cache items across all repositories of an enterprise or an organization. +// returns a *int32 when successful +func (m *ActionsCacheUsageOrgEnterprise) GetTotalActiveCachesSizeInBytes()(*int32) { + return m.total_active_caches_size_in_bytes +} +// Serialize serializes information the current object +func (m *ActionsCacheUsageOrgEnterprise) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_active_caches_count", m.GetTotalActiveCachesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_active_caches_size_in_bytes", m.GetTotalActiveCachesSizeInBytes()) + 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 *ActionsCacheUsageOrgEnterprise) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalActiveCachesCount sets the total_active_caches_count property value. The count of active caches across all repositories of an enterprise or an organization. +func (m *ActionsCacheUsageOrgEnterprise) SetTotalActiveCachesCount(value *int32)() { + m.total_active_caches_count = value +} +// SetTotalActiveCachesSizeInBytes sets the total_active_caches_size_in_bytes property value. The total size in bytes of all active cache items across all repositories of an enterprise or an organization. +func (m *ActionsCacheUsageOrgEnterprise) SetTotalActiveCachesSizeInBytes(value *int32)() { + m.total_active_caches_size_in_bytes = value +} +type ActionsCacheUsageOrgEnterpriseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalActiveCachesCount()(*int32) + GetTotalActiveCachesSizeInBytes()(*int32) + SetTotalActiveCachesCount(value *int32)() + SetTotalActiveCachesSizeInBytes(value *int32)() +} diff --git a/pkg/github/models/actions_cache_usage_policy_enterprise.go b/pkg/github/models/actions_cache_usage_policy_enterprise.go new file mode 100644 index 00000000..b18ef08f --- /dev/null +++ b/pkg/github/models/actions_cache_usage_policy_enterprise.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ActionsCacheUsagePolicyEnterprise gitHub Actions cache usage policy for an enterprise. +type ActionsCacheUsagePolicyEnterprise struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // For repositories in an enterprise, the maximum value that can be set as the limit for the sum of all caches in a repository, in gigabytes. + max_repo_cache_size_limit_in_gb *int32 + // For repositories in an enterprise, the default size limit for the sum of all caches in a repository, in gigabytes. + repo_cache_size_limit_in_gb *int32 +} +// NewActionsCacheUsagePolicyEnterprise instantiates a new ActionsCacheUsagePolicyEnterprise and sets the default values. +func NewActionsCacheUsagePolicyEnterprise()(*ActionsCacheUsagePolicyEnterprise) { + m := &ActionsCacheUsagePolicyEnterprise{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsCacheUsagePolicyEnterpriseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsCacheUsagePolicyEnterpriseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsCacheUsagePolicyEnterprise(), 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 *ActionsCacheUsagePolicyEnterprise) 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 *ActionsCacheUsagePolicyEnterprise) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["max_repo_cache_size_limit_in_gb"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMaxRepoCacheSizeLimitInGb(val) + } + return nil + } + res["repo_cache_size_limit_in_gb"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepoCacheSizeLimitInGb(val) + } + return nil + } + return res +} +// GetMaxRepoCacheSizeLimitInGb gets the max_repo_cache_size_limit_in_gb property value. For repositories in an enterprise, the maximum value that can be set as the limit for the sum of all caches in a repository, in gigabytes. +// returns a *int32 when successful +func (m *ActionsCacheUsagePolicyEnterprise) GetMaxRepoCacheSizeLimitInGb()(*int32) { + return m.max_repo_cache_size_limit_in_gb +} +// GetRepoCacheSizeLimitInGb gets the repo_cache_size_limit_in_gb property value. For repositories in an enterprise, the default size limit for the sum of all caches in a repository, in gigabytes. +// returns a *int32 when successful +func (m *ActionsCacheUsagePolicyEnterprise) GetRepoCacheSizeLimitInGb()(*int32) { + return m.repo_cache_size_limit_in_gb +} +// Serialize serializes information the current object +func (m *ActionsCacheUsagePolicyEnterprise) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("max_repo_cache_size_limit_in_gb", m.GetMaxRepoCacheSizeLimitInGb()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repo_cache_size_limit_in_gb", m.GetRepoCacheSizeLimitInGb()) + 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 *ActionsCacheUsagePolicyEnterprise) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMaxRepoCacheSizeLimitInGb sets the max_repo_cache_size_limit_in_gb property value. For repositories in an enterprise, the maximum value that can be set as the limit for the sum of all caches in a repository, in gigabytes. +func (m *ActionsCacheUsagePolicyEnterprise) SetMaxRepoCacheSizeLimitInGb(value *int32)() { + m.max_repo_cache_size_limit_in_gb = value +} +// SetRepoCacheSizeLimitInGb sets the repo_cache_size_limit_in_gb property value. For repositories in an enterprise, the default size limit for the sum of all caches in a repository, in gigabytes. +func (m *ActionsCacheUsagePolicyEnterprise) SetRepoCacheSizeLimitInGb(value *int32)() { + m.repo_cache_size_limit_in_gb = value +} +type ActionsCacheUsagePolicyEnterpriseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMaxRepoCacheSizeLimitInGb()(*int32) + GetRepoCacheSizeLimitInGb()(*int32) + SetMaxRepoCacheSizeLimitInGb(value *int32)() + SetRepoCacheSizeLimitInGb(value *int32)() +} diff --git a/pkg/github/models/actions_cache_usage_policy_for_repository.go b/pkg/github/models/actions_cache_usage_policy_for_repository.go new file mode 100644 index 00000000..a949a48c --- /dev/null +++ b/pkg/github/models/actions_cache_usage_policy_for_repository.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ActionsCacheUsagePolicyForRepository gitHub Actions cache usage policy for repository. +type ActionsCacheUsagePolicyForRepository 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 size limit for the sum of all caches, in gigabytes. + repo_cache_size_limit_in_gb *int32 +} +// NewActionsCacheUsagePolicyForRepository instantiates a new ActionsCacheUsagePolicyForRepository and sets the default values. +func NewActionsCacheUsagePolicyForRepository()(*ActionsCacheUsagePolicyForRepository) { + m := &ActionsCacheUsagePolicyForRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsCacheUsagePolicyForRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsCacheUsagePolicyForRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsCacheUsagePolicyForRepository(), 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 *ActionsCacheUsagePolicyForRepository) 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 *ActionsCacheUsagePolicyForRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repo_cache_size_limit_in_gb"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepoCacheSizeLimitInGb(val) + } + return nil + } + return res +} +// GetRepoCacheSizeLimitInGb gets the repo_cache_size_limit_in_gb property value. The size limit for the sum of all caches, in gigabytes. +// returns a *int32 when successful +func (m *ActionsCacheUsagePolicyForRepository) GetRepoCacheSizeLimitInGb()(*int32) { + return m.repo_cache_size_limit_in_gb +} +// Serialize serializes information the current object +func (m *ActionsCacheUsagePolicyForRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("repo_cache_size_limit_in_gb", m.GetRepoCacheSizeLimitInGb()) + 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 *ActionsCacheUsagePolicyForRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepoCacheSizeLimitInGb sets the repo_cache_size_limit_in_gb property value. The size limit for the sum of all caches, in gigabytes. +func (m *ActionsCacheUsagePolicyForRepository) SetRepoCacheSizeLimitInGb(value *int32)() { + m.repo_cache_size_limit_in_gb = value +} +type ActionsCacheUsagePolicyForRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepoCacheSizeLimitInGb()(*int32) + SetRepoCacheSizeLimitInGb(value *int32)() +} diff --git a/pkg/github/models/actions_default_workflow_permissions.go b/pkg/github/models/actions_default_workflow_permissions.go new file mode 100644 index 00000000..b3af872e --- /dev/null +++ b/pkg/github/models/actions_default_workflow_permissions.go @@ -0,0 +1,34 @@ +package models +// The default workflow permissions granted to the GITHUB_TOKEN when running workflows. +type ActionsDefaultWorkflowPermissions int + +const ( + READ_ACTIONSDEFAULTWORKFLOWPERMISSIONS ActionsDefaultWorkflowPermissions = iota + WRITE_ACTIONSDEFAULTWORKFLOWPERMISSIONS +) + +func (i ActionsDefaultWorkflowPermissions) String() string { + return []string{"read", "write"}[i] +} +func ParseActionsDefaultWorkflowPermissions(v string) (any, error) { + result := READ_ACTIONSDEFAULTWORKFLOWPERMISSIONS + switch v { + case "read": + result = READ_ACTIONSDEFAULTWORKFLOWPERMISSIONS + case "write": + result = WRITE_ACTIONSDEFAULTWORKFLOWPERMISSIONS + default: + return nil, nil + } + return &result, nil +} +func SerializeActionsDefaultWorkflowPermissions(values []ActionsDefaultWorkflowPermissions) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ActionsDefaultWorkflowPermissions) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/actions_enterprise_permissions.go b/pkg/github/models/actions_enterprise_permissions.go new file mode 100644 index 00000000..2b0b9a2a --- /dev/null +++ b/pkg/github/models/actions_enterprise_permissions.go @@ -0,0 +1,169 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsEnterprisePermissions 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 permissions policy that controls the actions that are allowed to run. + allowed_actions *AllowedActions + // The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. + enabled_organizations *EnabledOrganizations + // The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`. + selected_actions_url *string + // The API URL to use to get or set the selected organizations that are allowed to run GitHub Actions, when `enabled_organizations` is set to `selected`. + selected_organizations_url *string +} +// NewActionsEnterprisePermissions instantiates a new ActionsEnterprisePermissions and sets the default values. +func NewActionsEnterprisePermissions()(*ActionsEnterprisePermissions) { + m := &ActionsEnterprisePermissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsEnterprisePermissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsEnterprisePermissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsEnterprisePermissions(), 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 *ActionsEnterprisePermissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedActions gets the allowed_actions property value. The permissions policy that controls the actions that are allowed to run. +// returns a *AllowedActions when successful +func (m *ActionsEnterprisePermissions) GetAllowedActions()(*AllowedActions) { + return m.allowed_actions +} +// GetEnabledOrganizations gets the enabled_organizations property value. The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. +// returns a *EnabledOrganizations when successful +func (m *ActionsEnterprisePermissions) GetEnabledOrganizations()(*EnabledOrganizations) { + return m.enabled_organizations +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsEnterprisePermissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_actions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAllowedActions) + if err != nil { + return err + } + if val != nil { + m.SetAllowedActions(val.(*AllowedActions)) + } + return nil + } + res["enabled_organizations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseEnabledOrganizations) + if err != nil { + return err + } + if val != nil { + m.SetEnabledOrganizations(val.(*EnabledOrganizations)) + } + return nil + } + res["selected_actions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedActionsUrl(val) + } + return nil + } + res["selected_organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedOrganizationsUrl(val) + } + return nil + } + return res +} +// GetSelectedActionsUrl gets the selected_actions_url property value. The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`. +// returns a *string when successful +func (m *ActionsEnterprisePermissions) GetSelectedActionsUrl()(*string) { + return m.selected_actions_url +} +// GetSelectedOrganizationsUrl gets the selected_organizations_url property value. The API URL to use to get or set the selected organizations that are allowed to run GitHub Actions, when `enabled_organizations` is set to `selected`. +// returns a *string when successful +func (m *ActionsEnterprisePermissions) GetSelectedOrganizationsUrl()(*string) { + return m.selected_organizations_url +} +// Serialize serializes information the current object +func (m *ActionsEnterprisePermissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedActions() != nil { + cast := (*m.GetAllowedActions()).String() + err := writer.WriteStringValue("allowed_actions", &cast) + if err != nil { + return err + } + } + if m.GetEnabledOrganizations() != nil { + cast := (*m.GetEnabledOrganizations()).String() + err := writer.WriteStringValue("enabled_organizations", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_actions_url", m.GetSelectedActionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_organizations_url", m.GetSelectedOrganizationsUrl()) + 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 *ActionsEnterprisePermissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedActions sets the allowed_actions property value. The permissions policy that controls the actions that are allowed to run. +func (m *ActionsEnterprisePermissions) SetAllowedActions(value *AllowedActions)() { + m.allowed_actions = value +} +// SetEnabledOrganizations sets the enabled_organizations property value. The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. +func (m *ActionsEnterprisePermissions) SetEnabledOrganizations(value *EnabledOrganizations)() { + m.enabled_organizations = value +} +// SetSelectedActionsUrl sets the selected_actions_url property value. The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`. +func (m *ActionsEnterprisePermissions) SetSelectedActionsUrl(value *string)() { + m.selected_actions_url = value +} +// SetSelectedOrganizationsUrl sets the selected_organizations_url property value. The API URL to use to get or set the selected organizations that are allowed to run GitHub Actions, when `enabled_organizations` is set to `selected`. +func (m *ActionsEnterprisePermissions) SetSelectedOrganizationsUrl(value *string)() { + m.selected_organizations_url = value +} +type ActionsEnterprisePermissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedActions()(*AllowedActions) + GetEnabledOrganizations()(*EnabledOrganizations) + GetSelectedActionsUrl()(*string) + GetSelectedOrganizationsUrl()(*string) + SetAllowedActions(value *AllowedActions)() + SetEnabledOrganizations(value *EnabledOrganizations)() + SetSelectedActionsUrl(value *string)() + SetSelectedOrganizationsUrl(value *string)() +} diff --git a/pkg/github/models/actions_get_default_workflow_permissions.go b/pkg/github/models/actions_get_default_workflow_permissions.go new file mode 100644 index 00000000..43385fc5 --- /dev/null +++ b/pkg/github/models/actions_get_default_workflow_permissions.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsGetDefaultWorkflowPermissions 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 GitHub Actions can approve pull requests. Enabling this can be a security risk. + can_approve_pull_request_reviews *bool + // The default workflow permissions granted to the GITHUB_TOKEN when running workflows. + default_workflow_permissions *ActionsDefaultWorkflowPermissions +} +// NewActionsGetDefaultWorkflowPermissions instantiates a new ActionsGetDefaultWorkflowPermissions and sets the default values. +func NewActionsGetDefaultWorkflowPermissions()(*ActionsGetDefaultWorkflowPermissions) { + m := &ActionsGetDefaultWorkflowPermissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsGetDefaultWorkflowPermissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsGetDefaultWorkflowPermissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsGetDefaultWorkflowPermissions(), 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 *ActionsGetDefaultWorkflowPermissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCanApprovePullRequestReviews gets the can_approve_pull_request_reviews property value. Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. +// returns a *bool when successful +func (m *ActionsGetDefaultWorkflowPermissions) GetCanApprovePullRequestReviews()(*bool) { + return m.can_approve_pull_request_reviews +} +// GetDefaultWorkflowPermissions gets the default_workflow_permissions property value. The default workflow permissions granted to the GITHUB_TOKEN when running workflows. +// returns a *ActionsDefaultWorkflowPermissions when successful +func (m *ActionsGetDefaultWorkflowPermissions) GetDefaultWorkflowPermissions()(*ActionsDefaultWorkflowPermissions) { + return m.default_workflow_permissions +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsGetDefaultWorkflowPermissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["can_approve_pull_request_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanApprovePullRequestReviews(val) + } + return nil + } + res["default_workflow_permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseActionsDefaultWorkflowPermissions) + if err != nil { + return err + } + if val != nil { + m.SetDefaultWorkflowPermissions(val.(*ActionsDefaultWorkflowPermissions)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ActionsGetDefaultWorkflowPermissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("can_approve_pull_request_reviews", m.GetCanApprovePullRequestReviews()) + if err != nil { + return err + } + } + if m.GetDefaultWorkflowPermissions() != nil { + cast := (*m.GetDefaultWorkflowPermissions()).String() + err := writer.WriteStringValue("default_workflow_permissions", &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 *ActionsGetDefaultWorkflowPermissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCanApprovePullRequestReviews sets the can_approve_pull_request_reviews property value. Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. +func (m *ActionsGetDefaultWorkflowPermissions) SetCanApprovePullRequestReviews(value *bool)() { + m.can_approve_pull_request_reviews = value +} +// SetDefaultWorkflowPermissions sets the default_workflow_permissions property value. The default workflow permissions granted to the GITHUB_TOKEN when running workflows. +func (m *ActionsGetDefaultWorkflowPermissions) SetDefaultWorkflowPermissions(value *ActionsDefaultWorkflowPermissions)() { + m.default_workflow_permissions = value +} +type ActionsGetDefaultWorkflowPermissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCanApprovePullRequestReviews()(*bool) + GetDefaultWorkflowPermissions()(*ActionsDefaultWorkflowPermissions) + SetCanApprovePullRequestReviews(value *bool)() + SetDefaultWorkflowPermissions(value *ActionsDefaultWorkflowPermissions)() +} diff --git a/pkg/github/models/actions_organization_permissions.go b/pkg/github/models/actions_organization_permissions.go new file mode 100644 index 00000000..e99cc340 --- /dev/null +++ b/pkg/github/models/actions_organization_permissions.go @@ -0,0 +1,169 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsOrganizationPermissions 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 permissions policy that controls the actions that are allowed to run. + allowed_actions *AllowedActions + // The policy that controls the repositories in the organization that are allowed to run GitHub Actions. + enabled_repositories *EnabledRepositories + // The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`. + selected_actions_url *string + // The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`. + selected_repositories_url *string +} +// NewActionsOrganizationPermissions instantiates a new ActionsOrganizationPermissions and sets the default values. +func NewActionsOrganizationPermissions()(*ActionsOrganizationPermissions) { + m := &ActionsOrganizationPermissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsOrganizationPermissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsOrganizationPermissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsOrganizationPermissions(), 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 *ActionsOrganizationPermissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedActions gets the allowed_actions property value. The permissions policy that controls the actions that are allowed to run. +// returns a *AllowedActions when successful +func (m *ActionsOrganizationPermissions) GetAllowedActions()(*AllowedActions) { + return m.allowed_actions +} +// GetEnabledRepositories gets the enabled_repositories property value. The policy that controls the repositories in the organization that are allowed to run GitHub Actions. +// returns a *EnabledRepositories when successful +func (m *ActionsOrganizationPermissions) GetEnabledRepositories()(*EnabledRepositories) { + return m.enabled_repositories +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsOrganizationPermissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_actions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAllowedActions) + if err != nil { + return err + } + if val != nil { + m.SetAllowedActions(val.(*AllowedActions)) + } + return nil + } + res["enabled_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseEnabledRepositories) + if err != nil { + return err + } + if val != nil { + m.SetEnabledRepositories(val.(*EnabledRepositories)) + } + return nil + } + res["selected_actions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedActionsUrl(val) + } + return nil + } + res["selected_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedRepositoriesUrl(val) + } + return nil + } + return res +} +// GetSelectedActionsUrl gets the selected_actions_url property value. The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`. +// returns a *string when successful +func (m *ActionsOrganizationPermissions) GetSelectedActionsUrl()(*string) { + return m.selected_actions_url +} +// GetSelectedRepositoriesUrl gets the selected_repositories_url property value. The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`. +// returns a *string when successful +func (m *ActionsOrganizationPermissions) GetSelectedRepositoriesUrl()(*string) { + return m.selected_repositories_url +} +// Serialize serializes information the current object +func (m *ActionsOrganizationPermissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedActions() != nil { + cast := (*m.GetAllowedActions()).String() + err := writer.WriteStringValue("allowed_actions", &cast) + if err != nil { + return err + } + } + if m.GetEnabledRepositories() != nil { + cast := (*m.GetEnabledRepositories()).String() + err := writer.WriteStringValue("enabled_repositories", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_actions_url", m.GetSelectedActionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_repositories_url", m.GetSelectedRepositoriesUrl()) + 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 *ActionsOrganizationPermissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedActions sets the allowed_actions property value. The permissions policy that controls the actions that are allowed to run. +func (m *ActionsOrganizationPermissions) SetAllowedActions(value *AllowedActions)() { + m.allowed_actions = value +} +// SetEnabledRepositories sets the enabled_repositories property value. The policy that controls the repositories in the organization that are allowed to run GitHub Actions. +func (m *ActionsOrganizationPermissions) SetEnabledRepositories(value *EnabledRepositories)() { + m.enabled_repositories = value +} +// SetSelectedActionsUrl sets the selected_actions_url property value. The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`. +func (m *ActionsOrganizationPermissions) SetSelectedActionsUrl(value *string)() { + m.selected_actions_url = value +} +// SetSelectedRepositoriesUrl sets the selected_repositories_url property value. The API URL to use to get or set the selected repositories that are allowed to run GitHub Actions, when `enabled_repositories` is set to `selected`. +func (m *ActionsOrganizationPermissions) SetSelectedRepositoriesUrl(value *string)() { + m.selected_repositories_url = value +} +type ActionsOrganizationPermissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedActions()(*AllowedActions) + GetEnabledRepositories()(*EnabledRepositories) + GetSelectedActionsUrl()(*string) + GetSelectedRepositoriesUrl()(*string) + SetAllowedActions(value *AllowedActions)() + SetEnabledRepositories(value *EnabledRepositories)() + SetSelectedActionsUrl(value *string)() + SetSelectedRepositoriesUrl(value *string)() +} diff --git a/pkg/github/models/actions_public_key.go b/pkg/github/models/actions_public_key.go new file mode 100644 index 00000000..02668514 --- /dev/null +++ b/pkg/github/models/actions_public_key.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ActionsPublicKey the public key used for setting Actions Secrets. +type ActionsPublicKey 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 *string + // The id property + id *int32 + // The Base64 encoded public key. + key *string + // The identifier for the key. + key_id *string + // The title property + title *string + // The url property + url *string +} +// NewActionsPublicKey instantiates a new ActionsPublicKey and sets the default values. +func NewActionsPublicKey()(*ActionsPublicKey) { + m := &ActionsPublicKey{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsPublicKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsPublicKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsPublicKey(), 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 *ActionsPublicKey) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *ActionsPublicKey) GetCreatedAt()(*string) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsPublicKey) 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.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + 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 + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ActionsPublicKey) GetId()(*int32) { + return m.id +} +// GetKey gets the key property value. The Base64 encoded public key. +// returns a *string when successful +func (m *ActionsPublicKey) GetKey()(*string) { + return m.key +} +// GetKeyId gets the key_id property value. The identifier for the key. +// returns a *string when successful +func (m *ActionsPublicKey) GetKeyId()(*string) { + return m.key_id +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *ActionsPublicKey) GetTitle()(*string) { + return m.title +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ActionsPublicKey) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ActionsPublicKey) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + 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.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ActionsPublicKey) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ActionsPublicKey) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *ActionsPublicKey) SetId(value *int32)() { + m.id = value +} +// SetKey sets the key property value. The Base64 encoded public key. +func (m *ActionsPublicKey) SetKey(value *string)() { + m.key = value +} +// SetKeyId sets the key_id property value. The identifier for the key. +func (m *ActionsPublicKey) SetKeyId(value *string)() { + m.key_id = value +} +// SetTitle sets the title property value. The title property +func (m *ActionsPublicKey) SetTitle(value *string)() { + m.title = value +} +// SetUrl sets the url property value. The url property +func (m *ActionsPublicKey) SetUrl(value *string)() { + m.url = value +} +type ActionsPublicKeyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetId()(*int32) + GetKey()(*string) + GetKeyId()(*string) + GetTitle()(*string) + GetUrl()(*string) + SetCreatedAt(value *string)() + SetId(value *int32)() + SetKey(value *string)() + SetKeyId(value *string)() + SetTitle(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/actions_repository_permissions.go b/pkg/github/models/actions_repository_permissions.go new file mode 100644 index 00000000..31e4b5ce --- /dev/null +++ b/pkg/github/models/actions_repository_permissions.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsRepositoryPermissions 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 permissions policy that controls the actions that are allowed to run. + allowed_actions *AllowedActions + // Whether GitHub Actions is enabled on the repository. + enabled *bool + // The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`. + selected_actions_url *string +} +// NewActionsRepositoryPermissions instantiates a new ActionsRepositoryPermissions and sets the default values. +func NewActionsRepositoryPermissions()(*ActionsRepositoryPermissions) { + m := &ActionsRepositoryPermissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsRepositoryPermissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsRepositoryPermissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsRepositoryPermissions(), 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 *ActionsRepositoryPermissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedActions gets the allowed_actions property value. The permissions policy that controls the actions that are allowed to run. +// returns a *AllowedActions when successful +func (m *ActionsRepositoryPermissions) GetAllowedActions()(*AllowedActions) { + return m.allowed_actions +} +// GetEnabled gets the enabled property value. Whether GitHub Actions is enabled on the repository. +// returns a *bool when successful +func (m *ActionsRepositoryPermissions) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsRepositoryPermissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_actions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAllowedActions) + if err != nil { + return err + } + if val != nil { + m.SetAllowedActions(val.(*AllowedActions)) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["selected_actions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedActionsUrl(val) + } + return nil + } + return res +} +// GetSelectedActionsUrl gets the selected_actions_url property value. The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`. +// returns a *string when successful +func (m *ActionsRepositoryPermissions) GetSelectedActionsUrl()(*string) { + return m.selected_actions_url +} +// Serialize serializes information the current object +func (m *ActionsRepositoryPermissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedActions() != nil { + cast := (*m.GetAllowedActions()).String() + err := writer.WriteStringValue("allowed_actions", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_actions_url", m.GetSelectedActionsUrl()) + 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 *ActionsRepositoryPermissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedActions sets the allowed_actions property value. The permissions policy that controls the actions that are allowed to run. +func (m *ActionsRepositoryPermissions) SetAllowedActions(value *AllowedActions)() { + m.allowed_actions = value +} +// SetEnabled sets the enabled property value. Whether GitHub Actions is enabled on the repository. +func (m *ActionsRepositoryPermissions) SetEnabled(value *bool)() { + m.enabled = value +} +// SetSelectedActionsUrl sets the selected_actions_url property value. The API URL to use to get or set the actions that are allowed to run, when `allowed_actions` is set to `selected`. +func (m *ActionsRepositoryPermissions) SetSelectedActionsUrl(value *string)() { + m.selected_actions_url = value +} +type ActionsRepositoryPermissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedActions()(*AllowedActions) + GetEnabled()(*bool) + GetSelectedActionsUrl()(*string) + SetAllowedActions(value *AllowedActions)() + SetEnabled(value *bool)() + SetSelectedActionsUrl(value *string)() +} diff --git a/pkg/github/models/actions_secret.go b/pkg/github/models/actions_secret.go new file mode 100644 index 00000000..c42490e1 --- /dev/null +++ b/pkg/github/models/actions_secret.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ActionsSecret set secrets for GitHub Actions. +type ActionsSecret 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 secret. + name *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewActionsSecret instantiates a new ActionsSecret and sets the default values. +func NewActionsSecret()(*ActionsSecret) { + m := &ActionsSecret{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsSecretFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsSecretFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsSecret(), 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 *ActionsSecret) 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 *ActionsSecret) 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 *ActionsSecret) 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["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the secret. +// returns a *string when successful +func (m *ActionsSecret) GetName()(*string) { + return m.name +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *ActionsSecret) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *ActionsSecret) 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 + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *ActionsSecret) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ActionsSecret) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the secret. +func (m *ActionsSecret) SetName(value *string)() { + m.name = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *ActionsSecret) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type ActionsSecretable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/actions_set_default_workflow_permissions.go b/pkg/github/models/actions_set_default_workflow_permissions.go new file mode 100644 index 00000000..86dcf13a --- /dev/null +++ b/pkg/github/models/actions_set_default_workflow_permissions.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsSetDefaultWorkflowPermissions 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 GitHub Actions can approve pull requests. Enabling this can be a security risk. + can_approve_pull_request_reviews *bool + // The default workflow permissions granted to the GITHUB_TOKEN when running workflows. + default_workflow_permissions *ActionsDefaultWorkflowPermissions +} +// NewActionsSetDefaultWorkflowPermissions instantiates a new ActionsSetDefaultWorkflowPermissions and sets the default values. +func NewActionsSetDefaultWorkflowPermissions()(*ActionsSetDefaultWorkflowPermissions) { + m := &ActionsSetDefaultWorkflowPermissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsSetDefaultWorkflowPermissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsSetDefaultWorkflowPermissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsSetDefaultWorkflowPermissions(), 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 *ActionsSetDefaultWorkflowPermissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCanApprovePullRequestReviews gets the can_approve_pull_request_reviews property value. Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. +// returns a *bool when successful +func (m *ActionsSetDefaultWorkflowPermissions) GetCanApprovePullRequestReviews()(*bool) { + return m.can_approve_pull_request_reviews +} +// GetDefaultWorkflowPermissions gets the default_workflow_permissions property value. The default workflow permissions granted to the GITHUB_TOKEN when running workflows. +// returns a *ActionsDefaultWorkflowPermissions when successful +func (m *ActionsSetDefaultWorkflowPermissions) GetDefaultWorkflowPermissions()(*ActionsDefaultWorkflowPermissions) { + return m.default_workflow_permissions +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ActionsSetDefaultWorkflowPermissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["can_approve_pull_request_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanApprovePullRequestReviews(val) + } + return nil + } + res["default_workflow_permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseActionsDefaultWorkflowPermissions) + if err != nil { + return err + } + if val != nil { + m.SetDefaultWorkflowPermissions(val.(*ActionsDefaultWorkflowPermissions)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ActionsSetDefaultWorkflowPermissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("can_approve_pull_request_reviews", m.GetCanApprovePullRequestReviews()) + if err != nil { + return err + } + } + if m.GetDefaultWorkflowPermissions() != nil { + cast := (*m.GetDefaultWorkflowPermissions()).String() + err := writer.WriteStringValue("default_workflow_permissions", &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 *ActionsSetDefaultWorkflowPermissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCanApprovePullRequestReviews sets the can_approve_pull_request_reviews property value. Whether GitHub Actions can approve pull requests. Enabling this can be a security risk. +func (m *ActionsSetDefaultWorkflowPermissions) SetCanApprovePullRequestReviews(value *bool)() { + m.can_approve_pull_request_reviews = value +} +// SetDefaultWorkflowPermissions sets the default_workflow_permissions property value. The default workflow permissions granted to the GITHUB_TOKEN when running workflows. +func (m *ActionsSetDefaultWorkflowPermissions) SetDefaultWorkflowPermissions(value *ActionsDefaultWorkflowPermissions)() { + m.default_workflow_permissions = value +} +type ActionsSetDefaultWorkflowPermissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCanApprovePullRequestReviews()(*bool) + GetDefaultWorkflowPermissions()(*ActionsDefaultWorkflowPermissions) + SetCanApprovePullRequestReviews(value *bool)() + SetDefaultWorkflowPermissions(value *ActionsDefaultWorkflowPermissions)() +} diff --git a/pkg/github/models/actions_variable.go b/pkg/github/models/actions_variable.go new file mode 100644 index 00000000..f89af004 --- /dev/null +++ b/pkg/github/models/actions_variable.go @@ -0,0 +1,168 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsVariable 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 date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the variable. + name *string + // The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The value of the variable. + value *string +} +// NewActionsVariable instantiates a new ActionsVariable and sets the default values. +func NewActionsVariable()(*ActionsVariable) { + m := &ActionsVariable{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsVariableFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsVariableFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsVariable(), 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 *ActionsVariable) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *ActionsVariable) 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 *ActionsVariable) 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["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["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ActionsVariable) GetName()(*string) { + return m.name +} +// GetUpdatedAt gets the updated_at property value. The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *ActionsVariable) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ActionsVariable) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ActionsVariable) 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 + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + 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 *ActionsVariable) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *ActionsVariable) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the variable. +func (m *ActionsVariable) SetName(value *string)() { + m.name = value +} +// SetUpdatedAt sets the updated_at property value. The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *ActionsVariable) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ActionsVariable) SetValue(value *string)() { + m.value = value +} +type ActionsVariableable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetValue()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetValue(value *string)() +} diff --git a/pkg/github/models/actions_workflow_access_to_repository.go b/pkg/github/models/actions_workflow_access_to_repository.go new file mode 100644 index 00000000..6174ca9a --- /dev/null +++ b/pkg/github/models/actions_workflow_access_to_repository.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ActionsWorkflowAccessToRepository struct { + // Defines the level of access that workflows outside of the repository have to actions and reusable workflows within therepository.`none` means the access is only possible from workflows in this repository. `user` level access allows sharing across user owned private repositories only. `organization` level access allows sharing across the organization. `enterprise` level access allows sharing across the enterprise. + access_level *ActionsWorkflowAccessToRepository_access_level + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewActionsWorkflowAccessToRepository instantiates a new ActionsWorkflowAccessToRepository and sets the default values. +func NewActionsWorkflowAccessToRepository()(*ActionsWorkflowAccessToRepository) { + m := &ActionsWorkflowAccessToRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActionsWorkflowAccessToRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActionsWorkflowAccessToRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActionsWorkflowAccessToRepository(), nil +} +// GetAccessLevel gets the access_level property value. Defines the level of access that workflows outside of the repository have to actions and reusable workflows within therepository.`none` means the access is only possible from workflows in this repository. `user` level access allows sharing across user owned private repositories only. `organization` level access allows sharing across the organization. `enterprise` level access allows sharing across the enterprise. +// returns a *ActionsWorkflowAccessToRepository_access_level when successful +func (m *ActionsWorkflowAccessToRepository) GetAccessLevel()(*ActionsWorkflowAccessToRepository_access_level) { + return m.access_level +} +// 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 *ActionsWorkflowAccessToRepository) 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 *ActionsWorkflowAccessToRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_level"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseActionsWorkflowAccessToRepository_access_level) + if err != nil { + return err + } + if val != nil { + m.SetAccessLevel(val.(*ActionsWorkflowAccessToRepository_access_level)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ActionsWorkflowAccessToRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAccessLevel() != nil { + cast := (*m.GetAccessLevel()).String() + err := writer.WriteStringValue("access_level", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessLevel sets the access_level property value. Defines the level of access that workflows outside of the repository have to actions and reusable workflows within therepository.`none` means the access is only possible from workflows in this repository. `user` level access allows sharing across user owned private repositories only. `organization` level access allows sharing across the organization. `enterprise` level access allows sharing across the enterprise. +func (m *ActionsWorkflowAccessToRepository) SetAccessLevel(value *ActionsWorkflowAccessToRepository_access_level)() { + m.access_level = 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 *ActionsWorkflowAccessToRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ActionsWorkflowAccessToRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessLevel()(*ActionsWorkflowAccessToRepository_access_level) + SetAccessLevel(value *ActionsWorkflowAccessToRepository_access_level)() +} diff --git a/pkg/github/models/actions_workflow_access_to_repository_escaped_access_escaped_level.go b/pkg/github/models/actions_workflow_access_to_repository_escaped_access_escaped_level.go new file mode 100644 index 00000000..5ccd14bd --- /dev/null +++ b/pkg/github/models/actions_workflow_access_to_repository_escaped_access_escaped_level.go @@ -0,0 +1,40 @@ +package models +// Defines the level of access that workflows outside of the repository have to actions and reusable workflows within therepository.`none` means the access is only possible from workflows in this repository. `user` level access allows sharing across user owned private repositories only. `organization` level access allows sharing across the organization. `enterprise` level access allows sharing across the enterprise. +type ActionsWorkflowAccessToRepository_access_level int + +const ( + NONE_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL ActionsWorkflowAccessToRepository_access_level = iota + USER_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL + ORGANIZATION_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL + ENTERPRISE_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL +) + +func (i ActionsWorkflowAccessToRepository_access_level) String() string { + return []string{"none", "user", "organization", "enterprise"}[i] +} +func ParseActionsWorkflowAccessToRepository_access_level(v string) (any, error) { + result := NONE_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL + switch v { + case "none": + result = NONE_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL + case "user": + result = USER_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL + case "organization": + result = ORGANIZATION_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL + case "enterprise": + result = ENTERPRISE_ACTIONSWORKFLOWACCESSTOREPOSITORY_ACCESS_LEVEL + default: + return nil, nil + } + return &result, nil +} +func SerializeActionsWorkflowAccessToRepository_access_level(values []ActionsWorkflowAccessToRepository_access_level) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ActionsWorkflowAccessToRepository_access_level) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/activity.go b/pkg/github/models/activity.go new file mode 100644 index 00000000..b8be7875 --- /dev/null +++ b/pkg/github/models/activity.go @@ -0,0 +1,286 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Activity activity +type Activity struct { + // The type of the activity that was performed. + activity_type *Activity_activity_type + // A GitHub user. + actor NullableSimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The SHA of the commit after the activity. + after *string + // The SHA of the commit before the activity. + before *string + // The id property + id *int32 + // The node_id property + node_id *string + // The full Git reference, formatted as `refs/heads/`. + ref *string + // The time when the activity occurred. + timestamp *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewActivity instantiates a new Activity and sets the default values. +func NewActivity()(*Activity) { + m := &Activity{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActivityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActivityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActivity(), nil +} +// GetActivityType gets the activity_type property value. The type of the activity that was performed. +// returns a *Activity_activity_type when successful +func (m *Activity) GetActivityType()(*Activity_activity_type) { + return m.activity_type +} +// GetActor gets the actor property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Activity) GetActor()(NullableSimpleUserable) { + return m.actor +} +// 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 *Activity) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAfter gets the after property value. The SHA of the commit after the activity. +// returns a *string when successful +func (m *Activity) GetAfter()(*string) { + return m.after +} +// GetBefore gets the before property value. The SHA of the commit before the activity. +// returns a *string when successful +func (m *Activity) GetBefore()(*string) { + return m.before +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Activity) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["activity_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseActivity_activity_type) + if err != nil { + return err + } + if val != nil { + m.SetActivityType(val.(*Activity_activity_type)) + } + return nil + } + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(NullableSimpleUserable)) + } + return nil + } + res["after"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAfter(val) + } + return nil + } + res["before"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBefore(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["timestamp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetTimestamp(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Activity) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Activity) GetNodeId()(*string) { + return m.node_id +} +// GetRef gets the ref property value. The full Git reference, formatted as `refs/heads/`. +// returns a *string when successful +func (m *Activity) GetRef()(*string) { + return m.ref +} +// GetTimestamp gets the timestamp property value. The time when the activity occurred. +// returns a *Time when successful +func (m *Activity) GetTimestamp()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.timestamp +} +// Serialize serializes information the current object +func (m *Activity) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetActivityType() != nil { + cast := (*m.GetActivityType()).String() + err := writer.WriteStringValue("activity_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("after", m.GetAfter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("before", m.GetBefore()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("timestamp", m.GetTimestamp()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActivityType sets the activity_type property value. The type of the activity that was performed. +func (m *Activity) SetActivityType(value *Activity_activity_type)() { + m.activity_type = value +} +// SetActor sets the actor property value. A GitHub user. +func (m *Activity) SetActor(value NullableSimpleUserable)() { + m.actor = 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 *Activity) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAfter sets the after property value. The SHA of the commit after the activity. +func (m *Activity) SetAfter(value *string)() { + m.after = value +} +// SetBefore sets the before property value. The SHA of the commit before the activity. +func (m *Activity) SetBefore(value *string)() { + m.before = value +} +// SetId sets the id property value. The id property +func (m *Activity) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Activity) SetNodeId(value *string)() { + m.node_id = value +} +// SetRef sets the ref property value. The full Git reference, formatted as `refs/heads/`. +func (m *Activity) SetRef(value *string)() { + m.ref = value +} +// SetTimestamp sets the timestamp property value. The time when the activity occurred. +func (m *Activity) SetTimestamp(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.timestamp = value +} +type Activityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActivityType()(*Activity_activity_type) + GetActor()(NullableSimpleUserable) + GetAfter()(*string) + GetBefore()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetRef()(*string) + GetTimestamp()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetActivityType(value *Activity_activity_type)() + SetActor(value NullableSimpleUserable)() + SetAfter(value *string)() + SetBefore(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetRef(value *string)() + SetTimestamp(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/activity_escaped_activity_escaped_type.go b/pkg/github/models/activity_escaped_activity_escaped_type.go new file mode 100644 index 00000000..65789417 --- /dev/null +++ b/pkg/github/models/activity_escaped_activity_escaped_type.go @@ -0,0 +1,46 @@ +package models +// The type of the activity that was performed. +type Activity_activity_type int + +const ( + PUSH_ACTIVITY_ACTIVITY_TYPE Activity_activity_type = iota + FORCE_PUSH_ACTIVITY_ACTIVITY_TYPE + BRANCH_DELETION_ACTIVITY_ACTIVITY_TYPE + BRANCH_CREATION_ACTIVITY_ACTIVITY_TYPE + PR_MERGE_ACTIVITY_ACTIVITY_TYPE + MERGE_QUEUE_MERGE_ACTIVITY_ACTIVITY_TYPE +) + +func (i Activity_activity_type) String() string { + return []string{"push", "force_push", "branch_deletion", "branch_creation", "pr_merge", "merge_queue_merge"}[i] +} +func ParseActivity_activity_type(v string) (any, error) { + result := PUSH_ACTIVITY_ACTIVITY_TYPE + switch v { + case "push": + result = PUSH_ACTIVITY_ACTIVITY_TYPE + case "force_push": + result = FORCE_PUSH_ACTIVITY_ACTIVITY_TYPE + case "branch_deletion": + result = BRANCH_DELETION_ACTIVITY_ACTIVITY_TYPE + case "branch_creation": + result = BRANCH_CREATION_ACTIVITY_ACTIVITY_TYPE + case "pr_merge": + result = PR_MERGE_ACTIVITY_ACTIVITY_TYPE + case "merge_queue_merge": + result = MERGE_QUEUE_MERGE_ACTIVITY_ACTIVITY_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeActivity_activity_type(values []Activity_activity_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Activity_activity_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/actor.go b/pkg/github/models/actor.go new file mode 100644 index 00000000..bceb9933 --- /dev/null +++ b/pkg/github/models/actor.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Actor actor +type Actor 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 avatar_url property + avatar_url *string + // The display_login property + display_login *string + // The gravatar_id property + gravatar_id *string + // The id property + id *int32 + // The login property + login *string + // The url property + url *string +} +// NewActor instantiates a new Actor and sets the default values. +func NewActor()(*Actor) { + m := &Actor{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateActorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateActorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewActor(), 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 *Actor) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *Actor) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetDisplayLogin gets the display_login property value. The display_login property +// returns a *string when successful +func (m *Actor) GetDisplayLogin()(*string) { + return m.display_login +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Actor) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["display_login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayLogin(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *Actor) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Actor) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *Actor) GetLogin()(*string) { + return m.login +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Actor) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Actor) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("display_login", m.GetDisplayLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Actor) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *Actor) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetDisplayLogin sets the display_login property value. The display_login property +func (m *Actor) SetDisplayLogin(value *string)() { + m.display_login = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *Actor) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetId sets the id property value. The id property +func (m *Actor) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *Actor) SetLogin(value *string)() { + m.login = value +} +// SetUrl sets the url property value. The url property +func (m *Actor) SetUrl(value *string)() { + m.url = value +} +type Actorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetDisplayLogin()(*string) + GetGravatarId()(*string) + GetId()(*int32) + GetLogin()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetDisplayLogin(value *string)() + SetGravatarId(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/added_to_project_issue_event.go b/pkg/github/models/added_to_project_issue_event.go new file mode 100644 index 00000000..9d1dfe68 --- /dev/null +++ b/pkg/github/models/added_to_project_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// AddedToProjectIssueEvent added to Project Issue Event +type AddedToProjectIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The project_card property + project_card AddedToProjectIssueEvent_project_cardable + // The url property + url *string +} +// NewAddedToProjectIssueEvent instantiates a new AddedToProjectIssueEvent and sets the default values. +func NewAddedToProjectIssueEvent()(*AddedToProjectIssueEvent) { + m := &AddedToProjectIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAddedToProjectIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAddedToProjectIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAddedToProjectIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *AddedToProjectIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *AddedToProjectIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *AddedToProjectIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *AddedToProjectIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *AddedToProjectIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *AddedToProjectIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AddedToProjectIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["project_card"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAddedToProjectIssueEvent_project_cardFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProjectCard(val.(AddedToProjectIssueEvent_project_cardable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *AddedToProjectIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *AddedToProjectIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *AddedToProjectIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetProjectCard gets the project_card property value. The project_card property +// returns a AddedToProjectIssueEvent_project_cardable when successful +func (m *AddedToProjectIssueEvent) GetProjectCard()(AddedToProjectIssueEvent_project_cardable) { + return m.project_card +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *AddedToProjectIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *AddedToProjectIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("project_card", m.GetProjectCard()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *AddedToProjectIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *AddedToProjectIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *AddedToProjectIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *AddedToProjectIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *AddedToProjectIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *AddedToProjectIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *AddedToProjectIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *AddedToProjectIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *AddedToProjectIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetProjectCard sets the project_card property value. The project_card property +func (m *AddedToProjectIssueEvent) SetProjectCard(value AddedToProjectIssueEvent_project_cardable)() { + m.project_card = value +} +// SetUrl sets the url property value. The url property +func (m *AddedToProjectIssueEvent) SetUrl(value *string)() { + m.url = value +} +type AddedToProjectIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetProjectCard()(AddedToProjectIssueEvent_project_cardable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetProjectCard(value AddedToProjectIssueEvent_project_cardable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/added_to_project_issue_event_escaped_project_escaped_card.go b/pkg/github/models/added_to_project_issue_event_escaped_project_escaped_card.go new file mode 100644 index 00000000..7c542469 --- /dev/null +++ b/pkg/github/models/added_to_project_issue_event_escaped_project_escaped_card.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AddedToProjectIssueEvent_project_card 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 column_name property + column_name *string + // The id property + id *int32 + // The previous_column_name property + previous_column_name *string + // The project_id property + project_id *int32 + // The project_url property + project_url *string + // The url property + url *string +} +// NewAddedToProjectIssueEvent_project_card instantiates a new AddedToProjectIssueEvent_project_card and sets the default values. +func NewAddedToProjectIssueEvent_project_card()(*AddedToProjectIssueEvent_project_card) { + m := &AddedToProjectIssueEvent_project_card{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAddedToProjectIssueEvent_project_cardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAddedToProjectIssueEvent_project_cardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAddedToProjectIssueEvent_project_card(), 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 *AddedToProjectIssueEvent_project_card) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColumnName gets the column_name property value. The column_name property +// returns a *string when successful +func (m *AddedToProjectIssueEvent_project_card) GetColumnName()(*string) { + return m.column_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AddedToProjectIssueEvent_project_card) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnName(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["previous_column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousColumnName(val) + } + return nil + } + res["project_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetProjectId(val) + } + return nil + } + res["project_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *AddedToProjectIssueEvent_project_card) GetId()(*int32) { + return m.id +} +// GetPreviousColumnName gets the previous_column_name property value. The previous_column_name property +// returns a *string when successful +func (m *AddedToProjectIssueEvent_project_card) GetPreviousColumnName()(*string) { + return m.previous_column_name +} +// GetProjectId gets the project_id property value. The project_id property +// returns a *int32 when successful +func (m *AddedToProjectIssueEvent_project_card) GetProjectId()(*int32) { + return m.project_id +} +// GetProjectUrl gets the project_url property value. The project_url property +// returns a *string when successful +func (m *AddedToProjectIssueEvent_project_card) GetProjectUrl()(*string) { + return m.project_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *AddedToProjectIssueEvent_project_card) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *AddedToProjectIssueEvent_project_card) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("column_name", m.GetColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_column_name", m.GetPreviousColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("project_id", m.GetProjectId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_url", m.GetProjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *AddedToProjectIssueEvent_project_card) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColumnName sets the column_name property value. The column_name property +func (m *AddedToProjectIssueEvent_project_card) SetColumnName(value *string)() { + m.column_name = value +} +// SetId sets the id property value. The id property +func (m *AddedToProjectIssueEvent_project_card) SetId(value *int32)() { + m.id = value +} +// SetPreviousColumnName sets the previous_column_name property value. The previous_column_name property +func (m *AddedToProjectIssueEvent_project_card) SetPreviousColumnName(value *string)() { + m.previous_column_name = value +} +// SetProjectId sets the project_id property value. The project_id property +func (m *AddedToProjectIssueEvent_project_card) SetProjectId(value *int32)() { + m.project_id = value +} +// SetProjectUrl sets the project_url property value. The project_url property +func (m *AddedToProjectIssueEvent_project_card) SetProjectUrl(value *string)() { + m.project_url = value +} +// SetUrl sets the url property value. The url property +func (m *AddedToProjectIssueEvent_project_card) SetUrl(value *string)() { + m.url = value +} +type AddedToProjectIssueEvent_project_cardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumnName()(*string) + GetId()(*int32) + GetPreviousColumnName()(*string) + GetProjectId()(*int32) + GetProjectUrl()(*string) + GetUrl()(*string) + SetColumnName(value *string)() + SetId(value *int32)() + SetPreviousColumnName(value *string)() + SetProjectId(value *int32)() + SetProjectUrl(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/advanced_security_active_committers.go b/pkg/github/models/advanced_security_active_committers.go new file mode 100644 index 00000000..f66ce4a1 --- /dev/null +++ b/pkg/github/models/advanced_security_active_committers.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AdvancedSecurityActiveCommitters 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 total number of GitHub Advanced Security licences required if all repositories were to enable GitHub Advanced Security + maximum_advanced_security_committers *int32 + // The total number of GitHub Advanced Security licences purchased + purchased_advanced_security_committers *int32 + // The repositories property + repositories []AdvancedSecurityActiveCommittersRepositoryable + // The total_advanced_security_committers property + total_advanced_security_committers *int32 + // The total_count property + total_count *int32 +} +// NewAdvancedSecurityActiveCommitters instantiates a new AdvancedSecurityActiveCommitters and sets the default values. +func NewAdvancedSecurityActiveCommitters()(*AdvancedSecurityActiveCommitters) { + m := &AdvancedSecurityActiveCommitters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAdvancedSecurityActiveCommittersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAdvancedSecurityActiveCommittersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAdvancedSecurityActiveCommitters(), 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 *AdvancedSecurityActiveCommitters) 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 *AdvancedSecurityActiveCommitters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["maximum_advanced_security_committers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMaximumAdvancedSecurityCommitters(val) + } + return nil + } + res["purchased_advanced_security_committers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPurchasedAdvancedSecurityCommitters(val) + } + return nil + } + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateAdvancedSecurityActiveCommittersRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]AdvancedSecurityActiveCommittersRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(AdvancedSecurityActiveCommittersRepositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["total_advanced_security_committers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalAdvancedSecurityCommitters(val) + } + 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 +} +// GetMaximumAdvancedSecurityCommitters gets the maximum_advanced_security_committers property value. The total number of GitHub Advanced Security licences required if all repositories were to enable GitHub Advanced Security +// returns a *int32 when successful +func (m *AdvancedSecurityActiveCommitters) GetMaximumAdvancedSecurityCommitters()(*int32) { + return m.maximum_advanced_security_committers +} +// GetPurchasedAdvancedSecurityCommitters gets the purchased_advanced_security_committers property value. The total number of GitHub Advanced Security licences purchased +// returns a *int32 when successful +func (m *AdvancedSecurityActiveCommitters) GetPurchasedAdvancedSecurityCommitters()(*int32) { + return m.purchased_advanced_security_committers +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []AdvancedSecurityActiveCommittersRepositoryable when successful +func (m *AdvancedSecurityActiveCommitters) GetRepositories()([]AdvancedSecurityActiveCommittersRepositoryable) { + return m.repositories +} +// GetTotalAdvancedSecurityCommitters gets the total_advanced_security_committers property value. The total_advanced_security_committers property +// returns a *int32 when successful +func (m *AdvancedSecurityActiveCommitters) GetTotalAdvancedSecurityCommitters()(*int32) { + return m.total_advanced_security_committers +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *AdvancedSecurityActiveCommitters) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *AdvancedSecurityActiveCommitters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("maximum_advanced_security_committers", m.GetMaximumAdvancedSecurityCommitters()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("purchased_advanced_security_committers", m.GetPurchasedAdvancedSecurityCommitters()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_advanced_security_committers", m.GetTotalAdvancedSecurityCommitters()) + 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 *AdvancedSecurityActiveCommitters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMaximumAdvancedSecurityCommitters sets the maximum_advanced_security_committers property value. The total number of GitHub Advanced Security licences required if all repositories were to enable GitHub Advanced Security +func (m *AdvancedSecurityActiveCommitters) SetMaximumAdvancedSecurityCommitters(value *int32)() { + m.maximum_advanced_security_committers = value +} +// SetPurchasedAdvancedSecurityCommitters sets the purchased_advanced_security_committers property value. The total number of GitHub Advanced Security licences purchased +func (m *AdvancedSecurityActiveCommitters) SetPurchasedAdvancedSecurityCommitters(value *int32)() { + m.purchased_advanced_security_committers = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *AdvancedSecurityActiveCommitters) SetRepositories(value []AdvancedSecurityActiveCommittersRepositoryable)() { + m.repositories = value +} +// SetTotalAdvancedSecurityCommitters sets the total_advanced_security_committers property value. The total_advanced_security_committers property +func (m *AdvancedSecurityActiveCommitters) SetTotalAdvancedSecurityCommitters(value *int32)() { + m.total_advanced_security_committers = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *AdvancedSecurityActiveCommitters) SetTotalCount(value *int32)() { + m.total_count = value +} +type AdvancedSecurityActiveCommittersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMaximumAdvancedSecurityCommitters()(*int32) + GetPurchasedAdvancedSecurityCommitters()(*int32) + GetRepositories()([]AdvancedSecurityActiveCommittersRepositoryable) + GetTotalAdvancedSecurityCommitters()(*int32) + GetTotalCount()(*int32) + SetMaximumAdvancedSecurityCommitters(value *int32)() + SetPurchasedAdvancedSecurityCommitters(value *int32)() + SetRepositories(value []AdvancedSecurityActiveCommittersRepositoryable)() + SetTotalAdvancedSecurityCommitters(value *int32)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/models/advanced_security_active_committers_repository.go b/pkg/github/models/advanced_security_active_committers_repository.go new file mode 100644 index 00000000..b7813b0b --- /dev/null +++ b/pkg/github/models/advanced_security_active_committers_repository.go @@ -0,0 +1,150 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AdvancedSecurityActiveCommittersRepository 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 advanced_security_committers property + advanced_security_committers *int32 + // The advanced_security_committers_breakdown property + advanced_security_committers_breakdown []AdvancedSecurityActiveCommittersUserable + // The name property + name *string +} +// NewAdvancedSecurityActiveCommittersRepository instantiates a new AdvancedSecurityActiveCommittersRepository and sets the default values. +func NewAdvancedSecurityActiveCommittersRepository()(*AdvancedSecurityActiveCommittersRepository) { + m := &AdvancedSecurityActiveCommittersRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAdvancedSecurityActiveCommittersRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAdvancedSecurityActiveCommittersRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAdvancedSecurityActiveCommittersRepository(), 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 *AdvancedSecurityActiveCommittersRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurityCommitters gets the advanced_security_committers property value. The advanced_security_committers property +// returns a *int32 when successful +func (m *AdvancedSecurityActiveCommittersRepository) GetAdvancedSecurityCommitters()(*int32) { + return m.advanced_security_committers +} +// GetAdvancedSecurityCommittersBreakdown gets the advanced_security_committers_breakdown property value. The advanced_security_committers_breakdown property +// returns a []AdvancedSecurityActiveCommittersUserable when successful +func (m *AdvancedSecurityActiveCommittersRepository) GetAdvancedSecurityCommittersBreakdown()([]AdvancedSecurityActiveCommittersUserable) { + return m.advanced_security_committers_breakdown +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AdvancedSecurityActiveCommittersRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advanced_security_committers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurityCommitters(val) + } + return nil + } + res["advanced_security_committers_breakdown"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateAdvancedSecurityActiveCommittersUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]AdvancedSecurityActiveCommittersUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(AdvancedSecurityActiveCommittersUserable) + } + } + m.SetAdvancedSecurityCommittersBreakdown(res) + } + 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 property +// returns a *string when successful +func (m *AdvancedSecurityActiveCommittersRepository) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *AdvancedSecurityActiveCommittersRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("advanced_security_committers", m.GetAdvancedSecurityCommitters()) + if err != nil { + return err + } + } + if m.GetAdvancedSecurityCommittersBreakdown() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAdvancedSecurityCommittersBreakdown())) + for i, v := range m.GetAdvancedSecurityCommittersBreakdown() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("advanced_security_committers_breakdown", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *AdvancedSecurityActiveCommittersRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurityCommitters sets the advanced_security_committers property value. The advanced_security_committers property +func (m *AdvancedSecurityActiveCommittersRepository) SetAdvancedSecurityCommitters(value *int32)() { + m.advanced_security_committers = value +} +// SetAdvancedSecurityCommittersBreakdown sets the advanced_security_committers_breakdown property value. The advanced_security_committers_breakdown property +func (m *AdvancedSecurityActiveCommittersRepository) SetAdvancedSecurityCommittersBreakdown(value []AdvancedSecurityActiveCommittersUserable)() { + m.advanced_security_committers_breakdown = value +} +// SetName sets the name property value. The name property +func (m *AdvancedSecurityActiveCommittersRepository) SetName(value *string)() { + m.name = value +} +type AdvancedSecurityActiveCommittersRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurityCommitters()(*int32) + GetAdvancedSecurityCommittersBreakdown()([]AdvancedSecurityActiveCommittersUserable) + GetName()(*string) + SetAdvancedSecurityCommitters(value *int32)() + SetAdvancedSecurityCommittersBreakdown(value []AdvancedSecurityActiveCommittersUserable)() + SetName(value *string)() +} diff --git a/pkg/github/models/advanced_security_active_committers_user.go b/pkg/github/models/advanced_security_active_committers_user.go new file mode 100644 index 00000000..32e9ec8b --- /dev/null +++ b/pkg/github/models/advanced_security_active_committers_user.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AdvancedSecurityActiveCommittersUser 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 last_pushed_date property + last_pushed_date *string + // The last_pushed_email property + last_pushed_email *string + // The user_login property + user_login *string +} +// NewAdvancedSecurityActiveCommittersUser instantiates a new AdvancedSecurityActiveCommittersUser and sets the default values. +func NewAdvancedSecurityActiveCommittersUser()(*AdvancedSecurityActiveCommittersUser) { + m := &AdvancedSecurityActiveCommittersUser{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAdvancedSecurityActiveCommittersUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAdvancedSecurityActiveCommittersUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAdvancedSecurityActiveCommittersUser(), 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 *AdvancedSecurityActiveCommittersUser) 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 *AdvancedSecurityActiveCommittersUser) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["last_pushed_date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLastPushedDate(val) + } + return nil + } + res["last_pushed_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLastPushedEmail(val) + } + return nil + } + res["user_login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserLogin(val) + } + return nil + } + return res +} +// GetLastPushedDate gets the last_pushed_date property value. The last_pushed_date property +// returns a *string when successful +func (m *AdvancedSecurityActiveCommittersUser) GetLastPushedDate()(*string) { + return m.last_pushed_date +} +// GetLastPushedEmail gets the last_pushed_email property value. The last_pushed_email property +// returns a *string when successful +func (m *AdvancedSecurityActiveCommittersUser) GetLastPushedEmail()(*string) { + return m.last_pushed_email +} +// GetUserLogin gets the user_login property value. The user_login property +// returns a *string when successful +func (m *AdvancedSecurityActiveCommittersUser) GetUserLogin()(*string) { + return m.user_login +} +// Serialize serializes information the current object +func (m *AdvancedSecurityActiveCommittersUser) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("last_pushed_date", m.GetLastPushedDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("last_pushed_email", m.GetLastPushedEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user_login", m.GetUserLogin()) + 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 *AdvancedSecurityActiveCommittersUser) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLastPushedDate sets the last_pushed_date property value. The last_pushed_date property +func (m *AdvancedSecurityActiveCommittersUser) SetLastPushedDate(value *string)() { + m.last_pushed_date = value +} +// SetLastPushedEmail sets the last_pushed_email property value. The last_pushed_email property +func (m *AdvancedSecurityActiveCommittersUser) SetLastPushedEmail(value *string)() { + m.last_pushed_email = value +} +// SetUserLogin sets the user_login property value. The user_login property +func (m *AdvancedSecurityActiveCommittersUser) SetUserLogin(value *string)() { + m.user_login = value +} +type AdvancedSecurityActiveCommittersUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLastPushedDate()(*string) + GetLastPushedEmail()(*string) + GetUserLogin()(*string) + SetLastPushedDate(value *string)() + SetLastPushedEmail(value *string)() + SetUserLogin(value *string)() +} diff --git a/pkg/github/models/alerts503_error.go b/pkg/github/models/alerts503_error.go new file mode 100644 index 00000000..11350948 --- /dev/null +++ b/pkg/github/models/alerts503_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 Alerts503Error 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 +} +// NewAlerts503Error instantiates a new Alerts503Error and sets the default values. +func NewAlerts503Error()(*Alerts503Error) { + m := &Alerts503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAlerts503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAlerts503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAlerts503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Alerts503Error) 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 *Alerts503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Alerts503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Alerts503Error) 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 *Alerts503Error) 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 *Alerts503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Alerts503Error) 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 *Alerts503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Alerts503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Alerts503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Alerts503Error) SetMessage(value *string)() { + m.message = value +} +type Alerts503Errorable 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/allowed_actions.go b/pkg/github/models/allowed_actions.go new file mode 100644 index 00000000..59c257f4 --- /dev/null +++ b/pkg/github/models/allowed_actions.go @@ -0,0 +1,37 @@ +package models +// The permissions policy that controls the actions that are allowed to run. +type AllowedActions int + +const ( + ALL_ALLOWEDACTIONS AllowedActions = iota + LOCAL_ONLY_ALLOWEDACTIONS + SELECTED_ALLOWEDACTIONS +) + +func (i AllowedActions) String() string { + return []string{"all", "local_only", "selected"}[i] +} +func ParseAllowedActions(v string) (any, error) { + result := ALL_ALLOWEDACTIONS + switch v { + case "all": + result = ALL_ALLOWEDACTIONS + case "local_only": + result = LOCAL_ONLY_ALLOWEDACTIONS + case "selected": + result = SELECTED_ALLOWEDACTIONS + default: + return nil, nil + } + return &result, nil +} +func SerializeAllowedActions(values []AllowedActions) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AllowedActions) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/analyses503_error.go b/pkg/github/models/analyses503_error.go new file mode 100644 index 00000000..59c81fe8 --- /dev/null +++ b/pkg/github/models/analyses503_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 Analyses503Error 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 +} +// NewAnalyses503Error instantiates a new Analyses503Error and sets the default values. +func NewAnalyses503Error()(*Analyses503Error) { + m := &Analyses503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAnalyses503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAnalyses503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAnalyses503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Analyses503Error) 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 *Analyses503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Analyses503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Analyses503Error) 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 *Analyses503Error) 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 *Analyses503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Analyses503Error) 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 *Analyses503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Analyses503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Analyses503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Analyses503Error) SetMessage(value *string)() { + m.message = value +} +type Analyses503Errorable 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/announcement.go b/pkg/github/models/announcement.go new file mode 100644 index 00000000..91ce477f --- /dev/null +++ b/pkg/github/models/announcement.go @@ -0,0 +1,111 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Announcement enterprise global announcement +type Announcement 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 announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see "[Basic writing and formatting syntax](https://docs.github.com/enterprise-server@3.14/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax)." + announcement *string + // The time at which the announcement expires. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. To set an announcement that never expires, omit this parameter, set it to `null`, or set it to an empty string. + expires_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewAnnouncement instantiates a new Announcement and sets the default values. +func NewAnnouncement()(*Announcement) { + m := &Announcement{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAnnouncementFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAnnouncementFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAnnouncement(), 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 *Announcement) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAnnouncement gets the announcement property value. The announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see "[Basic writing and formatting syntax](https://docs.github.com/enterprise-server@3.14/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax)." +// returns a *string when successful +func (m *Announcement) GetAnnouncement()(*string) { + return m.announcement +} +// GetExpiresAt gets the expires_at property value. The time at which the announcement expires. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. To set an announcement that never expires, omit this parameter, set it to `null`, or set it to an empty string. +// returns a *Time when successful +func (m *Announcement) GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Announcement) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["announcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAnnouncement(val) + } + return nil + } + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *Announcement) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("announcement", m.GetAnnouncement()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("expires_at", m.GetExpiresAt()) + 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 *Announcement) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAnnouncement sets the announcement property value. The announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see "[Basic writing and formatting syntax](https://docs.github.com/enterprise-server@3.14/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax)." +func (m *Announcement) SetAnnouncement(value *string)() { + m.announcement = value +} +// SetExpiresAt sets the expires_at property value. The time at which the announcement expires. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. To set an announcement that never expires, omit this parameter, set it to `null`, or set it to an empty string. +func (m *Announcement) SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.expires_at = value +} +type Announcementable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAnnouncement()(*string) + GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetAnnouncement(value *string)() + SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/announcement_banner.go b/pkg/github/models/announcement_banner.go new file mode 100644 index 00000000..09c4efe6 --- /dev/null +++ b/pkg/github/models/announcement_banner.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// AnnouncementBanner announcement at either the repository, organization, or enterprise level +type AnnouncementBanner 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 announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see "[Basic writing and formatting syntax](https://docs.github.com/enterprise-server@3.14/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax)." + announcement *string + // The time at which the announcement expires. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. To set an announcement that never expires, omit this parameter, set it to `null`, or set it to an empty string. + expires_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Whether an announcement can be dismissed by the user. + user_dismissible *bool +} +// NewAnnouncementBanner instantiates a new AnnouncementBanner and sets the default values. +func NewAnnouncementBanner()(*AnnouncementBanner) { + m := &AnnouncementBanner{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAnnouncementBannerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAnnouncementBannerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAnnouncementBanner(), 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 *AnnouncementBanner) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAnnouncement gets the announcement property value. The announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see "[Basic writing and formatting syntax](https://docs.github.com/enterprise-server@3.14/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax)." +// returns a *string when successful +func (m *AnnouncementBanner) GetAnnouncement()(*string) { + return m.announcement +} +// GetExpiresAt gets the expires_at property value. The time at which the announcement expires. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. To set an announcement that never expires, omit this parameter, set it to `null`, or set it to an empty string. +// returns a *Time when successful +func (m *AnnouncementBanner) GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AnnouncementBanner) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["announcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAnnouncement(val) + } + return nil + } + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["user_dismissible"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUserDismissible(val) + } + return nil + } + return res +} +// GetUserDismissible gets the user_dismissible property value. Whether an announcement can be dismissed by the user. +// returns a *bool when successful +func (m *AnnouncementBanner) GetUserDismissible()(*bool) { + return m.user_dismissible +} +// Serialize serializes information the current object +func (m *AnnouncementBanner) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("announcement", m.GetAnnouncement()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("user_dismissible", m.GetUserDismissible()) + 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 *AnnouncementBanner) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAnnouncement sets the announcement property value. The announcement text in GitHub Flavored Markdown. For more information about GitHub Flavored Markdown, see "[Basic writing and formatting syntax](https://docs.github.com/enterprise-server@3.14/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax)." +func (m *AnnouncementBanner) SetAnnouncement(value *string)() { + m.announcement = value +} +// SetExpiresAt sets the expires_at property value. The time at which the announcement expires. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. To set an announcement that never expires, omit this parameter, set it to `null`, or set it to an empty string. +func (m *AnnouncementBanner) SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.expires_at = value +} +// SetUserDismissible sets the user_dismissible property value. Whether an announcement can be dismissed by the user. +func (m *AnnouncementBanner) SetUserDismissible(value *bool)() { + m.user_dismissible = value +} +type AnnouncementBannerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAnnouncement()(*string) + GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUserDismissible()(*bool) + SetAnnouncement(value *string)() + SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUserDismissible(value *bool)() +} diff --git a/pkg/github/models/api_overview.go b/pkg/github/models/api_overview.go new file mode 100644 index 00000000..235ae3cc --- /dev/null +++ b/pkg/github/models/api_overview.go @@ -0,0 +1,174 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ApiOverview api Overview +type ApiOverview 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 domains property + domains ApiOverview_domainsable + // The installed_version property + installed_version *string + // The packages property + packages []string + // The verifiable_password_authentication property + verifiable_password_authentication *bool +} +// NewApiOverview instantiates a new ApiOverview and sets the default values. +func NewApiOverview()(*ApiOverview) { + m := &ApiOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApiOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApiOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApiOverview(), 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) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDomains gets the domains property value. The domains property +// returns a ApiOverview_domainsable when successful +func (m *ApiOverview) GetDomains()(ApiOverview_domainsable) { + return m.domains +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ApiOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["domains"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateApiOverview_domainsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDomains(val.(ApiOverview_domainsable)) + } + return nil + } + res["installed_version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInstalledVersion(val) + } + return nil + } + res["packages"] = 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.SetPackages(res) + } + return nil + } + res["verifiable_password_authentication"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerifiablePasswordAuthentication(val) + } + return nil + } + return res +} +// GetInstalledVersion gets the installed_version property value. The installed_version property +// returns a *string when successful +func (m *ApiOverview) GetInstalledVersion()(*string) { + return m.installed_version +} +// GetPackages gets the packages property value. The packages property +// returns a []string when successful +func (m *ApiOverview) GetPackages()([]string) { + return m.packages +} +// GetVerifiablePasswordAuthentication gets the verifiable_password_authentication property value. The verifiable_password_authentication property +// returns a *bool when successful +func (m *ApiOverview) GetVerifiablePasswordAuthentication()(*bool) { + return m.verifiable_password_authentication +} +// Serialize serializes information the current object +func (m *ApiOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("domains", m.GetDomains()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("installed_version", m.GetInstalledVersion()) + if err != nil { + return err + } + } + if m.GetPackages() != nil { + err := writer.WriteCollectionOfStringValues("packages", m.GetPackages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verifiable_password_authentication", m.GetVerifiablePasswordAuthentication()) + 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) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDomains sets the domains property value. The domains property +func (m *ApiOverview) SetDomains(value ApiOverview_domainsable)() { + m.domains = value +} +// SetInstalledVersion sets the installed_version property value. The installed_version property +func (m *ApiOverview) SetInstalledVersion(value *string)() { + m.installed_version = value +} +// SetPackages sets the packages property value. The packages property +func (m *ApiOverview) SetPackages(value []string)() { + m.packages = value +} +// SetVerifiablePasswordAuthentication sets the verifiable_password_authentication property value. The verifiable_password_authentication property +func (m *ApiOverview) SetVerifiablePasswordAuthentication(value *bool)() { + m.verifiable_password_authentication = value +} +type ApiOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDomains()(ApiOverview_domainsable) + GetInstalledVersion()(*string) + GetPackages()([]string) + GetVerifiablePasswordAuthentication()(*bool) + SetDomains(value ApiOverview_domainsable)() + SetInstalledVersion(value *string)() + SetPackages(value []string)() + SetVerifiablePasswordAuthentication(value *bool)() +} diff --git a/pkg/github/models/api_overview_escaped_domains.go b/pkg/github/models/api_overview_escaped_domains.go new file mode 100644 index 00000000..32950e02 --- /dev/null +++ b/pkg/github/models/api_overview_escaped_domains.go @@ -0,0 +1,255 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ApiOverview_domains struct { + // The actions property + actions []string + // 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 + artifact_attestations ApiOverview_domains_artifact_attestationsable + // The codespaces property + codespaces []string + // The copilot property + copilot []string + // The packages property + packages []string + // The website property + website []string +} +// NewApiOverview_domains instantiates a new ApiOverview_domains and sets the default values. +func NewApiOverview_domains()(*ApiOverview_domains) { + m := &ApiOverview_domains{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApiOverview_domainsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApiOverview_domainsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApiOverview_domains(), nil +} +// GetActions gets the actions property value. The actions property +// returns a []string when successful +func (m *ApiOverview_domains) GetActions()([]string) { + return m.actions +} +// 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) { + return m.additionalData +} +// GetArtifactAttestations gets the artifact_attestations property value. The artifact_attestations property +// returns a ApiOverview_domains_artifact_attestationsable when successful +func (m *ApiOverview_domains) GetArtifactAttestations()(ApiOverview_domains_artifact_attestationsable) { + return m.artifact_attestations +} +// GetCodespaces gets the codespaces property value. The codespaces property +// returns a []string when successful +func (m *ApiOverview_domains) GetCodespaces()([]string) { + return m.codespaces +} +// GetCopilot gets the copilot property value. The copilot property +// returns a []string when successful +func (m *ApiOverview_domains) GetCopilot()([]string) { + return m.copilot +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ApiOverview_domains) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actions"] = 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.SetActions(res) + } + return nil + } + res["artifact_attestations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateApiOverview_domains_artifact_attestationsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetArtifactAttestations(val.(ApiOverview_domains_artifact_attestationsable)) + } + return nil + } + res["codespaces"] = 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.SetCodespaces(res) + } + return nil + } + res["copilot"] = 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.SetCopilot(res) + } + return nil + } + res["packages"] = 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.SetPackages(res) + } + return nil + } + res["website"] = 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.SetWebsite(res) + } + return nil + } + return res +} +// GetPackages gets the packages property value. The packages property +// returns a []string when successful +func (m *ApiOverview_domains) GetPackages()([]string) { + return m.packages +} +// GetWebsite gets the website property value. The website property +// returns a []string when successful +func (m *ApiOverview_domains) GetWebsite()([]string) { + return m.website +} +// Serialize serializes information the current object +func (m *ApiOverview_domains) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetActions() != nil { + err := writer.WriteCollectionOfStringValues("actions", m.GetActions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("artifact_attestations", m.GetArtifactAttestations()) + if err != nil { + return err + } + } + if m.GetCodespaces() != nil { + err := writer.WriteCollectionOfStringValues("codespaces", m.GetCodespaces()) + if err != nil { + return err + } + } + if m.GetCopilot() != nil { + err := writer.WriteCollectionOfStringValues("copilot", m.GetCopilot()) + if err != nil { + return err + } + } + if m.GetPackages() != nil { + err := writer.WriteCollectionOfStringValues("packages", m.GetPackages()) + if err != nil { + return err + } + } + if m.GetWebsite() != nil { + err := writer.WriteCollectionOfStringValues("website", m.GetWebsite()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActions sets the actions property value. The actions property +func (m *ApiOverview_domains) SetActions(value []string)() { + m.actions = 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 +} +// SetArtifactAttestations sets the artifact_attestations property value. The artifact_attestations property +func (m *ApiOverview_domains) SetArtifactAttestations(value ApiOverview_domains_artifact_attestationsable)() { + m.artifact_attestations = value +} +// SetCodespaces sets the codespaces property value. The codespaces property +func (m *ApiOverview_domains) SetCodespaces(value []string)() { + m.codespaces = value +} +// SetCopilot sets the copilot property value. The copilot property +func (m *ApiOverview_domains) SetCopilot(value []string)() { + m.copilot = value +} +// SetPackages sets the packages property value. The packages property +func (m *ApiOverview_domains) SetPackages(value []string)() { + m.packages = value +} +// SetWebsite sets the website property value. The website property +func (m *ApiOverview_domains) SetWebsite(value []string)() { + m.website = value +} +type ApiOverview_domainsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActions()([]string) + GetArtifactAttestations()(ApiOverview_domains_artifact_attestationsable) + GetCodespaces()([]string) + GetCopilot()([]string) + GetPackages()([]string) + GetWebsite()([]string) + SetActions(value []string)() + SetArtifactAttestations(value ApiOverview_domains_artifact_attestationsable)() + SetCodespaces(value []string)() + SetCopilot(value []string)() + SetPackages(value []string)() + SetWebsite(value []string)() +} diff --git a/pkg/github/models/api_overview_escaped_domains_escaped_artifact_escaped_attestations.go b/pkg/github/models/api_overview_escaped_domains_escaped_artifact_escaped_attestations.go new file mode 100644 index 00000000..df6bdb69 --- /dev/null +++ b/pkg/github/models/api_overview_escaped_domains_escaped_artifact_escaped_attestations.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ApiOverview_domains_artifact_attestations 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 services property + services []string + // The trust_domain property + trust_domain *string +} +// NewApiOverview_domains_artifact_attestations instantiates a new ApiOverview_domains_artifact_attestations and sets the default values. +func NewApiOverview_domains_artifact_attestations()(*ApiOverview_domains_artifact_attestations) { + m := &ApiOverview_domains_artifact_attestations{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApiOverview_domains_artifact_attestationsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApiOverview_domains_artifact_attestationsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApiOverview_domains_artifact_attestations(), 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_artifact_attestations) 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_artifact_attestations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["services"] = 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.SetServices(res) + } + return nil + } + res["trust_domain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTrustDomain(val) + } + return nil + } + return res +} +// GetServices gets the services property value. The services property +// returns a []string when successful +func (m *ApiOverview_domains_artifact_attestations) GetServices()([]string) { + return m.services +} +// GetTrustDomain gets the trust_domain property value. The trust_domain property +// returns a *string when successful +func (m *ApiOverview_domains_artifact_attestations) GetTrustDomain()(*string) { + return m.trust_domain +} +// Serialize serializes information the current object +func (m *ApiOverview_domains_artifact_attestations) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetServices() != nil { + err := writer.WriteCollectionOfStringValues("services", m.GetServices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trust_domain", m.GetTrustDomain()) + 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_artifact_attestations) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetServices sets the services property value. The services property +func (m *ApiOverview_domains_artifact_attestations) SetServices(value []string)() { + m.services = value +} +// SetTrustDomain sets the trust_domain property value. The trust_domain property +func (m *ApiOverview_domains_artifact_attestations) SetTrustDomain(value *string)() { + m.trust_domain = value +} +type ApiOverview_domains_artifact_attestationsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetServices()([]string) + GetTrustDomain()(*string) + SetServices(value []string)() + SetTrustDomain(value *string)() +} diff --git a/pkg/github/models/app_permissions.go b/pkg/github/models/app_permissions.go new file mode 100644 index 00000000..ca2dc151 --- /dev/null +++ b/pkg/github/models/app_permissions.go @@ -0,0 +1,1492 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// AppPermissions the permissions granted to the user access token. +type AppPermissions struct { + // The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. + actions *AppPermissions_actions + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. + administration *AppPermissions_administration + // The level of permission to grant the access token for checks on code. + checks *AppPermissions_checks + // The level of permission to grant the access token to create, edit, delete, and list Codespaces. + codespaces *AppPermissions_codespaces + // The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. + contents *AppPermissions_contents + // The leve of permission to grant the access token to manage Dependabot secrets. + dependabot_secrets *AppPermissions_dependabot_secrets + // The level of permission to grant the access token for deployments and deployment statuses. + deployments *AppPermissions_deployments + // The level of permission to grant the access token to manage the email addresses belonging to a user. + email_addresses *AppPermissions_email_addresses + // The level of permission to grant the access token for managing repository environments. + environments *AppPermissions_environments + // The level of permission to grant the access token to manage the followers belonging to a user. + followers *AppPermissions_followers + // The level of permission to grant the access token to manage git SSH keys. + git_ssh_keys *AppPermissions_git_ssh_keys + // The level of permission to grant the access token to view and manage GPG keys belonging to a user. + gpg_keys *AppPermissions_gpg_keys + // The level of permission to grant the access token to view and manage interaction limits on a repository. + interaction_limits *AppPermissions_interaction_limits + // The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. + issues *AppPermissions_issues + // The level of permission to grant the access token for organization teams and members. + members *AppPermissions_members + // The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. + metadata *AppPermissions_metadata + // The level of permission to grant the access token to manage access to an organization. + organization_administration *AppPermissions_organization_administration + // The level of permission to grant the access token to view and manage announcement banners for an organization. + organization_announcement_banners *AppPermissions_organization_announcement_banners + // The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change. + organization_copilot_seat_management *AppPermissions_organization_copilot_seat_management + // The level of permission to grant the access token for custom organization roles management. + organization_custom_org_roles *AppPermissions_organization_custom_org_roles + // The level of permission to grant the access token for custom property management. + organization_custom_properties *AppPermissions_organization_custom_properties + // The level of permission to grant the access token for custom repository roles management. + organization_custom_roles *AppPermissions_organization_custom_roles + // The level of permission to grant the access token to view events triggered by an activity in an organization. + organization_events *AppPermissions_organization_events + // The level of permission to grant the access token to manage the post-receive hooks for an organization. + organization_hooks *AppPermissions_organization_hooks + // The level of permission to grant the access token for organization packages published to GitHub Packages. + organization_packages *AppPermissions_organization_packages + // The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization. + organization_personal_access_token_requests *AppPermissions_organization_personal_access_token_requests + // The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization. + organization_personal_access_tokens *AppPermissions_organization_personal_access_tokens + // The level of permission to grant the access token for viewing an organization's plan. + organization_plan *AppPermissions_organization_plan + // The level of permission to grant the access token to manage organization projects and projects beta (where available). + organization_projects *AppPermissions_organization_projects + // The level of permission to grant the access token to manage organization secrets. + organization_secrets *AppPermissions_organization_secrets + // The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. + organization_self_hosted_runners *AppPermissions_organization_self_hosted_runners + // The level of permission to grant the access token to view and manage users blocked by the organization. + organization_user_blocking *AppPermissions_organization_user_blocking + // The level of permission to grant the access token for packages published to GitHub Packages. + packages *AppPermissions_packages + // The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. + pages *AppPermissions_pages + // The level of permission to grant the access token to manage the profile settings belonging to a user. + profile *AppPermissions_profile + // The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. + pull_requests *AppPermissions_pull_requests + // The level of permission to grant the access token to view and edit custom properties for a repository, when allowed by the property. + repository_custom_properties *AppPermissions_repository_custom_properties + // The level of permission to grant the access token to manage the post-receive hooks for a repository. + repository_hooks *AppPermissions_repository_hooks + // The level of permission to grant the access token to manage repository projects, columns, and cards. + repository_projects *AppPermissions_repository_projects + // The level of permission to grant the access token to view and manage secret scanning alerts. + secret_scanning_alerts *AppPermissions_secret_scanning_alerts + // The level of permission to grant the access token to manage repository secrets. + secrets *AppPermissions_secrets + // The level of permission to grant the access token to view and manage security events like code scanning alerts. + security_events *AppPermissions_security_events + // The level of permission to grant the access token to manage just a single file. + single_file *AppPermissions_single_file + // The level of permission to grant the access token to list and manage repositories a user is starring. + starring *AppPermissions_starring + // The level of permission to grant the access token for commit statuses. + statuses *AppPermissions_statuses + // The level of permission to grant the access token to manage team discussions and related comments. + team_discussions *AppPermissions_team_discussions + // The level of permission to grant the access token to manage Dependabot alerts. + vulnerability_alerts *AppPermissions_vulnerability_alerts + // The level of permission to grant the access token to update GitHub Actions workflow files. + workflows *AppPermissions_workflows +} +// NewAppPermissions instantiates a new AppPermissions and sets the default values. +func NewAppPermissions()(*AppPermissions) { + m := &AppPermissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAppPermissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAppPermissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAppPermissions(), nil +} +// GetActions gets the actions property value. The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. +// returns a *AppPermissions_actions when successful +func (m *AppPermissions) GetActions()(*AppPermissions_actions) { + return m.actions +} +// 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 *AppPermissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdministration gets the administration property value. The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. +// returns a *AppPermissions_administration when successful +func (m *AppPermissions) GetAdministration()(*AppPermissions_administration) { + return m.administration +} +// GetChecks gets the checks property value. The level of permission to grant the access token for checks on code. +// returns a *AppPermissions_checks when successful +func (m *AppPermissions) GetChecks()(*AppPermissions_checks) { + return m.checks +} +// GetCodespaces gets the codespaces property value. The level of permission to grant the access token to create, edit, delete, and list Codespaces. +// returns a *AppPermissions_codespaces when successful +func (m *AppPermissions) GetCodespaces()(*AppPermissions_codespaces) { + return m.codespaces +} +// GetContents gets the contents property value. The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. +// returns a *AppPermissions_contents when successful +func (m *AppPermissions) GetContents()(*AppPermissions_contents) { + return m.contents +} +// GetDependabotSecrets gets the dependabot_secrets property value. The leve of permission to grant the access token to manage Dependabot secrets. +// returns a *AppPermissions_dependabot_secrets when successful +func (m *AppPermissions) GetDependabotSecrets()(*AppPermissions_dependabot_secrets) { + return m.dependabot_secrets +} +// GetDeployments gets the deployments property value. The level of permission to grant the access token for deployments and deployment statuses. +// returns a *AppPermissions_deployments when successful +func (m *AppPermissions) GetDeployments()(*AppPermissions_deployments) { + return m.deployments +} +// GetEmailAddresses gets the email_addresses property value. The level of permission to grant the access token to manage the email addresses belonging to a user. +// returns a *AppPermissions_email_addresses when successful +func (m *AppPermissions) GetEmailAddresses()(*AppPermissions_email_addresses) { + return m.email_addresses +} +// GetEnvironments gets the environments property value. The level of permission to grant the access token for managing repository environments. +// returns a *AppPermissions_environments when successful +func (m *AppPermissions) GetEnvironments()(*AppPermissions_environments) { + return m.environments +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AppPermissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_actions) + if err != nil { + return err + } + if val != nil { + m.SetActions(val.(*AppPermissions_actions)) + } + return nil + } + res["administration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_administration) + if err != nil { + return err + } + if val != nil { + m.SetAdministration(val.(*AppPermissions_administration)) + } + return nil + } + res["checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_checks) + if err != nil { + return err + } + if val != nil { + m.SetChecks(val.(*AppPermissions_checks)) + } + return nil + } + res["codespaces"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_codespaces) + if err != nil { + return err + } + if val != nil { + m.SetCodespaces(val.(*AppPermissions_codespaces)) + } + return nil + } + res["contents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_contents) + if err != nil { + return err + } + if val != nil { + m.SetContents(val.(*AppPermissions_contents)) + } + return nil + } + res["dependabot_secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_dependabot_secrets) + if err != nil { + return err + } + if val != nil { + m.SetDependabotSecrets(val.(*AppPermissions_dependabot_secrets)) + } + return nil + } + res["deployments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_deployments) + if err != nil { + return err + } + if val != nil { + m.SetDeployments(val.(*AppPermissions_deployments)) + } + return nil + } + res["email_addresses"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_email_addresses) + if err != nil { + return err + } + if val != nil { + m.SetEmailAddresses(val.(*AppPermissions_email_addresses)) + } + return nil + } + res["environments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_environments) + if err != nil { + return err + } + if val != nil { + m.SetEnvironments(val.(*AppPermissions_environments)) + } + return nil + } + res["followers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_followers) + if err != nil { + return err + } + if val != nil { + m.SetFollowers(val.(*AppPermissions_followers)) + } + return nil + } + res["git_ssh_keys"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_git_ssh_keys) + if err != nil { + return err + } + if val != nil { + m.SetGitSshKeys(val.(*AppPermissions_git_ssh_keys)) + } + return nil + } + res["gpg_keys"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_gpg_keys) + if err != nil { + return err + } + if val != nil { + m.SetGpgKeys(val.(*AppPermissions_gpg_keys)) + } + return nil + } + res["interaction_limits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_interaction_limits) + if err != nil { + return err + } + if val != nil { + m.SetInteractionLimits(val.(*AppPermissions_interaction_limits)) + } + return nil + } + res["issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_issues) + if err != nil { + return err + } + if val != nil { + m.SetIssues(val.(*AppPermissions_issues)) + } + return nil + } + res["members"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_members) + if err != nil { + return err + } + if val != nil { + m.SetMembers(val.(*AppPermissions_members)) + } + return nil + } + res["metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_metadata) + if err != nil { + return err + } + if val != nil { + m.SetMetadata(val.(*AppPermissions_metadata)) + } + return nil + } + res["organization_administration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_administration) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationAdministration(val.(*AppPermissions_organization_administration)) + } + return nil + } + res["organization_announcement_banners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_announcement_banners) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationAnnouncementBanners(val.(*AppPermissions_organization_announcement_banners)) + } + return nil + } + res["organization_copilot_seat_management"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_copilot_seat_management) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationCopilotSeatManagement(val.(*AppPermissions_organization_copilot_seat_management)) + } + return nil + } + res["organization_custom_org_roles"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_custom_org_roles) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationCustomOrgRoles(val.(*AppPermissions_organization_custom_org_roles)) + } + return nil + } + res["organization_custom_properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_custom_properties) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationCustomProperties(val.(*AppPermissions_organization_custom_properties)) + } + return nil + } + res["organization_custom_roles"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_custom_roles) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationCustomRoles(val.(*AppPermissions_organization_custom_roles)) + } + return nil + } + res["organization_events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_events) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationEvents(val.(*AppPermissions_organization_events)) + } + return nil + } + res["organization_hooks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_hooks) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationHooks(val.(*AppPermissions_organization_hooks)) + } + return nil + } + res["organization_packages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_packages) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationPackages(val.(*AppPermissions_organization_packages)) + } + return nil + } + res["organization_personal_access_token_requests"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_personal_access_token_requests) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationPersonalAccessTokenRequests(val.(*AppPermissions_organization_personal_access_token_requests)) + } + return nil + } + res["organization_personal_access_tokens"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_personal_access_tokens) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationPersonalAccessTokens(val.(*AppPermissions_organization_personal_access_tokens)) + } + return nil + } + res["organization_plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_plan) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationPlan(val.(*AppPermissions_organization_plan)) + } + return nil + } + res["organization_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_projects) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationProjects(val.(*AppPermissions_organization_projects)) + } + return nil + } + res["organization_secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_secrets) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationSecrets(val.(*AppPermissions_organization_secrets)) + } + return nil + } + res["organization_self_hosted_runners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_self_hosted_runners) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationSelfHostedRunners(val.(*AppPermissions_organization_self_hosted_runners)) + } + return nil + } + res["organization_user_blocking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_organization_user_blocking) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationUserBlocking(val.(*AppPermissions_organization_user_blocking)) + } + return nil + } + res["packages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_packages) + if err != nil { + return err + } + if val != nil { + m.SetPackages(val.(*AppPermissions_packages)) + } + return nil + } + res["pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_pages) + if err != nil { + return err + } + if val != nil { + m.SetPages(val.(*AppPermissions_pages)) + } + return nil + } + res["profile"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_profile) + if err != nil { + return err + } + if val != nil { + m.SetProfile(val.(*AppPermissions_profile)) + } + return nil + } + res["pull_requests"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_pull_requests) + if err != nil { + return err + } + if val != nil { + m.SetPullRequests(val.(*AppPermissions_pull_requests)) + } + return nil + } + res["repository_custom_properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_repository_custom_properties) + if err != nil { + return err + } + if val != nil { + m.SetRepositoryCustomProperties(val.(*AppPermissions_repository_custom_properties)) + } + return nil + } + res["repository_hooks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_repository_hooks) + if err != nil { + return err + } + if val != nil { + m.SetRepositoryHooks(val.(*AppPermissions_repository_hooks)) + } + return nil + } + res["repository_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_repository_projects) + if err != nil { + return err + } + if val != nil { + m.SetRepositoryProjects(val.(*AppPermissions_repository_projects)) + } + return nil + } + res["secret_scanning_alerts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_secret_scanning_alerts) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningAlerts(val.(*AppPermissions_secret_scanning_alerts)) + } + return nil + } + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_secrets) + if err != nil { + return err + } + if val != nil { + m.SetSecrets(val.(*AppPermissions_secrets)) + } + return nil + } + res["security_events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_security_events) + if err != nil { + return err + } + if val != nil { + m.SetSecurityEvents(val.(*AppPermissions_security_events)) + } + return nil + } + res["single_file"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_single_file) + if err != nil { + return err + } + if val != nil { + m.SetSingleFile(val.(*AppPermissions_single_file)) + } + return nil + } + res["starring"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_starring) + if err != nil { + return err + } + if val != nil { + m.SetStarring(val.(*AppPermissions_starring)) + } + return nil + } + res["statuses"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_statuses) + if err != nil { + return err + } + if val != nil { + m.SetStatuses(val.(*AppPermissions_statuses)) + } + return nil + } + res["team_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_team_discussions) + if err != nil { + return err + } + if val != nil { + m.SetTeamDiscussions(val.(*AppPermissions_team_discussions)) + } + return nil + } + res["vulnerability_alerts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_vulnerability_alerts) + if err != nil { + return err + } + if val != nil { + m.SetVulnerabilityAlerts(val.(*AppPermissions_vulnerability_alerts)) + } + return nil + } + res["workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAppPermissions_workflows) + if err != nil { + return err + } + if val != nil { + m.SetWorkflows(val.(*AppPermissions_workflows)) + } + return nil + } + return res +} +// GetFollowers gets the followers property value. The level of permission to grant the access token to manage the followers belonging to a user. +// returns a *AppPermissions_followers when successful +func (m *AppPermissions) GetFollowers()(*AppPermissions_followers) { + return m.followers +} +// GetGitSshKeys gets the git_ssh_keys property value. The level of permission to grant the access token to manage git SSH keys. +// returns a *AppPermissions_git_ssh_keys when successful +func (m *AppPermissions) GetGitSshKeys()(*AppPermissions_git_ssh_keys) { + return m.git_ssh_keys +} +// GetGpgKeys gets the gpg_keys property value. The level of permission to grant the access token to view and manage GPG keys belonging to a user. +// returns a *AppPermissions_gpg_keys when successful +func (m *AppPermissions) GetGpgKeys()(*AppPermissions_gpg_keys) { + return m.gpg_keys +} +// GetInteractionLimits gets the interaction_limits property value. The level of permission to grant the access token to view and manage interaction limits on a repository. +// returns a *AppPermissions_interaction_limits when successful +func (m *AppPermissions) GetInteractionLimits()(*AppPermissions_interaction_limits) { + return m.interaction_limits +} +// GetIssues gets the issues property value. The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. +// returns a *AppPermissions_issues when successful +func (m *AppPermissions) GetIssues()(*AppPermissions_issues) { + return m.issues +} +// GetMembers gets the members property value. The level of permission to grant the access token for organization teams and members. +// returns a *AppPermissions_members when successful +func (m *AppPermissions) GetMembers()(*AppPermissions_members) { + return m.members +} +// GetMetadata gets the metadata property value. The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. +// returns a *AppPermissions_metadata when successful +func (m *AppPermissions) GetMetadata()(*AppPermissions_metadata) { + return m.metadata +} +// GetOrganizationAdministration gets the organization_administration property value. The level of permission to grant the access token to manage access to an organization. +// returns a *AppPermissions_organization_administration when successful +func (m *AppPermissions) GetOrganizationAdministration()(*AppPermissions_organization_administration) { + return m.organization_administration +} +// GetOrganizationAnnouncementBanners gets the organization_announcement_banners property value. The level of permission to grant the access token to view and manage announcement banners for an organization. +// returns a *AppPermissions_organization_announcement_banners when successful +func (m *AppPermissions) GetOrganizationAnnouncementBanners()(*AppPermissions_organization_announcement_banners) { + return m.organization_announcement_banners +} +// GetOrganizationCopilotSeatManagement gets the organization_copilot_seat_management property value. The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change. +// returns a *AppPermissions_organization_copilot_seat_management when successful +func (m *AppPermissions) GetOrganizationCopilotSeatManagement()(*AppPermissions_organization_copilot_seat_management) { + return m.organization_copilot_seat_management +} +// GetOrganizationCustomOrgRoles gets the organization_custom_org_roles property value. The level of permission to grant the access token for custom organization roles management. +// returns a *AppPermissions_organization_custom_org_roles when successful +func (m *AppPermissions) GetOrganizationCustomOrgRoles()(*AppPermissions_organization_custom_org_roles) { + return m.organization_custom_org_roles +} +// GetOrganizationCustomProperties gets the organization_custom_properties property value. The level of permission to grant the access token for custom property management. +// returns a *AppPermissions_organization_custom_properties when successful +func (m *AppPermissions) GetOrganizationCustomProperties()(*AppPermissions_organization_custom_properties) { + return m.organization_custom_properties +} +// GetOrganizationCustomRoles gets the organization_custom_roles property value. The level of permission to grant the access token for custom repository roles management. +// returns a *AppPermissions_organization_custom_roles when successful +func (m *AppPermissions) GetOrganizationCustomRoles()(*AppPermissions_organization_custom_roles) { + return m.organization_custom_roles +} +// GetOrganizationEvents gets the organization_events property value. The level of permission to grant the access token to view events triggered by an activity in an organization. +// returns a *AppPermissions_organization_events when successful +func (m *AppPermissions) GetOrganizationEvents()(*AppPermissions_organization_events) { + return m.organization_events +} +// GetOrganizationHooks gets the organization_hooks property value. The level of permission to grant the access token to manage the post-receive hooks for an organization. +// returns a *AppPermissions_organization_hooks when successful +func (m *AppPermissions) GetOrganizationHooks()(*AppPermissions_organization_hooks) { + return m.organization_hooks +} +// GetOrganizationPackages gets the organization_packages property value. The level of permission to grant the access token for organization packages published to GitHub Packages. +// returns a *AppPermissions_organization_packages when successful +func (m *AppPermissions) GetOrganizationPackages()(*AppPermissions_organization_packages) { + return m.organization_packages +} +// GetOrganizationPersonalAccessTokenRequests gets the organization_personal_access_token_requests property value. The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization. +// returns a *AppPermissions_organization_personal_access_token_requests when successful +func (m *AppPermissions) GetOrganizationPersonalAccessTokenRequests()(*AppPermissions_organization_personal_access_token_requests) { + return m.organization_personal_access_token_requests +} +// GetOrganizationPersonalAccessTokens gets the organization_personal_access_tokens property value. The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization. +// returns a *AppPermissions_organization_personal_access_tokens when successful +func (m *AppPermissions) GetOrganizationPersonalAccessTokens()(*AppPermissions_organization_personal_access_tokens) { + return m.organization_personal_access_tokens +} +// GetOrganizationPlan gets the organization_plan property value. The level of permission to grant the access token for viewing an organization's plan. +// returns a *AppPermissions_organization_plan when successful +func (m *AppPermissions) GetOrganizationPlan()(*AppPermissions_organization_plan) { + return m.organization_plan +} +// GetOrganizationProjects gets the organization_projects property value. The level of permission to grant the access token to manage organization projects and projects beta (where available). +// returns a *AppPermissions_organization_projects when successful +func (m *AppPermissions) GetOrganizationProjects()(*AppPermissions_organization_projects) { + return m.organization_projects +} +// GetOrganizationSecrets gets the organization_secrets property value. The level of permission to grant the access token to manage organization secrets. +// returns a *AppPermissions_organization_secrets when successful +func (m *AppPermissions) GetOrganizationSecrets()(*AppPermissions_organization_secrets) { + return m.organization_secrets +} +// GetOrganizationSelfHostedRunners gets the organization_self_hosted_runners property value. The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. +// returns a *AppPermissions_organization_self_hosted_runners when successful +func (m *AppPermissions) GetOrganizationSelfHostedRunners()(*AppPermissions_organization_self_hosted_runners) { + return m.organization_self_hosted_runners +} +// GetOrganizationUserBlocking gets the organization_user_blocking property value. The level of permission to grant the access token to view and manage users blocked by the organization. +// returns a *AppPermissions_organization_user_blocking when successful +func (m *AppPermissions) GetOrganizationUserBlocking()(*AppPermissions_organization_user_blocking) { + return m.organization_user_blocking +} +// GetPackages gets the packages property value. The level of permission to grant the access token for packages published to GitHub Packages. +// returns a *AppPermissions_packages when successful +func (m *AppPermissions) GetPackages()(*AppPermissions_packages) { + return m.packages +} +// GetPages gets the pages property value. The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. +// returns a *AppPermissions_pages when successful +func (m *AppPermissions) GetPages()(*AppPermissions_pages) { + return m.pages +} +// GetProfile gets the profile property value. The level of permission to grant the access token to manage the profile settings belonging to a user. +// returns a *AppPermissions_profile when successful +func (m *AppPermissions) GetProfile()(*AppPermissions_profile) { + return m.profile +} +// GetPullRequests gets the pull_requests property value. The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. +// returns a *AppPermissions_pull_requests when successful +func (m *AppPermissions) GetPullRequests()(*AppPermissions_pull_requests) { + return m.pull_requests +} +// GetRepositoryCustomProperties gets the repository_custom_properties property value. The level of permission to grant the access token to view and edit custom properties for a repository, when allowed by the property. +// returns a *AppPermissions_repository_custom_properties when successful +func (m *AppPermissions) GetRepositoryCustomProperties()(*AppPermissions_repository_custom_properties) { + return m.repository_custom_properties +} +// GetRepositoryHooks gets the repository_hooks property value. The level of permission to grant the access token to manage the post-receive hooks for a repository. +// returns a *AppPermissions_repository_hooks when successful +func (m *AppPermissions) GetRepositoryHooks()(*AppPermissions_repository_hooks) { + return m.repository_hooks +} +// GetRepositoryProjects gets the repository_projects property value. The level of permission to grant the access token to manage repository projects, columns, and cards. +// returns a *AppPermissions_repository_projects when successful +func (m *AppPermissions) GetRepositoryProjects()(*AppPermissions_repository_projects) { + return m.repository_projects +} +// GetSecrets gets the secrets property value. The level of permission to grant the access token to manage repository secrets. +// returns a *AppPermissions_secrets when successful +func (m *AppPermissions) GetSecrets()(*AppPermissions_secrets) { + return m.secrets +} +// GetSecretScanningAlerts gets the secret_scanning_alerts property value. The level of permission to grant the access token to view and manage secret scanning alerts. +// returns a *AppPermissions_secret_scanning_alerts when successful +func (m *AppPermissions) GetSecretScanningAlerts()(*AppPermissions_secret_scanning_alerts) { + return m.secret_scanning_alerts +} +// GetSecurityEvents gets the security_events property value. The level of permission to grant the access token to view and manage security events like code scanning alerts. +// returns a *AppPermissions_security_events when successful +func (m *AppPermissions) GetSecurityEvents()(*AppPermissions_security_events) { + return m.security_events +} +// GetSingleFile gets the single_file property value. The level of permission to grant the access token to manage just a single file. +// returns a *AppPermissions_single_file when successful +func (m *AppPermissions) GetSingleFile()(*AppPermissions_single_file) { + return m.single_file +} +// GetStarring gets the starring property value. The level of permission to grant the access token to list and manage repositories a user is starring. +// returns a *AppPermissions_starring when successful +func (m *AppPermissions) GetStarring()(*AppPermissions_starring) { + return m.starring +} +// GetStatuses gets the statuses property value. The level of permission to grant the access token for commit statuses. +// returns a *AppPermissions_statuses when successful +func (m *AppPermissions) GetStatuses()(*AppPermissions_statuses) { + return m.statuses +} +// GetTeamDiscussions gets the team_discussions property value. The level of permission to grant the access token to manage team discussions and related comments. +// returns a *AppPermissions_team_discussions when successful +func (m *AppPermissions) GetTeamDiscussions()(*AppPermissions_team_discussions) { + return m.team_discussions +} +// GetVulnerabilityAlerts gets the vulnerability_alerts property value. The level of permission to grant the access token to manage Dependabot alerts. +// returns a *AppPermissions_vulnerability_alerts when successful +func (m *AppPermissions) GetVulnerabilityAlerts()(*AppPermissions_vulnerability_alerts) { + return m.vulnerability_alerts +} +// GetWorkflows gets the workflows property value. The level of permission to grant the access token to update GitHub Actions workflow files. +// returns a *AppPermissions_workflows when successful +func (m *AppPermissions) GetWorkflows()(*AppPermissions_workflows) { + return m.workflows +} +// Serialize serializes information the current object +func (m *AppPermissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetActions() != nil { + cast := (*m.GetActions()).String() + err := writer.WriteStringValue("actions", &cast) + if err != nil { + return err + } + } + if m.GetAdministration() != nil { + cast := (*m.GetAdministration()).String() + err := writer.WriteStringValue("administration", &cast) + if err != nil { + return err + } + } + if m.GetChecks() != nil { + cast := (*m.GetChecks()).String() + err := writer.WriteStringValue("checks", &cast) + if err != nil { + return err + } + } + if m.GetCodespaces() != nil { + cast := (*m.GetCodespaces()).String() + err := writer.WriteStringValue("codespaces", &cast) + if err != nil { + return err + } + } + if m.GetContents() != nil { + cast := (*m.GetContents()).String() + err := writer.WriteStringValue("contents", &cast) + if err != nil { + return err + } + } + if m.GetDependabotSecrets() != nil { + cast := (*m.GetDependabotSecrets()).String() + err := writer.WriteStringValue("dependabot_secrets", &cast) + if err != nil { + return err + } + } + if m.GetDeployments() != nil { + cast := (*m.GetDeployments()).String() + err := writer.WriteStringValue("deployments", &cast) + if err != nil { + return err + } + } + if m.GetEmailAddresses() != nil { + cast := (*m.GetEmailAddresses()).String() + err := writer.WriteStringValue("email_addresses", &cast) + if err != nil { + return err + } + } + if m.GetEnvironments() != nil { + cast := (*m.GetEnvironments()).String() + err := writer.WriteStringValue("environments", &cast) + if err != nil { + return err + } + } + if m.GetFollowers() != nil { + cast := (*m.GetFollowers()).String() + err := writer.WriteStringValue("followers", &cast) + if err != nil { + return err + } + } + if m.GetGitSshKeys() != nil { + cast := (*m.GetGitSshKeys()).String() + err := writer.WriteStringValue("git_ssh_keys", &cast) + if err != nil { + return err + } + } + if m.GetGpgKeys() != nil { + cast := (*m.GetGpgKeys()).String() + err := writer.WriteStringValue("gpg_keys", &cast) + if err != nil { + return err + } + } + if m.GetInteractionLimits() != nil { + cast := (*m.GetInteractionLimits()).String() + err := writer.WriteStringValue("interaction_limits", &cast) + if err != nil { + return err + } + } + if m.GetIssues() != nil { + cast := (*m.GetIssues()).String() + err := writer.WriteStringValue("issues", &cast) + if err != nil { + return err + } + } + if m.GetMembers() != nil { + cast := (*m.GetMembers()).String() + err := writer.WriteStringValue("members", &cast) + if err != nil { + return err + } + } + if m.GetMetadata() != nil { + cast := (*m.GetMetadata()).String() + err := writer.WriteStringValue("metadata", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationAdministration() != nil { + cast := (*m.GetOrganizationAdministration()).String() + err := writer.WriteStringValue("organization_administration", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationAnnouncementBanners() != nil { + cast := (*m.GetOrganizationAnnouncementBanners()).String() + err := writer.WriteStringValue("organization_announcement_banners", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationCopilotSeatManagement() != nil { + cast := (*m.GetOrganizationCopilotSeatManagement()).String() + err := writer.WriteStringValue("organization_copilot_seat_management", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationCustomOrgRoles() != nil { + cast := (*m.GetOrganizationCustomOrgRoles()).String() + err := writer.WriteStringValue("organization_custom_org_roles", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationCustomProperties() != nil { + cast := (*m.GetOrganizationCustomProperties()).String() + err := writer.WriteStringValue("organization_custom_properties", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationCustomRoles() != nil { + cast := (*m.GetOrganizationCustomRoles()).String() + err := writer.WriteStringValue("organization_custom_roles", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationEvents() != nil { + cast := (*m.GetOrganizationEvents()).String() + err := writer.WriteStringValue("organization_events", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationHooks() != nil { + cast := (*m.GetOrganizationHooks()).String() + err := writer.WriteStringValue("organization_hooks", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationPackages() != nil { + cast := (*m.GetOrganizationPackages()).String() + err := writer.WriteStringValue("organization_packages", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationPersonalAccessTokens() != nil { + cast := (*m.GetOrganizationPersonalAccessTokens()).String() + err := writer.WriteStringValue("organization_personal_access_tokens", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationPersonalAccessTokenRequests() != nil { + cast := (*m.GetOrganizationPersonalAccessTokenRequests()).String() + err := writer.WriteStringValue("organization_personal_access_token_requests", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationPlan() != nil { + cast := (*m.GetOrganizationPlan()).String() + err := writer.WriteStringValue("organization_plan", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationProjects() != nil { + cast := (*m.GetOrganizationProjects()).String() + err := writer.WriteStringValue("organization_projects", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationSecrets() != nil { + cast := (*m.GetOrganizationSecrets()).String() + err := writer.WriteStringValue("organization_secrets", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationSelfHostedRunners() != nil { + cast := (*m.GetOrganizationSelfHostedRunners()).String() + err := writer.WriteStringValue("organization_self_hosted_runners", &cast) + if err != nil { + return err + } + } + if m.GetOrganizationUserBlocking() != nil { + cast := (*m.GetOrganizationUserBlocking()).String() + err := writer.WriteStringValue("organization_user_blocking", &cast) + if err != nil { + return err + } + } + if m.GetPackages() != nil { + cast := (*m.GetPackages()).String() + err := writer.WriteStringValue("packages", &cast) + if err != nil { + return err + } + } + if m.GetPages() != nil { + cast := (*m.GetPages()).String() + err := writer.WriteStringValue("pages", &cast) + if err != nil { + return err + } + } + if m.GetProfile() != nil { + cast := (*m.GetProfile()).String() + err := writer.WriteStringValue("profile", &cast) + if err != nil { + return err + } + } + if m.GetPullRequests() != nil { + cast := (*m.GetPullRequests()).String() + err := writer.WriteStringValue("pull_requests", &cast) + if err != nil { + return err + } + } + if m.GetRepositoryCustomProperties() != nil { + cast := (*m.GetRepositoryCustomProperties()).String() + err := writer.WriteStringValue("repository_custom_properties", &cast) + if err != nil { + return err + } + } + if m.GetRepositoryHooks() != nil { + cast := (*m.GetRepositoryHooks()).String() + err := writer.WriteStringValue("repository_hooks", &cast) + if err != nil { + return err + } + } + if m.GetRepositoryProjects() != nil { + cast := (*m.GetRepositoryProjects()).String() + err := writer.WriteStringValue("repository_projects", &cast) + if err != nil { + return err + } + } + if m.GetSecrets() != nil { + cast := (*m.GetSecrets()).String() + err := writer.WriteStringValue("secrets", &cast) + if err != nil { + return err + } + } + if m.GetSecretScanningAlerts() != nil { + cast := (*m.GetSecretScanningAlerts()).String() + err := writer.WriteStringValue("secret_scanning_alerts", &cast) + if err != nil { + return err + } + } + if m.GetSecurityEvents() != nil { + cast := (*m.GetSecurityEvents()).String() + err := writer.WriteStringValue("security_events", &cast) + if err != nil { + return err + } + } + if m.GetSingleFile() != nil { + cast := (*m.GetSingleFile()).String() + err := writer.WriteStringValue("single_file", &cast) + if err != nil { + return err + } + } + if m.GetStarring() != nil { + cast := (*m.GetStarring()).String() + err := writer.WriteStringValue("starring", &cast) + if err != nil { + return err + } + } + if m.GetStatuses() != nil { + cast := (*m.GetStatuses()).String() + err := writer.WriteStringValue("statuses", &cast) + if err != nil { + return err + } + } + if m.GetTeamDiscussions() != nil { + cast := (*m.GetTeamDiscussions()).String() + err := writer.WriteStringValue("team_discussions", &cast) + if err != nil { + return err + } + } + if m.GetVulnerabilityAlerts() != nil { + cast := (*m.GetVulnerabilityAlerts()).String() + err := writer.WriteStringValue("vulnerability_alerts", &cast) + if err != nil { + return err + } + } + if m.GetWorkflows() != nil { + cast := (*m.GetWorkflows()).String() + err := writer.WriteStringValue("workflows", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActions sets the actions property value. The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. +func (m *AppPermissions) SetActions(value *AppPermissions_actions)() { + m.actions = 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 *AppPermissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdministration sets the administration property value. The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. +func (m *AppPermissions) SetAdministration(value *AppPermissions_administration)() { + m.administration = value +} +// SetChecks sets the checks property value. The level of permission to grant the access token for checks on code. +func (m *AppPermissions) SetChecks(value *AppPermissions_checks)() { + m.checks = value +} +// SetCodespaces sets the codespaces property value. The level of permission to grant the access token to create, edit, delete, and list Codespaces. +func (m *AppPermissions) SetCodespaces(value *AppPermissions_codespaces)() { + m.codespaces = value +} +// SetContents sets the contents property value. The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. +func (m *AppPermissions) SetContents(value *AppPermissions_contents)() { + m.contents = value +} +// SetDependabotSecrets sets the dependabot_secrets property value. The leve of permission to grant the access token to manage Dependabot secrets. +func (m *AppPermissions) SetDependabotSecrets(value *AppPermissions_dependabot_secrets)() { + m.dependabot_secrets = value +} +// SetDeployments sets the deployments property value. The level of permission to grant the access token for deployments and deployment statuses. +func (m *AppPermissions) SetDeployments(value *AppPermissions_deployments)() { + m.deployments = value +} +// SetEmailAddresses sets the email_addresses property value. The level of permission to grant the access token to manage the email addresses belonging to a user. +func (m *AppPermissions) SetEmailAddresses(value *AppPermissions_email_addresses)() { + m.email_addresses = value +} +// SetEnvironments sets the environments property value. The level of permission to grant the access token for managing repository environments. +func (m *AppPermissions) SetEnvironments(value *AppPermissions_environments)() { + m.environments = value +} +// SetFollowers sets the followers property value. The level of permission to grant the access token to manage the followers belonging to a user. +func (m *AppPermissions) SetFollowers(value *AppPermissions_followers)() { + m.followers = value +} +// SetGitSshKeys sets the git_ssh_keys property value. The level of permission to grant the access token to manage git SSH keys. +func (m *AppPermissions) SetGitSshKeys(value *AppPermissions_git_ssh_keys)() { + m.git_ssh_keys = value +} +// SetGpgKeys sets the gpg_keys property value. The level of permission to grant the access token to view and manage GPG keys belonging to a user. +func (m *AppPermissions) SetGpgKeys(value *AppPermissions_gpg_keys)() { + m.gpg_keys = value +} +// SetInteractionLimits sets the interaction_limits property value. The level of permission to grant the access token to view and manage interaction limits on a repository. +func (m *AppPermissions) SetInteractionLimits(value *AppPermissions_interaction_limits)() { + m.interaction_limits = value +} +// SetIssues sets the issues property value. The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. +func (m *AppPermissions) SetIssues(value *AppPermissions_issues)() { + m.issues = value +} +// SetMembers sets the members property value. The level of permission to grant the access token for organization teams and members. +func (m *AppPermissions) SetMembers(value *AppPermissions_members)() { + m.members = value +} +// SetMetadata sets the metadata property value. The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. +func (m *AppPermissions) SetMetadata(value *AppPermissions_metadata)() { + m.metadata = value +} +// SetOrganizationAdministration sets the organization_administration property value. The level of permission to grant the access token to manage access to an organization. +func (m *AppPermissions) SetOrganizationAdministration(value *AppPermissions_organization_administration)() { + m.organization_administration = value +} +// SetOrganizationAnnouncementBanners sets the organization_announcement_banners property value. The level of permission to grant the access token to view and manage announcement banners for an organization. +func (m *AppPermissions) SetOrganizationAnnouncementBanners(value *AppPermissions_organization_announcement_banners)() { + m.organization_announcement_banners = value +} +// SetOrganizationCopilotSeatManagement sets the organization_copilot_seat_management property value. The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change. +func (m *AppPermissions) SetOrganizationCopilotSeatManagement(value *AppPermissions_organization_copilot_seat_management)() { + m.organization_copilot_seat_management = value +} +// SetOrganizationCustomOrgRoles sets the organization_custom_org_roles property value. The level of permission to grant the access token for custom organization roles management. +func (m *AppPermissions) SetOrganizationCustomOrgRoles(value *AppPermissions_organization_custom_org_roles)() { + m.organization_custom_org_roles = value +} +// SetOrganizationCustomProperties sets the organization_custom_properties property value. The level of permission to grant the access token for custom property management. +func (m *AppPermissions) SetOrganizationCustomProperties(value *AppPermissions_organization_custom_properties)() { + m.organization_custom_properties = value +} +// SetOrganizationCustomRoles sets the organization_custom_roles property value. The level of permission to grant the access token for custom repository roles management. +func (m *AppPermissions) SetOrganizationCustomRoles(value *AppPermissions_organization_custom_roles)() { + m.organization_custom_roles = value +} +// SetOrganizationEvents sets the organization_events property value. The level of permission to grant the access token to view events triggered by an activity in an organization. +func (m *AppPermissions) SetOrganizationEvents(value *AppPermissions_organization_events)() { + m.organization_events = value +} +// SetOrganizationHooks sets the organization_hooks property value. The level of permission to grant the access token to manage the post-receive hooks for an organization. +func (m *AppPermissions) SetOrganizationHooks(value *AppPermissions_organization_hooks)() { + m.organization_hooks = value +} +// SetOrganizationPackages sets the organization_packages property value. The level of permission to grant the access token for organization packages published to GitHub Packages. +func (m *AppPermissions) SetOrganizationPackages(value *AppPermissions_organization_packages)() { + m.organization_packages = value +} +// SetOrganizationPersonalAccessTokenRequests sets the organization_personal_access_token_requests property value. The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization. +func (m *AppPermissions) SetOrganizationPersonalAccessTokenRequests(value *AppPermissions_organization_personal_access_token_requests)() { + m.organization_personal_access_token_requests = value +} +// SetOrganizationPersonalAccessTokens sets the organization_personal_access_tokens property value. The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization. +func (m *AppPermissions) SetOrganizationPersonalAccessTokens(value *AppPermissions_organization_personal_access_tokens)() { + m.organization_personal_access_tokens = value +} +// SetOrganizationPlan sets the organization_plan property value. The level of permission to grant the access token for viewing an organization's plan. +func (m *AppPermissions) SetOrganizationPlan(value *AppPermissions_organization_plan)() { + m.organization_plan = value +} +// SetOrganizationProjects sets the organization_projects property value. The level of permission to grant the access token to manage organization projects and projects beta (where available). +func (m *AppPermissions) SetOrganizationProjects(value *AppPermissions_organization_projects)() { + m.organization_projects = value +} +// SetOrganizationSecrets sets the organization_secrets property value. The level of permission to grant the access token to manage organization secrets. +func (m *AppPermissions) SetOrganizationSecrets(value *AppPermissions_organization_secrets)() { + m.organization_secrets = value +} +// SetOrganizationSelfHostedRunners sets the organization_self_hosted_runners property value. The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. +func (m *AppPermissions) SetOrganizationSelfHostedRunners(value *AppPermissions_organization_self_hosted_runners)() { + m.organization_self_hosted_runners = value +} +// SetOrganizationUserBlocking sets the organization_user_blocking property value. The level of permission to grant the access token to view and manage users blocked by the organization. +func (m *AppPermissions) SetOrganizationUserBlocking(value *AppPermissions_organization_user_blocking)() { + m.organization_user_blocking = value +} +// SetPackages sets the packages property value. The level of permission to grant the access token for packages published to GitHub Packages. +func (m *AppPermissions) SetPackages(value *AppPermissions_packages)() { + m.packages = value +} +// SetPages sets the pages property value. The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. +func (m *AppPermissions) SetPages(value *AppPermissions_pages)() { + m.pages = value +} +// SetProfile sets the profile property value. The level of permission to grant the access token to manage the profile settings belonging to a user. +func (m *AppPermissions) SetProfile(value *AppPermissions_profile)() { + m.profile = value +} +// SetPullRequests sets the pull_requests property value. The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. +func (m *AppPermissions) SetPullRequests(value *AppPermissions_pull_requests)() { + m.pull_requests = value +} +// SetRepositoryCustomProperties sets the repository_custom_properties property value. The level of permission to grant the access token to view and edit custom properties for a repository, when allowed by the property. +func (m *AppPermissions) SetRepositoryCustomProperties(value *AppPermissions_repository_custom_properties)() { + m.repository_custom_properties = value +} +// SetRepositoryHooks sets the repository_hooks property value. The level of permission to grant the access token to manage the post-receive hooks for a repository. +func (m *AppPermissions) SetRepositoryHooks(value *AppPermissions_repository_hooks)() { + m.repository_hooks = value +} +// SetRepositoryProjects sets the repository_projects property value. The level of permission to grant the access token to manage repository projects, columns, and cards. +func (m *AppPermissions) SetRepositoryProjects(value *AppPermissions_repository_projects)() { + m.repository_projects = value +} +// SetSecrets sets the secrets property value. The level of permission to grant the access token to manage repository secrets. +func (m *AppPermissions) SetSecrets(value *AppPermissions_secrets)() { + m.secrets = value +} +// SetSecretScanningAlerts sets the secret_scanning_alerts property value. The level of permission to grant the access token to view and manage secret scanning alerts. +func (m *AppPermissions) SetSecretScanningAlerts(value *AppPermissions_secret_scanning_alerts)() { + m.secret_scanning_alerts = value +} +// SetSecurityEvents sets the security_events property value. The level of permission to grant the access token to view and manage security events like code scanning alerts. +func (m *AppPermissions) SetSecurityEvents(value *AppPermissions_security_events)() { + m.security_events = value +} +// SetSingleFile sets the single_file property value. The level of permission to grant the access token to manage just a single file. +func (m *AppPermissions) SetSingleFile(value *AppPermissions_single_file)() { + m.single_file = value +} +// SetStarring sets the starring property value. The level of permission to grant the access token to list and manage repositories a user is starring. +func (m *AppPermissions) SetStarring(value *AppPermissions_starring)() { + m.starring = value +} +// SetStatuses sets the statuses property value. The level of permission to grant the access token for commit statuses. +func (m *AppPermissions) SetStatuses(value *AppPermissions_statuses)() { + m.statuses = value +} +// SetTeamDiscussions sets the team_discussions property value. The level of permission to grant the access token to manage team discussions and related comments. +func (m *AppPermissions) SetTeamDiscussions(value *AppPermissions_team_discussions)() { + m.team_discussions = value +} +// SetVulnerabilityAlerts sets the vulnerability_alerts property value. The level of permission to grant the access token to manage Dependabot alerts. +func (m *AppPermissions) SetVulnerabilityAlerts(value *AppPermissions_vulnerability_alerts)() { + m.vulnerability_alerts = value +} +// SetWorkflows sets the workflows property value. The level of permission to grant the access token to update GitHub Actions workflow files. +func (m *AppPermissions) SetWorkflows(value *AppPermissions_workflows)() { + m.workflows = value +} +type AppPermissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActions()(*AppPermissions_actions) + GetAdministration()(*AppPermissions_administration) + GetChecks()(*AppPermissions_checks) + GetCodespaces()(*AppPermissions_codespaces) + GetContents()(*AppPermissions_contents) + GetDependabotSecrets()(*AppPermissions_dependabot_secrets) + GetDeployments()(*AppPermissions_deployments) + GetEmailAddresses()(*AppPermissions_email_addresses) + GetEnvironments()(*AppPermissions_environments) + GetFollowers()(*AppPermissions_followers) + GetGitSshKeys()(*AppPermissions_git_ssh_keys) + GetGpgKeys()(*AppPermissions_gpg_keys) + GetInteractionLimits()(*AppPermissions_interaction_limits) + GetIssues()(*AppPermissions_issues) + GetMembers()(*AppPermissions_members) + GetMetadata()(*AppPermissions_metadata) + GetOrganizationAdministration()(*AppPermissions_organization_administration) + GetOrganizationAnnouncementBanners()(*AppPermissions_organization_announcement_banners) + GetOrganizationCopilotSeatManagement()(*AppPermissions_organization_copilot_seat_management) + GetOrganizationCustomOrgRoles()(*AppPermissions_organization_custom_org_roles) + GetOrganizationCustomProperties()(*AppPermissions_organization_custom_properties) + GetOrganizationCustomRoles()(*AppPermissions_organization_custom_roles) + GetOrganizationEvents()(*AppPermissions_organization_events) + GetOrganizationHooks()(*AppPermissions_organization_hooks) + GetOrganizationPackages()(*AppPermissions_organization_packages) + GetOrganizationPersonalAccessTokenRequests()(*AppPermissions_organization_personal_access_token_requests) + GetOrganizationPersonalAccessTokens()(*AppPermissions_organization_personal_access_tokens) + GetOrganizationPlan()(*AppPermissions_organization_plan) + GetOrganizationProjects()(*AppPermissions_organization_projects) + GetOrganizationSecrets()(*AppPermissions_organization_secrets) + GetOrganizationSelfHostedRunners()(*AppPermissions_organization_self_hosted_runners) + GetOrganizationUserBlocking()(*AppPermissions_organization_user_blocking) + GetPackages()(*AppPermissions_packages) + GetPages()(*AppPermissions_pages) + GetProfile()(*AppPermissions_profile) + GetPullRequests()(*AppPermissions_pull_requests) + GetRepositoryCustomProperties()(*AppPermissions_repository_custom_properties) + GetRepositoryHooks()(*AppPermissions_repository_hooks) + GetRepositoryProjects()(*AppPermissions_repository_projects) + GetSecrets()(*AppPermissions_secrets) + GetSecretScanningAlerts()(*AppPermissions_secret_scanning_alerts) + GetSecurityEvents()(*AppPermissions_security_events) + GetSingleFile()(*AppPermissions_single_file) + GetStarring()(*AppPermissions_starring) + GetStatuses()(*AppPermissions_statuses) + GetTeamDiscussions()(*AppPermissions_team_discussions) + GetVulnerabilityAlerts()(*AppPermissions_vulnerability_alerts) + GetWorkflows()(*AppPermissions_workflows) + SetActions(value *AppPermissions_actions)() + SetAdministration(value *AppPermissions_administration)() + SetChecks(value *AppPermissions_checks)() + SetCodespaces(value *AppPermissions_codespaces)() + SetContents(value *AppPermissions_contents)() + SetDependabotSecrets(value *AppPermissions_dependabot_secrets)() + SetDeployments(value *AppPermissions_deployments)() + SetEmailAddresses(value *AppPermissions_email_addresses)() + SetEnvironments(value *AppPermissions_environments)() + SetFollowers(value *AppPermissions_followers)() + SetGitSshKeys(value *AppPermissions_git_ssh_keys)() + SetGpgKeys(value *AppPermissions_gpg_keys)() + SetInteractionLimits(value *AppPermissions_interaction_limits)() + SetIssues(value *AppPermissions_issues)() + SetMembers(value *AppPermissions_members)() + SetMetadata(value *AppPermissions_metadata)() + SetOrganizationAdministration(value *AppPermissions_organization_administration)() + SetOrganizationAnnouncementBanners(value *AppPermissions_organization_announcement_banners)() + SetOrganizationCopilotSeatManagement(value *AppPermissions_organization_copilot_seat_management)() + SetOrganizationCustomOrgRoles(value *AppPermissions_organization_custom_org_roles)() + SetOrganizationCustomProperties(value *AppPermissions_organization_custom_properties)() + SetOrganizationCustomRoles(value *AppPermissions_organization_custom_roles)() + SetOrganizationEvents(value *AppPermissions_organization_events)() + SetOrganizationHooks(value *AppPermissions_organization_hooks)() + SetOrganizationPackages(value *AppPermissions_organization_packages)() + SetOrganizationPersonalAccessTokenRequests(value *AppPermissions_organization_personal_access_token_requests)() + SetOrganizationPersonalAccessTokens(value *AppPermissions_organization_personal_access_tokens)() + SetOrganizationPlan(value *AppPermissions_organization_plan)() + SetOrganizationProjects(value *AppPermissions_organization_projects)() + SetOrganizationSecrets(value *AppPermissions_organization_secrets)() + SetOrganizationSelfHostedRunners(value *AppPermissions_organization_self_hosted_runners)() + SetOrganizationUserBlocking(value *AppPermissions_organization_user_blocking)() + SetPackages(value *AppPermissions_packages)() + SetPages(value *AppPermissions_pages)() + SetProfile(value *AppPermissions_profile)() + SetPullRequests(value *AppPermissions_pull_requests)() + SetRepositoryCustomProperties(value *AppPermissions_repository_custom_properties)() + SetRepositoryHooks(value *AppPermissions_repository_hooks)() + SetRepositoryProjects(value *AppPermissions_repository_projects)() + SetSecrets(value *AppPermissions_secrets)() + SetSecretScanningAlerts(value *AppPermissions_secret_scanning_alerts)() + SetSecurityEvents(value *AppPermissions_security_events)() + SetSingleFile(value *AppPermissions_single_file)() + SetStarring(value *AppPermissions_starring)() + SetStatuses(value *AppPermissions_statuses)() + SetTeamDiscussions(value *AppPermissions_team_discussions)() + SetVulnerabilityAlerts(value *AppPermissions_vulnerability_alerts)() + SetWorkflows(value *AppPermissions_workflows)() +} diff --git a/pkg/github/models/app_permissions_escaped_actions.go b/pkg/github/models/app_permissions_escaped_actions.go new file mode 100644 index 00000000..60cd40fc --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_actions.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for GitHub Actions workflows, workflow runs, and artifacts. +type AppPermissions_actions int + +const ( + READ_APPPERMISSIONS_ACTIONS AppPermissions_actions = iota + WRITE_APPPERMISSIONS_ACTIONS +) + +func (i AppPermissions_actions) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_actions(v string) (any, error) { + result := READ_APPPERMISSIONS_ACTIONS + switch v { + case "read": + result = READ_APPPERMISSIONS_ACTIONS + case "write": + result = WRITE_APPPERMISSIONS_ACTIONS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_actions(values []AppPermissions_actions) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_actions) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_administration.go b/pkg/github/models/app_permissions_escaped_administration.go new file mode 100644 index 00000000..a092bec6 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_administration.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for repository creation, deletion, settings, teams, and collaborators creation. +type AppPermissions_administration int + +const ( + READ_APPPERMISSIONS_ADMINISTRATION AppPermissions_administration = iota + WRITE_APPPERMISSIONS_ADMINISTRATION +) + +func (i AppPermissions_administration) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_administration(v string) (any, error) { + result := READ_APPPERMISSIONS_ADMINISTRATION + switch v { + case "read": + result = READ_APPPERMISSIONS_ADMINISTRATION + case "write": + result = WRITE_APPPERMISSIONS_ADMINISTRATION + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_administration(values []AppPermissions_administration) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_administration) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_checks.go b/pkg/github/models/app_permissions_escaped_checks.go new file mode 100644 index 00000000..f118261a --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_checks.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for checks on code. +type AppPermissions_checks int + +const ( + READ_APPPERMISSIONS_CHECKS AppPermissions_checks = iota + WRITE_APPPERMISSIONS_CHECKS +) + +func (i AppPermissions_checks) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_checks(v string) (any, error) { + result := READ_APPPERMISSIONS_CHECKS + switch v { + case "read": + result = READ_APPPERMISSIONS_CHECKS + case "write": + result = WRITE_APPPERMISSIONS_CHECKS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_checks(values []AppPermissions_checks) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_checks) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_codespaces.go b/pkg/github/models/app_permissions_escaped_codespaces.go new file mode 100644 index 00000000..9a671507 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_codespaces.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to create, edit, delete, and list Codespaces. +type AppPermissions_codespaces int + +const ( + READ_APPPERMISSIONS_CODESPACES AppPermissions_codespaces = iota + WRITE_APPPERMISSIONS_CODESPACES +) + +func (i AppPermissions_codespaces) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_codespaces(v string) (any, error) { + result := READ_APPPERMISSIONS_CODESPACES + switch v { + case "read": + result = READ_APPPERMISSIONS_CODESPACES + case "write": + result = WRITE_APPPERMISSIONS_CODESPACES + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_codespaces(values []AppPermissions_codespaces) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_codespaces) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_contents.go b/pkg/github/models/app_permissions_escaped_contents.go new file mode 100644 index 00000000..b93d1c8f --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_contents.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for repository contents, commits, branches, downloads, releases, and merges. +type AppPermissions_contents int + +const ( + READ_APPPERMISSIONS_CONTENTS AppPermissions_contents = iota + WRITE_APPPERMISSIONS_CONTENTS +) + +func (i AppPermissions_contents) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_contents(v string) (any, error) { + result := READ_APPPERMISSIONS_CONTENTS + switch v { + case "read": + result = READ_APPPERMISSIONS_CONTENTS + case "write": + result = WRITE_APPPERMISSIONS_CONTENTS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_contents(values []AppPermissions_contents) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_contents) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_dependabot_escaped_secrets.go b/pkg/github/models/app_permissions_escaped_dependabot_escaped_secrets.go new file mode 100644 index 00000000..c6094c00 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_dependabot_escaped_secrets.go @@ -0,0 +1,34 @@ +package models +// The leve of permission to grant the access token to manage Dependabot secrets. +type AppPermissions_dependabot_secrets int + +const ( + READ_APPPERMISSIONS_DEPENDABOT_SECRETS AppPermissions_dependabot_secrets = iota + WRITE_APPPERMISSIONS_DEPENDABOT_SECRETS +) + +func (i AppPermissions_dependabot_secrets) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_dependabot_secrets(v string) (any, error) { + result := READ_APPPERMISSIONS_DEPENDABOT_SECRETS + switch v { + case "read": + result = READ_APPPERMISSIONS_DEPENDABOT_SECRETS + case "write": + result = WRITE_APPPERMISSIONS_DEPENDABOT_SECRETS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_dependabot_secrets(values []AppPermissions_dependabot_secrets) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_dependabot_secrets) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_deployments.go b/pkg/github/models/app_permissions_escaped_deployments.go new file mode 100644 index 00000000..3f318f2a --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_deployments.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for deployments and deployment statuses. +type AppPermissions_deployments int + +const ( + READ_APPPERMISSIONS_DEPLOYMENTS AppPermissions_deployments = iota + WRITE_APPPERMISSIONS_DEPLOYMENTS +) + +func (i AppPermissions_deployments) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_deployments(v string) (any, error) { + result := READ_APPPERMISSIONS_DEPLOYMENTS + switch v { + case "read": + result = READ_APPPERMISSIONS_DEPLOYMENTS + case "write": + result = WRITE_APPPERMISSIONS_DEPLOYMENTS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_deployments(values []AppPermissions_deployments) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_deployments) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_email_escaped_addresses.go b/pkg/github/models/app_permissions_escaped_email_escaped_addresses.go new file mode 100644 index 00000000..a62a21c7 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_email_escaped_addresses.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to manage the email addresses belonging to a user. +type AppPermissions_email_addresses int + +const ( + READ_APPPERMISSIONS_EMAIL_ADDRESSES AppPermissions_email_addresses = iota + WRITE_APPPERMISSIONS_EMAIL_ADDRESSES +) + +func (i AppPermissions_email_addresses) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_email_addresses(v string) (any, error) { + result := READ_APPPERMISSIONS_EMAIL_ADDRESSES + switch v { + case "read": + result = READ_APPPERMISSIONS_EMAIL_ADDRESSES + case "write": + result = WRITE_APPPERMISSIONS_EMAIL_ADDRESSES + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_email_addresses(values []AppPermissions_email_addresses) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_email_addresses) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_environments.go b/pkg/github/models/app_permissions_escaped_environments.go new file mode 100644 index 00000000..e5e16e9f --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_environments.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for managing repository environments. +type AppPermissions_environments int + +const ( + READ_APPPERMISSIONS_ENVIRONMENTS AppPermissions_environments = iota + WRITE_APPPERMISSIONS_ENVIRONMENTS +) + +func (i AppPermissions_environments) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_environments(v string) (any, error) { + result := READ_APPPERMISSIONS_ENVIRONMENTS + switch v { + case "read": + result = READ_APPPERMISSIONS_ENVIRONMENTS + case "write": + result = WRITE_APPPERMISSIONS_ENVIRONMENTS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_environments(values []AppPermissions_environments) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_environments) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_followers.go b/pkg/github/models/app_permissions_escaped_followers.go new file mode 100644 index 00000000..63d0bf79 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_followers.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to manage the followers belonging to a user. +type AppPermissions_followers int + +const ( + READ_APPPERMISSIONS_FOLLOWERS AppPermissions_followers = iota + WRITE_APPPERMISSIONS_FOLLOWERS +) + +func (i AppPermissions_followers) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_followers(v string) (any, error) { + result := READ_APPPERMISSIONS_FOLLOWERS + switch v { + case "read": + result = READ_APPPERMISSIONS_FOLLOWERS + case "write": + result = WRITE_APPPERMISSIONS_FOLLOWERS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_followers(values []AppPermissions_followers) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_followers) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_git_escaped_ssh_escaped_keys.go b/pkg/github/models/app_permissions_escaped_git_escaped_ssh_escaped_keys.go new file mode 100644 index 00000000..de4850a1 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_git_escaped_ssh_escaped_keys.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to manage git SSH keys. +type AppPermissions_git_ssh_keys int + +const ( + READ_APPPERMISSIONS_GIT_SSH_KEYS AppPermissions_git_ssh_keys = iota + WRITE_APPPERMISSIONS_GIT_SSH_KEYS +) + +func (i AppPermissions_git_ssh_keys) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_git_ssh_keys(v string) (any, error) { + result := READ_APPPERMISSIONS_GIT_SSH_KEYS + switch v { + case "read": + result = READ_APPPERMISSIONS_GIT_SSH_KEYS + case "write": + result = WRITE_APPPERMISSIONS_GIT_SSH_KEYS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_git_ssh_keys(values []AppPermissions_git_ssh_keys) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_git_ssh_keys) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_gpg_escaped_keys.go b/pkg/github/models/app_permissions_escaped_gpg_escaped_keys.go new file mode 100644 index 00000000..284984f1 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_gpg_escaped_keys.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to view and manage GPG keys belonging to a user. +type AppPermissions_gpg_keys int + +const ( + READ_APPPERMISSIONS_GPG_KEYS AppPermissions_gpg_keys = iota + WRITE_APPPERMISSIONS_GPG_KEYS +) + +func (i AppPermissions_gpg_keys) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_gpg_keys(v string) (any, error) { + result := READ_APPPERMISSIONS_GPG_KEYS + switch v { + case "read": + result = READ_APPPERMISSIONS_GPG_KEYS + case "write": + result = WRITE_APPPERMISSIONS_GPG_KEYS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_gpg_keys(values []AppPermissions_gpg_keys) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_gpg_keys) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_interaction_escaped_limits.go b/pkg/github/models/app_permissions_escaped_interaction_escaped_limits.go new file mode 100644 index 00000000..95bcc182 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_interaction_escaped_limits.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to view and manage interaction limits on a repository. +type AppPermissions_interaction_limits int + +const ( + READ_APPPERMISSIONS_INTERACTION_LIMITS AppPermissions_interaction_limits = iota + WRITE_APPPERMISSIONS_INTERACTION_LIMITS +) + +func (i AppPermissions_interaction_limits) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_interaction_limits(v string) (any, error) { + result := READ_APPPERMISSIONS_INTERACTION_LIMITS + switch v { + case "read": + result = READ_APPPERMISSIONS_INTERACTION_LIMITS + case "write": + result = WRITE_APPPERMISSIONS_INTERACTION_LIMITS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_interaction_limits(values []AppPermissions_interaction_limits) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_interaction_limits) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_issues.go b/pkg/github/models/app_permissions_escaped_issues.go new file mode 100644 index 00000000..7250708a --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_issues.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for issues and related comments, assignees, labels, and milestones. +type AppPermissions_issues int + +const ( + READ_APPPERMISSIONS_ISSUES AppPermissions_issues = iota + WRITE_APPPERMISSIONS_ISSUES +) + +func (i AppPermissions_issues) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_issues(v string) (any, error) { + result := READ_APPPERMISSIONS_ISSUES + switch v { + case "read": + result = READ_APPPERMISSIONS_ISSUES + case "write": + result = WRITE_APPPERMISSIONS_ISSUES + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_issues(values []AppPermissions_issues) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_issues) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_members.go b/pkg/github/models/app_permissions_escaped_members.go new file mode 100644 index 00000000..8003ce0a --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_members.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for organization teams and members. +type AppPermissions_members int + +const ( + READ_APPPERMISSIONS_MEMBERS AppPermissions_members = iota + WRITE_APPPERMISSIONS_MEMBERS +) + +func (i AppPermissions_members) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_members(v string) (any, error) { + result := READ_APPPERMISSIONS_MEMBERS + switch v { + case "read": + result = READ_APPPERMISSIONS_MEMBERS + case "write": + result = WRITE_APPPERMISSIONS_MEMBERS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_members(values []AppPermissions_members) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_members) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_metadata.go b/pkg/github/models/app_permissions_escaped_metadata.go new file mode 100644 index 00000000..fe06362c --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_metadata.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to search repositories, list collaborators, and access repository metadata. +type AppPermissions_metadata int + +const ( + READ_APPPERMISSIONS_METADATA AppPermissions_metadata = iota + WRITE_APPPERMISSIONS_METADATA +) + +func (i AppPermissions_metadata) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_metadata(v string) (any, error) { + result := READ_APPPERMISSIONS_METADATA + switch v { + case "read": + result = READ_APPPERMISSIONS_METADATA + case "write": + result = WRITE_APPPERMISSIONS_METADATA + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_metadata(values []AppPermissions_metadata) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_metadata) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_administration.go b/pkg/github/models/app_permissions_escaped_organization_escaped_administration.go new file mode 100644 index 00000000..0b1e6e52 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_administration.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to manage access to an organization. +type AppPermissions_organization_administration int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_ADMINISTRATION AppPermissions_organization_administration = iota + WRITE_APPPERMISSIONS_ORGANIZATION_ADMINISTRATION +) + +func (i AppPermissions_organization_administration) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_administration(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_ADMINISTRATION + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_ADMINISTRATION + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_ADMINISTRATION + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_administration(values []AppPermissions_organization_administration) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_administration) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_announcement_escaped_banners.go b/pkg/github/models/app_permissions_escaped_organization_escaped_announcement_escaped_banners.go new file mode 100644 index 00000000..62d575cb --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_announcement_escaped_banners.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to view and manage announcement banners for an organization. +type AppPermissions_organization_announcement_banners int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_ANNOUNCEMENT_BANNERS AppPermissions_organization_announcement_banners = iota + WRITE_APPPERMISSIONS_ORGANIZATION_ANNOUNCEMENT_BANNERS +) + +func (i AppPermissions_organization_announcement_banners) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_announcement_banners(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_ANNOUNCEMENT_BANNERS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_ANNOUNCEMENT_BANNERS + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_ANNOUNCEMENT_BANNERS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_announcement_banners(values []AppPermissions_organization_announcement_banners) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_announcement_banners) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_copilot_escaped_seat_escaped_management.go b/pkg/github/models/app_permissions_escaped_organization_escaped_copilot_escaped_seat_escaped_management.go new file mode 100644 index 00000000..ef8aa5d6 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_copilot_escaped_seat_escaped_management.go @@ -0,0 +1,31 @@ +package models +// The level of permission to grant the access token for managing access to GitHub Copilot for members of an organization with a Copilot Business subscription. This property is in beta and is subject to change. +type AppPermissions_organization_copilot_seat_management int + +const ( + WRITE_APPPERMISSIONS_ORGANIZATION_COPILOT_SEAT_MANAGEMENT AppPermissions_organization_copilot_seat_management = iota +) + +func (i AppPermissions_organization_copilot_seat_management) String() string { + return []string{"write"}[i] +} +func ParseAppPermissions_organization_copilot_seat_management(v string) (any, error) { + result := WRITE_APPPERMISSIONS_ORGANIZATION_COPILOT_SEAT_MANAGEMENT + switch v { + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_COPILOT_SEAT_MANAGEMENT + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_copilot_seat_management(values []AppPermissions_organization_copilot_seat_management) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_copilot_seat_management) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_custom_escaped_org_escaped_roles.go b/pkg/github/models/app_permissions_escaped_organization_escaped_custom_escaped_org_escaped_roles.go new file mode 100644 index 00000000..67c679c3 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_custom_escaped_org_escaped_roles.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for custom organization roles management. +type AppPermissions_organization_custom_org_roles int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_ORG_ROLES AppPermissions_organization_custom_org_roles = iota + WRITE_APPPERMISSIONS_ORGANIZATION_CUSTOM_ORG_ROLES +) + +func (i AppPermissions_organization_custom_org_roles) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_custom_org_roles(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_ORG_ROLES + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_ORG_ROLES + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_CUSTOM_ORG_ROLES + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_custom_org_roles(values []AppPermissions_organization_custom_org_roles) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_custom_org_roles) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_custom_escaped_properties.go b/pkg/github/models/app_permissions_escaped_organization_escaped_custom_escaped_properties.go new file mode 100644 index 00000000..b6eaf515 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_custom_escaped_properties.go @@ -0,0 +1,37 @@ +package models +// The level of permission to grant the access token for custom property management. +type AppPermissions_organization_custom_properties int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_PROPERTIES AppPermissions_organization_custom_properties = iota + WRITE_APPPERMISSIONS_ORGANIZATION_CUSTOM_PROPERTIES + ADMIN_APPPERMISSIONS_ORGANIZATION_CUSTOM_PROPERTIES +) + +func (i AppPermissions_organization_custom_properties) String() string { + return []string{"read", "write", "admin"}[i] +} +func ParseAppPermissions_organization_custom_properties(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_PROPERTIES + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_PROPERTIES + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_CUSTOM_PROPERTIES + case "admin": + result = ADMIN_APPPERMISSIONS_ORGANIZATION_CUSTOM_PROPERTIES + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_custom_properties(values []AppPermissions_organization_custom_properties) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_custom_properties) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_custom_escaped_roles.go b/pkg/github/models/app_permissions_escaped_organization_escaped_custom_escaped_roles.go new file mode 100644 index 00000000..28216655 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_custom_escaped_roles.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for custom repository roles management. +type AppPermissions_organization_custom_roles int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_ROLES AppPermissions_organization_custom_roles = iota + WRITE_APPPERMISSIONS_ORGANIZATION_CUSTOM_ROLES +) + +func (i AppPermissions_organization_custom_roles) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_custom_roles(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_ROLES + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_CUSTOM_ROLES + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_CUSTOM_ROLES + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_custom_roles(values []AppPermissions_organization_custom_roles) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_custom_roles) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_events.go b/pkg/github/models/app_permissions_escaped_organization_escaped_events.go new file mode 100644 index 00000000..dc449104 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_events.go @@ -0,0 +1,31 @@ +package models +// The level of permission to grant the access token to view events triggered by an activity in an organization. +type AppPermissions_organization_events int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_EVENTS AppPermissions_organization_events = iota +) + +func (i AppPermissions_organization_events) String() string { + return []string{"read"}[i] +} +func ParseAppPermissions_organization_events(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_EVENTS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_EVENTS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_events(values []AppPermissions_organization_events) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_events) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_hooks.go b/pkg/github/models/app_permissions_escaped_organization_escaped_hooks.go new file mode 100644 index 00000000..98aaaf8d --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_hooks.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to manage the post-receive hooks for an organization. +type AppPermissions_organization_hooks int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_HOOKS AppPermissions_organization_hooks = iota + WRITE_APPPERMISSIONS_ORGANIZATION_HOOKS +) + +func (i AppPermissions_organization_hooks) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_hooks(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_HOOKS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_HOOKS + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_HOOKS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_hooks(values []AppPermissions_organization_hooks) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_hooks) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_packages.go b/pkg/github/models/app_permissions_escaped_organization_escaped_packages.go new file mode 100644 index 00000000..7462138c --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_packages.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for organization packages published to GitHub Packages. +type AppPermissions_organization_packages int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_PACKAGES AppPermissions_organization_packages = iota + WRITE_APPPERMISSIONS_ORGANIZATION_PACKAGES +) + +func (i AppPermissions_organization_packages) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_packages(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_PACKAGES + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_PACKAGES + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_PACKAGES + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_packages(values []AppPermissions_organization_packages) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_packages) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_personal_escaped_access_escaped_token_escaped_requests.go b/pkg/github/models/app_permissions_escaped_organization_escaped_personal_escaped_access_escaped_token_escaped_requests.go new file mode 100644 index 00000000..fd8ec7e7 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_personal_escaped_access_escaped_token_escaped_requests.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for viewing and managing fine-grained personal access tokens that have been approved by an organization. +type AppPermissions_organization_personal_access_token_requests int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKEN_REQUESTS AppPermissions_organization_personal_access_token_requests = iota + WRITE_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKEN_REQUESTS +) + +func (i AppPermissions_organization_personal_access_token_requests) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_personal_access_token_requests(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKEN_REQUESTS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKEN_REQUESTS + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKEN_REQUESTS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_personal_access_token_requests(values []AppPermissions_organization_personal_access_token_requests) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_personal_access_token_requests) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_personal_escaped_access_escaped_tokens.go b/pkg/github/models/app_permissions_escaped_organization_escaped_personal_escaped_access_escaped_tokens.go new file mode 100644 index 00000000..c0cd9ef7 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_personal_escaped_access_escaped_tokens.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for viewing and managing fine-grained personal access token requests to an organization. +type AppPermissions_organization_personal_access_tokens int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKENS AppPermissions_organization_personal_access_tokens = iota + WRITE_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKENS +) + +func (i AppPermissions_organization_personal_access_tokens) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_personal_access_tokens(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKENS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKENS + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_PERSONAL_ACCESS_TOKENS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_personal_access_tokens(values []AppPermissions_organization_personal_access_tokens) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_personal_access_tokens) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_plan.go b/pkg/github/models/app_permissions_escaped_organization_escaped_plan.go new file mode 100644 index 00000000..19292053 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_plan.go @@ -0,0 +1,31 @@ +package models +// The level of permission to grant the access token for viewing an organization's plan. +type AppPermissions_organization_plan int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_PLAN AppPermissions_organization_plan = iota +) + +func (i AppPermissions_organization_plan) String() string { + return []string{"read"}[i] +} +func ParseAppPermissions_organization_plan(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_PLAN + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_PLAN + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_plan(values []AppPermissions_organization_plan) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_plan) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_projects.go b/pkg/github/models/app_permissions_escaped_organization_escaped_projects.go new file mode 100644 index 00000000..17911c3d --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_projects.go @@ -0,0 +1,37 @@ +package models +// The level of permission to grant the access token to manage organization projects and projects beta (where available). +type AppPermissions_organization_projects int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_PROJECTS AppPermissions_organization_projects = iota + WRITE_APPPERMISSIONS_ORGANIZATION_PROJECTS + ADMIN_APPPERMISSIONS_ORGANIZATION_PROJECTS +) + +func (i AppPermissions_organization_projects) String() string { + return []string{"read", "write", "admin"}[i] +} +func ParseAppPermissions_organization_projects(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_PROJECTS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_PROJECTS + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_PROJECTS + case "admin": + result = ADMIN_APPPERMISSIONS_ORGANIZATION_PROJECTS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_projects(values []AppPermissions_organization_projects) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_projects) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_secrets.go b/pkg/github/models/app_permissions_escaped_organization_escaped_secrets.go new file mode 100644 index 00000000..6601cc7a --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_secrets.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to manage organization secrets. +type AppPermissions_organization_secrets int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_SECRETS AppPermissions_organization_secrets = iota + WRITE_APPPERMISSIONS_ORGANIZATION_SECRETS +) + +func (i AppPermissions_organization_secrets) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_secrets(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_SECRETS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_SECRETS + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_SECRETS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_secrets(values []AppPermissions_organization_secrets) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_secrets) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_self_escaped_hosted_escaped_runners.go b/pkg/github/models/app_permissions_escaped_organization_escaped_self_escaped_hosted_escaped_runners.go new file mode 100644 index 00000000..f284c91c --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_self_escaped_hosted_escaped_runners.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to view and manage GitHub Actions self-hosted runners available to an organization. +type AppPermissions_organization_self_hosted_runners int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_SELF_HOSTED_RUNNERS AppPermissions_organization_self_hosted_runners = iota + WRITE_APPPERMISSIONS_ORGANIZATION_SELF_HOSTED_RUNNERS +) + +func (i AppPermissions_organization_self_hosted_runners) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_self_hosted_runners(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_SELF_HOSTED_RUNNERS + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_SELF_HOSTED_RUNNERS + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_SELF_HOSTED_RUNNERS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_self_hosted_runners(values []AppPermissions_organization_self_hosted_runners) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_self_hosted_runners) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_organization_escaped_user_escaped_blocking.go b/pkg/github/models/app_permissions_escaped_organization_escaped_user_escaped_blocking.go new file mode 100644 index 00000000..24f1ba9e --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_organization_escaped_user_escaped_blocking.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to view and manage users blocked by the organization. +type AppPermissions_organization_user_blocking int + +const ( + READ_APPPERMISSIONS_ORGANIZATION_USER_BLOCKING AppPermissions_organization_user_blocking = iota + WRITE_APPPERMISSIONS_ORGANIZATION_USER_BLOCKING +) + +func (i AppPermissions_organization_user_blocking) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_organization_user_blocking(v string) (any, error) { + result := READ_APPPERMISSIONS_ORGANIZATION_USER_BLOCKING + switch v { + case "read": + result = READ_APPPERMISSIONS_ORGANIZATION_USER_BLOCKING + case "write": + result = WRITE_APPPERMISSIONS_ORGANIZATION_USER_BLOCKING + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_organization_user_blocking(values []AppPermissions_organization_user_blocking) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_organization_user_blocking) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_packages.go b/pkg/github/models/app_permissions_escaped_packages.go new file mode 100644 index 00000000..bea42378 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_packages.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for packages published to GitHub Packages. +type AppPermissions_packages int + +const ( + READ_APPPERMISSIONS_PACKAGES AppPermissions_packages = iota + WRITE_APPPERMISSIONS_PACKAGES +) + +func (i AppPermissions_packages) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_packages(v string) (any, error) { + result := READ_APPPERMISSIONS_PACKAGES + switch v { + case "read": + result = READ_APPPERMISSIONS_PACKAGES + case "write": + result = WRITE_APPPERMISSIONS_PACKAGES + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_packages(values []AppPermissions_packages) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_packages) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_pages.go b/pkg/github/models/app_permissions_escaped_pages.go new file mode 100644 index 00000000..2f25a1d3 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_pages.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to retrieve Pages statuses, configuration, and builds, as well as create new builds. +type AppPermissions_pages int + +const ( + READ_APPPERMISSIONS_PAGES AppPermissions_pages = iota + WRITE_APPPERMISSIONS_PAGES +) + +func (i AppPermissions_pages) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_pages(v string) (any, error) { + result := READ_APPPERMISSIONS_PAGES + switch v { + case "read": + result = READ_APPPERMISSIONS_PAGES + case "write": + result = WRITE_APPPERMISSIONS_PAGES + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_pages(values []AppPermissions_pages) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_pages) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_profile.go b/pkg/github/models/app_permissions_escaped_profile.go new file mode 100644 index 00000000..8e5e3193 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_profile.go @@ -0,0 +1,31 @@ +package models +// The level of permission to grant the access token to manage the profile settings belonging to a user. +type AppPermissions_profile int + +const ( + WRITE_APPPERMISSIONS_PROFILE AppPermissions_profile = iota +) + +func (i AppPermissions_profile) String() string { + return []string{"write"}[i] +} +func ParseAppPermissions_profile(v string) (any, error) { + result := WRITE_APPPERMISSIONS_PROFILE + switch v { + case "write": + result = WRITE_APPPERMISSIONS_PROFILE + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_profile(values []AppPermissions_profile) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_profile) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_pull_escaped_requests.go b/pkg/github/models/app_permissions_escaped_pull_escaped_requests.go new file mode 100644 index 00000000..1c36c0e2 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_pull_escaped_requests.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for pull requests and related comments, assignees, labels, milestones, and merges. +type AppPermissions_pull_requests int + +const ( + READ_APPPERMISSIONS_PULL_REQUESTS AppPermissions_pull_requests = iota + WRITE_APPPERMISSIONS_PULL_REQUESTS +) + +func (i AppPermissions_pull_requests) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_pull_requests(v string) (any, error) { + result := READ_APPPERMISSIONS_PULL_REQUESTS + switch v { + case "read": + result = READ_APPPERMISSIONS_PULL_REQUESTS + case "write": + result = WRITE_APPPERMISSIONS_PULL_REQUESTS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_pull_requests(values []AppPermissions_pull_requests) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_pull_requests) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_repository_escaped_custom_escaped_properties.go b/pkg/github/models/app_permissions_escaped_repository_escaped_custom_escaped_properties.go new file mode 100644 index 00000000..9a35f61f --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_repository_escaped_custom_escaped_properties.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to view and edit custom properties for a repository, when allowed by the property. +type AppPermissions_repository_custom_properties int + +const ( + READ_APPPERMISSIONS_REPOSITORY_CUSTOM_PROPERTIES AppPermissions_repository_custom_properties = iota + WRITE_APPPERMISSIONS_REPOSITORY_CUSTOM_PROPERTIES +) + +func (i AppPermissions_repository_custom_properties) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_repository_custom_properties(v string) (any, error) { + result := READ_APPPERMISSIONS_REPOSITORY_CUSTOM_PROPERTIES + switch v { + case "read": + result = READ_APPPERMISSIONS_REPOSITORY_CUSTOM_PROPERTIES + case "write": + result = WRITE_APPPERMISSIONS_REPOSITORY_CUSTOM_PROPERTIES + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_repository_custom_properties(values []AppPermissions_repository_custom_properties) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_repository_custom_properties) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_repository_escaped_hooks.go b/pkg/github/models/app_permissions_escaped_repository_escaped_hooks.go new file mode 100644 index 00000000..7ac98463 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_repository_escaped_hooks.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to manage the post-receive hooks for a repository. +type AppPermissions_repository_hooks int + +const ( + READ_APPPERMISSIONS_REPOSITORY_HOOKS AppPermissions_repository_hooks = iota + WRITE_APPPERMISSIONS_REPOSITORY_HOOKS +) + +func (i AppPermissions_repository_hooks) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_repository_hooks(v string) (any, error) { + result := READ_APPPERMISSIONS_REPOSITORY_HOOKS + switch v { + case "read": + result = READ_APPPERMISSIONS_REPOSITORY_HOOKS + case "write": + result = WRITE_APPPERMISSIONS_REPOSITORY_HOOKS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_repository_hooks(values []AppPermissions_repository_hooks) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_repository_hooks) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_repository_escaped_projects.go b/pkg/github/models/app_permissions_escaped_repository_escaped_projects.go new file mode 100644 index 00000000..54aa40f7 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_repository_escaped_projects.go @@ -0,0 +1,37 @@ +package models +// The level of permission to grant the access token to manage repository projects, columns, and cards. +type AppPermissions_repository_projects int + +const ( + READ_APPPERMISSIONS_REPOSITORY_PROJECTS AppPermissions_repository_projects = iota + WRITE_APPPERMISSIONS_REPOSITORY_PROJECTS + ADMIN_APPPERMISSIONS_REPOSITORY_PROJECTS +) + +func (i AppPermissions_repository_projects) String() string { + return []string{"read", "write", "admin"}[i] +} +func ParseAppPermissions_repository_projects(v string) (any, error) { + result := READ_APPPERMISSIONS_REPOSITORY_PROJECTS + switch v { + case "read": + result = READ_APPPERMISSIONS_REPOSITORY_PROJECTS + case "write": + result = WRITE_APPPERMISSIONS_REPOSITORY_PROJECTS + case "admin": + result = ADMIN_APPPERMISSIONS_REPOSITORY_PROJECTS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_repository_projects(values []AppPermissions_repository_projects) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_repository_projects) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_secret_escaped_scanning_escaped_alerts.go b/pkg/github/models/app_permissions_escaped_secret_escaped_scanning_escaped_alerts.go new file mode 100644 index 00000000..64434783 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_secret_escaped_scanning_escaped_alerts.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to view and manage secret scanning alerts. +type AppPermissions_secret_scanning_alerts int + +const ( + READ_APPPERMISSIONS_SECRET_SCANNING_ALERTS AppPermissions_secret_scanning_alerts = iota + WRITE_APPPERMISSIONS_SECRET_SCANNING_ALERTS +) + +func (i AppPermissions_secret_scanning_alerts) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_secret_scanning_alerts(v string) (any, error) { + result := READ_APPPERMISSIONS_SECRET_SCANNING_ALERTS + switch v { + case "read": + result = READ_APPPERMISSIONS_SECRET_SCANNING_ALERTS + case "write": + result = WRITE_APPPERMISSIONS_SECRET_SCANNING_ALERTS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_secret_scanning_alerts(values []AppPermissions_secret_scanning_alerts) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_secret_scanning_alerts) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_secrets.go b/pkg/github/models/app_permissions_escaped_secrets.go new file mode 100644 index 00000000..a2af1324 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_secrets.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to manage repository secrets. +type AppPermissions_secrets int + +const ( + READ_APPPERMISSIONS_SECRETS AppPermissions_secrets = iota + WRITE_APPPERMISSIONS_SECRETS +) + +func (i AppPermissions_secrets) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_secrets(v string) (any, error) { + result := READ_APPPERMISSIONS_SECRETS + switch v { + case "read": + result = READ_APPPERMISSIONS_SECRETS + case "write": + result = WRITE_APPPERMISSIONS_SECRETS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_secrets(values []AppPermissions_secrets) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_secrets) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_security_escaped_events.go b/pkg/github/models/app_permissions_escaped_security_escaped_events.go new file mode 100644 index 00000000..648cdc73 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_security_escaped_events.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to view and manage security events like code scanning alerts. +type AppPermissions_security_events int + +const ( + READ_APPPERMISSIONS_SECURITY_EVENTS AppPermissions_security_events = iota + WRITE_APPPERMISSIONS_SECURITY_EVENTS +) + +func (i AppPermissions_security_events) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_security_events(v string) (any, error) { + result := READ_APPPERMISSIONS_SECURITY_EVENTS + switch v { + case "read": + result = READ_APPPERMISSIONS_SECURITY_EVENTS + case "write": + result = WRITE_APPPERMISSIONS_SECURITY_EVENTS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_security_events(values []AppPermissions_security_events) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_security_events) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_single_escaped_file.go b/pkg/github/models/app_permissions_escaped_single_escaped_file.go new file mode 100644 index 00000000..33f3fcf2 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_single_escaped_file.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to manage just a single file. +type AppPermissions_single_file int + +const ( + READ_APPPERMISSIONS_SINGLE_FILE AppPermissions_single_file = iota + WRITE_APPPERMISSIONS_SINGLE_FILE +) + +func (i AppPermissions_single_file) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_single_file(v string) (any, error) { + result := READ_APPPERMISSIONS_SINGLE_FILE + switch v { + case "read": + result = READ_APPPERMISSIONS_SINGLE_FILE + case "write": + result = WRITE_APPPERMISSIONS_SINGLE_FILE + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_single_file(values []AppPermissions_single_file) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_single_file) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_starring.go b/pkg/github/models/app_permissions_escaped_starring.go new file mode 100644 index 00000000..d569783a --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_starring.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to list and manage repositories a user is starring. +type AppPermissions_starring int + +const ( + READ_APPPERMISSIONS_STARRING AppPermissions_starring = iota + WRITE_APPPERMISSIONS_STARRING +) + +func (i AppPermissions_starring) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_starring(v string) (any, error) { + result := READ_APPPERMISSIONS_STARRING + switch v { + case "read": + result = READ_APPPERMISSIONS_STARRING + case "write": + result = WRITE_APPPERMISSIONS_STARRING + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_starring(values []AppPermissions_starring) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_starring) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_statuses.go b/pkg/github/models/app_permissions_escaped_statuses.go new file mode 100644 index 00000000..dc4d8380 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_statuses.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token for commit statuses. +type AppPermissions_statuses int + +const ( + READ_APPPERMISSIONS_STATUSES AppPermissions_statuses = iota + WRITE_APPPERMISSIONS_STATUSES +) + +func (i AppPermissions_statuses) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_statuses(v string) (any, error) { + result := READ_APPPERMISSIONS_STATUSES + switch v { + case "read": + result = READ_APPPERMISSIONS_STATUSES + case "write": + result = WRITE_APPPERMISSIONS_STATUSES + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_statuses(values []AppPermissions_statuses) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_statuses) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_team_escaped_discussions.go b/pkg/github/models/app_permissions_escaped_team_escaped_discussions.go new file mode 100644 index 00000000..df47366c --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_team_escaped_discussions.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to manage team discussions and related comments. +type AppPermissions_team_discussions int + +const ( + READ_APPPERMISSIONS_TEAM_DISCUSSIONS AppPermissions_team_discussions = iota + WRITE_APPPERMISSIONS_TEAM_DISCUSSIONS +) + +func (i AppPermissions_team_discussions) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_team_discussions(v string) (any, error) { + result := READ_APPPERMISSIONS_TEAM_DISCUSSIONS + switch v { + case "read": + result = READ_APPPERMISSIONS_TEAM_DISCUSSIONS + case "write": + result = WRITE_APPPERMISSIONS_TEAM_DISCUSSIONS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_team_discussions(values []AppPermissions_team_discussions) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_team_discussions) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_vulnerability_escaped_alerts.go b/pkg/github/models/app_permissions_escaped_vulnerability_escaped_alerts.go new file mode 100644 index 00000000..aec932b2 --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_vulnerability_escaped_alerts.go @@ -0,0 +1,34 @@ +package models +// The level of permission to grant the access token to manage Dependabot alerts. +type AppPermissions_vulnerability_alerts int + +const ( + READ_APPPERMISSIONS_VULNERABILITY_ALERTS AppPermissions_vulnerability_alerts = iota + WRITE_APPPERMISSIONS_VULNERABILITY_ALERTS +) + +func (i AppPermissions_vulnerability_alerts) String() string { + return []string{"read", "write"}[i] +} +func ParseAppPermissions_vulnerability_alerts(v string) (any, error) { + result := READ_APPPERMISSIONS_VULNERABILITY_ALERTS + switch v { + case "read": + result = READ_APPPERMISSIONS_VULNERABILITY_ALERTS + case "write": + result = WRITE_APPPERMISSIONS_VULNERABILITY_ALERTS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_vulnerability_alerts(values []AppPermissions_vulnerability_alerts) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_vulnerability_alerts) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/app_permissions_escaped_workflows.go b/pkg/github/models/app_permissions_escaped_workflows.go new file mode 100644 index 00000000..eda68e3b --- /dev/null +++ b/pkg/github/models/app_permissions_escaped_workflows.go @@ -0,0 +1,31 @@ +package models +// The level of permission to grant the access token to update GitHub Actions workflow files. +type AppPermissions_workflows int + +const ( + WRITE_APPPERMISSIONS_WORKFLOWS AppPermissions_workflows = iota +) + +func (i AppPermissions_workflows) String() string { + return []string{"write"}[i] +} +func ParseAppPermissions_workflows(v string) (any, error) { + result := WRITE_APPPERMISSIONS_WORKFLOWS + switch v { + case "write": + result = WRITE_APPPERMISSIONS_WORKFLOWS + default: + return nil, nil + } + return &result, nil +} +func SerializeAppPermissions_workflows(values []AppPermissions_workflows) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AppPermissions_workflows) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/application_grant.go b/pkg/github/models/application_grant.go new file mode 100644 index 00000000..dff9f0c0 --- /dev/null +++ b/pkg/github/models/application_grant.go @@ -0,0 +1,262 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ApplicationGrant the authorization associated with an OAuth Access. +type ApplicationGrant 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 app property + app ApplicationGrant_appable + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The id property + id *int64 + // The scopes property + scopes []string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewApplicationGrant instantiates a new ApplicationGrant and sets the default values. +func NewApplicationGrant()(*ApplicationGrant) { + m := &ApplicationGrant{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApplicationGrantFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApplicationGrantFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApplicationGrant(), 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 *ApplicationGrant) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApp gets the app property value. The app property +// returns a ApplicationGrant_appable when successful +func (m *ApplicationGrant) GetApp()(ApplicationGrant_appable) { + return m.app +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *ApplicationGrant) 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 *ApplicationGrant) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateApplicationGrant_appFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetApp(val.(ApplicationGrant_appable)) + } + return nil + } + 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["scopes"] = 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.SetScopes(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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *ApplicationGrant) GetId()(*int64) { + return m.id +} +// GetScopes gets the scopes property value. The scopes property +// returns a []string when successful +func (m *ApplicationGrant) GetScopes()([]string) { + return m.scopes +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *ApplicationGrant) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ApplicationGrant) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *ApplicationGrant) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *ApplicationGrant) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("app", m.GetApp()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + if m.GetScopes() != nil { + err := writer.WriteCollectionOfStringValues("scopes", m.GetScopes()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *ApplicationGrant) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApp sets the app property value. The app property +func (m *ApplicationGrant) SetApp(value ApplicationGrant_appable)() { + m.app = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ApplicationGrant) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *ApplicationGrant) SetId(value *int64)() { + m.id = value +} +// SetScopes sets the scopes property value. The scopes property +func (m *ApplicationGrant) SetScopes(value []string)() { + m.scopes = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *ApplicationGrant) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *ApplicationGrant) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *ApplicationGrant) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type ApplicationGrantable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApp()(ApplicationGrant_appable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int64) + GetScopes()([]string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetApp(value ApplicationGrant_appable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int64)() + SetScopes(value []string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/application_grant_escaped_app.go b/pkg/github/models/application_grant_escaped_app.go new file mode 100644 index 00000000..2ddc9a51 --- /dev/null +++ b/pkg/github/models/application_grant_escaped_app.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ApplicationGrant_app 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 client_id property + client_id *string + // The name property + name *string + // The url property + url *string +} +// NewApplicationGrant_app instantiates a new ApplicationGrant_app and sets the default values. +func NewApplicationGrant_app()(*ApplicationGrant_app) { + m := &ApplicationGrant_app{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApplicationGrant_appFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApplicationGrant_appFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApplicationGrant_app(), 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 *ApplicationGrant_app) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientId gets the client_id property value. The client_id property +// returns a *string when successful +func (m *ApplicationGrant_app) GetClientId()(*string) { + return m.client_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ApplicationGrant_app) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientId(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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *ApplicationGrant_app) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ApplicationGrant_app) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ApplicationGrant_app) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_id", m.GetClientId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ApplicationGrant_app) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientId sets the client_id property value. The client_id property +func (m *ApplicationGrant_app) SetClientId(value *string)() { + m.client_id = value +} +// SetName sets the name property value. The name property +func (m *ApplicationGrant_app) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *ApplicationGrant_app) SetUrl(value *string)() { + m.url = value +} +type ApplicationGrant_appable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientId()(*string) + GetName()(*string) + GetUrl()(*string) + SetClientId(value *string)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/artifact.go b/pkg/github/models/artifact.go new file mode 100644 index 00000000..ef53f106 --- /dev/null +++ b/pkg/github/models/artifact.go @@ -0,0 +1,372 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Artifact an artifact +type Artifact 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 archive_download_url property + archive_download_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Whether or not the artifact has expired. + expired *bool + // The expires_at property + expires_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The id property + id *int32 + // The name of the artifact. + name *string + // The node_id property + node_id *string + // The size in bytes of the artifact. + size_in_bytes *int32 + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The workflow_run property + workflow_run Artifact_workflow_runable +} +// NewArtifact instantiates a new Artifact and sets the default values. +func NewArtifact()(*Artifact) { + m := &Artifact{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateArtifactFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateArtifactFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewArtifact(), 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 *Artifact) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchiveDownloadUrl gets the archive_download_url property value. The archive_download_url property +// returns a *string when successful +func (m *Artifact) GetArchiveDownloadUrl()(*string) { + return m.archive_download_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Artifact) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetExpired gets the expired property value. Whether or not the artifact has expired. +// returns a *bool when successful +func (m *Artifact) GetExpired()(*bool) { + return m.expired +} +// GetExpiresAt gets the expires_at property value. The expires_at property +// returns a *Time when successful +func (m *Artifact) GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Artifact) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["archive_download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveDownloadUrl(val) + } + return nil + } + 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["expired"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExpired(val) + } + return nil + } + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["size_in_bytes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSizeInBytes(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["workflow_run"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateArtifact_workflow_runFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetWorkflowRun(val.(Artifact_workflow_runable)) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Artifact) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the artifact. +// returns a *string when successful +func (m *Artifact) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Artifact) GetNodeId()(*string) { + return m.node_id +} +// GetSizeInBytes gets the size_in_bytes property value. The size in bytes of the artifact. +// returns a *int32 when successful +func (m *Artifact) GetSizeInBytes()(*int32) { + return m.size_in_bytes +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Artifact) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Artifact) GetUrl()(*string) { + return m.url +} +// GetWorkflowRun gets the workflow_run property value. The workflow_run property +// returns a Artifact_workflow_runable when successful +func (m *Artifact) GetWorkflowRun()(Artifact_workflow_runable) { + return m.workflow_run +} +// Serialize serializes information the current object +func (m *Artifact) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("archive_download_url", m.GetArchiveDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("expired", m.GetExpired()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size_in_bytes", m.GetSizeInBytes()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("workflow_run", m.GetWorkflowRun()) + 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 *Artifact) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchiveDownloadUrl sets the archive_download_url property value. The archive_download_url property +func (m *Artifact) SetArchiveDownloadUrl(value *string)() { + m.archive_download_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Artifact) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetExpired sets the expired property value. Whether or not the artifact has expired. +func (m *Artifact) SetExpired(value *bool)() { + m.expired = value +} +// SetExpiresAt sets the expires_at property value. The expires_at property +func (m *Artifact) SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.expires_at = value +} +// SetId sets the id property value. The id property +func (m *Artifact) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the artifact. +func (m *Artifact) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Artifact) SetNodeId(value *string)() { + m.node_id = value +} +// SetSizeInBytes sets the size_in_bytes property value. The size in bytes of the artifact. +func (m *Artifact) SetSizeInBytes(value *int32)() { + m.size_in_bytes = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Artifact) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Artifact) SetUrl(value *string)() { + m.url = value +} +// SetWorkflowRun sets the workflow_run property value. The workflow_run property +func (m *Artifact) SetWorkflowRun(value Artifact_workflow_runable)() { + m.workflow_run = value +} +type Artifactable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchiveDownloadUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetExpired()(*bool) + GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetSizeInBytes()(*int32) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetWorkflowRun()(Artifact_workflow_runable) + SetArchiveDownloadUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetExpired(value *bool)() + SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetSizeInBytes(value *int32)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetWorkflowRun(value Artifact_workflow_runable)() +} diff --git a/pkg/github/models/artifact_escaped_workflow_escaped_run.go b/pkg/github/models/artifact_escaped_workflow_escaped_run.go new file mode 100644 index 00000000..8ab9b147 --- /dev/null +++ b/pkg/github/models/artifact_escaped_workflow_escaped_run.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Artifact_workflow_run 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 head_branch property + head_branch *string + // The head_repository_id property + head_repository_id *int32 + // The head_sha property + head_sha *string + // The id property + id *int32 + // The repository_id property + repository_id *int32 +} +// NewArtifact_workflow_run instantiates a new Artifact_workflow_run and sets the default values. +func NewArtifact_workflow_run()(*Artifact_workflow_run) { + m := &Artifact_workflow_run{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateArtifact_workflow_runFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateArtifact_workflow_runFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewArtifact_workflow_run(), 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 *Artifact_workflow_run) 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 *Artifact_workflow_run) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["head_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadBranch(val) + } + return nil + } + res["head_repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetHeadRepositoryId(val) + } + return nil + } + res["head_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadSha(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + return res +} +// GetHeadBranch gets the head_branch property value. The head_branch property +// returns a *string when successful +func (m *Artifact_workflow_run) GetHeadBranch()(*string) { + return m.head_branch +} +// GetHeadRepositoryId gets the head_repository_id property value. The head_repository_id property +// returns a *int32 when successful +func (m *Artifact_workflow_run) GetHeadRepositoryId()(*int32) { + return m.head_repository_id +} +// GetHeadSha gets the head_sha property value. The head_sha property +// returns a *string when successful +func (m *Artifact_workflow_run) GetHeadSha()(*string) { + return m.head_sha +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Artifact_workflow_run) GetId()(*int32) { + return m.id +} +// GetRepositoryId gets the repository_id property value. The repository_id property +// returns a *int32 when successful +func (m *Artifact_workflow_run) GetRepositoryId()(*int32) { + return m.repository_id +} +// Serialize serializes information the current object +func (m *Artifact_workflow_run) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("head_branch", m.GetHeadBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("head_repository_id", m.GetHeadRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_sha", m.GetHeadSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + 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 *Artifact_workflow_run) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHeadBranch sets the head_branch property value. The head_branch property +func (m *Artifact_workflow_run) SetHeadBranch(value *string)() { + m.head_branch = value +} +// SetHeadRepositoryId sets the head_repository_id property value. The head_repository_id property +func (m *Artifact_workflow_run) SetHeadRepositoryId(value *int32)() { + m.head_repository_id = value +} +// SetHeadSha sets the head_sha property value. The head_sha property +func (m *Artifact_workflow_run) SetHeadSha(value *string)() { + m.head_sha = value +} +// SetId sets the id property value. The id property +func (m *Artifact_workflow_run) SetId(value *int32)() { + m.id = value +} +// SetRepositoryId sets the repository_id property value. The repository_id property +func (m *Artifact_workflow_run) SetRepositoryId(value *int32)() { + m.repository_id = value +} +type Artifact_workflow_runable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHeadBranch()(*string) + GetHeadRepositoryId()(*int32) + GetHeadSha()(*string) + GetId()(*int32) + GetRepositoryId()(*int32) + SetHeadBranch(value *string)() + SetHeadRepositoryId(value *int32)() + SetHeadSha(value *string)() + SetId(value *int32)() + SetRepositoryId(value *int32)() +} diff --git a/pkg/github/models/assigned_issue_event.go b/pkg/github/models/assigned_issue_event.go new file mode 100644 index 00000000..dfa25457 --- /dev/null +++ b/pkg/github/models/assigned_issue_event.go @@ -0,0 +1,371 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// AssignedIssueEvent assigned Issue Event +type AssignedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee SimpleUserable + // A GitHub user. + assigner SimpleUserable + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app Integrationable + // The url property + url *string +} +// NewAssignedIssueEvent instantiates a new AssignedIssueEvent and sets the default values. +func NewAssignedIssueEvent()(*AssignedIssueEvent) { + m := &AssignedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAssignedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAssignedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAssignedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *AssignedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *AssignedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *AssignedIssueEvent) GetAssignee()(SimpleUserable) { + return m.assignee +} +// GetAssigner gets the assigner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *AssignedIssueEvent) GetAssigner()(SimpleUserable) { + return m.assigner +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *AssignedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *AssignedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *AssignedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *AssignedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AssignedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(SimpleUserable)) + } + return nil + } + res["assigner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssigner(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(Integrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *AssignedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *AssignedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a Integrationable when successful +func (m *AssignedIssueEvent) GetPerformedViaGithubApp()(Integrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *AssignedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *AssignedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assigner", m.GetAssigner()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *AssignedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *AssignedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *AssignedIssueEvent) SetAssignee(value SimpleUserable)() { + m.assignee = value +} +// SetAssigner sets the assigner property value. A GitHub user. +func (m *AssignedIssueEvent) SetAssigner(value SimpleUserable)() { + m.assigner = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *AssignedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *AssignedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *AssignedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *AssignedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *AssignedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *AssignedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *AssignedIssueEvent) SetPerformedViaGithubApp(value Integrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *AssignedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type AssignedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetAssignee()(SimpleUserable) + GetAssigner()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(Integrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetAssignee(value SimpleUserable)() + SetAssigner(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value Integrationable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/audit_log_event.go b/pkg/github/models/audit_log_event.go new file mode 100644 index 00000000..452f4835 --- /dev/null +++ b/pkg/github/models/audit_log_event.go @@ -0,0 +1,1346 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AuditLogEvent struct { + // A unique identifier for an audit event. + _document_id *string + // The name of the action that was performed, for example `user.login` or `repo.create`. + action *string + // The active property + active *bool + // The active_was property + active_was *bool + // The actor who performed the action. + actor *string + // The id of the actor who performed the action. + actor_id *int32 + // The actor_location property + actor_location AuditLogEvent_actor_locationable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The username of the account being blocked. + blocked_user *string + // The business property + business *string + // The business_id property + business_id *int32 + // The config property + config []AuditLogEvent_configable + // The config_was property + config_was []AuditLogEvent_config_wasable + // The content_type property + content_type *string + // The time the audit log event was recorded, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). + created_at *int32 + // The data property + data AuditLogEvent_dataable + // The deploy_key_fingerprint property + deploy_key_fingerprint *string + // The emoji property + emoji *string + // The events property + events []AuditLogEvent_eventsable + // The events_were property + events_were []AuditLogEvent_events_wereable + // The explanation property + explanation *string + // The fingerprint property + fingerprint *string + // The hook_id property + hook_id *int32 + // The limited_availability property + limited_availability *bool + // The message property + message *string + // The name property + name *string + // The old_user property + old_user *string + // The openssh_public_key property + openssh_public_key *string + // The operation_type property + operation_type *string + // The org property + org *string + // The org_id property + org_id *int32 + // The previous_visibility property + previous_visibility *string + // The read_only property + read_only *bool + // The name of the repository. + repo *string + // The name of the repository. + repository *string + // The repository_public property + repository_public *bool + // The target_login property + target_login *string + // The team property + team *string + // The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). + timestamp *int32 + // The type of protocol (for example, HTTP or SSH) used to transfer Git data. + transport_protocol *int32 + // A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. + transport_protocol_name *string + // The user that was affected by the action performed (if available). + user *string + // The user_id property + user_id *int32 + // The repository visibility, for example `public` or `private`. + visibility *string +} +// NewAuditLogEvent instantiates a new AuditLogEvent and sets the default values. +func NewAuditLogEvent()(*AuditLogEvent) { + m := &AuditLogEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuditLogEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuditLogEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuditLogEvent(), nil +} +// GetAction gets the action property value. The name of the action that was performed, for example `user.login` or `repo.create`. +// returns a *string when successful +func (m *AuditLogEvent) GetAction()(*string) { + return m.action +} +// GetActive gets the active property value. The active property +// returns a *bool when successful +func (m *AuditLogEvent) GetActive()(*bool) { + return m.active +} +// GetActiveWas gets the active_was property value. The active_was property +// returns a *bool when successful +func (m *AuditLogEvent) GetActiveWas()(*bool) { + return m.active_was +} +// GetActor gets the actor property value. The actor who performed the action. +// returns a *string when successful +func (m *AuditLogEvent) GetActor()(*string) { + return m.actor +} +// GetActorId gets the actor_id property value. The id of the actor who performed the action. +// returns a *int32 when successful +func (m *AuditLogEvent) GetActorId()(*int32) { + return m.actor_id +} +// GetActorLocation gets the actor_location property value. The actor_location property +// returns a AuditLogEvent_actor_locationable when successful +func (m *AuditLogEvent) GetActorLocation()(AuditLogEvent_actor_locationable) { + return m.actor_location +} +// 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 *AuditLogEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBlockedUser gets the blocked_user property value. The username of the account being blocked. +// returns a *string when successful +func (m *AuditLogEvent) GetBlockedUser()(*string) { + return m.blocked_user +} +// GetBusiness gets the business property value. The business property +// returns a *string when successful +func (m *AuditLogEvent) GetBusiness()(*string) { + return m.business +} +// GetBusinessId gets the business_id property value. The business_id property +// returns a *int32 when successful +func (m *AuditLogEvent) GetBusinessId()(*int32) { + return m.business_id +} +// GetConfig gets the config property value. The config property +// returns a []AuditLogEvent_configable when successful +func (m *AuditLogEvent) GetConfig()([]AuditLogEvent_configable) { + return m.config +} +// GetConfigWas gets the config_was property value. The config_was property +// returns a []AuditLogEvent_config_wasable when successful +func (m *AuditLogEvent) GetConfigWas()([]AuditLogEvent_config_wasable) { + return m.config_was +} +// GetContentType gets the content_type property value. The content_type property +// returns a *string when successful +func (m *AuditLogEvent) GetContentType()(*string) { + return m.content_type +} +// GetCreatedAt gets the created_at property value. The time the audit log event was recorded, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). +// returns a *int32 when successful +func (m *AuditLogEvent) GetCreatedAt()(*int32) { + return m.created_at +} +// GetData gets the data property value. The data property +// returns a AuditLogEvent_dataable when successful +func (m *AuditLogEvent) GetData()(AuditLogEvent_dataable) { + return m.data +} +// GetDeployKeyFingerprint gets the deploy_key_fingerprint property value. The deploy_key_fingerprint property +// returns a *string when successful +func (m *AuditLogEvent) GetDeployKeyFingerprint()(*string) { + return m.deploy_key_fingerprint +} +// GetDocumentId gets the _document_id property value. A unique identifier for an audit event. +// returns a *string when successful +func (m *AuditLogEvent) GetDocumentId()(*string) { + return m._document_id +} +// GetEmoji gets the emoji property value. The emoji property +// returns a *string when successful +func (m *AuditLogEvent) GetEmoji()(*string) { + return m.emoji +} +// GetEvents gets the events property value. The events property +// returns a []AuditLogEvent_eventsable when successful +func (m *AuditLogEvent) GetEvents()([]AuditLogEvent_eventsable) { + return m.events +} +// GetEventsWere gets the events_were property value. The events_were property +// returns a []AuditLogEvent_events_wereable when successful +func (m *AuditLogEvent) GetEventsWere()([]AuditLogEvent_events_wereable) { + return m.events_were +} +// GetExplanation gets the explanation property value. The explanation property +// returns a *string when successful +func (m *AuditLogEvent) GetExplanation()(*string) { + return m.explanation +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AuditLogEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_document_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentId(val) + } + return nil + } + res["action"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAction(val) + } + return nil + } + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["active_was"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActiveWas(val) + } + return nil + } + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActor(val) + } + return nil + } + res["actor_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActorId(val) + } + return nil + } + res["actor_location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAuditLogEvent_actor_locationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActorLocation(val.(AuditLogEvent_actor_locationable)) + } + return nil + } + res["blocked_user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlockedUser(val) + } + return nil + } + res["business"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBusiness(val) + } + return nil + } + res["business_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetBusinessId(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateAuditLogEvent_configFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]AuditLogEvent_configable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(AuditLogEvent_configable) + } + } + m.SetConfig(res) + } + return nil + } + res["config_was"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateAuditLogEvent_config_wasFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]AuditLogEvent_config_wasable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(AuditLogEvent_config_wasable) + } + } + m.SetConfigWas(res) + } + return nil + } + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["data"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAuditLogEvent_dataFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetData(val.(AuditLogEvent_dataable)) + } + return nil + } + res["deploy_key_fingerprint"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeployKeyFingerprint(val) + } + return nil + } + res["emoji"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmoji(val) + } + return nil + } + res["events"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateAuditLogEvent_eventsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]AuditLogEvent_eventsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(AuditLogEvent_eventsable) + } + } + m.SetEvents(res) + } + return nil + } + res["events_were"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateAuditLogEvent_events_wereFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]AuditLogEvent_events_wereable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(AuditLogEvent_events_wereable) + } + } + m.SetEventsWere(res) + } + return nil + } + res["explanation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExplanation(val) + } + return nil + } + res["fingerprint"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFingerprint(val) + } + return nil + } + res["hook_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetHookId(val) + } + return nil + } + res["limited_availability"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLimitedAvailability(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 + } + 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["old_user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOldUser(val) + } + return nil + } + res["openssh_public_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOpensshPublicKey(val) + } + return nil + } + res["operation_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOperationType(val) + } + return nil + } + res["org"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrg(val) + } + return nil + } + res["org_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOrgId(val) + } + return nil + } + res["previous_visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousVisibility(val) + } + return nil + } + res["read_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetReadOnly(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepo(val) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepository(val) + } + return nil + } + res["repository_public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryPublic(val) + } + return nil + } + res["target_login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetLogin(val) + } + return nil + } + res["team"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeam(val) + } + return nil + } + res["@timestamp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTimestamp(val) + } + return nil + } + res["transport_protocol"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTransportProtocol(val) + } + return nil + } + res["transport_protocol_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTransportProtocolName(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUser(val) + } + return nil + } + res["user_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUserId(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + return res +} +// GetFingerprint gets the fingerprint property value. The fingerprint property +// returns a *string when successful +func (m *AuditLogEvent) GetFingerprint()(*string) { + return m.fingerprint +} +// GetHookId gets the hook_id property value. The hook_id property +// returns a *int32 when successful +func (m *AuditLogEvent) GetHookId()(*int32) { + return m.hook_id +} +// GetLimitedAvailability gets the limited_availability property value. The limited_availability property +// returns a *bool when successful +func (m *AuditLogEvent) GetLimitedAvailability()(*bool) { + return m.limited_availability +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *AuditLogEvent) GetMessage()(*string) { + return m.message +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *AuditLogEvent) GetName()(*string) { + return m.name +} +// GetOldUser gets the old_user property value. The old_user property +// returns a *string when successful +func (m *AuditLogEvent) GetOldUser()(*string) { + return m.old_user +} +// GetOpensshPublicKey gets the openssh_public_key property value. The openssh_public_key property +// returns a *string when successful +func (m *AuditLogEvent) GetOpensshPublicKey()(*string) { + return m.openssh_public_key +} +// GetOperationType gets the operation_type property value. The operation_type property +// returns a *string when successful +func (m *AuditLogEvent) GetOperationType()(*string) { + return m.operation_type +} +// GetOrg gets the org property value. The org property +// returns a *string when successful +func (m *AuditLogEvent) GetOrg()(*string) { + return m.org +} +// GetOrgId gets the org_id property value. The org_id property +// returns a *int32 when successful +func (m *AuditLogEvent) GetOrgId()(*int32) { + return m.org_id +} +// GetPreviousVisibility gets the previous_visibility property value. The previous_visibility property +// returns a *string when successful +func (m *AuditLogEvent) GetPreviousVisibility()(*string) { + return m.previous_visibility +} +// GetReadOnly gets the read_only property value. The read_only property +// returns a *bool when successful +func (m *AuditLogEvent) GetReadOnly()(*bool) { + return m.read_only +} +// GetRepo gets the repo property value. The name of the repository. +// returns a *string when successful +func (m *AuditLogEvent) GetRepo()(*string) { + return m.repo +} +// GetRepository gets the repository property value. The name of the repository. +// returns a *string when successful +func (m *AuditLogEvent) GetRepository()(*string) { + return m.repository +} +// GetRepositoryPublic gets the repository_public property value. The repository_public property +// returns a *bool when successful +func (m *AuditLogEvent) GetRepositoryPublic()(*bool) { + return m.repository_public +} +// GetTargetLogin gets the target_login property value. The target_login property +// returns a *string when successful +func (m *AuditLogEvent) GetTargetLogin()(*string) { + return m.target_login +} +// GetTeam gets the team property value. The team property +// returns a *string when successful +func (m *AuditLogEvent) GetTeam()(*string) { + return m.team +} +// GetTimestamp gets the @timestamp property value. The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). +// returns a *int32 when successful +func (m *AuditLogEvent) GetTimestamp()(*int32) { + return m.timestamp +} +// GetTransportProtocol gets the transport_protocol property value. The type of protocol (for example, HTTP or SSH) used to transfer Git data. +// returns a *int32 when successful +func (m *AuditLogEvent) GetTransportProtocol()(*int32) { + return m.transport_protocol +} +// GetTransportProtocolName gets the transport_protocol_name property value. A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. +// returns a *string when successful +func (m *AuditLogEvent) GetTransportProtocolName()(*string) { + return m.transport_protocol_name +} +// GetUser gets the user property value. The user that was affected by the action performed (if available). +// returns a *string when successful +func (m *AuditLogEvent) GetUser()(*string) { + return m.user +} +// GetUserId gets the user_id property value. The user_id property +// returns a *int32 when successful +func (m *AuditLogEvent) GetUserId()(*int32) { + return m.user_id +} +// GetVisibility gets the visibility property value. The repository visibility, for example `public` or `private`. +// returns a *string when successful +func (m *AuditLogEvent) GetVisibility()(*string) { + return m.visibility +} +// Serialize serializes information the current object +func (m *AuditLogEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("action", m.GetAction()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("active_was", m.GetActiveWas()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("actor_id", m.GetActorId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("actor_location", m.GetActorLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blocked_user", m.GetBlockedUser()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("business", m.GetBusiness()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("business_id", m.GetBusinessId()) + if err != nil { + return err + } + } + if m.GetConfig() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetConfig())) + for i, v := range m.GetConfig() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("config", cast) + if err != nil { + return err + } + } + if m.GetConfigWas() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetConfigWas())) + for i, v := range m.GetConfigWas() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("config_was", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("data", m.GetData()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deploy_key_fingerprint", m.GetDeployKeyFingerprint()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("emoji", m.GetEmoji()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetEvents())) + for i, v := range m.GetEvents() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("events", cast) + if err != nil { + return err + } + } + if m.GetEventsWere() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetEventsWere())) + for i, v := range m.GetEventsWere() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("events_were", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("explanation", m.GetExplanation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("fingerprint", m.GetFingerprint()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("hook_id", m.GetHookId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("limited_availability", m.GetLimitedAvailability()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("old_user", m.GetOldUser()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("openssh_public_key", m.GetOpensshPublicKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("operation_type", m.GetOperationType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("org", m.GetOrg()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("org_id", m.GetOrgId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_visibility", m.GetPreviousVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("read_only", m.GetReadOnly()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("repository_public", m.GetRepositoryPublic()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_login", m.GetTargetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("team", m.GetTeam()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("@timestamp", m.GetTimestamp()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("transport_protocol", m.GetTransportProtocol()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("transport_protocol_name", m.GetTransportProtocolName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("user_id", m.GetUserId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("_document_id", m.GetDocumentId()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAction sets the action property value. The name of the action that was performed, for example `user.login` or `repo.create`. +func (m *AuditLogEvent) SetAction(value *string)() { + m.action = value +} +// SetActive sets the active property value. The active property +func (m *AuditLogEvent) SetActive(value *bool)() { + m.active = value +} +// SetActiveWas sets the active_was property value. The active_was property +func (m *AuditLogEvent) SetActiveWas(value *bool)() { + m.active_was = value +} +// SetActor sets the actor property value. The actor who performed the action. +func (m *AuditLogEvent) SetActor(value *string)() { + m.actor = value +} +// SetActorId sets the actor_id property value. The id of the actor who performed the action. +func (m *AuditLogEvent) SetActorId(value *int32)() { + m.actor_id = value +} +// SetActorLocation sets the actor_location property value. The actor_location property +func (m *AuditLogEvent) SetActorLocation(value AuditLogEvent_actor_locationable)() { + m.actor_location = 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 *AuditLogEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBlockedUser sets the blocked_user property value. The username of the account being blocked. +func (m *AuditLogEvent) SetBlockedUser(value *string)() { + m.blocked_user = value +} +// SetBusiness sets the business property value. The business property +func (m *AuditLogEvent) SetBusiness(value *string)() { + m.business = value +} +// SetBusinessId sets the business_id property value. The business_id property +func (m *AuditLogEvent) SetBusinessId(value *int32)() { + m.business_id = value +} +// SetConfig sets the config property value. The config property +func (m *AuditLogEvent) SetConfig(value []AuditLogEvent_configable)() { + m.config = value +} +// SetConfigWas sets the config_was property value. The config_was property +func (m *AuditLogEvent) SetConfigWas(value []AuditLogEvent_config_wasable)() { + m.config_was = value +} +// SetContentType sets the content_type property value. The content_type property +func (m *AuditLogEvent) SetContentType(value *string)() { + m.content_type = value +} +// SetCreatedAt sets the created_at property value. The time the audit log event was recorded, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). +func (m *AuditLogEvent) SetCreatedAt(value *int32)() { + m.created_at = value +} +// SetData sets the data property value. The data property +func (m *AuditLogEvent) SetData(value AuditLogEvent_dataable)() { + m.data = value +} +// SetDeployKeyFingerprint sets the deploy_key_fingerprint property value. The deploy_key_fingerprint property +func (m *AuditLogEvent) SetDeployKeyFingerprint(value *string)() { + m.deploy_key_fingerprint = value +} +// SetDocumentId sets the _document_id property value. A unique identifier for an audit event. +func (m *AuditLogEvent) SetDocumentId(value *string)() { + m._document_id = value +} +// SetEmoji sets the emoji property value. The emoji property +func (m *AuditLogEvent) SetEmoji(value *string)() { + m.emoji = value +} +// SetEvents sets the events property value. The events property +func (m *AuditLogEvent) SetEvents(value []AuditLogEvent_eventsable)() { + m.events = value +} +// SetEventsWere sets the events_were property value. The events_were property +func (m *AuditLogEvent) SetEventsWere(value []AuditLogEvent_events_wereable)() { + m.events_were = value +} +// SetExplanation sets the explanation property value. The explanation property +func (m *AuditLogEvent) SetExplanation(value *string)() { + m.explanation = value +} +// SetFingerprint sets the fingerprint property value. The fingerprint property +func (m *AuditLogEvent) SetFingerprint(value *string)() { + m.fingerprint = value +} +// SetHookId sets the hook_id property value. The hook_id property +func (m *AuditLogEvent) SetHookId(value *int32)() { + m.hook_id = value +} +// SetLimitedAvailability sets the limited_availability property value. The limited_availability property +func (m *AuditLogEvent) SetLimitedAvailability(value *bool)() { + m.limited_availability = value +} +// SetMessage sets the message property value. The message property +func (m *AuditLogEvent) SetMessage(value *string)() { + m.message = value +} +// SetName sets the name property value. The name property +func (m *AuditLogEvent) SetName(value *string)() { + m.name = value +} +// SetOldUser sets the old_user property value. The old_user property +func (m *AuditLogEvent) SetOldUser(value *string)() { + m.old_user = value +} +// SetOpensshPublicKey sets the openssh_public_key property value. The openssh_public_key property +func (m *AuditLogEvent) SetOpensshPublicKey(value *string)() { + m.openssh_public_key = value +} +// SetOperationType sets the operation_type property value. The operation_type property +func (m *AuditLogEvent) SetOperationType(value *string)() { + m.operation_type = value +} +// SetOrg sets the org property value. The org property +func (m *AuditLogEvent) SetOrg(value *string)() { + m.org = value +} +// SetOrgId sets the org_id property value. The org_id property +func (m *AuditLogEvent) SetOrgId(value *int32)() { + m.org_id = value +} +// SetPreviousVisibility sets the previous_visibility property value. The previous_visibility property +func (m *AuditLogEvent) SetPreviousVisibility(value *string)() { + m.previous_visibility = value +} +// SetReadOnly sets the read_only property value. The read_only property +func (m *AuditLogEvent) SetReadOnly(value *bool)() { + m.read_only = value +} +// SetRepo sets the repo property value. The name of the repository. +func (m *AuditLogEvent) SetRepo(value *string)() { + m.repo = value +} +// SetRepository sets the repository property value. The name of the repository. +func (m *AuditLogEvent) SetRepository(value *string)() { + m.repository = value +} +// SetRepositoryPublic sets the repository_public property value. The repository_public property +func (m *AuditLogEvent) SetRepositoryPublic(value *bool)() { + m.repository_public = value +} +// SetTargetLogin sets the target_login property value. The target_login property +func (m *AuditLogEvent) SetTargetLogin(value *string)() { + m.target_login = value +} +// SetTeam sets the team property value. The team property +func (m *AuditLogEvent) SetTeam(value *string)() { + m.team = value +} +// SetTimestamp sets the @timestamp property value. The time the audit log event occurred, given as a [Unix timestamp](http://en.wikipedia.org/wiki/Unix_time). +func (m *AuditLogEvent) SetTimestamp(value *int32)() { + m.timestamp = value +} +// SetTransportProtocol sets the transport_protocol property value. The type of protocol (for example, HTTP or SSH) used to transfer Git data. +func (m *AuditLogEvent) SetTransportProtocol(value *int32)() { + m.transport_protocol = value +} +// SetTransportProtocolName sets the transport_protocol_name property value. A human readable name for the protocol (for example, HTTP or SSH) used to transfer Git data. +func (m *AuditLogEvent) SetTransportProtocolName(value *string)() { + m.transport_protocol_name = value +} +// SetUser sets the user property value. The user that was affected by the action performed (if available). +func (m *AuditLogEvent) SetUser(value *string)() { + m.user = value +} +// SetUserId sets the user_id property value. The user_id property +func (m *AuditLogEvent) SetUserId(value *int32)() { + m.user_id = value +} +// SetVisibility sets the visibility property value. The repository visibility, for example `public` or `private`. +func (m *AuditLogEvent) SetVisibility(value *string)() { + m.visibility = value +} +type AuditLogEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAction()(*string) + GetActive()(*bool) + GetActiveWas()(*bool) + GetActor()(*string) + GetActorId()(*int32) + GetActorLocation()(AuditLogEvent_actor_locationable) + GetBlockedUser()(*string) + GetBusiness()(*string) + GetBusinessId()(*int32) + GetConfig()([]AuditLogEvent_configable) + GetConfigWas()([]AuditLogEvent_config_wasable) + GetContentType()(*string) + GetCreatedAt()(*int32) + GetData()(AuditLogEvent_dataable) + GetDeployKeyFingerprint()(*string) + GetDocumentId()(*string) + GetEmoji()(*string) + GetEvents()([]AuditLogEvent_eventsable) + GetEventsWere()([]AuditLogEvent_events_wereable) + GetExplanation()(*string) + GetFingerprint()(*string) + GetHookId()(*int32) + GetLimitedAvailability()(*bool) + GetMessage()(*string) + GetName()(*string) + GetOldUser()(*string) + GetOpensshPublicKey()(*string) + GetOperationType()(*string) + GetOrg()(*string) + GetOrgId()(*int32) + GetPreviousVisibility()(*string) + GetReadOnly()(*bool) + GetRepo()(*string) + GetRepository()(*string) + GetRepositoryPublic()(*bool) + GetTargetLogin()(*string) + GetTeam()(*string) + GetTimestamp()(*int32) + GetTransportProtocol()(*int32) + GetTransportProtocolName()(*string) + GetUser()(*string) + GetUserId()(*int32) + GetVisibility()(*string) + SetAction(value *string)() + SetActive(value *bool)() + SetActiveWas(value *bool)() + SetActor(value *string)() + SetActorId(value *int32)() + SetActorLocation(value AuditLogEvent_actor_locationable)() + SetBlockedUser(value *string)() + SetBusiness(value *string)() + SetBusinessId(value *int32)() + SetConfig(value []AuditLogEvent_configable)() + SetConfigWas(value []AuditLogEvent_config_wasable)() + SetContentType(value *string)() + SetCreatedAt(value *int32)() + SetData(value AuditLogEvent_dataable)() + SetDeployKeyFingerprint(value *string)() + SetDocumentId(value *string)() + SetEmoji(value *string)() + SetEvents(value []AuditLogEvent_eventsable)() + SetEventsWere(value []AuditLogEvent_events_wereable)() + SetExplanation(value *string)() + SetFingerprint(value *string)() + SetHookId(value *int32)() + SetLimitedAvailability(value *bool)() + SetMessage(value *string)() + SetName(value *string)() + SetOldUser(value *string)() + SetOpensshPublicKey(value *string)() + SetOperationType(value *string)() + SetOrg(value *string)() + SetOrgId(value *int32)() + SetPreviousVisibility(value *string)() + SetReadOnly(value *bool)() + SetRepo(value *string)() + SetRepository(value *string)() + SetRepositoryPublic(value *bool)() + SetTargetLogin(value *string)() + SetTeam(value *string)() + SetTimestamp(value *int32)() + SetTransportProtocol(value *int32)() + SetTransportProtocolName(value *string)() + SetUser(value *string)() + SetUserId(value *int32)() + SetVisibility(value *string)() +} diff --git a/pkg/github/models/audit_log_event_escaped_actor_escaped_location.go b/pkg/github/models/audit_log_event_escaped_actor_escaped_location.go new file mode 100644 index 00000000..0136fe35 --- /dev/null +++ b/pkg/github/models/audit_log_event_escaped_actor_escaped_location.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AuditLogEvent_actor_location 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 country_name property + country_name *string +} +// NewAuditLogEvent_actor_location instantiates a new AuditLogEvent_actor_location and sets the default values. +func NewAuditLogEvent_actor_location()(*AuditLogEvent_actor_location) { + m := &AuditLogEvent_actor_location{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuditLogEvent_actor_locationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuditLogEvent_actor_locationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuditLogEvent_actor_location(), 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 *AuditLogEvent_actor_location) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCountryName gets the country_name property value. The country_name property +// returns a *string when successful +func (m *AuditLogEvent_actor_location) GetCountryName()(*string) { + return m.country_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AuditLogEvent_actor_location) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["country_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCountryName(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *AuditLogEvent_actor_location) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("country_name", m.GetCountryName()) + 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 *AuditLogEvent_actor_location) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCountryName sets the country_name property value. The country_name property +func (m *AuditLogEvent_actor_location) SetCountryName(value *string)() { + m.country_name = value +} +type AuditLogEvent_actor_locationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCountryName()(*string) + SetCountryName(value *string)() +} diff --git a/pkg/github/models/audit_log_event_escaped_config.go b/pkg/github/models/audit_log_event_escaped_config.go new file mode 100644 index 00000000..bf2eadf1 --- /dev/null +++ b/pkg/github/models/audit_log_event_escaped_config.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AuditLogEvent_config struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewAuditLogEvent_config instantiates a new AuditLogEvent_config and sets the default values. +func NewAuditLogEvent_config()(*AuditLogEvent_config) { + m := &AuditLogEvent_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuditLogEvent_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuditLogEvent_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuditLogEvent_config(), 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 *AuditLogEvent_config) 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 *AuditLogEvent_config) 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 *AuditLogEvent_config) 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 *AuditLogEvent_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type AuditLogEvent_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/audit_log_event_escaped_config_escaped_was.go b/pkg/github/models/audit_log_event_escaped_config_escaped_was.go new file mode 100644 index 00000000..3e62e0d4 --- /dev/null +++ b/pkg/github/models/audit_log_event_escaped_config_escaped_was.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AuditLogEvent_config_was struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewAuditLogEvent_config_was instantiates a new AuditLogEvent_config_was and sets the default values. +func NewAuditLogEvent_config_was()(*AuditLogEvent_config_was) { + m := &AuditLogEvent_config_was{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuditLogEvent_config_wasFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuditLogEvent_config_wasFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuditLogEvent_config_was(), 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 *AuditLogEvent_config_was) 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 *AuditLogEvent_config_was) 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 *AuditLogEvent_config_was) 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 *AuditLogEvent_config_was) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type AuditLogEvent_config_wasable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/audit_log_event_escaped_data.go b/pkg/github/models/audit_log_event_escaped_data.go new file mode 100644 index 00000000..6cf3d944 --- /dev/null +++ b/pkg/github/models/audit_log_event_escaped_data.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AuditLogEvent_data struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewAuditLogEvent_data instantiates a new AuditLogEvent_data and sets the default values. +func NewAuditLogEvent_data()(*AuditLogEvent_data) { + m := &AuditLogEvent_data{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuditLogEvent_dataFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuditLogEvent_dataFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuditLogEvent_data(), 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 *AuditLogEvent_data) 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 *AuditLogEvent_data) 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 *AuditLogEvent_data) 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 *AuditLogEvent_data) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type AuditLogEvent_dataable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/audit_log_event_escaped_events.go b/pkg/github/models/audit_log_event_escaped_events.go new file mode 100644 index 00000000..9d49a3b7 --- /dev/null +++ b/pkg/github/models/audit_log_event_escaped_events.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AuditLogEvent_events struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewAuditLogEvent_events instantiates a new AuditLogEvent_events and sets the default values. +func NewAuditLogEvent_events()(*AuditLogEvent_events) { + m := &AuditLogEvent_events{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuditLogEvent_eventsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuditLogEvent_eventsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuditLogEvent_events(), 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 *AuditLogEvent_events) 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 *AuditLogEvent_events) 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 *AuditLogEvent_events) 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 *AuditLogEvent_events) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type AuditLogEvent_eventsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/audit_log_event_escaped_events_escaped_were.go b/pkg/github/models/audit_log_event_escaped_events_escaped_were.go new file mode 100644 index 00000000..3f2505bb --- /dev/null +++ b/pkg/github/models/audit_log_event_escaped_events_escaped_were.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AuditLogEvent_events_were struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewAuditLogEvent_events_were instantiates a new AuditLogEvent_events_were and sets the default values. +func NewAuditLogEvent_events_were()(*AuditLogEvent_events_were) { + m := &AuditLogEvent_events_were{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuditLogEvent_events_wereFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuditLogEvent_events_wereFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuditLogEvent_events_were(), 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 *AuditLogEvent_events_were) 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 *AuditLogEvent_events_were) 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 *AuditLogEvent_events_were) 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 *AuditLogEvent_events_were) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type AuditLogEvent_events_wereable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/authentication_token.go b/pkg/github/models/authentication_token.go new file mode 100644 index 00000000..c0fdc843 --- /dev/null +++ b/pkg/github/models/authentication_token.go @@ -0,0 +1,240 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// AuthenticationToken authentication Token +type AuthenticationToken struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time this token expires + expires_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The permissions property + permissions AuthenticationToken_permissionsable + // The repositories this token has access to + repositories []Repositoryable + // Describe whether all repositories have been selected or there's a selection involved + repository_selection *AuthenticationToken_repository_selection + // The single_file property + single_file *string + // The token used for authentication + token *string +} +// NewAuthenticationToken instantiates a new AuthenticationToken and sets the default values. +func NewAuthenticationToken()(*AuthenticationToken) { + m := &AuthenticationToken{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuthenticationTokenFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuthenticationTokenFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuthenticationToken(), 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 *AuthenticationToken) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExpiresAt gets the expires_at property value. The time this token expires +// returns a *Time when successful +func (m *AuthenticationToken) GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AuthenticationToken) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAuthenticationToken_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(AuthenticationToken_permissionsable)) + } + return nil + } + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Repositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Repositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthenticationToken_repository_selection) + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val.(*AuthenticationToken_repository_selection)) + } + return nil + } + res["single_file"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSingleFile(val) + } + return nil + } + res["token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetToken(val) + } + return nil + } + return res +} +// GetPermissions gets the permissions property value. The permissions property +// returns a AuthenticationToken_permissionsable when successful +func (m *AuthenticationToken) GetPermissions()(AuthenticationToken_permissionsable) { + return m.permissions +} +// GetRepositories gets the repositories property value. The repositories this token has access to +// returns a []Repositoryable when successful +func (m *AuthenticationToken) GetRepositories()([]Repositoryable) { + return m.repositories +} +// GetRepositorySelection gets the repository_selection property value. Describe whether all repositories have been selected or there's a selection involved +// returns a *AuthenticationToken_repository_selection when successful +func (m *AuthenticationToken) GetRepositorySelection()(*AuthenticationToken_repository_selection) { + return m.repository_selection +} +// GetSingleFile gets the single_file property value. The single_file property +// returns a *string when successful +func (m *AuthenticationToken) GetSingleFile()(*string) { + return m.single_file +} +// GetToken gets the token property value. The token used for authentication +// returns a *string when successful +func (m *AuthenticationToken) GetToken()(*string) { + return m.token +} +// Serialize serializes information the current object +func (m *AuthenticationToken) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + if m.GetRepositorySelection() != nil { + cast := (*m.GetRepositorySelection()).String() + err := writer.WriteStringValue("repository_selection", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("single_file", m.GetSingleFile()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token", m.GetToken()) + 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 *AuthenticationToken) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExpiresAt sets the expires_at property value. The time this token expires +func (m *AuthenticationToken) SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.expires_at = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *AuthenticationToken) SetPermissions(value AuthenticationToken_permissionsable)() { + m.permissions = value +} +// SetRepositories sets the repositories property value. The repositories this token has access to +func (m *AuthenticationToken) SetRepositories(value []Repositoryable)() { + m.repositories = value +} +// SetRepositorySelection sets the repository_selection property value. Describe whether all repositories have been selected or there's a selection involved +func (m *AuthenticationToken) SetRepositorySelection(value *AuthenticationToken_repository_selection)() { + m.repository_selection = value +} +// SetSingleFile sets the single_file property value. The single_file property +func (m *AuthenticationToken) SetSingleFile(value *string)() { + m.single_file = value +} +// SetToken sets the token property value. The token used for authentication +func (m *AuthenticationToken) SetToken(value *string)() { + m.token = value +} +type AuthenticationTokenable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPermissions()(AuthenticationToken_permissionsable) + GetRepositories()([]Repositoryable) + GetRepositorySelection()(*AuthenticationToken_repository_selection) + GetSingleFile()(*string) + GetToken()(*string) + SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPermissions(value AuthenticationToken_permissionsable)() + SetRepositories(value []Repositoryable)() + SetRepositorySelection(value *AuthenticationToken_repository_selection)() + SetSingleFile(value *string)() + SetToken(value *string)() +} diff --git a/pkg/github/models/authentication_token_escaped_permissions.go b/pkg/github/models/authentication_token_escaped_permissions.go new file mode 100644 index 00000000..a3af4def --- /dev/null +++ b/pkg/github/models/authentication_token_escaped_permissions.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type AuthenticationToken_permissions struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewAuthenticationToken_permissions instantiates a new AuthenticationToken_permissions and sets the default values. +func NewAuthenticationToken_permissions()(*AuthenticationToken_permissions) { + m := &AuthenticationToken_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuthenticationToken_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuthenticationToken_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuthenticationToken_permissions(), 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 *AuthenticationToken_permissions) 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 *AuthenticationToken_permissions) 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 *AuthenticationToken_permissions) 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 *AuthenticationToken_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type AuthenticationToken_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/authentication_token_escaped_repository_escaped_selection.go b/pkg/github/models/authentication_token_escaped_repository_escaped_selection.go new file mode 100644 index 00000000..387065c4 --- /dev/null +++ b/pkg/github/models/authentication_token_escaped_repository_escaped_selection.go @@ -0,0 +1,34 @@ +package models +// Describe whether all repositories have been selected or there's a selection involved +type AuthenticationToken_repository_selection int + +const ( + ALL_AUTHENTICATIONTOKEN_REPOSITORY_SELECTION AuthenticationToken_repository_selection = iota + SELECTED_AUTHENTICATIONTOKEN_REPOSITORY_SELECTION +) + +func (i AuthenticationToken_repository_selection) String() string { + return []string{"all", "selected"}[i] +} +func ParseAuthenticationToken_repository_selection(v string) (any, error) { + result := ALL_AUTHENTICATIONTOKEN_REPOSITORY_SELECTION + switch v { + case "all": + result = ALL_AUTHENTICATIONTOKEN_REPOSITORY_SELECTION + case "selected": + result = SELECTED_AUTHENTICATIONTOKEN_REPOSITORY_SELECTION + default: + return nil, nil + } + return &result, nil +} +func SerializeAuthenticationToken_repository_selection(values []AuthenticationToken_repository_selection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AuthenticationToken_repository_selection) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/author_association.go b/pkg/github/models/author_association.go new file mode 100644 index 00000000..66ea49fa --- /dev/null +++ b/pkg/github/models/author_association.go @@ -0,0 +1,52 @@ +package models +// How the author is associated with the repository. +type AuthorAssociation int + +const ( + COLLABORATOR_AUTHORASSOCIATION AuthorAssociation = iota + CONTRIBUTOR_AUTHORASSOCIATION + FIRST_TIMER_AUTHORASSOCIATION + FIRST_TIME_CONTRIBUTOR_AUTHORASSOCIATION + MANNEQUIN_AUTHORASSOCIATION + MEMBER_AUTHORASSOCIATION + NONE_AUTHORASSOCIATION + OWNER_AUTHORASSOCIATION +) + +func (i AuthorAssociation) String() string { + return []string{"COLLABORATOR", "CONTRIBUTOR", "FIRST_TIMER", "FIRST_TIME_CONTRIBUTOR", "MANNEQUIN", "MEMBER", "NONE", "OWNER"}[i] +} +func ParseAuthorAssociation(v string) (any, error) { + result := COLLABORATOR_AUTHORASSOCIATION + switch v { + case "COLLABORATOR": + result = COLLABORATOR_AUTHORASSOCIATION + case "CONTRIBUTOR": + result = CONTRIBUTOR_AUTHORASSOCIATION + case "FIRST_TIMER": + result = FIRST_TIMER_AUTHORASSOCIATION + case "FIRST_TIME_CONTRIBUTOR": + result = FIRST_TIME_CONTRIBUTOR_AUTHORASSOCIATION + case "MANNEQUIN": + result = MANNEQUIN_AUTHORASSOCIATION + case "MEMBER": + result = MEMBER_AUTHORASSOCIATION + case "NONE": + result = NONE_AUTHORASSOCIATION + case "OWNER": + result = OWNER_AUTHORASSOCIATION + default: + return nil, nil + } + return &result, nil +} +func SerializeAuthorAssociation(values []AuthorAssociation) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AuthorAssociation) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/authorization.go b/pkg/github/models/authorization.go new file mode 100644 index 00000000..df9a7c56 --- /dev/null +++ b/pkg/github/models/authorization.go @@ -0,0 +1,494 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Authorization the authorization for an OAuth app, GitHub App, or a Personal Access Token. +type Authorization 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 app property + app Authorization_appable + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The expires_at property + expires_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The fingerprint property + fingerprint *string + // The hashed_token property + hashed_token *string + // The id property + id *int64 + // The installation property + installation NullableScopedInstallationable + // The note property + note *string + // The note_url property + note_url *string + // A list of scopes that this authorization is in. + scopes []string + // The token property + token *string + // The token_last_eight property + token_last_eight *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewAuthorization instantiates a new Authorization and sets the default values. +func NewAuthorization()(*Authorization) { + m := &Authorization{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuthorizationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuthorizationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuthorization(), 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 *Authorization) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApp gets the app property value. The app property +// returns a Authorization_appable when successful +func (m *Authorization) GetApp()(Authorization_appable) { + return m.app +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Authorization) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetExpiresAt gets the expires_at property value. The expires_at property +// returns a *Time when successful +func (m *Authorization) GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Authorization) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAuthorization_appFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetApp(val.(Authorization_appable)) + } + return nil + } + 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["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["fingerprint"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFingerprint(val) + } + return nil + } + res["hashed_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHashedToken(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["installation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableScopedInstallationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInstallation(val.(NullableScopedInstallationable)) + } + return nil + } + res["note"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNote(val) + } + return nil + } + res["note_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNoteUrl(val) + } + return nil + } + res["scopes"] = 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.SetScopes(res) + } + return nil + } + res["token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetToken(val) + } + return nil + } + res["token_last_eight"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenLastEight(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetFingerprint gets the fingerprint property value. The fingerprint property +// returns a *string when successful +func (m *Authorization) GetFingerprint()(*string) { + return m.fingerprint +} +// GetHashedToken gets the hashed_token property value. The hashed_token property +// returns a *string when successful +func (m *Authorization) GetHashedToken()(*string) { + return m.hashed_token +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *Authorization) GetId()(*int64) { + return m.id +} +// GetInstallation gets the installation property value. The installation property +// returns a NullableScopedInstallationable when successful +func (m *Authorization) GetInstallation()(NullableScopedInstallationable) { + return m.installation +} +// GetNote gets the note property value. The note property +// returns a *string when successful +func (m *Authorization) GetNote()(*string) { + return m.note +} +// GetNoteUrl gets the note_url property value. The note_url property +// returns a *string when successful +func (m *Authorization) GetNoteUrl()(*string) { + return m.note_url +} +// GetScopes gets the scopes property value. A list of scopes that this authorization is in. +// returns a []string when successful +func (m *Authorization) GetScopes()([]string) { + return m.scopes +} +// GetToken gets the token property value. The token property +// returns a *string when successful +func (m *Authorization) GetToken()(*string) { + return m.token +} +// GetTokenLastEight gets the token_last_eight property value. The token_last_eight property +// returns a *string when successful +func (m *Authorization) GetTokenLastEight()(*string) { + return m.token_last_eight +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Authorization) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Authorization) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Authorization) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *Authorization) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("app", m.GetApp()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("fingerprint", m.GetFingerprint()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hashed_token", m.GetHashedToken()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("installation", m.GetInstallation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note", m.GetNote()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note_url", m.GetNoteUrl()) + if err != nil { + return err + } + } + if m.GetScopes() != nil { + err := writer.WriteCollectionOfStringValues("scopes", m.GetScopes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token", m.GetToken()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token_last_eight", m.GetTokenLastEight()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *Authorization) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApp sets the app property value. The app property +func (m *Authorization) SetApp(value Authorization_appable)() { + m.app = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Authorization) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetExpiresAt sets the expires_at property value. The expires_at property +func (m *Authorization) SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.expires_at = value +} +// SetFingerprint sets the fingerprint property value. The fingerprint property +func (m *Authorization) SetFingerprint(value *string)() { + m.fingerprint = value +} +// SetHashedToken sets the hashed_token property value. The hashed_token property +func (m *Authorization) SetHashedToken(value *string)() { + m.hashed_token = value +} +// SetId sets the id property value. The id property +func (m *Authorization) SetId(value *int64)() { + m.id = value +} +// SetInstallation sets the installation property value. The installation property +func (m *Authorization) SetInstallation(value NullableScopedInstallationable)() { + m.installation = value +} +// SetNote sets the note property value. The note property +func (m *Authorization) SetNote(value *string)() { + m.note = value +} +// SetNoteUrl sets the note_url property value. The note_url property +func (m *Authorization) SetNoteUrl(value *string)() { + m.note_url = value +} +// SetScopes sets the scopes property value. A list of scopes that this authorization is in. +func (m *Authorization) SetScopes(value []string)() { + m.scopes = value +} +// SetToken sets the token property value. The token property +func (m *Authorization) SetToken(value *string)() { + m.token = value +} +// SetTokenLastEight sets the token_last_eight property value. The token_last_eight property +func (m *Authorization) SetTokenLastEight(value *string)() { + m.token_last_eight = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Authorization) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Authorization) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *Authorization) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type Authorizationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApp()(Authorization_appable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetFingerprint()(*string) + GetHashedToken()(*string) + GetId()(*int64) + GetInstallation()(NullableScopedInstallationable) + GetNote()(*string) + GetNoteUrl()(*string) + GetScopes()([]string) + GetToken()(*string) + GetTokenLastEight()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetApp(value Authorization_appable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetFingerprint(value *string)() + SetHashedToken(value *string)() + SetId(value *int64)() + SetInstallation(value NullableScopedInstallationable)() + SetNote(value *string)() + SetNoteUrl(value *string)() + SetScopes(value []string)() + SetToken(value *string)() + SetTokenLastEight(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/authorization_escaped_app.go b/pkg/github/models/authorization_escaped_app.go new file mode 100644 index 00000000..045c5220 --- /dev/null +++ b/pkg/github/models/authorization_escaped_app.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Authorization_app 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 client_id property + client_id *string + // The name property + name *string + // The url property + url *string +} +// NewAuthorization_app instantiates a new Authorization_app and sets the default values. +func NewAuthorization_app()(*Authorization_app) { + m := &Authorization_app{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAuthorization_appFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAuthorization_appFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAuthorization_app(), 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 *Authorization_app) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientId gets the client_id property value. The client_id property +// returns a *string when successful +func (m *Authorization_app) GetClientId()(*string) { + return m.client_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Authorization_app) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientId(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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Authorization_app) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Authorization_app) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Authorization_app) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_id", m.GetClientId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Authorization_app) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientId sets the client_id property value. The client_id property +func (m *Authorization_app) SetClientId(value *string)() { + m.client_id = value +} +// SetName sets the name property value. The name property +func (m *Authorization_app) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *Authorization_app) SetUrl(value *string)() { + m.url = value +} +type Authorization_appable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientId()(*string) + GetName()(*string) + GetUrl()(*string) + SetClientId(value *string)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/auto_merge.go b/pkg/github/models/auto_merge.go new file mode 100644 index 00000000..c2c7ffc5 --- /dev/null +++ b/pkg/github/models/auto_merge.go @@ -0,0 +1,169 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// AutoMerge the status of auto merging a pull request. +type AutoMerge 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 for the merge commit. + commit_message *string + // Title for the merge commit message. + commit_title *string + // A GitHub user. + enabled_by SimpleUserable + // The merge method to use. + merge_method *AutoMerge_merge_method +} +// NewAutoMerge instantiates a new AutoMerge and sets the default values. +func NewAutoMerge()(*AutoMerge) { + m := &AutoMerge{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAutoMergeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAutoMergeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAutoMerge(), 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 *AutoMerge) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitMessage gets the commit_message property value. Commit message for the merge commit. +// returns a *string when successful +func (m *AutoMerge) GetCommitMessage()(*string) { + return m.commit_message +} +// GetCommitTitle gets the commit_title property value. Title for the merge commit message. +// returns a *string when successful +func (m *AutoMerge) GetCommitTitle()(*string) { + return m.commit_title +} +// GetEnabledBy gets the enabled_by property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *AutoMerge) GetEnabledBy()(SimpleUserable) { + return m.enabled_by +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AutoMerge) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitMessage(val) + } + return nil + } + res["commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitTitle(val) + } + return nil + } + res["enabled_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetEnabledBy(val.(SimpleUserable)) + } + return nil + } + res["merge_method"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAutoMerge_merge_method) + if err != nil { + return err + } + if val != nil { + m.SetMergeMethod(val.(*AutoMerge_merge_method)) + } + return nil + } + return res +} +// GetMergeMethod gets the merge_method property value. The merge method to use. +// returns a *AutoMerge_merge_method when successful +func (m *AutoMerge) GetMergeMethod()(*AutoMerge_merge_method) { + return m.merge_method +} +// Serialize serializes information the current object +func (m *AutoMerge) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("commit_message", m.GetCommitMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_title", m.GetCommitTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("enabled_by", m.GetEnabledBy()) + if err != nil { + return err + } + } + if m.GetMergeMethod() != nil { + cast := (*m.GetMergeMethod()).String() + err := writer.WriteStringValue("merge_method", &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 *AutoMerge) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitMessage sets the commit_message property value. Commit message for the merge commit. +func (m *AutoMerge) SetCommitMessage(value *string)() { + m.commit_message = value +} +// SetCommitTitle sets the commit_title property value. Title for the merge commit message. +func (m *AutoMerge) SetCommitTitle(value *string)() { + m.commit_title = value +} +// SetEnabledBy sets the enabled_by property value. A GitHub user. +func (m *AutoMerge) SetEnabledBy(value SimpleUserable)() { + m.enabled_by = value +} +// SetMergeMethod sets the merge_method property value. The merge method to use. +func (m *AutoMerge) SetMergeMethod(value *AutoMerge_merge_method)() { + m.merge_method = value +} +type AutoMergeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommitMessage()(*string) + GetCommitTitle()(*string) + GetEnabledBy()(SimpleUserable) + GetMergeMethod()(*AutoMerge_merge_method) + SetCommitMessage(value *string)() + SetCommitTitle(value *string)() + SetEnabledBy(value SimpleUserable)() + SetMergeMethod(value *AutoMerge_merge_method)() +} diff --git a/pkg/github/models/auto_merge_escaped_merge_escaped_method.go b/pkg/github/models/auto_merge_escaped_merge_escaped_method.go new file mode 100644 index 00000000..54931960 --- /dev/null +++ b/pkg/github/models/auto_merge_escaped_merge_escaped_method.go @@ -0,0 +1,37 @@ +package models +// The merge method to use. +type AutoMerge_merge_method int + +const ( + MERGE_AUTOMERGE_MERGE_METHOD AutoMerge_merge_method = iota + SQUASH_AUTOMERGE_MERGE_METHOD + REBASE_AUTOMERGE_MERGE_METHOD +) + +func (i AutoMerge_merge_method) String() string { + return []string{"merge", "squash", "rebase"}[i] +} +func ParseAutoMerge_merge_method(v string) (any, error) { + result := MERGE_AUTOMERGE_MERGE_METHOD + switch v { + case "merge": + result = MERGE_AUTOMERGE_MERGE_METHOD + case "squash": + result = SQUASH_AUTOMERGE_MERGE_METHOD + case "rebase": + result = REBASE_AUTOMERGE_MERGE_METHOD + default: + return nil, nil + } + return &result, nil +} +func SerializeAutoMerge_merge_method(values []AutoMerge_merge_method) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i AutoMerge_merge_method) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/autolink.go b/pkg/github/models/autolink.go new file mode 100644 index 00000000..ef226b35 --- /dev/null +++ b/pkg/github/models/autolink.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Autolink an autolink reference. +type Autolink struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. + is_alphanumeric *bool + // The prefix of a key that is linkified. + key_prefix *string + // A template for the target URL that is generated if a key was found. + url_template *string +} +// NewAutolink instantiates a new Autolink and sets the default values. +func NewAutolink()(*Autolink) { + m := &Autolink{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateAutolinkFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAutolinkFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewAutolink(), 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 *Autolink) 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 *Autolink) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_alphanumeric"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsAlphanumeric(val) + } + return nil + } + res["key_prefix"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyPrefix(val) + } + return nil + } + res["url_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrlTemplate(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Autolink) GetId()(*int32) { + return m.id +} +// GetIsAlphanumeric gets the is_alphanumeric property value. Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. +// returns a *bool when successful +func (m *Autolink) GetIsAlphanumeric()(*bool) { + return m.is_alphanumeric +} +// GetKeyPrefix gets the key_prefix property value. The prefix of a key that is linkified. +// returns a *string when successful +func (m *Autolink) GetKeyPrefix()(*string) { + return m.key_prefix +} +// GetUrlTemplate gets the url_template property value. A template for the target URL that is generated if a key was found. +// returns a *string when successful +func (m *Autolink) GetUrlTemplate()(*string) { + return m.url_template +} +// Serialize serializes information the current object +func (m *Autolink) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_alphanumeric", m.GetIsAlphanumeric()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_prefix", m.GetKeyPrefix()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url_template", m.GetUrlTemplate()) + 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 *Autolink) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *Autolink) SetId(value *int32)() { + m.id = value +} +// SetIsAlphanumeric sets the is_alphanumeric property value. Whether this autolink reference matches alphanumeric characters. If false, this autolink reference only matches numeric characters. +func (m *Autolink) SetIsAlphanumeric(value *bool)() { + m.is_alphanumeric = value +} +// SetKeyPrefix sets the key_prefix property value. The prefix of a key that is linkified. +func (m *Autolink) SetKeyPrefix(value *string)() { + m.key_prefix = value +} +// SetUrlTemplate sets the url_template property value. A template for the target URL that is generated if a key was found. +func (m *Autolink) SetUrlTemplate(value *string)() { + m.url_template = value +} +type Autolinkable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetIsAlphanumeric()(*bool) + GetKeyPrefix()(*string) + GetUrlTemplate()(*string) + SetId(value *int32)() + SetIsAlphanumeric(value *bool)() + SetKeyPrefix(value *string)() + SetUrlTemplate(value *string)() +} diff --git a/pkg/github/models/b72c6e1af1bcec5c809ea07762464f8551f51f3033e3a502d2d5557f57b5fb77.go b/pkg/github/models/b72c6e1af1bcec5c809ea07762464f8551f51f3033e3a502d2d5557f57b5fb77.go new file mode 100644 index 00000000..61558859 --- /dev/null +++ b/pkg/github/models/b72c6e1af1bcec5c809ea07762464f8551f51f3033e3a502d2d5557f57b5fb77.go @@ -0,0 +1,174 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances 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 apps property + apps []Integrationable + // The teams property + teams []Teamable + // The users property + users []SimpleUserable +} +// NewProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances instantiates a new ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances and sets the default values. +func NewProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances()(*ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) { + m := &ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances(), 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 *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The apps property +// returns a []Integrationable when successful +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) GetApps()([]Integrationable) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Integrationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Integrationable) + } + } + m.SetApps(res) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Teamable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Teamable) + } + } + m.SetTeams(res) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The teams property +// returns a []Teamable when successful +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) GetTeams()([]Teamable) { + return m.teams +} +// GetUsers gets the users property value. The users property +// returns a []SimpleUserable when successful +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) GetUsers()([]SimpleUserable) { + return m.users +} +// Serialize serializes information the current object +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetApps())) + for i, v := range m.GetApps() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("apps", cast) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTeams())) + for i, v := range m.GetTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("teams", cast) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUsers())) + for i, v := range m.GetUsers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("users", 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 *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The apps property +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) SetApps(value []Integrationable)() { + m.apps = value +} +// SetTeams sets the teams property value. The teams property +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) SetTeams(value []Teamable)() { + m.teams = value +} +// SetUsers sets the users property value. The users property +func (m *ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowances) SetUsers(value []SimpleUserable)() { + m.users = value +} +type ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]Integrationable) + GetTeams()([]Teamable) + GetUsers()([]SimpleUserable) + SetApps(value []Integrationable)() + SetTeams(value []Teamable)() + SetUsers(value []SimpleUserable)() +} diff --git a/pkg/github/models/base_gist.go b/pkg/github/models/base_gist.go new file mode 100644 index 00000000..87644a4f --- /dev/null +++ b/pkg/github/models/base_gist.go @@ -0,0 +1,633 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BaseGist base Gist +type BaseGist 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 comments property + comments *int32 + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + description *string + // The files property + files BaseGist_filesable + // The forks property + forks i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + // The forks_url property + forks_url *string + // The git_pull_url property + git_pull_url *string + // The git_push_url property + git_push_url *string + // The history property + history i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + // The html_url property + html_url *string + // The id property + id *string + // The node_id property + node_id *string + // A GitHub user. + owner SimpleUserable + // The public property + public *bool + // The truncated property + truncated *bool + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewBaseGist instantiates a new BaseGist and sets the default values. +func NewBaseGist()(*BaseGist) { + m := &BaseGist{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBaseGistFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBaseGistFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBaseGist(), 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 *BaseGist) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. The comments property +// returns a *int32 when successful +func (m *BaseGist) GetComments()(*int32) { + return m.comments +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *BaseGist) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *BaseGist) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *BaseGist) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *BaseGist) 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 *BaseGist) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetComments(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + 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["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBaseGist_filesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetFiles(val.(BaseGist_filesable)) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetForks(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["git_pull_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitPullUrl(val) + } + return nil + } + res["git_push_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitPushUrl(val) + } + return nil + } + res["history"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHistory(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPublic(val) + } + return nil + } + res["truncated"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTruncated(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetFiles gets the files property value. The files property +// returns a BaseGist_filesable when successful +func (m *BaseGist) GetFiles()(BaseGist_filesable) { + return m.files +} +// GetForks gets the forks property value. The forks property +// returns a UntypedNodeable when successful +func (m *BaseGist) GetForks()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + return m.forks +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *BaseGist) GetForksUrl()(*string) { + return m.forks_url +} +// GetGitPullUrl gets the git_pull_url property value. The git_pull_url property +// returns a *string when successful +func (m *BaseGist) GetGitPullUrl()(*string) { + return m.git_pull_url +} +// GetGitPushUrl gets the git_push_url property value. The git_push_url property +// returns a *string when successful +func (m *BaseGist) GetGitPushUrl()(*string) { + return m.git_push_url +} +// GetHistory gets the history property value. The history property +// returns a UntypedNodeable when successful +func (m *BaseGist) GetHistory()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + return m.history +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *BaseGist) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *string when successful +func (m *BaseGist) GetId()(*string) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *BaseGist) GetNodeId()(*string) { + return m.node_id +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *BaseGist) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPublic gets the public property value. The public property +// returns a *bool when successful +func (m *BaseGist) GetPublic()(*bool) { + return m.public +} +// GetTruncated gets the truncated property value. The truncated property +// returns a *bool when successful +func (m *BaseGist) GetTruncated()(*bool) { + return m.truncated +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *BaseGist) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BaseGist) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *BaseGist) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *BaseGist) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("files", m.GetFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_pull_url", m.GetGitPullUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_push_url", m.GetGitPushUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("history", m.GetHistory()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("public", m.GetPublic()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("truncated", m.GetTruncated()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *BaseGist) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. The comments property +func (m *BaseGist) SetComments(value *int32)() { + m.comments = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *BaseGist) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *BaseGist) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *BaseGist) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *BaseGist) SetDescription(value *string)() { + m.description = value +} +// SetFiles sets the files property value. The files property +func (m *BaseGist) SetFiles(value BaseGist_filesable)() { + m.files = value +} +// SetForks sets the forks property value. The forks property +func (m *BaseGist) SetForks(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() { + m.forks = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *BaseGist) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetGitPullUrl sets the git_pull_url property value. The git_pull_url property +func (m *BaseGist) SetGitPullUrl(value *string)() { + m.git_pull_url = value +} +// SetGitPushUrl sets the git_push_url property value. The git_push_url property +func (m *BaseGist) SetGitPushUrl(value *string)() { + m.git_push_url = value +} +// SetHistory sets the history property value. The history property +func (m *BaseGist) SetHistory(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() { + m.history = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *BaseGist) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *BaseGist) SetId(value *string)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *BaseGist) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *BaseGist) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPublic sets the public property value. The public property +func (m *BaseGist) SetPublic(value *bool)() { + m.public = value +} +// SetTruncated sets the truncated property value. The truncated property +func (m *BaseGist) SetTruncated(value *bool)() { + m.truncated = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *BaseGist) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *BaseGist) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *BaseGist) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type BaseGistable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()(*int32) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetFiles()(BaseGist_filesable) + GetForks()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + GetForksUrl()(*string) + GetGitPullUrl()(*string) + GetGitPushUrl()(*string) + GetHistory()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + GetHtmlUrl()(*string) + GetId()(*string) + GetNodeId()(*string) + GetOwner()(SimpleUserable) + GetPublic()(*bool) + GetTruncated()(*bool) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetComments(value *int32)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetFiles(value BaseGist_filesable)() + SetForks(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() + SetForksUrl(value *string)() + SetGitPullUrl(value *string)() + SetGitPushUrl(value *string)() + SetHistory(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() + SetHtmlUrl(value *string)() + SetId(value *string)() + SetNodeId(value *string)() + SetOwner(value SimpleUserable)() + SetPublic(value *bool)() + SetTruncated(value *bool)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/base_gist_escaped_files.go b/pkg/github/models/base_gist_escaped_files.go new file mode 100644 index 00000000..8fab653b --- /dev/null +++ b/pkg/github/models/base_gist_escaped_files.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BaseGist_files struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewBaseGist_files instantiates a new BaseGist_files and sets the default values. +func NewBaseGist_files()(*BaseGist_files) { + m := &BaseGist_files{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBaseGist_filesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBaseGist_filesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBaseGist_files(), 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 *BaseGist_files) 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 *BaseGist_files) 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 *BaseGist_files) 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 *BaseGist_files) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type BaseGist_filesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/basic_error.go b/pkg/github/models/basic_error.go new file mode 100644 index 00000000..ab2919a4 --- /dev/null +++ b/pkg/github/models/basic_error.go @@ -0,0 +1,176 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BasicError basic Error +type BasicError 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 documentation_url property + documentation_url *string + // The message property + message *string + // The status property + status *string + // The url property + url *string +} +// NewBasicError instantiates a new BasicError and sets the default values. +func NewBasicError()(*BasicError) { + m := &BasicError{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBasicErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBasicErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBasicError(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *BasicError) 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 *BasicError) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *BasicError) 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 *BasicError) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *BasicError) GetMessage()(*string) { + return m.message +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *BasicError) GetStatus()(*string) { + return m.status +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BasicError) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *BasicError) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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.WriteStringValue("status", m.GetStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *BasicError) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *BasicError) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *BasicError) SetMessage(value *string)() { + m.message = value +} +// SetStatus sets the status property value. The status property +func (m *BasicError) SetStatus(value *string)() { + m.status = value +} +// SetUrl sets the url property value. The url property +func (m *BasicError) SetUrl(value *string)() { + m.url = value +} +type BasicErrorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + GetStatus()(*string) + GetUrl()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() + SetStatus(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/blob.go b/pkg/github/models/blob.go new file mode 100644 index 00000000..f83a8202 --- /dev/null +++ b/pkg/github/models/blob.go @@ -0,0 +1,255 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Blob blob +type Blob 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 content property + content *string + // The encoding property + encoding *string + // The highlighted_content property + highlighted_content *string + // The node_id property + node_id *string + // The sha property + sha *string + // The size property + size *int32 + // The url property + url *string +} +// NewBlob instantiates a new Blob and sets the default values. +func NewBlob()(*Blob) { + m := &Blob{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBlobFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBlobFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBlob(), 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 *Blob) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContent gets the content property value. The content property +// returns a *string when successful +func (m *Blob) GetContent()(*string) { + return m.content +} +// GetEncoding gets the encoding property value. The encoding property +// returns a *string when successful +func (m *Blob) GetEncoding()(*string) { + return m.encoding +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Blob) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContent(val) + } + return nil + } + res["encoding"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncoding(val) + } + return nil + } + res["highlighted_content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHighlightedContent(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + 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["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHighlightedContent gets the highlighted_content property value. The highlighted_content property +// returns a *string when successful +func (m *Blob) GetHighlightedContent()(*string) { + return m.highlighted_content +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Blob) GetNodeId()(*string) { + return m.node_id +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *Blob) GetSha()(*string) { + return m.sha +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *Blob) GetSize()(*int32) { + return m.size +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Blob) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Blob) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content", m.GetContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("encoding", m.GetEncoding()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("highlighted_content", m.GetHighlightedContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Blob) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContent sets the content property value. The content property +func (m *Blob) SetContent(value *string)() { + m.content = value +} +// SetEncoding sets the encoding property value. The encoding property +func (m *Blob) SetEncoding(value *string)() { + m.encoding = value +} +// SetHighlightedContent sets the highlighted_content property value. The highlighted_content property +func (m *Blob) SetHighlightedContent(value *string)() { + m.highlighted_content = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Blob) SetNodeId(value *string)() { + m.node_id = value +} +// SetSha sets the sha property value. The sha property +func (m *Blob) SetSha(value *string)() { + m.sha = value +} +// SetSize sets the size property value. The size property +func (m *Blob) SetSize(value *int32)() { + m.size = value +} +// SetUrl sets the url property value. The url property +func (m *Blob) SetUrl(value *string)() { + m.url = value +} +type Blobable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContent()(*string) + GetEncoding()(*string) + GetHighlightedContent()(*string) + GetNodeId()(*string) + GetSha()(*string) + GetSize()(*int32) + GetUrl()(*string) + SetContent(value *string)() + SetEncoding(value *string)() + SetHighlightedContent(value *string)() + SetNodeId(value *string)() + SetSha(value *string)() + SetSize(value *int32)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/branch_protection.go b/pkg/github/models/branch_protection.go new file mode 100644 index 00000000..595ce27a --- /dev/null +++ b/pkg/github/models/branch_protection.go @@ -0,0 +1,516 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BranchProtection branch Protection +type BranchProtection 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 allow_deletions property + allow_deletions BranchProtection_allow_deletionsable + // The allow_force_pushes property + allow_force_pushes BranchProtection_allow_force_pushesable + // Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. + allow_fork_syncing BranchProtection_allow_fork_syncingable + // The block_creations property + block_creations BranchProtection_block_creationsable + // The enabled property + enabled *bool + // Protected Branch Admin Enforced + enforce_admins ProtectedBranchAdminEnforcedable + // Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. + lock_branch BranchProtection_lock_branchable + // The name property + name *string + // The protection_url property + protection_url *string + // The required_conversation_resolution property + required_conversation_resolution BranchProtection_required_conversation_resolutionable + // The required_linear_history property + required_linear_history BranchProtection_required_linear_historyable + // Protected Branch Pull Request Review + required_pull_request_reviews ProtectedBranchPullRequestReviewable + // The required_signatures property + required_signatures BranchProtection_required_signaturesable + // Protected Branch Required Status Check + required_status_checks ProtectedBranchRequiredStatusCheckable + // Branch Restriction Policy + restrictions BranchRestrictionPolicyable + // The url property + url *string +} +// NewBranchProtection instantiates a new BranchProtection and sets the default values. +func NewBranchProtection()(*BranchProtection) { + m := &BranchProtection{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection(), 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 *BranchProtection) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowDeletions gets the allow_deletions property value. The allow_deletions property +// returns a BranchProtection_allow_deletionsable when successful +func (m *BranchProtection) GetAllowDeletions()(BranchProtection_allow_deletionsable) { + return m.allow_deletions +} +// GetAllowForcePushes gets the allow_force_pushes property value. The allow_force_pushes property +// returns a BranchProtection_allow_force_pushesable when successful +func (m *BranchProtection) GetAllowForcePushes()(BranchProtection_allow_force_pushesable) { + return m.allow_force_pushes +} +// GetAllowForkSyncing gets the allow_fork_syncing property value. Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. +// returns a BranchProtection_allow_fork_syncingable when successful +func (m *BranchProtection) GetAllowForkSyncing()(BranchProtection_allow_fork_syncingable) { + return m.allow_fork_syncing +} +// GetBlockCreations gets the block_creations property value. The block_creations property +// returns a BranchProtection_block_creationsable when successful +func (m *BranchProtection) GetBlockCreations()(BranchProtection_block_creationsable) { + return m.block_creations +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection) GetEnabled()(*bool) { + return m.enabled +} +// GetEnforceAdmins gets the enforce_admins property value. Protected Branch Admin Enforced +// returns a ProtectedBranchAdminEnforcedable when successful +func (m *BranchProtection) GetEnforceAdmins()(ProtectedBranchAdminEnforcedable) { + return m.enforce_admins +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_allow_deletionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAllowDeletions(val.(BranchProtection_allow_deletionsable)) + } + return nil + } + res["allow_force_pushes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_allow_force_pushesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAllowForcePushes(val.(BranchProtection_allow_force_pushesable)) + } + return nil + } + res["allow_fork_syncing"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_allow_fork_syncingFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAllowForkSyncing(val.(BranchProtection_allow_fork_syncingable)) + } + return nil + } + res["block_creations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_block_creationsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBlockCreations(val.(BranchProtection_block_creationsable)) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["enforce_admins"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranchAdminEnforcedFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetEnforceAdmins(val.(ProtectedBranchAdminEnforcedable)) + } + return nil + } + res["lock_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_lock_branchFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLockBranch(val.(BranchProtection_lock_branchable)) + } + 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["protection_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProtectionUrl(val) + } + return nil + } + res["required_conversation_resolution"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_required_conversation_resolutionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredConversationResolution(val.(BranchProtection_required_conversation_resolutionable)) + } + return nil + } + res["required_linear_history"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_required_linear_historyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredLinearHistory(val.(BranchProtection_required_linear_historyable)) + } + return nil + } + res["required_pull_request_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranchPullRequestReviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredPullRequestReviews(val.(ProtectedBranchPullRequestReviewable)) + } + return nil + } + res["required_signatures"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtection_required_signaturesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredSignatures(val.(BranchProtection_required_signaturesable)) + } + return nil + } + res["required_status_checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranchRequiredStatusCheckFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredStatusChecks(val.(ProtectedBranchRequiredStatusCheckable)) + } + return nil + } + res["restrictions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchRestrictionPolicyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRestrictions(val.(BranchRestrictionPolicyable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetLockBranch gets the lock_branch property value. Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. +// returns a BranchProtection_lock_branchable when successful +func (m *BranchProtection) GetLockBranch()(BranchProtection_lock_branchable) { + return m.lock_branch +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *BranchProtection) GetName()(*string) { + return m.name +} +// GetProtectionUrl gets the protection_url property value. The protection_url property +// returns a *string when successful +func (m *BranchProtection) GetProtectionUrl()(*string) { + return m.protection_url +} +// GetRequiredConversationResolution gets the required_conversation_resolution property value. The required_conversation_resolution property +// returns a BranchProtection_required_conversation_resolutionable when successful +func (m *BranchProtection) GetRequiredConversationResolution()(BranchProtection_required_conversation_resolutionable) { + return m.required_conversation_resolution +} +// GetRequiredLinearHistory gets the required_linear_history property value. The required_linear_history property +// returns a BranchProtection_required_linear_historyable when successful +func (m *BranchProtection) GetRequiredLinearHistory()(BranchProtection_required_linear_historyable) { + return m.required_linear_history +} +// GetRequiredPullRequestReviews gets the required_pull_request_reviews property value. Protected Branch Pull Request Review +// returns a ProtectedBranchPullRequestReviewable when successful +func (m *BranchProtection) GetRequiredPullRequestReviews()(ProtectedBranchPullRequestReviewable) { + return m.required_pull_request_reviews +} +// GetRequiredSignatures gets the required_signatures property value. The required_signatures property +// returns a BranchProtection_required_signaturesable when successful +func (m *BranchProtection) GetRequiredSignatures()(BranchProtection_required_signaturesable) { + return m.required_signatures +} +// GetRequiredStatusChecks gets the required_status_checks property value. Protected Branch Required Status Check +// returns a ProtectedBranchRequiredStatusCheckable when successful +func (m *BranchProtection) GetRequiredStatusChecks()(ProtectedBranchRequiredStatusCheckable) { + return m.required_status_checks +} +// GetRestrictions gets the restrictions property value. Branch Restriction Policy +// returns a BranchRestrictionPolicyable when successful +func (m *BranchProtection) GetRestrictions()(BranchRestrictionPolicyable) { + return m.restrictions +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BranchProtection) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *BranchProtection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("allow_deletions", m.GetAllowDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("allow_force_pushes", m.GetAllowForcePushes()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("allow_fork_syncing", m.GetAllowForkSyncing()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("block_creations", m.GetBlockCreations()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("enforce_admins", m.GetEnforceAdmins()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("lock_branch", m.GetLockBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("protection_url", m.GetProtectionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_conversation_resolution", m.GetRequiredConversationResolution()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_linear_history", m.GetRequiredLinearHistory()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_pull_request_reviews", m.GetRequiredPullRequestReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_signatures", m.GetRequiredSignatures()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_status_checks", m.GetRequiredStatusChecks()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("restrictions", m.GetRestrictions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *BranchProtection) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowDeletions sets the allow_deletions property value. The allow_deletions property +func (m *BranchProtection) SetAllowDeletions(value BranchProtection_allow_deletionsable)() { + m.allow_deletions = value +} +// SetAllowForcePushes sets the allow_force_pushes property value. The allow_force_pushes property +func (m *BranchProtection) SetAllowForcePushes(value BranchProtection_allow_force_pushesable)() { + m.allow_force_pushes = value +} +// SetAllowForkSyncing sets the allow_fork_syncing property value. Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. +func (m *BranchProtection) SetAllowForkSyncing(value BranchProtection_allow_fork_syncingable)() { + m.allow_fork_syncing = value +} +// SetBlockCreations sets the block_creations property value. The block_creations property +func (m *BranchProtection) SetBlockCreations(value BranchProtection_block_creationsable)() { + m.block_creations = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection) SetEnabled(value *bool)() { + m.enabled = value +} +// SetEnforceAdmins sets the enforce_admins property value. Protected Branch Admin Enforced +func (m *BranchProtection) SetEnforceAdmins(value ProtectedBranchAdminEnforcedable)() { + m.enforce_admins = value +} +// SetLockBranch sets the lock_branch property value. Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. +func (m *BranchProtection) SetLockBranch(value BranchProtection_lock_branchable)() { + m.lock_branch = value +} +// SetName sets the name property value. The name property +func (m *BranchProtection) SetName(value *string)() { + m.name = value +} +// SetProtectionUrl sets the protection_url property value. The protection_url property +func (m *BranchProtection) SetProtectionUrl(value *string)() { + m.protection_url = value +} +// SetRequiredConversationResolution sets the required_conversation_resolution property value. The required_conversation_resolution property +func (m *BranchProtection) SetRequiredConversationResolution(value BranchProtection_required_conversation_resolutionable)() { + m.required_conversation_resolution = value +} +// SetRequiredLinearHistory sets the required_linear_history property value. The required_linear_history property +func (m *BranchProtection) SetRequiredLinearHistory(value BranchProtection_required_linear_historyable)() { + m.required_linear_history = value +} +// SetRequiredPullRequestReviews sets the required_pull_request_reviews property value. Protected Branch Pull Request Review +func (m *BranchProtection) SetRequiredPullRequestReviews(value ProtectedBranchPullRequestReviewable)() { + m.required_pull_request_reviews = value +} +// SetRequiredSignatures sets the required_signatures property value. The required_signatures property +func (m *BranchProtection) SetRequiredSignatures(value BranchProtection_required_signaturesable)() { + m.required_signatures = value +} +// SetRequiredStatusChecks sets the required_status_checks property value. Protected Branch Required Status Check +func (m *BranchProtection) SetRequiredStatusChecks(value ProtectedBranchRequiredStatusCheckable)() { + m.required_status_checks = value +} +// SetRestrictions sets the restrictions property value. Branch Restriction Policy +func (m *BranchProtection) SetRestrictions(value BranchRestrictionPolicyable)() { + m.restrictions = value +} +// SetUrl sets the url property value. The url property +func (m *BranchProtection) SetUrl(value *string)() { + m.url = value +} +type BranchProtectionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowDeletions()(BranchProtection_allow_deletionsable) + GetAllowForcePushes()(BranchProtection_allow_force_pushesable) + GetAllowForkSyncing()(BranchProtection_allow_fork_syncingable) + GetBlockCreations()(BranchProtection_block_creationsable) + GetEnabled()(*bool) + GetEnforceAdmins()(ProtectedBranchAdminEnforcedable) + GetLockBranch()(BranchProtection_lock_branchable) + GetName()(*string) + GetProtectionUrl()(*string) + GetRequiredConversationResolution()(BranchProtection_required_conversation_resolutionable) + GetRequiredLinearHistory()(BranchProtection_required_linear_historyable) + GetRequiredPullRequestReviews()(ProtectedBranchPullRequestReviewable) + GetRequiredSignatures()(BranchProtection_required_signaturesable) + GetRequiredStatusChecks()(ProtectedBranchRequiredStatusCheckable) + GetRestrictions()(BranchRestrictionPolicyable) + GetUrl()(*string) + SetAllowDeletions(value BranchProtection_allow_deletionsable)() + SetAllowForcePushes(value BranchProtection_allow_force_pushesable)() + SetAllowForkSyncing(value BranchProtection_allow_fork_syncingable)() + SetBlockCreations(value BranchProtection_block_creationsable)() + SetEnabled(value *bool)() + SetEnforceAdmins(value ProtectedBranchAdminEnforcedable)() + SetLockBranch(value BranchProtection_lock_branchable)() + SetName(value *string)() + SetProtectionUrl(value *string)() + SetRequiredConversationResolution(value BranchProtection_required_conversation_resolutionable)() + SetRequiredLinearHistory(value BranchProtection_required_linear_historyable)() + SetRequiredPullRequestReviews(value ProtectedBranchPullRequestReviewable)() + SetRequiredSignatures(value BranchProtection_required_signaturesable)() + SetRequiredStatusChecks(value ProtectedBranchRequiredStatusCheckable)() + SetRestrictions(value BranchRestrictionPolicyable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/branch_protection_escaped_allow_escaped_deletions.go b/pkg/github/models/branch_protection_escaped_allow_escaped_deletions.go new file mode 100644 index 00000000..c633d3e6 --- /dev/null +++ b/pkg/github/models/branch_protection_escaped_allow_escaped_deletions.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchProtection_allow_deletions 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 enabled property + enabled *bool +} +// NewBranchProtection_allow_deletions instantiates a new BranchProtection_allow_deletions and sets the default values. +func NewBranchProtection_allow_deletions()(*BranchProtection_allow_deletions) { + m := &BranchProtection_allow_deletions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_allow_deletionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_allow_deletionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_allow_deletions(), 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 *BranchProtection_allow_deletions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_allow_deletions) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_allow_deletions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *BranchProtection_allow_deletions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + 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 *BranchProtection_allow_deletions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_allow_deletions) SetEnabled(value *bool)() { + m.enabled = value +} +type BranchProtection_allow_deletionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/branch_protection_escaped_allow_escaped_force_escaped_pushes.go b/pkg/github/models/branch_protection_escaped_allow_escaped_force_escaped_pushes.go new file mode 100644 index 00000000..4745c2e5 --- /dev/null +++ b/pkg/github/models/branch_protection_escaped_allow_escaped_force_escaped_pushes.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchProtection_allow_force_pushes 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 enabled property + enabled *bool +} +// NewBranchProtection_allow_force_pushes instantiates a new BranchProtection_allow_force_pushes and sets the default values. +func NewBranchProtection_allow_force_pushes()(*BranchProtection_allow_force_pushes) { + m := &BranchProtection_allow_force_pushes{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_allow_force_pushesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_allow_force_pushesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_allow_force_pushes(), 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 *BranchProtection_allow_force_pushes) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_allow_force_pushes) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_allow_force_pushes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *BranchProtection_allow_force_pushes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + 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 *BranchProtection_allow_force_pushes) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_allow_force_pushes) SetEnabled(value *bool)() { + m.enabled = value +} +type BranchProtection_allow_force_pushesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/branch_protection_escaped_allow_escaped_fork_escaped_syncing.go b/pkg/github/models/branch_protection_escaped_allow_escaped_fork_escaped_syncing.go new file mode 100644 index 00000000..a9be4df3 --- /dev/null +++ b/pkg/github/models/branch_protection_escaped_allow_escaped_fork_escaped_syncing.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BranchProtection_allow_fork_syncing whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. +type BranchProtection_allow_fork_syncing 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 enabled property + enabled *bool +} +// NewBranchProtection_allow_fork_syncing instantiates a new BranchProtection_allow_fork_syncing and sets the default values. +func NewBranchProtection_allow_fork_syncing()(*BranchProtection_allow_fork_syncing) { + m := &BranchProtection_allow_fork_syncing{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_allow_fork_syncingFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_allow_fork_syncingFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_allow_fork_syncing(), 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 *BranchProtection_allow_fork_syncing) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_allow_fork_syncing) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_allow_fork_syncing) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *BranchProtection_allow_fork_syncing) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + 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 *BranchProtection_allow_fork_syncing) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_allow_fork_syncing) SetEnabled(value *bool)() { + m.enabled = value +} +type BranchProtection_allow_fork_syncingable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/branch_protection_escaped_block_escaped_creations.go b/pkg/github/models/branch_protection_escaped_block_escaped_creations.go new file mode 100644 index 00000000..dc34c0c5 --- /dev/null +++ b/pkg/github/models/branch_protection_escaped_block_escaped_creations.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchProtection_block_creations 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 enabled property + enabled *bool +} +// NewBranchProtection_block_creations instantiates a new BranchProtection_block_creations and sets the default values. +func NewBranchProtection_block_creations()(*BranchProtection_block_creations) { + m := &BranchProtection_block_creations{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_block_creationsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_block_creationsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_block_creations(), 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 *BranchProtection_block_creations) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_block_creations) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_block_creations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *BranchProtection_block_creations) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + 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 *BranchProtection_block_creations) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_block_creations) SetEnabled(value *bool)() { + m.enabled = value +} +type BranchProtection_block_creationsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/branch_protection_escaped_lock_escaped_branch.go b/pkg/github/models/branch_protection_escaped_lock_escaped_branch.go new file mode 100644 index 00000000..fc2c1b01 --- /dev/null +++ b/pkg/github/models/branch_protection_escaped_lock_escaped_branch.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BranchProtection_lock_branch whether to set the branch as read-only. If this is true, users will not be able to push to the branch. +type BranchProtection_lock_branch 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 enabled property + enabled *bool +} +// NewBranchProtection_lock_branch instantiates a new BranchProtection_lock_branch and sets the default values. +func NewBranchProtection_lock_branch()(*BranchProtection_lock_branch) { + m := &BranchProtection_lock_branch{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_lock_branchFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_lock_branchFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_lock_branch(), 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 *BranchProtection_lock_branch) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_lock_branch) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_lock_branch) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *BranchProtection_lock_branch) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + 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 *BranchProtection_lock_branch) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_lock_branch) SetEnabled(value *bool)() { + m.enabled = value +} +type BranchProtection_lock_branchable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/branch_protection_escaped_required_escaped_conversation_escaped_resolution.go b/pkg/github/models/branch_protection_escaped_required_escaped_conversation_escaped_resolution.go new file mode 100644 index 00000000..b772d300 --- /dev/null +++ b/pkg/github/models/branch_protection_escaped_required_escaped_conversation_escaped_resolution.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchProtection_required_conversation_resolution 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 enabled property + enabled *bool +} +// NewBranchProtection_required_conversation_resolution instantiates a new BranchProtection_required_conversation_resolution and sets the default values. +func NewBranchProtection_required_conversation_resolution()(*BranchProtection_required_conversation_resolution) { + m := &BranchProtection_required_conversation_resolution{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_required_conversation_resolutionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_required_conversation_resolutionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_required_conversation_resolution(), 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 *BranchProtection_required_conversation_resolution) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_required_conversation_resolution) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_required_conversation_resolution) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *BranchProtection_required_conversation_resolution) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + 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 *BranchProtection_required_conversation_resolution) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_required_conversation_resolution) SetEnabled(value *bool)() { + m.enabled = value +} +type BranchProtection_required_conversation_resolutionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/branch_protection_escaped_required_escaped_linear_escaped_history.go b/pkg/github/models/branch_protection_escaped_required_escaped_linear_escaped_history.go new file mode 100644 index 00000000..b804813b --- /dev/null +++ b/pkg/github/models/branch_protection_escaped_required_escaped_linear_escaped_history.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchProtection_required_linear_history 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 enabled property + enabled *bool +} +// NewBranchProtection_required_linear_history instantiates a new BranchProtection_required_linear_history and sets the default values. +func NewBranchProtection_required_linear_history()(*BranchProtection_required_linear_history) { + m := &BranchProtection_required_linear_history{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_required_linear_historyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_required_linear_historyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_required_linear_history(), 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 *BranchProtection_required_linear_history) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_required_linear_history) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_required_linear_history) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *BranchProtection_required_linear_history) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + 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 *BranchProtection_required_linear_history) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_required_linear_history) SetEnabled(value *bool)() { + m.enabled = value +} +type BranchProtection_required_linear_historyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/branch_protection_escaped_required_escaped_signatures.go b/pkg/github/models/branch_protection_escaped_required_escaped_signatures.go new file mode 100644 index 00000000..fdd4af5a --- /dev/null +++ b/pkg/github/models/branch_protection_escaped_required_escaped_signatures.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchProtection_required_signatures 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 enabled property + enabled *bool + // The url property + url *string +} +// NewBranchProtection_required_signatures instantiates a new BranchProtection_required_signatures and sets the default values. +func NewBranchProtection_required_signatures()(*BranchProtection_required_signatures) { + m := &BranchProtection_required_signatures{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchProtection_required_signaturesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchProtection_required_signaturesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchProtection_required_signatures(), 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 *BranchProtection_required_signatures) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *BranchProtection_required_signatures) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchProtection_required_signatures) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BranchProtection_required_signatures) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *BranchProtection_required_signatures) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *BranchProtection_required_signatures) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *BranchProtection_required_signatures) SetEnabled(value *bool)() { + m.enabled = value +} +// SetUrl sets the url property value. The url property +func (m *BranchProtection_required_signatures) SetUrl(value *string)() { + m.url = value +} +type BranchProtection_required_signaturesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetUrl()(*string) + SetEnabled(value *bool)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/branch_restriction_policy.go b/pkg/github/models/branch_restriction_policy.go new file mode 100644 index 00000000..acfa68d4 --- /dev/null +++ b/pkg/github/models/branch_restriction_policy.go @@ -0,0 +1,291 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BranchRestrictionPolicy branch Restriction Policy +type BranchRestrictionPolicy 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 apps property + apps []BranchRestrictionPolicy_appsable + // The apps_url property + apps_url *string + // The teams property + teams []BranchRestrictionPolicy_teamsable + // The teams_url property + teams_url *string + // The url property + url *string + // The users property + users []BranchRestrictionPolicy_usersable + // The users_url property + users_url *string +} +// NewBranchRestrictionPolicy instantiates a new BranchRestrictionPolicy and sets the default values. +func NewBranchRestrictionPolicy()(*BranchRestrictionPolicy) { + m := &BranchRestrictionPolicy{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchRestrictionPolicyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchRestrictionPolicyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchRestrictionPolicy(), 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 *BranchRestrictionPolicy) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The apps property +// returns a []BranchRestrictionPolicy_appsable when successful +func (m *BranchRestrictionPolicy) GetApps()([]BranchRestrictionPolicy_appsable) { + return m.apps +} +// GetAppsUrl gets the apps_url property value. The apps_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy) GetAppsUrl()(*string) { + return m.apps_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchRestrictionPolicy) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateBranchRestrictionPolicy_appsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]BranchRestrictionPolicy_appsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(BranchRestrictionPolicy_appsable) + } + } + m.SetApps(res) + } + return nil + } + res["apps_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAppsUrl(val) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateBranchRestrictionPolicy_teamsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]BranchRestrictionPolicy_teamsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(BranchRestrictionPolicy_teamsable) + } + } + m.SetTeams(res) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateBranchRestrictionPolicy_usersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]BranchRestrictionPolicy_usersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(BranchRestrictionPolicy_usersable) + } + } + m.SetUsers(res) + } + return nil + } + res["users_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUsersUrl(val) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The teams property +// returns a []BranchRestrictionPolicy_teamsable when successful +func (m *BranchRestrictionPolicy) GetTeams()([]BranchRestrictionPolicy_teamsable) { + return m.teams +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BranchRestrictionPolicy) GetUrl()(*string) { + return m.url +} +// GetUsers gets the users property value. The users property +// returns a []BranchRestrictionPolicy_usersable when successful +func (m *BranchRestrictionPolicy) GetUsers()([]BranchRestrictionPolicy_usersable) { + return m.users +} +// GetUsersUrl gets the users_url property value. The users_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy) GetUsersUrl()(*string) { + return m.users_url +} +// Serialize serializes information the current object +func (m *BranchRestrictionPolicy) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetApps())) + for i, v := range m.GetApps() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("apps", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("apps_url", m.GetAppsUrl()) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTeams())) + for i, v := range m.GetTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("teams", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUsers())) + for i, v := range m.GetUsers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("users", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("users_url", m.GetUsersUrl()) + 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 *BranchRestrictionPolicy) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The apps property +func (m *BranchRestrictionPolicy) SetApps(value []BranchRestrictionPolicy_appsable)() { + m.apps = value +} +// SetAppsUrl sets the apps_url property value. The apps_url property +func (m *BranchRestrictionPolicy) SetAppsUrl(value *string)() { + m.apps_url = value +} +// SetTeams sets the teams property value. The teams property +func (m *BranchRestrictionPolicy) SetTeams(value []BranchRestrictionPolicy_teamsable)() { + m.teams = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *BranchRestrictionPolicy) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetUrl sets the url property value. The url property +func (m *BranchRestrictionPolicy) SetUrl(value *string)() { + m.url = value +} +// SetUsers sets the users property value. The users property +func (m *BranchRestrictionPolicy) SetUsers(value []BranchRestrictionPolicy_usersable)() { + m.users = value +} +// SetUsersUrl sets the users_url property value. The users_url property +func (m *BranchRestrictionPolicy) SetUsersUrl(value *string)() { + m.users_url = value +} +type BranchRestrictionPolicyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]BranchRestrictionPolicy_appsable) + GetAppsUrl()(*string) + GetTeams()([]BranchRestrictionPolicy_teamsable) + GetTeamsUrl()(*string) + GetUrl()(*string) + GetUsers()([]BranchRestrictionPolicy_usersable) + GetUsersUrl()(*string) + SetApps(value []BranchRestrictionPolicy_appsable)() + SetAppsUrl(value *string)() + SetTeams(value []BranchRestrictionPolicy_teamsable)() + SetTeamsUrl(value *string)() + SetUrl(value *string)() + SetUsers(value []BranchRestrictionPolicy_usersable)() + SetUsersUrl(value *string)() +} diff --git a/pkg/github/models/branch_restriction_policy_escaped_apps.go b/pkg/github/models/branch_restriction_policy_escaped_apps.go new file mode 100644 index 00000000..37c4b996 --- /dev/null +++ b/pkg/github/models/branch_restriction_policy_escaped_apps.go @@ -0,0 +1,434 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchRestrictionPolicy_apps 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 client_id property + client_id *string + // The created_at property + created_at *string + // The description property + description *string + // The events property + events []string + // The external_url property + external_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The name property + name *string + // The node_id property + node_id *string + // The owner property + owner BranchRestrictionPolicy_apps_ownerable + // The permissions property + permissions BranchRestrictionPolicy_apps_permissionsable + // The slug property + slug *string + // The updated_at property + updated_at *string +} +// NewBranchRestrictionPolicy_apps instantiates a new BranchRestrictionPolicy_apps and sets the default values. +func NewBranchRestrictionPolicy_apps()(*BranchRestrictionPolicy_apps) { + m := &BranchRestrictionPolicy_apps{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchRestrictionPolicy_appsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchRestrictionPolicy_appsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchRestrictionPolicy_apps(), 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 *BranchRestrictionPolicy_apps) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientId gets the client_id property value. The client_id property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetClientId()(*string) { + return m.client_id +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetCreatedAt()(*string) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetDescription()(*string) { + return m.description +} +// GetEvents gets the events property value. The events property +// returns a []string when successful +func (m *BranchRestrictionPolicy_apps) GetEvents()([]string) { + return m.events +} +// GetExternalUrl gets the external_url property value. The external_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetExternalUrl()(*string) { + return m.external_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchRestrictionPolicy_apps) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientId(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + 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["events"] = 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.SetEvents(res) + } + return nil + } + res["external_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExternalUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchRestrictionPolicy_apps_ownerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(BranchRestrictionPolicy_apps_ownerable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchRestrictionPolicy_apps_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(BranchRestrictionPolicy_apps_permissionsable)) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *BranchRestrictionPolicy_apps) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetNodeId()(*string) { + return m.node_id +} +// GetOwner gets the owner property value. The owner property +// returns a BranchRestrictionPolicy_apps_ownerable when successful +func (m *BranchRestrictionPolicy_apps) GetOwner()(BranchRestrictionPolicy_apps_ownerable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a BranchRestrictionPolicy_apps_permissionsable when successful +func (m *BranchRestrictionPolicy_apps) GetPermissions()(BranchRestrictionPolicy_apps_permissionsable) { + return m.permissions +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetSlug()(*string) { + return m.slug +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps) GetUpdatedAt()(*string) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *BranchRestrictionPolicy_apps) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_id", m.GetClientId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("external_url", m.GetExternalUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + 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 *BranchRestrictionPolicy_apps) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientId sets the client_id property value. The client_id property +func (m *BranchRestrictionPolicy_apps) SetClientId(value *string)() { + m.client_id = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *BranchRestrictionPolicy_apps) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *BranchRestrictionPolicy_apps) SetDescription(value *string)() { + m.description = value +} +// SetEvents sets the events property value. The events property +func (m *BranchRestrictionPolicy_apps) SetEvents(value []string)() { + m.events = value +} +// SetExternalUrl sets the external_url property value. The external_url property +func (m *BranchRestrictionPolicy_apps) SetExternalUrl(value *string)() { + m.external_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *BranchRestrictionPolicy_apps) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *BranchRestrictionPolicy_apps) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *BranchRestrictionPolicy_apps) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *BranchRestrictionPolicy_apps) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwner sets the owner property value. The owner property +func (m *BranchRestrictionPolicy_apps) SetOwner(value BranchRestrictionPolicy_apps_ownerable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *BranchRestrictionPolicy_apps) SetPermissions(value BranchRestrictionPolicy_apps_permissionsable)() { + m.permissions = value +} +// SetSlug sets the slug property value. The slug property +func (m *BranchRestrictionPolicy_apps) SetSlug(value *string)() { + m.slug = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *BranchRestrictionPolicy_apps) SetUpdatedAt(value *string)() { + m.updated_at = value +} +type BranchRestrictionPolicy_appsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientId()(*string) + GetCreatedAt()(*string) + GetDescription()(*string) + GetEvents()([]string) + GetExternalUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetOwner()(BranchRestrictionPolicy_apps_ownerable) + GetPermissions()(BranchRestrictionPolicy_apps_permissionsable) + GetSlug()(*string) + GetUpdatedAt()(*string) + SetClientId(value *string)() + SetCreatedAt(value *string)() + SetDescription(value *string)() + SetEvents(value []string)() + SetExternalUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetOwner(value BranchRestrictionPolicy_apps_ownerable)() + SetPermissions(value BranchRestrictionPolicy_apps_permissionsable)() + SetSlug(value *string)() + SetUpdatedAt(value *string)() +} diff --git a/pkg/github/models/branch_restriction_policy_escaped_apps_escaped_owner.go b/pkg/github/models/branch_restriction_policy_escaped_apps_escaped_owner.go new file mode 100644 index 00000000..af436c8a --- /dev/null +++ b/pkg/github/models/branch_restriction_policy_escaped_apps_escaped_owner.go @@ -0,0 +1,718 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchRestrictionPolicy_apps_owner 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 avatar_url property + avatar_url *string + // The description property + description *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The issues_url property + issues_url *string + // The login property + login *string + // The members_url property + members_url *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The public_members_url property + public_members_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewBranchRestrictionPolicy_apps_owner instantiates a new BranchRestrictionPolicy_apps_owner and sets the default values. +func NewBranchRestrictionPolicy_apps_owner()(*BranchRestrictionPolicy_apps_owner) { + m := &BranchRestrictionPolicy_apps_owner{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchRestrictionPolicy_apps_ownerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchRestrictionPolicy_apps_ownerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchRestrictionPolicy_apps_owner(), 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 *BranchRestrictionPolicy_apps_owner) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetDescription()(*string) { + return m.description +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchRestrictionPolicy_apps_owner) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + 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["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["public_members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicMembersUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *BranchRestrictionPolicy_apps_owner) GetId()(*int32) { + return m.id +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetLogin()(*string) { + return m.login +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetMembersUrl()(*string) { + return m.members_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetPublicMembersUrl gets the public_members_url property value. The public_members_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetPublicMembersUrl()(*string) { + return m.public_members_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *BranchRestrictionPolicy_apps_owner) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_owner) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *BranchRestrictionPolicy_apps_owner) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_members_url", m.GetPublicMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *BranchRestrictionPolicy_apps_owner) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *BranchRestrictionPolicy_apps_owner) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetDescription sets the description property value. The description property +func (m *BranchRestrictionPolicy_apps_owner) SetDescription(value *string)() { + m.description = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *BranchRestrictionPolicy_apps_owner) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *BranchRestrictionPolicy_apps_owner) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *BranchRestrictionPolicy_apps_owner) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *BranchRestrictionPolicy_apps_owner) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *BranchRestrictionPolicy_apps_owner) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *BranchRestrictionPolicy_apps_owner) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *BranchRestrictionPolicy_apps_owner) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *BranchRestrictionPolicy_apps_owner) SetId(value *int32)() { + m.id = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *BranchRestrictionPolicy_apps_owner) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetLogin sets the login property value. The login property +func (m *BranchRestrictionPolicy_apps_owner) SetLogin(value *string)() { + m.login = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *BranchRestrictionPolicy_apps_owner) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *BranchRestrictionPolicy_apps_owner) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *BranchRestrictionPolicy_apps_owner) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetPublicMembersUrl sets the public_members_url property value. The public_members_url property +func (m *BranchRestrictionPolicy_apps_owner) SetPublicMembersUrl(value *string)() { + m.public_members_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *BranchRestrictionPolicy_apps_owner) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *BranchRestrictionPolicy_apps_owner) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *BranchRestrictionPolicy_apps_owner) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *BranchRestrictionPolicy_apps_owner) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *BranchRestrictionPolicy_apps_owner) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *BranchRestrictionPolicy_apps_owner) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *BranchRestrictionPolicy_apps_owner) SetUrl(value *string)() { + m.url = value +} +type BranchRestrictionPolicy_apps_ownerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetDescription()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssuesUrl()(*string) + GetLogin()(*string) + GetMembersUrl()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetPublicMembersUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetDescription(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssuesUrl(value *string)() + SetLogin(value *string)() + SetMembersUrl(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetPublicMembersUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/branch_restriction_policy_escaped_apps_escaped_permissions.go b/pkg/github/models/branch_restriction_policy_escaped_apps_escaped_permissions.go new file mode 100644 index 00000000..3a9f9a75 --- /dev/null +++ b/pkg/github/models/branch_restriction_policy_escaped_apps_escaped_permissions.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchRestrictionPolicy_apps_permissions 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 contents property + contents *string + // The issues property + issues *string + // The metadata property + metadata *string + // The single_file property + single_file *string +} +// NewBranchRestrictionPolicy_apps_permissions instantiates a new BranchRestrictionPolicy_apps_permissions and sets the default values. +func NewBranchRestrictionPolicy_apps_permissions()(*BranchRestrictionPolicy_apps_permissions) { + m := &BranchRestrictionPolicy_apps_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchRestrictionPolicy_apps_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchRestrictionPolicy_apps_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchRestrictionPolicy_apps_permissions(), 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 *BranchRestrictionPolicy_apps_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContents gets the contents property value. The contents property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_permissions) GetContents()(*string) { + return m.contents +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchRestrictionPolicy_apps_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["contents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContents(val) + } + return nil + } + res["issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssues(val) + } + return nil + } + res["metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMetadata(val) + } + return nil + } + res["single_file"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSingleFile(val) + } + return nil + } + return res +} +// GetIssues gets the issues property value. The issues property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_permissions) GetIssues()(*string) { + return m.issues +} +// GetMetadata gets the metadata property value. The metadata property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_permissions) GetMetadata()(*string) { + return m.metadata +} +// GetSingleFile gets the single_file property value. The single_file property +// returns a *string when successful +func (m *BranchRestrictionPolicy_apps_permissions) GetSingleFile()(*string) { + return m.single_file +} +// Serialize serializes information the current object +func (m *BranchRestrictionPolicy_apps_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("contents", m.GetContents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues", m.GetIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("metadata", m.GetMetadata()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("single_file", m.GetSingleFile()) + 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 *BranchRestrictionPolicy_apps_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContents sets the contents property value. The contents property +func (m *BranchRestrictionPolicy_apps_permissions) SetContents(value *string)() { + m.contents = value +} +// SetIssues sets the issues property value. The issues property +func (m *BranchRestrictionPolicy_apps_permissions) SetIssues(value *string)() { + m.issues = value +} +// SetMetadata sets the metadata property value. The metadata property +func (m *BranchRestrictionPolicy_apps_permissions) SetMetadata(value *string)() { + m.metadata = value +} +// SetSingleFile sets the single_file property value. The single_file property +func (m *BranchRestrictionPolicy_apps_permissions) SetSingleFile(value *string)() { + m.single_file = value +} +type BranchRestrictionPolicy_apps_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContents()(*string) + GetIssues()(*string) + GetMetadata()(*string) + GetSingleFile()(*string) + SetContents(value *string)() + SetIssues(value *string)() + SetMetadata(value *string)() + SetSingleFile(value *string)() +} diff --git a/pkg/github/models/branch_restriction_policy_escaped_teams.go b/pkg/github/models/branch_restriction_policy_escaped_teams.go new file mode 100644 index 00000000..b12b2967 --- /dev/null +++ b/pkg/github/models/branch_restriction_policy_escaped_teams.go @@ -0,0 +1,428 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchRestrictionPolicy_teams 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 property + description *string + // The html_url property + html_url *string + // The id property + id *int32 + // The members_url property + members_url *string + // The name property + name *string + // The node_id property + node_id *string + // The notification_setting property + notification_setting *string + // The parent property + parent *string + // The permission property + permission *string + // The privacy property + privacy *string + // The repositories_url property + repositories_url *string + // The slug property + slug *string + // The url property + url *string +} +// NewBranchRestrictionPolicy_teams instantiates a new BranchRestrictionPolicy_teams and sets the default values. +func NewBranchRestrictionPolicy_teams()(*BranchRestrictionPolicy_teams) { + m := &BranchRestrictionPolicy_teams{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchRestrictionPolicy_teamsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchRestrictionPolicy_teamsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchRestrictionPolicy_teams(), 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 *BranchRestrictionPolicy_teams) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) 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 *BranchRestrictionPolicy_teams) 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["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationSetting(val) + } + return nil + } + res["parent"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetParent(val) + } + return nil + } + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["privacy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivacy(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *BranchRestrictionPolicy_teams) GetId()(*int32) { + return m.id +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationSetting gets the notification_setting property value. The notification_setting property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetNotificationSetting()(*string) { + return m.notification_setting +} +// GetParent gets the parent property value. The parent property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetParent()(*string) { + return m.parent +} +// GetPermission gets the permission property value. The permission property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetPermission()(*string) { + return m.permission +} +// GetPrivacy gets the privacy property value. The privacy property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetPrivacy()(*string) { + return m.privacy +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetSlug()(*string) { + return m.slug +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_teams) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *BranchRestrictionPolicy_teams) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_setting", m.GetNotificationSetting()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("parent", m.GetParent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("privacy", m.GetPrivacy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *BranchRestrictionPolicy_teams) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description property +func (m *BranchRestrictionPolicy_teams) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *BranchRestrictionPolicy_teams) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *BranchRestrictionPolicy_teams) SetId(value *int32)() { + m.id = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *BranchRestrictionPolicy_teams) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. The name property +func (m *BranchRestrictionPolicy_teams) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *BranchRestrictionPolicy_teams) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationSetting sets the notification_setting property value. The notification_setting property +func (m *BranchRestrictionPolicy_teams) SetNotificationSetting(value *string)() { + m.notification_setting = value +} +// SetParent sets the parent property value. The parent property +func (m *BranchRestrictionPolicy_teams) SetParent(value *string)() { + m.parent = value +} +// SetPermission sets the permission property value. The permission property +func (m *BranchRestrictionPolicy_teams) SetPermission(value *string)() { + m.permission = value +} +// SetPrivacy sets the privacy property value. The privacy property +func (m *BranchRestrictionPolicy_teams) SetPrivacy(value *string)() { + m.privacy = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *BranchRestrictionPolicy_teams) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetSlug sets the slug property value. The slug property +func (m *BranchRestrictionPolicy_teams) SetSlug(value *string)() { + m.slug = value +} +// SetUrl sets the url property value. The url property +func (m *BranchRestrictionPolicy_teams) SetUrl(value *string)() { + m.url = value +} +type BranchRestrictionPolicy_teamsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationSetting()(*string) + GetParent()(*string) + GetPermission()(*string) + GetPrivacy()(*string) + GetRepositoriesUrl()(*string) + GetSlug()(*string) + GetUrl()(*string) + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationSetting(value *string)() + SetParent(value *string)() + SetPermission(value *string)() + SetPrivacy(value *string)() + SetRepositoriesUrl(value *string)() + SetSlug(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/branch_restriction_policy_escaped_users.go b/pkg/github/models/branch_restriction_policy_escaped_users.go new file mode 100644 index 00000000..96629f5b --- /dev/null +++ b/pkg/github/models/branch_restriction_policy_escaped_users.go @@ -0,0 +1,573 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchRestrictionPolicy_users struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The avatar_url property + avatar_url *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int64 + // The login property + login *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewBranchRestrictionPolicy_users instantiates a new BranchRestrictionPolicy_users and sets the default values. +func NewBranchRestrictionPolicy_users()(*BranchRestrictionPolicy_users) { + m := &BranchRestrictionPolicy_users{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchRestrictionPolicy_usersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchRestrictionPolicy_usersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchRestrictionPolicy_users(), 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 *BranchRestrictionPolicy_users) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchRestrictionPolicy_users) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *BranchRestrictionPolicy_users) GetId()(*int64) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetLogin()(*string) { + return m.login +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *BranchRestrictionPolicy_users) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BranchRestrictionPolicy_users) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *BranchRestrictionPolicy_users) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *BranchRestrictionPolicy_users) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *BranchRestrictionPolicy_users) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *BranchRestrictionPolicy_users) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *BranchRestrictionPolicy_users) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *BranchRestrictionPolicy_users) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *BranchRestrictionPolicy_users) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *BranchRestrictionPolicy_users) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *BranchRestrictionPolicy_users) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *BranchRestrictionPolicy_users) SetId(value *int64)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *BranchRestrictionPolicy_users) SetLogin(value *string)() { + m.login = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *BranchRestrictionPolicy_users) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *BranchRestrictionPolicy_users) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *BranchRestrictionPolicy_users) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *BranchRestrictionPolicy_users) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *BranchRestrictionPolicy_users) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *BranchRestrictionPolicy_users) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *BranchRestrictionPolicy_users) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *BranchRestrictionPolicy_users) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *BranchRestrictionPolicy_users) SetUrl(value *string)() { + m.url = value +} +type BranchRestrictionPolicy_usersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLogin()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLogin(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/branch_short.go b/pkg/github/models/branch_short.go new file mode 100644 index 00000000..7c7c7345 --- /dev/null +++ b/pkg/github/models/branch_short.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BranchShort branch Short +type BranchShort 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 commit property + commit BranchShort_commitable + // The name property + name *string + // The protected property + protected *bool +} +// NewBranchShort instantiates a new BranchShort and sets the default values. +func NewBranchShort()(*BranchShort) { + m := &BranchShort{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchShortFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchShortFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchShort(), 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 *BranchShort) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommit gets the commit property value. The commit property +// returns a BranchShort_commitable when successful +func (m *BranchShort) GetCommit()(BranchShort_commitable) { + return m.commit +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchShort) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchShort_commitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommit(val.(BranchShort_commitable)) + } + 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["protected"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetProtected(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *BranchShort) GetName()(*string) { + return m.name +} +// GetProtected gets the protected property value. The protected property +// returns a *bool when successful +func (m *BranchShort) GetProtected()(*bool) { + return m.protected +} +// Serialize serializes information the current object +func (m *BranchShort) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("protected", m.GetProtected()) + 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 *BranchShort) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommit sets the commit property value. The commit property +func (m *BranchShort) SetCommit(value BranchShort_commitable)() { + m.commit = value +} +// SetName sets the name property value. The name property +func (m *BranchShort) SetName(value *string)() { + m.name = value +} +// SetProtected sets the protected property value. The protected property +func (m *BranchShort) SetProtected(value *bool)() { + m.protected = value +} +type BranchShortable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommit()(BranchShort_commitable) + GetName()(*string) + GetProtected()(*bool) + SetCommit(value BranchShort_commitable)() + SetName(value *string)() + SetProtected(value *bool)() +} diff --git a/pkg/github/models/branch_short_escaped_commit.go b/pkg/github/models/branch_short_escaped_commit.go new file mode 100644 index 00000000..080cf0ea --- /dev/null +++ b/pkg/github/models/branch_short_escaped_commit.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchShort_commit 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 sha property + sha *string + // The url property + url *string +} +// NewBranchShort_commit instantiates a new BranchShort_commit and sets the default values. +func NewBranchShort_commit()(*BranchShort_commit) { + m := &BranchShort_commit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchShort_commitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchShort_commitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchShort_commit(), 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 *BranchShort_commit) 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 *BranchShort_commit) 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *BranchShort_commit) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *BranchShort_commit) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *BranchShort_commit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *BranchShort_commit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *BranchShort_commit) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *BranchShort_commit) SetUrl(value *string)() { + m.url = value +} +type BranchShort_commitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/branch_with_protection.go b/pkg/github/models/branch_with_protection.go new file mode 100644 index 00000000..cc8e9988 --- /dev/null +++ b/pkg/github/models/branch_with_protection.go @@ -0,0 +1,284 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// BranchWithProtection branch With Protection +type BranchWithProtection struct { + // The _links property + _links BranchWithProtection__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Commit + commit Commitable + // The name property + name *string + // The pattern property + pattern *string + // The protected property + protected *bool + // Branch Protection + protection BranchProtectionable + // The protection_url property + protection_url *string + // The required_approving_review_count property + required_approving_review_count *int32 +} +// NewBranchWithProtection instantiates a new BranchWithProtection and sets the default values. +func NewBranchWithProtection()(*BranchWithProtection) { + m := &BranchWithProtection{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchWithProtectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchWithProtectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchWithProtection(), 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 *BranchWithProtection) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommit gets the commit property value. Commit +// returns a Commitable when successful +func (m *BranchWithProtection) GetCommit()(Commitable) { + return m.commit +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *BranchWithProtection) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchWithProtection__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(BranchWithProtection__linksable)) + } + return nil + } + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommit(val.(Commitable)) + } + 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["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + res["protected"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetProtected(val) + } + return nil + } + res["protection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtectionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProtection(val.(BranchProtectionable)) + } + return nil + } + res["protection_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProtectionUrl(val) + } + return nil + } + res["required_approving_review_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRequiredApprovingReviewCount(val) + } + return nil + } + return res +} +// GetLinks gets the _links property value. The _links property +// returns a BranchWithProtection__linksable when successful +func (m *BranchWithProtection) GetLinks()(BranchWithProtection__linksable) { + return m._links +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *BranchWithProtection) GetName()(*string) { + return m.name +} +// GetPattern gets the pattern property value. The pattern property +// returns a *string when successful +func (m *BranchWithProtection) GetPattern()(*string) { + return m.pattern +} +// GetProtected gets the protected property value. The protected property +// returns a *bool when successful +func (m *BranchWithProtection) GetProtected()(*bool) { + return m.protected +} +// GetProtection gets the protection property value. Branch Protection +// returns a BranchProtectionable when successful +func (m *BranchWithProtection) GetProtection()(BranchProtectionable) { + return m.protection +} +// GetProtectionUrl gets the protection_url property value. The protection_url property +// returns a *string when successful +func (m *BranchWithProtection) GetProtectionUrl()(*string) { + return m.protection_url +} +// GetRequiredApprovingReviewCount gets the required_approving_review_count property value. The required_approving_review_count property +// returns a *int32 when successful +func (m *BranchWithProtection) GetRequiredApprovingReviewCount()(*int32) { + return m.required_approving_review_count +} +// Serialize serializes information the current object +func (m *BranchWithProtection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("protected", m.GetProtected()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("protection", m.GetProtection()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("protection_url", m.GetProtectionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("required_approving_review_count", m.GetRequiredApprovingReviewCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *BranchWithProtection) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommit sets the commit property value. Commit +func (m *BranchWithProtection) SetCommit(value Commitable)() { + m.commit = value +} +// SetLinks sets the _links property value. The _links property +func (m *BranchWithProtection) SetLinks(value BranchWithProtection__linksable)() { + m._links = value +} +// SetName sets the name property value. The name property +func (m *BranchWithProtection) SetName(value *string)() { + m.name = value +} +// SetPattern sets the pattern property value. The pattern property +func (m *BranchWithProtection) SetPattern(value *string)() { + m.pattern = value +} +// SetProtected sets the protected property value. The protected property +func (m *BranchWithProtection) SetProtected(value *bool)() { + m.protected = value +} +// SetProtection sets the protection property value. Branch Protection +func (m *BranchWithProtection) SetProtection(value BranchProtectionable)() { + m.protection = value +} +// SetProtectionUrl sets the protection_url property value. The protection_url property +func (m *BranchWithProtection) SetProtectionUrl(value *string)() { + m.protection_url = value +} +// SetRequiredApprovingReviewCount sets the required_approving_review_count property value. The required_approving_review_count property +func (m *BranchWithProtection) SetRequiredApprovingReviewCount(value *int32)() { + m.required_approving_review_count = value +} +type BranchWithProtectionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommit()(Commitable) + GetLinks()(BranchWithProtection__linksable) + GetName()(*string) + GetPattern()(*string) + GetProtected()(*bool) + GetProtection()(BranchProtectionable) + GetProtectionUrl()(*string) + GetRequiredApprovingReviewCount()(*int32) + SetCommit(value Commitable)() + SetLinks(value BranchWithProtection__linksable)() + SetName(value *string)() + SetPattern(value *string)() + SetProtected(value *bool)() + SetProtection(value BranchProtectionable)() + SetProtectionUrl(value *string)() + SetRequiredApprovingReviewCount(value *int32)() +} diff --git a/pkg/github/models/branch_with_protection_escaped__escaped_links.go b/pkg/github/models/branch_with_protection_escaped__escaped_links.go new file mode 100644 index 00000000..8e03d524 --- /dev/null +++ b/pkg/github/models/branch_with_protection_escaped__escaped_links.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type BranchWithProtection__links 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 html property + html *string + // The self property + self *string +} +// NewBranchWithProtection__links instantiates a new BranchWithProtection__links and sets the default values. +func NewBranchWithProtection__links()(*BranchWithProtection__links) { + m := &BranchWithProtection__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateBranchWithProtection__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateBranchWithProtection__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewBranchWithProtection__links(), 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 *BranchWithProtection__links) 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 *BranchWithProtection__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtml(val) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelf(val) + } + return nil + } + return res +} +// GetHtml gets the html property value. The html property +// returns a *string when successful +func (m *BranchWithProtection__links) GetHtml()(*string) { + return m.html +} +// GetSelf gets the self property value. The self property +// returns a *string when successful +func (m *BranchWithProtection__links) GetSelf()(*string) { + return m.self +} +// Serialize serializes information the current object +func (m *BranchWithProtection__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("self", m.GetSelf()) + 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 *BranchWithProtection__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtml sets the html property value. The html property +func (m *BranchWithProtection__links) SetHtml(value *string)() { + m.html = value +} +// SetSelf sets the self property value. The self property +func (m *BranchWithProtection__links) SetSelf(value *string)() { + m.self = value +} +type BranchWithProtection__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtml()(*string) + GetSelf()(*string) + SetHtml(value *string)() + SetSelf(value *string)() +} diff --git a/pkg/github/models/check_annotation.go b/pkg/github/models/check_annotation.go new file mode 100644 index 00000000..bc268791 --- /dev/null +++ b/pkg/github/models/check_annotation.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CheckAnnotation check Annotation +type CheckAnnotation 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 annotation_level property + annotation_level *string + // The blob_href property + blob_href *string + // The end_column property + end_column *int32 + // The end_line property + end_line *int32 + // The message property + message *string + // The path property + path *string + // The raw_details property + raw_details *string + // The start_column property + start_column *int32 + // The start_line property + start_line *int32 + // The title property + title *string +} +// NewCheckAnnotation instantiates a new CheckAnnotation and sets the default values. +func NewCheckAnnotation()(*CheckAnnotation) { + m := &CheckAnnotation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckAnnotationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckAnnotationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckAnnotation(), 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 *CheckAnnotation) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAnnotationLevel gets the annotation_level property value. The annotation_level property +// returns a *string when successful +func (m *CheckAnnotation) GetAnnotationLevel()(*string) { + return m.annotation_level +} +// GetBlobHref gets the blob_href property value. The blob_href property +// returns a *string when successful +func (m *CheckAnnotation) GetBlobHref()(*string) { + return m.blob_href +} +// GetEndColumn gets the end_column property value. The end_column property +// returns a *int32 when successful +func (m *CheckAnnotation) GetEndColumn()(*int32) { + return m.end_column +} +// GetEndLine gets the end_line property value. The end_line property +// returns a *int32 when successful +func (m *CheckAnnotation) GetEndLine()(*int32) { + return m.end_line +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckAnnotation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["annotation_level"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAnnotationLevel(val) + } + return nil + } + res["blob_href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobHref(val) + } + return nil + } + res["end_column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetEndColumn(val) + } + return nil + } + res["end_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetEndLine(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 + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["raw_details"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRawDetails(val) + } + return nil + } + res["start_column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartColumn(val) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CheckAnnotation) GetMessage()(*string) { + return m.message +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *CheckAnnotation) GetPath()(*string) { + return m.path +} +// GetRawDetails gets the raw_details property value. The raw_details property +// returns a *string when successful +func (m *CheckAnnotation) GetRawDetails()(*string) { + return m.raw_details +} +// GetStartColumn gets the start_column property value. The start_column property +// returns a *int32 when successful +func (m *CheckAnnotation) GetStartColumn()(*int32) { + return m.start_column +} +// GetStartLine gets the start_line property value. The start_line property +// returns a *int32 when successful +func (m *CheckAnnotation) GetStartLine()(*int32) { + return m.start_line +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *CheckAnnotation) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *CheckAnnotation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("annotation_level", m.GetAnnotationLevel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blob_href", m.GetBlobHref()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("end_column", m.GetEndColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("end_line", m.GetEndLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("raw_details", m.GetRawDetails()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("start_column", m.GetStartColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("start_line", m.GetStartLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *CheckAnnotation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAnnotationLevel sets the annotation_level property value. The annotation_level property +func (m *CheckAnnotation) SetAnnotationLevel(value *string)() { + m.annotation_level = value +} +// SetBlobHref sets the blob_href property value. The blob_href property +func (m *CheckAnnotation) SetBlobHref(value *string)() { + m.blob_href = value +} +// SetEndColumn sets the end_column property value. The end_column property +func (m *CheckAnnotation) SetEndColumn(value *int32)() { + m.end_column = value +} +// SetEndLine sets the end_line property value. The end_line property +func (m *CheckAnnotation) SetEndLine(value *int32)() { + m.end_line = value +} +// SetMessage sets the message property value. The message property +func (m *CheckAnnotation) SetMessage(value *string)() { + m.message = value +} +// SetPath sets the path property value. The path property +func (m *CheckAnnotation) SetPath(value *string)() { + m.path = value +} +// SetRawDetails sets the raw_details property value. The raw_details property +func (m *CheckAnnotation) SetRawDetails(value *string)() { + m.raw_details = value +} +// SetStartColumn sets the start_column property value. The start_column property +func (m *CheckAnnotation) SetStartColumn(value *int32)() { + m.start_column = value +} +// SetStartLine sets the start_line property value. The start_line property +func (m *CheckAnnotation) SetStartLine(value *int32)() { + m.start_line = value +} +// SetTitle sets the title property value. The title property +func (m *CheckAnnotation) SetTitle(value *string)() { + m.title = value +} +type CheckAnnotationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAnnotationLevel()(*string) + GetBlobHref()(*string) + GetEndColumn()(*int32) + GetEndLine()(*int32) + GetMessage()(*string) + GetPath()(*string) + GetRawDetails()(*string) + GetStartColumn()(*int32) + GetStartLine()(*int32) + GetTitle()(*string) + SetAnnotationLevel(value *string)() + SetBlobHref(value *string)() + SetEndColumn(value *int32)() + SetEndLine(value *int32)() + SetMessage(value *string)() + SetPath(value *string)() + SetRawDetails(value *string)() + SetStartColumn(value *int32)() + SetStartLine(value *int32)() + SetTitle(value *string)() +} diff --git a/pkg/github/models/check_automated_security_fixes.go b/pkg/github/models/check_automated_security_fixes.go new file mode 100644 index 00000000..a20c43b6 --- /dev/null +++ b/pkg/github/models/check_automated_security_fixes.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CheckAutomatedSecurityFixes check Automated Security Fixes +type CheckAutomatedSecurityFixes 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 automated security fixes are enabled for the repository. + enabled *bool + // Whether automated security fixes are paused for the repository. + paused *bool +} +// NewCheckAutomatedSecurityFixes instantiates a new CheckAutomatedSecurityFixes and sets the default values. +func NewCheckAutomatedSecurityFixes()(*CheckAutomatedSecurityFixes) { + m := &CheckAutomatedSecurityFixes{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckAutomatedSecurityFixesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckAutomatedSecurityFixesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckAutomatedSecurityFixes(), 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 *CheckAutomatedSecurityFixes) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. Whether automated security fixes are enabled for the repository. +// returns a *bool when successful +func (m *CheckAutomatedSecurityFixes) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckAutomatedSecurityFixes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["paused"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPaused(val) + } + return nil + } + return res +} +// GetPaused gets the paused property value. Whether automated security fixes are paused for the repository. +// returns a *bool when successful +func (m *CheckAutomatedSecurityFixes) GetPaused()(*bool) { + return m.paused +} +// Serialize serializes information the current object +func (m *CheckAutomatedSecurityFixes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("paused", m.GetPaused()) + 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 *CheckAutomatedSecurityFixes) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. Whether automated security fixes are enabled for the repository. +func (m *CheckAutomatedSecurityFixes) SetEnabled(value *bool)() { + m.enabled = value +} +// SetPaused sets the paused property value. Whether automated security fixes are paused for the repository. +func (m *CheckAutomatedSecurityFixes) SetPaused(value *bool)() { + m.paused = value +} +type CheckAutomatedSecurityFixesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetPaused()(*bool) + SetEnabled(value *bool)() + SetPaused(value *bool)() +} diff --git a/pkg/github/models/check_run.go b/pkg/github/models/check_run.go new file mode 100644 index 00000000..b8103358 --- /dev/null +++ b/pkg/github/models/check_run.go @@ -0,0 +1,560 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CheckRun a check performed on the code of a given code change +type CheckRun struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + app NullableIntegrationable + // The check_suite property + check_suite CheckRun_check_suiteable + // The completed_at property + completed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The conclusion property + conclusion *CheckRun_conclusion + // A deployment created as the result of an Actions check run from a workflow that references an environment + deployment DeploymentSimpleable + // The details_url property + details_url *string + // The external_id property + external_id *string + // The SHA of the commit that is being checked. + head_sha *string + // The html_url property + html_url *string + // The id of the check. + id *int64 + // The name of the check. + name *string + // The node_id property + node_id *string + // The output property + output CheckRun_outputable + // Pull requests that are open with a `head_sha` or `head_branch` that matches the check. The returned pull requests do not necessarily indicate pull requests that triggered the check. + pull_requests []PullRequestMinimalable + // The started_at property + started_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The phase of the lifecycle that the check is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check runs. + status *CheckRun_status + // The url property + url *string +} +// NewCheckRun instantiates a new CheckRun and sets the default values. +func NewCheckRun()(*CheckRun) { + m := &CheckRun{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckRunFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckRunFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckRun(), 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 *CheckRun) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApp gets the app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *CheckRun) GetApp()(NullableIntegrationable) { + return m.app +} +// GetCheckSuite gets the check_suite property value. The check_suite property +// returns a CheckRun_check_suiteable when successful +func (m *CheckRun) GetCheckSuite()(CheckRun_check_suiteable) { + return m.check_suite +} +// GetCompletedAt gets the completed_at property value. The completed_at property +// returns a *Time when successful +func (m *CheckRun) GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.completed_at +} +// GetConclusion gets the conclusion property value. The conclusion property +// returns a *CheckRun_conclusion when successful +func (m *CheckRun) GetConclusion()(*CheckRun_conclusion) { + return m.conclusion +} +// GetDeployment gets the deployment property value. A deployment created as the result of an Actions check run from a workflow that references an environment +// returns a DeploymentSimpleable when successful +func (m *CheckRun) GetDeployment()(DeploymentSimpleable) { + return m.deployment +} +// GetDetailsUrl gets the details_url property value. The details_url property +// returns a *string when successful +func (m *CheckRun) GetDetailsUrl()(*string) { + return m.details_url +} +// GetExternalId gets the external_id property value. The external_id property +// returns a *string when successful +func (m *CheckRun) GetExternalId()(*string) { + return m.external_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckRun) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetApp(val.(NullableIntegrationable)) + } + return nil + } + res["check_suite"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCheckRun_check_suiteFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCheckSuite(val.(CheckRun_check_suiteable)) + } + return nil + } + res["completed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCompletedAt(val) + } + return nil + } + res["conclusion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCheckRun_conclusion) + if err != nil { + return err + } + if val != nil { + m.SetConclusion(val.(*CheckRun_conclusion)) + } + return nil + } + res["deployment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDeploymentSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDeployment(val.(DeploymentSimpleable)) + } + return nil + } + res["details_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDetailsUrl(val) + } + return nil + } + res["external_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExternalId(val) + } + return nil + } + res["head_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadSha(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["output"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCheckRun_outputFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOutput(val.(CheckRun_outputable)) + } + return nil + } + res["pull_requests"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePullRequestMinimalFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PullRequestMinimalable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PullRequestMinimalable) + } + } + m.SetPullRequests(res) + } + 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(ParseCheckRun_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*CheckRun_status)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHeadSha gets the head_sha property value. The SHA of the commit that is being checked. +// returns a *string when successful +func (m *CheckRun) GetHeadSha()(*string) { + return m.head_sha +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CheckRun) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id of the check. +// returns a *int64 when successful +func (m *CheckRun) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name of the check. +// returns a *string when successful +func (m *CheckRun) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *CheckRun) GetNodeId()(*string) { + return m.node_id +} +// GetOutput gets the output property value. The output property +// returns a CheckRun_outputable when successful +func (m *CheckRun) GetOutput()(CheckRun_outputable) { + return m.output +} +// GetPullRequests gets the pull_requests property value. Pull requests that are open with a `head_sha` or `head_branch` that matches the check. The returned pull requests do not necessarily indicate pull requests that triggered the check. +// returns a []PullRequestMinimalable when successful +func (m *CheckRun) GetPullRequests()([]PullRequestMinimalable) { + return m.pull_requests +} +// GetStartedAt gets the started_at property value. The started_at property +// returns a *Time when successful +func (m *CheckRun) GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.started_at +} +// GetStatus gets the status property value. The phase of the lifecycle that the check is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check runs. +// returns a *CheckRun_status when successful +func (m *CheckRun) GetStatus()(*CheckRun_status) { + return m.status +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CheckRun) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CheckRun) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("app", m.GetApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("check_suite", m.GetCheckSuite()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("completed_at", m.GetCompletedAt()) + if err != nil { + return err + } + } + if m.GetConclusion() != nil { + cast := (*m.GetConclusion()).String() + err := writer.WriteStringValue("conclusion", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("deployment", m.GetDeployment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("details_url", m.GetDetailsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("external_id", m.GetExternalId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_sha", m.GetHeadSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("output", m.GetOutput()) + if err != nil { + return err + } + } + if m.GetPullRequests() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetPullRequests())) + for i, v := range m.GetPullRequests() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("pull_requests", cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("started_at", m.GetStartedAt()) + 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.WriteStringValue("url", m.GetUrl()) + 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 *CheckRun) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApp sets the app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *CheckRun) SetApp(value NullableIntegrationable)() { + m.app = value +} +// SetCheckSuite sets the check_suite property value. The check_suite property +func (m *CheckRun) SetCheckSuite(value CheckRun_check_suiteable)() { + m.check_suite = value +} +// SetCompletedAt sets the completed_at property value. The completed_at property +func (m *CheckRun) SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.completed_at = value +} +// SetConclusion sets the conclusion property value. The conclusion property +func (m *CheckRun) SetConclusion(value *CheckRun_conclusion)() { + m.conclusion = value +} +// SetDeployment sets the deployment property value. A deployment created as the result of an Actions check run from a workflow that references an environment +func (m *CheckRun) SetDeployment(value DeploymentSimpleable)() { + m.deployment = value +} +// SetDetailsUrl sets the details_url property value. The details_url property +func (m *CheckRun) SetDetailsUrl(value *string)() { + m.details_url = value +} +// SetExternalId sets the external_id property value. The external_id property +func (m *CheckRun) SetExternalId(value *string)() { + m.external_id = value +} +// SetHeadSha sets the head_sha property value. The SHA of the commit that is being checked. +func (m *CheckRun) SetHeadSha(value *string)() { + m.head_sha = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CheckRun) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id of the check. +func (m *CheckRun) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name of the check. +func (m *CheckRun) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *CheckRun) SetNodeId(value *string)() { + m.node_id = value +} +// SetOutput sets the output property value. The output property +func (m *CheckRun) SetOutput(value CheckRun_outputable)() { + m.output = value +} +// SetPullRequests sets the pull_requests property value. Pull requests that are open with a `head_sha` or `head_branch` that matches the check. The returned pull requests do not necessarily indicate pull requests that triggered the check. +func (m *CheckRun) SetPullRequests(value []PullRequestMinimalable)() { + m.pull_requests = value +} +// SetStartedAt sets the started_at property value. The started_at property +func (m *CheckRun) SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.started_at = value +} +// SetStatus sets the status property value. The phase of the lifecycle that the check is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check runs. +func (m *CheckRun) SetStatus(value *CheckRun_status)() { + m.status = value +} +// SetUrl sets the url property value. The url property +func (m *CheckRun) SetUrl(value *string)() { + m.url = value +} +type CheckRunable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApp()(NullableIntegrationable) + GetCheckSuite()(CheckRun_check_suiteable) + GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetConclusion()(*CheckRun_conclusion) + GetDeployment()(DeploymentSimpleable) + GetDetailsUrl()(*string) + GetExternalId()(*string) + GetHeadSha()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetName()(*string) + GetNodeId()(*string) + GetOutput()(CheckRun_outputable) + GetPullRequests()([]PullRequestMinimalable) + GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetStatus()(*CheckRun_status) + GetUrl()(*string) + SetApp(value NullableIntegrationable)() + SetCheckSuite(value CheckRun_check_suiteable)() + SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetConclusion(value *CheckRun_conclusion)() + SetDeployment(value DeploymentSimpleable)() + SetDetailsUrl(value *string)() + SetExternalId(value *string)() + SetHeadSha(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetName(value *string)() + SetNodeId(value *string)() + SetOutput(value CheckRun_outputable)() + SetPullRequests(value []PullRequestMinimalable)() + SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetStatus(value *CheckRun_status)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/check_run_escaped_check_escaped_suite.go b/pkg/github/models/check_run_escaped_check_escaped_suite.go new file mode 100644 index 00000000..8fce07b5 --- /dev/null +++ b/pkg/github/models/check_run_escaped_check_escaped_suite.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CheckRun_check_suite struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 +} +// NewCheckRun_check_suite instantiates a new CheckRun_check_suite and sets the default values. +func NewCheckRun_check_suite()(*CheckRun_check_suite) { + m := &CheckRun_check_suite{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckRun_check_suiteFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckRun_check_suiteFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckRun_check_suite(), 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 *CheckRun_check_suite) 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 *CheckRun_check_suite) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *CheckRun_check_suite) GetId()(*int32) { + return m.id +} +// Serialize serializes information the current object +func (m *CheckRun_check_suite) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + 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 *CheckRun_check_suite) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *CheckRun_check_suite) SetId(value *int32)() { + m.id = value +} +type CheckRun_check_suiteable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + SetId(value *int32)() +} diff --git a/pkg/github/models/check_run_escaped_conclusion.go b/pkg/github/models/check_run_escaped_conclusion.go new file mode 100644 index 00000000..d414323d --- /dev/null +++ b/pkg/github/models/check_run_escaped_conclusion.go @@ -0,0 +1,48 @@ +package models +type CheckRun_conclusion int + +const ( + SUCCESS_CHECKRUN_CONCLUSION CheckRun_conclusion = iota + FAILURE_CHECKRUN_CONCLUSION + NEUTRAL_CHECKRUN_CONCLUSION + CANCELLED_CHECKRUN_CONCLUSION + SKIPPED_CHECKRUN_CONCLUSION + TIMED_OUT_CHECKRUN_CONCLUSION + ACTION_REQUIRED_CHECKRUN_CONCLUSION +) + +func (i CheckRun_conclusion) String() string { + return []string{"success", "failure", "neutral", "cancelled", "skipped", "timed_out", "action_required"}[i] +} +func ParseCheckRun_conclusion(v string) (any, error) { + result := SUCCESS_CHECKRUN_CONCLUSION + switch v { + case "success": + result = SUCCESS_CHECKRUN_CONCLUSION + case "failure": + result = FAILURE_CHECKRUN_CONCLUSION + case "neutral": + result = NEUTRAL_CHECKRUN_CONCLUSION + case "cancelled": + result = CANCELLED_CHECKRUN_CONCLUSION + case "skipped": + result = SKIPPED_CHECKRUN_CONCLUSION + case "timed_out": + result = TIMED_OUT_CHECKRUN_CONCLUSION + case "action_required": + result = ACTION_REQUIRED_CHECKRUN_CONCLUSION + default: + return nil, nil + } + return &result, nil +} +func SerializeCheckRun_conclusion(values []CheckRun_conclusion) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CheckRun_conclusion) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/check_run_escaped_output.go b/pkg/github/models/check_run_escaped_output.go new file mode 100644 index 00000000..0efeda15 --- /dev/null +++ b/pkg/github/models/check_run_escaped_output.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CheckRun_output 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 annotations_count property + annotations_count *int32 + // The annotations_url property + annotations_url *string + // The summary property + summary *string + // The text property + text *string + // The title property + title *string +} +// NewCheckRun_output instantiates a new CheckRun_output and sets the default values. +func NewCheckRun_output()(*CheckRun_output) { + m := &CheckRun_output{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckRun_outputFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckRun_outputFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckRun_output(), 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 *CheckRun_output) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAnnotationsCount gets the annotations_count property value. The annotations_count property +// returns a *int32 when successful +func (m *CheckRun_output) GetAnnotationsCount()(*int32) { + return m.annotations_count +} +// GetAnnotationsUrl gets the annotations_url property value. The annotations_url property +// returns a *string when successful +func (m *CheckRun_output) GetAnnotationsUrl()(*string) { + return m.annotations_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckRun_output) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["annotations_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAnnotationsCount(val) + } + return nil + } + res["annotations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAnnotationsUrl(val) + } + return nil + } + res["summary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSummary(val) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetSummary gets the summary property value. The summary property +// returns a *string when successful +func (m *CheckRun_output) GetSummary()(*string) { + return m.summary +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *CheckRun_output) GetText()(*string) { + return m.text +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *CheckRun_output) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *CheckRun_output) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("annotations_count", m.GetAnnotationsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("annotations_url", m.GetAnnotationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("summary", m.GetSummary()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *CheckRun_output) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAnnotationsCount sets the annotations_count property value. The annotations_count property +func (m *CheckRun_output) SetAnnotationsCount(value *int32)() { + m.annotations_count = value +} +// SetAnnotationsUrl sets the annotations_url property value. The annotations_url property +func (m *CheckRun_output) SetAnnotationsUrl(value *string)() { + m.annotations_url = value +} +// SetSummary sets the summary property value. The summary property +func (m *CheckRun_output) SetSummary(value *string)() { + m.summary = value +} +// SetText sets the text property value. The text property +func (m *CheckRun_output) SetText(value *string)() { + m.text = value +} +// SetTitle sets the title property value. The title property +func (m *CheckRun_output) SetTitle(value *string)() { + m.title = value +} +type CheckRun_outputable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAnnotationsCount()(*int32) + GetAnnotationsUrl()(*string) + GetSummary()(*string) + GetText()(*string) + GetTitle()(*string) + SetAnnotationsCount(value *int32)() + SetAnnotationsUrl(value *string)() + SetSummary(value *string)() + SetText(value *string)() + SetTitle(value *string)() +} diff --git a/pkg/github/models/check_run_escaped_status.go b/pkg/github/models/check_run_escaped_status.go new file mode 100644 index 00000000..2314d9f7 --- /dev/null +++ b/pkg/github/models/check_run_escaped_status.go @@ -0,0 +1,46 @@ +package models +// The phase of the lifecycle that the check is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check runs. +type CheckRun_status int + +const ( + QUEUED_CHECKRUN_STATUS CheckRun_status = iota + IN_PROGRESS_CHECKRUN_STATUS + COMPLETED_CHECKRUN_STATUS + WAITING_CHECKRUN_STATUS + REQUESTED_CHECKRUN_STATUS + PENDING_CHECKRUN_STATUS +) + +func (i CheckRun_status) String() string { + return []string{"queued", "in_progress", "completed", "waiting", "requested", "pending"}[i] +} +func ParseCheckRun_status(v string) (any, error) { + result := QUEUED_CHECKRUN_STATUS + switch v { + case "queued": + result = QUEUED_CHECKRUN_STATUS + case "in_progress": + result = IN_PROGRESS_CHECKRUN_STATUS + case "completed": + result = COMPLETED_CHECKRUN_STATUS + case "waiting": + result = WAITING_CHECKRUN_STATUS + case "requested": + result = REQUESTED_CHECKRUN_STATUS + case "pending": + result = PENDING_CHECKRUN_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeCheckRun_status(values []CheckRun_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CheckRun_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/check_suite.go b/pkg/github/models/check_suite.go new file mode 100644 index 00000000..bd0ab8e4 --- /dev/null +++ b/pkg/github/models/check_suite.go @@ -0,0 +1,618 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CheckSuite a suite of checks performed on the code of a given code change +type CheckSuite 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 after property + after *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + app NullableIntegrationable + // The before property + before *string + // The check_runs_url property + check_runs_url *string + // The conclusion property + conclusion *CheckSuite_conclusion + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The head_branch property + head_branch *string + // A commit. + head_commit SimpleCommitable + // The SHA of the head commit that is being checked. + head_sha *string + // The id property + id *int32 + // The latest_check_runs_count property + latest_check_runs_count *int32 + // The node_id property + node_id *string + // The pull_requests property + pull_requests []PullRequestMinimalable + // Minimal Repository + repository MinimalRepositoryable + // The rerequestable property + rerequestable *bool + // The runs_rerequestable property + runs_rerequestable *bool + // The phase of the lifecycle that the check suite is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check suites. + status *CheckSuite_status + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewCheckSuite instantiates a new CheckSuite and sets the default values. +func NewCheckSuite()(*CheckSuite) { + m := &CheckSuite{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckSuiteFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckSuiteFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckSuite(), 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 *CheckSuite) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAfter gets the after property value. The after property +// returns a *string when successful +func (m *CheckSuite) GetAfter()(*string) { + return m.after +} +// GetApp gets the app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *CheckSuite) GetApp()(NullableIntegrationable) { + return m.app +} +// GetBefore gets the before property value. The before property +// returns a *string when successful +func (m *CheckSuite) GetBefore()(*string) { + return m.before +} +// GetCheckRunsUrl gets the check_runs_url property value. The check_runs_url property +// returns a *string when successful +func (m *CheckSuite) GetCheckRunsUrl()(*string) { + return m.check_runs_url +} +// GetConclusion gets the conclusion property value. The conclusion property +// returns a *CheckSuite_conclusion when successful +func (m *CheckSuite) GetConclusion()(*CheckSuite_conclusion) { + return m.conclusion +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *CheckSuite) 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 *CheckSuite) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["after"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAfter(val) + } + return nil + } + res["app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetApp(val.(NullableIntegrationable)) + } + return nil + } + res["before"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBefore(val) + } + return nil + } + res["check_runs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCheckRunsUrl(val) + } + return nil + } + res["conclusion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCheckSuite_conclusion) + if err != nil { + return err + } + if val != nil { + m.SetConclusion(val.(*CheckSuite_conclusion)) + } + return nil + } + 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["head_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadBranch(val) + } + return nil + } + res["head_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleCommitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHeadCommit(val.(SimpleCommitable)) + } + return nil + } + res["head_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadSha(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["latest_check_runs_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLatestCheckRunsCount(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["pull_requests"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePullRequestMinimalFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PullRequestMinimalable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PullRequestMinimalable) + } + } + m.SetPullRequests(res) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["rerequestable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRerequestable(val) + } + return nil + } + res["runs_rerequestable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRunsRerequestable(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCheckSuite_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*CheckSuite_status)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHeadBranch gets the head_branch property value. The head_branch property +// returns a *string when successful +func (m *CheckSuite) GetHeadBranch()(*string) { + return m.head_branch +} +// GetHeadCommit gets the head_commit property value. A commit. +// returns a SimpleCommitable when successful +func (m *CheckSuite) GetHeadCommit()(SimpleCommitable) { + return m.head_commit +} +// GetHeadSha gets the head_sha property value. The SHA of the head commit that is being checked. +// returns a *string when successful +func (m *CheckSuite) GetHeadSha()(*string) { + return m.head_sha +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *CheckSuite) GetId()(*int32) { + return m.id +} +// GetLatestCheckRunsCount gets the latest_check_runs_count property value. The latest_check_runs_count property +// returns a *int32 when successful +func (m *CheckSuite) GetLatestCheckRunsCount()(*int32) { + return m.latest_check_runs_count +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *CheckSuite) GetNodeId()(*string) { + return m.node_id +} +// GetPullRequests gets the pull_requests property value. The pull_requests property +// returns a []PullRequestMinimalable when successful +func (m *CheckSuite) GetPullRequests()([]PullRequestMinimalable) { + return m.pull_requests +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *CheckSuite) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetRerequestable gets the rerequestable property value. The rerequestable property +// returns a *bool when successful +func (m *CheckSuite) GetRerequestable()(*bool) { + return m.rerequestable +} +// GetRunsRerequestable gets the runs_rerequestable property value. The runs_rerequestable property +// returns a *bool when successful +func (m *CheckSuite) GetRunsRerequestable()(*bool) { + return m.runs_rerequestable +} +// GetStatus gets the status property value. The phase of the lifecycle that the check suite is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check suites. +// returns a *CheckSuite_status when successful +func (m *CheckSuite) GetStatus()(*CheckSuite_status) { + return m.status +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *CheckSuite) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CheckSuite) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CheckSuite) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("after", m.GetAfter()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("app", m.GetApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("before", m.GetBefore()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("check_runs_url", m.GetCheckRunsUrl()) + if err != nil { + return err + } + } + if m.GetConclusion() != nil { + cast := (*m.GetConclusion()).String() + err := writer.WriteStringValue("conclusion", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_branch", m.GetHeadBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("head_commit", m.GetHeadCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_sha", m.GetHeadSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("latest_check_runs_count", m.GetLatestCheckRunsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetPullRequests() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetPullRequests())) + for i, v := range m.GetPullRequests() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("pull_requests", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("rerequestable", m.GetRerequestable()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("runs_rerequestable", m.GetRunsRerequestable()) + 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.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CheckSuite) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAfter sets the after property value. The after property +func (m *CheckSuite) SetAfter(value *string)() { + m.after = value +} +// SetApp sets the app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *CheckSuite) SetApp(value NullableIntegrationable)() { + m.app = value +} +// SetBefore sets the before property value. The before property +func (m *CheckSuite) SetBefore(value *string)() { + m.before = value +} +// SetCheckRunsUrl sets the check_runs_url property value. The check_runs_url property +func (m *CheckSuite) SetCheckRunsUrl(value *string)() { + m.check_runs_url = value +} +// SetConclusion sets the conclusion property value. The conclusion property +func (m *CheckSuite) SetConclusion(value *CheckSuite_conclusion)() { + m.conclusion = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *CheckSuite) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHeadBranch sets the head_branch property value. The head_branch property +func (m *CheckSuite) SetHeadBranch(value *string)() { + m.head_branch = value +} +// SetHeadCommit sets the head_commit property value. A commit. +func (m *CheckSuite) SetHeadCommit(value SimpleCommitable)() { + m.head_commit = value +} +// SetHeadSha sets the head_sha property value. The SHA of the head commit that is being checked. +func (m *CheckSuite) SetHeadSha(value *string)() { + m.head_sha = value +} +// SetId sets the id property value. The id property +func (m *CheckSuite) SetId(value *int32)() { + m.id = value +} +// SetLatestCheckRunsCount sets the latest_check_runs_count property value. The latest_check_runs_count property +func (m *CheckSuite) SetLatestCheckRunsCount(value *int32)() { + m.latest_check_runs_count = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *CheckSuite) SetNodeId(value *string)() { + m.node_id = value +} +// SetPullRequests sets the pull_requests property value. The pull_requests property +func (m *CheckSuite) SetPullRequests(value []PullRequestMinimalable)() { + m.pull_requests = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *CheckSuite) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetRerequestable sets the rerequestable property value. The rerequestable property +func (m *CheckSuite) SetRerequestable(value *bool)() { + m.rerequestable = value +} +// SetRunsRerequestable sets the runs_rerequestable property value. The runs_rerequestable property +func (m *CheckSuite) SetRunsRerequestable(value *bool)() { + m.runs_rerequestable = value +} +// SetStatus sets the status property value. The phase of the lifecycle that the check suite is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check suites. +func (m *CheckSuite) SetStatus(value *CheckSuite_status)() { + m.status = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *CheckSuite) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *CheckSuite) SetUrl(value *string)() { + m.url = value +} +type CheckSuiteable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAfter()(*string) + GetApp()(NullableIntegrationable) + GetBefore()(*string) + GetCheckRunsUrl()(*string) + GetConclusion()(*CheckSuite_conclusion) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHeadBranch()(*string) + GetHeadCommit()(SimpleCommitable) + GetHeadSha()(*string) + GetId()(*int32) + GetLatestCheckRunsCount()(*int32) + GetNodeId()(*string) + GetPullRequests()([]PullRequestMinimalable) + GetRepository()(MinimalRepositoryable) + GetRerequestable()(*bool) + GetRunsRerequestable()(*bool) + GetStatus()(*CheckSuite_status) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAfter(value *string)() + SetApp(value NullableIntegrationable)() + SetBefore(value *string)() + SetCheckRunsUrl(value *string)() + SetConclusion(value *CheckSuite_conclusion)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHeadBranch(value *string)() + SetHeadCommit(value SimpleCommitable)() + SetHeadSha(value *string)() + SetId(value *int32)() + SetLatestCheckRunsCount(value *int32)() + SetNodeId(value *string)() + SetPullRequests(value []PullRequestMinimalable)() + SetRepository(value MinimalRepositoryable)() + SetRerequestable(value *bool)() + SetRunsRerequestable(value *bool)() + SetStatus(value *CheckSuite_status)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/check_suite_escaped_conclusion.go b/pkg/github/models/check_suite_escaped_conclusion.go new file mode 100644 index 00000000..5ef4132d --- /dev/null +++ b/pkg/github/models/check_suite_escaped_conclusion.go @@ -0,0 +1,54 @@ +package models +type CheckSuite_conclusion int + +const ( + SUCCESS_CHECKSUITE_CONCLUSION CheckSuite_conclusion = iota + FAILURE_CHECKSUITE_CONCLUSION + NEUTRAL_CHECKSUITE_CONCLUSION + CANCELLED_CHECKSUITE_CONCLUSION + SKIPPED_CHECKSUITE_CONCLUSION + TIMED_OUT_CHECKSUITE_CONCLUSION + ACTION_REQUIRED_CHECKSUITE_CONCLUSION + STARTUP_FAILURE_CHECKSUITE_CONCLUSION + STALE_CHECKSUITE_CONCLUSION +) + +func (i CheckSuite_conclusion) String() string { + return []string{"success", "failure", "neutral", "cancelled", "skipped", "timed_out", "action_required", "startup_failure", "stale"}[i] +} +func ParseCheckSuite_conclusion(v string) (any, error) { + result := SUCCESS_CHECKSUITE_CONCLUSION + switch v { + case "success": + result = SUCCESS_CHECKSUITE_CONCLUSION + case "failure": + result = FAILURE_CHECKSUITE_CONCLUSION + case "neutral": + result = NEUTRAL_CHECKSUITE_CONCLUSION + case "cancelled": + result = CANCELLED_CHECKSUITE_CONCLUSION + case "skipped": + result = SKIPPED_CHECKSUITE_CONCLUSION + case "timed_out": + result = TIMED_OUT_CHECKSUITE_CONCLUSION + case "action_required": + result = ACTION_REQUIRED_CHECKSUITE_CONCLUSION + case "startup_failure": + result = STARTUP_FAILURE_CHECKSUITE_CONCLUSION + case "stale": + result = STALE_CHECKSUITE_CONCLUSION + default: + return nil, nil + } + return &result, nil +} +func SerializeCheckSuite_conclusion(values []CheckSuite_conclusion) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CheckSuite_conclusion) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/check_suite_escaped_status.go b/pkg/github/models/check_suite_escaped_status.go new file mode 100644 index 00000000..282eb79e --- /dev/null +++ b/pkg/github/models/check_suite_escaped_status.go @@ -0,0 +1,46 @@ +package models +// The phase of the lifecycle that the check suite is currently in. Statuses of waiting, requested, and pending are reserved for GitHub Actions check suites. +type CheckSuite_status int + +const ( + QUEUED_CHECKSUITE_STATUS CheckSuite_status = iota + IN_PROGRESS_CHECKSUITE_STATUS + COMPLETED_CHECKSUITE_STATUS + WAITING_CHECKSUITE_STATUS + REQUESTED_CHECKSUITE_STATUS + PENDING_CHECKSUITE_STATUS +) + +func (i CheckSuite_status) String() string { + return []string{"queued", "in_progress", "completed", "waiting", "requested", "pending"}[i] +} +func ParseCheckSuite_status(v string) (any, error) { + result := QUEUED_CHECKSUITE_STATUS + switch v { + case "queued": + result = QUEUED_CHECKSUITE_STATUS + case "in_progress": + result = IN_PROGRESS_CHECKSUITE_STATUS + case "completed": + result = COMPLETED_CHECKSUITE_STATUS + case "waiting": + result = WAITING_CHECKSUITE_STATUS + case "requested": + result = REQUESTED_CHECKSUITE_STATUS + case "pending": + result = PENDING_CHECKSUITE_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeCheckSuite_status(values []CheckSuite_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CheckSuite_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/check_suite_preference.go b/pkg/github/models/check_suite_preference.go new file mode 100644 index 00000000..3c504dc9 --- /dev/null +++ b/pkg/github/models/check_suite_preference.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CheckSuitePreference check suite configuration preferences for a repository. +type CheckSuitePreference 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 preferences property + preferences CheckSuitePreference_preferencesable + // Minimal Repository + repository MinimalRepositoryable +} +// NewCheckSuitePreference instantiates a new CheckSuitePreference and sets the default values. +func NewCheckSuitePreference()(*CheckSuitePreference) { + m := &CheckSuitePreference{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckSuitePreferenceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckSuitePreferenceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckSuitePreference(), 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 *CheckSuitePreference) 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 *CheckSuitePreference) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["preferences"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCheckSuitePreference_preferencesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPreferences(val.(CheckSuitePreference_preferencesable)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + return res +} +// GetPreferences gets the preferences property value. The preferences property +// returns a CheckSuitePreference_preferencesable when successful +func (m *CheckSuitePreference) GetPreferences()(CheckSuitePreference_preferencesable) { + return m.preferences +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *CheckSuitePreference) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// Serialize serializes information the current object +func (m *CheckSuitePreference) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("preferences", m.GetPreferences()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + 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 *CheckSuitePreference) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPreferences sets the preferences property value. The preferences property +func (m *CheckSuitePreference) SetPreferences(value CheckSuitePreference_preferencesable)() { + m.preferences = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *CheckSuitePreference) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +type CheckSuitePreferenceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPreferences()(CheckSuitePreference_preferencesable) + GetRepository()(MinimalRepositoryable) + SetPreferences(value CheckSuitePreference_preferencesable)() + SetRepository(value MinimalRepositoryable)() +} diff --git a/pkg/github/models/check_suite_preference_escaped_preferences.go b/pkg/github/models/check_suite_preference_escaped_preferences.go new file mode 100644 index 00000000..5109327e --- /dev/null +++ b/pkg/github/models/check_suite_preference_escaped_preferences.go @@ -0,0 +1,92 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CheckSuitePreference_preferences 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 auto_trigger_checks property + auto_trigger_checks []CheckSuitePreference_preferences_auto_trigger_checksable +} +// NewCheckSuitePreference_preferences instantiates a new CheckSuitePreference_preferences and sets the default values. +func NewCheckSuitePreference_preferences()(*CheckSuitePreference_preferences) { + m := &CheckSuitePreference_preferences{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckSuitePreference_preferencesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckSuitePreference_preferencesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckSuitePreference_preferences(), 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 *CheckSuitePreference_preferences) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAutoTriggerChecks gets the auto_trigger_checks property value. The auto_trigger_checks property +// returns a []CheckSuitePreference_preferences_auto_trigger_checksable when successful +func (m *CheckSuitePreference_preferences) GetAutoTriggerChecks()([]CheckSuitePreference_preferences_auto_trigger_checksable) { + return m.auto_trigger_checks +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckSuitePreference_preferences) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["auto_trigger_checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCheckSuitePreference_preferences_auto_trigger_checksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CheckSuitePreference_preferences_auto_trigger_checksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CheckSuitePreference_preferences_auto_trigger_checksable) + } + } + m.SetAutoTriggerChecks(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *CheckSuitePreference_preferences) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAutoTriggerChecks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAutoTriggerChecks())) + for i, v := range m.GetAutoTriggerChecks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("auto_trigger_checks", 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 *CheckSuitePreference_preferences) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAutoTriggerChecks sets the auto_trigger_checks property value. The auto_trigger_checks property +func (m *CheckSuitePreference_preferences) SetAutoTriggerChecks(value []CheckSuitePreference_preferences_auto_trigger_checksable)() { + m.auto_trigger_checks = value +} +type CheckSuitePreference_preferencesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAutoTriggerChecks()([]CheckSuitePreference_preferences_auto_trigger_checksable) + SetAutoTriggerChecks(value []CheckSuitePreference_preferences_auto_trigger_checksable)() +} diff --git a/pkg/github/models/check_suite_preference_escaped_preferences_escaped_auto_escaped_trigger_escaped_checks.go b/pkg/github/models/check_suite_preference_escaped_preferences_escaped_auto_escaped_trigger_escaped_checks.go new file mode 100644 index 00000000..3c850978 --- /dev/null +++ b/pkg/github/models/check_suite_preference_escaped_preferences_escaped_auto_escaped_trigger_escaped_checks.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CheckSuitePreference_preferences_auto_trigger_checks 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 app_id property + app_id *int32 + // The setting property + setting *bool +} +// NewCheckSuitePreference_preferences_auto_trigger_checks instantiates a new CheckSuitePreference_preferences_auto_trigger_checks and sets the default values. +func NewCheckSuitePreference_preferences_auto_trigger_checks()(*CheckSuitePreference_preferences_auto_trigger_checks) { + m := &CheckSuitePreference_preferences_auto_trigger_checks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCheckSuitePreference_preferences_auto_trigger_checksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckSuitePreference_preferences_auto_trigger_checksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCheckSuitePreference_preferences_auto_trigger_checks(), 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 *CheckSuitePreference_preferences_auto_trigger_checks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAppId gets the app_id property value. The app_id property +// returns a *int32 when successful +func (m *CheckSuitePreference_preferences_auto_trigger_checks) GetAppId()(*int32) { + return m.app_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckSuitePreference_preferences_auto_trigger_checks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSetting(val) + } + return nil + } + return res +} +// GetSetting gets the setting property value. The setting property +// returns a *bool when successful +func (m *CheckSuitePreference_preferences_auto_trigger_checks) GetSetting()(*bool) { + return m.setting +} +// Serialize serializes information the current object +func (m *CheckSuitePreference_preferences_auto_trigger_checks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("app_id", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("setting", m.GetSetting()) + 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 *CheckSuitePreference_preferences_auto_trigger_checks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAppId sets the app_id property value. The app_id property +func (m *CheckSuitePreference_preferences_auto_trigger_checks) SetAppId(value *int32)() { + m.app_id = value +} +// SetSetting sets the setting property value. The setting property +func (m *CheckSuitePreference_preferences_auto_trigger_checks) SetSetting(value *bool)() { + m.setting = value +} +type CheckSuitePreference_preferences_auto_trigger_checksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId()(*int32) + GetSetting()(*bool) + SetAppId(value *int32)() + SetSetting(value *bool)() +} diff --git a/pkg/github/models/code.go b/pkg/github/models/code.go new file mode 100644 index 00000000..f5b14c36 --- /dev/null +++ b/pkg/github/models/code.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Code struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The fragment property + fragment *string + // The matches property + matches []Code_matchesable + // The object_type property + object_type *string + // The object_url property + object_url *string + // The property property + property *string +} +// NewCode instantiates a new Code and sets the default values. +func NewCode()(*Code) { + m := &Code{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCode(), 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 *Code) 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 *Code) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fragment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFragment(val) + } + return nil + } + res["matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCode_matchesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Code_matchesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Code_matchesable) + } + } + m.SetMatches(res) + } + return nil + } + res["object_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectType(val) + } + return nil + } + res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectUrl(val) + } + return nil + } + res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProperty(val) + } + return nil + } + return res +} +// GetFragment gets the fragment property value. The fragment property +// returns a *string when successful +func (m *Code) GetFragment()(*string) { + return m.fragment +} +// GetMatches gets the matches property value. The matches property +// returns a []Code_matchesable when successful +func (m *Code) GetMatches()([]Code_matchesable) { + return m.matches +} +// GetObjectType gets the object_type property value. The object_type property +// returns a *string when successful +func (m *Code) GetObjectType()(*string) { + return m.object_type +} +// GetObjectUrl gets the object_url property value. The object_url property +// returns a *string when successful +func (m *Code) GetObjectUrl()(*string) { + return m.object_url +} +// GetProperty gets the property property value. The property property +// returns a *string when successful +func (m *Code) GetProperty()(*string) { + return m.property +} +// Serialize serializes information the current object +func (m *Code) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("fragment", m.GetFragment()) + if err != nil { + return err + } + } + if m.GetMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMatches())) + for i, v := range m.GetMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_type", m.GetObjectType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_url", m.GetObjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("property", m.GetProperty()) + 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 *Code) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFragment sets the fragment property value. The fragment property +func (m *Code) SetFragment(value *string)() { + m.fragment = value +} +// SetMatches sets the matches property value. The matches property +func (m *Code) SetMatches(value []Code_matchesable)() { + m.matches = value +} +// SetObjectType sets the object_type property value. The object_type property +func (m *Code) SetObjectType(value *string)() { + m.object_type = value +} +// SetObjectUrl sets the object_url property value. The object_url property +func (m *Code) SetObjectUrl(value *string)() { + m.object_url = value +} +// SetProperty sets the property property value. The property property +func (m *Code) SetProperty(value *string)() { + m.property = value +} +type Codeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFragment()(*string) + GetMatches()([]Code_matchesable) + GetObjectType()(*string) + GetObjectUrl()(*string) + GetProperty()(*string) + SetFragment(value *string)() + SetMatches(value []Code_matchesable)() + SetObjectType(value *string)() + SetObjectUrl(value *string)() + SetProperty(value *string)() +} diff --git a/pkg/github/models/code503_error.go b/pkg/github/models/code503_error.go new file mode 100644 index 00000000..f54f2bae --- /dev/null +++ b/pkg/github/models/code503_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 Code503Error 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 +} +// NewCode503Error instantiates a new Code503Error and sets the default values. +func NewCode503Error()(*Code503Error) { + m := &Code503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCode503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCode503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCode503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Code503Error) 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 *Code503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Code503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Code503Error) 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 *Code503Error) 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 *Code503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Code503Error) 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 *Code503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Code503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Code503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Code503Error) SetMessage(value *string)() { + m.message = value +} +type Code503Errorable 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_escaped_matches.go b/pkg/github/models/code_escaped_matches.go new file mode 100644 index 00000000..48e24f51 --- /dev/null +++ b/pkg/github/models/code_escaped_matches.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Code_matches struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The indices property + indices []int32 + // The text property + text *string +} +// NewCode_matches instantiates a new Code_matches and sets the default values. +func NewCode_matches()(*Code_matches) { + m := &Code_matches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCode_matchesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCode_matchesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCode_matches(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Code_matches) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Code_matches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["indices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetIndices(res) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetIndices gets the indices property value. The indices property +// returns a []int32 when successful +func (m *Code_matches) GetIndices()([]int32) { + return m.indices +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *Code_matches) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *Code_matches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIndices() != nil { + err := writer.WriteCollectionOfInt32Values("indices", m.GetIndices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *Code_matches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIndices sets the indices property value. The indices property +func (m *Code_matches) SetIndices(value []int32)() { + m.indices = value +} +// SetText sets the text property value. The text property +func (m *Code_matches) SetText(value *string)() { + m.text = value +} +type Code_matchesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIndices()([]int32) + GetText()(*string) + SetIndices(value []int32)() + SetText(value *string)() +} diff --git a/pkg/github/models/code_of_conduct.go b/pkg/github/models/code_of_conduct.go new file mode 100644 index 00000000..cfe785f7 --- /dev/null +++ b/pkg/github/models/code_of_conduct.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeOfConduct code Of Conduct +type CodeOfConduct 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 body property + body *string + // The html_url property + html_url *string + // The key property + key *string + // The name property + name *string + // The url property + url *string +} +// NewCodeOfConduct instantiates a new CodeOfConduct and sets the default values. +func NewCodeOfConduct()(*CodeOfConduct) { + m := &CodeOfConduct{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeOfConductFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeOfConductFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeOfConduct(), 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 *CodeOfConduct) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *CodeOfConduct) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeOfConduct) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + 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["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CodeOfConduct) GetHtmlUrl()(*string) { + return m.html_url +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *CodeOfConduct) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *CodeOfConduct) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CodeOfConduct) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeOfConduct) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CodeOfConduct) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The body property +func (m *CodeOfConduct) SetBody(value *string)() { + m.body = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CodeOfConduct) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetKey sets the key property value. The key property +func (m *CodeOfConduct) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *CodeOfConduct) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *CodeOfConduct) SetUrl(value *string)() { + m.url = value +} +type CodeOfConductable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetHtmlUrl()(*string) + GetKey()(*string) + GetName()(*string) + GetUrl()(*string) + SetBody(value *string)() + SetHtmlUrl(value *string)() + SetKey(value *string)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/code_of_conduct_simple.go b/pkg/github/models/code_of_conduct_simple.go new file mode 100644 index 00000000..81e59243 --- /dev/null +++ b/pkg/github/models/code_of_conduct_simple.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeOfConductSimple code of Conduct Simple +type CodeOfConductSimple 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 html_url property + html_url *string + // The key property + key *string + // The name property + name *string + // The url property + url *string +} +// NewCodeOfConductSimple instantiates a new CodeOfConductSimple and sets the default values. +func NewCodeOfConductSimple()(*CodeOfConductSimple) { + m := &CodeOfConductSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeOfConductSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeOfConductSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeOfConductSimple(), 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 *CodeOfConductSimple) 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 *CodeOfConductSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + 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["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CodeOfConductSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *CodeOfConductSimple) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *CodeOfConductSimple) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CodeOfConductSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeOfConductSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CodeOfConductSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CodeOfConductSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetKey sets the key property value. The key property +func (m *CodeOfConductSimple) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *CodeOfConductSimple) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *CodeOfConductSimple) SetUrl(value *string)() { + m.url = value +} +type CodeOfConductSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetKey()(*string) + GetName()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetKey(value *string)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/code_scanning_alert.go b/pkg/github/models/code_scanning_alert.go new file mode 100644 index 00000000..125b73c0 --- /dev/null +++ b/pkg/github/models/code_scanning_alert.go @@ -0,0 +1,441 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAlert struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + dismissed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + dismissed_by NullableSimpleUserable + // The dismissal comment associated with the dismissal of the alert. + dismissed_comment *string + // **Required when the state is dismissed.** The reason for dismissing or closing the alert. + dismissed_reason *CodeScanningAlertDismissedReason + // The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + fixed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The GitHub URL of the alert resource. + html_url *string + // The REST API URL for fetching the list of instances for an alert. + instances_url *string + // The most_recent_instance property + most_recent_instance CodeScanningAlertInstanceable + // The security alert number. + number *int32 + // The rule property + rule CodeScanningAlertRuleable + // State of a code scanning alert. + state *CodeScanningAlertState + // The tool property + tool CodeScanningAnalysisToolable + // The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The REST API URL of the alert resource. + url *string +} +// NewCodeScanningAlert instantiates a new CodeScanningAlert and sets the default values. +func NewCodeScanningAlert()(*CodeScanningAlert) { + m := &CodeScanningAlert{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlertFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlertFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlert(), 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 *CodeScanningAlert) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlert) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDismissedAt gets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlert) GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.dismissed_at +} +// GetDismissedBy gets the dismissed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *CodeScanningAlert) GetDismissedBy()(NullableSimpleUserable) { + return m.dismissed_by +} +// GetDismissedComment gets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +// returns a *string when successful +func (m *CodeScanningAlert) GetDismissedComment()(*string) { + return m.dismissed_comment +} +// GetDismissedReason gets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +// returns a *CodeScanningAlertDismissedReason when successful +func (m *CodeScanningAlert) GetDismissedReason()(*CodeScanningAlertDismissedReason) { + return m.dismissed_reason +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAlert) 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["dismissed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedAt(val) + } + return nil + } + res["dismissed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["dismissed_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedComment(val) + } + return nil + } + res["dismissed_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertDismissedReason) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReason(val.(*CodeScanningAlertDismissedReason)) + } + return nil + } + res["fixed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetFixedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["instances_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInstancesUrl(val) + } + return nil + } + res["most_recent_instance"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertInstanceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMostRecentInstance(val.(CodeScanningAlertInstanceable)) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["rule"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRule(val.(CodeScanningAlertRuleable)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*CodeScanningAlertState)) + } + return nil + } + res["tool"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAnalysisToolFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTool(val.(CodeScanningAnalysisToolable)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFixedAt gets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlert) GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.fixed_at +} +// GetHtmlUrl gets the html_url property value. The GitHub URL of the alert resource. +// returns a *string when successful +func (m *CodeScanningAlert) GetHtmlUrl()(*string) { + return m.html_url +} +// GetInstancesUrl gets the instances_url property value. The REST API URL for fetching the list of instances for an alert. +// returns a *string when successful +func (m *CodeScanningAlert) GetInstancesUrl()(*string) { + return m.instances_url +} +// GetMostRecentInstance gets the most_recent_instance property value. The most_recent_instance property +// returns a CodeScanningAlertInstanceable when successful +func (m *CodeScanningAlert) GetMostRecentInstance()(CodeScanningAlertInstanceable) { + return m.most_recent_instance +} +// GetNumber gets the number property value. The security alert number. +// returns a *int32 when successful +func (m *CodeScanningAlert) GetNumber()(*int32) { + return m.number +} +// GetRule gets the rule property value. The rule property +// returns a CodeScanningAlertRuleable when successful +func (m *CodeScanningAlert) GetRule()(CodeScanningAlertRuleable) { + return m.rule +} +// GetState gets the state property value. State of a code scanning alert. +// returns a *CodeScanningAlertState when successful +func (m *CodeScanningAlert) GetState()(*CodeScanningAlertState) { + return m.state +} +// GetTool gets the tool property value. The tool property +// returns a CodeScanningAnalysisToolable when successful +func (m *CodeScanningAlert) GetTool()(CodeScanningAnalysisToolable) { + return m.tool +} +// GetUpdatedAt gets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlert) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The REST API URL of the alert resource. +// returns a *string when successful +func (m *CodeScanningAlert) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeScanningAlert) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dismissed_by", m.GetDismissedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dismissed_comment", m.GetDismissedComment()) + if err != nil { + return err + } + } + if m.GetDismissedReason() != nil { + cast := (*m.GetDismissedReason()).String() + err := writer.WriteStringValue("dismissed_reason", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("most_recent_instance", m.GetMostRecentInstance()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("rule", m.GetRule()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tool", m.GetTool()) + 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 *CodeScanningAlert) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlert) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDismissedAt sets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlert) SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.dismissed_at = value +} +// SetDismissedBy sets the dismissed_by property value. A GitHub user. +func (m *CodeScanningAlert) SetDismissedBy(value NullableSimpleUserable)() { + m.dismissed_by = value +} +// SetDismissedComment sets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +func (m *CodeScanningAlert) SetDismissedComment(value *string)() { + m.dismissed_comment = value +} +// SetDismissedReason sets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +func (m *CodeScanningAlert) SetDismissedReason(value *CodeScanningAlertDismissedReason)() { + m.dismissed_reason = value +} +// SetFixedAt sets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlert) SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.fixed_at = value +} +// SetHtmlUrl sets the html_url property value. The GitHub URL of the alert resource. +func (m *CodeScanningAlert) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetInstancesUrl sets the instances_url property value. The REST API URL for fetching the list of instances for an alert. +func (m *CodeScanningAlert) SetInstancesUrl(value *string)() { + m.instances_url = value +} +// SetMostRecentInstance sets the most_recent_instance property value. The most_recent_instance property +func (m *CodeScanningAlert) SetMostRecentInstance(value CodeScanningAlertInstanceable)() { + m.most_recent_instance = value +} +// SetNumber sets the number property value. The security alert number. +func (m *CodeScanningAlert) SetNumber(value *int32)() { + m.number = value +} +// SetRule sets the rule property value. The rule property +func (m *CodeScanningAlert) SetRule(value CodeScanningAlertRuleable)() { + m.rule = value +} +// SetState sets the state property value. State of a code scanning alert. +func (m *CodeScanningAlert) SetState(value *CodeScanningAlertState)() { + m.state = value +} +// SetTool sets the tool property value. The tool property +func (m *CodeScanningAlert) SetTool(value CodeScanningAnalysisToolable)() { + m.tool = value +} +// SetUpdatedAt sets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlert) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The REST API URL of the alert resource. +func (m *CodeScanningAlert) SetUrl(value *string)() { + m.url = value +} +type CodeScanningAlertable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedBy()(NullableSimpleUserable) + GetDismissedComment()(*string) + GetDismissedReason()(*CodeScanningAlertDismissedReason) + GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetInstancesUrl()(*string) + GetMostRecentInstance()(CodeScanningAlertInstanceable) + GetNumber()(*int32) + GetRule()(CodeScanningAlertRuleable) + GetState()(*CodeScanningAlertState) + GetTool()(CodeScanningAnalysisToolable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedBy(value NullableSimpleUserable)() + SetDismissedComment(value *string)() + SetDismissedReason(value *CodeScanningAlertDismissedReason)() + SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetInstancesUrl(value *string)() + SetMostRecentInstance(value CodeScanningAlertInstanceable)() + SetNumber(value *int32)() + SetRule(value CodeScanningAlertRuleable)() + SetState(value *CodeScanningAlertState)() + SetTool(value CodeScanningAnalysisToolable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/code_scanning_alert503_error.go b/pkg/github/models/code_scanning_alert503_error.go new file mode 100644 index 00000000..930cea8e --- /dev/null +++ b/pkg/github/models/code_scanning_alert503_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 CodeScanningAlert503Error 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 +} +// NewCodeScanningAlert503Error instantiates a new CodeScanningAlert503Error and sets the default values. +func NewCodeScanningAlert503Error()(*CodeScanningAlert503Error) { + m := &CodeScanningAlert503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlert503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlert503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlert503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningAlert503Error) 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 *CodeScanningAlert503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningAlert503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningAlert503Error) 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 *CodeScanningAlert503Error) 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 *CodeScanningAlert503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningAlert503Error) 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 *CodeScanningAlert503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningAlert503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningAlert503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningAlert503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningAlert503Errorable 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_alert_classification.go b/pkg/github/models/code_scanning_alert_classification.go new file mode 100644 index 00000000..552c5a6e --- /dev/null +++ b/pkg/github/models/code_scanning_alert_classification.go @@ -0,0 +1,40 @@ +package models +// A classification of the file. For example to identify it as generated. +type CodeScanningAlertClassification int + +const ( + SOURCE_CODESCANNINGALERTCLASSIFICATION CodeScanningAlertClassification = iota + GENERATED_CODESCANNINGALERTCLASSIFICATION + TEST_CODESCANNINGALERTCLASSIFICATION + LIBRARY_CODESCANNINGALERTCLASSIFICATION +) + +func (i CodeScanningAlertClassification) String() string { + return []string{"source", "generated", "test", "library"}[i] +} +func ParseCodeScanningAlertClassification(v string) (any, error) { + result := SOURCE_CODESCANNINGALERTCLASSIFICATION + switch v { + case "source": + result = SOURCE_CODESCANNINGALERTCLASSIFICATION + case "generated": + result = GENERATED_CODESCANNINGALERTCLASSIFICATION + case "test": + result = TEST_CODESCANNINGALERTCLASSIFICATION + case "library": + result = LIBRARY_CODESCANNINGALERTCLASSIFICATION + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningAlertClassification(values []CodeScanningAlertClassification) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertClassification) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_alert_dismissed_reason.go b/pkg/github/models/code_scanning_alert_dismissed_reason.go new file mode 100644 index 00000000..049d58d9 --- /dev/null +++ b/pkg/github/models/code_scanning_alert_dismissed_reason.go @@ -0,0 +1,37 @@ +package models +// **Required when the state is dismissed.** The reason for dismissing or closing the alert. +type CodeScanningAlertDismissedReason int + +const ( + FALSEPOSITIVE_CODESCANNINGALERTDISMISSEDREASON CodeScanningAlertDismissedReason = iota + WONTFIX_CODESCANNINGALERTDISMISSEDREASON + USEDINTESTS_CODESCANNINGALERTDISMISSEDREASON +) + +func (i CodeScanningAlertDismissedReason) String() string { + return []string{"false positive", "won't fix", "used in tests"}[i] +} +func ParseCodeScanningAlertDismissedReason(v string) (any, error) { + result := FALSEPOSITIVE_CODESCANNINGALERTDISMISSEDREASON + switch v { + case "false positive": + result = FALSEPOSITIVE_CODESCANNINGALERTDISMISSEDREASON + case "won't fix": + result = WONTFIX_CODESCANNINGALERTDISMISSEDREASON + case "used in tests": + result = USEDINTESTS_CODESCANNINGALERTDISMISSEDREASON + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningAlertDismissedReason(values []CodeScanningAlertDismissedReason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertDismissedReason) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_alert_instance.go b/pkg/github/models/code_scanning_alert_instance.go new file mode 100644 index 00000000..b4132fae --- /dev/null +++ b/pkg/github/models/code_scanning_alert_instance.go @@ -0,0 +1,348 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAlertInstance struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. + analysis_key *string + // Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. + category *string + // Classifications that have been applied to the file that triggered the alert.For example identifying it as documentation, or a generated file. + classifications []CodeScanningAlertClassification + // The commit_sha property + commit_sha *string + // Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. + environment *string + // The html_url property + html_url *string + // Describe a region within a file for the alert. + location CodeScanningAlertLocationable + // The message property + message CodeScanningAlertInstance_messageable + // The Git reference, formatted as `refs/pull//merge`, `refs/pull//head`,`refs/heads/` or simply ``. + ref *string + // State of a code scanning alert. + state *CodeScanningAlertState +} +// NewCodeScanningAlertInstance instantiates a new CodeScanningAlertInstance and sets the default values. +func NewCodeScanningAlertInstance()(*CodeScanningAlertInstance) { + m := &CodeScanningAlertInstance{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlertInstanceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlertInstanceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlertInstance(), 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 *CodeScanningAlertInstance) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAnalysisKey gets the analysis_key property value. Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. +// returns a *string when successful +func (m *CodeScanningAlertInstance) GetAnalysisKey()(*string) { + return m.analysis_key +} +// GetCategory gets the category property value. Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. +// returns a *string when successful +func (m *CodeScanningAlertInstance) GetCategory()(*string) { + return m.category +} +// GetClassifications gets the classifications property value. Classifications that have been applied to the file that triggered the alert.For example identifying it as documentation, or a generated file. +// returns a []CodeScanningAlertClassification when successful +func (m *CodeScanningAlertInstance) GetClassifications()([]CodeScanningAlertClassification) { + return m.classifications +} +// GetCommitSha gets the commit_sha property value. The commit_sha property +// returns a *string when successful +func (m *CodeScanningAlertInstance) GetCommitSha()(*string) { + return m.commit_sha +} +// GetEnvironment gets the environment property value. Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. +// returns a *string when successful +func (m *CodeScanningAlertInstance) GetEnvironment()(*string) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAlertInstance) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["analysis_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAnalysisKey(val) + } + return nil + } + res["category"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCategory(val) + } + return nil + } + res["classifications"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseCodeScanningAlertClassification) + if err != nil { + return err + } + if val != nil { + res := make([]CodeScanningAlertClassification, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*CodeScanningAlertClassification)) + } + } + m.SetClassifications(res) + } + return nil + } + res["commit_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitSha(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertLocationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLocation(val.(CodeScanningAlertLocationable)) + } + return nil + } + res["message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertInstance_messageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMessage(val.(CodeScanningAlertInstance_messageable)) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*CodeScanningAlertState)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CodeScanningAlertInstance) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLocation gets the location property value. Describe a region within a file for the alert. +// returns a CodeScanningAlertLocationable when successful +func (m *CodeScanningAlertInstance) GetLocation()(CodeScanningAlertLocationable) { + return m.location +} +// GetMessage gets the message property value. The message property +// returns a CodeScanningAlertInstance_messageable when successful +func (m *CodeScanningAlertInstance) GetMessage()(CodeScanningAlertInstance_messageable) { + return m.message +} +// GetRef gets the ref property value. The Git reference, formatted as `refs/pull//merge`, `refs/pull//head`,`refs/heads/` or simply ``. +// returns a *string when successful +func (m *CodeScanningAlertInstance) GetRef()(*string) { + return m.ref +} +// GetState gets the state property value. State of a code scanning alert. +// returns a *CodeScanningAlertState when successful +func (m *CodeScanningAlertInstance) GetState()(*CodeScanningAlertState) { + return m.state +} +// Serialize serializes information the current object +func (m *CodeScanningAlertInstance) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("analysis_key", m.GetAnalysisKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("category", m.GetCategory()) + if err != nil { + return err + } + } + if m.GetClassifications() != nil { + err := writer.WriteCollectionOfStringValues("classifications", SerializeCodeScanningAlertClassification(m.GetClassifications())) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_sha", m.GetCommitSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &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 *CodeScanningAlertInstance) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAnalysisKey sets the analysis_key property value. Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. +func (m *CodeScanningAlertInstance) SetAnalysisKey(value *string)() { + m.analysis_key = value +} +// SetCategory sets the category property value. Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. +func (m *CodeScanningAlertInstance) SetCategory(value *string)() { + m.category = value +} +// SetClassifications sets the classifications property value. Classifications that have been applied to the file that triggered the alert.For example identifying it as documentation, or a generated file. +func (m *CodeScanningAlertInstance) SetClassifications(value []CodeScanningAlertClassification)() { + m.classifications = value +} +// SetCommitSha sets the commit_sha property value. The commit_sha property +func (m *CodeScanningAlertInstance) SetCommitSha(value *string)() { + m.commit_sha = value +} +// SetEnvironment sets the environment property value. Identifies the variable values associated with the environment in which the analysis that generated this alert instance was performed, such as the language that was analyzed. +func (m *CodeScanningAlertInstance) SetEnvironment(value *string)() { + m.environment = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CodeScanningAlertInstance) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLocation sets the location property value. Describe a region within a file for the alert. +func (m *CodeScanningAlertInstance) SetLocation(value CodeScanningAlertLocationable)() { + m.location = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningAlertInstance) SetMessage(value CodeScanningAlertInstance_messageable)() { + m.message = value +} +// SetRef sets the ref property value. The Git reference, formatted as `refs/pull//merge`, `refs/pull//head`,`refs/heads/` or simply ``. +func (m *CodeScanningAlertInstance) SetRef(value *string)() { + m.ref = value +} +// SetState sets the state property value. State of a code scanning alert. +func (m *CodeScanningAlertInstance) SetState(value *CodeScanningAlertState)() { + m.state = value +} +type CodeScanningAlertInstanceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAnalysisKey()(*string) + GetCategory()(*string) + GetClassifications()([]CodeScanningAlertClassification) + GetCommitSha()(*string) + GetEnvironment()(*string) + GetHtmlUrl()(*string) + GetLocation()(CodeScanningAlertLocationable) + GetMessage()(CodeScanningAlertInstance_messageable) + GetRef()(*string) + GetState()(*CodeScanningAlertState) + SetAnalysisKey(value *string)() + SetCategory(value *string)() + SetClassifications(value []CodeScanningAlertClassification)() + SetCommitSha(value *string)() + SetEnvironment(value *string)() + SetHtmlUrl(value *string)() + SetLocation(value CodeScanningAlertLocationable)() + SetMessage(value CodeScanningAlertInstance_messageable)() + SetRef(value *string)() + SetState(value *CodeScanningAlertState)() +} diff --git a/pkg/github/models/code_scanning_alert_instance_escaped_message.go b/pkg/github/models/code_scanning_alert_instance_escaped_message.go new file mode 100644 index 00000000..83a574c5 --- /dev/null +++ b/pkg/github/models/code_scanning_alert_instance_escaped_message.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAlertInstance_message 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 text property + text *string +} +// NewCodeScanningAlertInstance_message instantiates a new CodeScanningAlertInstance_message and sets the default values. +func NewCodeScanningAlertInstance_message()(*CodeScanningAlertInstance_message) { + m := &CodeScanningAlertInstance_message{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlertInstance_messageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlertInstance_messageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlertInstance_message(), 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 *CodeScanningAlertInstance_message) 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 *CodeScanningAlertInstance_message) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *CodeScanningAlertInstance_message) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *CodeScanningAlertInstance_message) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("text", m.GetText()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *CodeScanningAlertInstance_message) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetText sets the text property value. The text property +func (m *CodeScanningAlertInstance_message) SetText(value *string)() { + m.text = value +} +type CodeScanningAlertInstance_messageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetText()(*string) + SetText(value *string)() +} diff --git a/pkg/github/models/code_scanning_alert_items.go b/pkg/github/models/code_scanning_alert_items.go new file mode 100644 index 00000000..1bc9aa20 --- /dev/null +++ b/pkg/github/models/code_scanning_alert_items.go @@ -0,0 +1,441 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAlertItems struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + dismissed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + dismissed_by NullableSimpleUserable + // The dismissal comment associated with the dismissal of the alert. + dismissed_comment *string + // **Required when the state is dismissed.** The reason for dismissing or closing the alert. + dismissed_reason *CodeScanningAlertDismissedReason + // The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + fixed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The GitHub URL of the alert resource. + html_url *string + // The REST API URL for fetching the list of instances for an alert. + instances_url *string + // The most_recent_instance property + most_recent_instance CodeScanningAlertInstanceable + // The security alert number. + number *int32 + // The rule property + rule CodeScanningAlertRuleSummaryable + // State of a code scanning alert. + state *CodeScanningAlertState + // The tool property + tool CodeScanningAnalysisToolable + // The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The REST API URL of the alert resource. + url *string +} +// NewCodeScanningAlertItems instantiates a new CodeScanningAlertItems and sets the default values. +func NewCodeScanningAlertItems()(*CodeScanningAlertItems) { + m := &CodeScanningAlertItems{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlertItemsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlertItemsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlertItems(), 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 *CodeScanningAlertItems) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlertItems) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDismissedAt gets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlertItems) GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.dismissed_at +} +// GetDismissedBy gets the dismissed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *CodeScanningAlertItems) GetDismissedBy()(NullableSimpleUserable) { + return m.dismissed_by +} +// GetDismissedComment gets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +// returns a *string when successful +func (m *CodeScanningAlertItems) GetDismissedComment()(*string) { + return m.dismissed_comment +} +// GetDismissedReason gets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +// returns a *CodeScanningAlertDismissedReason when successful +func (m *CodeScanningAlertItems) GetDismissedReason()(*CodeScanningAlertDismissedReason) { + return m.dismissed_reason +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAlertItems) 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["dismissed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedAt(val) + } + return nil + } + res["dismissed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["dismissed_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedComment(val) + } + return nil + } + res["dismissed_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertDismissedReason) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReason(val.(*CodeScanningAlertDismissedReason)) + } + return nil + } + res["fixed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetFixedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["instances_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInstancesUrl(val) + } + return nil + } + res["most_recent_instance"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertInstanceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMostRecentInstance(val.(CodeScanningAlertInstanceable)) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["rule"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertRuleSummaryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRule(val.(CodeScanningAlertRuleSummaryable)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*CodeScanningAlertState)) + } + return nil + } + res["tool"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAnalysisToolFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTool(val.(CodeScanningAnalysisToolable)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFixedAt gets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlertItems) GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.fixed_at +} +// GetHtmlUrl gets the html_url property value. The GitHub URL of the alert resource. +// returns a *string when successful +func (m *CodeScanningAlertItems) GetHtmlUrl()(*string) { + return m.html_url +} +// GetInstancesUrl gets the instances_url property value. The REST API URL for fetching the list of instances for an alert. +// returns a *string when successful +func (m *CodeScanningAlertItems) GetInstancesUrl()(*string) { + return m.instances_url +} +// GetMostRecentInstance gets the most_recent_instance property value. The most_recent_instance property +// returns a CodeScanningAlertInstanceable when successful +func (m *CodeScanningAlertItems) GetMostRecentInstance()(CodeScanningAlertInstanceable) { + return m.most_recent_instance +} +// GetNumber gets the number property value. The security alert number. +// returns a *int32 when successful +func (m *CodeScanningAlertItems) GetNumber()(*int32) { + return m.number +} +// GetRule gets the rule property value. The rule property +// returns a CodeScanningAlertRuleSummaryable when successful +func (m *CodeScanningAlertItems) GetRule()(CodeScanningAlertRuleSummaryable) { + return m.rule +} +// GetState gets the state property value. State of a code scanning alert. +// returns a *CodeScanningAlertState when successful +func (m *CodeScanningAlertItems) GetState()(*CodeScanningAlertState) { + return m.state +} +// GetTool gets the tool property value. The tool property +// returns a CodeScanningAnalysisToolable when successful +func (m *CodeScanningAlertItems) GetTool()(CodeScanningAnalysisToolable) { + return m.tool +} +// GetUpdatedAt gets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAlertItems) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The REST API URL of the alert resource. +// returns a *string when successful +func (m *CodeScanningAlertItems) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeScanningAlertItems) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dismissed_by", m.GetDismissedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dismissed_comment", m.GetDismissedComment()) + if err != nil { + return err + } + } + if m.GetDismissedReason() != nil { + cast := (*m.GetDismissedReason()).String() + err := writer.WriteStringValue("dismissed_reason", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("most_recent_instance", m.GetMostRecentInstance()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("rule", m.GetRule()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tool", m.GetTool()) + 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 *CodeScanningAlertItems) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlertItems) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDismissedAt sets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlertItems) SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.dismissed_at = value +} +// SetDismissedBy sets the dismissed_by property value. A GitHub user. +func (m *CodeScanningAlertItems) SetDismissedBy(value NullableSimpleUserable)() { + m.dismissed_by = value +} +// SetDismissedComment sets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +func (m *CodeScanningAlertItems) SetDismissedComment(value *string)() { + m.dismissed_comment = value +} +// SetDismissedReason sets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +func (m *CodeScanningAlertItems) SetDismissedReason(value *CodeScanningAlertDismissedReason)() { + m.dismissed_reason = value +} +// SetFixedAt sets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlertItems) SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.fixed_at = value +} +// SetHtmlUrl sets the html_url property value. The GitHub URL of the alert resource. +func (m *CodeScanningAlertItems) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetInstancesUrl sets the instances_url property value. The REST API URL for fetching the list of instances for an alert. +func (m *CodeScanningAlertItems) SetInstancesUrl(value *string)() { + m.instances_url = value +} +// SetMostRecentInstance sets the most_recent_instance property value. The most_recent_instance property +func (m *CodeScanningAlertItems) SetMostRecentInstance(value CodeScanningAlertInstanceable)() { + m.most_recent_instance = value +} +// SetNumber sets the number property value. The security alert number. +func (m *CodeScanningAlertItems) SetNumber(value *int32)() { + m.number = value +} +// SetRule sets the rule property value. The rule property +func (m *CodeScanningAlertItems) SetRule(value CodeScanningAlertRuleSummaryable)() { + m.rule = value +} +// SetState sets the state property value. State of a code scanning alert. +func (m *CodeScanningAlertItems) SetState(value *CodeScanningAlertState)() { + m.state = value +} +// SetTool sets the tool property value. The tool property +func (m *CodeScanningAlertItems) SetTool(value CodeScanningAnalysisToolable)() { + m.tool = value +} +// SetUpdatedAt sets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAlertItems) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The REST API URL of the alert resource. +func (m *CodeScanningAlertItems) SetUrl(value *string)() { + m.url = value +} +type CodeScanningAlertItemsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedBy()(NullableSimpleUserable) + GetDismissedComment()(*string) + GetDismissedReason()(*CodeScanningAlertDismissedReason) + GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetInstancesUrl()(*string) + GetMostRecentInstance()(CodeScanningAlertInstanceable) + GetNumber()(*int32) + GetRule()(CodeScanningAlertRuleSummaryable) + GetState()(*CodeScanningAlertState) + GetTool()(CodeScanningAnalysisToolable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedBy(value NullableSimpleUserable)() + SetDismissedComment(value *string)() + SetDismissedReason(value *CodeScanningAlertDismissedReason)() + SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetInstancesUrl(value *string)() + SetMostRecentInstance(value CodeScanningAlertInstanceable)() + SetNumber(value *int32)() + SetRule(value CodeScanningAlertRuleSummaryable)() + SetState(value *CodeScanningAlertState)() + SetTool(value CodeScanningAnalysisToolable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/code_scanning_alert_location.go b/pkg/github/models/code_scanning_alert_location.go new file mode 100644 index 00000000..632819d0 --- /dev/null +++ b/pkg/github/models/code_scanning_alert_location.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeScanningAlertLocation describe a region within a file for the alert. +type CodeScanningAlertLocation 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 end_column property + end_column *int32 + // The end_line property + end_line *int32 + // The path property + path *string + // The start_column property + start_column *int32 + // The start_line property + start_line *int32 +} +// NewCodeScanningAlertLocation instantiates a new CodeScanningAlertLocation and sets the default values. +func NewCodeScanningAlertLocation()(*CodeScanningAlertLocation) { + m := &CodeScanningAlertLocation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlertLocationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlertLocationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlertLocation(), 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 *CodeScanningAlertLocation) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEndColumn gets the end_column property value. The end_column property +// returns a *int32 when successful +func (m *CodeScanningAlertLocation) GetEndColumn()(*int32) { + return m.end_column +} +// GetEndLine gets the end_line property value. The end_line property +// returns a *int32 when successful +func (m *CodeScanningAlertLocation) GetEndLine()(*int32) { + return m.end_line +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAlertLocation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["end_column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetEndColumn(val) + } + return nil + } + res["end_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetEndLine(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["start_column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartColumn(val) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + return res +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *CodeScanningAlertLocation) GetPath()(*string) { + return m.path +} +// GetStartColumn gets the start_column property value. The start_column property +// returns a *int32 when successful +func (m *CodeScanningAlertLocation) GetStartColumn()(*int32) { + return m.start_column +} +// GetStartLine gets the start_line property value. The start_line property +// returns a *int32 when successful +func (m *CodeScanningAlertLocation) GetStartLine()(*int32) { + return m.start_line +} +// Serialize serializes information the current object +func (m *CodeScanningAlertLocation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("end_column", m.GetEndColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("end_line", m.GetEndLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("start_column", m.GetStartColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("start_line", m.GetStartLine()) + 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 *CodeScanningAlertLocation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEndColumn sets the end_column property value. The end_column property +func (m *CodeScanningAlertLocation) SetEndColumn(value *int32)() { + m.end_column = value +} +// SetEndLine sets the end_line property value. The end_line property +func (m *CodeScanningAlertLocation) SetEndLine(value *int32)() { + m.end_line = value +} +// SetPath sets the path property value. The path property +func (m *CodeScanningAlertLocation) SetPath(value *string)() { + m.path = value +} +// SetStartColumn sets the start_column property value. The start_column property +func (m *CodeScanningAlertLocation) SetStartColumn(value *int32)() { + m.start_column = value +} +// SetStartLine sets the start_line property value. The start_line property +func (m *CodeScanningAlertLocation) SetStartLine(value *int32)() { + m.start_line = value +} +type CodeScanningAlertLocationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEndColumn()(*int32) + GetEndLine()(*int32) + GetPath()(*string) + GetStartColumn()(*int32) + GetStartLine()(*int32) + SetEndColumn(value *int32)() + SetEndLine(value *int32)() + SetPath(value *string)() + SetStartColumn(value *int32)() + SetStartLine(value *int32)() +} diff --git a/pkg/github/models/code_scanning_alert_rule.go b/pkg/github/models/code_scanning_alert_rule.go new file mode 100644 index 00000000..c09f0df9 --- /dev/null +++ b/pkg/github/models/code_scanning_alert_rule.go @@ -0,0 +1,320 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAlertRule 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 short description of the rule used to detect the alert. + description *string + // A description of the rule used to detect the alert. + full_description *string + // Detailed documentation for the rule as GitHub Flavored Markdown. + help *string + // A link to the documentation for the rule used to detect the alert. + help_uri *string + // A unique identifier for the rule used to detect the alert. + id *string + // The name of the rule used to detect the alert. + name *string + // The security severity of the alert. + security_severity_level *CodeScanningAlertRule_security_severity_level + // The severity of the alert. + severity *CodeScanningAlertRule_severity + // A set of tags applicable for the rule. + tags []string +} +// NewCodeScanningAlertRule instantiates a new CodeScanningAlertRule and sets the default values. +func NewCodeScanningAlertRule()(*CodeScanningAlertRule) { + m := &CodeScanningAlertRule{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlertRuleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlertRuleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlertRule(), 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 *CodeScanningAlertRule) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. A short description of the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRule) 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 *CodeScanningAlertRule) 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["full_description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullDescription(val) + } + return nil + } + res["help"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHelp(val) + } + return nil + } + res["help_uri"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHelpUri(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(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["security_severity_level"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertRule_security_severity_level) + if err != nil { + return err + } + if val != nil { + m.SetSecuritySeverityLevel(val.(*CodeScanningAlertRule_security_severity_level)) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertRule_severity) + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val.(*CodeScanningAlertRule_severity)) + } + return nil + } + res["tags"] = 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.SetTags(res) + } + return nil + } + return res +} +// GetFullDescription gets the full_description property value. A description of the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRule) GetFullDescription()(*string) { + return m.full_description +} +// GetHelp gets the help property value. Detailed documentation for the rule as GitHub Flavored Markdown. +// returns a *string when successful +func (m *CodeScanningAlertRule) GetHelp()(*string) { + return m.help +} +// GetHelpUri gets the help_uri property value. A link to the documentation for the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRule) GetHelpUri()(*string) { + return m.help_uri +} +// GetId gets the id property value. A unique identifier for the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRule) GetId()(*string) { + return m.id +} +// GetName gets the name property value. The name of the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRule) GetName()(*string) { + return m.name +} +// GetSecuritySeverityLevel gets the security_severity_level property value. The security severity of the alert. +// returns a *CodeScanningAlertRule_security_severity_level when successful +func (m *CodeScanningAlertRule) GetSecuritySeverityLevel()(*CodeScanningAlertRule_security_severity_level) { + return m.security_severity_level +} +// GetSeverity gets the severity property value. The severity of the alert. +// returns a *CodeScanningAlertRule_severity when successful +func (m *CodeScanningAlertRule) GetSeverity()(*CodeScanningAlertRule_severity) { + return m.severity +} +// GetTags gets the tags property value. A set of tags applicable for the rule. +// returns a []string when successful +func (m *CodeScanningAlertRule) GetTags()([]string) { + return m.tags +} +// Serialize serializes information the current object +func (m *CodeScanningAlertRule) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_description", m.GetFullDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("help", m.GetHelp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("help_uri", m.GetHelpUri()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetSecuritySeverityLevel() != nil { + cast := (*m.GetSecuritySeverityLevel()).String() + err := writer.WriteStringValue("security_severity_level", &cast) + if err != nil { + return err + } + } + if m.GetSeverity() != nil { + cast := (*m.GetSeverity()).String() + err := writer.WriteStringValue("severity", &cast) + if err != nil { + return err + } + } + if m.GetTags() != nil { + err := writer.WriteCollectionOfStringValues("tags", m.GetTags()) + 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 *CodeScanningAlertRule) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. A short description of the rule used to detect the alert. +func (m *CodeScanningAlertRule) SetDescription(value *string)() { + m.description = value +} +// SetFullDescription sets the full_description property value. A description of the rule used to detect the alert. +func (m *CodeScanningAlertRule) SetFullDescription(value *string)() { + m.full_description = value +} +// SetHelp sets the help property value. Detailed documentation for the rule as GitHub Flavored Markdown. +func (m *CodeScanningAlertRule) SetHelp(value *string)() { + m.help = value +} +// SetHelpUri sets the help_uri property value. A link to the documentation for the rule used to detect the alert. +func (m *CodeScanningAlertRule) SetHelpUri(value *string)() { + m.help_uri = value +} +// SetId sets the id property value. A unique identifier for the rule used to detect the alert. +func (m *CodeScanningAlertRule) SetId(value *string)() { + m.id = value +} +// SetName sets the name property value. The name of the rule used to detect the alert. +func (m *CodeScanningAlertRule) SetName(value *string)() { + m.name = value +} +// SetSecuritySeverityLevel sets the security_severity_level property value. The security severity of the alert. +func (m *CodeScanningAlertRule) SetSecuritySeverityLevel(value *CodeScanningAlertRule_security_severity_level)() { + m.security_severity_level = value +} +// SetSeverity sets the severity property value. The severity of the alert. +func (m *CodeScanningAlertRule) SetSeverity(value *CodeScanningAlertRule_severity)() { + m.severity = value +} +// SetTags sets the tags property value. A set of tags applicable for the rule. +func (m *CodeScanningAlertRule) SetTags(value []string)() { + m.tags = value +} +type CodeScanningAlertRuleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetFullDescription()(*string) + GetHelp()(*string) + GetHelpUri()(*string) + GetId()(*string) + GetName()(*string) + GetSecuritySeverityLevel()(*CodeScanningAlertRule_security_severity_level) + GetSeverity()(*CodeScanningAlertRule_severity) + GetTags()([]string) + SetDescription(value *string)() + SetFullDescription(value *string)() + SetHelp(value *string)() + SetHelpUri(value *string)() + SetId(value *string)() + SetName(value *string)() + SetSecuritySeverityLevel(value *CodeScanningAlertRule_security_severity_level)() + SetSeverity(value *CodeScanningAlertRule_severity)() + SetTags(value []string)() +} diff --git a/pkg/github/models/code_scanning_alert_rule_escaped_security_escaped_severity_escaped_level.go b/pkg/github/models/code_scanning_alert_rule_escaped_security_escaped_severity_escaped_level.go new file mode 100644 index 00000000..7d847037 --- /dev/null +++ b/pkg/github/models/code_scanning_alert_rule_escaped_security_escaped_severity_escaped_level.go @@ -0,0 +1,40 @@ +package models +// The security severity of the alert. +type CodeScanningAlertRule_security_severity_level int + +const ( + LOW_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL CodeScanningAlertRule_security_severity_level = iota + MEDIUM_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL + HIGH_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL + CRITICAL_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL +) + +func (i CodeScanningAlertRule_security_severity_level) String() string { + return []string{"low", "medium", "high", "critical"}[i] +} +func ParseCodeScanningAlertRule_security_severity_level(v string) (any, error) { + result := LOW_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL + switch v { + case "low": + result = LOW_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL + case "medium": + result = MEDIUM_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL + case "high": + result = HIGH_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL + case "critical": + result = CRITICAL_CODESCANNINGALERTRULE_SECURITY_SEVERITY_LEVEL + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningAlertRule_security_severity_level(values []CodeScanningAlertRule_security_severity_level) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertRule_security_severity_level) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_alert_rule_escaped_severity.go b/pkg/github/models/code_scanning_alert_rule_escaped_severity.go new file mode 100644 index 00000000..a1de689f --- /dev/null +++ b/pkg/github/models/code_scanning_alert_rule_escaped_severity.go @@ -0,0 +1,40 @@ +package models +// The severity of the alert. +type CodeScanningAlertRule_severity int + +const ( + NONE_CODESCANNINGALERTRULE_SEVERITY CodeScanningAlertRule_severity = iota + NOTE_CODESCANNINGALERTRULE_SEVERITY + WARNING_CODESCANNINGALERTRULE_SEVERITY + ERROR_CODESCANNINGALERTRULE_SEVERITY +) + +func (i CodeScanningAlertRule_severity) String() string { + return []string{"none", "note", "warning", "error"}[i] +} +func ParseCodeScanningAlertRule_severity(v string) (any, error) { + result := NONE_CODESCANNINGALERTRULE_SEVERITY + switch v { + case "none": + result = NONE_CODESCANNINGALERTRULE_SEVERITY + case "note": + result = NOTE_CODESCANNINGALERTRULE_SEVERITY + case "warning": + result = WARNING_CODESCANNINGALERTRULE_SEVERITY + case "error": + result = ERROR_CODESCANNINGALERTRULE_SEVERITY + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningAlertRule_severity(values []CodeScanningAlertRule_severity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertRule_severity) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_alert_rule_summary.go b/pkg/github/models/code_scanning_alert_rule_summary.go new file mode 100644 index 00000000..774db614 --- /dev/null +++ b/pkg/github/models/code_scanning_alert_rule_summary.go @@ -0,0 +1,233 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAlertRuleSummary 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 short description of the rule used to detect the alert. + description *string + // A unique identifier for the rule used to detect the alert. + id *string + // The name of the rule used to detect the alert. + name *string + // The security severity of the alert. + security_severity_level *CodeScanningAlertRuleSummary_security_severity_level + // The severity of the alert. + severity *CodeScanningAlertRuleSummary_severity + // A set of tags applicable for the rule. + tags []string +} +// NewCodeScanningAlertRuleSummary instantiates a new CodeScanningAlertRuleSummary and sets the default values. +func NewCodeScanningAlertRuleSummary()(*CodeScanningAlertRuleSummary) { + m := &CodeScanningAlertRuleSummary{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAlertRuleSummaryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAlertRuleSummaryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAlertRuleSummary(), 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 *CodeScanningAlertRuleSummary) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. A short description of the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRuleSummary) 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 *CodeScanningAlertRuleSummary) 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(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["security_severity_level"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertRuleSummary_security_severity_level) + if err != nil { + return err + } + if val != nil { + m.SetSecuritySeverityLevel(val.(*CodeScanningAlertRuleSummary_security_severity_level)) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertRuleSummary_severity) + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val.(*CodeScanningAlertRuleSummary_severity)) + } + return nil + } + res["tags"] = 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.SetTags(res) + } + return nil + } + return res +} +// GetId gets the id property value. A unique identifier for the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRuleSummary) GetId()(*string) { + return m.id +} +// GetName gets the name property value. The name of the rule used to detect the alert. +// returns a *string when successful +func (m *CodeScanningAlertRuleSummary) GetName()(*string) { + return m.name +} +// GetSecuritySeverityLevel gets the security_severity_level property value. The security severity of the alert. +// returns a *CodeScanningAlertRuleSummary_security_severity_level when successful +func (m *CodeScanningAlertRuleSummary) GetSecuritySeverityLevel()(*CodeScanningAlertRuleSummary_security_severity_level) { + return m.security_severity_level +} +// GetSeverity gets the severity property value. The severity of the alert. +// returns a *CodeScanningAlertRuleSummary_severity when successful +func (m *CodeScanningAlertRuleSummary) GetSeverity()(*CodeScanningAlertRuleSummary_severity) { + return m.severity +} +// GetTags gets the tags property value. A set of tags applicable for the rule. +// returns a []string when successful +func (m *CodeScanningAlertRuleSummary) GetTags()([]string) { + return m.tags +} +// Serialize serializes information the current object +func (m *CodeScanningAlertRuleSummary) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetSecuritySeverityLevel() != nil { + cast := (*m.GetSecuritySeverityLevel()).String() + err := writer.WriteStringValue("security_severity_level", &cast) + if err != nil { + return err + } + } + if m.GetSeverity() != nil { + cast := (*m.GetSeverity()).String() + err := writer.WriteStringValue("severity", &cast) + if err != nil { + return err + } + } + if m.GetTags() != nil { + err := writer.WriteCollectionOfStringValues("tags", m.GetTags()) + 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 *CodeScanningAlertRuleSummary) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. A short description of the rule used to detect the alert. +func (m *CodeScanningAlertRuleSummary) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. A unique identifier for the rule used to detect the alert. +func (m *CodeScanningAlertRuleSummary) SetId(value *string)() { + m.id = value +} +// SetName sets the name property value. The name of the rule used to detect the alert. +func (m *CodeScanningAlertRuleSummary) SetName(value *string)() { + m.name = value +} +// SetSecuritySeverityLevel sets the security_severity_level property value. The security severity of the alert. +func (m *CodeScanningAlertRuleSummary) SetSecuritySeverityLevel(value *CodeScanningAlertRuleSummary_security_severity_level)() { + m.security_severity_level = value +} +// SetSeverity sets the severity property value. The severity of the alert. +func (m *CodeScanningAlertRuleSummary) SetSeverity(value *CodeScanningAlertRuleSummary_severity)() { + m.severity = value +} +// SetTags sets the tags property value. A set of tags applicable for the rule. +func (m *CodeScanningAlertRuleSummary) SetTags(value []string)() { + m.tags = value +} +type CodeScanningAlertRuleSummaryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetId()(*string) + GetName()(*string) + GetSecuritySeverityLevel()(*CodeScanningAlertRuleSummary_security_severity_level) + GetSeverity()(*CodeScanningAlertRuleSummary_severity) + GetTags()([]string) + SetDescription(value *string)() + SetId(value *string)() + SetName(value *string)() + SetSecuritySeverityLevel(value *CodeScanningAlertRuleSummary_security_severity_level)() + SetSeverity(value *CodeScanningAlertRuleSummary_severity)() + SetTags(value []string)() +} diff --git a/pkg/github/models/code_scanning_alert_rule_summary_escaped_security_escaped_severity_escaped_level.go b/pkg/github/models/code_scanning_alert_rule_summary_escaped_security_escaped_severity_escaped_level.go new file mode 100644 index 00000000..0ff8ff86 --- /dev/null +++ b/pkg/github/models/code_scanning_alert_rule_summary_escaped_security_escaped_severity_escaped_level.go @@ -0,0 +1,40 @@ +package models +// The security severity of the alert. +type CodeScanningAlertRuleSummary_security_severity_level int + +const ( + LOW_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL CodeScanningAlertRuleSummary_security_severity_level = iota + MEDIUM_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL + HIGH_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL + CRITICAL_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL +) + +func (i CodeScanningAlertRuleSummary_security_severity_level) String() string { + return []string{"low", "medium", "high", "critical"}[i] +} +func ParseCodeScanningAlertRuleSummary_security_severity_level(v string) (any, error) { + result := LOW_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL + switch v { + case "low": + result = LOW_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL + case "medium": + result = MEDIUM_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL + case "high": + result = HIGH_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL + case "critical": + result = CRITICAL_CODESCANNINGALERTRULESUMMARY_SECURITY_SEVERITY_LEVEL + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningAlertRuleSummary_security_severity_level(values []CodeScanningAlertRuleSummary_security_severity_level) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertRuleSummary_security_severity_level) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_alert_rule_summary_escaped_severity.go b/pkg/github/models/code_scanning_alert_rule_summary_escaped_severity.go new file mode 100644 index 00000000..6da60f6a --- /dev/null +++ b/pkg/github/models/code_scanning_alert_rule_summary_escaped_severity.go @@ -0,0 +1,40 @@ +package models +// The severity of the alert. +type CodeScanningAlertRuleSummary_severity int + +const ( + NONE_CODESCANNINGALERTRULESUMMARY_SEVERITY CodeScanningAlertRuleSummary_severity = iota + NOTE_CODESCANNINGALERTRULESUMMARY_SEVERITY + WARNING_CODESCANNINGALERTRULESUMMARY_SEVERITY + ERROR_CODESCANNINGALERTRULESUMMARY_SEVERITY +) + +func (i CodeScanningAlertRuleSummary_severity) String() string { + return []string{"none", "note", "warning", "error"}[i] +} +func ParseCodeScanningAlertRuleSummary_severity(v string) (any, error) { + result := NONE_CODESCANNINGALERTRULESUMMARY_SEVERITY + switch v { + case "none": + result = NONE_CODESCANNINGALERTRULESUMMARY_SEVERITY + case "note": + result = NOTE_CODESCANNINGALERTRULESUMMARY_SEVERITY + case "warning": + result = WARNING_CODESCANNINGALERTRULESUMMARY_SEVERITY + case "error": + result = ERROR_CODESCANNINGALERTRULESUMMARY_SEVERITY + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningAlertRuleSummary_severity(values []CodeScanningAlertRuleSummary_severity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertRuleSummary_severity) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_alert_set_state.go b/pkg/github/models/code_scanning_alert_set_state.go new file mode 100644 index 00000000..b8a36cf3 --- /dev/null +++ b/pkg/github/models/code_scanning_alert_set_state.go @@ -0,0 +1,34 @@ +package models +// Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`. +type CodeScanningAlertSetState int + +const ( + OPEN_CODESCANNINGALERTSETSTATE CodeScanningAlertSetState = iota + DISMISSED_CODESCANNINGALERTSETSTATE +) + +func (i CodeScanningAlertSetState) String() string { + return []string{"open", "dismissed"}[i] +} +func ParseCodeScanningAlertSetState(v string) (any, error) { + result := OPEN_CODESCANNINGALERTSETSTATE + switch v { + case "open": + result = OPEN_CODESCANNINGALERTSETSTATE + case "dismissed": + result = DISMISSED_CODESCANNINGALERTSETSTATE + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningAlertSetState(values []CodeScanningAlertSetState) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertSetState) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_alert_severity.go b/pkg/github/models/code_scanning_alert_severity.go new file mode 100644 index 00000000..a2bbc71a --- /dev/null +++ b/pkg/github/models/code_scanning_alert_severity.go @@ -0,0 +1,49 @@ +package models +// Severity of a code scanning alert. +type CodeScanningAlertSeverity int + +const ( + CRITICAL_CODESCANNINGALERTSEVERITY CodeScanningAlertSeverity = iota + HIGH_CODESCANNINGALERTSEVERITY + MEDIUM_CODESCANNINGALERTSEVERITY + LOW_CODESCANNINGALERTSEVERITY + WARNING_CODESCANNINGALERTSEVERITY + NOTE_CODESCANNINGALERTSEVERITY + ERROR_CODESCANNINGALERTSEVERITY +) + +func (i CodeScanningAlertSeverity) String() string { + return []string{"critical", "high", "medium", "low", "warning", "note", "error"}[i] +} +func ParseCodeScanningAlertSeverity(v string) (any, error) { + result := CRITICAL_CODESCANNINGALERTSEVERITY + switch v { + case "critical": + result = CRITICAL_CODESCANNINGALERTSEVERITY + case "high": + result = HIGH_CODESCANNINGALERTSEVERITY + case "medium": + result = MEDIUM_CODESCANNINGALERTSEVERITY + case "low": + result = LOW_CODESCANNINGALERTSEVERITY + case "warning": + result = WARNING_CODESCANNINGALERTSEVERITY + case "note": + result = NOTE_CODESCANNINGALERTSEVERITY + case "error": + result = ERROR_CODESCANNINGALERTSEVERITY + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningAlertSeverity(values []CodeScanningAlertSeverity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertSeverity) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_alert_state.go b/pkg/github/models/code_scanning_alert_state.go new file mode 100644 index 00000000..91eb5c36 --- /dev/null +++ b/pkg/github/models/code_scanning_alert_state.go @@ -0,0 +1,37 @@ +package models +// State of a code scanning alert. +type CodeScanningAlertState int + +const ( + OPEN_CODESCANNINGALERTSTATE CodeScanningAlertState = iota + DISMISSED_CODESCANNINGALERTSTATE + FIXED_CODESCANNINGALERTSTATE +) + +func (i CodeScanningAlertState) String() string { + return []string{"open", "dismissed", "fixed"}[i] +} +func ParseCodeScanningAlertState(v string) (any, error) { + result := OPEN_CODESCANNINGALERTSTATE + switch v { + case "open": + result = OPEN_CODESCANNINGALERTSTATE + case "dismissed": + result = DISMISSED_CODESCANNINGALERTSTATE + case "fixed": + result = FIXED_CODESCANNINGALERTSTATE + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningAlertState(values []CodeScanningAlertState) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertState) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_alert_state_query.go b/pkg/github/models/code_scanning_alert_state_query.go new file mode 100644 index 00000000..01cbc10d --- /dev/null +++ b/pkg/github/models/code_scanning_alert_state_query.go @@ -0,0 +1,40 @@ +package models +// State of a code scanning alert. +type CodeScanningAlertStateQuery int + +const ( + OPEN_CODESCANNINGALERTSTATEQUERY CodeScanningAlertStateQuery = iota + CLOSED_CODESCANNINGALERTSTATEQUERY + DISMISSED_CODESCANNINGALERTSTATEQUERY + FIXED_CODESCANNINGALERTSTATEQUERY +) + +func (i CodeScanningAlertStateQuery) String() string { + return []string{"open", "closed", "dismissed", "fixed"}[i] +} +func ParseCodeScanningAlertStateQuery(v string) (any, error) { + result := OPEN_CODESCANNINGALERTSTATEQUERY + switch v { + case "open": + result = OPEN_CODESCANNINGALERTSTATEQUERY + case "closed": + result = CLOSED_CODESCANNINGALERTSTATEQUERY + case "dismissed": + result = DISMISSED_CODESCANNINGALERTSTATEQUERY + case "fixed": + result = FIXED_CODESCANNINGALERTSTATEQUERY + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningAlertStateQuery(values []CodeScanningAlertStateQuery) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningAlertStateQuery) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_analysis.go b/pkg/github/models/code_scanning_analysis.go new file mode 100644 index 00000000..a0ddd3b7 --- /dev/null +++ b/pkg/github/models/code_scanning_analysis.go @@ -0,0 +1,475 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAnalysis struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. + analysis_key *string + // Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. + category *string + // The SHA of the commit to which the analysis you are uploading relates. + commit_sha *string + // The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The deletable property + deletable *bool + // Identifies the variable values associated with the environment in which this analysis was performed. + environment *string + // The error property + error *string + // Unique identifier for this analysis. + id *int32 + // The Git reference, formatted as `refs/pull//merge`, `refs/pull//head`,`refs/heads/` or simply ``. + ref *string + // The total number of results in the analysis. + results_count *int32 + // The total number of rules used in the analysis. + rules_count *int32 + // An identifier for the upload. + sarif_id *string + // The tool property + tool CodeScanningAnalysisToolable + // The REST API URL of the analysis resource. + url *string + // Warning generated when processing the analysis + warning *string +} +// NewCodeScanningAnalysis instantiates a new CodeScanningAnalysis and sets the default values. +func NewCodeScanningAnalysis()(*CodeScanningAnalysis) { + m := &CodeScanningAnalysis{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAnalysisFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAnalysisFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAnalysis(), 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 *CodeScanningAnalysis) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAnalysisKey gets the analysis_key property value. Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. +// returns a *string when successful +func (m *CodeScanningAnalysis) GetAnalysisKey()(*string) { + return m.analysis_key +} +// GetCategory gets the category property value. Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. +// returns a *string when successful +func (m *CodeScanningAnalysis) GetCategory()(*string) { + return m.category +} +// GetCommitSha gets the commit_sha property value. The SHA of the commit to which the analysis you are uploading relates. +// returns a *string when successful +func (m *CodeScanningAnalysis) GetCommitSha()(*string) { + return m.commit_sha +} +// GetCreatedAt gets the created_at property value. The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningAnalysis) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDeletable gets the deletable property value. The deletable property +// returns a *bool when successful +func (m *CodeScanningAnalysis) GetDeletable()(*bool) { + return m.deletable +} +// GetEnvironment gets the environment property value. Identifies the variable values associated with the environment in which this analysis was performed. +// returns a *string when successful +func (m *CodeScanningAnalysis) GetEnvironment()(*string) { + return m.environment +} +// GetError gets the error property value. The error property +// returns a *string when successful +func (m *CodeScanningAnalysis) GetError()(*string) { + return m.error +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAnalysis) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["analysis_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAnalysisKey(val) + } + return nil + } + res["category"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCategory(val) + } + return nil + } + res["commit_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitSha(val) + } + return nil + } + 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["deletable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeletable(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["error"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetError(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["results_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetResultsCount(val) + } + return nil + } + res["rules_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRulesCount(val) + } + return nil + } + res["sarif_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSarifId(val) + } + return nil + } + res["tool"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAnalysisToolFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTool(val.(CodeScanningAnalysisToolable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["warning"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWarning(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier for this analysis. +// returns a *int32 when successful +func (m *CodeScanningAnalysis) GetId()(*int32) { + return m.id +} +// GetRef gets the ref property value. The Git reference, formatted as `refs/pull//merge`, `refs/pull//head`,`refs/heads/` or simply ``. +// returns a *string when successful +func (m *CodeScanningAnalysis) GetRef()(*string) { + return m.ref +} +// GetResultsCount gets the results_count property value. The total number of results in the analysis. +// returns a *int32 when successful +func (m *CodeScanningAnalysis) GetResultsCount()(*int32) { + return m.results_count +} +// GetRulesCount gets the rules_count property value. The total number of rules used in the analysis. +// returns a *int32 when successful +func (m *CodeScanningAnalysis) GetRulesCount()(*int32) { + return m.rules_count +} +// GetSarifId gets the sarif_id property value. An identifier for the upload. +// returns a *string when successful +func (m *CodeScanningAnalysis) GetSarifId()(*string) { + return m.sarif_id +} +// GetTool gets the tool property value. The tool property +// returns a CodeScanningAnalysisToolable when successful +func (m *CodeScanningAnalysis) GetTool()(CodeScanningAnalysisToolable) { + return m.tool +} +// GetUrl gets the url property value. The REST API URL of the analysis resource. +// returns a *string when successful +func (m *CodeScanningAnalysis) GetUrl()(*string) { + return m.url +} +// GetWarning gets the warning property value. Warning generated when processing the analysis +// returns a *string when successful +func (m *CodeScanningAnalysis) GetWarning()(*string) { + return m.warning +} +// Serialize serializes information the current object +func (m *CodeScanningAnalysis) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("analysis_key", m.GetAnalysisKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("category", m.GetCategory()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_sha", m.GetCommitSha()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("deletable", m.GetDeletable()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("error", m.GetError()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("results_count", m.GetResultsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("rules_count", m.GetRulesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sarif_id", m.GetSarifId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tool", m.GetTool()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("warning", m.GetWarning()) + 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 *CodeScanningAnalysis) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAnalysisKey sets the analysis_key property value. Identifies the configuration under which the analysis was executed. For example, in GitHub Actions this includes the workflow filename and job name. +func (m *CodeScanningAnalysis) SetAnalysisKey(value *string)() { + m.analysis_key = value +} +// SetCategory sets the category property value. Identifies the configuration under which the analysis was executed. Used to distinguish between multiple analyses for the same tool and commit, but performed on different languages or different parts of the code. +func (m *CodeScanningAnalysis) SetCategory(value *string)() { + m.category = value +} +// SetCommitSha sets the commit_sha property value. The SHA of the commit to which the analysis you are uploading relates. +func (m *CodeScanningAnalysis) SetCommitSha(value *string)() { + m.commit_sha = value +} +// SetCreatedAt sets the created_at property value. The time that the analysis was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningAnalysis) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDeletable sets the deletable property value. The deletable property +func (m *CodeScanningAnalysis) SetDeletable(value *bool)() { + m.deletable = value +} +// SetEnvironment sets the environment property value. Identifies the variable values associated with the environment in which this analysis was performed. +func (m *CodeScanningAnalysis) SetEnvironment(value *string)() { + m.environment = value +} +// SetError sets the error property value. The error property +func (m *CodeScanningAnalysis) SetError(value *string)() { + m.error = value +} +// SetId sets the id property value. Unique identifier for this analysis. +func (m *CodeScanningAnalysis) SetId(value *int32)() { + m.id = value +} +// SetRef sets the ref property value. The Git reference, formatted as `refs/pull//merge`, `refs/pull//head`,`refs/heads/` or simply ``. +func (m *CodeScanningAnalysis) SetRef(value *string)() { + m.ref = value +} +// SetResultsCount sets the results_count property value. The total number of results in the analysis. +func (m *CodeScanningAnalysis) SetResultsCount(value *int32)() { + m.results_count = value +} +// SetRulesCount sets the rules_count property value. The total number of rules used in the analysis. +func (m *CodeScanningAnalysis) SetRulesCount(value *int32)() { + m.rules_count = value +} +// SetSarifId sets the sarif_id property value. An identifier for the upload. +func (m *CodeScanningAnalysis) SetSarifId(value *string)() { + m.sarif_id = value +} +// SetTool sets the tool property value. The tool property +func (m *CodeScanningAnalysis) SetTool(value CodeScanningAnalysisToolable)() { + m.tool = value +} +// SetUrl sets the url property value. The REST API URL of the analysis resource. +func (m *CodeScanningAnalysis) SetUrl(value *string)() { + m.url = value +} +// SetWarning sets the warning property value. Warning generated when processing the analysis +func (m *CodeScanningAnalysis) SetWarning(value *string)() { + m.warning = value +} +type CodeScanningAnalysisable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAnalysisKey()(*string) + GetCategory()(*string) + GetCommitSha()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDeletable()(*bool) + GetEnvironment()(*string) + GetError()(*string) + GetId()(*int32) + GetRef()(*string) + GetResultsCount()(*int32) + GetRulesCount()(*int32) + GetSarifId()(*string) + GetTool()(CodeScanningAnalysisToolable) + GetUrl()(*string) + GetWarning()(*string) + SetAnalysisKey(value *string)() + SetCategory(value *string)() + SetCommitSha(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDeletable(value *bool)() + SetEnvironment(value *string)() + SetError(value *string)() + SetId(value *int32)() + SetRef(value *string)() + SetResultsCount(value *int32)() + SetRulesCount(value *int32)() + SetSarifId(value *string)() + SetTool(value CodeScanningAnalysisToolable)() + SetUrl(value *string)() + SetWarning(value *string)() +} diff --git a/pkg/github/models/code_scanning_analysis503_error.go b/pkg/github/models/code_scanning_analysis503_error.go new file mode 100644 index 00000000..888313c9 --- /dev/null +++ b/pkg/github/models/code_scanning_analysis503_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 CodeScanningAnalysis503Error 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 +} +// NewCodeScanningAnalysis503Error instantiates a new CodeScanningAnalysis503Error and sets the default values. +func NewCodeScanningAnalysis503Error()(*CodeScanningAnalysis503Error) { + m := &CodeScanningAnalysis503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAnalysis503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAnalysis503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAnalysis503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningAnalysis503Error) 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 *CodeScanningAnalysis503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningAnalysis503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningAnalysis503Error) 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 *CodeScanningAnalysis503Error) 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 *CodeScanningAnalysis503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningAnalysis503Error) 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 *CodeScanningAnalysis503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningAnalysis503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningAnalysis503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningAnalysis503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningAnalysis503Errorable 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_analysis_deletion.go b/pkg/github/models/code_scanning_analysis_deletion.go new file mode 100644 index 00000000..0e104ce9 --- /dev/null +++ b/pkg/github/models/code_scanning_analysis_deletion.go @@ -0,0 +1,98 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeScanningAnalysisDeletion successful deletion of a code scanning analysis +type CodeScanningAnalysisDeletion struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Next deletable analysis in chain, with last analysis deletion confirmation + confirm_delete_url *string + // Next deletable analysis in chain, without last analysis deletion confirmation + next_analysis_url *string +} +// NewCodeScanningAnalysisDeletion instantiates a new CodeScanningAnalysisDeletion and sets the default values. +func NewCodeScanningAnalysisDeletion()(*CodeScanningAnalysisDeletion) { + m := &CodeScanningAnalysisDeletion{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAnalysisDeletionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAnalysisDeletionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAnalysisDeletion(), 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 *CodeScanningAnalysisDeletion) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfirmDeleteUrl gets the confirm_delete_url property value. Next deletable analysis in chain, with last analysis deletion confirmation +// returns a *string when successful +func (m *CodeScanningAnalysisDeletion) GetConfirmDeleteUrl()(*string) { + return m.confirm_delete_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningAnalysisDeletion) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["confirm_delete_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetConfirmDeleteUrl(val) + } + return nil + } + res["next_analysis_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNextAnalysisUrl(val) + } + return nil + } + return res +} +// GetNextAnalysisUrl gets the next_analysis_url property value. Next deletable analysis in chain, without last analysis deletion confirmation +// returns a *string when successful +func (m *CodeScanningAnalysisDeletion) GetNextAnalysisUrl()(*string) { + return m.next_analysis_url +} +// Serialize serializes information the current object +func (m *CodeScanningAnalysisDeletion) 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 *CodeScanningAnalysisDeletion) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfirmDeleteUrl sets the confirm_delete_url property value. Next deletable analysis in chain, with last analysis deletion confirmation +func (m *CodeScanningAnalysisDeletion) SetConfirmDeleteUrl(value *string)() { + m.confirm_delete_url = value +} +// SetNextAnalysisUrl sets the next_analysis_url property value. Next deletable analysis in chain, without last analysis deletion confirmation +func (m *CodeScanningAnalysisDeletion) SetNextAnalysisUrl(value *string)() { + m.next_analysis_url = value +} +type CodeScanningAnalysisDeletionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConfirmDeleteUrl()(*string) + GetNextAnalysisUrl()(*string) + SetConfirmDeleteUrl(value *string)() + SetNextAnalysisUrl(value *string)() +} diff --git a/pkg/github/models/code_scanning_analysis_deletion503_error.go b/pkg/github/models/code_scanning_analysis_deletion503_error.go new file mode 100644 index 00000000..9a69878c --- /dev/null +++ b/pkg/github/models/code_scanning_analysis_deletion503_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 CodeScanningAnalysisDeletion503Error 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 +} +// NewCodeScanningAnalysisDeletion503Error instantiates a new CodeScanningAnalysisDeletion503Error and sets the default values. +func NewCodeScanningAnalysisDeletion503Error()(*CodeScanningAnalysisDeletion503Error) { + m := &CodeScanningAnalysisDeletion503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAnalysisDeletion503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAnalysisDeletion503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAnalysisDeletion503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningAnalysisDeletion503Error) 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 *CodeScanningAnalysisDeletion503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningAnalysisDeletion503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningAnalysisDeletion503Error) 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 *CodeScanningAnalysisDeletion503Error) 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 *CodeScanningAnalysisDeletion503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningAnalysisDeletion503Error) 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 *CodeScanningAnalysisDeletion503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningAnalysisDeletion503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningAnalysisDeletion503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningAnalysisDeletion503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningAnalysisDeletion503Errorable 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_analysis_tool.go b/pkg/github/models/code_scanning_analysis_tool.go new file mode 100644 index 00000000..075ba541 --- /dev/null +++ b/pkg/github/models/code_scanning_analysis_tool.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningAnalysisTool 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 GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data. + guid *string + // The name of the tool used to generate the code scanning analysis. + name *string + // The version of the tool used to generate the code scanning analysis. + version *string +} +// NewCodeScanningAnalysisTool instantiates a new CodeScanningAnalysisTool and sets the default values. +func NewCodeScanningAnalysisTool()(*CodeScanningAnalysisTool) { + m := &CodeScanningAnalysisTool{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningAnalysisToolFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningAnalysisToolFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningAnalysisTool(), 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 *CodeScanningAnalysisTool) 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 *CodeScanningAnalysisTool) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["guid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGuid(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["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} +// GetGuid gets the guid property value. The GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data. +// returns a *string when successful +func (m *CodeScanningAnalysisTool) GetGuid()(*string) { + return m.guid +} +// GetName gets the name property value. The name of the tool used to generate the code scanning analysis. +// returns a *string when successful +func (m *CodeScanningAnalysisTool) GetName()(*string) { + return m.name +} +// GetVersion gets the version property value. The version of the tool used to generate the code scanning analysis. +// returns a *string when successful +func (m *CodeScanningAnalysisTool) GetVersion()(*string) { + return m.version +} +// Serialize serializes information the current object +func (m *CodeScanningAnalysisTool) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("guid", m.GetGuid()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("version", m.GetVersion()) + 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 *CodeScanningAnalysisTool) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGuid sets the guid property value. The GUID of the tool used to generate the code scanning analysis, if provided in the uploaded SARIF data. +func (m *CodeScanningAnalysisTool) SetGuid(value *string)() { + m.guid = value +} +// SetName sets the name property value. The name of the tool used to generate the code scanning analysis. +func (m *CodeScanningAnalysisTool) SetName(value *string)() { + m.name = value +} +// SetVersion sets the version property value. The version of the tool used to generate the code scanning analysis. +func (m *CodeScanningAnalysisTool) SetVersion(value *string)() { + m.version = value +} +type CodeScanningAnalysisToolable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGuid()(*string) + GetName()(*string) + GetVersion()(*string) + SetGuid(value *string)() + SetName(value *string)() + SetVersion(value *string)() +} diff --git a/pkg/github/models/code_scanning_default_setup.go b/pkg/github/models/code_scanning_default_setup.go new file mode 100644 index 00000000..01af1752 --- /dev/null +++ b/pkg/github/models/code_scanning_default_setup.go @@ -0,0 +1,207 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeScanningDefaultSetup configuration for code scanning default setup. +type CodeScanningDefaultSetup struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Languages to be analyzed. + languages []CodeScanningDefaultSetup_languages + // CodeQL query suite to be used. + query_suite *CodeScanningDefaultSetup_query_suite + // The frequency of the periodic analysis. + schedule *CodeScanningDefaultSetup_schedule + // Code scanning default setup has been configured or not. + state *CodeScanningDefaultSetup_state + // Timestamp of latest configuration update. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewCodeScanningDefaultSetup instantiates a new CodeScanningDefaultSetup and sets the default values. +func NewCodeScanningDefaultSetup()(*CodeScanningDefaultSetup) { + m := &CodeScanningDefaultSetup{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningDefaultSetupFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningDefaultSetupFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningDefaultSetup(), 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 *CodeScanningDefaultSetup) 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 *CodeScanningDefaultSetup) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["languages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseCodeScanningDefaultSetup_languages) + if err != nil { + return err + } + if val != nil { + res := make([]CodeScanningDefaultSetup_languages, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*CodeScanningDefaultSetup_languages)) + } + } + m.SetLanguages(res) + } + return nil + } + res["query_suite"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningDefaultSetup_query_suite) + if err != nil { + return err + } + if val != nil { + m.SetQuerySuite(val.(*CodeScanningDefaultSetup_query_suite)) + } + return nil + } + res["schedule"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningDefaultSetup_schedule) + if err != nil { + return err + } + if val != nil { + m.SetSchedule(val.(*CodeScanningDefaultSetup_schedule)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningDefaultSetup_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*CodeScanningDefaultSetup_state)) + } + 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 + } + return res +} +// GetLanguages gets the languages property value. Languages to be analyzed. +// returns a []CodeScanningDefaultSetup_languages when successful +func (m *CodeScanningDefaultSetup) GetLanguages()([]CodeScanningDefaultSetup_languages) { + return m.languages +} +// GetQuerySuite gets the query_suite property value. CodeQL query suite to be used. +// returns a *CodeScanningDefaultSetup_query_suite when successful +func (m *CodeScanningDefaultSetup) GetQuerySuite()(*CodeScanningDefaultSetup_query_suite) { + return m.query_suite +} +// GetSchedule gets the schedule property value. The frequency of the periodic analysis. +// returns a *CodeScanningDefaultSetup_schedule when successful +func (m *CodeScanningDefaultSetup) GetSchedule()(*CodeScanningDefaultSetup_schedule) { + return m.schedule +} +// GetState gets the state property value. Code scanning default setup has been configured or not. +// returns a *CodeScanningDefaultSetup_state when successful +func (m *CodeScanningDefaultSetup) GetState()(*CodeScanningDefaultSetup_state) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. Timestamp of latest configuration update. +// returns a *Time when successful +func (m *CodeScanningDefaultSetup) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *CodeScanningDefaultSetup) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLanguages() != nil { + err := writer.WriteCollectionOfStringValues("languages", SerializeCodeScanningDefaultSetup_languages(m.GetLanguages())) + if err != nil { + return err + } + } + if m.GetQuerySuite() != nil { + cast := (*m.GetQuerySuite()).String() + err := writer.WriteStringValue("query_suite", &cast) + if err != nil { + return err + } + } + if m.GetSchedule() != nil { + cast := (*m.GetSchedule()).String() + err := writer.WriteStringValue("schedule", &cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *CodeScanningDefaultSetup) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLanguages sets the languages property value. Languages to be analyzed. +func (m *CodeScanningDefaultSetup) SetLanguages(value []CodeScanningDefaultSetup_languages)() { + m.languages = value +} +// SetQuerySuite sets the query_suite property value. CodeQL query suite to be used. +func (m *CodeScanningDefaultSetup) SetQuerySuite(value *CodeScanningDefaultSetup_query_suite)() { + m.query_suite = value +} +// SetSchedule sets the schedule property value. The frequency of the periodic analysis. +func (m *CodeScanningDefaultSetup) SetSchedule(value *CodeScanningDefaultSetup_schedule)() { + m.schedule = value +} +// SetState sets the state property value. Code scanning default setup has been configured or not. +func (m *CodeScanningDefaultSetup) SetState(value *CodeScanningDefaultSetup_state)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. Timestamp of latest configuration update. +func (m *CodeScanningDefaultSetup) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type CodeScanningDefaultSetupable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLanguages()([]CodeScanningDefaultSetup_languages) + GetQuerySuite()(*CodeScanningDefaultSetup_query_suite) + GetSchedule()(*CodeScanningDefaultSetup_schedule) + GetState()(*CodeScanningDefaultSetup_state) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetLanguages(value []CodeScanningDefaultSetup_languages)() + SetQuerySuite(value *CodeScanningDefaultSetup_query_suite)() + SetSchedule(value *CodeScanningDefaultSetup_schedule)() + SetState(value *CodeScanningDefaultSetup_state)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/code_scanning_default_setup503_error.go b/pkg/github/models/code_scanning_default_setup503_error.go new file mode 100644 index 00000000..80210d36 --- /dev/null +++ b/pkg/github/models/code_scanning_default_setup503_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 CodeScanningDefaultSetup503Error 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 +} +// NewCodeScanningDefaultSetup503Error instantiates a new CodeScanningDefaultSetup503Error and sets the default values. +func NewCodeScanningDefaultSetup503Error()(*CodeScanningDefaultSetup503Error) { + m := &CodeScanningDefaultSetup503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningDefaultSetup503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningDefaultSetup503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningDefaultSetup503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningDefaultSetup503Error) 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 *CodeScanningDefaultSetup503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningDefaultSetup503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningDefaultSetup503Error) 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 *CodeScanningDefaultSetup503Error) 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 *CodeScanningDefaultSetup503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningDefaultSetup503Error) 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 *CodeScanningDefaultSetup503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningDefaultSetup503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningDefaultSetup503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningDefaultSetup503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningDefaultSetup503Errorable 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_default_setup_escaped_languages.go b/pkg/github/models/code_scanning_default_setup_escaped_languages.go new file mode 100644 index 00000000..78b417f4 --- /dev/null +++ b/pkg/github/models/code_scanning_default_setup_escaped_languages.go @@ -0,0 +1,57 @@ +package models +type CodeScanningDefaultSetup_languages int + +const ( + CCPP_CODESCANNINGDEFAULTSETUP_LANGUAGES CodeScanningDefaultSetup_languages = iota + CSHARP_CODESCANNINGDEFAULTSETUP_LANGUAGES + GO_CODESCANNINGDEFAULTSETUP_LANGUAGES + JAVAKOTLIN_CODESCANNINGDEFAULTSETUP_LANGUAGES + JAVASCRIPTTYPESCRIPT_CODESCANNINGDEFAULTSETUP_LANGUAGES + JAVASCRIPT_CODESCANNINGDEFAULTSETUP_LANGUAGES + PYTHON_CODESCANNINGDEFAULTSETUP_LANGUAGES + RUBY_CODESCANNINGDEFAULTSETUP_LANGUAGES + TYPESCRIPT_CODESCANNINGDEFAULTSETUP_LANGUAGES + SWIFT_CODESCANNINGDEFAULTSETUP_LANGUAGES +) + +func (i CodeScanningDefaultSetup_languages) String() string { + return []string{"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 + switch v { + case "c-cpp": + result = CCPP_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "csharp": + result = CSHARP_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "go": + result = GO_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "java-kotlin": + result = JAVAKOTLIN_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "javascript-typescript": + result = JAVASCRIPTTYPESCRIPT_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "javascript": + result = JAVASCRIPT_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "python": + result = PYTHON_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "ruby": + result = RUBY_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "typescript": + result = TYPESCRIPT_CODESCANNINGDEFAULTSETUP_LANGUAGES + case "swift": + result = SWIFT_CODESCANNINGDEFAULTSETUP_LANGUAGES + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningDefaultSetup_languages(values []CodeScanningDefaultSetup_languages) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningDefaultSetup_languages) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_default_setup_escaped_query_escaped_suite.go b/pkg/github/models/code_scanning_default_setup_escaped_query_escaped_suite.go new file mode 100644 index 00000000..403fd560 --- /dev/null +++ b/pkg/github/models/code_scanning_default_setup_escaped_query_escaped_suite.go @@ -0,0 +1,34 @@ +package models +// CodeQL query suite to be used. +type CodeScanningDefaultSetup_query_suite int + +const ( + DEFAULT_CODESCANNINGDEFAULTSETUP_QUERY_SUITE CodeScanningDefaultSetup_query_suite = iota + EXTENDED_CODESCANNINGDEFAULTSETUP_QUERY_SUITE +) + +func (i CodeScanningDefaultSetup_query_suite) String() string { + return []string{"default", "extended"}[i] +} +func ParseCodeScanningDefaultSetup_query_suite(v string) (any, error) { + result := DEFAULT_CODESCANNINGDEFAULTSETUP_QUERY_SUITE + switch v { + case "default": + result = DEFAULT_CODESCANNINGDEFAULTSETUP_QUERY_SUITE + case "extended": + result = EXTENDED_CODESCANNINGDEFAULTSETUP_QUERY_SUITE + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningDefaultSetup_query_suite(values []CodeScanningDefaultSetup_query_suite) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningDefaultSetup_query_suite) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_default_setup_escaped_schedule.go b/pkg/github/models/code_scanning_default_setup_escaped_schedule.go new file mode 100644 index 00000000..1a36aee7 --- /dev/null +++ b/pkg/github/models/code_scanning_default_setup_escaped_schedule.go @@ -0,0 +1,31 @@ +package models +// The frequency of the periodic analysis. +type CodeScanningDefaultSetup_schedule int + +const ( + WEEKLY_CODESCANNINGDEFAULTSETUP_SCHEDULE CodeScanningDefaultSetup_schedule = iota +) + +func (i CodeScanningDefaultSetup_schedule) String() string { + return []string{"weekly"}[i] +} +func ParseCodeScanningDefaultSetup_schedule(v string) (any, error) { + result := WEEKLY_CODESCANNINGDEFAULTSETUP_SCHEDULE + switch v { + case "weekly": + result = WEEKLY_CODESCANNINGDEFAULTSETUP_SCHEDULE + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningDefaultSetup_schedule(values []CodeScanningDefaultSetup_schedule) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningDefaultSetup_schedule) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_default_setup_escaped_state.go b/pkg/github/models/code_scanning_default_setup_escaped_state.go new file mode 100644 index 00000000..472c10d3 --- /dev/null +++ b/pkg/github/models/code_scanning_default_setup_escaped_state.go @@ -0,0 +1,34 @@ +package models +// Code scanning default setup has been configured or not. +type CodeScanningDefaultSetup_state int + +const ( + CONFIGURED_CODESCANNINGDEFAULTSETUP_STATE CodeScanningDefaultSetup_state = iota + NOTCONFIGURED_CODESCANNINGDEFAULTSETUP_STATE +) + +func (i CodeScanningDefaultSetup_state) String() string { + return []string{"configured", "not-configured"}[i] +} +func ParseCodeScanningDefaultSetup_state(v string) (any, error) { + result := CONFIGURED_CODESCANNINGDEFAULTSETUP_STATE + switch v { + case "configured": + result = CONFIGURED_CODESCANNINGDEFAULTSETUP_STATE + case "not-configured": + result = NOTCONFIGURED_CODESCANNINGDEFAULTSETUP_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningDefaultSetup_state(values []CodeScanningDefaultSetup_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningDefaultSetup_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_default_setup_update.go b/pkg/github/models/code_scanning_default_setup_update.go new file mode 100644 index 00000000..afe9a8c2 --- /dev/null +++ b/pkg/github/models/code_scanning_default_setup_update.go @@ -0,0 +1,128 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeScanningDefaultSetupUpdate configuration for code scanning default setup. +type CodeScanningDefaultSetupUpdate struct { + // CodeQL languages to be analyzed. + languages []CodeScanningDefaultSetupUpdate_languages + // CodeQL query suite to be used. + query_suite *CodeScanningDefaultSetupUpdate_query_suite + // The desired state of code scanning default setup. + state *CodeScanningDefaultSetupUpdate_state +} +// NewCodeScanningDefaultSetupUpdate instantiates a new CodeScanningDefaultSetupUpdate and sets the default values. +func NewCodeScanningDefaultSetupUpdate()(*CodeScanningDefaultSetupUpdate) { + m := &CodeScanningDefaultSetupUpdate{ + } + return m +} +// CreateCodeScanningDefaultSetupUpdateFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningDefaultSetupUpdateFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningDefaultSetupUpdate(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningDefaultSetupUpdate) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["languages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseCodeScanningDefaultSetupUpdate_languages) + if err != nil { + return err + } + if val != nil { + res := make([]CodeScanningDefaultSetupUpdate_languages, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*CodeScanningDefaultSetupUpdate_languages)) + } + } + m.SetLanguages(res) + } + return nil + } + res["query_suite"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningDefaultSetupUpdate_query_suite) + if err != nil { + return err + } + if val != nil { + m.SetQuerySuite(val.(*CodeScanningDefaultSetupUpdate_query_suite)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningDefaultSetupUpdate_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*CodeScanningDefaultSetupUpdate_state)) + } + return nil + } + return res +} +// GetLanguages gets the languages property value. CodeQL languages to be analyzed. +// returns a []CodeScanningDefaultSetupUpdate_languages when successful +func (m *CodeScanningDefaultSetupUpdate) GetLanguages()([]CodeScanningDefaultSetupUpdate_languages) { + return m.languages +} +// GetQuerySuite gets the query_suite property value. CodeQL query suite to be used. +// returns a *CodeScanningDefaultSetupUpdate_query_suite when successful +func (m *CodeScanningDefaultSetupUpdate) GetQuerySuite()(*CodeScanningDefaultSetupUpdate_query_suite) { + return m.query_suite +} +// GetState gets the state property value. The desired state of code scanning default setup. +// returns a *CodeScanningDefaultSetupUpdate_state when successful +func (m *CodeScanningDefaultSetupUpdate) GetState()(*CodeScanningDefaultSetupUpdate_state) { + return m.state +} +// Serialize serializes information the current object +func (m *CodeScanningDefaultSetupUpdate) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLanguages() != nil { + err := writer.WriteCollectionOfStringValues("languages", SerializeCodeScanningDefaultSetupUpdate_languages(m.GetLanguages())) + if err != nil { + return err + } + } + if m.GetQuerySuite() != nil { + cast := (*m.GetQuerySuite()).String() + err := writer.WriteStringValue("query_suite", &cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + return nil +} +// SetLanguages sets the languages property value. CodeQL languages to be analyzed. +func (m *CodeScanningDefaultSetupUpdate) SetLanguages(value []CodeScanningDefaultSetupUpdate_languages)() { + m.languages = value +} +// SetQuerySuite sets the query_suite property value. CodeQL query suite to be used. +func (m *CodeScanningDefaultSetupUpdate) SetQuerySuite(value *CodeScanningDefaultSetupUpdate_query_suite)() { + m.query_suite = value +} +// SetState sets the state property value. The desired state of code scanning default setup. +func (m *CodeScanningDefaultSetupUpdate) SetState(value *CodeScanningDefaultSetupUpdate_state)() { + m.state = value +} +type CodeScanningDefaultSetupUpdateable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLanguages()([]CodeScanningDefaultSetupUpdate_languages) + GetQuerySuite()(*CodeScanningDefaultSetupUpdate_query_suite) + GetState()(*CodeScanningDefaultSetupUpdate_state) + SetLanguages(value []CodeScanningDefaultSetupUpdate_languages)() + SetQuerySuite(value *CodeScanningDefaultSetupUpdate_query_suite)() + SetState(value *CodeScanningDefaultSetupUpdate_state)() +} 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 new file mode 100644 index 00000000..c1f3a1f8 --- /dev/null +++ b/pkg/github/models/code_scanning_default_setup_update_escaped_languages.go @@ -0,0 +1,51 @@ +package models +type CodeScanningDefaultSetupUpdate_languages int + +const ( + CCPP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES CodeScanningDefaultSetupUpdate_languages = iota + CSHARP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + GO_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + JAVAKOTLIN_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + JAVASCRIPTTYPESCRIPT_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + PYTHON_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + RUBY_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + SWIFT_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES +) + +func (i CodeScanningDefaultSetupUpdate_languages) String() string { + return []string{"c-cpp", "csharp", "go", "java-kotlin", "javascript-typescript", "python", "ruby", "swift"}[i] +} +func ParseCodeScanningDefaultSetupUpdate_languages(v string) (any, error) { + result := CCPP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + switch v { + case "c-cpp": + result = CCPP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + case "csharp": + result = CSHARP_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + case "go": + result = GO_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + case "java-kotlin": + result = JAVAKOTLIN_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + case "javascript-typescript": + result = JAVASCRIPTTYPESCRIPT_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + case "python": + result = PYTHON_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + case "ruby": + result = RUBY_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + case "swift": + result = SWIFT_CODESCANNINGDEFAULTSETUPUPDATE_LANGUAGES + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningDefaultSetupUpdate_languages(values []CodeScanningDefaultSetupUpdate_languages) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningDefaultSetupUpdate_languages) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_default_setup_update_escaped_query_escaped_suite.go b/pkg/github/models/code_scanning_default_setup_update_escaped_query_escaped_suite.go new file mode 100644 index 00000000..2761da92 --- /dev/null +++ b/pkg/github/models/code_scanning_default_setup_update_escaped_query_escaped_suite.go @@ -0,0 +1,34 @@ +package models +// CodeQL query suite to be used. +type CodeScanningDefaultSetupUpdate_query_suite int + +const ( + DEFAULT_CODESCANNINGDEFAULTSETUPUPDATE_QUERY_SUITE CodeScanningDefaultSetupUpdate_query_suite = iota + EXTENDED_CODESCANNINGDEFAULTSETUPUPDATE_QUERY_SUITE +) + +func (i CodeScanningDefaultSetupUpdate_query_suite) String() string { + return []string{"default", "extended"}[i] +} +func ParseCodeScanningDefaultSetupUpdate_query_suite(v string) (any, error) { + result := DEFAULT_CODESCANNINGDEFAULTSETUPUPDATE_QUERY_SUITE + switch v { + case "default": + result = DEFAULT_CODESCANNINGDEFAULTSETUPUPDATE_QUERY_SUITE + case "extended": + result = EXTENDED_CODESCANNINGDEFAULTSETUPUPDATE_QUERY_SUITE + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningDefaultSetupUpdate_query_suite(values []CodeScanningDefaultSetupUpdate_query_suite) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningDefaultSetupUpdate_query_suite) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_default_setup_update_escaped_state.go b/pkg/github/models/code_scanning_default_setup_update_escaped_state.go new file mode 100644 index 00000000..1bcb0ae5 --- /dev/null +++ b/pkg/github/models/code_scanning_default_setup_update_escaped_state.go @@ -0,0 +1,34 @@ +package models +// The desired state of code scanning default setup. +type CodeScanningDefaultSetupUpdate_state int + +const ( + CONFIGURED_CODESCANNINGDEFAULTSETUPUPDATE_STATE CodeScanningDefaultSetupUpdate_state = iota + NOTCONFIGURED_CODESCANNINGDEFAULTSETUPUPDATE_STATE +) + +func (i CodeScanningDefaultSetupUpdate_state) String() string { + return []string{"configured", "not-configured"}[i] +} +func ParseCodeScanningDefaultSetupUpdate_state(v string) (any, error) { + result := CONFIGURED_CODESCANNINGDEFAULTSETUPUPDATE_STATE + switch v { + case "configured": + result = CONFIGURED_CODESCANNINGDEFAULTSETUPUPDATE_STATE + case "not-configured": + result = NOTCONFIGURED_CODESCANNINGDEFAULTSETUPUPDATE_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningDefaultSetupUpdate_state(values []CodeScanningDefaultSetupUpdate_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningDefaultSetupUpdate_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_scanning_organization_alert_items.go b/pkg/github/models/code_scanning_organization_alert_items.go new file mode 100644 index 00000000..c35910ab --- /dev/null +++ b/pkg/github/models/code_scanning_organization_alert_items.go @@ -0,0 +1,470 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningOrganizationAlertItems struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + dismissed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + dismissed_by NullableSimpleUserable + // The dismissal comment associated with the dismissal of the alert. + dismissed_comment *string + // **Required when the state is dismissed.** The reason for dismissing or closing the alert. + dismissed_reason *CodeScanningAlertDismissedReason + // The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + fixed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The GitHub URL of the alert resource. + html_url *string + // The REST API URL for fetching the list of instances for an alert. + instances_url *string + // The most_recent_instance property + most_recent_instance CodeScanningAlertInstanceable + // The security alert number. + number *int32 + // A GitHub repository. + repository SimpleRepositoryable + // The rule property + rule CodeScanningAlertRuleSummaryable + // State of a code scanning alert. + state *CodeScanningAlertState + // The tool property + tool CodeScanningAnalysisToolable + // The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The REST API URL of the alert resource. + url *string +} +// NewCodeScanningOrganizationAlertItems instantiates a new CodeScanningOrganizationAlertItems and sets the default values. +func NewCodeScanningOrganizationAlertItems()(*CodeScanningOrganizationAlertItems) { + m := &CodeScanningOrganizationAlertItems{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningOrganizationAlertItemsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningOrganizationAlertItemsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningOrganizationAlertItems(), 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 *CodeScanningOrganizationAlertItems) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningOrganizationAlertItems) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDismissedAt gets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningOrganizationAlertItems) GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.dismissed_at +} +// GetDismissedBy gets the dismissed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *CodeScanningOrganizationAlertItems) GetDismissedBy()(NullableSimpleUserable) { + return m.dismissed_by +} +// GetDismissedComment gets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +// returns a *string when successful +func (m *CodeScanningOrganizationAlertItems) GetDismissedComment()(*string) { + return m.dismissed_comment +} +// GetDismissedReason gets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +// returns a *CodeScanningAlertDismissedReason when successful +func (m *CodeScanningOrganizationAlertItems) GetDismissedReason()(*CodeScanningAlertDismissedReason) { + return m.dismissed_reason +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningOrganizationAlertItems) 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["dismissed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedAt(val) + } + return nil + } + res["dismissed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["dismissed_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedComment(val) + } + return nil + } + res["dismissed_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertDismissedReason) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReason(val.(*CodeScanningAlertDismissedReason)) + } + return nil + } + res["fixed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetFixedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["instances_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInstancesUrl(val) + } + return nil + } + res["most_recent_instance"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertInstanceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMostRecentInstance(val.(CodeScanningAlertInstanceable)) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(SimpleRepositoryable)) + } + return nil + } + res["rule"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAlertRuleSummaryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRule(val.(CodeScanningAlertRuleSummaryable)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningAlertState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*CodeScanningAlertState)) + } + return nil + } + res["tool"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeScanningAnalysisToolFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTool(val.(CodeScanningAnalysisToolable)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFixedAt gets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningOrganizationAlertItems) GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.fixed_at +} +// GetHtmlUrl gets the html_url property value. The GitHub URL of the alert resource. +// returns a *string when successful +func (m *CodeScanningOrganizationAlertItems) GetHtmlUrl()(*string) { + return m.html_url +} +// GetInstancesUrl gets the instances_url property value. The REST API URL for fetching the list of instances for an alert. +// returns a *string when successful +func (m *CodeScanningOrganizationAlertItems) GetInstancesUrl()(*string) { + return m.instances_url +} +// GetMostRecentInstance gets the most_recent_instance property value. The most_recent_instance property +// returns a CodeScanningAlertInstanceable when successful +func (m *CodeScanningOrganizationAlertItems) GetMostRecentInstance()(CodeScanningAlertInstanceable) { + return m.most_recent_instance +} +// GetNumber gets the number property value. The security alert number. +// returns a *int32 when successful +func (m *CodeScanningOrganizationAlertItems) GetNumber()(*int32) { + return m.number +} +// GetRepository gets the repository property value. A GitHub repository. +// returns a SimpleRepositoryable when successful +func (m *CodeScanningOrganizationAlertItems) GetRepository()(SimpleRepositoryable) { + return m.repository +} +// GetRule gets the rule property value. The rule property +// returns a CodeScanningAlertRuleSummaryable when successful +func (m *CodeScanningOrganizationAlertItems) GetRule()(CodeScanningAlertRuleSummaryable) { + return m.rule +} +// GetState gets the state property value. State of a code scanning alert. +// returns a *CodeScanningAlertState when successful +func (m *CodeScanningOrganizationAlertItems) GetState()(*CodeScanningAlertState) { + return m.state +} +// GetTool gets the tool property value. The tool property +// returns a CodeScanningAnalysisToolable when successful +func (m *CodeScanningOrganizationAlertItems) GetTool()(CodeScanningAnalysisToolable) { + return m.tool +} +// GetUpdatedAt gets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *CodeScanningOrganizationAlertItems) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The REST API URL of the alert resource. +// returns a *string when successful +func (m *CodeScanningOrganizationAlertItems) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeScanningOrganizationAlertItems) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dismissed_by", m.GetDismissedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dismissed_comment", m.GetDismissedComment()) + if err != nil { + return err + } + } + if m.GetDismissedReason() != nil { + cast := (*m.GetDismissedReason()).String() + err := writer.WriteStringValue("dismissed_reason", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("most_recent_instance", m.GetMostRecentInstance()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("rule", m.GetRule()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tool", m.GetTool()) + 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 *CodeScanningOrganizationAlertItems) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningOrganizationAlertItems) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDismissedAt sets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningOrganizationAlertItems) SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.dismissed_at = value +} +// SetDismissedBy sets the dismissed_by property value. A GitHub user. +func (m *CodeScanningOrganizationAlertItems) SetDismissedBy(value NullableSimpleUserable)() { + m.dismissed_by = value +} +// SetDismissedComment sets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +func (m *CodeScanningOrganizationAlertItems) SetDismissedComment(value *string)() { + m.dismissed_comment = value +} +// SetDismissedReason sets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +func (m *CodeScanningOrganizationAlertItems) SetDismissedReason(value *CodeScanningAlertDismissedReason)() { + m.dismissed_reason = value +} +// SetFixedAt sets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningOrganizationAlertItems) SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.fixed_at = value +} +// SetHtmlUrl sets the html_url property value. The GitHub URL of the alert resource. +func (m *CodeScanningOrganizationAlertItems) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetInstancesUrl sets the instances_url property value. The REST API URL for fetching the list of instances for an alert. +func (m *CodeScanningOrganizationAlertItems) SetInstancesUrl(value *string)() { + m.instances_url = value +} +// SetMostRecentInstance sets the most_recent_instance property value. The most_recent_instance property +func (m *CodeScanningOrganizationAlertItems) SetMostRecentInstance(value CodeScanningAlertInstanceable)() { + m.most_recent_instance = value +} +// SetNumber sets the number property value. The security alert number. +func (m *CodeScanningOrganizationAlertItems) SetNumber(value *int32)() { + m.number = value +} +// SetRepository sets the repository property value. A GitHub repository. +func (m *CodeScanningOrganizationAlertItems) SetRepository(value SimpleRepositoryable)() { + m.repository = value +} +// SetRule sets the rule property value. The rule property +func (m *CodeScanningOrganizationAlertItems) SetRule(value CodeScanningAlertRuleSummaryable)() { + m.rule = value +} +// SetState sets the state property value. State of a code scanning alert. +func (m *CodeScanningOrganizationAlertItems) SetState(value *CodeScanningAlertState)() { + m.state = value +} +// SetTool sets the tool property value. The tool property +func (m *CodeScanningOrganizationAlertItems) SetTool(value CodeScanningAnalysisToolable)() { + m.tool = value +} +// SetUpdatedAt sets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *CodeScanningOrganizationAlertItems) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The REST API URL of the alert resource. +func (m *CodeScanningOrganizationAlertItems) SetUrl(value *string)() { + m.url = value +} +type CodeScanningOrganizationAlertItemsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedBy()(NullableSimpleUserable) + GetDismissedComment()(*string) + GetDismissedReason()(*CodeScanningAlertDismissedReason) + GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetInstancesUrl()(*string) + GetMostRecentInstance()(CodeScanningAlertInstanceable) + GetNumber()(*int32) + GetRepository()(SimpleRepositoryable) + GetRule()(CodeScanningAlertRuleSummaryable) + GetState()(*CodeScanningAlertState) + GetTool()(CodeScanningAnalysisToolable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedBy(value NullableSimpleUserable)() + SetDismissedComment(value *string)() + SetDismissedReason(value *CodeScanningAlertDismissedReason)() + SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetInstancesUrl(value *string)() + SetMostRecentInstance(value CodeScanningAlertInstanceable)() + SetNumber(value *int32)() + SetRepository(value SimpleRepositoryable)() + SetRule(value CodeScanningAlertRuleSummaryable)() + SetState(value *CodeScanningAlertState)() + SetTool(value CodeScanningAnalysisToolable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/code_scanning_sarifs_receipt.go b/pkg/github/models/code_scanning_sarifs_receipt.go new file mode 100644 index 00000000..ad7bebb7 --- /dev/null +++ b/pkg/github/models/code_scanning_sarifs_receipt.go @@ -0,0 +1,103 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningSarifsReceipt 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 identifier for the upload. + id *string + // The REST API URL for checking the status of the upload. + url *string +} +// NewCodeScanningSarifsReceipt instantiates a new CodeScanningSarifsReceipt and sets the default values. +func NewCodeScanningSarifsReceipt()(*CodeScanningSarifsReceipt) { + m := &CodeScanningSarifsReceipt{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningSarifsReceiptFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningSarifsReceiptFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningSarifsReceipt(), 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 *CodeScanningSarifsReceipt) 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 *CodeScanningSarifsReceipt) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. An identifier for the upload. +// returns a *string when successful +func (m *CodeScanningSarifsReceipt) GetId()(*string) { + return m.id +} +// GetUrl gets the url property value. The REST API URL for checking the status of the upload. +// returns a *string when successful +func (m *CodeScanningSarifsReceipt) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeScanningSarifsReceipt) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("id", m.GetId()) + 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 *CodeScanningSarifsReceipt) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. An identifier for the upload. +func (m *CodeScanningSarifsReceipt) SetId(value *string)() { + m.id = value +} +// SetUrl sets the url property value. The REST API URL for checking the status of the upload. +func (m *CodeScanningSarifsReceipt) SetUrl(value *string)() { + m.url = value +} +type CodeScanningSarifsReceiptable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*string) + GetUrl()(*string) + SetId(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/code_scanning_sarifs_receipt503_error.go b/pkg/github/models/code_scanning_sarifs_receipt503_error.go new file mode 100644 index 00000000..85870849 --- /dev/null +++ b/pkg/github/models/code_scanning_sarifs_receipt503_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 CodeScanningSarifsReceipt503Error 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 +} +// NewCodeScanningSarifsReceipt503Error instantiates a new CodeScanningSarifsReceipt503Error and sets the default values. +func NewCodeScanningSarifsReceipt503Error()(*CodeScanningSarifsReceipt503Error) { + m := &CodeScanningSarifsReceipt503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningSarifsReceipt503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningSarifsReceipt503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningSarifsReceipt503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningSarifsReceipt503Error) 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 *CodeScanningSarifsReceipt503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningSarifsReceipt503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningSarifsReceipt503Error) 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 *CodeScanningSarifsReceipt503Error) 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 *CodeScanningSarifsReceipt503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningSarifsReceipt503Error) 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 *CodeScanningSarifsReceipt503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningSarifsReceipt503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningSarifsReceipt503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningSarifsReceipt503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningSarifsReceipt503Errorable 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_sarifs_status.go b/pkg/github/models/code_scanning_sarifs_status.go new file mode 100644 index 00000000..43202aec --- /dev/null +++ b/pkg/github/models/code_scanning_sarifs_status.go @@ -0,0 +1,133 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeScanningSarifsStatus 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 REST API URL for getting the analyses associated with the upload. + analyses_url *string + // Any errors that ocurred during processing of the delivery. + errors []string + // `pending` files have not yet been processed, while `complete` means results from the SARIF have been stored. `failed` files have either not been processed at all, or could only be partially processed. + processing_status *CodeScanningSarifsStatus_processing_status +} +// NewCodeScanningSarifsStatus instantiates a new CodeScanningSarifsStatus and sets the default values. +func NewCodeScanningSarifsStatus()(*CodeScanningSarifsStatus) { + m := &CodeScanningSarifsStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningSarifsStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningSarifsStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningSarifsStatus(), 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 *CodeScanningSarifsStatus) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAnalysesUrl gets the analyses_url property value. The REST API URL for getting the analyses associated with the upload. +// returns a *string when successful +func (m *CodeScanningSarifsStatus) GetAnalysesUrl()(*string) { + return m.analyses_url +} +// GetErrors gets the errors property value. Any errors that ocurred during processing of the delivery. +// returns a []string when successful +func (m *CodeScanningSarifsStatus) GetErrors()([]string) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeScanningSarifsStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["analyses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAnalysesUrl(val) + } + return nil + } + res["errors"] = 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.SetErrors(res) + } + return nil + } + res["processing_status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCodeScanningSarifsStatus_processing_status) + if err != nil { + return err + } + if val != nil { + m.SetProcessingStatus(val.(*CodeScanningSarifsStatus_processing_status)) + } + return nil + } + return res +} +// GetProcessingStatus gets the processing_status property value. `pending` files have not yet been processed, while `complete` means results from the SARIF have been stored. `failed` files have either not been processed at all, or could only be partially processed. +// returns a *CodeScanningSarifsStatus_processing_status when successful +func (m *CodeScanningSarifsStatus) GetProcessingStatus()(*CodeScanningSarifsStatus_processing_status) { + return m.processing_status +} +// Serialize serializes information the current object +func (m *CodeScanningSarifsStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetProcessingStatus() != nil { + cast := (*m.GetProcessingStatus()).String() + err := writer.WriteStringValue("processing_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 *CodeScanningSarifsStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAnalysesUrl sets the analyses_url property value. The REST API URL for getting the analyses associated with the upload. +func (m *CodeScanningSarifsStatus) SetAnalysesUrl(value *string)() { + m.analyses_url = value +} +// SetErrors sets the errors property value. Any errors that ocurred during processing of the delivery. +func (m *CodeScanningSarifsStatus) SetErrors(value []string)() { + m.errors = value +} +// SetProcessingStatus sets the processing_status property value. `pending` files have not yet been processed, while `complete` means results from the SARIF have been stored. `failed` files have either not been processed at all, or could only be partially processed. +func (m *CodeScanningSarifsStatus) SetProcessingStatus(value *CodeScanningSarifsStatus_processing_status)() { + m.processing_status = value +} +type CodeScanningSarifsStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAnalysesUrl()(*string) + GetErrors()([]string) + GetProcessingStatus()(*CodeScanningSarifsStatus_processing_status) + SetAnalysesUrl(value *string)() + SetErrors(value []string)() + SetProcessingStatus(value *CodeScanningSarifsStatus_processing_status)() +} diff --git a/pkg/github/models/code_scanning_sarifs_status503_error.go b/pkg/github/models/code_scanning_sarifs_status503_error.go new file mode 100644 index 00000000..fce60ffb --- /dev/null +++ b/pkg/github/models/code_scanning_sarifs_status503_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 CodeScanningSarifsStatus503Error 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 +} +// NewCodeScanningSarifsStatus503Error instantiates a new CodeScanningSarifsStatus503Error and sets the default values. +func NewCodeScanningSarifsStatus503Error()(*CodeScanningSarifsStatus503Error) { + m := &CodeScanningSarifsStatus503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeScanningSarifsStatus503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeScanningSarifsStatus503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeScanningSarifsStatus503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CodeScanningSarifsStatus503Error) 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 *CodeScanningSarifsStatus503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CodeScanningSarifsStatus503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CodeScanningSarifsStatus503Error) 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 *CodeScanningSarifsStatus503Error) 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 *CodeScanningSarifsStatus503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CodeScanningSarifsStatus503Error) 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 *CodeScanningSarifsStatus503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CodeScanningSarifsStatus503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CodeScanningSarifsStatus503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CodeScanningSarifsStatus503Error) SetMessage(value *string)() { + m.message = value +} +type CodeScanningSarifsStatus503Errorable 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_sarifs_status_escaped_processing_escaped_status.go b/pkg/github/models/code_scanning_sarifs_status_escaped_processing_escaped_status.go new file mode 100644 index 00000000..915586bf --- /dev/null +++ b/pkg/github/models/code_scanning_sarifs_status_escaped_processing_escaped_status.go @@ -0,0 +1,37 @@ +package models +// `pending` files have not yet been processed, while `complete` means results from the SARIF have been stored. `failed` files have either not been processed at all, or could only be partially processed. +type CodeScanningSarifsStatus_processing_status int + +const ( + PENDING_CODESCANNINGSARIFSSTATUS_PROCESSING_STATUS CodeScanningSarifsStatus_processing_status = iota + COMPLETE_CODESCANNINGSARIFSSTATUS_PROCESSING_STATUS + FAILED_CODESCANNINGSARIFSSTATUS_PROCESSING_STATUS +) + +func (i CodeScanningSarifsStatus_processing_status) String() string { + return []string{"pending", "complete", "failed"}[i] +} +func ParseCodeScanningSarifsStatus_processing_status(v string) (any, error) { + result := PENDING_CODESCANNINGSARIFSSTATUS_PROCESSING_STATUS + switch v { + case "pending": + result = PENDING_CODESCANNINGSARIFSSTATUS_PROCESSING_STATUS + case "complete": + result = COMPLETE_CODESCANNINGSARIFSSTATUS_PROCESSING_STATUS + case "failed": + result = FAILED_CODESCANNINGSARIFSSTATUS_PROCESSING_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeCodeScanningSarifsStatus_processing_status(values []CodeScanningSarifsStatus_processing_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CodeScanningSarifsStatus_processing_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/code_search_result_item.go b/pkg/github/models/code_search_result_item.go new file mode 100644 index 00000000..5305d9f4 --- /dev/null +++ b/pkg/github/models/code_search_result_item.go @@ -0,0 +1,448 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeSearchResultItem code Search Result Item +type CodeSearchResultItem 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 file_size property + file_size *int32 + // The git_url property + git_url *string + // The html_url property + html_url *string + // The language property + language *string + // The last_modified_at property + last_modified_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The line_numbers property + line_numbers []string + // The name property + name *string + // The path property + path *string + // Minimal Repository + repository MinimalRepositoryable + // The score property + score *float64 + // The sha property + sha *string + // The text_matches property + text_matches []Codeable + // The url property + url *string +} +// NewCodeSearchResultItem instantiates a new CodeSearchResultItem and sets the default values. +func NewCodeSearchResultItem()(*CodeSearchResultItem) { + m := &CodeSearchResultItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeSearchResultItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeSearchResultItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeSearchResultItem(), 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 *CodeSearchResultItem) 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 *CodeSearchResultItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["file_size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFileSize(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["last_modified_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastModifiedAt(val) + } + return nil + } + res["line_numbers"] = 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.SetLineNumbers(res) + } + 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["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + 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["text_matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Codeable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Codeable) + } + } + m.SetTextMatches(res) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFileSize gets the file_size property value. The file_size property +// returns a *int32 when successful +func (m *CodeSearchResultItem) GetFileSize()(*int32) { + return m.file_size +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *CodeSearchResultItem) GetGitUrl()(*string) { + return m.git_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CodeSearchResultItem) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *CodeSearchResultItem) GetLanguage()(*string) { + return m.language +} +// GetLastModifiedAt gets the last_modified_at property value. The last_modified_at property +// returns a *Time when successful +func (m *CodeSearchResultItem) GetLastModifiedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_modified_at +} +// GetLineNumbers gets the line_numbers property value. The line_numbers property +// returns a []string when successful +func (m *CodeSearchResultItem) GetLineNumbers()([]string) { + return m.line_numbers +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *CodeSearchResultItem) GetName()(*string) { + return m.name +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *CodeSearchResultItem) GetPath()(*string) { + return m.path +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *CodeSearchResultItem) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetScore gets the score property value. The score property +// returns a *float64 when successful +func (m *CodeSearchResultItem) GetScore()(*float64) { + return m.score +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *CodeSearchResultItem) GetSha()(*string) { + return m.sha +} +// GetTextMatches gets the text_matches property value. The text_matches property +// returns a []Codeable when successful +func (m *CodeSearchResultItem) GetTextMatches()([]Codeable) { + return m.text_matches +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CodeSearchResultItem) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CodeSearchResultItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("file_size", m.GetFileSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("last_modified_at", m.GetLastModifiedAt()) + if err != nil { + return err + } + } + if m.GetLineNumbers() != nil { + err := writer.WriteCollectionOfStringValues("line_numbers", m.GetLineNumbers()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("score", m.GetScore()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + if m.GetTextMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTextMatches())) + for i, v := range m.GetTextMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("text_matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CodeSearchResultItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFileSize sets the file_size property value. The file_size property +func (m *CodeSearchResultItem) SetFileSize(value *int32)() { + m.file_size = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *CodeSearchResultItem) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CodeSearchResultItem) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLanguage sets the language property value. The language property +func (m *CodeSearchResultItem) SetLanguage(value *string)() { + m.language = value +} +// SetLastModifiedAt sets the last_modified_at property value. The last_modified_at property +func (m *CodeSearchResultItem) SetLastModifiedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_modified_at = value +} +// SetLineNumbers sets the line_numbers property value. The line_numbers property +func (m *CodeSearchResultItem) SetLineNumbers(value []string)() { + m.line_numbers = value +} +// SetName sets the name property value. The name property +func (m *CodeSearchResultItem) SetName(value *string)() { + m.name = value +} +// SetPath sets the path property value. The path property +func (m *CodeSearchResultItem) SetPath(value *string)() { + m.path = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *CodeSearchResultItem) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetScore sets the score property value. The score property +func (m *CodeSearchResultItem) SetScore(value *float64)() { + m.score = value +} +// SetSha sets the sha property value. The sha property +func (m *CodeSearchResultItem) SetSha(value *string)() { + m.sha = value +} +// SetTextMatches sets the text_matches property value. The text_matches property +func (m *CodeSearchResultItem) SetTextMatches(value []Codeable)() { + m.text_matches = value +} +// SetUrl sets the url property value. The url property +func (m *CodeSearchResultItem) SetUrl(value *string)() { + m.url = value +} +type CodeSearchResultItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFileSize()(*int32) + GetGitUrl()(*string) + GetHtmlUrl()(*string) + GetLanguage()(*string) + GetLastModifiedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetLineNumbers()([]string) + GetName()(*string) + GetPath()(*string) + GetRepository()(MinimalRepositoryable) + GetScore()(*float64) + GetSha()(*string) + GetTextMatches()([]Codeable) + GetUrl()(*string) + SetFileSize(value *int32)() + SetGitUrl(value *string)() + SetHtmlUrl(value *string)() + SetLanguage(value *string)() + SetLastModifiedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetLineNumbers(value []string)() + SetName(value *string)() + SetPath(value *string)() + SetRepository(value MinimalRepositoryable)() + SetScore(value *float64)() + SetSha(value *string)() + SetTextMatches(value []Codeable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/codeowners_errors.go b/pkg/github/models/codeowners_errors.go new file mode 100644 index 00000000..11730baf --- /dev/null +++ b/pkg/github/models/codeowners_errors.go @@ -0,0 +1,93 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CodeownersErrors a list of errors found in a repo's CODEOWNERS file +type CodeownersErrors 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 errors property + errors []CodeownersErrors_errorsable +} +// NewCodeownersErrors instantiates a new CodeownersErrors and sets the default values. +func NewCodeownersErrors()(*CodeownersErrors) { + m := &CodeownersErrors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeownersErrorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeownersErrorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeownersErrors(), 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 *CodeownersErrors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetErrors gets the errors property value. The errors property +// returns a []CodeownersErrors_errorsable when successful +func (m *CodeownersErrors) GetErrors()([]CodeownersErrors_errorsable) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeownersErrors) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCodeownersErrors_errorsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CodeownersErrors_errorsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CodeownersErrors_errorsable) + } + } + m.SetErrors(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *CodeownersErrors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetErrors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetErrors())) + for i, v := range m.GetErrors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("errors", 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 *CodeownersErrors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetErrors sets the errors property value. The errors property +func (m *CodeownersErrors) SetErrors(value []CodeownersErrors_errorsable)() { + m.errors = value +} +type CodeownersErrorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetErrors()([]CodeownersErrors_errorsable) + SetErrors(value []CodeownersErrors_errorsable)() +} diff --git a/pkg/github/models/codeowners_errors_escaped_errors.go b/pkg/github/models/codeowners_errors_escaped_errors.go new file mode 100644 index 00000000..267227b4 --- /dev/null +++ b/pkg/github/models/codeowners_errors_escaped_errors.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CodeownersErrors_errors 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 column number where this errors occurs. + column *int32 + // The type of error. + kind *string + // The line number where this errors occurs. + line *int32 + // A human-readable description of the error, combining information from multiple fields, laid out for display in a monospaced typeface (for example, a command-line setting). + message *string + // The path of the file where the error occured. + path *string + // The contents of the line where the error occurs. + source *string + // Suggested action to fix the error. This will usually be `null`, but is provided for some common errors. + suggestion *string +} +// NewCodeownersErrors_errors instantiates a new CodeownersErrors_errors and sets the default values. +func NewCodeownersErrors_errors()(*CodeownersErrors_errors) { + m := &CodeownersErrors_errors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeownersErrors_errorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeownersErrors_errorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeownersErrors_errors(), 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 *CodeownersErrors_errors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColumn gets the column property value. The column number where this errors occurs. +// returns a *int32 when successful +func (m *CodeownersErrors_errors) GetColumn()(*int32) { + return m.column +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CodeownersErrors_errors) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetColumn(val) + } + return nil + } + res["kind"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKind(val) + } + return nil + } + res["line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLine(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 + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSource(val) + } + return nil + } + res["suggestion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSuggestion(val) + } + return nil + } + return res +} +// GetKind gets the kind property value. The type of error. +// returns a *string when successful +func (m *CodeownersErrors_errors) GetKind()(*string) { + return m.kind +} +// GetLine gets the line property value. The line number where this errors occurs. +// returns a *int32 when successful +func (m *CodeownersErrors_errors) GetLine()(*int32) { + return m.line +} +// GetMessage gets the message property value. A human-readable description of the error, combining information from multiple fields, laid out for display in a monospaced typeface (for example, a command-line setting). +// returns a *string when successful +func (m *CodeownersErrors_errors) GetMessage()(*string) { + return m.message +} +// GetPath gets the path property value. The path of the file where the error occured. +// returns a *string when successful +func (m *CodeownersErrors_errors) GetPath()(*string) { + return m.path +} +// GetSource gets the source property value. The contents of the line where the error occurs. +// returns a *string when successful +func (m *CodeownersErrors_errors) GetSource()(*string) { + return m.source +} +// GetSuggestion gets the suggestion property value. Suggested action to fix the error. This will usually be `null`, but is provided for some common errors. +// returns a *string when successful +func (m *CodeownersErrors_errors) GetSuggestion()(*string) { + return m.suggestion +} +// Serialize serializes information the current object +func (m *CodeownersErrors_errors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("column", m.GetColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("kind", m.GetKind()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("line", m.GetLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("source", m.GetSource()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("suggestion", m.GetSuggestion()) + 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 *CodeownersErrors_errors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColumn sets the column property value. The column number where this errors occurs. +func (m *CodeownersErrors_errors) SetColumn(value *int32)() { + m.column = value +} +// SetKind sets the kind property value. The type of error. +func (m *CodeownersErrors_errors) SetKind(value *string)() { + m.kind = value +} +// SetLine sets the line property value. The line number where this errors occurs. +func (m *CodeownersErrors_errors) SetLine(value *int32)() { + m.line = value +} +// SetMessage sets the message property value. A human-readable description of the error, combining information from multiple fields, laid out for display in a monospaced typeface (for example, a command-line setting). +func (m *CodeownersErrors_errors) SetMessage(value *string)() { + m.message = value +} +// SetPath sets the path property value. The path of the file where the error occured. +func (m *CodeownersErrors_errors) SetPath(value *string)() { + m.path = value +} +// SetSource sets the source property value. The contents of the line where the error occurs. +func (m *CodeownersErrors_errors) SetSource(value *string)() { + m.source = value +} +// SetSuggestion sets the suggestion property value. Suggested action to fix the error. This will usually be `null`, but is provided for some common errors. +func (m *CodeownersErrors_errors) SetSuggestion(value *string)() { + m.suggestion = value +} +type CodeownersErrors_errorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumn()(*int32) + GetKind()(*string) + GetLine()(*int32) + GetMessage()(*string) + GetPath()(*string) + GetSource()(*string) + GetSuggestion()(*string) + SetColumn(value *int32)() + SetKind(value *string)() + SetLine(value *int32)() + SetMessage(value *string)() + SetPath(value *string)() + SetSource(value *string)() + SetSuggestion(value *string)() +} diff --git a/pkg/github/models/collaborator.go b/pkg/github/models/collaborator.go new file mode 100644 index 00000000..05114685 --- /dev/null +++ b/pkg/github/models/collaborator.go @@ -0,0 +1,690 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Collaborator collaborator +type Collaborator 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 avatar_url property + avatar_url *string + // The email property + email *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int64 + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The permissions property + permissions Collaborator_permissionsable + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The role_name property + role_name *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewCollaborator instantiates a new Collaborator and sets the default values. +func NewCollaborator()(*Collaborator) { + m := &Collaborator{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCollaboratorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCollaboratorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCollaborator(), 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 *Collaborator) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *Collaborator) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *Collaborator) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *Collaborator) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Collaborator) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCollaborator_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(Collaborator_permissionsable)) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["role_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRoleName(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *Collaborator) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *Collaborator) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *Collaborator) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *Collaborator) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Collaborator) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *Collaborator) GetId()(*int64) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *Collaborator) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Collaborator) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Collaborator) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *Collaborator) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetPermissions gets the permissions property value. The permissions property +// returns a Collaborator_permissionsable when successful +func (m *Collaborator) GetPermissions()(Collaborator_permissionsable) { + return m.permissions +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *Collaborator) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *Collaborator) GetReposUrl()(*string) { + return m.repos_url +} +// GetRoleName gets the role_name property value. The role_name property +// returns a *string when successful +func (m *Collaborator) GetRoleName()(*string) { + return m.role_name +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *Collaborator) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *Collaborator) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *Collaborator) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Collaborator) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Collaborator) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Collaborator) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("role_name", m.GetRoleName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Collaborator) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *Collaborator) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEmail sets the email property value. The email property +func (m *Collaborator) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *Collaborator) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *Collaborator) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *Collaborator) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *Collaborator) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *Collaborator) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Collaborator) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Collaborator) SetId(value *int64)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *Collaborator) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *Collaborator) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Collaborator) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *Collaborator) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *Collaborator) SetPermissions(value Collaborator_permissionsable)() { + m.permissions = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *Collaborator) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *Collaborator) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetRoleName sets the role_name property value. The role_name property +func (m *Collaborator) SetRoleName(value *string)() { + m.role_name = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *Collaborator) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *Collaborator) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *Collaborator) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Collaborator) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *Collaborator) SetUrl(value *string)() { + m.url = value +} +type Collaboratorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetPermissions()(Collaborator_permissionsable) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetRoleName()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetPermissions(value Collaborator_permissionsable)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetRoleName(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/collaborator_escaped_permissions.go b/pkg/github/models/collaborator_escaped_permissions.go new file mode 100644 index 00000000..098a4502 --- /dev/null +++ b/pkg/github/models/collaborator_escaped_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Collaborator_permissions 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 admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewCollaborator_permissions instantiates a new Collaborator_permissions and sets the default values. +func NewCollaborator_permissions()(*Collaborator_permissions) { + m := &Collaborator_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCollaborator_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCollaborator_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCollaborator_permissions(), 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 *Collaborator_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *Collaborator_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Collaborator_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *Collaborator_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *Collaborator_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *Collaborator_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *Collaborator_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *Collaborator_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *Collaborator_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *Collaborator_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *Collaborator_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *Collaborator_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *Collaborator_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *Collaborator_permissions) SetTriage(value *bool)() { + m.triage = value +} +type Collaborator_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/pkg/github/models/combined_commit_status.go b/pkg/github/models/combined_commit_status.go new file mode 100644 index 00000000..2d21556f --- /dev/null +++ b/pkg/github/models/combined_commit_status.go @@ -0,0 +1,267 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CombinedCommitStatus combined Commit Status +type CombinedCommitStatus 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 commit_url property + commit_url *string + // Minimal Repository + repository MinimalRepositoryable + // The sha property + sha *string + // The state property + state *string + // The statuses property + statuses []SimpleCommitStatusable + // The total_count property + total_count *int32 + // The url property + url *string +} +// NewCombinedCommitStatus instantiates a new CombinedCommitStatus and sets the default values. +func NewCombinedCommitStatus()(*CombinedCommitStatus) { + m := &CombinedCommitStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCombinedCommitStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCombinedCommitStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCombinedCommitStatus(), 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 *CombinedCommitStatus) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *CombinedCommitStatus) GetCommitUrl()(*string) { + return m.commit_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CombinedCommitStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + 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["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["statuses"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleCommitStatusFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleCommitStatusable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleCommitStatusable) + } + } + m.SetStatuses(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 + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *CombinedCommitStatus) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *CombinedCommitStatus) GetSha()(*string) { + return m.sha +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *CombinedCommitStatus) GetState()(*string) { + return m.state +} +// GetStatuses gets the statuses property value. The statuses property +// returns a []SimpleCommitStatusable when successful +func (m *CombinedCommitStatus) GetStatuses()([]SimpleCommitStatusable) { + return m.statuses +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *CombinedCommitStatus) GetTotalCount()(*int32) { + return m.total_count +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CombinedCommitStatus) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CombinedCommitStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + if m.GetStatuses() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetStatuses())) + for i, v := range m.GetStatuses() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("statuses", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CombinedCommitStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *CombinedCommitStatus) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *CombinedCommitStatus) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetSha sets the sha property value. The sha property +func (m *CombinedCommitStatus) SetSha(value *string)() { + m.sha = value +} +// SetState sets the state property value. The state property +func (m *CombinedCommitStatus) SetState(value *string)() { + m.state = value +} +// SetStatuses sets the statuses property value. The statuses property +func (m *CombinedCommitStatus) SetStatuses(value []SimpleCommitStatusable)() { + m.statuses = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *CombinedCommitStatus) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetUrl sets the url property value. The url property +func (m *CombinedCommitStatus) SetUrl(value *string)() { + m.url = value +} +type CombinedCommitStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommitUrl()(*string) + GetRepository()(MinimalRepositoryable) + GetSha()(*string) + GetState()(*string) + GetStatuses()([]SimpleCommitStatusable) + GetTotalCount()(*int32) + GetUrl()(*string) + SetCommitUrl(value *string)() + SetRepository(value MinimalRepositoryable)() + SetSha(value *string)() + SetState(value *string)() + SetStatuses(value []SimpleCommitStatusable)() + SetTotalCount(value *int32)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/commit.go b/pkg/github/models/commit.go new file mode 100644 index 00000000..1d0289de --- /dev/null +++ b/pkg/github/models/commit.go @@ -0,0 +1,561 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Commit commit +type Commit 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 author property + author Commit_Commit_authorable + // The comments_url property + comments_url *string + // The commit property + commit Commit_commitable + // The committer property + committer Commit_Commit_committerable + // The files property + files []DiffEntryable + // The html_url property + html_url *string + // The node_id property + node_id *string + // The parents property + parents []Commit_parentsable + // The sha property + sha *string + // The stats property + stats Commit_statsable + // The url property + url *string +} +// Commit_Commit_author composed type wrapper for classes EmptyObjectable, SimpleUserable +type Commit_Commit_author struct { + // Composed type representation for type EmptyObjectable + emptyObject EmptyObjectable + // Composed type representation for type SimpleUserable + simpleUser SimpleUserable +} +// NewCommit_Commit_author instantiates a new Commit_Commit_author and sets the default values. +func NewCommit_Commit_author()(*Commit_Commit_author) { + m := &Commit_Commit_author{ + } + return m +} +// CreateCommit_Commit_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommit_Commit_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewCommit_Commit_author() + 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 { + } + } + } + return result, nil +} +// GetEmptyObject gets the emptyObject property value. Composed type representation for type EmptyObjectable +// returns a EmptyObjectable when successful +func (m *Commit_Commit_author) GetEmptyObject()(EmptyObjectable) { + return m.emptyObject +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Commit_Commit_author) 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 *Commit_Commit_author) GetIsComposedType()(bool) { + return true +} +// GetSimpleUser gets the simpleUser property value. Composed type representation for type SimpleUserable +// returns a SimpleUserable when successful +func (m *Commit_Commit_author) GetSimpleUser()(SimpleUserable) { + return m.simpleUser +} +// Serialize serializes information the current object +func (m *Commit_Commit_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEmptyObject() != nil { + err := writer.WriteObjectValue("", m.GetEmptyObject()) + if err != nil { + return err + } + } else if m.GetSimpleUser() != nil { + err := writer.WriteObjectValue("", m.GetSimpleUser()) + if err != nil { + return err + } + } + return nil +} +// SetEmptyObject sets the emptyObject property value. Composed type representation for type EmptyObjectable +func (m *Commit_Commit_author) SetEmptyObject(value EmptyObjectable)() { + m.emptyObject = value +} +// SetSimpleUser sets the simpleUser property value. Composed type representation for type SimpleUserable +func (m *Commit_Commit_author) SetSimpleUser(value SimpleUserable)() { + m.simpleUser = value +} +// Commit_Commit_committer composed type wrapper for classes EmptyObjectable, SimpleUserable +type Commit_Commit_committer struct { + // Composed type representation for type EmptyObjectable + emptyObject EmptyObjectable + // Composed type representation for type SimpleUserable + simpleUser SimpleUserable +} +// NewCommit_Commit_committer instantiates a new Commit_Commit_committer and sets the default values. +func NewCommit_Commit_committer()(*Commit_Commit_committer) { + m := &Commit_Commit_committer{ + } + return m +} +// CreateCommit_Commit_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommit_Commit_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewCommit_Commit_committer() + 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 { + } + } + } + return result, nil +} +// GetEmptyObject gets the emptyObject property value. Composed type representation for type EmptyObjectable +// returns a EmptyObjectable when successful +func (m *Commit_Commit_committer) GetEmptyObject()(EmptyObjectable) { + return m.emptyObject +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Commit_Commit_committer) 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 *Commit_Commit_committer) GetIsComposedType()(bool) { + return true +} +// GetSimpleUser gets the simpleUser property value. Composed type representation for type SimpleUserable +// returns a SimpleUserable when successful +func (m *Commit_Commit_committer) GetSimpleUser()(SimpleUserable) { + return m.simpleUser +} +// Serialize serializes information the current object +func (m *Commit_Commit_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEmptyObject() != nil { + err := writer.WriteObjectValue("", m.GetEmptyObject()) + if err != nil { + return err + } + } else if m.GetSimpleUser() != nil { + err := writer.WriteObjectValue("", m.GetSimpleUser()) + if err != nil { + return err + } + } + return nil +} +// SetEmptyObject sets the emptyObject property value. Composed type representation for type EmptyObjectable +func (m *Commit_Commit_committer) SetEmptyObject(value EmptyObjectable)() { + m.emptyObject = value +} +// SetSimpleUser sets the simpleUser property value. Composed type representation for type SimpleUserable +func (m *Commit_Commit_committer) SetSimpleUser(value SimpleUserable)() { + m.simpleUser = value +} +type Commit_Commit_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmptyObject()(EmptyObjectable) + GetSimpleUser()(SimpleUserable) + SetEmptyObject(value EmptyObjectable)() + SetSimpleUser(value SimpleUserable)() +} +type Commit_Commit_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmptyObject()(EmptyObjectable) + GetSimpleUser()(SimpleUserable) + SetEmptyObject(value EmptyObjectable)() + SetSimpleUser(value SimpleUserable)() +} +// NewCommit instantiates a new Commit and sets the default values. +func NewCommit()(*Commit) { + m := &Commit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommit(), 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 *Commit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. The author property +// returns a Commit_Commit_authorable when successful +func (m *Commit) GetAuthor()(Commit_Commit_authorable) { + return m.author +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *Commit) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommit gets the commit property value. The commit property +// returns a Commit_commitable when successful +func (m *Commit) GetCommit()(Commit_commitable) { + return m.commit +} +// GetCommitter gets the committer property value. The committer property +// returns a Commit_Commit_committerable when successful +func (m *Commit) GetCommitter()(Commit_Commit_committerable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Commit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommit_Commit_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(Commit_Commit_authorable)) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommit_commitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommit(val.(Commit_commitable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommit_Commit_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(Commit_Commit_committerable)) + } + return nil + } + res["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDiffEntryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DiffEntryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DiffEntryable) + } + } + m.SetFiles(res) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["parents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCommit_parentsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Commit_parentsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Commit_parentsable) + } + } + m.SetParents(res) + } + return nil + } + 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["stats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommit_statsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetStats(val.(Commit_statsable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFiles gets the files property value. The files property +// returns a []DiffEntryable when successful +func (m *Commit) GetFiles()([]DiffEntryable) { + return m.files +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Commit) GetHtmlUrl()(*string) { + return m.html_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Commit) GetNodeId()(*string) { + return m.node_id +} +// GetParents gets the parents property value. The parents property +// returns a []Commit_parentsable when successful +func (m *Commit) GetParents()([]Commit_parentsable) { + return m.parents +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *Commit) GetSha()(*string) { + return m.sha +} +// GetStats gets the stats property value. The stats property +// returns a Commit_statsable when successful +func (m *Commit) GetStats()(Commit_statsable) { + return m.stats +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Commit) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Commit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + if m.GetFiles() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetFiles())) + for i, v := range m.GetFiles() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("files", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetParents() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetParents())) + for i, v := range m.GetParents() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("parents", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("stats", m.GetStats()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Commit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. The author property +func (m *Commit) SetAuthor(value Commit_Commit_authorable)() { + m.author = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *Commit) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommit sets the commit property value. The commit property +func (m *Commit) SetCommit(value Commit_commitable)() { + m.commit = value +} +// SetCommitter sets the committer property value. The committer property +func (m *Commit) SetCommitter(value Commit_Commit_committerable)() { + m.committer = value +} +// SetFiles sets the files property value. The files property +func (m *Commit) SetFiles(value []DiffEntryable)() { + m.files = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Commit) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Commit) SetNodeId(value *string)() { + m.node_id = value +} +// SetParents sets the parents property value. The parents property +func (m *Commit) SetParents(value []Commit_parentsable)() { + m.parents = value +} +// SetSha sets the sha property value. The sha property +func (m *Commit) SetSha(value *string)() { + m.sha = value +} +// SetStats sets the stats property value. The stats property +func (m *Commit) SetStats(value Commit_statsable)() { + m.stats = value +} +// SetUrl sets the url property value. The url property +func (m *Commit) SetUrl(value *string)() { + m.url = value +} +type Commitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(Commit_Commit_authorable) + GetCommentsUrl()(*string) + GetCommit()(Commit_commitable) + GetCommitter()(Commit_Commit_committerable) + GetFiles()([]DiffEntryable) + GetHtmlUrl()(*string) + GetNodeId()(*string) + GetParents()([]Commit_parentsable) + GetSha()(*string) + GetStats()(Commit_statsable) + GetUrl()(*string) + SetAuthor(value Commit_Commit_authorable)() + SetCommentsUrl(value *string)() + SetCommit(value Commit_commitable)() + SetCommitter(value Commit_Commit_committerable)() + SetFiles(value []DiffEntryable)() + SetHtmlUrl(value *string)() + SetNodeId(value *string)() + SetParents(value []Commit_parentsable)() + SetSha(value *string)() + SetStats(value Commit_statsable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/commit503_error.go b/pkg/github/models/commit503_error.go new file mode 100644 index 00000000..1e17d900 --- /dev/null +++ b/pkg/github/models/commit503_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 Commit503Error 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 +} +// NewCommit503Error instantiates a new Commit503Error and sets the default values. +func NewCommit503Error()(*Commit503Error) { + m := &Commit503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommit503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommit503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommit503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Commit503Error) 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 *Commit503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Commit503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Commit503Error) 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 *Commit503Error) 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 *Commit503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Commit503Error) 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 *Commit503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Commit503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Commit503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Commit503Error) SetMessage(value *string)() { + m.message = value +} +type Commit503Errorable 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/commit_activity.go b/pkg/github/models/commit_activity.go new file mode 100644 index 00000000..58c70d83 --- /dev/null +++ b/pkg/github/models/commit_activity.go @@ -0,0 +1,145 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CommitActivity commit Activity +type CommitActivity 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 days property + days []int32 + // The total property + total *int32 + // The week property + week *int32 +} +// NewCommitActivity instantiates a new CommitActivity and sets the default values. +func NewCommitActivity()(*CommitActivity) { + m := &CommitActivity{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitActivityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitActivityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitActivity(), 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 *CommitActivity) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDays gets the days property value. The days property +// returns a []int32 when successful +func (m *CommitActivity) GetDays()([]int32) { + return m.days +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitActivity) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["days"] = 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.SetDays(res) + } + return nil + } + res["total"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotal(val) + } + return nil + } + res["week"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWeek(val) + } + return nil + } + return res +} +// GetTotal gets the total property value. The total property +// returns a *int32 when successful +func (m *CommitActivity) GetTotal()(*int32) { + return m.total +} +// GetWeek gets the week property value. The week property +// returns a *int32 when successful +func (m *CommitActivity) GetWeek()(*int32) { + return m.week +} +// Serialize serializes information the current object +func (m *CommitActivity) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetDays() != nil { + err := writer.WriteCollectionOfInt32Values("days", m.GetDays()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total", m.GetTotal()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("week", m.GetWeek()) + 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 *CommitActivity) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDays sets the days property value. The days property +func (m *CommitActivity) SetDays(value []int32)() { + m.days = value +} +// SetTotal sets the total property value. The total property +func (m *CommitActivity) SetTotal(value *int32)() { + m.total = value +} +// SetWeek sets the week property value. The week property +func (m *CommitActivity) SetWeek(value *int32)() { + m.week = value +} +type CommitActivityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDays()([]int32) + GetTotal()(*int32) + GetWeek()(*int32) + SetDays(value []int32)() + SetTotal(value *int32)() + SetWeek(value *int32)() +} diff --git a/pkg/github/models/commit_comment.go b/pkg/github/models/commit_comment.go new file mode 100644 index 00000000..43427659 --- /dev/null +++ b/pkg/github/models/commit_comment.go @@ -0,0 +1,460 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CommitComment commit Comment +type CommitComment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // The body property + body *string + // The commit_id property + commit_id *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // The id property + id *int32 + // The line property + line *int32 + // The node_id property + node_id *string + // The path property + path *string + // The position property + position *int32 + // The reactions property + reactions ReactionRollupable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewCommitComment instantiates a new CommitComment and sets the default values. +func NewCommitComment()(*CommitComment) { + m := &CommitComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitComment(), 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 *CommitComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *CommitComment) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *CommitComment) GetBody()(*string) { + return m.body +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *CommitComment) GetCommitId()(*string) { + return m.commit_id +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *CommitComment) 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 *CommitComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + 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["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLine(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CommitComment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *CommitComment) GetId()(*int32) { + return m.id +} +// GetLine gets the line property value. The line property +// returns a *int32 when successful +func (m *CommitComment) GetLine()(*int32) { + return m.line +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *CommitComment) GetNodeId()(*string) { + return m.node_id +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *CommitComment) GetPath()(*string) { + return m.path +} +// GetPosition gets the position property value. The position property +// returns a *int32 when successful +func (m *CommitComment) GetPosition()(*int32) { + return m.position +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *CommitComment) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *CommitComment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CommitComment) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *CommitComment) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *CommitComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("line", m.GetLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("position", m.GetPosition()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *CommitComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *CommitComment) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. The body property +func (m *CommitComment) SetBody(value *string)() { + m.body = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *CommitComment) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *CommitComment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CommitComment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *CommitComment) SetId(value *int32)() { + m.id = value +} +// SetLine sets the line property value. The line property +func (m *CommitComment) SetLine(value *int32)() { + m.line = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *CommitComment) SetNodeId(value *string)() { + m.node_id = value +} +// SetPath sets the path property value. The path property +func (m *CommitComment) SetPath(value *string)() { + m.path = value +} +// SetPosition sets the position property value. The position property +func (m *CommitComment) SetPosition(value *int32)() { + m.position = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *CommitComment) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *CommitComment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *CommitComment) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *CommitComment) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type CommitCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetCommitId()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLine()(*int32) + GetNodeId()(*string) + GetPath()(*string) + GetPosition()(*int32) + GetReactions()(ReactionRollupable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetCommitId(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLine(value *int32)() + SetNodeId(value *string)() + SetPath(value *string)() + SetPosition(value *int32)() + SetReactions(value ReactionRollupable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/commit_comparison.go b/pkg/github/models/commit_comparison.go new file mode 100644 index 00000000..6b2a9f75 --- /dev/null +++ b/pkg/github/models/commit_comparison.go @@ -0,0 +1,454 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CommitComparison commit Comparison +type CommitComparison 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 ahead_by property + ahead_by *int32 + // Commit + base_commit Commitable + // The behind_by property + behind_by *int32 + // The commits property + commits []Commitable + // The diff_url property + diff_url *string + // The files property + files []DiffEntryable + // The html_url property + html_url *string + // Commit + merge_base_commit Commitable + // The patch_url property + patch_url *string + // The permalink_url property + permalink_url *string + // The status property + status *CommitComparison_status + // The total_commits property + total_commits *int32 + // The url property + url *string +} +// NewCommitComparison instantiates a new CommitComparison and sets the default values. +func NewCommitComparison()(*CommitComparison) { + m := &CommitComparison{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitComparisonFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitComparisonFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitComparison(), 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 *CommitComparison) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAheadBy gets the ahead_by property value. The ahead_by property +// returns a *int32 when successful +func (m *CommitComparison) GetAheadBy()(*int32) { + return m.ahead_by +} +// GetBaseCommit gets the base_commit property value. Commit +// returns a Commitable when successful +func (m *CommitComparison) GetBaseCommit()(Commitable) { + return m.base_commit +} +// GetBehindBy gets the behind_by property value. The behind_by property +// returns a *int32 when successful +func (m *CommitComparison) GetBehindBy()(*int32) { + return m.behind_by +} +// GetCommits gets the commits property value. The commits property +// returns a []Commitable when successful +func (m *CommitComparison) GetCommits()([]Commitable) { + return m.commits +} +// GetDiffUrl gets the diff_url property value. The diff_url property +// returns a *string when successful +func (m *CommitComparison) GetDiffUrl()(*string) { + return m.diff_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitComparison) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ahead_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAheadBy(val) + } + return nil + } + res["base_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBaseCommit(val.(Commitable)) + } + return nil + } + res["behind_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetBehindBy(val) + } + return nil + } + res["commits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCommitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Commitable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Commitable) + } + } + m.SetCommits(res) + } + return nil + } + res["diff_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffUrl(val) + } + return nil + } + res["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDiffEntryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DiffEntryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DiffEntryable) + } + } + m.SetFiles(res) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["merge_base_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMergeBaseCommit(val.(Commitable)) + } + return nil + } + res["patch_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchUrl(val) + } + return nil + } + res["permalink_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermalinkUrl(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCommitComparison_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*CommitComparison_status)) + } + return nil + } + res["total_commits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCommits(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFiles gets the files property value. The files property +// returns a []DiffEntryable when successful +func (m *CommitComparison) GetFiles()([]DiffEntryable) { + return m.files +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CommitComparison) GetHtmlUrl()(*string) { + return m.html_url +} +// GetMergeBaseCommit gets the merge_base_commit property value. Commit +// returns a Commitable when successful +func (m *CommitComparison) GetMergeBaseCommit()(Commitable) { + return m.merge_base_commit +} +// GetPatchUrl gets the patch_url property value. The patch_url property +// returns a *string when successful +func (m *CommitComparison) GetPatchUrl()(*string) { + return m.patch_url +} +// GetPermalinkUrl gets the permalink_url property value. The permalink_url property +// returns a *string when successful +func (m *CommitComparison) GetPermalinkUrl()(*string) { + return m.permalink_url +} +// GetStatus gets the status property value. The status property +// returns a *CommitComparison_status when successful +func (m *CommitComparison) GetStatus()(*CommitComparison_status) { + return m.status +} +// GetTotalCommits gets the total_commits property value. The total_commits property +// returns a *int32 when successful +func (m *CommitComparison) GetTotalCommits()(*int32) { + return m.total_commits +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CommitComparison) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CommitComparison) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("ahead_by", m.GetAheadBy()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("base_commit", m.GetBaseCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("behind_by", m.GetBehindBy()) + if err != nil { + return err + } + } + if m.GetCommits() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCommits())) + for i, v := range m.GetCommits() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("commits", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("diff_url", m.GetDiffUrl()) + if err != nil { + return err + } + } + if m.GetFiles() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetFiles())) + for i, v := range m.GetFiles() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("files", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("merge_base_commit", m.GetMergeBaseCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patch_url", m.GetPatchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permalink_url", m.GetPermalinkUrl()) + 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.WriteInt32Value("total_commits", m.GetTotalCommits()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CommitComparison) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAheadBy sets the ahead_by property value. The ahead_by property +func (m *CommitComparison) SetAheadBy(value *int32)() { + m.ahead_by = value +} +// SetBaseCommit sets the base_commit property value. Commit +func (m *CommitComparison) SetBaseCommit(value Commitable)() { + m.base_commit = value +} +// SetBehindBy sets the behind_by property value. The behind_by property +func (m *CommitComparison) SetBehindBy(value *int32)() { + m.behind_by = value +} +// SetCommits sets the commits property value. The commits property +func (m *CommitComparison) SetCommits(value []Commitable)() { + m.commits = value +} +// SetDiffUrl sets the diff_url property value. The diff_url property +func (m *CommitComparison) SetDiffUrl(value *string)() { + m.diff_url = value +} +// SetFiles sets the files property value. The files property +func (m *CommitComparison) SetFiles(value []DiffEntryable)() { + m.files = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CommitComparison) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetMergeBaseCommit sets the merge_base_commit property value. Commit +func (m *CommitComparison) SetMergeBaseCommit(value Commitable)() { + m.merge_base_commit = value +} +// SetPatchUrl sets the patch_url property value. The patch_url property +func (m *CommitComparison) SetPatchUrl(value *string)() { + m.patch_url = value +} +// SetPermalinkUrl sets the permalink_url property value. The permalink_url property +func (m *CommitComparison) SetPermalinkUrl(value *string)() { + m.permalink_url = value +} +// SetStatus sets the status property value. The status property +func (m *CommitComparison) SetStatus(value *CommitComparison_status)() { + m.status = value +} +// SetTotalCommits sets the total_commits property value. The total_commits property +func (m *CommitComparison) SetTotalCommits(value *int32)() { + m.total_commits = value +} +// SetUrl sets the url property value. The url property +func (m *CommitComparison) SetUrl(value *string)() { + m.url = value +} +type CommitComparisonable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAheadBy()(*int32) + GetBaseCommit()(Commitable) + GetBehindBy()(*int32) + GetCommits()([]Commitable) + GetDiffUrl()(*string) + GetFiles()([]DiffEntryable) + GetHtmlUrl()(*string) + GetMergeBaseCommit()(Commitable) + GetPatchUrl()(*string) + GetPermalinkUrl()(*string) + GetStatus()(*CommitComparison_status) + GetTotalCommits()(*int32) + GetUrl()(*string) + SetAheadBy(value *int32)() + SetBaseCommit(value Commitable)() + SetBehindBy(value *int32)() + SetCommits(value []Commitable)() + SetDiffUrl(value *string)() + SetFiles(value []DiffEntryable)() + SetHtmlUrl(value *string)() + SetMergeBaseCommit(value Commitable)() + SetPatchUrl(value *string)() + SetPermalinkUrl(value *string)() + SetStatus(value *CommitComparison_status)() + SetTotalCommits(value *int32)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/commit_comparison503_error.go b/pkg/github/models/commit_comparison503_error.go new file mode 100644 index 00000000..cd2f8371 --- /dev/null +++ b/pkg/github/models/commit_comparison503_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 CommitComparison503Error 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 +} +// NewCommitComparison503Error instantiates a new CommitComparison503Error and sets the default values. +func NewCommitComparison503Error()(*CommitComparison503Error) { + m := &CommitComparison503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitComparison503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitComparison503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitComparison503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *CommitComparison503Error) 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 *CommitComparison503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *CommitComparison503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *CommitComparison503Error) 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 *CommitComparison503Error) 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 *CommitComparison503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *CommitComparison503Error) 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 *CommitComparison503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *CommitComparison503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *CommitComparison503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *CommitComparison503Error) SetMessage(value *string)() { + m.message = value +} +type CommitComparison503Errorable 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/commit_comparison_escaped_status.go b/pkg/github/models/commit_comparison_escaped_status.go new file mode 100644 index 00000000..8ad1a139 --- /dev/null +++ b/pkg/github/models/commit_comparison_escaped_status.go @@ -0,0 +1,39 @@ +package models +type CommitComparison_status int + +const ( + DIVERGED_COMMITCOMPARISON_STATUS CommitComparison_status = iota + AHEAD_COMMITCOMPARISON_STATUS + BEHIND_COMMITCOMPARISON_STATUS + IDENTICAL_COMMITCOMPARISON_STATUS +) + +func (i CommitComparison_status) String() string { + return []string{"diverged", "ahead", "behind", "identical"}[i] +} +func ParseCommitComparison_status(v string) (any, error) { + result := DIVERGED_COMMITCOMPARISON_STATUS + switch v { + case "diverged": + result = DIVERGED_COMMITCOMPARISON_STATUS + case "ahead": + result = AHEAD_COMMITCOMPARISON_STATUS + case "behind": + result = BEHIND_COMMITCOMPARISON_STATUS + case "identical": + result = IDENTICAL_COMMITCOMPARISON_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeCommitComparison_status(values []CommitComparison_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CommitComparison_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/commit_escaped_commit.go b/pkg/github/models/commit_escaped_commit.go new file mode 100644 index 00000000..0ce6d825 --- /dev/null +++ b/pkg/github/models/commit_escaped_commit.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Commit_commit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Metaproperties for Git author/committer information. + author NullableGitUserable + // The comment_count property + comment_count *int32 + // Metaproperties for Git author/committer information. + committer NullableGitUserable + // The message property + message *string + // The tree property + tree Commit_commit_treeable + // The url property + url *string + // The verification property + verification Verificationable +} +// NewCommit_commit instantiates a new Commit_commit and sets the default values. +func NewCommit_commit()(*Commit_commit) { + m := &Commit_commit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommit_commitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommit_commitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommit_commit(), 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 *Commit_commit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. Metaproperties for Git author/committer information. +// returns a NullableGitUserable when successful +func (m *Commit_commit) GetAuthor()(NullableGitUserable) { + return m.author +} +// GetCommentCount gets the comment_count property value. The comment_count property +// returns a *int32 when successful +func (m *Commit_commit) GetCommentCount()(*int32) { + return m.comment_count +} +// GetCommitter gets the committer property value. Metaproperties for Git author/committer information. +// returns a NullableGitUserable when successful +func (m *Commit_commit) GetCommitter()(NullableGitUserable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Commit_commit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableGitUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(NullableGitUserable)) + } + return nil + } + res["comment_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCommentCount(val) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableGitUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(NullableGitUserable)) + } + 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 + } + res["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommit_commit_treeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTree(val.(Commit_commit_treeable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verification"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateVerificationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerification(val.(Verificationable)) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Commit_commit) GetMessage()(*string) { + return m.message +} +// GetTree gets the tree property value. The tree property +// returns a Commit_commit_treeable when successful +func (m *Commit_commit) GetTree()(Commit_commit_treeable) { + return m.tree +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Commit_commit) GetUrl()(*string) { + return m.url +} +// GetVerification gets the verification property value. The verification property +// returns a Verificationable when successful +func (m *Commit_commit) GetVerification()(Verificationable) { + return m.verification +} +// Serialize serializes information the current object +func (m *Commit_commit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("comment_count", m.GetCommentCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tree", m.GetTree()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verification", m.GetVerification()) + 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 *Commit_commit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. Metaproperties for Git author/committer information. +func (m *Commit_commit) SetAuthor(value NullableGitUserable)() { + m.author = value +} +// SetCommentCount sets the comment_count property value. The comment_count property +func (m *Commit_commit) SetCommentCount(value *int32)() { + m.comment_count = value +} +// SetCommitter sets the committer property value. Metaproperties for Git author/committer information. +func (m *Commit_commit) SetCommitter(value NullableGitUserable)() { + m.committer = value +} +// SetMessage sets the message property value. The message property +func (m *Commit_commit) SetMessage(value *string)() { + m.message = value +} +// SetTree sets the tree property value. The tree property +func (m *Commit_commit) SetTree(value Commit_commit_treeable)() { + m.tree = value +} +// SetUrl sets the url property value. The url property +func (m *Commit_commit) SetUrl(value *string)() { + m.url = value +} +// SetVerification sets the verification property value. The verification property +func (m *Commit_commit) SetVerification(value Verificationable)() { + m.verification = value +} +type Commit_commitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(NullableGitUserable) + GetCommentCount()(*int32) + GetCommitter()(NullableGitUserable) + GetMessage()(*string) + GetTree()(Commit_commit_treeable) + GetUrl()(*string) + GetVerification()(Verificationable) + SetAuthor(value NullableGitUserable)() + SetCommentCount(value *int32)() + SetCommitter(value NullableGitUserable)() + SetMessage(value *string)() + SetTree(value Commit_commit_treeable)() + SetUrl(value *string)() + SetVerification(value Verificationable)() +} diff --git a/pkg/github/models/commit_escaped_commit_escaped_tree.go b/pkg/github/models/commit_escaped_commit_escaped_tree.go new file mode 100644 index 00000000..9620aa87 --- /dev/null +++ b/pkg/github/models/commit_escaped_commit_escaped_tree.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Commit_commit_tree 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 sha property + sha *string + // The url property + url *string +} +// NewCommit_commit_tree instantiates a new Commit_commit_tree and sets the default values. +func NewCommit_commit_tree()(*Commit_commit_tree) { + m := &Commit_commit_tree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommit_commit_treeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommit_commit_treeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommit_commit_tree(), 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 *Commit_commit_tree) 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 *Commit_commit_tree) 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *Commit_commit_tree) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Commit_commit_tree) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Commit_commit_tree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Commit_commit_tree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *Commit_commit_tree) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *Commit_commit_tree) SetUrl(value *string)() { + m.url = value +} +type Commit_commit_treeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/commit_escaped_parents.go b/pkg/github/models/commit_escaped_parents.go new file mode 100644 index 00000000..5c2fa420 --- /dev/null +++ b/pkg/github/models/commit_escaped_parents.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Commit_parents 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 html_url property + html_url *string + // The sha property + sha *string + // The url property + url *string +} +// NewCommit_parents instantiates a new Commit_parents and sets the default values. +func NewCommit_parents()(*Commit_parents) { + m := &Commit_parents{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommit_parentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommit_parentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommit_parents(), 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 *Commit_parents) 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 *Commit_parents) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Commit_parents) GetHtmlUrl()(*string) { + return m.html_url +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *Commit_parents) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Commit_parents) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Commit_parents) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Commit_parents) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Commit_parents) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetSha sets the sha property value. The sha property +func (m *Commit_parents) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *Commit_parents) SetUrl(value *string)() { + m.url = value +} +type Commit_parentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetSha()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/commit_escaped_stats.go b/pkg/github/models/commit_escaped_stats.go new file mode 100644 index 00000000..2105df61 --- /dev/null +++ b/pkg/github/models/commit_escaped_stats.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Commit_stats 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 additions property + additions *int32 + // The deletions property + deletions *int32 + // The total property + total *int32 +} +// NewCommit_stats instantiates a new Commit_stats and sets the default values. +func NewCommit_stats()(*Commit_stats) { + m := &Commit_stats{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommit_statsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommit_statsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommit_stats(), 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 *Commit_stats) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdditions gets the additions property value. The additions property +// returns a *int32 when successful +func (m *Commit_stats) GetAdditions()(*int32) { + return m.additions +} +// GetDeletions gets the deletions property value. The deletions property +// returns a *int32 when successful +func (m *Commit_stats) GetDeletions()(*int32) { + return m.deletions +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Commit_stats) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["additions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAdditions(val) + } + return nil + } + res["deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDeletions(val) + } + return nil + } + res["total"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotal(val) + } + return nil + } + return res +} +// GetTotal gets the total property value. The total property +// returns a *int32 when successful +func (m *Commit_stats) GetTotal()(*int32) { + return m.total +} +// Serialize serializes information the current object +func (m *Commit_stats) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("additions", m.GetAdditions()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("deletions", m.GetDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total", m.GetTotal()) + 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 *Commit_stats) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdditions sets the additions property value. The additions property +func (m *Commit_stats) SetAdditions(value *int32)() { + m.additions = value +} +// SetDeletions sets the deletions property value. The deletions property +func (m *Commit_stats) SetDeletions(value *int32)() { + m.deletions = value +} +// SetTotal sets the total property value. The total property +func (m *Commit_stats) SetTotal(value *int32)() { + m.total = value +} +type Commit_statsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdditions()(*int32) + GetDeletions()(*int32) + GetTotal()(*int32) + SetAdditions(value *int32)() + SetDeletions(value *int32)() + SetTotal(value *int32)() +} diff --git a/pkg/github/models/commit_search_result_item.go b/pkg/github/models/commit_search_result_item.go new file mode 100644 index 00000000..0838814b --- /dev/null +++ b/pkg/github/models/commit_search_result_item.go @@ -0,0 +1,424 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CommitSearchResultItem commit Search Result Item +type CommitSearchResultItem 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 GitHub user. + author NullableSimpleUserable + // The comments_url property + comments_url *string + // The commit property + commit CommitSearchResultItem_commitable + // Metaproperties for Git author/committer information. + committer NullableGitUserable + // The html_url property + html_url *string + // The node_id property + node_id *string + // The parents property + parents []CommitSearchResultItem_parentsable + // Minimal Repository + repository MinimalRepositoryable + // The score property + score *float64 + // The sha property + sha *string + // The text_matches property + text_matches []Commitsable + // The url property + url *string +} +// NewCommitSearchResultItem instantiates a new CommitSearchResultItem and sets the default values. +func NewCommitSearchResultItem()(*CommitSearchResultItem) { + m := &CommitSearchResultItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitSearchResultItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitSearchResultItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitSearchResultItem(), 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 *CommitSearchResultItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *CommitSearchResultItem) GetAuthor()(NullableSimpleUserable) { + return m.author +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *CommitSearchResultItem) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommit gets the commit property value. The commit property +// returns a CommitSearchResultItem_commitable when successful +func (m *CommitSearchResultItem) GetCommit()(CommitSearchResultItem_commitable) { + return m.commit +} +// GetCommitter gets the committer property value. Metaproperties for Git author/committer information. +// returns a NullableGitUserable when successful +func (m *CommitSearchResultItem) GetCommitter()(NullableGitUserable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitSearchResultItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(NullableSimpleUserable)) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommitSearchResultItem_commitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommit(val.(CommitSearchResultItem_commitable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableGitUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(NullableGitUserable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["parents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCommitSearchResultItem_parentsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CommitSearchResultItem_parentsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CommitSearchResultItem_parentsable) + } + } + m.SetParents(res) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + 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["text_matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCommitsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Commitsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Commitsable) + } + } + m.SetTextMatches(res) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CommitSearchResultItem) GetHtmlUrl()(*string) { + return m.html_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *CommitSearchResultItem) GetNodeId()(*string) { + return m.node_id +} +// GetParents gets the parents property value. The parents property +// returns a []CommitSearchResultItem_parentsable when successful +func (m *CommitSearchResultItem) GetParents()([]CommitSearchResultItem_parentsable) { + return m.parents +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *CommitSearchResultItem) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetScore gets the score property value. The score property +// returns a *float64 when successful +func (m *CommitSearchResultItem) GetScore()(*float64) { + return m.score +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *CommitSearchResultItem) GetSha()(*string) { + return m.sha +} +// GetTextMatches gets the text_matches property value. The text_matches property +// returns a []Commitsable when successful +func (m *CommitSearchResultItem) GetTextMatches()([]Commitsable) { + return m.text_matches +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CommitSearchResultItem) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CommitSearchResultItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetParents() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetParents())) + for i, v := range m.GetParents() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("parents", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("score", m.GetScore()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + if m.GetTextMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTextMatches())) + for i, v := range m.GetTextMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("text_matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CommitSearchResultItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. A GitHub user. +func (m *CommitSearchResultItem) SetAuthor(value NullableSimpleUserable)() { + m.author = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *CommitSearchResultItem) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommit sets the commit property value. The commit property +func (m *CommitSearchResultItem) SetCommit(value CommitSearchResultItem_commitable)() { + m.commit = value +} +// SetCommitter sets the committer property value. Metaproperties for Git author/committer information. +func (m *CommitSearchResultItem) SetCommitter(value NullableGitUserable)() { + m.committer = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CommitSearchResultItem) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *CommitSearchResultItem) SetNodeId(value *string)() { + m.node_id = value +} +// SetParents sets the parents property value. The parents property +func (m *CommitSearchResultItem) SetParents(value []CommitSearchResultItem_parentsable)() { + m.parents = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *CommitSearchResultItem) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetScore sets the score property value. The score property +func (m *CommitSearchResultItem) SetScore(value *float64)() { + m.score = value +} +// SetSha sets the sha property value. The sha property +func (m *CommitSearchResultItem) SetSha(value *string)() { + m.sha = value +} +// SetTextMatches sets the text_matches property value. The text_matches property +func (m *CommitSearchResultItem) SetTextMatches(value []Commitsable)() { + m.text_matches = value +} +// SetUrl sets the url property value. The url property +func (m *CommitSearchResultItem) SetUrl(value *string)() { + m.url = value +} +type CommitSearchResultItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(NullableSimpleUserable) + GetCommentsUrl()(*string) + GetCommit()(CommitSearchResultItem_commitable) + GetCommitter()(NullableGitUserable) + GetHtmlUrl()(*string) + GetNodeId()(*string) + GetParents()([]CommitSearchResultItem_parentsable) + GetRepository()(MinimalRepositoryable) + GetScore()(*float64) + GetSha()(*string) + GetTextMatches()([]Commitsable) + GetUrl()(*string) + SetAuthor(value NullableSimpleUserable)() + SetCommentsUrl(value *string)() + SetCommit(value CommitSearchResultItem_commitable)() + SetCommitter(value NullableGitUserable)() + SetHtmlUrl(value *string)() + SetNodeId(value *string)() + SetParents(value []CommitSearchResultItem_parentsable)() + SetRepository(value MinimalRepositoryable)() + SetScore(value *float64)() + SetSha(value *string)() + SetTextMatches(value []Commitsable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/commit_search_result_item_escaped_commit.go b/pkg/github/models/commit_search_result_item_escaped_commit.go new file mode 100644 index 00000000..d734c2bc --- /dev/null +++ b/pkg/github/models/commit_search_result_item_escaped_commit.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CommitSearchResultItem_commit 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 author property + author CommitSearchResultItem_commit_authorable + // The comment_count property + comment_count *int32 + // Metaproperties for Git author/committer information. + committer NullableGitUserable + // The message property + message *string + // The tree property + tree CommitSearchResultItem_commit_treeable + // The url property + url *string + // The verification property + verification Verificationable +} +// NewCommitSearchResultItem_commit instantiates a new CommitSearchResultItem_commit and sets the default values. +func NewCommitSearchResultItem_commit()(*CommitSearchResultItem_commit) { + m := &CommitSearchResultItem_commit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitSearchResultItem_commitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitSearchResultItem_commitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitSearchResultItem_commit(), 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 *CommitSearchResultItem_commit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. The author property +// returns a CommitSearchResultItem_commit_authorable when successful +func (m *CommitSearchResultItem_commit) GetAuthor()(CommitSearchResultItem_commit_authorable) { + return m.author +} +// GetCommentCount gets the comment_count property value. The comment_count property +// returns a *int32 when successful +func (m *CommitSearchResultItem_commit) GetCommentCount()(*int32) { + return m.comment_count +} +// GetCommitter gets the committer property value. Metaproperties for Git author/committer information. +// returns a NullableGitUserable when successful +func (m *CommitSearchResultItem_commit) GetCommitter()(NullableGitUserable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitSearchResultItem_commit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommitSearchResultItem_commit_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(CommitSearchResultItem_commit_authorable)) + } + return nil + } + res["comment_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCommentCount(val) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableGitUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(NullableGitUserable)) + } + 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 + } + res["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCommitSearchResultItem_commit_treeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTree(val.(CommitSearchResultItem_commit_treeable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verification"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateVerificationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerification(val.(Verificationable)) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *CommitSearchResultItem_commit) GetMessage()(*string) { + return m.message +} +// GetTree gets the tree property value. The tree property +// returns a CommitSearchResultItem_commit_treeable when successful +func (m *CommitSearchResultItem_commit) GetTree()(CommitSearchResultItem_commit_treeable) { + return m.tree +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CommitSearchResultItem_commit) GetUrl()(*string) { + return m.url +} +// GetVerification gets the verification property value. The verification property +// returns a Verificationable when successful +func (m *CommitSearchResultItem_commit) GetVerification()(Verificationable) { + return m.verification +} +// Serialize serializes information the current object +func (m *CommitSearchResultItem_commit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("comment_count", m.GetCommentCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tree", m.GetTree()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verification", m.GetVerification()) + 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 *CommitSearchResultItem_commit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. The author property +func (m *CommitSearchResultItem_commit) SetAuthor(value CommitSearchResultItem_commit_authorable)() { + m.author = value +} +// SetCommentCount sets the comment_count property value. The comment_count property +func (m *CommitSearchResultItem_commit) SetCommentCount(value *int32)() { + m.comment_count = value +} +// SetCommitter sets the committer property value. Metaproperties for Git author/committer information. +func (m *CommitSearchResultItem_commit) SetCommitter(value NullableGitUserable)() { + m.committer = value +} +// SetMessage sets the message property value. The message property +func (m *CommitSearchResultItem_commit) SetMessage(value *string)() { + m.message = value +} +// SetTree sets the tree property value. The tree property +func (m *CommitSearchResultItem_commit) SetTree(value CommitSearchResultItem_commit_treeable)() { + m.tree = value +} +// SetUrl sets the url property value. The url property +func (m *CommitSearchResultItem_commit) SetUrl(value *string)() { + m.url = value +} +// SetVerification sets the verification property value. The verification property +func (m *CommitSearchResultItem_commit) SetVerification(value Verificationable)() { + m.verification = value +} +type CommitSearchResultItem_commitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(CommitSearchResultItem_commit_authorable) + GetCommentCount()(*int32) + GetCommitter()(NullableGitUserable) + GetMessage()(*string) + GetTree()(CommitSearchResultItem_commit_treeable) + GetUrl()(*string) + GetVerification()(Verificationable) + SetAuthor(value CommitSearchResultItem_commit_authorable)() + SetCommentCount(value *int32)() + SetCommitter(value NullableGitUserable)() + SetMessage(value *string)() + SetTree(value CommitSearchResultItem_commit_treeable)() + SetUrl(value *string)() + SetVerification(value Verificationable)() +} diff --git a/pkg/github/models/commit_search_result_item_escaped_commit_escaped_author.go b/pkg/github/models/commit_search_result_item_escaped_commit_escaped_author.go new file mode 100644 index 00000000..c6ee8227 --- /dev/null +++ b/pkg/github/models/commit_search_result_item_escaped_commit_escaped_author.go @@ -0,0 +1,139 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CommitSearchResultItem_commit_author 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 date property + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The email property + email *string + // The name property + name *string +} +// NewCommitSearchResultItem_commit_author instantiates a new CommitSearchResultItem_commit_author and sets the default values. +func NewCommitSearchResultItem_commit_author()(*CommitSearchResultItem_commit_author) { + m := &CommitSearchResultItem_commit_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitSearchResultItem_commit_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitSearchResultItem_commit_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitSearchResultItem_commit_author(), 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 *CommitSearchResultItem_commit_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. The date property +// returns a *Time when successful +func (m *CommitSearchResultItem_commit_author) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *CommitSearchResultItem_commit_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CommitSearchResultItem_commit_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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 property +// returns a *string when successful +func (m *CommitSearchResultItem_commit_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *CommitSearchResultItem_commit_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *CommitSearchResultItem_commit_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. The date property +func (m *CommitSearchResultItem_commit_author) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. The email property +func (m *CommitSearchResultItem_commit_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name property +func (m *CommitSearchResultItem_commit_author) SetName(value *string)() { + m.name = value +} +type CommitSearchResultItem_commit_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/commit_search_result_item_escaped_commit_escaped_tree.go b/pkg/github/models/commit_search_result_item_escaped_commit_escaped_tree.go new file mode 100644 index 00000000..4291d57d --- /dev/null +++ b/pkg/github/models/commit_search_result_item_escaped_commit_escaped_tree.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CommitSearchResultItem_commit_tree 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 sha property + sha *string + // The url property + url *string +} +// NewCommitSearchResultItem_commit_tree instantiates a new CommitSearchResultItem_commit_tree and sets the default values. +func NewCommitSearchResultItem_commit_tree()(*CommitSearchResultItem_commit_tree) { + m := &CommitSearchResultItem_commit_tree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitSearchResultItem_commit_treeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitSearchResultItem_commit_treeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitSearchResultItem_commit_tree(), 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 *CommitSearchResultItem_commit_tree) 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 *CommitSearchResultItem_commit_tree) 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *CommitSearchResultItem_commit_tree) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CommitSearchResultItem_commit_tree) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CommitSearchResultItem_commit_tree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CommitSearchResultItem_commit_tree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *CommitSearchResultItem_commit_tree) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *CommitSearchResultItem_commit_tree) SetUrl(value *string)() { + m.url = value +} +type CommitSearchResultItem_commit_treeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/commit_search_result_item_escaped_parents.go b/pkg/github/models/commit_search_result_item_escaped_parents.go new file mode 100644 index 00000000..f323c79e --- /dev/null +++ b/pkg/github/models/commit_search_result_item_escaped_parents.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CommitSearchResultItem_parents 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 html_url property + html_url *string + // The sha property + sha *string + // The url property + url *string +} +// NewCommitSearchResultItem_parents instantiates a new CommitSearchResultItem_parents and sets the default values. +func NewCommitSearchResultItem_parents()(*CommitSearchResultItem_parents) { + m := &CommitSearchResultItem_parents{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitSearchResultItem_parentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitSearchResultItem_parentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitSearchResultItem_parents(), 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 *CommitSearchResultItem_parents) 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 *CommitSearchResultItem_parents) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *CommitSearchResultItem_parents) GetHtmlUrl()(*string) { + return m.html_url +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *CommitSearchResultItem_parents) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *CommitSearchResultItem_parents) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *CommitSearchResultItem_parents) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *CommitSearchResultItem_parents) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *CommitSearchResultItem_parents) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetSha sets the sha property value. The sha property +func (m *CommitSearchResultItem_parents) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *CommitSearchResultItem_parents) SetUrl(value *string)() { + m.url = value +} +type CommitSearchResultItem_parentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetSha()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/commits.go b/pkg/github/models/commits.go new file mode 100644 index 00000000..9cf7039c --- /dev/null +++ b/pkg/github/models/commits.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Commits struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The fragment property + fragment *string + // The matches property + matches []Commits_matchesable + // The object_type property + object_type *string + // The object_url property + object_url *string + // The property property + property *string +} +// NewCommits instantiates a new Commits and sets the default values. +func NewCommits()(*Commits) { + m := &Commits{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommits(), 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 *Commits) 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 *Commits) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fragment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFragment(val) + } + return nil + } + res["matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCommits_matchesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Commits_matchesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Commits_matchesable) + } + } + m.SetMatches(res) + } + return nil + } + res["object_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectType(val) + } + return nil + } + res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectUrl(val) + } + return nil + } + res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProperty(val) + } + return nil + } + return res +} +// GetFragment gets the fragment property value. The fragment property +// returns a *string when successful +func (m *Commits) GetFragment()(*string) { + return m.fragment +} +// GetMatches gets the matches property value. The matches property +// returns a []Commits_matchesable when successful +func (m *Commits) GetMatches()([]Commits_matchesable) { + return m.matches +} +// GetObjectType gets the object_type property value. The object_type property +// returns a *string when successful +func (m *Commits) GetObjectType()(*string) { + return m.object_type +} +// GetObjectUrl gets the object_url property value. The object_url property +// returns a *string when successful +func (m *Commits) GetObjectUrl()(*string) { + return m.object_url +} +// GetProperty gets the property property value. The property property +// returns a *string when successful +func (m *Commits) GetProperty()(*string) { + return m.property +} +// Serialize serializes information the current object +func (m *Commits) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("fragment", m.GetFragment()) + if err != nil { + return err + } + } + if m.GetMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMatches())) + for i, v := range m.GetMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_type", m.GetObjectType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_url", m.GetObjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("property", m.GetProperty()) + 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 *Commits) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFragment sets the fragment property value. The fragment property +func (m *Commits) SetFragment(value *string)() { + m.fragment = value +} +// SetMatches sets the matches property value. The matches property +func (m *Commits) SetMatches(value []Commits_matchesable)() { + m.matches = value +} +// SetObjectType sets the object_type property value. The object_type property +func (m *Commits) SetObjectType(value *string)() { + m.object_type = value +} +// SetObjectUrl sets the object_url property value. The object_url property +func (m *Commits) SetObjectUrl(value *string)() { + m.object_url = value +} +// SetProperty sets the property property value. The property property +func (m *Commits) SetProperty(value *string)() { + m.property = value +} +type Commitsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFragment()(*string) + GetMatches()([]Commits_matchesable) + GetObjectType()(*string) + GetObjectUrl()(*string) + GetProperty()(*string) + SetFragment(value *string)() + SetMatches(value []Commits_matchesable)() + SetObjectType(value *string)() + SetObjectUrl(value *string)() + SetProperty(value *string)() +} diff --git a/pkg/github/models/commits_escaped_matches.go b/pkg/github/models/commits_escaped_matches.go new file mode 100644 index 00000000..95e3a8da --- /dev/null +++ b/pkg/github/models/commits_escaped_matches.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Commits_matches struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The indices property + indices []int32 + // The text property + text *string +} +// NewCommits_matches instantiates a new Commits_matches and sets the default values. +func NewCommits_matches()(*Commits_matches) { + m := &Commits_matches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommits_matchesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommits_matchesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommits_matches(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Commits_matches) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Commits_matches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["indices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetIndices(res) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetIndices gets the indices property value. The indices property +// returns a []int32 when successful +func (m *Commits_matches) GetIndices()([]int32) { + return m.indices +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *Commits_matches) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *Commits_matches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIndices() != nil { + err := writer.WriteCollectionOfInt32Values("indices", m.GetIndices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *Commits_matches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIndices sets the indices property value. The indices property +func (m *Commits_matches) SetIndices(value []int32)() { + m.indices = value +} +// SetText sets the text property value. The text property +func (m *Commits_matches) SetText(value *string)() { + m.text = value +} +type Commits_matchesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIndices()([]int32) + GetText()(*string) + SetIndices(value []int32)() + SetText(value *string)() +} diff --git a/pkg/github/models/configuration_status.go b/pkg/github/models/configuration_status.go new file mode 100644 index 00000000..8e23e2a2 --- /dev/null +++ b/pkg/github/models/configuration_status.go @@ -0,0 +1,121 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ConfigurationStatus 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 progress property + progress []ConfigurationStatus_progressable + // The status property + status *string +} +// NewConfigurationStatus instantiates a new ConfigurationStatus and sets the default values. +func NewConfigurationStatus()(*ConfigurationStatus) { + m := &ConfigurationStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateConfigurationStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateConfigurationStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewConfigurationStatus(), 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 *ConfigurationStatus) 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 *ConfigurationStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["progress"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateConfigurationStatus_progressFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ConfigurationStatus_progressable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ConfigurationStatus_progressable) + } + } + m.SetProgress(res) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetProgress gets the progress property value. The progress property +// returns a []ConfigurationStatus_progressable when successful +func (m *ConfigurationStatus) GetProgress()([]ConfigurationStatus_progressable) { + return m.progress +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *ConfigurationStatus) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *ConfigurationStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetProgress() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetProgress())) + for i, v := range m.GetProgress() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("progress", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *ConfigurationStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetProgress sets the progress property value. The progress property +func (m *ConfigurationStatus) SetProgress(value []ConfigurationStatus_progressable)() { + m.progress = value +} +// SetStatus sets the status property value. The status property +func (m *ConfigurationStatus) SetStatus(value *string)() { + m.status = value +} +type ConfigurationStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetProgress()([]ConfigurationStatus_progressable) + GetStatus()(*string) + SetProgress(value []ConfigurationStatus_progressable)() + SetStatus(value *string)() +} diff --git a/pkg/github/models/configuration_status_escaped_progress.go b/pkg/github/models/configuration_status_escaped_progress.go new file mode 100644 index 00000000..8820a96d --- /dev/null +++ b/pkg/github/models/configuration_status_escaped_progress.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ConfigurationStatus_progress 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 key property + key *string + // The status property + status *string +} +// NewConfigurationStatus_progress instantiates a new ConfigurationStatus_progress and sets the default values. +func NewConfigurationStatus_progress()(*ConfigurationStatus_progress) { + m := &ConfigurationStatus_progress{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateConfigurationStatus_progressFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateConfigurationStatus_progressFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewConfigurationStatus_progress(), 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 *ConfigurationStatus_progress) 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 *ConfigurationStatus_progress) 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["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *ConfigurationStatus_progress) GetKey()(*string) { + return m.key +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *ConfigurationStatus_progress) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *ConfigurationStatus_progress) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *ConfigurationStatus_progress) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The key property +func (m *ConfigurationStatus_progress) SetKey(value *string)() { + m.key = value +} +// SetStatus sets the status property value. The status property +func (m *ConfigurationStatus_progress) SetStatus(value *string)() { + m.status = value +} +type ConfigurationStatus_progressable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetStatus()(*string) + SetKey(value *string)() + SetStatus(value *string)() +} diff --git a/pkg/github/models/content_file.go b/pkg/github/models/content_file.go new file mode 100644 index 00000000..9a690433 --- /dev/null +++ b/pkg/github/models/content_file.go @@ -0,0 +1,459 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ContentFile content File +type ContentFile struct { + // The _links property + _links ContentFile__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The content property + content *string + // The download_url property + download_url *string + // The encoding property + encoding *string + // The git_url property + git_url *string + // The html_url property + html_url *string + // The name property + name *string + // The path property + path *string + // The sha property + sha *string + // The size property + size *int32 + // The submodule_git_url property + submodule_git_url *string + // The target property + target *string + // The type property + typeEscaped *ContentFile_type + // The url property + url *string +} +// NewContentFile instantiates a new ContentFile and sets the default values. +func NewContentFile()(*ContentFile) { + m := &ContentFile{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContentFileFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentFileFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentFile(), 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 *ContentFile) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContent gets the content property value. The content property +// returns a *string when successful +func (m *ContentFile) GetContent()(*string) { + return m.content +} +// GetDownloadUrl gets the download_url property value. The download_url property +// returns a *string when successful +func (m *ContentFile) GetDownloadUrl()(*string) { + return m.download_url +} +// GetEncoding gets the encoding property value. The encoding property +// returns a *string when successful +func (m *ContentFile) GetEncoding()(*string) { + return m.encoding +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContentFile) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateContentFile__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(ContentFile__linksable)) + } + return nil + } + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContent(val) + } + return nil + } + res["download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadUrl(val) + } + return nil + } + res["encoding"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncoding(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(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["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + 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["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["submodule_git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubmoduleGitUrl(val) + } + return nil + } + res["target"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTarget(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseContentFile_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*ContentFile_type)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *ContentFile) GetGitUrl()(*string) { + return m.git_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *ContentFile) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLinks gets the _links property value. The _links property +// returns a ContentFile__linksable when successful +func (m *ContentFile) GetLinks()(ContentFile__linksable) { + return m._links +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *ContentFile) GetName()(*string) { + return m.name +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *ContentFile) GetPath()(*string) { + return m.path +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *ContentFile) GetSha()(*string) { + return m.sha +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *ContentFile) GetSize()(*int32) { + return m.size +} +// GetSubmoduleGitUrl gets the submodule_git_url property value. The submodule_git_url property +// returns a *string when successful +func (m *ContentFile) GetSubmoduleGitUrl()(*string) { + return m.submodule_git_url +} +// GetTarget gets the target property value. The target property +// returns a *string when successful +func (m *ContentFile) GetTarget()(*string) { + return m.target +} +// GetTypeEscaped gets the type property value. The type property +// returns a *ContentFile_type when successful +func (m *ContentFile) GetTypeEscaped()(*ContentFile_type) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ContentFile) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ContentFile) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content", m.GetContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("download_url", m.GetDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("encoding", m.GetEncoding()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("submodule_git_url", m.GetSubmoduleGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target", m.GetTarget()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *ContentFile) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContent sets the content property value. The content property +func (m *ContentFile) SetContent(value *string)() { + m.content = value +} +// SetDownloadUrl sets the download_url property value. The download_url property +func (m *ContentFile) SetDownloadUrl(value *string)() { + m.download_url = value +} +// SetEncoding sets the encoding property value. The encoding property +func (m *ContentFile) SetEncoding(value *string)() { + m.encoding = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *ContentFile) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *ContentFile) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLinks sets the _links property value. The _links property +func (m *ContentFile) SetLinks(value ContentFile__linksable)() { + m._links = value +} +// SetName sets the name property value. The name property +func (m *ContentFile) SetName(value *string)() { + m.name = value +} +// SetPath sets the path property value. The path property +func (m *ContentFile) SetPath(value *string)() { + m.path = value +} +// SetSha sets the sha property value. The sha property +func (m *ContentFile) SetSha(value *string)() { + m.sha = value +} +// SetSize sets the size property value. The size property +func (m *ContentFile) SetSize(value *int32)() { + m.size = value +} +// SetSubmoduleGitUrl sets the submodule_git_url property value. The submodule_git_url property +func (m *ContentFile) SetSubmoduleGitUrl(value *string)() { + m.submodule_git_url = value +} +// SetTarget sets the target property value. The target property +func (m *ContentFile) SetTarget(value *string)() { + m.target = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *ContentFile) SetTypeEscaped(value *ContentFile_type)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *ContentFile) SetUrl(value *string)() { + m.url = value +} +type ContentFileable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContent()(*string) + GetDownloadUrl()(*string) + GetEncoding()(*string) + GetGitUrl()(*string) + GetHtmlUrl()(*string) + GetLinks()(ContentFile__linksable) + GetName()(*string) + GetPath()(*string) + GetSha()(*string) + GetSize()(*int32) + GetSubmoduleGitUrl()(*string) + GetTarget()(*string) + GetTypeEscaped()(*ContentFile_type) + GetUrl()(*string) + SetContent(value *string)() + SetDownloadUrl(value *string)() + SetEncoding(value *string)() + SetGitUrl(value *string)() + SetHtmlUrl(value *string)() + SetLinks(value ContentFile__linksable)() + SetName(value *string)() + SetPath(value *string)() + SetSha(value *string)() + SetSize(value *int32)() + SetSubmoduleGitUrl(value *string)() + SetTarget(value *string)() + SetTypeEscaped(value *ContentFile_type)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/content_file_escaped__escaped_links.go b/pkg/github/models/content_file_escaped__escaped_links.go new file mode 100644 index 00000000..bb77d374 --- /dev/null +++ b/pkg/github/models/content_file_escaped__escaped_links.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ContentFile__links 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 git property + git *string + // The html property + html *string + // The self property + self *string +} +// NewContentFile__links instantiates a new ContentFile__links and sets the default values. +func NewContentFile__links()(*ContentFile__links) { + m := &ContentFile__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContentFile__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentFile__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentFile__links(), 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 *ContentFile__links) 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 *ContentFile__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["git"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGit(val) + } + return nil + } + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtml(val) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelf(val) + } + return nil + } + return res +} +// GetGit gets the git property value. The git property +// returns a *string when successful +func (m *ContentFile__links) GetGit()(*string) { + return m.git +} +// GetHtml gets the html property value. The html property +// returns a *string when successful +func (m *ContentFile__links) GetHtml()(*string) { + return m.html +} +// GetSelf gets the self property value. The self property +// returns a *string when successful +func (m *ContentFile__links) GetSelf()(*string) { + return m.self +} +// Serialize serializes information the current object +func (m *ContentFile__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("git", m.GetGit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("self", m.GetSelf()) + 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 *ContentFile__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGit sets the git property value. The git property +func (m *ContentFile__links) SetGit(value *string)() { + m.git = value +} +// SetHtml sets the html property value. The html property +func (m *ContentFile__links) SetHtml(value *string)() { + m.html = value +} +// SetSelf sets the self property value. The self property +func (m *ContentFile__links) SetSelf(value *string)() { + m.self = value +} +type ContentFile__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGit()(*string) + GetHtml()(*string) + GetSelf()(*string) + SetGit(value *string)() + SetHtml(value *string)() + SetSelf(value *string)() +} diff --git a/pkg/github/models/content_file_escaped_type.go b/pkg/github/models/content_file_escaped_type.go new file mode 100644 index 00000000..929c9ba7 --- /dev/null +++ b/pkg/github/models/content_file_escaped_type.go @@ -0,0 +1,30 @@ +package models +type ContentFile_type int + +const ( + FILE_CONTENTFILE_TYPE ContentFile_type = iota +) + +func (i ContentFile_type) String() string { + return []string{"file"}[i] +} +func ParseContentFile_type(v string) (any, error) { + result := FILE_CONTENTFILE_TYPE + switch v { + case "file": + result = FILE_CONTENTFILE_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeContentFile_type(values []ContentFile_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ContentFile_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/content_submodule.go b/pkg/github/models/content_submodule.go new file mode 100644 index 00000000..cb105418 --- /dev/null +++ b/pkg/github/models/content_submodule.go @@ -0,0 +1,372 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ContentSubmodule an object describing a submodule +type ContentSubmodule struct { + // The _links property + _links ContentSubmodule__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The download_url property + download_url *string + // The git_url property + git_url *string + // The html_url property + html_url *string + // The name property + name *string + // The path property + path *string + // The sha property + sha *string + // The size property + size *int32 + // The submodule_git_url property + submodule_git_url *string + // The type property + typeEscaped *ContentSubmodule_type + // The url property + url *string +} +// NewContentSubmodule instantiates a new ContentSubmodule and sets the default values. +func NewContentSubmodule()(*ContentSubmodule) { + m := &ContentSubmodule{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContentSubmoduleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentSubmoduleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentSubmodule(), 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 *ContentSubmodule) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDownloadUrl gets the download_url property value. The download_url property +// returns a *string when successful +func (m *ContentSubmodule) GetDownloadUrl()(*string) { + return m.download_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContentSubmodule) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateContentSubmodule__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(ContentSubmodule__linksable)) + } + return nil + } + res["download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(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["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + 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["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["submodule_git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubmoduleGitUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseContentSubmodule_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*ContentSubmodule_type)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *ContentSubmodule) GetGitUrl()(*string) { + return m.git_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *ContentSubmodule) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLinks gets the _links property value. The _links property +// returns a ContentSubmodule__linksable when successful +func (m *ContentSubmodule) GetLinks()(ContentSubmodule__linksable) { + return m._links +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *ContentSubmodule) GetName()(*string) { + return m.name +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *ContentSubmodule) GetPath()(*string) { + return m.path +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *ContentSubmodule) GetSha()(*string) { + return m.sha +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *ContentSubmodule) GetSize()(*int32) { + return m.size +} +// GetSubmoduleGitUrl gets the submodule_git_url property value. The submodule_git_url property +// returns a *string when successful +func (m *ContentSubmodule) GetSubmoduleGitUrl()(*string) { + return m.submodule_git_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *ContentSubmodule_type when successful +func (m *ContentSubmodule) GetTypeEscaped()(*ContentSubmodule_type) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ContentSubmodule) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ContentSubmodule) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("download_url", m.GetDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("submodule_git_url", m.GetSubmoduleGitUrl()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *ContentSubmodule) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDownloadUrl sets the download_url property value. The download_url property +func (m *ContentSubmodule) SetDownloadUrl(value *string)() { + m.download_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *ContentSubmodule) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *ContentSubmodule) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLinks sets the _links property value. The _links property +func (m *ContentSubmodule) SetLinks(value ContentSubmodule__linksable)() { + m._links = value +} +// SetName sets the name property value. The name property +func (m *ContentSubmodule) SetName(value *string)() { + m.name = value +} +// SetPath sets the path property value. The path property +func (m *ContentSubmodule) SetPath(value *string)() { + m.path = value +} +// SetSha sets the sha property value. The sha property +func (m *ContentSubmodule) SetSha(value *string)() { + m.sha = value +} +// SetSize sets the size property value. The size property +func (m *ContentSubmodule) SetSize(value *int32)() { + m.size = value +} +// SetSubmoduleGitUrl sets the submodule_git_url property value. The submodule_git_url property +func (m *ContentSubmodule) SetSubmoduleGitUrl(value *string)() { + m.submodule_git_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *ContentSubmodule) SetTypeEscaped(value *ContentSubmodule_type)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *ContentSubmodule) SetUrl(value *string)() { + m.url = value +} +type ContentSubmoduleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDownloadUrl()(*string) + GetGitUrl()(*string) + GetHtmlUrl()(*string) + GetLinks()(ContentSubmodule__linksable) + GetName()(*string) + GetPath()(*string) + GetSha()(*string) + GetSize()(*int32) + GetSubmoduleGitUrl()(*string) + GetTypeEscaped()(*ContentSubmodule_type) + GetUrl()(*string) + SetDownloadUrl(value *string)() + SetGitUrl(value *string)() + SetHtmlUrl(value *string)() + SetLinks(value ContentSubmodule__linksable)() + SetName(value *string)() + SetPath(value *string)() + SetSha(value *string)() + SetSize(value *int32)() + SetSubmoduleGitUrl(value *string)() + SetTypeEscaped(value *ContentSubmodule_type)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/content_submodule_escaped__escaped_links.go b/pkg/github/models/content_submodule_escaped__escaped_links.go new file mode 100644 index 00000000..bc48d47b --- /dev/null +++ b/pkg/github/models/content_submodule_escaped__escaped_links.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ContentSubmodule__links 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 git property + git *string + // The html property + html *string + // The self property + self *string +} +// NewContentSubmodule__links instantiates a new ContentSubmodule__links and sets the default values. +func NewContentSubmodule__links()(*ContentSubmodule__links) { + m := &ContentSubmodule__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContentSubmodule__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentSubmodule__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentSubmodule__links(), 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 *ContentSubmodule__links) 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 *ContentSubmodule__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["git"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGit(val) + } + return nil + } + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtml(val) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelf(val) + } + return nil + } + return res +} +// GetGit gets the git property value. The git property +// returns a *string when successful +func (m *ContentSubmodule__links) GetGit()(*string) { + return m.git +} +// GetHtml gets the html property value. The html property +// returns a *string when successful +func (m *ContentSubmodule__links) GetHtml()(*string) { + return m.html +} +// GetSelf gets the self property value. The self property +// returns a *string when successful +func (m *ContentSubmodule__links) GetSelf()(*string) { + return m.self +} +// Serialize serializes information the current object +func (m *ContentSubmodule__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("git", m.GetGit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("self", m.GetSelf()) + 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 *ContentSubmodule__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGit sets the git property value. The git property +func (m *ContentSubmodule__links) SetGit(value *string)() { + m.git = value +} +// SetHtml sets the html property value. The html property +func (m *ContentSubmodule__links) SetHtml(value *string)() { + m.html = value +} +// SetSelf sets the self property value. The self property +func (m *ContentSubmodule__links) SetSelf(value *string)() { + m.self = value +} +type ContentSubmodule__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGit()(*string) + GetHtml()(*string) + GetSelf()(*string) + SetGit(value *string)() + SetHtml(value *string)() + SetSelf(value *string)() +} diff --git a/pkg/github/models/content_submodule_escaped_type.go b/pkg/github/models/content_submodule_escaped_type.go new file mode 100644 index 00000000..bbd3be3f --- /dev/null +++ b/pkg/github/models/content_submodule_escaped_type.go @@ -0,0 +1,30 @@ +package models +type ContentSubmodule_type int + +const ( + SUBMODULE_CONTENTSUBMODULE_TYPE ContentSubmodule_type = iota +) + +func (i ContentSubmodule_type) String() string { + return []string{"submodule"}[i] +} +func ParseContentSubmodule_type(v string) (any, error) { + result := SUBMODULE_CONTENTSUBMODULE_TYPE + switch v { + case "submodule": + result = SUBMODULE_CONTENTSUBMODULE_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeContentSubmodule_type(values []ContentSubmodule_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ContentSubmodule_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/content_symlink.go b/pkg/github/models/content_symlink.go new file mode 100644 index 00000000..48d3c210 --- /dev/null +++ b/pkg/github/models/content_symlink.go @@ -0,0 +1,372 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ContentSymlink an object describing a symlink +type ContentSymlink struct { + // The _links property + _links ContentSymlink__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The download_url property + download_url *string + // The git_url property + git_url *string + // The html_url property + html_url *string + // The name property + name *string + // The path property + path *string + // The sha property + sha *string + // The size property + size *int32 + // The target property + target *string + // The type property + typeEscaped *ContentSymlink_type + // The url property + url *string +} +// NewContentSymlink instantiates a new ContentSymlink and sets the default values. +func NewContentSymlink()(*ContentSymlink) { + m := &ContentSymlink{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContentSymlinkFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentSymlinkFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentSymlink(), 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 *ContentSymlink) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDownloadUrl gets the download_url property value. The download_url property +// returns a *string when successful +func (m *ContentSymlink) GetDownloadUrl()(*string) { + return m.download_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContentSymlink) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateContentSymlink__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(ContentSymlink__linksable)) + } + return nil + } + res["download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(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["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + 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["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["target"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTarget(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseContentSymlink_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*ContentSymlink_type)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *ContentSymlink) GetGitUrl()(*string) { + return m.git_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *ContentSymlink) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLinks gets the _links property value. The _links property +// returns a ContentSymlink__linksable when successful +func (m *ContentSymlink) GetLinks()(ContentSymlink__linksable) { + return m._links +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *ContentSymlink) GetName()(*string) { + return m.name +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *ContentSymlink) GetPath()(*string) { + return m.path +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *ContentSymlink) GetSha()(*string) { + return m.sha +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *ContentSymlink) GetSize()(*int32) { + return m.size +} +// GetTarget gets the target property value. The target property +// returns a *string when successful +func (m *ContentSymlink) GetTarget()(*string) { + return m.target +} +// GetTypeEscaped gets the type property value. The type property +// returns a *ContentSymlink_type when successful +func (m *ContentSymlink) GetTypeEscaped()(*ContentSymlink_type) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ContentSymlink) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ContentSymlink) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("download_url", m.GetDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target", m.GetTarget()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *ContentSymlink) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDownloadUrl sets the download_url property value. The download_url property +func (m *ContentSymlink) SetDownloadUrl(value *string)() { + m.download_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *ContentSymlink) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *ContentSymlink) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLinks sets the _links property value. The _links property +func (m *ContentSymlink) SetLinks(value ContentSymlink__linksable)() { + m._links = value +} +// SetName sets the name property value. The name property +func (m *ContentSymlink) SetName(value *string)() { + m.name = value +} +// SetPath sets the path property value. The path property +func (m *ContentSymlink) SetPath(value *string)() { + m.path = value +} +// SetSha sets the sha property value. The sha property +func (m *ContentSymlink) SetSha(value *string)() { + m.sha = value +} +// SetSize sets the size property value. The size property +func (m *ContentSymlink) SetSize(value *int32)() { + m.size = value +} +// SetTarget sets the target property value. The target property +func (m *ContentSymlink) SetTarget(value *string)() { + m.target = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *ContentSymlink) SetTypeEscaped(value *ContentSymlink_type)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *ContentSymlink) SetUrl(value *string)() { + m.url = value +} +type ContentSymlinkable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDownloadUrl()(*string) + GetGitUrl()(*string) + GetHtmlUrl()(*string) + GetLinks()(ContentSymlink__linksable) + GetName()(*string) + GetPath()(*string) + GetSha()(*string) + GetSize()(*int32) + GetTarget()(*string) + GetTypeEscaped()(*ContentSymlink_type) + GetUrl()(*string) + SetDownloadUrl(value *string)() + SetGitUrl(value *string)() + SetHtmlUrl(value *string)() + SetLinks(value ContentSymlink__linksable)() + SetName(value *string)() + SetPath(value *string)() + SetSha(value *string)() + SetSize(value *int32)() + SetTarget(value *string)() + SetTypeEscaped(value *ContentSymlink_type)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/content_symlink_escaped__escaped_links.go b/pkg/github/models/content_symlink_escaped__escaped_links.go new file mode 100644 index 00000000..14f012f0 --- /dev/null +++ b/pkg/github/models/content_symlink_escaped__escaped_links.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ContentSymlink__links 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 git property + git *string + // The html property + html *string + // The self property + self *string +} +// NewContentSymlink__links instantiates a new ContentSymlink__links and sets the default values. +func NewContentSymlink__links()(*ContentSymlink__links) { + m := &ContentSymlink__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContentSymlink__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContentSymlink__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContentSymlink__links(), 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 *ContentSymlink__links) 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 *ContentSymlink__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["git"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGit(val) + } + return nil + } + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtml(val) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelf(val) + } + return nil + } + return res +} +// GetGit gets the git property value. The git property +// returns a *string when successful +func (m *ContentSymlink__links) GetGit()(*string) { + return m.git +} +// GetHtml gets the html property value. The html property +// returns a *string when successful +func (m *ContentSymlink__links) GetHtml()(*string) { + return m.html +} +// GetSelf gets the self property value. The self property +// returns a *string when successful +func (m *ContentSymlink__links) GetSelf()(*string) { + return m.self +} +// Serialize serializes information the current object +func (m *ContentSymlink__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("git", m.GetGit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("self", m.GetSelf()) + 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 *ContentSymlink__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGit sets the git property value. The git property +func (m *ContentSymlink__links) SetGit(value *string)() { + m.git = value +} +// SetHtml sets the html property value. The html property +func (m *ContentSymlink__links) SetHtml(value *string)() { + m.html = value +} +// SetSelf sets the self property value. The self property +func (m *ContentSymlink__links) SetSelf(value *string)() { + m.self = value +} +type ContentSymlink__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGit()(*string) + GetHtml()(*string) + GetSelf()(*string) + SetGit(value *string)() + SetHtml(value *string)() + SetSelf(value *string)() +} diff --git a/pkg/github/models/content_symlink_escaped_type.go b/pkg/github/models/content_symlink_escaped_type.go new file mode 100644 index 00000000..b1385a6b --- /dev/null +++ b/pkg/github/models/content_symlink_escaped_type.go @@ -0,0 +1,30 @@ +package models +type ContentSymlink_type int + +const ( + SYMLINK_CONTENTSYMLINK_TYPE ContentSymlink_type = iota +) + +func (i ContentSymlink_type) String() string { + return []string{"symlink"}[i] +} +func ParseContentSymlink_type(v string) (any, error) { + result := SYMLINK_CONTENTSYMLINK_TYPE + switch v { + case "symlink": + result = SYMLINK_CONTENTSYMLINK_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeContentSymlink_type(values []ContentSymlink_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ContentSymlink_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/contributor.go b/pkg/github/models/contributor.go new file mode 100644 index 00000000..08342ad4 --- /dev/null +++ b/pkg/github/models/contributor.go @@ -0,0 +1,661 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Contributor contributor +type Contributor 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 avatar_url property + avatar_url *string + // The contributions property + contributions *int32 + // The email property + email *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int32 + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewContributor instantiates a new Contributor and sets the default values. +func NewContributor()(*Contributor) { + m := &Contributor{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContributorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContributorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContributor(), 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 *Contributor) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *Contributor) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetContributions gets the contributions property value. The contributions property +// returns a *int32 when successful +func (m *Contributor) GetContributions()(*int32) { + return m.contributions +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *Contributor) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *Contributor) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Contributor) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["contributions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetContributions(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *Contributor) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *Contributor) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *Contributor) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *Contributor) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Contributor) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Contributor) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *Contributor) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Contributor) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Contributor) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *Contributor) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *Contributor) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *Contributor) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *Contributor) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *Contributor) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *Contributor) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Contributor) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Contributor) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Contributor) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("contributions", m.GetContributions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Contributor) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *Contributor) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetContributions sets the contributions property value. The contributions property +func (m *Contributor) SetContributions(value *int32)() { + m.contributions = value +} +// SetEmail sets the email property value. The email property +func (m *Contributor) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *Contributor) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *Contributor) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *Contributor) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *Contributor) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *Contributor) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Contributor) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Contributor) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *Contributor) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *Contributor) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Contributor) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *Contributor) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *Contributor) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *Contributor) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *Contributor) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *Contributor) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *Contributor) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Contributor) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *Contributor) SetUrl(value *string)() { + m.url = value +} +type Contributorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetContributions()(*int32) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetContributions(value *int32)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/contributor_activity.go b/pkg/github/models/contributor_activity.go new file mode 100644 index 00000000..66abfa8e --- /dev/null +++ b/pkg/github/models/contributor_activity.go @@ -0,0 +1,151 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ContributorActivity contributor Activity +type ContributorActivity 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 GitHub user. + author NullableSimpleUserable + // The total property + total *int32 + // The weeks property + weeks []ContributorActivity_weeksable +} +// NewContributorActivity instantiates a new ContributorActivity and sets the default values. +func NewContributorActivity()(*ContributorActivity) { + m := &ContributorActivity{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContributorActivityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContributorActivityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContributorActivity(), 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 *ContributorActivity) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *ContributorActivity) GetAuthor()(NullableSimpleUserable) { + return m.author +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContributorActivity) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(NullableSimpleUserable)) + } + return nil + } + res["total"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotal(val) + } + return nil + } + res["weeks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateContributorActivity_weeksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ContributorActivity_weeksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ContributorActivity_weeksable) + } + } + m.SetWeeks(res) + } + return nil + } + return res +} +// GetTotal gets the total property value. The total property +// returns a *int32 when successful +func (m *ContributorActivity) GetTotal()(*int32) { + return m.total +} +// GetWeeks gets the weeks property value. The weeks property +// returns a []ContributorActivity_weeksable when successful +func (m *ContributorActivity) GetWeeks()([]ContributorActivity_weeksable) { + return m.weeks +} +// Serialize serializes information the current object +func (m *ContributorActivity) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total", m.GetTotal()) + if err != nil { + return err + } + } + if m.GetWeeks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWeeks())) + for i, v := range m.GetWeeks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("weeks", 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 *ContributorActivity) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. A GitHub user. +func (m *ContributorActivity) SetAuthor(value NullableSimpleUserable)() { + m.author = value +} +// SetTotal sets the total property value. The total property +func (m *ContributorActivity) SetTotal(value *int32)() { + m.total = value +} +// SetWeeks sets the weeks property value. The weeks property +func (m *ContributorActivity) SetWeeks(value []ContributorActivity_weeksable)() { + m.weeks = value +} +type ContributorActivityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(NullableSimpleUserable) + GetTotal()(*int32) + GetWeeks()([]ContributorActivity_weeksable) + SetAuthor(value NullableSimpleUserable)() + SetTotal(value *int32)() + SetWeeks(value []ContributorActivity_weeksable)() +} diff --git a/pkg/github/models/contributor_activity_escaped_weeks.go b/pkg/github/models/contributor_activity_escaped_weeks.go new file mode 100644 index 00000000..8427f464 --- /dev/null +++ b/pkg/github/models/contributor_activity_escaped_weeks.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ContributorActivity_weeks struct { + // The a property + a *int32 + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The c property + c *int32 + // The d property + d *int32 + // The w property + w *int32 +} +// NewContributorActivity_weeks instantiates a new ContributorActivity_weeks and sets the default values. +func NewContributorActivity_weeks()(*ContributorActivity_weeks) { + m := &ContributorActivity_weeks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateContributorActivity_weeksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContributorActivity_weeksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewContributorActivity_weeks(), nil +} +// GetA gets the a property value. The a property +// returns a *int32 when successful +func (m *ContributorActivity_weeks) GetA()(*int32) { + return m.a +} +// 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 *ContributorActivity_weeks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetC gets the c property value. The c property +// returns a *int32 when successful +func (m *ContributorActivity_weeks) GetC()(*int32) { + return m.c +} +// GetD gets the d property value. The d property +// returns a *int32 when successful +func (m *ContributorActivity_weeks) GetD()(*int32) { + return m.d +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContributorActivity_weeks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["a"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetA(val) + } + return nil + } + res["c"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetC(val) + } + return nil + } + res["d"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetD(val) + } + return nil + } + res["w"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetW(val) + } + return nil + } + return res +} +// GetW gets the w property value. The w property +// returns a *int32 when successful +func (m *ContributorActivity_weeks) GetW()(*int32) { + return m.w +} +// Serialize serializes information the current object +func (m *ContributorActivity_weeks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("a", m.GetA()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("c", m.GetC()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("d", m.GetD()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("w", m.GetW()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetA sets the a property value. The a property +func (m *ContributorActivity_weeks) SetA(value *int32)() { + m.a = 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 *ContributorActivity_weeks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetC sets the c property value. The c property +func (m *ContributorActivity_weeks) SetC(value *int32)() { + m.c = value +} +// SetD sets the d property value. The d property +func (m *ContributorActivity_weeks) SetD(value *int32)() { + m.d = value +} +// SetW sets the w property value. The w property +func (m *ContributorActivity_weeks) SetW(value *int32)() { + m.w = value +} +type ContributorActivity_weeksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetA()(*int32) + GetC()(*int32) + GetD()(*int32) + GetW()(*int32) + SetA(value *int32)() + SetC(value *int32)() + SetD(value *int32)() + SetW(value *int32)() +} diff --git a/pkg/github/models/converted_note_to_issue_issue_event.go b/pkg/github/models/converted_note_to_issue_issue_event.go new file mode 100644 index 00000000..6a024bc4 --- /dev/null +++ b/pkg/github/models/converted_note_to_issue_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ConvertedNoteToIssueIssueEvent converted Note to Issue Issue Event +type ConvertedNoteToIssueIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app Integrationable + // The project_card property + project_card ConvertedNoteToIssueIssueEvent_project_cardable + // The url property + url *string +} +// NewConvertedNoteToIssueIssueEvent instantiates a new ConvertedNoteToIssueIssueEvent and sets the default values. +func NewConvertedNoteToIssueIssueEvent()(*ConvertedNoteToIssueIssueEvent) { + m := &ConvertedNoteToIssueIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateConvertedNoteToIssueIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateConvertedNoteToIssueIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewConvertedNoteToIssueIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ConvertedNoteToIssueIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *ConvertedNoteToIssueIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ConvertedNoteToIssueIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(Integrationable)) + } + return nil + } + res["project_card"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateConvertedNoteToIssueIssueEvent_project_cardFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProjectCard(val.(ConvertedNoteToIssueIssueEvent_project_cardable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ConvertedNoteToIssueIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a Integrationable when successful +func (m *ConvertedNoteToIssueIssueEvent) GetPerformedViaGithubApp()(Integrationable) { + return m.performed_via_github_app +} +// GetProjectCard gets the project_card property value. The project_card property +// returns a ConvertedNoteToIssueIssueEvent_project_cardable when successful +func (m *ConvertedNoteToIssueIssueEvent) GetProjectCard()(ConvertedNoteToIssueIssueEvent_project_cardable) { + return m.project_card +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ConvertedNoteToIssueIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("project_card", m.GetProjectCard()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *ConvertedNoteToIssueIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *ConvertedNoteToIssueIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *ConvertedNoteToIssueIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *ConvertedNoteToIssueIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ConvertedNoteToIssueIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *ConvertedNoteToIssueIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *ConvertedNoteToIssueIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ConvertedNoteToIssueIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *ConvertedNoteToIssueIssueEvent) SetPerformedViaGithubApp(value Integrationable)() { + m.performed_via_github_app = value +} +// SetProjectCard sets the project_card property value. The project_card property +func (m *ConvertedNoteToIssueIssueEvent) SetProjectCard(value ConvertedNoteToIssueIssueEvent_project_cardable)() { + m.project_card = value +} +// SetUrl sets the url property value. The url property +func (m *ConvertedNoteToIssueIssueEvent) SetUrl(value *string)() { + m.url = value +} +type ConvertedNoteToIssueIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(Integrationable) + GetProjectCard()(ConvertedNoteToIssueIssueEvent_project_cardable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value Integrationable)() + SetProjectCard(value ConvertedNoteToIssueIssueEvent_project_cardable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/converted_note_to_issue_issue_event_escaped_project_escaped_card.go b/pkg/github/models/converted_note_to_issue_issue_event_escaped_project_escaped_card.go new file mode 100644 index 00000000..2713ecfc --- /dev/null +++ b/pkg/github/models/converted_note_to_issue_issue_event_escaped_project_escaped_card.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ConvertedNoteToIssueIssueEvent_project_card 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 column_name property + column_name *string + // The id property + id *int32 + // The previous_column_name property + previous_column_name *string + // The project_id property + project_id *int32 + // The project_url property + project_url *string + // The url property + url *string +} +// NewConvertedNoteToIssueIssueEvent_project_card instantiates a new ConvertedNoteToIssueIssueEvent_project_card and sets the default values. +func NewConvertedNoteToIssueIssueEvent_project_card()(*ConvertedNoteToIssueIssueEvent_project_card) { + m := &ConvertedNoteToIssueIssueEvent_project_card{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateConvertedNoteToIssueIssueEvent_project_cardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateConvertedNoteToIssueIssueEvent_project_cardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewConvertedNoteToIssueIssueEvent_project_card(), 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 *ConvertedNoteToIssueIssueEvent_project_card) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColumnName gets the column_name property value. The column_name property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent_project_card) GetColumnName()(*string) { + return m.column_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ConvertedNoteToIssueIssueEvent_project_card) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnName(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["previous_column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousColumnName(val) + } + return nil + } + res["project_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetProjectId(val) + } + return nil + } + res["project_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ConvertedNoteToIssueIssueEvent_project_card) GetId()(*int32) { + return m.id +} +// GetPreviousColumnName gets the previous_column_name property value. The previous_column_name property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent_project_card) GetPreviousColumnName()(*string) { + return m.previous_column_name +} +// GetProjectId gets the project_id property value. The project_id property +// returns a *int32 when successful +func (m *ConvertedNoteToIssueIssueEvent_project_card) GetProjectId()(*int32) { + return m.project_id +} +// GetProjectUrl gets the project_url property value. The project_url property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent_project_card) GetProjectUrl()(*string) { + return m.project_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ConvertedNoteToIssueIssueEvent_project_card) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ConvertedNoteToIssueIssueEvent_project_card) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("column_name", m.GetColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_column_name", m.GetPreviousColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("project_id", m.GetProjectId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_url", m.GetProjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ConvertedNoteToIssueIssueEvent_project_card) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColumnName sets the column_name property value. The column_name property +func (m *ConvertedNoteToIssueIssueEvent_project_card) SetColumnName(value *string)() { + m.column_name = value +} +// SetId sets the id property value. The id property +func (m *ConvertedNoteToIssueIssueEvent_project_card) SetId(value *int32)() { + m.id = value +} +// SetPreviousColumnName sets the previous_column_name property value. The previous_column_name property +func (m *ConvertedNoteToIssueIssueEvent_project_card) SetPreviousColumnName(value *string)() { + m.previous_column_name = value +} +// SetProjectId sets the project_id property value. The project_id property +func (m *ConvertedNoteToIssueIssueEvent_project_card) SetProjectId(value *int32)() { + m.project_id = value +} +// SetProjectUrl sets the project_url property value. The project_url property +func (m *ConvertedNoteToIssueIssueEvent_project_card) SetProjectUrl(value *string)() { + m.project_url = value +} +// SetUrl sets the url property value. The url property +func (m *ConvertedNoteToIssueIssueEvent_project_card) SetUrl(value *string)() { + m.url = value +} +type ConvertedNoteToIssueIssueEvent_project_cardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumnName()(*string) + GetId()(*int32) + GetPreviousColumnName()(*string) + GetProjectId()(*int32) + GetProjectUrl()(*string) + GetUrl()(*string) + SetColumnName(value *string)() + SetId(value *int32)() + SetPreviousColumnName(value *string)() + SetProjectId(value *int32)() + SetProjectUrl(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/custom_deployment_rule_app.go b/pkg/github/models/custom_deployment_rule_app.go new file mode 100644 index 00000000..9f1613c9 --- /dev/null +++ b/pkg/github/models/custom_deployment_rule_app.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CustomDeploymentRuleApp a GitHub App that is providing a custom deployment protection rule. +type CustomDeploymentRuleApp 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 unique identifier of the deployment protection rule integration. + id *int32 + // The URL for the endpoint to get details about the app. + integration_url *string + // The node ID for the deployment protection rule integration. + node_id *string + // The slugified name of the deployment protection rule integration. + slug *string +} +// NewCustomDeploymentRuleApp instantiates a new CustomDeploymentRuleApp and sets the default values. +func NewCustomDeploymentRuleApp()(*CustomDeploymentRuleApp) { + m := &CustomDeploymentRuleApp{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCustomDeploymentRuleAppFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCustomDeploymentRuleAppFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCustomDeploymentRuleApp(), 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 *CustomDeploymentRuleApp) 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 *CustomDeploymentRuleApp) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["integration_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIntegrationUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + return res +} +// GetId gets the id property value. The unique identifier of the deployment protection rule integration. +// returns a *int32 when successful +func (m *CustomDeploymentRuleApp) GetId()(*int32) { + return m.id +} +// GetIntegrationUrl gets the integration_url property value. The URL for the endpoint to get details about the app. +// returns a *string when successful +func (m *CustomDeploymentRuleApp) GetIntegrationUrl()(*string) { + return m.integration_url +} +// GetNodeId gets the node_id property value. The node ID for the deployment protection rule integration. +// returns a *string when successful +func (m *CustomDeploymentRuleApp) GetNodeId()(*string) { + return m.node_id +} +// GetSlug gets the slug property value. The slugified name of the deployment protection rule integration. +// returns a *string when successful +func (m *CustomDeploymentRuleApp) GetSlug()(*string) { + return m.slug +} +// Serialize serializes information the current object +func (m *CustomDeploymentRuleApp) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("integration_url", m.GetIntegrationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + 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 *CustomDeploymentRuleApp) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The unique identifier of the deployment protection rule integration. +func (m *CustomDeploymentRuleApp) SetId(value *int32)() { + m.id = value +} +// SetIntegrationUrl sets the integration_url property value. The URL for the endpoint to get details about the app. +func (m *CustomDeploymentRuleApp) SetIntegrationUrl(value *string)() { + m.integration_url = value +} +// SetNodeId sets the node_id property value. The node ID for the deployment protection rule integration. +func (m *CustomDeploymentRuleApp) SetNodeId(value *string)() { + m.node_id = value +} +// SetSlug sets the slug property value. The slugified name of the deployment protection rule integration. +func (m *CustomDeploymentRuleApp) SetSlug(value *string)() { + m.slug = value +} +type CustomDeploymentRuleAppable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetIntegrationUrl()(*string) + GetNodeId()(*string) + GetSlug()(*string) + SetId(value *int32)() + SetIntegrationUrl(value *string)() + SetNodeId(value *string)() + SetSlug(value *string)() +} diff --git a/pkg/github/models/custom_property.go b/pkg/github/models/custom_property.go new file mode 100644 index 00000000..b41f3d9e --- /dev/null +++ b/pkg/github/models/custom_property.go @@ -0,0 +1,363 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CustomProperty custom property defined on an organization +type CustomProperty struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // An ordered list of the allowed values of the property.The property can have up to 200 allowed values. + allowed_values []string + // Default value of the property + default_value CustomProperty_CustomProperty_default_valueable + // Short description of the property + description *string + // The name of the property + property_name *string + // Whether the property is required. + required *bool + // The URL that can be used to fetch, update, or delete info about this property via the API. + url *string + // The type of the value for the property + value_type *CustomProperty_value_type + // Who can edit the values of the property + values_editable_by *CustomProperty_values_editable_by +} +// CustomProperty_CustomProperty_default_value composed type wrapper for classes string +type CustomProperty_CustomProperty_default_value struct { + // Composed type representation for type string + string *string +} +// NewCustomProperty_CustomProperty_default_value instantiates a new CustomProperty_CustomProperty_default_value and sets the default values. +func NewCustomProperty_CustomProperty_default_value()(*CustomProperty_CustomProperty_default_value) { + m := &CustomProperty_CustomProperty_default_value{ + } + return m +} +// CreateCustomProperty_CustomProperty_default_valueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCustomProperty_CustomProperty_default_valueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewCustomProperty_CustomProperty_default_value() + if parseNode != nil { + mappingValueNode, err := parseNode.GetChildNode("") + if err != nil { + 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.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CustomProperty_CustomProperty_default_value) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *CustomProperty_CustomProperty_default_value) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *CustomProperty_CustomProperty_default_value) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *CustomProperty_CustomProperty_default_value) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetString sets the string property value. Composed type representation for type string +func (m *CustomProperty_CustomProperty_default_value) SetString(value *string)() { + m.string = value +} +type CustomProperty_CustomProperty_default_valueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetString()(*string) + SetString(value *string)() +} +// NewCustomProperty instantiates a new CustomProperty and sets the default values. +func NewCustomProperty()(*CustomProperty) { + m := &CustomProperty{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCustomPropertyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCustomPropertyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCustomProperty(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *CustomProperty) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedValues gets the allowed_values property value. An ordered list of the allowed values of the property.The property can have up to 200 allowed values. +// returns a []string when successful +func (m *CustomProperty) GetAllowedValues()([]string) { + return m.allowed_values +} +// GetDefaultValue gets the default_value property value. Default value of the property +// returns a CustomProperty_CustomProperty_default_valueable when successful +func (m *CustomProperty) GetDefaultValue()(CustomProperty_CustomProperty_default_valueable) { + return m.default_value +} +// GetDescription gets the description property value. Short description of the property +// returns a *string when successful +func (m *CustomProperty) GetDescription()(*string) { + return m.description +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CustomProperty) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_values"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("string") + 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(CreateCustomProperty_CustomProperty_default_valueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDefaultValue(val.(CustomProperty_CustomProperty_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["property_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPropertyName(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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["value_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCustomProperty_value_type) + if err != nil { + return err + } + if val != nil { + m.SetValueType(val.(*CustomProperty_value_type)) + } + return nil + } + res["values_editable_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseCustomProperty_values_editable_by) + if err != nil { + return err + } + if val != nil { + m.SetValuesEditableBy(val.(*CustomProperty_values_editable_by)) + } + return nil + } + return res +} +// GetPropertyName gets the property_name property value. The name of the property +// returns a *string when successful +func (m *CustomProperty) GetPropertyName()(*string) { + return m.property_name +} +// GetRequired gets the required property value. Whether the property is required. +// returns a *bool when successful +func (m *CustomProperty) GetRequired()(*bool) { + return m.required +} +// GetUrl gets the url property value. The URL that can be used to fetch, update, or delete info about this property via the API. +// returns a *string when successful +func (m *CustomProperty) GetUrl()(*string) { + return m.url +} +// GetValuesEditableBy gets the values_editable_by property value. Who can edit the values of the property +// returns a *CustomProperty_values_editable_by when successful +func (m *CustomProperty) GetValuesEditableBy()(*CustomProperty_values_editable_by) { + return m.values_editable_by +} +// GetValueType gets the value_type property value. The type of the value for the property +// returns a *CustomProperty_value_type when successful +func (m *CustomProperty) GetValueType()(*CustomProperty_value_type) { + return m.value_type +} +// Serialize serializes information the current object +func (m *CustomProperty) 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.WriteStringValue("property_name", m.GetPropertyName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("required", m.GetRequired()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + if m.GetValuesEditableBy() != nil { + cast := (*m.GetValuesEditableBy()).String() + err := writer.WriteStringValue("values_editable_by", &cast) + 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 *CustomProperty) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedValues sets the allowed_values property value. An ordered list of the allowed values of the property.The property can have up to 200 allowed values. +func (m *CustomProperty) SetAllowedValues(value []string)() { + m.allowed_values = value +} +// SetDefaultValue sets the default_value property value. Default value of the property +func (m *CustomProperty) SetDefaultValue(value CustomProperty_CustomProperty_default_valueable)() { + m.default_value = value +} +// SetDescription sets the description property value. Short description of the property +func (m *CustomProperty) SetDescription(value *string)() { + m.description = value +} +// SetPropertyName sets the property_name property value. The name of the property +func (m *CustomProperty) SetPropertyName(value *string)() { + m.property_name = value +} +// SetRequired sets the required property value. Whether the property is required. +func (m *CustomProperty) SetRequired(value *bool)() { + m.required = value +} +// SetUrl sets the url property value. The URL that can be used to fetch, update, or delete info about this property via the API. +func (m *CustomProperty) SetUrl(value *string)() { + m.url = value +} +// SetValuesEditableBy sets the values_editable_by property value. Who can edit the values of the property +func (m *CustomProperty) SetValuesEditableBy(value *CustomProperty_values_editable_by)() { + m.values_editable_by = value +} +// SetValueType sets the value_type property value. The type of the value for the property +func (m *CustomProperty) SetValueType(value *CustomProperty_value_type)() { + m.value_type = value +} +type CustomPropertyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedValues()([]string) + GetDefaultValue()(CustomProperty_CustomProperty_default_valueable) + GetDescription()(*string) + GetPropertyName()(*string) + GetRequired()(*bool) + GetUrl()(*string) + GetValuesEditableBy()(*CustomProperty_values_editable_by) + GetValueType()(*CustomProperty_value_type) + SetAllowedValues(value []string)() + SetDefaultValue(value CustomProperty_CustomProperty_default_valueable)() + SetDescription(value *string)() + SetPropertyName(value *string)() + SetRequired(value *bool)() + SetUrl(value *string)() + SetValuesEditableBy(value *CustomProperty_values_editable_by)() + SetValueType(value *CustomProperty_value_type)() +} diff --git a/pkg/github/models/custom_property_escaped_value_escaped_type.go b/pkg/github/models/custom_property_escaped_value_escaped_type.go new file mode 100644 index 00000000..e10de81a --- /dev/null +++ b/pkg/github/models/custom_property_escaped_value_escaped_type.go @@ -0,0 +1,40 @@ +package models +// The type of the value for the property +type CustomProperty_value_type int + +const ( + STRING_CUSTOMPROPERTY_VALUE_TYPE CustomProperty_value_type = iota + SINGLE_SELECT_CUSTOMPROPERTY_VALUE_TYPE + MULTI_SELECT_CUSTOMPROPERTY_VALUE_TYPE + TRUE_FALSE_CUSTOMPROPERTY_VALUE_TYPE +) + +func (i CustomProperty_value_type) String() string { + return []string{"string", "single_select", "multi_select", "true_false"}[i] +} +func ParseCustomProperty_value_type(v string) (any, error) { + result := STRING_CUSTOMPROPERTY_VALUE_TYPE + switch v { + case "string": + result = STRING_CUSTOMPROPERTY_VALUE_TYPE + case "single_select": + result = SINGLE_SELECT_CUSTOMPROPERTY_VALUE_TYPE + case "multi_select": + result = MULTI_SELECT_CUSTOMPROPERTY_VALUE_TYPE + case "true_false": + result = TRUE_FALSE_CUSTOMPROPERTY_VALUE_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeCustomProperty_value_type(values []CustomProperty_value_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CustomProperty_value_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/custom_property_escaped_values_escaped_editable_escaped_by.go b/pkg/github/models/custom_property_escaped_values_escaped_editable_escaped_by.go new file mode 100644 index 00000000..f851355a --- /dev/null +++ b/pkg/github/models/custom_property_escaped_values_escaped_editable_escaped_by.go @@ -0,0 +1,34 @@ +package models +// Who can edit the values of the property +type CustomProperty_values_editable_by int + +const ( + ORG_ACTORS_CUSTOMPROPERTY_VALUES_EDITABLE_BY CustomProperty_values_editable_by = iota + ORG_AND_REPO_ACTORS_CUSTOMPROPERTY_VALUES_EDITABLE_BY +) + +func (i CustomProperty_values_editable_by) String() string { + return []string{"org_actors", "org_and_repo_actors"}[i] +} +func ParseCustomProperty_values_editable_by(v string) (any, error) { + result := ORG_ACTORS_CUSTOMPROPERTY_VALUES_EDITABLE_BY + switch v { + case "org_actors": + result = ORG_ACTORS_CUSTOMPROPERTY_VALUES_EDITABLE_BY + case "org_and_repo_actors": + result = ORG_AND_REPO_ACTORS_CUSTOMPROPERTY_VALUES_EDITABLE_BY + default: + return nil, nil + } + return &result, nil +} +func SerializeCustomProperty_values_editable_by(values []CustomProperty_values_editable_by) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CustomProperty_values_editable_by) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/custom_property_value.go b/pkg/github/models/custom_property_value.go new file mode 100644 index 00000000..5608853b --- /dev/null +++ b/pkg/github/models/custom_property_value.go @@ -0,0 +1,181 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// CustomPropertyValue custom property name and associated value +type CustomPropertyValue 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 name of the property + property_name *string + // The value assigned to the property + value CustomPropertyValue_CustomPropertyValue_valueable +} +// CustomPropertyValue_CustomPropertyValue_value composed type wrapper for classes string +type CustomPropertyValue_CustomPropertyValue_value struct { + // Composed type representation for type string + string *string +} +// NewCustomPropertyValue_CustomPropertyValue_value instantiates a new CustomPropertyValue_CustomPropertyValue_value and sets the default values. +func NewCustomPropertyValue_CustomPropertyValue_value()(*CustomPropertyValue_CustomPropertyValue_value) { + m := &CustomPropertyValue_CustomPropertyValue_value{ + } + return m +} +// CreateCustomPropertyValue_CustomPropertyValue_valueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCustomPropertyValue_CustomPropertyValue_valueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewCustomPropertyValue_CustomPropertyValue_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.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CustomPropertyValue_CustomPropertyValue_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 *CustomPropertyValue_CustomPropertyValue_value) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *CustomPropertyValue_CustomPropertyValue_value) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *CustomPropertyValue_CustomPropertyValue_value) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetString sets the string property value. Composed type representation for type string +func (m *CustomPropertyValue_CustomPropertyValue_value) SetString(value *string)() { + m.string = value +} +type CustomPropertyValue_CustomPropertyValue_valueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetString()(*string) + SetString(value *string)() +} +// NewCustomPropertyValue instantiates a new CustomPropertyValue and sets the default values. +func NewCustomPropertyValue()(*CustomPropertyValue) { + m := &CustomPropertyValue{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCustomPropertyValueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCustomPropertyValueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCustomPropertyValue(), 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 *CustomPropertyValue) 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 *CustomPropertyValue) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["property_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPropertyName(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCustomPropertyValue_CustomPropertyValue_valueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetValue(val.(CustomPropertyValue_CustomPropertyValue_valueable)) + } + return nil + } + return res +} +// GetPropertyName gets the property_name property value. The name of the property +// returns a *string when successful +func (m *CustomPropertyValue) GetPropertyName()(*string) { + return m.property_name +} +// GetValue gets the value property value. The value assigned to the property +// returns a CustomPropertyValue_CustomPropertyValue_valueable when successful +func (m *CustomPropertyValue) GetValue()(CustomPropertyValue_CustomPropertyValue_valueable) { + return m.value +} +// Serialize serializes information the current object +func (m *CustomPropertyValue) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("property_name", m.GetPropertyName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("value", m.GetValue()) + 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 *CustomPropertyValue) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPropertyName sets the property_name property value. The name of the property +func (m *CustomPropertyValue) SetPropertyName(value *string)() { + m.property_name = value +} +// SetValue sets the value property value. The value assigned to the property +func (m *CustomPropertyValue) SetValue(value CustomPropertyValue_CustomPropertyValue_valueable)() { + m.value = value +} +type CustomPropertyValueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPropertyName()(*string) + GetValue()(CustomPropertyValue_CustomPropertyValue_valueable) + SetPropertyName(value *string)() + SetValue(value CustomPropertyValue_CustomPropertyValue_valueable)() +} diff --git a/pkg/github/models/cvss_severities.go b/pkg/github/models/cvss_severities.go new file mode 100644 index 00000000..154412fa --- /dev/null +++ b/pkg/github/models/cvss_severities.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CvssSeverities 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 cvss_v3 property + cvss_v3 CvssSeverities_cvss_v3able + // The cvss_v4 property + cvss_v4 CvssSeverities_cvss_v4able +} +// NewCvssSeverities instantiates a new CvssSeverities and sets the default values. +func NewCvssSeverities()(*CvssSeverities) { + m := &CvssSeverities{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCvssSeveritiesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCvssSeveritiesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCvssSeverities(), 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 *CvssSeverities) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCvssV3 gets the cvss_v3 property value. The cvss_v3 property +// returns a CvssSeverities_cvss_v3able when successful +func (m *CvssSeverities) GetCvssV3()(CvssSeverities_cvss_v3able) { + return m.cvss_v3 +} +// GetCvssV4 gets the cvss_v4 property value. The cvss_v4 property +// returns a CvssSeverities_cvss_v4able when successful +func (m *CvssSeverities) GetCvssV4()(CvssSeverities_cvss_v4able) { + return m.cvss_v4 +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CvssSeverities) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cvss_v3"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCvssSeverities_cvss_v3FromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCvssV3(val.(CvssSeverities_cvss_v3able)) + } + return nil + } + res["cvss_v4"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCvssSeverities_cvss_v4FromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCvssV4(val.(CvssSeverities_cvss_v4able)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *CvssSeverities) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("cvss_v3", m.GetCvssV3()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("cvss_v4", m.GetCvssV4()) + 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 *CvssSeverities) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCvssV3 sets the cvss_v3 property value. The cvss_v3 property +func (m *CvssSeverities) SetCvssV3(value CvssSeverities_cvss_v3able)() { + m.cvss_v3 = value +} +// SetCvssV4 sets the cvss_v4 property value. The cvss_v4 property +func (m *CvssSeverities) SetCvssV4(value CvssSeverities_cvss_v4able)() { + m.cvss_v4 = value +} +type CvssSeveritiesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCvssV3()(CvssSeverities_cvss_v3able) + GetCvssV4()(CvssSeverities_cvss_v4able) + SetCvssV3(value CvssSeverities_cvss_v3able)() + SetCvssV4(value CvssSeverities_cvss_v4able)() +} diff --git a/pkg/github/models/cvss_severities_escaped_cvss_escaped_v3.go b/pkg/github/models/cvss_severities_escaped_cvss_escaped_v3.go new file mode 100644 index 00000000..4abcf2e6 --- /dev/null +++ b/pkg/github/models/cvss_severities_escaped_cvss_escaped_v3.go @@ -0,0 +1,103 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CvssSeverities_cvss_v3 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 CVSS 3 score. + score *float64 + // The CVSS 3 vector string. + vector_string *string +} +// NewCvssSeverities_cvss_v3 instantiates a new CvssSeverities_cvss_v3 and sets the default values. +func NewCvssSeverities_cvss_v3()(*CvssSeverities_cvss_v3) { + m := &CvssSeverities_cvss_v3{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCvssSeverities_cvss_v3FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCvssSeverities_cvss_v3FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCvssSeverities_cvss_v3(), 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 *CvssSeverities_cvss_v3) 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 *CvssSeverities_cvss_v3) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["vector_string"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVectorString(val) + } + return nil + } + return res +} +// GetScore gets the score property value. The CVSS 3 score. +// returns a *float64 when successful +func (m *CvssSeverities_cvss_v3) GetScore()(*float64) { + return m.score +} +// GetVectorString gets the vector_string property value. The CVSS 3 vector string. +// returns a *string when successful +func (m *CvssSeverities_cvss_v3) GetVectorString()(*string) { + return m.vector_string +} +// Serialize serializes information the current object +func (m *CvssSeverities_cvss_v3) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("vector_string", m.GetVectorString()) + 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 *CvssSeverities_cvss_v3) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetScore sets the score property value. The CVSS 3 score. +func (m *CvssSeverities_cvss_v3) SetScore(value *float64)() { + m.score = value +} +// SetVectorString sets the vector_string property value. The CVSS 3 vector string. +func (m *CvssSeverities_cvss_v3) SetVectorString(value *string)() { + m.vector_string = value +} +type CvssSeverities_cvss_v3able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetScore()(*float64) + GetVectorString()(*string) + SetScore(value *float64)() + SetVectorString(value *string)() +} diff --git a/pkg/github/models/cvss_severities_escaped_cvss_escaped_v4.go b/pkg/github/models/cvss_severities_escaped_cvss_escaped_v4.go new file mode 100644 index 00000000..37d1c3a7 --- /dev/null +++ b/pkg/github/models/cvss_severities_escaped_cvss_escaped_v4.go @@ -0,0 +1,103 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type CvssSeverities_cvss_v4 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 CVSS 4 score. + score *float64 + // The CVSS 4 vector string. + vector_string *string +} +// NewCvssSeverities_cvss_v4 instantiates a new CvssSeverities_cvss_v4 and sets the default values. +func NewCvssSeverities_cvss_v4()(*CvssSeverities_cvss_v4) { + m := &CvssSeverities_cvss_v4{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCvssSeverities_cvss_v4FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCvssSeverities_cvss_v4FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCvssSeverities_cvss_v4(), 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 *CvssSeverities_cvss_v4) 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 *CvssSeverities_cvss_v4) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["vector_string"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVectorString(val) + } + return nil + } + return res +} +// GetScore gets the score property value. The CVSS 4 score. +// returns a *float64 when successful +func (m *CvssSeverities_cvss_v4) GetScore()(*float64) { + return m.score +} +// GetVectorString gets the vector_string property value. The CVSS 4 vector string. +// returns a *string when successful +func (m *CvssSeverities_cvss_v4) GetVectorString()(*string) { + return m.vector_string +} +// Serialize serializes information the current object +func (m *CvssSeverities_cvss_v4) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("vector_string", m.GetVectorString()) + 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 *CvssSeverities_cvss_v4) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetScore sets the score property value. The CVSS 4 score. +func (m *CvssSeverities_cvss_v4) SetScore(value *float64)() { + m.score = value +} +// SetVectorString sets the vector_string property value. The CVSS 4 vector string. +func (m *CvssSeverities_cvss_v4) SetVectorString(value *string)() { + m.vector_string = value +} +type CvssSeverities_cvss_v4able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetScore()(*float64) + GetVectorString()(*string) + SetScore(value *float64)() + SetVectorString(value *string)() +} diff --git a/pkg/github/models/demilestoned_issue_event.go b/pkg/github/models/demilestoned_issue_event.go new file mode 100644 index 00000000..ad3ecb11 --- /dev/null +++ b/pkg/github/models/demilestoned_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DemilestonedIssueEvent demilestoned Issue Event +type DemilestonedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The milestone property + milestone DemilestonedIssueEvent_milestoneable + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewDemilestonedIssueEvent instantiates a new DemilestonedIssueEvent and sets the default values. +func NewDemilestonedIssueEvent()(*DemilestonedIssueEvent) { + m := &DemilestonedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDemilestonedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDemilestonedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDemilestonedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *DemilestonedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *DemilestonedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *DemilestonedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *DemilestonedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *DemilestonedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *DemilestonedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DemilestonedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDemilestonedIssueEvent_milestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(DemilestonedIssueEvent_milestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *DemilestonedIssueEvent) GetId()(*int32) { + return m.id +} +// GetMilestone gets the milestone property value. The milestone property +// returns a DemilestonedIssueEvent_milestoneable when successful +func (m *DemilestonedIssueEvent) GetMilestone()(DemilestonedIssueEvent_milestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *DemilestonedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *DemilestonedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *DemilestonedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *DemilestonedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *DemilestonedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *DemilestonedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *DemilestonedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *DemilestonedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *DemilestonedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *DemilestonedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *DemilestonedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetMilestone sets the milestone property value. The milestone property +func (m *DemilestonedIssueEvent) SetMilestone(value DemilestonedIssueEvent_milestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *DemilestonedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *DemilestonedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *DemilestonedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type DemilestonedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetMilestone()(DemilestonedIssueEvent_milestoneable) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetMilestone(value DemilestonedIssueEvent_milestoneable)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/demilestoned_issue_event_escaped_milestone.go b/pkg/github/models/demilestoned_issue_event_escaped_milestone.go new file mode 100644 index 00000000..e864bc2b --- /dev/null +++ b/pkg/github/models/demilestoned_issue_event_escaped_milestone.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DemilestonedIssueEvent_milestone 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 title property + title *string +} +// NewDemilestonedIssueEvent_milestone instantiates a new DemilestonedIssueEvent_milestone and sets the default values. +func NewDemilestonedIssueEvent_milestone()(*DemilestonedIssueEvent_milestone) { + m := &DemilestonedIssueEvent_milestone{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDemilestonedIssueEvent_milestoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDemilestonedIssueEvent_milestoneFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDemilestonedIssueEvent_milestone(), 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 *DemilestonedIssueEvent_milestone) 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 *DemilestonedIssueEvent_milestone) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *DemilestonedIssueEvent_milestone) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *DemilestonedIssueEvent_milestone) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *DemilestonedIssueEvent_milestone) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTitle sets the title property value. The title property +func (m *DemilestonedIssueEvent_milestone) SetTitle(value *string)() { + m.title = value +} +type DemilestonedIssueEvent_milestoneable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTitle()(*string) + SetTitle(value *string)() +} diff --git a/pkg/github/models/dependabot_alert.go b/pkg/github/models/dependabot_alert.go new file mode 100644 index 00000000..823058ff --- /dev/null +++ b/pkg/github/models/dependabot_alert.go @@ -0,0 +1,398 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlert a Dependabot alert. +type DependabotAlert struct { + // The time that the alert was auto-dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + auto_dismissed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Details for the vulnerable dependency. + dependency DependabotAlert_dependencyable + // The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + dismissed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + dismissed_by NullableSimpleUserable + // An optional comment associated with the alert's dismissal. + dismissed_comment *string + // The reason that the alert was dismissed. + dismissed_reason *DependabotAlert_dismissed_reason + // The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + fixed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The GitHub URL of the alert resource. + html_url *string + // The security alert number. + number *int32 + // Details for the GitHub Security Advisory. + security_advisory DependabotAlertSecurityAdvisoryable + // Details pertaining to one vulnerable version range for the advisory. + security_vulnerability DependabotAlertSecurityVulnerabilityable + // The state of the Dependabot alert. + state *DependabotAlert_state + // The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The REST API URL of the alert resource. + url *string +} +// NewDependabotAlert instantiates a new DependabotAlert and sets the default values. +func NewDependabotAlert()(*DependabotAlert) { + m := &DependabotAlert{ + } + return m +} +// CreateDependabotAlertFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlert(), nil +} +// GetAutoDismissedAt gets the auto_dismissed_at property value. The time that the alert was auto-dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlert) GetAutoDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.auto_dismissed_at +} +// GetCreatedAt gets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlert) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDependency gets the dependency property value. Details for the vulnerable dependency. +// returns a DependabotAlert_dependencyable when successful +func (m *DependabotAlert) GetDependency()(DependabotAlert_dependencyable) { + return m.dependency +} +// GetDismissedAt gets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlert) GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.dismissed_at +} +// GetDismissedBy gets the dismissed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *DependabotAlert) GetDismissedBy()(NullableSimpleUserable) { + return m.dismissed_by +} +// GetDismissedComment gets the dismissed_comment property value. An optional comment associated with the alert's dismissal. +// returns a *string when successful +func (m *DependabotAlert) GetDismissedComment()(*string) { + return m.dismissed_comment +} +// GetDismissedReason gets the dismissed_reason property value. The reason that the alert was dismissed. +// returns a *DependabotAlert_dismissed_reason when successful +func (m *DependabotAlert) GetDismissedReason()(*DependabotAlert_dismissed_reason) { + return m.dismissed_reason +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlert) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["auto_dismissed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetAutoDismissedAt(val) + } + return nil + } + 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["dependency"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlert_dependencyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDependency(val.(DependabotAlert_dependencyable)) + } + return nil + } + res["dismissed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedAt(val) + } + return nil + } + res["dismissed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["dismissed_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedComment(val) + } + return nil + } + res["dismissed_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlert_dismissed_reason) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReason(val.(*DependabotAlert_dismissed_reason)) + } + return nil + } + res["fixed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetFixedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["security_advisory"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertSecurityAdvisoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAdvisory(val.(DependabotAlertSecurityAdvisoryable)) + } + return nil + } + res["security_vulnerability"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertSecurityVulnerabilityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityVulnerability(val.(DependabotAlertSecurityVulnerabilityable)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlert_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*DependabotAlert_state)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFixedAt gets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlert) GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.fixed_at +} +// GetHtmlUrl gets the html_url property value. The GitHub URL of the alert resource. +// returns a *string when successful +func (m *DependabotAlert) GetHtmlUrl()(*string) { + return m.html_url +} +// GetNumber gets the number property value. The security alert number. +// returns a *int32 when successful +func (m *DependabotAlert) GetNumber()(*int32) { + return m.number +} +// GetSecurityAdvisory gets the security_advisory property value. Details for the GitHub Security Advisory. +// returns a DependabotAlertSecurityAdvisoryable when successful +func (m *DependabotAlert) GetSecurityAdvisory()(DependabotAlertSecurityAdvisoryable) { + return m.security_advisory +} +// GetSecurityVulnerability gets the security_vulnerability property value. Details pertaining to one vulnerable version range for the advisory. +// returns a DependabotAlertSecurityVulnerabilityable when successful +func (m *DependabotAlert) GetSecurityVulnerability()(DependabotAlertSecurityVulnerabilityable) { + return m.security_vulnerability +} +// GetState gets the state property value. The state of the Dependabot alert. +// returns a *DependabotAlert_state when successful +func (m *DependabotAlert) GetState()(*DependabotAlert_state) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlert) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The REST API URL of the alert resource. +// returns a *string when successful +func (m *DependabotAlert) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *DependabotAlert) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dismissed_by", m.GetDismissedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dismissed_comment", m.GetDismissedComment()) + if err != nil { + return err + } + } + if m.GetDismissedReason() != nil { + cast := (*m.GetDismissedReason()).String() + err := writer.WriteStringValue("dismissed_reason", &cast) + if err != nil { + return err + } + } + return nil +} +// SetAutoDismissedAt sets the auto_dismissed_at property value. The time that the alert was auto-dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlert) SetAutoDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.auto_dismissed_at = value +} +// SetCreatedAt sets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlert) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDependency sets the dependency property value. Details for the vulnerable dependency. +func (m *DependabotAlert) SetDependency(value DependabotAlert_dependencyable)() { + m.dependency = value +} +// SetDismissedAt sets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlert) SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.dismissed_at = value +} +// SetDismissedBy sets the dismissed_by property value. A GitHub user. +func (m *DependabotAlert) SetDismissedBy(value NullableSimpleUserable)() { + m.dismissed_by = value +} +// SetDismissedComment sets the dismissed_comment property value. An optional comment associated with the alert's dismissal. +func (m *DependabotAlert) SetDismissedComment(value *string)() { + m.dismissed_comment = value +} +// SetDismissedReason sets the dismissed_reason property value. The reason that the alert was dismissed. +func (m *DependabotAlert) SetDismissedReason(value *DependabotAlert_dismissed_reason)() { + m.dismissed_reason = value +} +// SetFixedAt sets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlert) SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.fixed_at = value +} +// SetHtmlUrl sets the html_url property value. The GitHub URL of the alert resource. +func (m *DependabotAlert) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetNumber sets the number property value. The security alert number. +func (m *DependabotAlert) SetNumber(value *int32)() { + m.number = value +} +// SetSecurityAdvisory sets the security_advisory property value. Details for the GitHub Security Advisory. +func (m *DependabotAlert) SetSecurityAdvisory(value DependabotAlertSecurityAdvisoryable)() { + m.security_advisory = value +} +// SetSecurityVulnerability sets the security_vulnerability property value. Details pertaining to one vulnerable version range for the advisory. +func (m *DependabotAlert) SetSecurityVulnerability(value DependabotAlertSecurityVulnerabilityable)() { + m.security_vulnerability = value +} +// SetState sets the state property value. The state of the Dependabot alert. +func (m *DependabotAlert) SetState(value *DependabotAlert_state)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlert) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The REST API URL of the alert resource. +func (m *DependabotAlert) SetUrl(value *string)() { + m.url = value +} +type DependabotAlertable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAutoDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDependency()(DependabotAlert_dependencyable) + GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedBy()(NullableSimpleUserable) + GetDismissedComment()(*string) + GetDismissedReason()(*DependabotAlert_dismissed_reason) + GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetNumber()(*int32) + GetSecurityAdvisory()(DependabotAlertSecurityAdvisoryable) + GetSecurityVulnerability()(DependabotAlertSecurityVulnerabilityable) + GetState()(*DependabotAlert_state) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAutoDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDependency(value DependabotAlert_dependencyable)() + SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedBy(value NullableSimpleUserable)() + SetDismissedComment(value *string)() + SetDismissedReason(value *DependabotAlert_dismissed_reason)() + SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetNumber(value *int32)() + SetSecurityAdvisory(value DependabotAlertSecurityAdvisoryable)() + SetSecurityVulnerability(value DependabotAlertSecurityVulnerabilityable)() + SetState(value *DependabotAlert_state)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/dependabot_alert_escaped_dependency.go b/pkg/github/models/dependabot_alert_escaped_dependency.go new file mode 100644 index 00000000..560bb6f2 --- /dev/null +++ b/pkg/github/models/dependabot_alert_escaped_dependency.go @@ -0,0 +1,121 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlert_dependency details for the vulnerable dependency. +type DependabotAlert_dependency 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 path to the dependency manifest file, relative to the root of the repository. + manifest_path *string + // Details for the vulnerable package. + packageEscaped DependabotAlertPackageable + // The execution scope of the vulnerable dependency. + scope *DependabotAlert_dependency_scope +} +// NewDependabotAlert_dependency instantiates a new DependabotAlert_dependency and sets the default values. +func NewDependabotAlert_dependency()(*DependabotAlert_dependency) { + m := &DependabotAlert_dependency{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependabotAlert_dependencyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlert_dependencyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlert_dependency(), 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 *DependabotAlert_dependency) 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 *DependabotAlert_dependency) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["manifest_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetManifestPath(val) + } + return nil + } + res["package"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertPackageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPackageEscaped(val.(DependabotAlertPackageable)) + } + return nil + } + res["scope"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlert_dependency_scope) + if err != nil { + return err + } + if val != nil { + m.SetScope(val.(*DependabotAlert_dependency_scope)) + } + return nil + } + return res +} +// GetManifestPath gets the manifest_path property value. The full path to the dependency manifest file, relative to the root of the repository. +// returns a *string when successful +func (m *DependabotAlert_dependency) GetManifestPath()(*string) { + return m.manifest_path +} +// GetPackageEscaped gets the package property value. Details for the vulnerable package. +// returns a DependabotAlertPackageable when successful +func (m *DependabotAlert_dependency) GetPackageEscaped()(DependabotAlertPackageable) { + return m.packageEscaped +} +// GetScope gets the scope property value. The execution scope of the vulnerable dependency. +// returns a *DependabotAlert_dependency_scope when successful +func (m *DependabotAlert_dependency) GetScope()(*DependabotAlert_dependency_scope) { + return m.scope +} +// Serialize serializes information the current object +func (m *DependabotAlert_dependency) 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 *DependabotAlert_dependency) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetManifestPath sets the manifest_path property value. The full path to the dependency manifest file, relative to the root of the repository. +func (m *DependabotAlert_dependency) SetManifestPath(value *string)() { + m.manifest_path = value +} +// SetPackageEscaped sets the package property value. Details for the vulnerable package. +func (m *DependabotAlert_dependency) SetPackageEscaped(value DependabotAlertPackageable)() { + m.packageEscaped = value +} +// SetScope sets the scope property value. The execution scope of the vulnerable dependency. +func (m *DependabotAlert_dependency) SetScope(value *DependabotAlert_dependency_scope)() { + m.scope = value +} +type DependabotAlert_dependencyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetManifestPath()(*string) + GetPackageEscaped()(DependabotAlertPackageable) + GetScope()(*DependabotAlert_dependency_scope) + SetManifestPath(value *string)() + SetPackageEscaped(value DependabotAlertPackageable)() + SetScope(value *DependabotAlert_dependency_scope)() +} diff --git a/pkg/github/models/dependabot_alert_escaped_dependency_escaped_scope.go b/pkg/github/models/dependabot_alert_escaped_dependency_escaped_scope.go new file mode 100644 index 00000000..3d1d843e --- /dev/null +++ b/pkg/github/models/dependabot_alert_escaped_dependency_escaped_scope.go @@ -0,0 +1,34 @@ +package models +// The execution scope of the vulnerable dependency. +type DependabotAlert_dependency_scope int + +const ( + DEVELOPMENT_DEPENDABOTALERT_DEPENDENCY_SCOPE DependabotAlert_dependency_scope = iota + RUNTIME_DEPENDABOTALERT_DEPENDENCY_SCOPE +) + +func (i DependabotAlert_dependency_scope) String() string { + return []string{"development", "runtime"}[i] +} +func ParseDependabotAlert_dependency_scope(v string) (any, error) { + result := DEVELOPMENT_DEPENDABOTALERT_DEPENDENCY_SCOPE + switch v { + case "development": + result = DEVELOPMENT_DEPENDABOTALERT_DEPENDENCY_SCOPE + case "runtime": + result = RUNTIME_DEPENDABOTALERT_DEPENDENCY_SCOPE + default: + return nil, nil + } + return &result, nil +} +func SerializeDependabotAlert_dependency_scope(values []DependabotAlert_dependency_scope) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlert_dependency_scope) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/dependabot_alert_escaped_dismissed_escaped_reason.go b/pkg/github/models/dependabot_alert_escaped_dismissed_escaped_reason.go new file mode 100644 index 00000000..51ac021b --- /dev/null +++ b/pkg/github/models/dependabot_alert_escaped_dismissed_escaped_reason.go @@ -0,0 +1,43 @@ +package models +// The reason that the alert was dismissed. +type DependabotAlert_dismissed_reason int + +const ( + FIX_STARTED_DEPENDABOTALERT_DISMISSED_REASON DependabotAlert_dismissed_reason = iota + INACCURATE_DEPENDABOTALERT_DISMISSED_REASON + NO_BANDWIDTH_DEPENDABOTALERT_DISMISSED_REASON + NOT_USED_DEPENDABOTALERT_DISMISSED_REASON + TOLERABLE_RISK_DEPENDABOTALERT_DISMISSED_REASON +) + +func (i DependabotAlert_dismissed_reason) String() string { + return []string{"fix_started", "inaccurate", "no_bandwidth", "not_used", "tolerable_risk"}[i] +} +func ParseDependabotAlert_dismissed_reason(v string) (any, error) { + result := FIX_STARTED_DEPENDABOTALERT_DISMISSED_REASON + switch v { + case "fix_started": + result = FIX_STARTED_DEPENDABOTALERT_DISMISSED_REASON + case "inaccurate": + result = INACCURATE_DEPENDABOTALERT_DISMISSED_REASON + case "no_bandwidth": + result = NO_BANDWIDTH_DEPENDABOTALERT_DISMISSED_REASON + case "not_used": + result = NOT_USED_DEPENDABOTALERT_DISMISSED_REASON + case "tolerable_risk": + result = TOLERABLE_RISK_DEPENDABOTALERT_DISMISSED_REASON + default: + return nil, nil + } + return &result, nil +} +func SerializeDependabotAlert_dismissed_reason(values []DependabotAlert_dismissed_reason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlert_dismissed_reason) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/dependabot_alert_escaped_state.go b/pkg/github/models/dependabot_alert_escaped_state.go new file mode 100644 index 00000000..9ab24c9c --- /dev/null +++ b/pkg/github/models/dependabot_alert_escaped_state.go @@ -0,0 +1,40 @@ +package models +// The state of the Dependabot alert. +type DependabotAlert_state int + +const ( + AUTO_DISMISSED_DEPENDABOTALERT_STATE DependabotAlert_state = iota + DISMISSED_DEPENDABOTALERT_STATE + FIXED_DEPENDABOTALERT_STATE + OPEN_DEPENDABOTALERT_STATE +) + +func (i DependabotAlert_state) String() string { + return []string{"auto_dismissed", "dismissed", "fixed", "open"}[i] +} +func ParseDependabotAlert_state(v string) (any, error) { + result := AUTO_DISMISSED_DEPENDABOTALERT_STATE + switch v { + case "auto_dismissed": + result = AUTO_DISMISSED_DEPENDABOTALERT_STATE + case "dismissed": + result = DISMISSED_DEPENDABOTALERT_STATE + case "fixed": + result = FIXED_DEPENDABOTALERT_STATE + case "open": + result = OPEN_DEPENDABOTALERT_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeDependabotAlert_state(values []DependabotAlert_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlert_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/dependabot_alert_package.go b/pkg/github/models/dependabot_alert_package.go new file mode 100644 index 00000000..f142485e --- /dev/null +++ b/pkg/github/models/dependabot_alert_package.go @@ -0,0 +1,79 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertPackage details for the vulnerable package. +type DependabotAlertPackage struct { + // The package's language or package management ecosystem. + ecosystem *string + // The unique package name within its ecosystem. + name *string +} +// NewDependabotAlertPackage instantiates a new DependabotAlertPackage and sets the default values. +func NewDependabotAlertPackage()(*DependabotAlertPackage) { + m := &DependabotAlertPackage{ + } + return m +} +// CreateDependabotAlertPackageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertPackageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertPackage(), nil +} +// GetEcosystem gets the ecosystem property value. The package's language or package management ecosystem. +// returns a *string when successful +func (m *DependabotAlertPackage) GetEcosystem()(*string) { + return m.ecosystem +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertPackage) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ecosystem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEcosystem(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 unique package name within its ecosystem. +// returns a *string when successful +func (m *DependabotAlertPackage) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *DependabotAlertPackage) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetEcosystem sets the ecosystem property value. The package's language or package management ecosystem. +func (m *DependabotAlertPackage) SetEcosystem(value *string)() { + m.ecosystem = value +} +// SetName sets the name property value. The unique package name within its ecosystem. +func (m *DependabotAlertPackage) SetName(value *string)() { + m.name = value +} +type DependabotAlertPackageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEcosystem()(*string) + GetName()(*string) + SetEcosystem(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/dependabot_alert_security_advisory.go b/pkg/github/models/dependabot_alert_security_advisory.go new file mode 100644 index 00000000..0c62becb --- /dev/null +++ b/pkg/github/models/dependabot_alert_security_advisory.go @@ -0,0 +1,386 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertSecurityAdvisory details for the GitHub Security Advisory. +type DependabotAlertSecurityAdvisory struct { + // The unique CVE ID assigned to the advisory. + cve_id *string + // Details for the advisory pertaining to the Common Vulnerability Scoring System. + cvss DependabotAlertSecurityAdvisory_cvssable + // The cvss_severities property + cvss_severities CvssSeveritiesable + // Details for the advisory pertaining to Common Weakness Enumeration. + cwes []DependabotAlertSecurityAdvisory_cwesable + // A long-form Markdown-supported description of the advisory. + description *string + // The unique GitHub Security Advisory ID assigned to the advisory. + ghsa_id *string + // Values that identify this advisory among security information sources. + identifiers []DependabotAlertSecurityAdvisory_identifiersable + // The time that the advisory was published in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + published_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Links to additional advisory information. + references []DependabotAlertSecurityAdvisory_referencesable + // The severity of the advisory. + severity *DependabotAlertSecurityAdvisory_severity + // A short, plain text summary of the advisory. + summary *string + // The time that the advisory was last modified in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Vulnerable version range information for the advisory. + vulnerabilities []DependabotAlertSecurityVulnerabilityable + // The time that the advisory was withdrawn in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + withdrawn_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewDependabotAlertSecurityAdvisory instantiates a new DependabotAlertSecurityAdvisory and sets the default values. +func NewDependabotAlertSecurityAdvisory()(*DependabotAlertSecurityAdvisory) { + m := &DependabotAlertSecurityAdvisory{ + } + return m +} +// CreateDependabotAlertSecurityAdvisoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertSecurityAdvisoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertSecurityAdvisory(), nil +} +// GetCveId gets the cve_id property value. The unique CVE ID assigned to the advisory. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory) GetCveId()(*string) { + return m.cve_id +} +// GetCvss gets the cvss property value. Details for the advisory pertaining to the Common Vulnerability Scoring System. +// returns a DependabotAlertSecurityAdvisory_cvssable when successful +func (m *DependabotAlertSecurityAdvisory) GetCvss()(DependabotAlertSecurityAdvisory_cvssable) { + return m.cvss +} +// GetCvssSeverities gets the cvss_severities property value. The cvss_severities property +// returns a CvssSeveritiesable when successful +func (m *DependabotAlertSecurityAdvisory) GetCvssSeverities()(CvssSeveritiesable) { + return m.cvss_severities +} +// GetCwes gets the cwes property value. Details for the advisory pertaining to Common Weakness Enumeration. +// returns a []DependabotAlertSecurityAdvisory_cwesable when successful +func (m *DependabotAlertSecurityAdvisory) GetCwes()([]DependabotAlertSecurityAdvisory_cwesable) { + return m.cwes +} +// GetDescription gets the description property value. A long-form Markdown-supported description of the advisory. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory) 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 *DependabotAlertSecurityAdvisory) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cve_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCveId(val) + } + return nil + } + res["cvss"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertSecurityAdvisory_cvssFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCvss(val.(DependabotAlertSecurityAdvisory_cvssable)) + } + return nil + } + res["cvss_severities"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCvssSeveritiesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCvssSeverities(val.(CvssSeveritiesable)) + } + return nil + } + res["cwes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDependabotAlertSecurityAdvisory_cwesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DependabotAlertSecurityAdvisory_cwesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DependabotAlertSecurityAdvisory_cwesable) + } + } + m.SetCwes(res) + } + 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["ghsa_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGhsaId(val) + } + return nil + } + res["identifiers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDependabotAlertSecurityAdvisory_identifiersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DependabotAlertSecurityAdvisory_identifiersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DependabotAlertSecurityAdvisory_identifiersable) + } + } + m.SetIdentifiers(res) + } + return nil + } + res["published_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPublishedAt(val) + } + return nil + } + res["references"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDependabotAlertSecurityAdvisory_referencesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DependabotAlertSecurityAdvisory_referencesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DependabotAlertSecurityAdvisory_referencesable) + } + } + m.SetReferences(res) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlertSecurityAdvisory_severity) + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val.(*DependabotAlertSecurityAdvisory_severity)) + } + return nil + } + res["summary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSummary(val) + } + 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["vulnerabilities"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDependabotAlertSecurityVulnerabilityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DependabotAlertSecurityVulnerabilityable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DependabotAlertSecurityVulnerabilityable) + } + } + m.SetVulnerabilities(res) + } + return nil + } + res["withdrawn_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetWithdrawnAt(val) + } + return nil + } + return res +} +// GetGhsaId gets the ghsa_id property value. The unique GitHub Security Advisory ID assigned to the advisory. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory) GetGhsaId()(*string) { + return m.ghsa_id +} +// GetIdentifiers gets the identifiers property value. Values that identify this advisory among security information sources. +// returns a []DependabotAlertSecurityAdvisory_identifiersable when successful +func (m *DependabotAlertSecurityAdvisory) GetIdentifiers()([]DependabotAlertSecurityAdvisory_identifiersable) { + return m.identifiers +} +// GetPublishedAt gets the published_at property value. The time that the advisory was published in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertSecurityAdvisory) GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.published_at +} +// GetReferences gets the references property value. Links to additional advisory information. +// returns a []DependabotAlertSecurityAdvisory_referencesable when successful +func (m *DependabotAlertSecurityAdvisory) GetReferences()([]DependabotAlertSecurityAdvisory_referencesable) { + return m.references +} +// GetSeverity gets the severity property value. The severity of the advisory. +// returns a *DependabotAlertSecurityAdvisory_severity when successful +func (m *DependabotAlertSecurityAdvisory) GetSeverity()(*DependabotAlertSecurityAdvisory_severity) { + return m.severity +} +// GetSummary gets the summary property value. A short, plain text summary of the advisory. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory) GetSummary()(*string) { + return m.summary +} +// GetUpdatedAt gets the updated_at property value. The time that the advisory was last modified in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertSecurityAdvisory) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetVulnerabilities gets the vulnerabilities property value. Vulnerable version range information for the advisory. +// returns a []DependabotAlertSecurityVulnerabilityable when successful +func (m *DependabotAlertSecurityAdvisory) GetVulnerabilities()([]DependabotAlertSecurityVulnerabilityable) { + return m.vulnerabilities +} +// GetWithdrawnAt gets the withdrawn_at property value. The time that the advisory was withdrawn in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertSecurityAdvisory) GetWithdrawnAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.withdrawn_at +} +// Serialize serializes information the current object +func (m *DependabotAlertSecurityAdvisory) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("cvss_severities", m.GetCvssSeverities()) + if err != nil { + return err + } + } + return nil +} +// SetCveId sets the cve_id property value. The unique CVE ID assigned to the advisory. +func (m *DependabotAlertSecurityAdvisory) SetCveId(value *string)() { + m.cve_id = value +} +// SetCvss sets the cvss property value. Details for the advisory pertaining to the Common Vulnerability Scoring System. +func (m *DependabotAlertSecurityAdvisory) SetCvss(value DependabotAlertSecurityAdvisory_cvssable)() { + m.cvss = value +} +// SetCvssSeverities sets the cvss_severities property value. The cvss_severities property +func (m *DependabotAlertSecurityAdvisory) SetCvssSeverities(value CvssSeveritiesable)() { + m.cvss_severities = value +} +// SetCwes sets the cwes property value. Details for the advisory pertaining to Common Weakness Enumeration. +func (m *DependabotAlertSecurityAdvisory) SetCwes(value []DependabotAlertSecurityAdvisory_cwesable)() { + m.cwes = value +} +// SetDescription sets the description property value. A long-form Markdown-supported description of the advisory. +func (m *DependabotAlertSecurityAdvisory) SetDescription(value *string)() { + m.description = value +} +// SetGhsaId sets the ghsa_id property value. The unique GitHub Security Advisory ID assigned to the advisory. +func (m *DependabotAlertSecurityAdvisory) SetGhsaId(value *string)() { + m.ghsa_id = value +} +// SetIdentifiers sets the identifiers property value. Values that identify this advisory among security information sources. +func (m *DependabotAlertSecurityAdvisory) SetIdentifiers(value []DependabotAlertSecurityAdvisory_identifiersable)() { + m.identifiers = value +} +// SetPublishedAt sets the published_at property value. The time that the advisory was published in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertSecurityAdvisory) SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.published_at = value +} +// SetReferences sets the references property value. Links to additional advisory information. +func (m *DependabotAlertSecurityAdvisory) SetReferences(value []DependabotAlertSecurityAdvisory_referencesable)() { + m.references = value +} +// SetSeverity sets the severity property value. The severity of the advisory. +func (m *DependabotAlertSecurityAdvisory) SetSeverity(value *DependabotAlertSecurityAdvisory_severity)() { + m.severity = value +} +// SetSummary sets the summary property value. A short, plain text summary of the advisory. +func (m *DependabotAlertSecurityAdvisory) SetSummary(value *string)() { + m.summary = value +} +// SetUpdatedAt sets the updated_at property value. The time that the advisory was last modified in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertSecurityAdvisory) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetVulnerabilities sets the vulnerabilities property value. Vulnerable version range information for the advisory. +func (m *DependabotAlertSecurityAdvisory) SetVulnerabilities(value []DependabotAlertSecurityVulnerabilityable)() { + m.vulnerabilities = value +} +// SetWithdrawnAt sets the withdrawn_at property value. The time that the advisory was withdrawn in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertSecurityAdvisory) SetWithdrawnAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.withdrawn_at = value +} +type DependabotAlertSecurityAdvisoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCveId()(*string) + GetCvss()(DependabotAlertSecurityAdvisory_cvssable) + GetCvssSeverities()(CvssSeveritiesable) + GetCwes()([]DependabotAlertSecurityAdvisory_cwesable) + GetDescription()(*string) + GetGhsaId()(*string) + GetIdentifiers()([]DependabotAlertSecurityAdvisory_identifiersable) + GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReferences()([]DependabotAlertSecurityAdvisory_referencesable) + GetSeverity()(*DependabotAlertSecurityAdvisory_severity) + GetSummary()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetVulnerabilities()([]DependabotAlertSecurityVulnerabilityable) + GetWithdrawnAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCveId(value *string)() + SetCvss(value DependabotAlertSecurityAdvisory_cvssable)() + SetCvssSeverities(value CvssSeveritiesable)() + SetCwes(value []DependabotAlertSecurityAdvisory_cwesable)() + SetDescription(value *string)() + SetGhsaId(value *string)() + SetIdentifiers(value []DependabotAlertSecurityAdvisory_identifiersable)() + SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReferences(value []DependabotAlertSecurityAdvisory_referencesable)() + SetSeverity(value *DependabotAlertSecurityAdvisory_severity)() + SetSummary(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetVulnerabilities(value []DependabotAlertSecurityVulnerabilityable)() + SetWithdrawnAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/dependabot_alert_security_advisory_escaped_cvss.go b/pkg/github/models/dependabot_alert_security_advisory_escaped_cvss.go new file mode 100644 index 00000000..61ad5b93 --- /dev/null +++ b/pkg/github/models/dependabot_alert_security_advisory_escaped_cvss.go @@ -0,0 +1,79 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertSecurityAdvisory_cvss details for the advisory pertaining to the Common Vulnerability Scoring System. +type DependabotAlertSecurityAdvisory_cvss struct { + // The overall CVSS score of the advisory. + score *float64 + // The full CVSS vector string for the advisory. + vector_string *string +} +// NewDependabotAlertSecurityAdvisory_cvss instantiates a new DependabotAlertSecurityAdvisory_cvss and sets the default values. +func NewDependabotAlertSecurityAdvisory_cvss()(*DependabotAlertSecurityAdvisory_cvss) { + m := &DependabotAlertSecurityAdvisory_cvss{ + } + return m +} +// CreateDependabotAlertSecurityAdvisory_cvssFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertSecurityAdvisory_cvssFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertSecurityAdvisory_cvss(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertSecurityAdvisory_cvss) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["vector_string"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVectorString(val) + } + return nil + } + return res +} +// GetScore gets the score property value. The overall CVSS score of the advisory. +// returns a *float64 when successful +func (m *DependabotAlertSecurityAdvisory_cvss) GetScore()(*float64) { + return m.score +} +// GetVectorString gets the vector_string property value. The full CVSS vector string for the advisory. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory_cvss) GetVectorString()(*string) { + return m.vector_string +} +// Serialize serializes information the current object +func (m *DependabotAlertSecurityAdvisory_cvss) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetScore sets the score property value. The overall CVSS score of the advisory. +func (m *DependabotAlertSecurityAdvisory_cvss) SetScore(value *float64)() { + m.score = value +} +// SetVectorString sets the vector_string property value. The full CVSS vector string for the advisory. +func (m *DependabotAlertSecurityAdvisory_cvss) SetVectorString(value *string)() { + m.vector_string = value +} +type DependabotAlertSecurityAdvisory_cvssable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetScore()(*float64) + GetVectorString()(*string) + SetScore(value *float64)() + SetVectorString(value *string)() +} diff --git a/pkg/github/models/dependabot_alert_security_advisory_escaped_cwes.go b/pkg/github/models/dependabot_alert_security_advisory_escaped_cwes.go new file mode 100644 index 00000000..27e24d10 --- /dev/null +++ b/pkg/github/models/dependabot_alert_security_advisory_escaped_cwes.go @@ -0,0 +1,79 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertSecurityAdvisory_cwes a CWE weakness assigned to the advisory. +type DependabotAlertSecurityAdvisory_cwes struct { + // The unique CWE ID. + cwe_id *string + // The short, plain text name of the CWE. + name *string +} +// NewDependabotAlertSecurityAdvisory_cwes instantiates a new DependabotAlertSecurityAdvisory_cwes and sets the default values. +func NewDependabotAlertSecurityAdvisory_cwes()(*DependabotAlertSecurityAdvisory_cwes) { + m := &DependabotAlertSecurityAdvisory_cwes{ + } + return m +} +// CreateDependabotAlertSecurityAdvisory_cwesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertSecurityAdvisory_cwesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertSecurityAdvisory_cwes(), nil +} +// GetCweId gets the cwe_id property value. The unique CWE ID. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory_cwes) GetCweId()(*string) { + return m.cwe_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertSecurityAdvisory_cwes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cwe_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCweId(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 short, plain text name of the CWE. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory_cwes) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *DependabotAlertSecurityAdvisory_cwes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetCweId sets the cwe_id property value. The unique CWE ID. +func (m *DependabotAlertSecurityAdvisory_cwes) SetCweId(value *string)() { + m.cwe_id = value +} +// SetName sets the name property value. The short, plain text name of the CWE. +func (m *DependabotAlertSecurityAdvisory_cwes) SetName(value *string)() { + m.name = value +} +type DependabotAlertSecurityAdvisory_cwesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCweId()(*string) + GetName()(*string) + SetCweId(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/dependabot_alert_security_advisory_escaped_identifiers.go b/pkg/github/models/dependabot_alert_security_advisory_escaped_identifiers.go new file mode 100644 index 00000000..35b54af1 --- /dev/null +++ b/pkg/github/models/dependabot_alert_security_advisory_escaped_identifiers.go @@ -0,0 +1,79 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertSecurityAdvisory_identifiers an advisory identifier. +type DependabotAlertSecurityAdvisory_identifiers struct { + // The type of advisory identifier. + typeEscaped *DependabotAlertSecurityAdvisory_identifiers_type + // The value of the advisory identifer. + value *string +} +// NewDependabotAlertSecurityAdvisory_identifiers instantiates a new DependabotAlertSecurityAdvisory_identifiers and sets the default values. +func NewDependabotAlertSecurityAdvisory_identifiers()(*DependabotAlertSecurityAdvisory_identifiers) { + m := &DependabotAlertSecurityAdvisory_identifiers{ + } + return m +} +// CreateDependabotAlertSecurityAdvisory_identifiersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertSecurityAdvisory_identifiersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertSecurityAdvisory_identifiers(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertSecurityAdvisory_identifiers) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlertSecurityAdvisory_identifiers_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*DependabotAlertSecurityAdvisory_identifiers_type)) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type of advisory identifier. +// returns a *DependabotAlertSecurityAdvisory_identifiers_type when successful +func (m *DependabotAlertSecurityAdvisory_identifiers) GetTypeEscaped()(*DependabotAlertSecurityAdvisory_identifiers_type) { + return m.typeEscaped +} +// GetValue gets the value property value. The value of the advisory identifer. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory_identifiers) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *DependabotAlertSecurityAdvisory_identifiers) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetTypeEscaped sets the type property value. The type of advisory identifier. +func (m *DependabotAlertSecurityAdvisory_identifiers) SetTypeEscaped(value *DependabotAlertSecurityAdvisory_identifiers_type)() { + m.typeEscaped = value +} +// SetValue sets the value property value. The value of the advisory identifer. +func (m *DependabotAlertSecurityAdvisory_identifiers) SetValue(value *string)() { + m.value = value +} +type DependabotAlertSecurityAdvisory_identifiersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*DependabotAlertSecurityAdvisory_identifiers_type) + GetValue()(*string) + SetTypeEscaped(value *DependabotAlertSecurityAdvisory_identifiers_type)() + SetValue(value *string)() +} diff --git a/pkg/github/models/dependabot_alert_security_advisory_escaped_identifiers_escaped_type.go b/pkg/github/models/dependabot_alert_security_advisory_escaped_identifiers_escaped_type.go new file mode 100644 index 00000000..26a321bf --- /dev/null +++ b/pkg/github/models/dependabot_alert_security_advisory_escaped_identifiers_escaped_type.go @@ -0,0 +1,34 @@ +package models +// The type of advisory identifier. +type DependabotAlertSecurityAdvisory_identifiers_type int + +const ( + CVE_DEPENDABOTALERTSECURITYADVISORY_IDENTIFIERS_TYPE DependabotAlertSecurityAdvisory_identifiers_type = iota + GHSA_DEPENDABOTALERTSECURITYADVISORY_IDENTIFIERS_TYPE +) + +func (i DependabotAlertSecurityAdvisory_identifiers_type) String() string { + return []string{"CVE", "GHSA"}[i] +} +func ParseDependabotAlertSecurityAdvisory_identifiers_type(v string) (any, error) { + result := CVE_DEPENDABOTALERTSECURITYADVISORY_IDENTIFIERS_TYPE + switch v { + case "CVE": + result = CVE_DEPENDABOTALERTSECURITYADVISORY_IDENTIFIERS_TYPE + case "GHSA": + result = GHSA_DEPENDABOTALERTSECURITYADVISORY_IDENTIFIERS_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeDependabotAlertSecurityAdvisory_identifiers_type(values []DependabotAlertSecurityAdvisory_identifiers_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlertSecurityAdvisory_identifiers_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/dependabot_alert_security_advisory_escaped_references.go b/pkg/github/models/dependabot_alert_security_advisory_escaped_references.go new file mode 100644 index 00000000..52113307 --- /dev/null +++ b/pkg/github/models/dependabot_alert_security_advisory_escaped_references.go @@ -0,0 +1,56 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertSecurityAdvisory_references a link to additional advisory information. +type DependabotAlertSecurityAdvisory_references struct { + // The URL of the reference. + url *string +} +// NewDependabotAlertSecurityAdvisory_references instantiates a new DependabotAlertSecurityAdvisory_references and sets the default values. +func NewDependabotAlertSecurityAdvisory_references()(*DependabotAlertSecurityAdvisory_references) { + m := &DependabotAlertSecurityAdvisory_references{ + } + return m +} +// CreateDependabotAlertSecurityAdvisory_referencesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertSecurityAdvisory_referencesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertSecurityAdvisory_references(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertSecurityAdvisory_references) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The URL of the reference. +// returns a *string when successful +func (m *DependabotAlertSecurityAdvisory_references) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *DependabotAlertSecurityAdvisory_references) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetUrl sets the url property value. The URL of the reference. +func (m *DependabotAlertSecurityAdvisory_references) SetUrl(value *string)() { + m.url = value +} +type DependabotAlertSecurityAdvisory_referencesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetUrl()(*string) + SetUrl(value *string)() +} diff --git a/pkg/github/models/dependabot_alert_security_advisory_escaped_severity.go b/pkg/github/models/dependabot_alert_security_advisory_escaped_severity.go new file mode 100644 index 00000000..4be82d6a --- /dev/null +++ b/pkg/github/models/dependabot_alert_security_advisory_escaped_severity.go @@ -0,0 +1,40 @@ +package models +// The severity of the advisory. +type DependabotAlertSecurityAdvisory_severity int + +const ( + LOW_DEPENDABOTALERTSECURITYADVISORY_SEVERITY DependabotAlertSecurityAdvisory_severity = iota + MEDIUM_DEPENDABOTALERTSECURITYADVISORY_SEVERITY + HIGH_DEPENDABOTALERTSECURITYADVISORY_SEVERITY + CRITICAL_DEPENDABOTALERTSECURITYADVISORY_SEVERITY +) + +func (i DependabotAlertSecurityAdvisory_severity) String() string { + return []string{"low", "medium", "high", "critical"}[i] +} +func ParseDependabotAlertSecurityAdvisory_severity(v string) (any, error) { + result := LOW_DEPENDABOTALERTSECURITYADVISORY_SEVERITY + switch v { + case "low": + result = LOW_DEPENDABOTALERTSECURITYADVISORY_SEVERITY + case "medium": + result = MEDIUM_DEPENDABOTALERTSECURITYADVISORY_SEVERITY + case "high": + result = HIGH_DEPENDABOTALERTSECURITYADVISORY_SEVERITY + case "critical": + result = CRITICAL_DEPENDABOTALERTSECURITYADVISORY_SEVERITY + default: + return nil, nil + } + return &result, nil +} +func SerializeDependabotAlertSecurityAdvisory_severity(values []DependabotAlertSecurityAdvisory_severity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlertSecurityAdvisory_severity) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/dependabot_alert_security_vulnerability.go b/pkg/github/models/dependabot_alert_security_vulnerability.go new file mode 100644 index 00000000..310fad1d --- /dev/null +++ b/pkg/github/models/dependabot_alert_security_vulnerability.go @@ -0,0 +1,125 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertSecurityVulnerability details pertaining to one vulnerable version range for the advisory. +type DependabotAlertSecurityVulnerability struct { + // Details pertaining to the package version that patches this vulnerability. + first_patched_version DependabotAlertSecurityVulnerability_first_patched_versionable + // Details for the vulnerable package. + packageEscaped DependabotAlertPackageable + // The severity of the vulnerability. + severity *DependabotAlertSecurityVulnerability_severity + // Conditions that identify vulnerable versions of this vulnerability's package. + vulnerable_version_range *string +} +// NewDependabotAlertSecurityVulnerability instantiates a new DependabotAlertSecurityVulnerability and sets the default values. +func NewDependabotAlertSecurityVulnerability()(*DependabotAlertSecurityVulnerability) { + m := &DependabotAlertSecurityVulnerability{ + } + return m +} +// CreateDependabotAlertSecurityVulnerabilityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertSecurityVulnerabilityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertSecurityVulnerability(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertSecurityVulnerability) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["first_patched_version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertSecurityVulnerability_first_patched_versionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetFirstPatchedVersion(val.(DependabotAlertSecurityVulnerability_first_patched_versionable)) + } + return nil + } + res["package"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertPackageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPackageEscaped(val.(DependabotAlertPackageable)) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlertSecurityVulnerability_severity) + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val.(*DependabotAlertSecurityVulnerability_severity)) + } + return nil + } + res["vulnerable_version_range"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVulnerableVersionRange(val) + } + return nil + } + return res +} +// GetFirstPatchedVersion gets the first_patched_version property value. Details pertaining to the package version that patches this vulnerability. +// returns a DependabotAlertSecurityVulnerability_first_patched_versionable when successful +func (m *DependabotAlertSecurityVulnerability) GetFirstPatchedVersion()(DependabotAlertSecurityVulnerability_first_patched_versionable) { + return m.first_patched_version +} +// GetPackageEscaped gets the package property value. Details for the vulnerable package. +// returns a DependabotAlertPackageable when successful +func (m *DependabotAlertSecurityVulnerability) GetPackageEscaped()(DependabotAlertPackageable) { + return m.packageEscaped +} +// GetSeverity gets the severity property value. The severity of the vulnerability. +// returns a *DependabotAlertSecurityVulnerability_severity when successful +func (m *DependabotAlertSecurityVulnerability) GetSeverity()(*DependabotAlertSecurityVulnerability_severity) { + return m.severity +} +// GetVulnerableVersionRange gets the vulnerable_version_range property value. Conditions that identify vulnerable versions of this vulnerability's package. +// returns a *string when successful +func (m *DependabotAlertSecurityVulnerability) GetVulnerableVersionRange()(*string) { + return m.vulnerable_version_range +} +// Serialize serializes information the current object +func (m *DependabotAlertSecurityVulnerability) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetFirstPatchedVersion sets the first_patched_version property value. Details pertaining to the package version that patches this vulnerability. +func (m *DependabotAlertSecurityVulnerability) SetFirstPatchedVersion(value DependabotAlertSecurityVulnerability_first_patched_versionable)() { + m.first_patched_version = value +} +// SetPackageEscaped sets the package property value. Details for the vulnerable package. +func (m *DependabotAlertSecurityVulnerability) SetPackageEscaped(value DependabotAlertPackageable)() { + m.packageEscaped = value +} +// SetSeverity sets the severity property value. The severity of the vulnerability. +func (m *DependabotAlertSecurityVulnerability) SetSeverity(value *DependabotAlertSecurityVulnerability_severity)() { + m.severity = value +} +// SetVulnerableVersionRange sets the vulnerable_version_range property value. Conditions that identify vulnerable versions of this vulnerability's package. +func (m *DependabotAlertSecurityVulnerability) SetVulnerableVersionRange(value *string)() { + m.vulnerable_version_range = value +} +type DependabotAlertSecurityVulnerabilityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFirstPatchedVersion()(DependabotAlertSecurityVulnerability_first_patched_versionable) + GetPackageEscaped()(DependabotAlertPackageable) + GetSeverity()(*DependabotAlertSecurityVulnerability_severity) + GetVulnerableVersionRange()(*string) + SetFirstPatchedVersion(value DependabotAlertSecurityVulnerability_first_patched_versionable)() + SetPackageEscaped(value DependabotAlertPackageable)() + SetSeverity(value *DependabotAlertSecurityVulnerability_severity)() + SetVulnerableVersionRange(value *string)() +} diff --git a/pkg/github/models/dependabot_alert_security_vulnerability_escaped_first_escaped_patched_escaped_version.go b/pkg/github/models/dependabot_alert_security_vulnerability_escaped_first_escaped_patched_escaped_version.go new file mode 100644 index 00000000..bd96c084 --- /dev/null +++ b/pkg/github/models/dependabot_alert_security_vulnerability_escaped_first_escaped_patched_escaped_version.go @@ -0,0 +1,56 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertSecurityVulnerability_first_patched_version details pertaining to the package version that patches this vulnerability. +type DependabotAlertSecurityVulnerability_first_patched_version struct { + // The package version that patches this vulnerability. + identifier *string +} +// NewDependabotAlertSecurityVulnerability_first_patched_version instantiates a new DependabotAlertSecurityVulnerability_first_patched_version and sets the default values. +func NewDependabotAlertSecurityVulnerability_first_patched_version()(*DependabotAlertSecurityVulnerability_first_patched_version) { + m := &DependabotAlertSecurityVulnerability_first_patched_version{ + } + return m +} +// CreateDependabotAlertSecurityVulnerability_first_patched_versionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertSecurityVulnerability_first_patched_versionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertSecurityVulnerability_first_patched_version(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertSecurityVulnerability_first_patched_version) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["identifier"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIdentifier(val) + } + return nil + } + return res +} +// GetIdentifier gets the identifier property value. The package version that patches this vulnerability. +// returns a *string when successful +func (m *DependabotAlertSecurityVulnerability_first_patched_version) GetIdentifier()(*string) { + return m.identifier +} +// Serialize serializes information the current object +func (m *DependabotAlertSecurityVulnerability_first_patched_version) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +// SetIdentifier sets the identifier property value. The package version that patches this vulnerability. +func (m *DependabotAlertSecurityVulnerability_first_patched_version) SetIdentifier(value *string)() { + m.identifier = value +} +type DependabotAlertSecurityVulnerability_first_patched_versionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIdentifier()(*string) + SetIdentifier(value *string)() +} diff --git a/pkg/github/models/dependabot_alert_security_vulnerability_escaped_severity.go b/pkg/github/models/dependabot_alert_security_vulnerability_escaped_severity.go new file mode 100644 index 00000000..4f97da91 --- /dev/null +++ b/pkg/github/models/dependabot_alert_security_vulnerability_escaped_severity.go @@ -0,0 +1,40 @@ +package models +// The severity of the vulnerability. +type DependabotAlertSecurityVulnerability_severity int + +const ( + LOW_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY DependabotAlertSecurityVulnerability_severity = iota + MEDIUM_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY + HIGH_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY + CRITICAL_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY +) + +func (i DependabotAlertSecurityVulnerability_severity) String() string { + return []string{"low", "medium", "high", "critical"}[i] +} +func ParseDependabotAlertSecurityVulnerability_severity(v string) (any, error) { + result := LOW_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY + switch v { + case "low": + result = LOW_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY + case "medium": + result = MEDIUM_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY + case "high": + result = HIGH_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY + case "critical": + result = CRITICAL_DEPENDABOTALERTSECURITYVULNERABILITY_SEVERITY + default: + return nil, nil + } + return &result, nil +} +func SerializeDependabotAlertSecurityVulnerability_severity(values []DependabotAlertSecurityVulnerability_severity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlertSecurityVulnerability_severity) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/dependabot_alert_with_repository.go b/pkg/github/models/dependabot_alert_with_repository.go new file mode 100644 index 00000000..15d61503 --- /dev/null +++ b/pkg/github/models/dependabot_alert_with_repository.go @@ -0,0 +1,427 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertWithRepository a Dependabot alert. +type DependabotAlertWithRepository struct { + // The time that the alert was auto-dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + auto_dismissed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Details for the vulnerable dependency. + dependency DependabotAlertWithRepository_dependencyable + // The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + dismissed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + dismissed_by NullableSimpleUserable + // An optional comment associated with the alert's dismissal. + dismissed_comment *string + // The reason that the alert was dismissed. + dismissed_reason *DependabotAlertWithRepository_dismissed_reason + // The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + fixed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The GitHub URL of the alert resource. + html_url *string + // The security alert number. + number *int32 + // A GitHub repository. + repository SimpleRepositoryable + // Details for the GitHub Security Advisory. + security_advisory DependabotAlertSecurityAdvisoryable + // Details pertaining to one vulnerable version range for the advisory. + security_vulnerability DependabotAlertSecurityVulnerabilityable + // The state of the Dependabot alert. + state *DependabotAlertWithRepository_state + // The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The REST API URL of the alert resource. + url *string +} +// NewDependabotAlertWithRepository instantiates a new DependabotAlertWithRepository and sets the default values. +func NewDependabotAlertWithRepository()(*DependabotAlertWithRepository) { + m := &DependabotAlertWithRepository{ + } + return m +} +// CreateDependabotAlertWithRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertWithRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertWithRepository(), nil +} +// GetAutoDismissedAt gets the auto_dismissed_at property value. The time that the alert was auto-dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertWithRepository) GetAutoDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.auto_dismissed_at +} +// GetCreatedAt gets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertWithRepository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDependency gets the dependency property value. Details for the vulnerable dependency. +// returns a DependabotAlertWithRepository_dependencyable when successful +func (m *DependabotAlertWithRepository) GetDependency()(DependabotAlertWithRepository_dependencyable) { + return m.dependency +} +// GetDismissedAt gets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertWithRepository) GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.dismissed_at +} +// GetDismissedBy gets the dismissed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *DependabotAlertWithRepository) GetDismissedBy()(NullableSimpleUserable) { + return m.dismissed_by +} +// GetDismissedComment gets the dismissed_comment property value. An optional comment associated with the alert's dismissal. +// returns a *string when successful +func (m *DependabotAlertWithRepository) GetDismissedComment()(*string) { + return m.dismissed_comment +} +// GetDismissedReason gets the dismissed_reason property value. The reason that the alert was dismissed. +// returns a *DependabotAlertWithRepository_dismissed_reason when successful +func (m *DependabotAlertWithRepository) GetDismissedReason()(*DependabotAlertWithRepository_dismissed_reason) { + return m.dismissed_reason +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependabotAlertWithRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["auto_dismissed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetAutoDismissedAt(val) + } + return nil + } + 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["dependency"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertWithRepository_dependencyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDependency(val.(DependabotAlertWithRepository_dependencyable)) + } + return nil + } + res["dismissed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedAt(val) + } + return nil + } + res["dismissed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["dismissed_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedComment(val) + } + return nil + } + res["dismissed_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlertWithRepository_dismissed_reason) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReason(val.(*DependabotAlertWithRepository_dismissed_reason)) + } + return nil + } + res["fixed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetFixedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(SimpleRepositoryable)) + } + return nil + } + res["security_advisory"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertSecurityAdvisoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAdvisory(val.(DependabotAlertSecurityAdvisoryable)) + } + return nil + } + res["security_vulnerability"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertSecurityVulnerabilityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityVulnerability(val.(DependabotAlertSecurityVulnerabilityable)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlertWithRepository_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*DependabotAlertWithRepository_state)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFixedAt gets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertWithRepository) GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.fixed_at +} +// GetHtmlUrl gets the html_url property value. The GitHub URL of the alert resource. +// returns a *string when successful +func (m *DependabotAlertWithRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetNumber gets the number property value. The security alert number. +// returns a *int32 when successful +func (m *DependabotAlertWithRepository) GetNumber()(*int32) { + return m.number +} +// GetRepository gets the repository property value. A GitHub repository. +// returns a SimpleRepositoryable when successful +func (m *DependabotAlertWithRepository) GetRepository()(SimpleRepositoryable) { + return m.repository +} +// GetSecurityAdvisory gets the security_advisory property value. Details for the GitHub Security Advisory. +// returns a DependabotAlertSecurityAdvisoryable when successful +func (m *DependabotAlertWithRepository) GetSecurityAdvisory()(DependabotAlertSecurityAdvisoryable) { + return m.security_advisory +} +// GetSecurityVulnerability gets the security_vulnerability property value. Details pertaining to one vulnerable version range for the advisory. +// returns a DependabotAlertSecurityVulnerabilityable when successful +func (m *DependabotAlertWithRepository) GetSecurityVulnerability()(DependabotAlertSecurityVulnerabilityable) { + return m.security_vulnerability +} +// GetState gets the state property value. The state of the Dependabot alert. +// returns a *DependabotAlertWithRepository_state when successful +func (m *DependabotAlertWithRepository) GetState()(*DependabotAlertWithRepository_state) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *DependabotAlertWithRepository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The REST API URL of the alert resource. +// returns a *string when successful +func (m *DependabotAlertWithRepository) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *DependabotAlertWithRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("dismissed_by", m.GetDismissedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dismissed_comment", m.GetDismissedComment()) + if err != nil { + return err + } + } + if m.GetDismissedReason() != nil { + cast := (*m.GetDismissedReason()).String() + err := writer.WriteStringValue("dismissed_reason", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + return nil +} +// SetAutoDismissedAt sets the auto_dismissed_at property value. The time that the alert was auto-dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertWithRepository) SetAutoDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.auto_dismissed_at = value +} +// SetCreatedAt sets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertWithRepository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDependency sets the dependency property value. Details for the vulnerable dependency. +func (m *DependabotAlertWithRepository) SetDependency(value DependabotAlertWithRepository_dependencyable)() { + m.dependency = value +} +// SetDismissedAt sets the dismissed_at property value. The time that the alert was dismissed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertWithRepository) SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.dismissed_at = value +} +// SetDismissedBy sets the dismissed_by property value. A GitHub user. +func (m *DependabotAlertWithRepository) SetDismissedBy(value NullableSimpleUserable)() { + m.dismissed_by = value +} +// SetDismissedComment sets the dismissed_comment property value. An optional comment associated with the alert's dismissal. +func (m *DependabotAlertWithRepository) SetDismissedComment(value *string)() { + m.dismissed_comment = value +} +// SetDismissedReason sets the dismissed_reason property value. The reason that the alert was dismissed. +func (m *DependabotAlertWithRepository) SetDismissedReason(value *DependabotAlertWithRepository_dismissed_reason)() { + m.dismissed_reason = value +} +// SetFixedAt sets the fixed_at property value. The time that the alert was no longer detected and was considered fixed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertWithRepository) SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.fixed_at = value +} +// SetHtmlUrl sets the html_url property value. The GitHub URL of the alert resource. +func (m *DependabotAlertWithRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetNumber sets the number property value. The security alert number. +func (m *DependabotAlertWithRepository) SetNumber(value *int32)() { + m.number = value +} +// SetRepository sets the repository property value. A GitHub repository. +func (m *DependabotAlertWithRepository) SetRepository(value SimpleRepositoryable)() { + m.repository = value +} +// SetSecurityAdvisory sets the security_advisory property value. Details for the GitHub Security Advisory. +func (m *DependabotAlertWithRepository) SetSecurityAdvisory(value DependabotAlertSecurityAdvisoryable)() { + m.security_advisory = value +} +// SetSecurityVulnerability sets the security_vulnerability property value. Details pertaining to one vulnerable version range for the advisory. +func (m *DependabotAlertWithRepository) SetSecurityVulnerability(value DependabotAlertSecurityVulnerabilityable)() { + m.security_vulnerability = value +} +// SetState sets the state property value. The state of the Dependabot alert. +func (m *DependabotAlertWithRepository) SetState(value *DependabotAlertWithRepository_state)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *DependabotAlertWithRepository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The REST API URL of the alert resource. +func (m *DependabotAlertWithRepository) SetUrl(value *string)() { + m.url = value +} +type DependabotAlertWithRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAutoDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDependency()(DependabotAlertWithRepository_dependencyable) + GetDismissedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedBy()(NullableSimpleUserable) + GetDismissedComment()(*string) + GetDismissedReason()(*DependabotAlertWithRepository_dismissed_reason) + GetFixedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetNumber()(*int32) + GetRepository()(SimpleRepositoryable) + GetSecurityAdvisory()(DependabotAlertSecurityAdvisoryable) + GetSecurityVulnerability()(DependabotAlertSecurityVulnerabilityable) + GetState()(*DependabotAlertWithRepository_state) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAutoDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDependency(value DependabotAlertWithRepository_dependencyable)() + SetDismissedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedBy(value NullableSimpleUserable)() + SetDismissedComment(value *string)() + SetDismissedReason(value *DependabotAlertWithRepository_dismissed_reason)() + SetFixedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetNumber(value *int32)() + SetRepository(value SimpleRepositoryable)() + SetSecurityAdvisory(value DependabotAlertSecurityAdvisoryable)() + SetSecurityVulnerability(value DependabotAlertSecurityVulnerabilityable)() + SetState(value *DependabotAlertWithRepository_state)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/dependabot_alert_with_repository_escaped_dependency.go b/pkg/github/models/dependabot_alert_with_repository_escaped_dependency.go new file mode 100644 index 00000000..b85c3d9f --- /dev/null +++ b/pkg/github/models/dependabot_alert_with_repository_escaped_dependency.go @@ -0,0 +1,121 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotAlertWithRepository_dependency details for the vulnerable dependency. +type DependabotAlertWithRepository_dependency 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 path to the dependency manifest file, relative to the root of the repository. + manifest_path *string + // Details for the vulnerable package. + packageEscaped DependabotAlertPackageable + // The execution scope of the vulnerable dependency. + scope *DependabotAlertWithRepository_dependency_scope +} +// NewDependabotAlertWithRepository_dependency instantiates a new DependabotAlertWithRepository_dependency and sets the default values. +func NewDependabotAlertWithRepository_dependency()(*DependabotAlertWithRepository_dependency) { + m := &DependabotAlertWithRepository_dependency{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependabotAlertWithRepository_dependencyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotAlertWithRepository_dependencyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotAlertWithRepository_dependency(), 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 *DependabotAlertWithRepository_dependency) 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 *DependabotAlertWithRepository_dependency) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["manifest_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetManifestPath(val) + } + return nil + } + res["package"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependabotAlertPackageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPackageEscaped(val.(DependabotAlertPackageable)) + } + return nil + } + res["scope"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependabotAlertWithRepository_dependency_scope) + if err != nil { + return err + } + if val != nil { + m.SetScope(val.(*DependabotAlertWithRepository_dependency_scope)) + } + return nil + } + return res +} +// GetManifestPath gets the manifest_path property value. The full path to the dependency manifest file, relative to the root of the repository. +// returns a *string when successful +func (m *DependabotAlertWithRepository_dependency) GetManifestPath()(*string) { + return m.manifest_path +} +// GetPackageEscaped gets the package property value. Details for the vulnerable package. +// returns a DependabotAlertPackageable when successful +func (m *DependabotAlertWithRepository_dependency) GetPackageEscaped()(DependabotAlertPackageable) { + return m.packageEscaped +} +// GetScope gets the scope property value. The execution scope of the vulnerable dependency. +// returns a *DependabotAlertWithRepository_dependency_scope when successful +func (m *DependabotAlertWithRepository_dependency) GetScope()(*DependabotAlertWithRepository_dependency_scope) { + return m.scope +} +// Serialize serializes information the current object +func (m *DependabotAlertWithRepository_dependency) 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 *DependabotAlertWithRepository_dependency) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetManifestPath sets the manifest_path property value. The full path to the dependency manifest file, relative to the root of the repository. +func (m *DependabotAlertWithRepository_dependency) SetManifestPath(value *string)() { + m.manifest_path = value +} +// SetPackageEscaped sets the package property value. Details for the vulnerable package. +func (m *DependabotAlertWithRepository_dependency) SetPackageEscaped(value DependabotAlertPackageable)() { + m.packageEscaped = value +} +// SetScope sets the scope property value. The execution scope of the vulnerable dependency. +func (m *DependabotAlertWithRepository_dependency) SetScope(value *DependabotAlertWithRepository_dependency_scope)() { + m.scope = value +} +type DependabotAlertWithRepository_dependencyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetManifestPath()(*string) + GetPackageEscaped()(DependabotAlertPackageable) + GetScope()(*DependabotAlertWithRepository_dependency_scope) + SetManifestPath(value *string)() + SetPackageEscaped(value DependabotAlertPackageable)() + SetScope(value *DependabotAlertWithRepository_dependency_scope)() +} diff --git a/pkg/github/models/dependabot_alert_with_repository_escaped_dependency_escaped_scope.go b/pkg/github/models/dependabot_alert_with_repository_escaped_dependency_escaped_scope.go new file mode 100644 index 00000000..f11b603a --- /dev/null +++ b/pkg/github/models/dependabot_alert_with_repository_escaped_dependency_escaped_scope.go @@ -0,0 +1,34 @@ +package models +// The execution scope of the vulnerable dependency. +type DependabotAlertWithRepository_dependency_scope int + +const ( + DEVELOPMENT_DEPENDABOTALERTWITHREPOSITORY_DEPENDENCY_SCOPE DependabotAlertWithRepository_dependency_scope = iota + RUNTIME_DEPENDABOTALERTWITHREPOSITORY_DEPENDENCY_SCOPE +) + +func (i DependabotAlertWithRepository_dependency_scope) String() string { + return []string{"development", "runtime"}[i] +} +func ParseDependabotAlertWithRepository_dependency_scope(v string) (any, error) { + result := DEVELOPMENT_DEPENDABOTALERTWITHREPOSITORY_DEPENDENCY_SCOPE + switch v { + case "development": + result = DEVELOPMENT_DEPENDABOTALERTWITHREPOSITORY_DEPENDENCY_SCOPE + case "runtime": + result = RUNTIME_DEPENDABOTALERTWITHREPOSITORY_DEPENDENCY_SCOPE + default: + return nil, nil + } + return &result, nil +} +func SerializeDependabotAlertWithRepository_dependency_scope(values []DependabotAlertWithRepository_dependency_scope) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlertWithRepository_dependency_scope) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/dependabot_alert_with_repository_escaped_dismissed_escaped_reason.go b/pkg/github/models/dependabot_alert_with_repository_escaped_dismissed_escaped_reason.go new file mode 100644 index 00000000..d7034cff --- /dev/null +++ b/pkg/github/models/dependabot_alert_with_repository_escaped_dismissed_escaped_reason.go @@ -0,0 +1,43 @@ +package models +// The reason that the alert was dismissed. +type DependabotAlertWithRepository_dismissed_reason int + +const ( + FIX_STARTED_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON DependabotAlertWithRepository_dismissed_reason = iota + INACCURATE_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + NO_BANDWIDTH_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + NOT_USED_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + TOLERABLE_RISK_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON +) + +func (i DependabotAlertWithRepository_dismissed_reason) String() string { + return []string{"fix_started", "inaccurate", "no_bandwidth", "not_used", "tolerable_risk"}[i] +} +func ParseDependabotAlertWithRepository_dismissed_reason(v string) (any, error) { + result := FIX_STARTED_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + switch v { + case "fix_started": + result = FIX_STARTED_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + case "inaccurate": + result = INACCURATE_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + case "no_bandwidth": + result = NO_BANDWIDTH_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + case "not_used": + result = NOT_USED_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + case "tolerable_risk": + result = TOLERABLE_RISK_DEPENDABOTALERTWITHREPOSITORY_DISMISSED_REASON + default: + return nil, nil + } + return &result, nil +} +func SerializeDependabotAlertWithRepository_dismissed_reason(values []DependabotAlertWithRepository_dismissed_reason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlertWithRepository_dismissed_reason) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/dependabot_alert_with_repository_escaped_state.go b/pkg/github/models/dependabot_alert_with_repository_escaped_state.go new file mode 100644 index 00000000..23b5cef6 --- /dev/null +++ b/pkg/github/models/dependabot_alert_with_repository_escaped_state.go @@ -0,0 +1,40 @@ +package models +// The state of the Dependabot alert. +type DependabotAlertWithRepository_state int + +const ( + AUTO_DISMISSED_DEPENDABOTALERTWITHREPOSITORY_STATE DependabotAlertWithRepository_state = iota + DISMISSED_DEPENDABOTALERTWITHREPOSITORY_STATE + FIXED_DEPENDABOTALERTWITHREPOSITORY_STATE + OPEN_DEPENDABOTALERTWITHREPOSITORY_STATE +) + +func (i DependabotAlertWithRepository_state) String() string { + return []string{"auto_dismissed", "dismissed", "fixed", "open"}[i] +} +func ParseDependabotAlertWithRepository_state(v string) (any, error) { + result := AUTO_DISMISSED_DEPENDABOTALERTWITHREPOSITORY_STATE + switch v { + case "auto_dismissed": + result = AUTO_DISMISSED_DEPENDABOTALERTWITHREPOSITORY_STATE + case "dismissed": + result = DISMISSED_DEPENDABOTALERTWITHREPOSITORY_STATE + case "fixed": + result = FIXED_DEPENDABOTALERTWITHREPOSITORY_STATE + case "open": + result = OPEN_DEPENDABOTALERTWITHREPOSITORY_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeDependabotAlertWithRepository_state(values []DependabotAlertWithRepository_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependabotAlertWithRepository_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/dependabot_public_key.go b/pkg/github/models/dependabot_public_key.go new file mode 100644 index 00000000..2655586b --- /dev/null +++ b/pkg/github/models/dependabot_public_key.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotPublicKey the public key used for setting Dependabot Secrets. +type DependabotPublicKey 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 +} +// NewDependabotPublicKey instantiates a new DependabotPublicKey and sets the default values. +func NewDependabotPublicKey()(*DependabotPublicKey) { + m := &DependabotPublicKey{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependabotPublicKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotPublicKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotPublicKey(), 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 *DependabotPublicKey) 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 *DependabotPublicKey) 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 *DependabotPublicKey) GetKey()(*string) { + return m.key +} +// GetKeyId gets the key_id property value. The identifier for the key. +// returns a *string when successful +func (m *DependabotPublicKey) GetKeyId()(*string) { + return m.key_id +} +// Serialize serializes information the current object +func (m *DependabotPublicKey) 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 *DependabotPublicKey) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The Base64 encoded public key. +func (m *DependabotPublicKey) SetKey(value *string)() { + m.key = value +} +// SetKeyId sets the key_id property value. The identifier for the key. +func (m *DependabotPublicKey) SetKeyId(value *string)() { + m.key_id = value +} +type DependabotPublicKeyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetKeyId()(*string) + SetKey(value *string)() + SetKeyId(value *string)() +} diff --git a/pkg/github/models/dependabot_secret.go b/pkg/github/models/dependabot_secret.go new file mode 100644 index 00000000..f326e9bf --- /dev/null +++ b/pkg/github/models/dependabot_secret.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependabotSecret set secrets for Dependabot. +type DependabotSecret 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 secret. + name *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewDependabotSecret instantiates a new DependabotSecret and sets the default values. +func NewDependabotSecret()(*DependabotSecret) { + m := &DependabotSecret{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependabotSecretFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependabotSecretFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependabotSecret(), 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 *DependabotSecret) 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 *DependabotSecret) 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 *DependabotSecret) 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["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the secret. +// returns a *string when successful +func (m *DependabotSecret) GetName()(*string) { + return m.name +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *DependabotSecret) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *DependabotSecret) 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 + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *DependabotSecret) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *DependabotSecret) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the secret. +func (m *DependabotSecret) SetName(value *string)() { + m.name = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *DependabotSecret) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type DependabotSecretable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/dependency_graph_diff.go b/pkg/github/models/dependency_graph_diff.go new file mode 100644 index 00000000..c4760f92 --- /dev/null +++ b/pkg/github/models/dependency_graph_diff.go @@ -0,0 +1,355 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DependencyGraphDiff 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 change_type property + change_type *DependencyGraphDiff_change_type + // The ecosystem property + ecosystem *string + // The license property + license *string + // The manifest property + manifest *string + // The name property + name *string + // The package_url property + package_url *string + // Where the dependency is utilized. `development` means that the dependency is only utilized in the development environment. `runtime` means that the dependency is utilized at runtime and in the development environment. + scope *DependencyGraphDiff_scope + // The source_repository_url property + source_repository_url *string + // The version property + version *string + // The vulnerabilities property + vulnerabilities []DependencyGraphDiff_vulnerabilitiesable +} +// NewDependencyGraphDiff instantiates a new DependencyGraphDiff and sets the default values. +func NewDependencyGraphDiff()(*DependencyGraphDiff) { + m := &DependencyGraphDiff{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependencyGraphDiffFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependencyGraphDiffFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependencyGraphDiff(), 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 *DependencyGraphDiff) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChangeType gets the change_type property value. The change_type property +// returns a *DependencyGraphDiff_change_type when successful +func (m *DependencyGraphDiff) GetChangeType()(*DependencyGraphDiff_change_type) { + return m.change_type +} +// GetEcosystem gets the ecosystem property value. The ecosystem property +// returns a *string when successful +func (m *DependencyGraphDiff) GetEcosystem()(*string) { + return m.ecosystem +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependencyGraphDiff) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["change_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependencyGraphDiff_change_type) + if err != nil { + return err + } + if val != nil { + m.SetChangeType(val.(*DependencyGraphDiff_change_type)) + } + return nil + } + res["ecosystem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEcosystem(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicense(val) + } + return nil + } + res["manifest"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetManifest(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["package_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPackageUrl(val) + } + return nil + } + res["scope"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDependencyGraphDiff_scope) + if err != nil { + return err + } + if val != nil { + m.SetScope(val.(*DependencyGraphDiff_scope)) + } + return nil + } + res["source_repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSourceRepositoryUrl(val) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + res["vulnerabilities"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDependencyGraphDiff_vulnerabilitiesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DependencyGraphDiff_vulnerabilitiesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DependencyGraphDiff_vulnerabilitiesable) + } + } + m.SetVulnerabilities(res) + } + return nil + } + return res +} +// GetLicense gets the license property value. The license property +// returns a *string when successful +func (m *DependencyGraphDiff) GetLicense()(*string) { + return m.license +} +// GetManifest gets the manifest property value. The manifest property +// returns a *string when successful +func (m *DependencyGraphDiff) GetManifest()(*string) { + return m.manifest +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *DependencyGraphDiff) GetName()(*string) { + return m.name +} +// GetPackageUrl gets the package_url property value. The package_url property +// returns a *string when successful +func (m *DependencyGraphDiff) GetPackageUrl()(*string) { + return m.package_url +} +// GetScope gets the scope property value. Where the dependency is utilized. `development` means that the dependency is only utilized in the development environment. `runtime` means that the dependency is utilized at runtime and in the development environment. +// returns a *DependencyGraphDiff_scope when successful +func (m *DependencyGraphDiff) GetScope()(*DependencyGraphDiff_scope) { + return m.scope +} +// GetSourceRepositoryUrl gets the source_repository_url property value. The source_repository_url property +// returns a *string when successful +func (m *DependencyGraphDiff) GetSourceRepositoryUrl()(*string) { + return m.source_repository_url +} +// GetVersion gets the version property value. The version property +// returns a *string when successful +func (m *DependencyGraphDiff) GetVersion()(*string) { + return m.version +} +// GetVulnerabilities gets the vulnerabilities property value. The vulnerabilities property +// returns a []DependencyGraphDiff_vulnerabilitiesable when successful +func (m *DependencyGraphDiff) GetVulnerabilities()([]DependencyGraphDiff_vulnerabilitiesable) { + return m.vulnerabilities +} +// Serialize serializes information the current object +func (m *DependencyGraphDiff) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetChangeType() != nil { + cast := (*m.GetChangeType()).String() + err := writer.WriteStringValue("change_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ecosystem", m.GetEcosystem()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("manifest", m.GetManifest()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("package_url", m.GetPackageUrl()) + if err != nil { + return err + } + } + if m.GetScope() != nil { + cast := (*m.GetScope()).String() + err := writer.WriteStringValue("scope", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("source_repository_url", m.GetSourceRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("version", m.GetVersion()) + if err != nil { + return err + } + } + if m.GetVulnerabilities() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVulnerabilities())) + for i, v := range m.GetVulnerabilities() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("vulnerabilities", 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 *DependencyGraphDiff) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChangeType sets the change_type property value. The change_type property +func (m *DependencyGraphDiff) SetChangeType(value *DependencyGraphDiff_change_type)() { + m.change_type = value +} +// SetEcosystem sets the ecosystem property value. The ecosystem property +func (m *DependencyGraphDiff) SetEcosystem(value *string)() { + m.ecosystem = value +} +// SetLicense sets the license property value. The license property +func (m *DependencyGraphDiff) SetLicense(value *string)() { + m.license = value +} +// SetManifest sets the manifest property value. The manifest property +func (m *DependencyGraphDiff) SetManifest(value *string)() { + m.manifest = value +} +// SetName sets the name property value. The name property +func (m *DependencyGraphDiff) SetName(value *string)() { + m.name = value +} +// SetPackageUrl sets the package_url property value. The package_url property +func (m *DependencyGraphDiff) SetPackageUrl(value *string)() { + m.package_url = value +} +// SetScope sets the scope property value. Where the dependency is utilized. `development` means that the dependency is only utilized in the development environment. `runtime` means that the dependency is utilized at runtime and in the development environment. +func (m *DependencyGraphDiff) SetScope(value *DependencyGraphDiff_scope)() { + m.scope = value +} +// SetSourceRepositoryUrl sets the source_repository_url property value. The source_repository_url property +func (m *DependencyGraphDiff) SetSourceRepositoryUrl(value *string)() { + m.source_repository_url = value +} +// SetVersion sets the version property value. The version property +func (m *DependencyGraphDiff) SetVersion(value *string)() { + m.version = value +} +// SetVulnerabilities sets the vulnerabilities property value. The vulnerabilities property +func (m *DependencyGraphDiff) SetVulnerabilities(value []DependencyGraphDiff_vulnerabilitiesable)() { + m.vulnerabilities = value +} +type DependencyGraphDiffable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChangeType()(*DependencyGraphDiff_change_type) + GetEcosystem()(*string) + GetLicense()(*string) + GetManifest()(*string) + GetName()(*string) + GetPackageUrl()(*string) + GetScope()(*DependencyGraphDiff_scope) + GetSourceRepositoryUrl()(*string) + GetVersion()(*string) + GetVulnerabilities()([]DependencyGraphDiff_vulnerabilitiesable) + SetChangeType(value *DependencyGraphDiff_change_type)() + SetEcosystem(value *string)() + SetLicense(value *string)() + SetManifest(value *string)() + SetName(value *string)() + SetPackageUrl(value *string)() + SetScope(value *DependencyGraphDiff_scope)() + SetSourceRepositoryUrl(value *string)() + SetVersion(value *string)() + SetVulnerabilities(value []DependencyGraphDiff_vulnerabilitiesable)() +} diff --git a/pkg/github/models/dependency_graph_diff_escaped_change_escaped_type.go b/pkg/github/models/dependency_graph_diff_escaped_change_escaped_type.go new file mode 100644 index 00000000..066c1a58 --- /dev/null +++ b/pkg/github/models/dependency_graph_diff_escaped_change_escaped_type.go @@ -0,0 +1,33 @@ +package models +type DependencyGraphDiff_change_type int + +const ( + ADDED_DEPENDENCYGRAPHDIFF_CHANGE_TYPE DependencyGraphDiff_change_type = iota + REMOVED_DEPENDENCYGRAPHDIFF_CHANGE_TYPE +) + +func (i DependencyGraphDiff_change_type) String() string { + return []string{"added", "removed"}[i] +} +func ParseDependencyGraphDiff_change_type(v string) (any, error) { + result := ADDED_DEPENDENCYGRAPHDIFF_CHANGE_TYPE + switch v { + case "added": + result = ADDED_DEPENDENCYGRAPHDIFF_CHANGE_TYPE + case "removed": + result = REMOVED_DEPENDENCYGRAPHDIFF_CHANGE_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeDependencyGraphDiff_change_type(values []DependencyGraphDiff_change_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependencyGraphDiff_change_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/dependency_graph_diff_escaped_scope.go b/pkg/github/models/dependency_graph_diff_escaped_scope.go new file mode 100644 index 00000000..0f5c9f2f --- /dev/null +++ b/pkg/github/models/dependency_graph_diff_escaped_scope.go @@ -0,0 +1,37 @@ +package models +// Where the dependency is utilized. `development` means that the dependency is only utilized in the development environment. `runtime` means that the dependency is utilized at runtime and in the development environment. +type DependencyGraphDiff_scope int + +const ( + UNKNOWN_DEPENDENCYGRAPHDIFF_SCOPE DependencyGraphDiff_scope = iota + RUNTIME_DEPENDENCYGRAPHDIFF_SCOPE + DEVELOPMENT_DEPENDENCYGRAPHDIFF_SCOPE +) + +func (i DependencyGraphDiff_scope) String() string { + return []string{"unknown", "runtime", "development"}[i] +} +func ParseDependencyGraphDiff_scope(v string) (any, error) { + result := UNKNOWN_DEPENDENCYGRAPHDIFF_SCOPE + switch v { + case "unknown": + result = UNKNOWN_DEPENDENCYGRAPHDIFF_SCOPE + case "runtime": + result = RUNTIME_DEPENDENCYGRAPHDIFF_SCOPE + case "development": + result = DEVELOPMENT_DEPENDENCYGRAPHDIFF_SCOPE + default: + return nil, nil + } + return &result, nil +} +func SerializeDependencyGraphDiff_scope(values []DependencyGraphDiff_scope) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DependencyGraphDiff_scope) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/dependency_graph_diff_escaped_vulnerabilities.go b/pkg/github/models/dependency_graph_diff_escaped_vulnerabilities.go new file mode 100644 index 00000000..e5034937 --- /dev/null +++ b/pkg/github/models/dependency_graph_diff_escaped_vulnerabilities.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DependencyGraphDiff_vulnerabilities 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 advisory_ghsa_id property + advisory_ghsa_id *string + // The advisory_summary property + advisory_summary *string + // The advisory_url property + advisory_url *string + // The severity property + severity *string +} +// NewDependencyGraphDiff_vulnerabilities instantiates a new DependencyGraphDiff_vulnerabilities and sets the default values. +func NewDependencyGraphDiff_vulnerabilities()(*DependencyGraphDiff_vulnerabilities) { + m := &DependencyGraphDiff_vulnerabilities{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependencyGraphDiff_vulnerabilitiesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependencyGraphDiff_vulnerabilitiesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependencyGraphDiff_vulnerabilities(), 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 *DependencyGraphDiff_vulnerabilities) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvisoryGhsaId gets the advisory_ghsa_id property value. The advisory_ghsa_id property +// returns a *string when successful +func (m *DependencyGraphDiff_vulnerabilities) GetAdvisoryGhsaId()(*string) { + return m.advisory_ghsa_id +} +// GetAdvisorySummary gets the advisory_summary property value. The advisory_summary property +// returns a *string when successful +func (m *DependencyGraphDiff_vulnerabilities) GetAdvisorySummary()(*string) { + return m.advisory_summary +} +// GetAdvisoryUrl gets the advisory_url property value. The advisory_url property +// returns a *string when successful +func (m *DependencyGraphDiff_vulnerabilities) GetAdvisoryUrl()(*string) { + return m.advisory_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependencyGraphDiff_vulnerabilities) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advisory_ghsa_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvisoryGhsaId(val) + } + return nil + } + res["advisory_summary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvisorySummary(val) + } + return nil + } + res["advisory_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvisoryUrl(val) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val) + } + return nil + } + return res +} +// GetSeverity gets the severity property value. The severity property +// returns a *string when successful +func (m *DependencyGraphDiff_vulnerabilities) GetSeverity()(*string) { + return m.severity +} +// Serialize serializes information the current object +func (m *DependencyGraphDiff_vulnerabilities) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("advisory_ghsa_id", m.GetAdvisoryGhsaId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("advisory_summary", m.GetAdvisorySummary()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("advisory_url", m.GetAdvisoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("severity", m.GetSeverity()) + 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 *DependencyGraphDiff_vulnerabilities) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvisoryGhsaId sets the advisory_ghsa_id property value. The advisory_ghsa_id property +func (m *DependencyGraphDiff_vulnerabilities) SetAdvisoryGhsaId(value *string)() { + m.advisory_ghsa_id = value +} +// SetAdvisorySummary sets the advisory_summary property value. The advisory_summary property +func (m *DependencyGraphDiff_vulnerabilities) SetAdvisorySummary(value *string)() { + m.advisory_summary = value +} +// SetAdvisoryUrl sets the advisory_url property value. The advisory_url property +func (m *DependencyGraphDiff_vulnerabilities) SetAdvisoryUrl(value *string)() { + m.advisory_url = value +} +// SetSeverity sets the severity property value. The severity property +func (m *DependencyGraphDiff_vulnerabilities) SetSeverity(value *string)() { + m.severity = value +} +type DependencyGraphDiff_vulnerabilitiesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvisoryGhsaId()(*string) + GetAdvisorySummary()(*string) + GetAdvisoryUrl()(*string) + GetSeverity()(*string) + SetAdvisoryGhsaId(value *string)() + SetAdvisorySummary(value *string)() + SetAdvisoryUrl(value *string)() + SetSeverity(value *string)() +} diff --git a/pkg/github/models/dependency_graph_spdx_sbom.go b/pkg/github/models/dependency_graph_spdx_sbom.go new file mode 100644 index 00000000..69670e99 --- /dev/null +++ b/pkg/github/models/dependency_graph_spdx_sbom.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DependencyGraphSpdxSbom a schema for the SPDX JSON format returned by the Dependency Graph. +type DependencyGraphSpdxSbom 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 sbom property + sbom DependencyGraphSpdxSbom_sbomable +} +// NewDependencyGraphSpdxSbom instantiates a new DependencyGraphSpdxSbom and sets the default values. +func NewDependencyGraphSpdxSbom()(*DependencyGraphSpdxSbom) { + m := &DependencyGraphSpdxSbom{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependencyGraphSpdxSbomFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependencyGraphSpdxSbomFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependencyGraphSpdxSbom(), 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 *DependencyGraphSpdxSbom) 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 *DependencyGraphSpdxSbom) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["sbom"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependencyGraphSpdxSbom_sbomFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSbom(val.(DependencyGraphSpdxSbom_sbomable)) + } + return nil + } + return res +} +// GetSbom gets the sbom property value. The sbom property +// returns a DependencyGraphSpdxSbom_sbomable when successful +func (m *DependencyGraphSpdxSbom) GetSbom()(DependencyGraphSpdxSbom_sbomable) { + return m.sbom +} +// Serialize serializes information the current object +func (m *DependencyGraphSpdxSbom) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("sbom", m.GetSbom()) + 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 *DependencyGraphSpdxSbom) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSbom sets the sbom property value. The sbom property +func (m *DependencyGraphSpdxSbom) SetSbom(value DependencyGraphSpdxSbom_sbomable)() { + m.sbom = value +} +type DependencyGraphSpdxSbomable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSbom()(DependencyGraphSpdxSbom_sbomable) + SetSbom(value DependencyGraphSpdxSbom_sbomable)() +} diff --git a/pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom.go b/pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom.go new file mode 100644 index 00000000..f283a716 --- /dev/null +++ b/pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom.go @@ -0,0 +1,301 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DependencyGraphSpdxSbom_sbom 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 creationInfo property + creationInfo DependencyGraphSpdxSbom_sbom_creationInfoable + // The license under which the SPDX document is licensed. + dataLicense *string + // The name of the repository that the SPDX document describes. + documentDescribes []string + // The namespace for the SPDX document. + documentNamespace *string + // The name of the SPDX document. + name *string + // The packages property + packages []DependencyGraphSpdxSbom_sbom_packagesable + // The SPDX identifier for the SPDX document. + sPDXID *string + // The version of the SPDX specification that this document conforms to. + spdxVersion *string +} +// NewDependencyGraphSpdxSbom_sbom instantiates a new DependencyGraphSpdxSbom_sbom and sets the default values. +func NewDependencyGraphSpdxSbom_sbom()(*DependencyGraphSpdxSbom_sbom) { + m := &DependencyGraphSpdxSbom_sbom{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependencyGraphSpdxSbom_sbomFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependencyGraphSpdxSbom_sbomFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependencyGraphSpdxSbom_sbom(), 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 *DependencyGraphSpdxSbom_sbom) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreationInfo gets the creationInfo property value. The creationInfo property +// returns a DependencyGraphSpdxSbom_sbom_creationInfoable when successful +func (m *DependencyGraphSpdxSbom_sbom) GetCreationInfo()(DependencyGraphSpdxSbom_sbom_creationInfoable) { + return m.creationInfo +} +// GetDataLicense gets the dataLicense property value. The license under which the SPDX document is licensed. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom) GetDataLicense()(*string) { + return m.dataLicense +} +// GetDocumentDescribes gets the documentDescribes property value. The name of the repository that the SPDX document describes. +// returns a []string when successful +func (m *DependencyGraphSpdxSbom_sbom) GetDocumentDescribes()([]string) { + return m.documentDescribes +} +// GetDocumentNamespace gets the documentNamespace property value. The namespace for the SPDX document. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom) GetDocumentNamespace()(*string) { + return m.documentNamespace +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependencyGraphSpdxSbom_sbom) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["creationInfo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDependencyGraphSpdxSbom_sbom_creationInfoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreationInfo(val.(DependencyGraphSpdxSbom_sbom_creationInfoable)) + } + return nil + } + res["dataLicense"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDataLicense(val) + } + return nil + } + res["documentDescribes"] = 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.SetDocumentDescribes(res) + } + return nil + } + res["documentNamespace"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDocumentNamespace(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["packages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDependencyGraphSpdxSbom_sbom_packagesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DependencyGraphSpdxSbom_sbom_packagesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DependencyGraphSpdxSbom_sbom_packagesable) + } + } + m.SetPackages(res) + } + return nil + } + res["SPDXID"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSPDXID(val) + } + return nil + } + res["spdxVersion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpdxVersion(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the SPDX document. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom) GetName()(*string) { + return m.name +} +// GetPackages gets the packages property value. The packages property +// returns a []DependencyGraphSpdxSbom_sbom_packagesable when successful +func (m *DependencyGraphSpdxSbom_sbom) GetPackages()([]DependencyGraphSpdxSbom_sbom_packagesable) { + return m.packages +} +// GetSPDXID gets the SPDXID property value. The SPDX identifier for the SPDX document. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom) GetSPDXID()(*string) { + return m.sPDXID +} +// GetSpdxVersion gets the spdxVersion property value. The version of the SPDX specification that this document conforms to. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom) GetSpdxVersion()(*string) { + return m.spdxVersion +} +// Serialize serializes information the current object +func (m *DependencyGraphSpdxSbom_sbom) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("creationInfo", m.GetCreationInfo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dataLicense", m.GetDataLicense()) + if err != nil { + return err + } + } + if m.GetDocumentDescribes() != nil { + err := writer.WriteCollectionOfStringValues("documentDescribes", m.GetDocumentDescribes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("documentNamespace", m.GetDocumentNamespace()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetPackages() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetPackages())) + for i, v := range m.GetPackages() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("packages", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("SPDXID", m.GetSPDXID()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("spdxVersion", m.GetSpdxVersion()) + 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 *DependencyGraphSpdxSbom_sbom) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreationInfo sets the creationInfo property value. The creationInfo property +func (m *DependencyGraphSpdxSbom_sbom) SetCreationInfo(value DependencyGraphSpdxSbom_sbom_creationInfoable)() { + m.creationInfo = value +} +// SetDataLicense sets the dataLicense property value. The license under which the SPDX document is licensed. +func (m *DependencyGraphSpdxSbom_sbom) SetDataLicense(value *string)() { + m.dataLicense = value +} +// SetDocumentDescribes sets the documentDescribes property value. The name of the repository that the SPDX document describes. +func (m *DependencyGraphSpdxSbom_sbom) SetDocumentDescribes(value []string)() { + m.documentDescribes = value +} +// SetDocumentNamespace sets the documentNamespace property value. The namespace for the SPDX document. +func (m *DependencyGraphSpdxSbom_sbom) SetDocumentNamespace(value *string)() { + m.documentNamespace = value +} +// SetName sets the name property value. The name of the SPDX document. +func (m *DependencyGraphSpdxSbom_sbom) SetName(value *string)() { + m.name = value +} +// SetPackages sets the packages property value. The packages property +func (m *DependencyGraphSpdxSbom_sbom) SetPackages(value []DependencyGraphSpdxSbom_sbom_packagesable)() { + m.packages = value +} +// SetSPDXID sets the SPDXID property value. The SPDX identifier for the SPDX document. +func (m *DependencyGraphSpdxSbom_sbom) SetSPDXID(value *string)() { + m.sPDXID = value +} +// SetSpdxVersion sets the spdxVersion property value. The version of the SPDX specification that this document conforms to. +func (m *DependencyGraphSpdxSbom_sbom) SetSpdxVersion(value *string)() { + m.spdxVersion = value +} +type DependencyGraphSpdxSbom_sbomable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreationInfo()(DependencyGraphSpdxSbom_sbom_creationInfoable) + GetDataLicense()(*string) + GetDocumentDescribes()([]string) + GetDocumentNamespace()(*string) + GetName()(*string) + GetPackages()([]DependencyGraphSpdxSbom_sbom_packagesable) + GetSPDXID()(*string) + GetSpdxVersion()(*string) + SetCreationInfo(value DependencyGraphSpdxSbom_sbom_creationInfoable)() + SetDataLicense(value *string)() + SetDocumentDescribes(value []string)() + SetDocumentNamespace(value *string)() + SetName(value *string)() + SetPackages(value []DependencyGraphSpdxSbom_sbom_packagesable)() + SetSPDXID(value *string)() + SetSpdxVersion(value *string)() +} diff --git a/pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom_escaped_creation_info.go b/pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom_escaped_creation_info.go new file mode 100644 index 00000000..26f794cd --- /dev/null +++ b/pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom_escaped_creation_info.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DependencyGraphSpdxSbom_sbom_creationInfo 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 date and time the SPDX document was created. + created *string + // The tools that were used to generate the SPDX document. + creators []string +} +// NewDependencyGraphSpdxSbom_sbom_creationInfo instantiates a new DependencyGraphSpdxSbom_sbom_creationInfo and sets the default values. +func NewDependencyGraphSpdxSbom_sbom_creationInfo()(*DependencyGraphSpdxSbom_sbom_creationInfo) { + m := &DependencyGraphSpdxSbom_sbom_creationInfo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependencyGraphSpdxSbom_sbom_creationInfoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependencyGraphSpdxSbom_sbom_creationInfoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependencyGraphSpdxSbom_sbom_creationInfo(), 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 *DependencyGraphSpdxSbom_sbom_creationInfo) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreated gets the created property value. The date and time the SPDX document was created. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_creationInfo) GetCreated()(*string) { + return m.created +} +// GetCreators gets the creators property value. The tools that were used to generate the SPDX document. +// returns a []string when successful +func (m *DependencyGraphSpdxSbom_sbom_creationInfo) GetCreators()([]string) { + return m.creators +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependencyGraphSpdxSbom_sbom_creationInfo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreated(val) + } + return nil + } + res["creators"] = 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.SetCreators(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *DependencyGraphSpdxSbom_sbom_creationInfo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created", m.GetCreated()) + if err != nil { + return err + } + } + if m.GetCreators() != nil { + err := writer.WriteCollectionOfStringValues("creators", m.GetCreators()) + 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 *DependencyGraphSpdxSbom_sbom_creationInfo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreated sets the created property value. The date and time the SPDX document was created. +func (m *DependencyGraphSpdxSbom_sbom_creationInfo) SetCreated(value *string)() { + m.created = value +} +// SetCreators sets the creators property value. The tools that were used to generate the SPDX document. +func (m *DependencyGraphSpdxSbom_sbom_creationInfo) SetCreators(value []string)() { + m.creators = value +} +type DependencyGraphSpdxSbom_sbom_creationInfoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreated()(*string) + GetCreators()([]string) + SetCreated(value *string)() + SetCreators(value []string)() +} diff --git a/pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom_escaped_packages.go b/pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom_escaped_packages.go new file mode 100644 index 00000000..b397ec67 --- /dev/null +++ b/pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom_escaped_packages.go @@ -0,0 +1,353 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DependencyGraphSpdxSbom_sbom_packages 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 copyright holders of the package, and any dates present with those notices, if available. + copyrightText *string + // The location where the package can be downloaded,or NOASSERTION if this has not been determined. + downloadLocation *string + // The externalRefs property + externalRefs []DependencyGraphSpdxSbom_sbom_packages_externalRefsable + // Whether the package's file content has been subjected toanalysis during the creation of the SPDX document. + filesAnalyzed *bool + // The license of the package as determined while creating the SPDX document. + licenseConcluded *string + // The license of the package as declared by its author, or NOASSERTION if this informationwas not available when the SPDX document was created. + licenseDeclared *string + // The name of the package. + name *string + // A unique SPDX identifier for the package. + sPDXID *string + // The distribution source of this package, or NOASSERTION if this was not determined. + supplier *string + // The version of the package. If the package does not have an exact version specified,a version range is given. + versionInfo *string +} +// NewDependencyGraphSpdxSbom_sbom_packages instantiates a new DependencyGraphSpdxSbom_sbom_packages and sets the default values. +func NewDependencyGraphSpdxSbom_sbom_packages()(*DependencyGraphSpdxSbom_sbom_packages) { + m := &DependencyGraphSpdxSbom_sbom_packages{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependencyGraphSpdxSbom_sbom_packagesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependencyGraphSpdxSbom_sbom_packagesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependencyGraphSpdxSbom_sbom_packages(), 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 *DependencyGraphSpdxSbom_sbom_packages) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCopyrightText gets the copyrightText property value. The copyright holders of the package, and any dates present with those notices, if available. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetCopyrightText()(*string) { + return m.copyrightText +} +// GetDownloadLocation gets the downloadLocation property value. The location where the package can be downloaded,or NOASSERTION if this has not been determined. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetDownloadLocation()(*string) { + return m.downloadLocation +} +// GetExternalRefs gets the externalRefs property value. The externalRefs property +// returns a []DependencyGraphSpdxSbom_sbom_packages_externalRefsable when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetExternalRefs()([]DependencyGraphSpdxSbom_sbom_packages_externalRefsable) { + return m.externalRefs +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["copyrightText"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCopyrightText(val) + } + return nil + } + res["downloadLocation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadLocation(val) + } + return nil + } + res["externalRefs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateDependencyGraphSpdxSbom_sbom_packages_externalRefsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]DependencyGraphSpdxSbom_sbom_packages_externalRefsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(DependencyGraphSpdxSbom_sbom_packages_externalRefsable) + } + } + m.SetExternalRefs(res) + } + return nil + } + res["filesAnalyzed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFilesAnalyzed(val) + } + return nil + } + res["licenseConcluded"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicenseConcluded(val) + } + return nil + } + res["licenseDeclared"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicenseDeclared(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["SPDXID"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSPDXID(val) + } + return nil + } + res["supplier"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSupplier(val) + } + return nil + } + res["versionInfo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersionInfo(val) + } + return nil + } + return res +} +// GetFilesAnalyzed gets the filesAnalyzed property value. Whether the package's file content has been subjected toanalysis during the creation of the SPDX document. +// returns a *bool when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetFilesAnalyzed()(*bool) { + return m.filesAnalyzed +} +// GetLicenseConcluded gets the licenseConcluded property value. The license of the package as determined while creating the SPDX document. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetLicenseConcluded()(*string) { + return m.licenseConcluded +} +// GetLicenseDeclared gets the licenseDeclared property value. The license of the package as declared by its author, or NOASSERTION if this informationwas not available when the SPDX document was created. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetLicenseDeclared()(*string) { + return m.licenseDeclared +} +// GetName gets the name property value. The name of the package. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetName()(*string) { + return m.name +} +// GetSPDXID gets the SPDXID property value. A unique SPDX identifier for the package. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetSPDXID()(*string) { + return m.sPDXID +} +// GetSupplier gets the supplier property value. The distribution source of this package, or NOASSERTION if this was not determined. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetSupplier()(*string) { + return m.supplier +} +// GetVersionInfo gets the versionInfo property value. The version of the package. If the package does not have an exact version specified,a version range is given. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages) GetVersionInfo()(*string) { + return m.versionInfo +} +// Serialize serializes information the current object +func (m *DependencyGraphSpdxSbom_sbom_packages) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("copyrightText", m.GetCopyrightText()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloadLocation", m.GetDownloadLocation()) + if err != nil { + return err + } + } + if m.GetExternalRefs() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetExternalRefs())) + for i, v := range m.GetExternalRefs() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("externalRefs", cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("filesAnalyzed", m.GetFilesAnalyzed()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("licenseConcluded", m.GetLicenseConcluded()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("licenseDeclared", m.GetLicenseDeclared()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("SPDXID", m.GetSPDXID()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("supplier", m.GetSupplier()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("versionInfo", m.GetVersionInfo()) + 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 *DependencyGraphSpdxSbom_sbom_packages) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCopyrightText sets the copyrightText property value. The copyright holders of the package, and any dates present with those notices, if available. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetCopyrightText(value *string)() { + m.copyrightText = value +} +// SetDownloadLocation sets the downloadLocation property value. The location where the package can be downloaded,or NOASSERTION if this has not been determined. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetDownloadLocation(value *string)() { + m.downloadLocation = value +} +// SetExternalRefs sets the externalRefs property value. The externalRefs property +func (m *DependencyGraphSpdxSbom_sbom_packages) SetExternalRefs(value []DependencyGraphSpdxSbom_sbom_packages_externalRefsable)() { + m.externalRefs = value +} +// SetFilesAnalyzed sets the filesAnalyzed property value. Whether the package's file content has been subjected toanalysis during the creation of the SPDX document. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetFilesAnalyzed(value *bool)() { + m.filesAnalyzed = value +} +// SetLicenseConcluded sets the licenseConcluded property value. The license of the package as determined while creating the SPDX document. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetLicenseConcluded(value *string)() { + m.licenseConcluded = value +} +// SetLicenseDeclared sets the licenseDeclared property value. The license of the package as declared by its author, or NOASSERTION if this informationwas not available when the SPDX document was created. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetLicenseDeclared(value *string)() { + m.licenseDeclared = value +} +// SetName sets the name property value. The name of the package. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetName(value *string)() { + m.name = value +} +// SetSPDXID sets the SPDXID property value. A unique SPDX identifier for the package. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetSPDXID(value *string)() { + m.sPDXID = value +} +// SetSupplier sets the supplier property value. The distribution source of this package, or NOASSERTION if this was not determined. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetSupplier(value *string)() { + m.supplier = value +} +// SetVersionInfo sets the versionInfo property value. The version of the package. If the package does not have an exact version specified,a version range is given. +func (m *DependencyGraphSpdxSbom_sbom_packages) SetVersionInfo(value *string)() { + m.versionInfo = value +} +type DependencyGraphSpdxSbom_sbom_packagesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCopyrightText()(*string) + GetDownloadLocation()(*string) + GetExternalRefs()([]DependencyGraphSpdxSbom_sbom_packages_externalRefsable) + GetFilesAnalyzed()(*bool) + GetLicenseConcluded()(*string) + GetLicenseDeclared()(*string) + GetName()(*string) + GetSPDXID()(*string) + GetSupplier()(*string) + GetVersionInfo()(*string) + SetCopyrightText(value *string)() + SetDownloadLocation(value *string)() + SetExternalRefs(value []DependencyGraphSpdxSbom_sbom_packages_externalRefsable)() + SetFilesAnalyzed(value *bool)() + SetLicenseConcluded(value *string)() + SetLicenseDeclared(value *string)() + SetName(value *string)() + SetSPDXID(value *string)() + SetSupplier(value *string)() + SetVersionInfo(value *string)() +} diff --git a/pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom_escaped_packages_escaped_external_refs.go b/pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom_escaped_packages_escaped_external_refs.go new file mode 100644 index 00000000..a161a0fb --- /dev/null +++ b/pkg/github/models/dependency_graph_spdx_sbom_escaped_sbom_escaped_packages_escaped_external_refs.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DependencyGraphSpdxSbom_sbom_packages_externalRefs 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 category of reference to an external resource this reference refers to. + referenceCategory *string + // A locator for the particular external resource this reference refers to. + referenceLocator *string + // The category of reference to an external resource this reference refers to. + referenceType *string +} +// NewDependencyGraphSpdxSbom_sbom_packages_externalRefs instantiates a new DependencyGraphSpdxSbom_sbom_packages_externalRefs and sets the default values. +func NewDependencyGraphSpdxSbom_sbom_packages_externalRefs()(*DependencyGraphSpdxSbom_sbom_packages_externalRefs) { + m := &DependencyGraphSpdxSbom_sbom_packages_externalRefs{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDependencyGraphSpdxSbom_sbom_packages_externalRefsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDependencyGraphSpdxSbom_sbom_packages_externalRefsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDependencyGraphSpdxSbom_sbom_packages_externalRefs(), 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 *DependencyGraphSpdxSbom_sbom_packages_externalRefs) 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 *DependencyGraphSpdxSbom_sbom_packages_externalRefs) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["referenceCategory"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReferenceCategory(val) + } + return nil + } + res["referenceLocator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReferenceLocator(val) + } + return nil + } + res["referenceType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReferenceType(val) + } + return nil + } + return res +} +// GetReferenceCategory gets the referenceCategory property value. The category of reference to an external resource this reference refers to. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) GetReferenceCategory()(*string) { + return m.referenceCategory +} +// GetReferenceLocator gets the referenceLocator property value. A locator for the particular external resource this reference refers to. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) GetReferenceLocator()(*string) { + return m.referenceLocator +} +// GetReferenceType gets the referenceType property value. The category of reference to an external resource this reference refers to. +// returns a *string when successful +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) GetReferenceType()(*string) { + return m.referenceType +} +// Serialize serializes information the current object +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("referenceCategory", m.GetReferenceCategory()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("referenceLocator", m.GetReferenceLocator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("referenceType", m.GetReferenceType()) + 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 *DependencyGraphSpdxSbom_sbom_packages_externalRefs) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetReferenceCategory sets the referenceCategory property value. The category of reference to an external resource this reference refers to. +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) SetReferenceCategory(value *string)() { + m.referenceCategory = value +} +// SetReferenceLocator sets the referenceLocator property value. A locator for the particular external resource this reference refers to. +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) SetReferenceLocator(value *string)() { + m.referenceLocator = value +} +// SetReferenceType sets the referenceType property value. The category of reference to an external resource this reference refers to. +func (m *DependencyGraphSpdxSbom_sbom_packages_externalRefs) SetReferenceType(value *string)() { + m.referenceType = value +} +type DependencyGraphSpdxSbom_sbom_packages_externalRefsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetReferenceCategory()(*string) + GetReferenceLocator()(*string) + GetReferenceType()(*string) + SetReferenceCategory(value *string)() + SetReferenceLocator(value *string)() + SetReferenceType(value *string)() +} diff --git a/pkg/github/models/deploy_key.go b/pkg/github/models/deploy_key.go new file mode 100644 index 00000000..e51d0d31 --- /dev/null +++ b/pkg/github/models/deploy_key.go @@ -0,0 +1,313 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DeployKey an SSH key granting access to a single repository. +type DeployKey struct { + // The added_by property + added_by *string + // 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 *string + // The id property + id *int32 + // The key property + key *string + // The last_used property + last_used *string + // The read_only property + read_only *bool + // The title property + title *string + // The url property + url *string + // The verified property + verified *bool +} +// NewDeployKey instantiates a new DeployKey and sets the default values. +func NewDeployKey()(*DeployKey) { + m := &DeployKey{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeployKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeployKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeployKey(), nil +} +// GetAddedBy gets the added_by property value. The added_by property +// returns a *string when successful +func (m *DeployKey) GetAddedBy()(*string) { + return m.added_by +} +// 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 *DeployKey) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *DeployKey) GetCreatedAt()(*string) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DeployKey) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["added_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAddedBy(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + 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["last_used"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLastUsed(val) + } + return nil + } + res["read_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetReadOnly(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *DeployKey) GetId()(*int32) { + return m.id +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *DeployKey) GetKey()(*string) { + return m.key +} +// GetLastUsed gets the last_used property value. The last_used property +// returns a *string when successful +func (m *DeployKey) GetLastUsed()(*string) { + return m.last_used +} +// GetReadOnly gets the read_only property value. The read_only property +// returns a *bool when successful +func (m *DeployKey) GetReadOnly()(*bool) { + return m.read_only +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *DeployKey) GetTitle()(*string) { + return m.title +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *DeployKey) GetUrl()(*string) { + return m.url +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *DeployKey) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *DeployKey) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("added_by", m.GetAddedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("last_used", m.GetLastUsed()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("read_only", m.GetReadOnly()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAddedBy sets the added_by property value. The added_by property +func (m *DeployKey) SetAddedBy(value *string)() { + m.added_by = 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 *DeployKey) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *DeployKey) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *DeployKey) SetId(value *int32)() { + m.id = value +} +// SetKey sets the key property value. The key property +func (m *DeployKey) SetKey(value *string)() { + m.key = value +} +// SetLastUsed sets the last_used property value. The last_used property +func (m *DeployKey) SetLastUsed(value *string)() { + m.last_used = value +} +// SetReadOnly sets the read_only property value. The read_only property +func (m *DeployKey) SetReadOnly(value *bool)() { + m.read_only = value +} +// SetTitle sets the title property value. The title property +func (m *DeployKey) SetTitle(value *string)() { + m.title = value +} +// SetUrl sets the url property value. The url property +func (m *DeployKey) SetUrl(value *string)() { + m.url = value +} +// SetVerified sets the verified property value. The verified property +func (m *DeployKey) SetVerified(value *bool)() { + m.verified = value +} +type DeployKeyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAddedBy()(*string) + GetCreatedAt()(*string) + GetId()(*int32) + GetKey()(*string) + GetLastUsed()(*string) + GetReadOnly()(*bool) + GetTitle()(*string) + GetUrl()(*string) + GetVerified()(*bool) + SetAddedBy(value *string)() + SetCreatedAt(value *string)() + SetId(value *int32)() + SetKey(value *string)() + SetLastUsed(value *string)() + SetReadOnly(value *bool)() + SetTitle(value *string)() + SetUrl(value *string)() + SetVerified(value *bool)() +} diff --git a/pkg/github/models/deployment.go b/pkg/github/models/deployment.go new file mode 100644 index 00000000..7b7f0289 --- /dev/null +++ b/pkg/github/models/deployment.go @@ -0,0 +1,575 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Deployment a request for a specific ref(branch,sha,tag) to be deployed +type Deployment 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 + // A GitHub user. + creator NullableSimpleUserable + // The description property + description *string + // Name for the target deployment environment. + environment *string + // Unique identifier of the deployment + id *int64 + // The node_id property + node_id *string + // The original_environment property + original_environment *string + // The payload property + payload *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // Specifies if the given environment is one that end-users directly interact with. Default: false. + production_environment *bool + // The ref to deploy. This can be a branch, tag, or sha. + ref *string + // The repository_url property + repository_url *string + // The sha property + sha *string + // The statuses_url property + statuses_url *string + // Parameter to specify a task to execute + task *string + // Specifies if the given environment is will no longer exist at some point in the future. Default: false. + transient_environment *bool + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewDeployment instantiates a new Deployment and sets the default values. +func NewDeployment()(*Deployment) { + m := &Deployment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeployment(), 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 *Deployment) 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 *Deployment) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Deployment) GetCreator()(NullableSimpleUserable) { + return m.creator +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *Deployment) GetDescription()(*string) { + return m.description +} +// GetEnvironment gets the environment property value. Name for the target deployment environment. +// returns a *string when successful +func (m *Deployment) GetEnvironment()(*string) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Deployment) 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["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(NullableSimpleUserable)) + } + 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["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["original_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOriginalEnvironment(val) + } + return nil + } + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["production_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetProductionEnvironment(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + 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["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["task"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTask(val) + } + return nil + } + res["transient_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTransientEnvironment(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the deployment +// returns a *int64 when successful +func (m *Deployment) GetId()(*int64) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Deployment) GetNodeId()(*string) { + return m.node_id +} +// GetOriginalEnvironment gets the original_environment property value. The original_environment property +// returns a *string when successful +func (m *Deployment) GetOriginalEnvironment()(*string) { + return m.original_environment +} +// GetPayload gets the payload property value. The payload property +// returns a *string when successful +func (m *Deployment) GetPayload()(*string) { + return m.payload +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *Deployment) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetProductionEnvironment gets the production_environment property value. Specifies if the given environment is one that end-users directly interact with. Default: false. +// returns a *bool when successful +func (m *Deployment) GetProductionEnvironment()(*bool) { + return m.production_environment +} +// GetRef gets the ref property value. The ref to deploy. This can be a branch, tag, or sha. +// returns a *string when successful +func (m *Deployment) GetRef()(*string) { + return m.ref +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *Deployment) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *Deployment) GetSha()(*string) { + return m.sha +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *Deployment) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetTask gets the task property value. Parameter to specify a task to execute +// returns a *string when successful +func (m *Deployment) GetTask()(*string) { + return m.task +} +// GetTransientEnvironment gets the transient_environment property value. Specifies if the given environment is will no longer exist at some point in the future. Default: false. +// returns a *bool when successful +func (m *Deployment) GetTransientEnvironment()(*bool) { + return m.transient_environment +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Deployment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Deployment) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Deployment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("original_environment", m.GetOriginalEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("production_environment", m.GetProductionEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("task", m.GetTask()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("transient_environment", m.GetTransientEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Deployment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Deployment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *Deployment) SetCreator(value NullableSimpleUserable)() { + m.creator = value +} +// SetDescription sets the description property value. The description property +func (m *Deployment) SetDescription(value *string)() { + m.description = value +} +// SetEnvironment sets the environment property value. Name for the target deployment environment. +func (m *Deployment) SetEnvironment(value *string)() { + m.environment = value +} +// SetId sets the id property value. Unique identifier of the deployment +func (m *Deployment) SetId(value *int64)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Deployment) SetNodeId(value *string)() { + m.node_id = value +} +// SetOriginalEnvironment sets the original_environment property value. The original_environment property +func (m *Deployment) SetOriginalEnvironment(value *string)() { + m.original_environment = value +} +// SetPayload sets the payload property value. The payload property +func (m *Deployment) SetPayload(value *string)() { + m.payload = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *Deployment) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetProductionEnvironment sets the production_environment property value. Specifies if the given environment is one that end-users directly interact with. Default: false. +func (m *Deployment) SetProductionEnvironment(value *bool)() { + m.production_environment = value +} +// SetRef sets the ref property value. The ref to deploy. This can be a branch, tag, or sha. +func (m *Deployment) SetRef(value *string)() { + m.ref = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *Deployment) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetSha sets the sha property value. The sha property +func (m *Deployment) SetSha(value *string)() { + m.sha = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *Deployment) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetTask sets the task property value. Parameter to specify a task to execute +func (m *Deployment) SetTask(value *string)() { + m.task = value +} +// SetTransientEnvironment sets the transient_environment property value. Specifies if the given environment is will no longer exist at some point in the future. Default: false. +func (m *Deployment) SetTransientEnvironment(value *bool)() { + m.transient_environment = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Deployment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Deployment) SetUrl(value *string)() { + m.url = value +} +type Deploymentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreator()(NullableSimpleUserable) + GetDescription()(*string) + GetEnvironment()(*string) + GetId()(*int64) + GetNodeId()(*string) + GetOriginalEnvironment()(*string) + GetPayload()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetProductionEnvironment()(*bool) + GetRef()(*string) + GetRepositoryUrl()(*string) + GetSha()(*string) + GetStatusesUrl()(*string) + GetTask()(*string) + GetTransientEnvironment()(*bool) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreator(value NullableSimpleUserable)() + SetDescription(value *string)() + SetEnvironment(value *string)() + SetId(value *int64)() + SetNodeId(value *string)() + SetOriginalEnvironment(value *string)() + SetPayload(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetProductionEnvironment(value *bool)() + SetRef(value *string)() + SetRepositoryUrl(value *string)() + SetSha(value *string)() + SetStatusesUrl(value *string)() + SetTask(value *string)() + SetTransientEnvironment(value *bool)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/deployment_branch_policy.go b/pkg/github/models/deployment_branch_policy.go new file mode 100644 index 00000000..b09c45fc --- /dev/null +++ b/pkg/github/models/deployment_branch_policy.go @@ -0,0 +1,169 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DeploymentBranchPolicy details of a deployment branch or tag policy. +type DeploymentBranchPolicy 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 unique identifier of the branch or tag policy. + id *int32 + // The name pattern that branches or tags must match in order to deploy to the environment. + name *string + // The node_id property + node_id *string + // Whether this rule targets a branch or tag. + typeEscaped *DeploymentBranchPolicy_type +} +// NewDeploymentBranchPolicy instantiates a new DeploymentBranchPolicy and sets the default values. +func NewDeploymentBranchPolicy()(*DeploymentBranchPolicy) { + m := &DeploymentBranchPolicy{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentBranchPolicyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentBranchPolicyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentBranchPolicy(), 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 *DeploymentBranchPolicy) 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 *DeploymentBranchPolicy) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDeploymentBranchPolicy_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*DeploymentBranchPolicy_type)) + } + return nil + } + return res +} +// GetId gets the id property value. The unique identifier of the branch or tag policy. +// returns a *int32 when successful +func (m *DeploymentBranchPolicy) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name pattern that branches or tags must match in order to deploy to the environment. +// returns a *string when successful +func (m *DeploymentBranchPolicy) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *DeploymentBranchPolicy) GetNodeId()(*string) { + return m.node_id +} +// GetTypeEscaped gets the type property value. Whether this rule targets a branch or tag. +// returns a *DeploymentBranchPolicy_type when successful +func (m *DeploymentBranchPolicy) GetTypeEscaped()(*DeploymentBranchPolicy_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *DeploymentBranchPolicy) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *DeploymentBranchPolicy) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The unique identifier of the branch or tag policy. +func (m *DeploymentBranchPolicy) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name pattern that branches or tags must match in order to deploy to the environment. +func (m *DeploymentBranchPolicy) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *DeploymentBranchPolicy) SetNodeId(value *string)() { + m.node_id = value +} +// SetTypeEscaped sets the type property value. Whether this rule targets a branch or tag. +func (m *DeploymentBranchPolicy) SetTypeEscaped(value *DeploymentBranchPolicy_type)() { + m.typeEscaped = value +} +type DeploymentBranchPolicyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetTypeEscaped()(*DeploymentBranchPolicy_type) + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetTypeEscaped(value *DeploymentBranchPolicy_type)() +} diff --git a/pkg/github/models/deployment_branch_policy_escaped_type.go b/pkg/github/models/deployment_branch_policy_escaped_type.go new file mode 100644 index 00000000..a53334dd --- /dev/null +++ b/pkg/github/models/deployment_branch_policy_escaped_type.go @@ -0,0 +1,34 @@ +package models +// Whether this rule targets a branch or tag. +type DeploymentBranchPolicy_type int + +const ( + BRANCH_DEPLOYMENTBRANCHPOLICY_TYPE DeploymentBranchPolicy_type = iota + TAG_DEPLOYMENTBRANCHPOLICY_TYPE +) + +func (i DeploymentBranchPolicy_type) String() string { + return []string{"branch", "tag"}[i] +} +func ParseDeploymentBranchPolicy_type(v string) (any, error) { + result := BRANCH_DEPLOYMENTBRANCHPOLICY_TYPE + switch v { + case "branch": + result = BRANCH_DEPLOYMENTBRANCHPOLICY_TYPE + case "tag": + result = TAG_DEPLOYMENTBRANCHPOLICY_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeDeploymentBranchPolicy_type(values []DeploymentBranchPolicy_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DeploymentBranchPolicy_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/deployment_branch_policy_name_pattern.go b/pkg/github/models/deployment_branch_policy_name_pattern.go new file mode 100644 index 00000000..543ff4b4 --- /dev/null +++ b/pkg/github/models/deployment_branch_policy_name_pattern.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DeploymentBranchPolicyNamePattern 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 name pattern that branches must match in order to deploy to the environment.Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch). + name *string +} +// NewDeploymentBranchPolicyNamePattern instantiates a new DeploymentBranchPolicyNamePattern and sets the default values. +func NewDeploymentBranchPolicyNamePattern()(*DeploymentBranchPolicyNamePattern) { + m := &DeploymentBranchPolicyNamePattern{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentBranchPolicyNamePatternFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentBranchPolicyNamePatternFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentBranchPolicyNamePattern(), 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 *DeploymentBranchPolicyNamePattern) 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 *DeploymentBranchPolicyNamePattern) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 pattern that branches must match in order to deploy to the environment.Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch). +// returns a *string when successful +func (m *DeploymentBranchPolicyNamePattern) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *DeploymentBranchPolicyNamePattern) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *DeploymentBranchPolicyNamePattern) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name pattern that branches must match in order to deploy to the environment.Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch). +func (m *DeploymentBranchPolicyNamePattern) SetName(value *string)() { + m.name = value +} +type DeploymentBranchPolicyNamePatternable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + SetName(value *string)() +} diff --git a/pkg/github/models/deployment_branch_policy_name_pattern_with_type.go b/pkg/github/models/deployment_branch_policy_name_pattern_with_type.go new file mode 100644 index 00000000..d0aa7554 --- /dev/null +++ b/pkg/github/models/deployment_branch_policy_name_pattern_with_type.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type DeploymentBranchPolicyNamePatternWithType 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 name pattern that branches or tags must match in order to deploy to the environment.Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch). + name *string + // Whether this rule targets a branch or tag + typeEscaped *DeploymentBranchPolicyNamePatternWithType_type +} +// NewDeploymentBranchPolicyNamePatternWithType instantiates a new DeploymentBranchPolicyNamePatternWithType and sets the default values. +func NewDeploymentBranchPolicyNamePatternWithType()(*DeploymentBranchPolicyNamePatternWithType) { + m := &DeploymentBranchPolicyNamePatternWithType{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentBranchPolicyNamePatternWithTypeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentBranchPolicyNamePatternWithTypeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentBranchPolicyNamePatternWithType(), 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 *DeploymentBranchPolicyNamePatternWithType) 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 *DeploymentBranchPolicyNamePatternWithType) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDeploymentBranchPolicyNamePatternWithType_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*DeploymentBranchPolicyNamePatternWithType_type)) + } + return nil + } + return res +} +// GetName gets the name property value. The name pattern that branches or tags must match in order to deploy to the environment.Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch). +// returns a *string when successful +func (m *DeploymentBranchPolicyNamePatternWithType) GetName()(*string) { + return m.name +} +// GetTypeEscaped gets the type property value. Whether this rule targets a branch or tag +// returns a *DeploymentBranchPolicyNamePatternWithType_type when successful +func (m *DeploymentBranchPolicyNamePatternWithType) GetTypeEscaped()(*DeploymentBranchPolicyNamePatternWithType_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *DeploymentBranchPolicyNamePatternWithType) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *DeploymentBranchPolicyNamePatternWithType) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name pattern that branches or tags must match in order to deploy to the environment.Wildcard characters will not match `/`. For example, to match branches that begin with `release/` and contain an additional single slash, use `release/*/*`.For more information about pattern matching syntax, see the [Ruby File.fnmatch documentation](https://ruby-doc.org/core-2.5.1/File.html#method-c-fnmatch). +func (m *DeploymentBranchPolicyNamePatternWithType) SetName(value *string)() { + m.name = value +} +// SetTypeEscaped sets the type property value. Whether this rule targets a branch or tag +func (m *DeploymentBranchPolicyNamePatternWithType) SetTypeEscaped(value *DeploymentBranchPolicyNamePatternWithType_type)() { + m.typeEscaped = value +} +type DeploymentBranchPolicyNamePatternWithTypeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetTypeEscaped()(*DeploymentBranchPolicyNamePatternWithType_type) + SetName(value *string)() + SetTypeEscaped(value *DeploymentBranchPolicyNamePatternWithType_type)() +} diff --git a/pkg/github/models/deployment_branch_policy_name_pattern_with_type_escaped_type.go b/pkg/github/models/deployment_branch_policy_name_pattern_with_type_escaped_type.go new file mode 100644 index 00000000..001e00e3 --- /dev/null +++ b/pkg/github/models/deployment_branch_policy_name_pattern_with_type_escaped_type.go @@ -0,0 +1,34 @@ +package models +// Whether this rule targets a branch or tag +type DeploymentBranchPolicyNamePatternWithType_type int + +const ( + BRANCH_DEPLOYMENTBRANCHPOLICYNAMEPATTERNWITHTYPE_TYPE DeploymentBranchPolicyNamePatternWithType_type = iota + TAG_DEPLOYMENTBRANCHPOLICYNAMEPATTERNWITHTYPE_TYPE +) + +func (i DeploymentBranchPolicyNamePatternWithType_type) String() string { + return []string{"branch", "tag"}[i] +} +func ParseDeploymentBranchPolicyNamePatternWithType_type(v string) (any, error) { + result := BRANCH_DEPLOYMENTBRANCHPOLICYNAMEPATTERNWITHTYPE_TYPE + switch v { + case "branch": + result = BRANCH_DEPLOYMENTBRANCHPOLICYNAMEPATTERNWITHTYPE_TYPE + case "tag": + result = TAG_DEPLOYMENTBRANCHPOLICYNAMEPATTERNWITHTYPE_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeDeploymentBranchPolicyNamePatternWithType_type(values []DeploymentBranchPolicyNamePatternWithType_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DeploymentBranchPolicyNamePatternWithType_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/deployment_branch_policy_settings.go b/pkg/github/models/deployment_branch_policy_settings.go new file mode 100644 index 00000000..3724f400 --- /dev/null +++ b/pkg/github/models/deployment_branch_policy_settings.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DeploymentBranchPolicySettings the type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. +type DeploymentBranchPolicySettings 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 only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`. + custom_branch_policies *bool + // Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`. + protected_branches *bool +} +// NewDeploymentBranchPolicySettings instantiates a new DeploymentBranchPolicySettings and sets the default values. +func NewDeploymentBranchPolicySettings()(*DeploymentBranchPolicySettings) { + m := &DeploymentBranchPolicySettings{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentBranchPolicySettingsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentBranchPolicySettingsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentBranchPolicySettings(), 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 *DeploymentBranchPolicySettings) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCustomBranchPolicies gets the custom_branch_policies property value. Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`. +// returns a *bool when successful +func (m *DeploymentBranchPolicySettings) GetCustomBranchPolicies()(*bool) { + return m.custom_branch_policies +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DeploymentBranchPolicySettings) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["custom_branch_policies"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCustomBranchPolicies(val) + } + return nil + } + res["protected_branches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetProtectedBranches(val) + } + return nil + } + return res +} +// GetProtectedBranches gets the protected_branches property value. Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`. +// returns a *bool when successful +func (m *DeploymentBranchPolicySettings) GetProtectedBranches()(*bool) { + return m.protected_branches +} +// Serialize serializes information the current object +func (m *DeploymentBranchPolicySettings) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("custom_branch_policies", m.GetCustomBranchPolicies()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("protected_branches", m.GetProtectedBranches()) + 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 *DeploymentBranchPolicySettings) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCustomBranchPolicies sets the custom_branch_policies property value. Whether only branches that match the specified name patterns can deploy to this environment. If `custom_branch_policies` is `true`, `protected_branches` must be `false`; if `custom_branch_policies` is `false`, `protected_branches` must be `true`. +func (m *DeploymentBranchPolicySettings) SetCustomBranchPolicies(value *bool)() { + m.custom_branch_policies = value +} +// SetProtectedBranches sets the protected_branches property value. Whether only branches with branch protection rules can deploy to this environment. If `protected_branches` is `true`, `custom_branch_policies` must be `false`; if `protected_branches` is `false`, `custom_branch_policies` must be `true`. +func (m *DeploymentBranchPolicySettings) SetProtectedBranches(value *bool)() { + m.protected_branches = value +} +type DeploymentBranchPolicySettingsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCustomBranchPolicies()(*bool) + GetProtectedBranches()(*bool) + SetCustomBranchPolicies(value *bool)() + SetProtectedBranches(value *bool)() +} diff --git a/pkg/github/models/deployment_protection_rule.go b/pkg/github/models/deployment_protection_rule.go new file mode 100644 index 00000000..104d5e14 --- /dev/null +++ b/pkg/github/models/deployment_protection_rule.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DeploymentProtectionRule deployment protection rule +type DeploymentProtectionRule 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 GitHub App that is providing a custom deployment protection rule. + app CustomDeploymentRuleAppable + // Whether the deployment protection rule is enabled for the environment. + enabled *bool + // The unique identifier for the deployment protection rule. + id *int32 + // The node ID for the deployment protection rule. + node_id *string +} +// NewDeploymentProtectionRule instantiates a new DeploymentProtectionRule and sets the default values. +func NewDeploymentProtectionRule()(*DeploymentProtectionRule) { + m := &DeploymentProtectionRule{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentProtectionRuleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentProtectionRuleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentProtectionRule(), 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 *DeploymentProtectionRule) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApp gets the app property value. A GitHub App that is providing a custom deployment protection rule. +// returns a CustomDeploymentRuleAppable when successful +func (m *DeploymentProtectionRule) GetApp()(CustomDeploymentRuleAppable) { + return m.app +} +// GetEnabled gets the enabled property value. Whether the deployment protection rule is enabled for the environment. +// returns a *bool when successful +func (m *DeploymentProtectionRule) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DeploymentProtectionRule) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCustomDeploymentRuleAppFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetApp(val.(CustomDeploymentRuleAppable)) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + return res +} +// GetId gets the id property value. The unique identifier for the deployment protection rule. +// returns a *int32 when successful +func (m *DeploymentProtectionRule) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node ID for the deployment protection rule. +// returns a *string when successful +func (m *DeploymentProtectionRule) GetNodeId()(*string) { + return m.node_id +} +// Serialize serializes information the current object +func (m *DeploymentProtectionRule) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("app", m.GetApp()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + 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 *DeploymentProtectionRule) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApp sets the app property value. A GitHub App that is providing a custom deployment protection rule. +func (m *DeploymentProtectionRule) SetApp(value CustomDeploymentRuleAppable)() { + m.app = value +} +// SetEnabled sets the enabled property value. Whether the deployment protection rule is enabled for the environment. +func (m *DeploymentProtectionRule) SetEnabled(value *bool)() { + m.enabled = value +} +// SetId sets the id property value. The unique identifier for the deployment protection rule. +func (m *DeploymentProtectionRule) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node ID for the deployment protection rule. +func (m *DeploymentProtectionRule) SetNodeId(value *string)() { + m.node_id = value +} +type DeploymentProtectionRuleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApp()(CustomDeploymentRuleAppable) + GetEnabled()(*bool) + GetId()(*int32) + GetNodeId()(*string) + SetApp(value CustomDeploymentRuleAppable)() + SetEnabled(value *bool)() + SetId(value *int32)() + SetNodeId(value *string)() +} diff --git a/pkg/github/models/deployment_reviewer_type.go b/pkg/github/models/deployment_reviewer_type.go new file mode 100644 index 00000000..9d0895a2 --- /dev/null +++ b/pkg/github/models/deployment_reviewer_type.go @@ -0,0 +1,34 @@ +package models +// The type of reviewer. +type DeploymentReviewerType int + +const ( + USER_DEPLOYMENTREVIEWERTYPE DeploymentReviewerType = iota + TEAM_DEPLOYMENTREVIEWERTYPE +) + +func (i DeploymentReviewerType) String() string { + return []string{"User", "Team"}[i] +} +func ParseDeploymentReviewerType(v string) (any, error) { + result := USER_DEPLOYMENTREVIEWERTYPE + switch v { + case "User": + result = USER_DEPLOYMENTREVIEWERTYPE + case "Team": + result = TEAM_DEPLOYMENTREVIEWERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeDeploymentReviewerType(values []DeploymentReviewerType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DeploymentReviewerType) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/deployment_simple.go b/pkg/github/models/deployment_simple.go new file mode 100644 index 00000000..1eb295a8 --- /dev/null +++ b/pkg/github/models/deployment_simple.go @@ -0,0 +1,459 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DeploymentSimple a deployment created as the result of an Actions check run from a workflow that references an environment +type DeploymentSimple 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 description property + description *string + // Name for the target deployment environment. + environment *string + // Unique identifier of the deployment + id *int32 + // The node_id property + node_id *string + // The original_environment property + original_environment *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // Specifies if the given environment is one that end-users directly interact with. Default: false. + production_environment *bool + // The repository_url property + repository_url *string + // The statuses_url property + statuses_url *string + // Parameter to specify a task to execute + task *string + // Specifies if the given environment is will no longer exist at some point in the future. Default: false. + transient_environment *bool + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewDeploymentSimple instantiates a new DeploymentSimple and sets the default values. +func NewDeploymentSimple()(*DeploymentSimple) { + m := &DeploymentSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentSimple(), 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 *DeploymentSimple) 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 *DeploymentSimple) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *DeploymentSimple) GetDescription()(*string) { + return m.description +} +// GetEnvironment gets the environment property value. Name for the target deployment environment. +// returns a *string when successful +func (m *DeploymentSimple) GetEnvironment()(*string) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DeploymentSimple) 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["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["original_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOriginalEnvironment(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["production_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetProductionEnvironment(val) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["task"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTask(val) + } + return nil + } + res["transient_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTransientEnvironment(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the deployment +// returns a *int32 when successful +func (m *DeploymentSimple) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *DeploymentSimple) GetNodeId()(*string) { + return m.node_id +} +// GetOriginalEnvironment gets the original_environment property value. The original_environment property +// returns a *string when successful +func (m *DeploymentSimple) GetOriginalEnvironment()(*string) { + return m.original_environment +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *DeploymentSimple) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetProductionEnvironment gets the production_environment property value. Specifies if the given environment is one that end-users directly interact with. Default: false. +// returns a *bool when successful +func (m *DeploymentSimple) GetProductionEnvironment()(*bool) { + return m.production_environment +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *DeploymentSimple) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *DeploymentSimple) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetTask gets the task property value. Parameter to specify a task to execute +// returns a *string when successful +func (m *DeploymentSimple) GetTask()(*string) { + return m.task +} +// GetTransientEnvironment gets the transient_environment property value. Specifies if the given environment is will no longer exist at some point in the future. Default: false. +// returns a *bool when successful +func (m *DeploymentSimple) GetTransientEnvironment()(*bool) { + return m.transient_environment +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *DeploymentSimple) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *DeploymentSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *DeploymentSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("original_environment", m.GetOriginalEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("production_environment", m.GetProductionEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("task", m.GetTask()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("transient_environment", m.GetTransientEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *DeploymentSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *DeploymentSimple) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *DeploymentSimple) SetDescription(value *string)() { + m.description = value +} +// SetEnvironment sets the environment property value. Name for the target deployment environment. +func (m *DeploymentSimple) SetEnvironment(value *string)() { + m.environment = value +} +// SetId sets the id property value. Unique identifier of the deployment +func (m *DeploymentSimple) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *DeploymentSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetOriginalEnvironment sets the original_environment property value. The original_environment property +func (m *DeploymentSimple) SetOriginalEnvironment(value *string)() { + m.original_environment = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *DeploymentSimple) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetProductionEnvironment sets the production_environment property value. Specifies if the given environment is one that end-users directly interact with. Default: false. +func (m *DeploymentSimple) SetProductionEnvironment(value *bool)() { + m.production_environment = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *DeploymentSimple) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *DeploymentSimple) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetTask sets the task property value. Parameter to specify a task to execute +func (m *DeploymentSimple) SetTask(value *string)() { + m.task = value +} +// SetTransientEnvironment sets the transient_environment property value. Specifies if the given environment is will no longer exist at some point in the future. Default: false. +func (m *DeploymentSimple) SetTransientEnvironment(value *bool)() { + m.transient_environment = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *DeploymentSimple) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *DeploymentSimple) SetUrl(value *string)() { + m.url = value +} +type DeploymentSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetEnvironment()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetOriginalEnvironment()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetProductionEnvironment()(*bool) + GetRepositoryUrl()(*string) + GetStatusesUrl()(*string) + GetTask()(*string) + GetTransientEnvironment()(*bool) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetEnvironment(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetOriginalEnvironment(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetProductionEnvironment(value *bool)() + SetRepositoryUrl(value *string)() + SetStatusesUrl(value *string)() + SetTask(value *string)() + SetTransientEnvironment(value *bool)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/deployment_status.go b/pkg/github/models/deployment_status.go new file mode 100644 index 00000000..69367899 --- /dev/null +++ b/pkg/github/models/deployment_status.go @@ -0,0 +1,489 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DeploymentStatus the status of a deployment. +type DeploymentStatus 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 + // A GitHub user. + creator NullableSimpleUserable + // The deployment_url property + deployment_url *string + // A short description of the status. + description *string + // The environment of the deployment that the status is for. + environment *string + // The URL for accessing your environment. + environment_url *string + // The id property + id *int64 + // The URL to associate with this status. + log_url *string + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The repository_url property + repository_url *string + // The state of the status. + state *DeploymentStatus_state + // Deprecated: the URL to associate with this status. + target_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewDeploymentStatus instantiates a new DeploymentStatus and sets the default values. +func NewDeploymentStatus()(*DeploymentStatus) { + m := &DeploymentStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDeploymentStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeploymentStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDeploymentStatus(), 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 *DeploymentStatus) 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 *DeploymentStatus) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *DeploymentStatus) GetCreator()(NullableSimpleUserable) { + return m.creator +} +// GetDeploymentUrl gets the deployment_url property value. The deployment_url property +// returns a *string when successful +func (m *DeploymentStatus) GetDeploymentUrl()(*string) { + return m.deployment_url +} +// GetDescription gets the description property value. A short description of the status. +// returns a *string when successful +func (m *DeploymentStatus) GetDescription()(*string) { + return m.description +} +// GetEnvironment gets the environment property value. The environment of the deployment that the status is for. +// returns a *string when successful +func (m *DeploymentStatus) GetEnvironment()(*string) { + return m.environment +} +// GetEnvironmentUrl gets the environment_url property value. The URL for accessing your environment. +// returns a *string when successful +func (m *DeploymentStatus) GetEnvironmentUrl()(*string) { + return m.environment_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DeploymentStatus) 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["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(NullableSimpleUserable)) + } + return nil + } + res["deployment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentUrl(val) + } + 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["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["environment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironmentUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["log_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDeploymentStatus_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*DeploymentStatus_state)) + } + return nil + } + res["target_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetUrl(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *DeploymentStatus) GetId()(*int64) { + return m.id +} +// GetLogUrl gets the log_url property value. The URL to associate with this status. +// returns a *string when successful +func (m *DeploymentStatus) GetLogUrl()(*string) { + return m.log_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *DeploymentStatus) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *DeploymentStatus) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *DeploymentStatus) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetState gets the state property value. The state of the status. +// returns a *DeploymentStatus_state when successful +func (m *DeploymentStatus) GetState()(*DeploymentStatus_state) { + return m.state +} +// GetTargetUrl gets the target_url property value. Deprecated: the URL to associate with this status. +// returns a *string when successful +func (m *DeploymentStatus) GetTargetUrl()(*string) { + return m.target_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *DeploymentStatus) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *DeploymentStatus) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *DeploymentStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployment_url", m.GetDeploymentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment_url", m.GetEnvironmentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("log_url", m.GetLogUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_url", m.GetTargetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *DeploymentStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *DeploymentStatus) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *DeploymentStatus) SetCreator(value NullableSimpleUserable)() { + m.creator = value +} +// SetDeploymentUrl sets the deployment_url property value. The deployment_url property +func (m *DeploymentStatus) SetDeploymentUrl(value *string)() { + m.deployment_url = value +} +// SetDescription sets the description property value. A short description of the status. +func (m *DeploymentStatus) SetDescription(value *string)() { + m.description = value +} +// SetEnvironment sets the environment property value. The environment of the deployment that the status is for. +func (m *DeploymentStatus) SetEnvironment(value *string)() { + m.environment = value +} +// SetEnvironmentUrl sets the environment_url property value. The URL for accessing your environment. +func (m *DeploymentStatus) SetEnvironmentUrl(value *string)() { + m.environment_url = value +} +// SetId sets the id property value. The id property +func (m *DeploymentStatus) SetId(value *int64)() { + m.id = value +} +// SetLogUrl sets the log_url property value. The URL to associate with this status. +func (m *DeploymentStatus) SetLogUrl(value *string)() { + m.log_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *DeploymentStatus) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *DeploymentStatus) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *DeploymentStatus) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetState sets the state property value. The state of the status. +func (m *DeploymentStatus) SetState(value *DeploymentStatus_state)() { + m.state = value +} +// SetTargetUrl sets the target_url property value. Deprecated: the URL to associate with this status. +func (m *DeploymentStatus) SetTargetUrl(value *string)() { + m.target_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *DeploymentStatus) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *DeploymentStatus) SetUrl(value *string)() { + m.url = value +} +type DeploymentStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreator()(NullableSimpleUserable) + GetDeploymentUrl()(*string) + GetDescription()(*string) + GetEnvironment()(*string) + GetEnvironmentUrl()(*string) + GetId()(*int64) + GetLogUrl()(*string) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetRepositoryUrl()(*string) + GetState()(*DeploymentStatus_state) + GetTargetUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreator(value NullableSimpleUserable)() + SetDeploymentUrl(value *string)() + SetDescription(value *string)() + SetEnvironment(value *string)() + SetEnvironmentUrl(value *string)() + SetId(value *int64)() + SetLogUrl(value *string)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetRepositoryUrl(value *string)() + SetState(value *DeploymentStatus_state)() + SetTargetUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/deployment_status_escaped_state.go b/pkg/github/models/deployment_status_escaped_state.go new file mode 100644 index 00000000..3a224166 --- /dev/null +++ b/pkg/github/models/deployment_status_escaped_state.go @@ -0,0 +1,49 @@ +package models +// The state of the status. +type DeploymentStatus_state int + +const ( + ERROR_DEPLOYMENTSTATUS_STATE DeploymentStatus_state = iota + FAILURE_DEPLOYMENTSTATUS_STATE + INACTIVE_DEPLOYMENTSTATUS_STATE + PENDING_DEPLOYMENTSTATUS_STATE + SUCCESS_DEPLOYMENTSTATUS_STATE + QUEUED_DEPLOYMENTSTATUS_STATE + IN_PROGRESS_DEPLOYMENTSTATUS_STATE +) + +func (i DeploymentStatus_state) String() string { + return []string{"error", "failure", "inactive", "pending", "success", "queued", "in_progress"}[i] +} +func ParseDeploymentStatus_state(v string) (any, error) { + result := ERROR_DEPLOYMENTSTATUS_STATE + switch v { + case "error": + result = ERROR_DEPLOYMENTSTATUS_STATE + case "failure": + result = FAILURE_DEPLOYMENTSTATUS_STATE + case "inactive": + result = INACTIVE_DEPLOYMENTSTATUS_STATE + case "pending": + result = PENDING_DEPLOYMENTSTATUS_STATE + case "success": + result = SUCCESS_DEPLOYMENTSTATUS_STATE + case "queued": + result = QUEUED_DEPLOYMENTSTATUS_STATE + case "in_progress": + result = IN_PROGRESS_DEPLOYMENTSTATUS_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeDeploymentStatus_state(values []DeploymentStatus_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DeploymentStatus_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/diff_entry.go b/pkg/github/models/diff_entry.go new file mode 100644 index 00000000..a6506c81 --- /dev/null +++ b/pkg/github/models/diff_entry.go @@ -0,0 +1,372 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// DiffEntry diff Entry +type DiffEntry 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 additions property + additions *int32 + // The blob_url property + blob_url *string + // The changes property + changes *int32 + // The contents_url property + contents_url *string + // The deletions property + deletions *int32 + // The filename property + filename *string + // The patch property + patch *string + // The previous_filename property + previous_filename *string + // The raw_url property + raw_url *string + // The sha property + sha *string + // The status property + status *DiffEntry_status +} +// NewDiffEntry instantiates a new DiffEntry and sets the default values. +func NewDiffEntry()(*DiffEntry) { + m := &DiffEntry{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateDiffEntryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDiffEntryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewDiffEntry(), 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 *DiffEntry) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdditions gets the additions property value. The additions property +// returns a *int32 when successful +func (m *DiffEntry) GetAdditions()(*int32) { + return m.additions +} +// GetBlobUrl gets the blob_url property value. The blob_url property +// returns a *string when successful +func (m *DiffEntry) GetBlobUrl()(*string) { + return m.blob_url +} +// GetChanges gets the changes property value. The changes property +// returns a *int32 when successful +func (m *DiffEntry) GetChanges()(*int32) { + return m.changes +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *DiffEntry) GetContentsUrl()(*string) { + return m.contents_url +} +// GetDeletions gets the deletions property value. The deletions property +// returns a *int32 when successful +func (m *DiffEntry) GetDeletions()(*int32) { + return m.deletions +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *DiffEntry) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["additions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAdditions(val) + } + return nil + } + res["blob_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobUrl(val) + } + return nil + } + res["changes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetChanges(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDeletions(val) + } + return nil + } + res["filename"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFilename(val) + } + return nil + } + res["patch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatch(val) + } + return nil + } + res["previous_filename"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousFilename(val) + } + return nil + } + res["raw_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRawUrl(val) + } + return nil + } + 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["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDiffEntry_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*DiffEntry_status)) + } + return nil + } + return res +} +// GetFilename gets the filename property value. The filename property +// returns a *string when successful +func (m *DiffEntry) GetFilename()(*string) { + return m.filename +} +// GetPatch gets the patch property value. The patch property +// returns a *string when successful +func (m *DiffEntry) GetPatch()(*string) { + return m.patch +} +// GetPreviousFilename gets the previous_filename property value. The previous_filename property +// returns a *string when successful +func (m *DiffEntry) GetPreviousFilename()(*string) { + return m.previous_filename +} +// GetRawUrl gets the raw_url property value. The raw_url property +// returns a *string when successful +func (m *DiffEntry) GetRawUrl()(*string) { + return m.raw_url +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *DiffEntry) GetSha()(*string) { + return m.sha +} +// GetStatus gets the status property value. The status property +// returns a *DiffEntry_status when successful +func (m *DiffEntry) GetStatus()(*DiffEntry_status) { + return m.status +} +// Serialize serializes information the current object +func (m *DiffEntry) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("additions", m.GetAdditions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blob_url", m.GetBlobUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("changes", m.GetChanges()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("deletions", m.GetDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("filename", m.GetFilename()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patch", m.GetPatch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_filename", m.GetPreviousFilename()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("raw_url", m.GetRawUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *DiffEntry) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdditions sets the additions property value. The additions property +func (m *DiffEntry) SetAdditions(value *int32)() { + m.additions = value +} +// SetBlobUrl sets the blob_url property value. The blob_url property +func (m *DiffEntry) SetBlobUrl(value *string)() { + m.blob_url = value +} +// SetChanges sets the changes property value. The changes property +func (m *DiffEntry) SetChanges(value *int32)() { + m.changes = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *DiffEntry) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetDeletions sets the deletions property value. The deletions property +func (m *DiffEntry) SetDeletions(value *int32)() { + m.deletions = value +} +// SetFilename sets the filename property value. The filename property +func (m *DiffEntry) SetFilename(value *string)() { + m.filename = value +} +// SetPatch sets the patch property value. The patch property +func (m *DiffEntry) SetPatch(value *string)() { + m.patch = value +} +// SetPreviousFilename sets the previous_filename property value. The previous_filename property +func (m *DiffEntry) SetPreviousFilename(value *string)() { + m.previous_filename = value +} +// SetRawUrl sets the raw_url property value. The raw_url property +func (m *DiffEntry) SetRawUrl(value *string)() { + m.raw_url = value +} +// SetSha sets the sha property value. The sha property +func (m *DiffEntry) SetSha(value *string)() { + m.sha = value +} +// SetStatus sets the status property value. The status property +func (m *DiffEntry) SetStatus(value *DiffEntry_status)() { + m.status = value +} +type DiffEntryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdditions()(*int32) + GetBlobUrl()(*string) + GetChanges()(*int32) + GetContentsUrl()(*string) + GetDeletions()(*int32) + GetFilename()(*string) + GetPatch()(*string) + GetPreviousFilename()(*string) + GetRawUrl()(*string) + GetSha()(*string) + GetStatus()(*DiffEntry_status) + SetAdditions(value *int32)() + SetBlobUrl(value *string)() + SetChanges(value *int32)() + SetContentsUrl(value *string)() + SetDeletions(value *int32)() + SetFilename(value *string)() + SetPatch(value *string)() + SetPreviousFilename(value *string)() + SetRawUrl(value *string)() + SetSha(value *string)() + SetStatus(value *DiffEntry_status)() +} diff --git a/pkg/github/models/diff_entry_escaped_status.go b/pkg/github/models/diff_entry_escaped_status.go new file mode 100644 index 00000000..d0a9cc6a --- /dev/null +++ b/pkg/github/models/diff_entry_escaped_status.go @@ -0,0 +1,48 @@ +package models +type DiffEntry_status int + +const ( + ADDED_DIFFENTRY_STATUS DiffEntry_status = iota + REMOVED_DIFFENTRY_STATUS + MODIFIED_DIFFENTRY_STATUS + RENAMED_DIFFENTRY_STATUS + COPIED_DIFFENTRY_STATUS + CHANGED_DIFFENTRY_STATUS + UNCHANGED_DIFFENTRY_STATUS +) + +func (i DiffEntry_status) String() string { + return []string{"added", "removed", "modified", "renamed", "copied", "changed", "unchanged"}[i] +} +func ParseDiffEntry_status(v string) (any, error) { + result := ADDED_DIFFENTRY_STATUS + switch v { + case "added": + result = ADDED_DIFFENTRY_STATUS + case "removed": + result = REMOVED_DIFFENTRY_STATUS + case "modified": + result = MODIFIED_DIFFENTRY_STATUS + case "renamed": + result = RENAMED_DIFFENTRY_STATUS + case "copied": + result = COPIED_DIFFENTRY_STATUS + case "changed": + result = CHANGED_DIFFENTRY_STATUS + case "unchanged": + result = UNCHANGED_DIFFENTRY_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeDiffEntry_status(values []DiffEntry_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DiffEntry_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/email.go b/pkg/github/models/email.go new file mode 100644 index 00000000..1a663e74 --- /dev/null +++ b/pkg/github/models/email.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Email email +type Email 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 email property + email *string + // The primary property + primary *bool + // The verified property + verified *bool + // The visibility property + visibility *string +} +// NewEmail instantiates a new Email and sets the default values. +func NewEmail()(*Email) { + m := &Email{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEmailFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmailFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEmail(), 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 *Email) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *Email) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Email) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["primary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrimary(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + return res +} +// GetPrimary gets the primary property value. The primary property +// returns a *bool when successful +func (m *Email) GetPrimary()(*bool) { + return m.primary +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *Email) GetVerified()(*bool) { + return m.verified +} +// GetVisibility gets the visibility property value. The visibility property +// returns a *string when successful +func (m *Email) GetVisibility()(*string) { + return m.visibility +} +// Serialize serializes information the current object +func (m *Email) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("primary", m.GetPrimary()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + 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 *Email) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email property +func (m *Email) SetEmail(value *string)() { + m.email = value +} +// SetPrimary sets the primary property value. The primary property +func (m *Email) SetPrimary(value *bool)() { + m.primary = value +} +// SetVerified sets the verified property value. The verified property +func (m *Email) SetVerified(value *bool)() { + m.verified = value +} +// SetVisibility sets the visibility property value. The visibility property +func (m *Email) SetVisibility(value *string)() { + m.visibility = value +} +type Emailable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetPrimary()(*bool) + GetVerified()(*bool) + GetVisibility()(*string) + SetEmail(value *string)() + SetPrimary(value *bool)() + SetVerified(value *bool)() + SetVisibility(value *string)() +} diff --git a/pkg/github/models/empty_object.go b/pkg/github/models/empty_object.go new file mode 100644 index 00000000..ac73b6f2 --- /dev/null +++ b/pkg/github/models/empty_object.go @@ -0,0 +1,33 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// EmptyObject an object without any properties. +type EmptyObject struct { +} +// NewEmptyObject instantiates a new EmptyObject and sets the default values. +func NewEmptyObject()(*EmptyObject) { + m := &EmptyObject{ + } + return m +} +// CreateEmptyObjectFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmptyObjectFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEmptyObject(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EmptyObject) 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 *EmptyObject) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +type EmptyObjectable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/empty_object503_error.go b/pkg/github/models/empty_object503_error.go new file mode 100644 index 00000000..2e7d36e9 --- /dev/null +++ b/pkg/github/models/empty_object503_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 EmptyObject503Error 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 +} +// NewEmptyObject503Error instantiates a new EmptyObject503Error and sets the default values. +func NewEmptyObject503Error()(*EmptyObject503Error) { + m := &EmptyObject503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEmptyObject503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmptyObject503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEmptyObject503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *EmptyObject503Error) 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 *EmptyObject503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *EmptyObject503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *EmptyObject503Error) 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 *EmptyObject503Error) 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 *EmptyObject503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *EmptyObject503Error) 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 *EmptyObject503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *EmptyObject503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *EmptyObject503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *EmptyObject503Error) SetMessage(value *string)() { + m.message = value +} +type EmptyObject503Errorable 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/enabled_organizations.go b/pkg/github/models/enabled_organizations.go new file mode 100644 index 00000000..3ddc0db8 --- /dev/null +++ b/pkg/github/models/enabled_organizations.go @@ -0,0 +1,37 @@ +package models +// The policy that controls the organizations in the enterprise that are allowed to run GitHub Actions. +type EnabledOrganizations int + +const ( + ALL_ENABLEDORGANIZATIONS EnabledOrganizations = iota + NONE_ENABLEDORGANIZATIONS + SELECTED_ENABLEDORGANIZATIONS +) + +func (i EnabledOrganizations) String() string { + return []string{"all", "none", "selected"}[i] +} +func ParseEnabledOrganizations(v string) (any, error) { + result := ALL_ENABLEDORGANIZATIONS + switch v { + case "all": + result = ALL_ENABLEDORGANIZATIONS + case "none": + result = NONE_ENABLEDORGANIZATIONS + case "selected": + result = SELECTED_ENABLEDORGANIZATIONS + default: + return nil, nil + } + return &result, nil +} +func SerializeEnabledOrganizations(values []EnabledOrganizations) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i EnabledOrganizations) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/enabled_repositories.go b/pkg/github/models/enabled_repositories.go new file mode 100644 index 00000000..8f6dcb09 --- /dev/null +++ b/pkg/github/models/enabled_repositories.go @@ -0,0 +1,37 @@ +package models +// The policy that controls the repositories in the organization that are allowed to run GitHub Actions. +type EnabledRepositories int + +const ( + ALL_ENABLEDREPOSITORIES EnabledRepositories = iota + NONE_ENABLEDREPOSITORIES + SELECTED_ENABLEDREPOSITORIES +) + +func (i EnabledRepositories) String() string { + return []string{"all", "none", "selected"}[i] +} +func ParseEnabledRepositories(v string) (any, error) { + result := ALL_ENABLEDREPOSITORIES + switch v { + case "all": + result = ALL_ENABLEDREPOSITORIES + case "none": + result = NONE_ENABLEDREPOSITORIES + case "selected": + result = SELECTED_ENABLEDREPOSITORIES + default: + return nil, nil + } + return &result, nil +} +func SerializeEnabledRepositories(values []EnabledRepositories) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i EnabledRepositories) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/enterprise.go b/pkg/github/models/enterprise.go new file mode 100644 index 00000000..8a2e7107 --- /dev/null +++ b/pkg/github/models/enterprise.go @@ -0,0 +1,343 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Enterprise an enterprise on GitHub. +type Enterprise 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 avatar_url property + avatar_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A short description of the enterprise. + description *string + // The html_url property + html_url *string + // Unique identifier of the enterprise + id *int32 + // The name of the enterprise. + name *string + // The node_id property + node_id *string + // The slug url identifier for the enterprise. + slug *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The enterprise's website URL. + website_url *string +} +// NewEnterprise instantiates a new Enterprise and sets the default values. +func NewEnterprise()(*Enterprise) { + m := &Enterprise{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterprise(), 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 *Enterprise) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *Enterprise) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Enterprise) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. A short description of the enterprise. +// returns a *string when successful +func (m *Enterprise) 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 *Enterprise) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + 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["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + 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["website_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWebsiteUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Enterprise) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the enterprise +// returns a *int32 when successful +func (m *Enterprise) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the enterprise. +// returns a *string when successful +func (m *Enterprise) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Enterprise) GetNodeId()(*string) { + return m.node_id +} +// GetSlug gets the slug property value. The slug url identifier for the enterprise. +// returns a *string when successful +func (m *Enterprise) GetSlug()(*string) { + return m.slug +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Enterprise) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetWebsiteUrl gets the website_url property value. The enterprise's website URL. +// returns a *string when successful +func (m *Enterprise) GetWebsiteUrl()(*string) { + return m.website_url +} +// Serialize serializes information the current object +func (m *Enterprise) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("website_url", m.GetWebsiteUrl()) + 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 *Enterprise) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *Enterprise) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Enterprise) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. A short description of the enterprise. +func (m *Enterprise) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Enterprise) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the enterprise +func (m *Enterprise) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the enterprise. +func (m *Enterprise) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Enterprise) SetNodeId(value *string)() { + m.node_id = value +} +// SetSlug sets the slug property value. The slug url identifier for the enterprise. +func (m *Enterprise) SetSlug(value *string)() { + m.slug = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Enterprise) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetWebsiteUrl sets the website_url property value. The enterprise's website URL. +func (m *Enterprise) SetWebsiteUrl(value *string)() { + m.website_url = value +} +type Enterpriseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetSlug()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetWebsiteUrl()(*string) + SetAvatarUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetSlug(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetWebsiteUrl(value *string)() +} diff --git a/pkg/github/models/enterprise_comment_overview.go b/pkg/github/models/enterprise_comment_overview.go new file mode 100644 index 00000000..87bf07e0 --- /dev/null +++ b/pkg/github/models/enterprise_comment_overview.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseCommentOverview 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 total_commit_comments property + total_commit_comments *int32 + // The total_gist_comments property + total_gist_comments *int32 + // The total_issue_comments property + total_issue_comments *int32 + // The total_pull_request_comments property + total_pull_request_comments *int32 +} +// NewEnterpriseCommentOverview instantiates a new EnterpriseCommentOverview and sets the default values. +func NewEnterpriseCommentOverview()(*EnterpriseCommentOverview) { + m := &EnterpriseCommentOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseCommentOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseCommentOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseCommentOverview(), 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 *EnterpriseCommentOverview) 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 *EnterpriseCommentOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_commit_comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCommitComments(val) + } + return nil + } + res["total_gist_comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalGistComments(val) + } + return nil + } + res["total_issue_comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalIssueComments(val) + } + return nil + } + res["total_pull_request_comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPullRequestComments(val) + } + return nil + } + return res +} +// GetTotalCommitComments gets the total_commit_comments property value. The total_commit_comments property +// returns a *int32 when successful +func (m *EnterpriseCommentOverview) GetTotalCommitComments()(*int32) { + return m.total_commit_comments +} +// GetTotalGistComments gets the total_gist_comments property value. The total_gist_comments property +// returns a *int32 when successful +func (m *EnterpriseCommentOverview) GetTotalGistComments()(*int32) { + return m.total_gist_comments +} +// GetTotalIssueComments gets the total_issue_comments property value. The total_issue_comments property +// returns a *int32 when successful +func (m *EnterpriseCommentOverview) GetTotalIssueComments()(*int32) { + return m.total_issue_comments +} +// GetTotalPullRequestComments gets the total_pull_request_comments property value. The total_pull_request_comments property +// returns a *int32 when successful +func (m *EnterpriseCommentOverview) GetTotalPullRequestComments()(*int32) { + return m.total_pull_request_comments +} +// Serialize serializes information the current object +func (m *EnterpriseCommentOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_commit_comments", m.GetTotalCommitComments()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_gist_comments", m.GetTotalGistComments()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_issue_comments", m.GetTotalIssueComments()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_pull_request_comments", m.GetTotalPullRequestComments()) + 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 *EnterpriseCommentOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCommitComments sets the total_commit_comments property value. The total_commit_comments property +func (m *EnterpriseCommentOverview) SetTotalCommitComments(value *int32)() { + m.total_commit_comments = value +} +// SetTotalGistComments sets the total_gist_comments property value. The total_gist_comments property +func (m *EnterpriseCommentOverview) SetTotalGistComments(value *int32)() { + m.total_gist_comments = value +} +// SetTotalIssueComments sets the total_issue_comments property value. The total_issue_comments property +func (m *EnterpriseCommentOverview) SetTotalIssueComments(value *int32)() { + m.total_issue_comments = value +} +// SetTotalPullRequestComments sets the total_pull_request_comments property value. The total_pull_request_comments property +func (m *EnterpriseCommentOverview) SetTotalPullRequestComments(value *int32)() { + m.total_pull_request_comments = value +} +type EnterpriseCommentOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCommitComments()(*int32) + GetTotalGistComments()(*int32) + GetTotalIssueComments()(*int32) + GetTotalPullRequestComments()(*int32) + SetTotalCommitComments(value *int32)() + SetTotalGistComments(value *int32)() + SetTotalIssueComments(value *int32)() + SetTotalPullRequestComments(value *int32)() +} diff --git a/pkg/github/models/enterprise_gist_overview.go b/pkg/github/models/enterprise_gist_overview.go new file mode 100644 index 00000000..5b6cf366 --- /dev/null +++ b/pkg/github/models/enterprise_gist_overview.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseGistOverview 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 private_gists property + private_gists *int32 + // The public_gists property + public_gists *int32 + // The total_gists property + total_gists *int32 +} +// NewEnterpriseGistOverview instantiates a new EnterpriseGistOverview and sets the default values. +func NewEnterpriseGistOverview()(*EnterpriseGistOverview) { + m := &EnterpriseGistOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseGistOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseGistOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseGistOverview(), 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 *EnterpriseGistOverview) 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 *EnterpriseGistOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["private_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateGists(val) + } + return nil + } + res["public_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicGists(val) + } + return nil + } + res["total_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalGists(val) + } + return nil + } + return res +} +// GetPrivateGists gets the private_gists property value. The private_gists property +// returns a *int32 when successful +func (m *EnterpriseGistOverview) GetPrivateGists()(*int32) { + return m.private_gists +} +// GetPublicGists gets the public_gists property value. The public_gists property +// returns a *int32 when successful +func (m *EnterpriseGistOverview) GetPublicGists()(*int32) { + return m.public_gists +} +// GetTotalGists gets the total_gists property value. The total_gists property +// returns a *int32 when successful +func (m *EnterpriseGistOverview) GetTotalGists()(*int32) { + return m.total_gists +} +// Serialize serializes information the current object +func (m *EnterpriseGistOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("private_gists", m.GetPrivateGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_gists", m.GetPublicGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_gists", m.GetTotalGists()) + 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 *EnterpriseGistOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPrivateGists sets the private_gists property value. The private_gists property +func (m *EnterpriseGistOverview) SetPrivateGists(value *int32)() { + m.private_gists = value +} +// SetPublicGists sets the public_gists property value. The public_gists property +func (m *EnterpriseGistOverview) SetPublicGists(value *int32)() { + m.public_gists = value +} +// SetTotalGists sets the total_gists property value. The total_gists property +func (m *EnterpriseGistOverview) SetTotalGists(value *int32)() { + m.total_gists = value +} +type EnterpriseGistOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPrivateGists()(*int32) + GetPublicGists()(*int32) + GetTotalGists()(*int32) + SetPrivateGists(value *int32)() + SetPublicGists(value *int32)() + SetTotalGists(value *int32)() +} diff --git a/pkg/github/models/enterprise_hook_overview.go b/pkg/github/models/enterprise_hook_overview.go new file mode 100644 index 00000000..3b2e652f --- /dev/null +++ b/pkg/github/models/enterprise_hook_overview.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseHookOverview struct { + // The active_hooks property + active_hooks *int32 + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The inactive_hooks property + inactive_hooks *int32 + // The total_hooks property + total_hooks *int32 +} +// NewEnterpriseHookOverview instantiates a new EnterpriseHookOverview and sets the default values. +func NewEnterpriseHookOverview()(*EnterpriseHookOverview) { + m := &EnterpriseHookOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseHookOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseHookOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseHookOverview(), nil +} +// GetActiveHooks gets the active_hooks property value. The active_hooks property +// returns a *int32 when successful +func (m *EnterpriseHookOverview) GetActiveHooks()(*int32) { + return m.active_hooks +} +// 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 *EnterpriseHookOverview) 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 *EnterpriseHookOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active_hooks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActiveHooks(val) + } + return nil + } + res["inactive_hooks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInactiveHooks(val) + } + return nil + } + res["total_hooks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalHooks(val) + } + return nil + } + return res +} +// GetInactiveHooks gets the inactive_hooks property value. The inactive_hooks property +// returns a *int32 when successful +func (m *EnterpriseHookOverview) GetInactiveHooks()(*int32) { + return m.inactive_hooks +} +// GetTotalHooks gets the total_hooks property value. The total_hooks property +// returns a *int32 when successful +func (m *EnterpriseHookOverview) GetTotalHooks()(*int32) { + return m.total_hooks +} +// Serialize serializes information the current object +func (m *EnterpriseHookOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("active_hooks", m.GetActiveHooks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("inactive_hooks", m.GetInactiveHooks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_hooks", m.GetTotalHooks()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveHooks sets the active_hooks property value. The active_hooks property +func (m *EnterpriseHookOverview) SetActiveHooks(value *int32)() { + m.active_hooks = 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 *EnterpriseHookOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetInactiveHooks sets the inactive_hooks property value. The inactive_hooks property +func (m *EnterpriseHookOverview) SetInactiveHooks(value *int32)() { + m.inactive_hooks = value +} +// SetTotalHooks sets the total_hooks property value. The total_hooks property +func (m *EnterpriseHookOverview) SetTotalHooks(value *int32)() { + m.total_hooks = value +} +type EnterpriseHookOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveHooks()(*int32) + GetInactiveHooks()(*int32) + GetTotalHooks()(*int32) + SetActiveHooks(value *int32)() + SetInactiveHooks(value *int32)() + SetTotalHooks(value *int32)() +} diff --git a/pkg/github/models/enterprise_issue_overview.go b/pkg/github/models/enterprise_issue_overview.go new file mode 100644 index 00000000..8b0b8554 --- /dev/null +++ b/pkg/github/models/enterprise_issue_overview.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseIssueOverview 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 closed_issues property + closed_issues *int32 + // The open_issues property + open_issues *int32 + // The total_issues property + total_issues *int32 +} +// NewEnterpriseIssueOverview instantiates a new EnterpriseIssueOverview and sets the default values. +func NewEnterpriseIssueOverview()(*EnterpriseIssueOverview) { + m := &EnterpriseIssueOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseIssueOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseIssueOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseIssueOverview(), 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 *EnterpriseIssueOverview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClosedIssues gets the closed_issues property value. The closed_issues property +// returns a *int32 when successful +func (m *EnterpriseIssueOverview) GetClosedIssues()(*int32) { + return m.closed_issues +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseIssueOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["closed_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetClosedIssues(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["total_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalIssues(val) + } + return nil + } + return res +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *EnterpriseIssueOverview) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetTotalIssues gets the total_issues property value. The total_issues property +// returns a *int32 when successful +func (m *EnterpriseIssueOverview) GetTotalIssues()(*int32) { + return m.total_issues +} +// Serialize serializes information the current object +func (m *EnterpriseIssueOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("closed_issues", m.GetClosedIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_issues", m.GetTotalIssues()) + 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 *EnterpriseIssueOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClosedIssues sets the closed_issues property value. The closed_issues property +func (m *EnterpriseIssueOverview) SetClosedIssues(value *int32)() { + m.closed_issues = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *EnterpriseIssueOverview) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetTotalIssues sets the total_issues property value. The total_issues property +func (m *EnterpriseIssueOverview) SetTotalIssues(value *int32)() { + m.total_issues = value +} +type EnterpriseIssueOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClosedIssues()(*int32) + GetOpenIssues()(*int32) + GetTotalIssues()(*int32) + SetClosedIssues(value *int32)() + SetOpenIssues(value *int32)() + SetTotalIssues(value *int32)() +} diff --git a/pkg/github/models/enterprise_milestone_overview.go b/pkg/github/models/enterprise_milestone_overview.go new file mode 100644 index 00000000..080fb95d --- /dev/null +++ b/pkg/github/models/enterprise_milestone_overview.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseMilestoneOverview 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 closed_milestones property + closed_milestones *int32 + // The open_milestones property + open_milestones *int32 + // The total_milestones property + total_milestones *int32 +} +// NewEnterpriseMilestoneOverview instantiates a new EnterpriseMilestoneOverview and sets the default values. +func NewEnterpriseMilestoneOverview()(*EnterpriseMilestoneOverview) { + m := &EnterpriseMilestoneOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseMilestoneOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseMilestoneOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseMilestoneOverview(), 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 *EnterpriseMilestoneOverview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClosedMilestones gets the closed_milestones property value. The closed_milestones property +// returns a *int32 when successful +func (m *EnterpriseMilestoneOverview) GetClosedMilestones()(*int32) { + return m.closed_milestones +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseMilestoneOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["closed_milestones"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetClosedMilestones(val) + } + return nil + } + res["open_milestones"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenMilestones(val) + } + return nil + } + res["total_milestones"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalMilestones(val) + } + return nil + } + return res +} +// GetOpenMilestones gets the open_milestones property value. The open_milestones property +// returns a *int32 when successful +func (m *EnterpriseMilestoneOverview) GetOpenMilestones()(*int32) { + return m.open_milestones +} +// GetTotalMilestones gets the total_milestones property value. The total_milestones property +// returns a *int32 when successful +func (m *EnterpriseMilestoneOverview) GetTotalMilestones()(*int32) { + return m.total_milestones +} +// Serialize serializes information the current object +func (m *EnterpriseMilestoneOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("closed_milestones", m.GetClosedMilestones()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_milestones", m.GetOpenMilestones()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_milestones", m.GetTotalMilestones()) + 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 *EnterpriseMilestoneOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClosedMilestones sets the closed_milestones property value. The closed_milestones property +func (m *EnterpriseMilestoneOverview) SetClosedMilestones(value *int32)() { + m.closed_milestones = value +} +// SetOpenMilestones sets the open_milestones property value. The open_milestones property +func (m *EnterpriseMilestoneOverview) SetOpenMilestones(value *int32)() { + m.open_milestones = value +} +// SetTotalMilestones sets the total_milestones property value. The total_milestones property +func (m *EnterpriseMilestoneOverview) SetTotalMilestones(value *int32)() { + m.total_milestones = value +} +type EnterpriseMilestoneOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClosedMilestones()(*int32) + GetOpenMilestones()(*int32) + GetTotalMilestones()(*int32) + SetClosedMilestones(value *int32)() + SetOpenMilestones(value *int32)() + SetTotalMilestones(value *int32)() +} diff --git a/pkg/github/models/enterprise_organization_overview.go b/pkg/github/models/enterprise_organization_overview.go new file mode 100644 index 00000000..06f38419 --- /dev/null +++ b/pkg/github/models/enterprise_organization_overview.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseOrganizationOverview 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 disabled_orgs property + disabled_orgs *int32 + // The total_orgs property + total_orgs *int32 + // The total_team_members property + total_team_members *int32 + // The total_teams property + total_teams *int32 +} +// NewEnterpriseOrganizationOverview instantiates a new EnterpriseOrganizationOverview and sets the default values. +func NewEnterpriseOrganizationOverview()(*EnterpriseOrganizationOverview) { + m := &EnterpriseOrganizationOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseOrganizationOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseOrganizationOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseOrganizationOverview(), 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 *EnterpriseOrganizationOverview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDisabledOrgs gets the disabled_orgs property value. The disabled_orgs property +// returns a *int32 when successful +func (m *EnterpriseOrganizationOverview) GetDisabledOrgs()(*int32) { + return m.disabled_orgs +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseOrganizationOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["disabled_orgs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDisabledOrgs(val) + } + return nil + } + res["total_orgs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalOrgs(val) + } + return nil + } + res["total_team_members"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalTeamMembers(val) + } + return nil + } + res["total_teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalTeams(val) + } + return nil + } + return res +} +// GetTotalOrgs gets the total_orgs property value. The total_orgs property +// returns a *int32 when successful +func (m *EnterpriseOrganizationOverview) GetTotalOrgs()(*int32) { + return m.total_orgs +} +// GetTotalTeamMembers gets the total_team_members property value. The total_team_members property +// returns a *int32 when successful +func (m *EnterpriseOrganizationOverview) GetTotalTeamMembers()(*int32) { + return m.total_team_members +} +// GetTotalTeams gets the total_teams property value. The total_teams property +// returns a *int32 when successful +func (m *EnterpriseOrganizationOverview) GetTotalTeams()(*int32) { + return m.total_teams +} +// Serialize serializes information the current object +func (m *EnterpriseOrganizationOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("disabled_orgs", m.GetDisabledOrgs()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_orgs", m.GetTotalOrgs()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_teams", m.GetTotalTeams()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_team_members", m.GetTotalTeamMembers()) + 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 *EnterpriseOrganizationOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDisabledOrgs sets the disabled_orgs property value. The disabled_orgs property +func (m *EnterpriseOrganizationOverview) SetDisabledOrgs(value *int32)() { + m.disabled_orgs = value +} +// SetTotalOrgs sets the total_orgs property value. The total_orgs property +func (m *EnterpriseOrganizationOverview) SetTotalOrgs(value *int32)() { + m.total_orgs = value +} +// SetTotalTeamMembers sets the total_team_members property value. The total_team_members property +func (m *EnterpriseOrganizationOverview) SetTotalTeamMembers(value *int32)() { + m.total_team_members = value +} +// SetTotalTeams sets the total_teams property value. The total_teams property +func (m *EnterpriseOrganizationOverview) SetTotalTeams(value *int32)() { + m.total_teams = value +} +type EnterpriseOrganizationOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDisabledOrgs()(*int32) + GetTotalOrgs()(*int32) + GetTotalTeamMembers()(*int32) + GetTotalTeams()(*int32) + SetDisabledOrgs(value *int32)() + SetTotalOrgs(value *int32)() + SetTotalTeamMembers(value *int32)() + SetTotalTeams(value *int32)() +} diff --git a/pkg/github/models/enterprise_overview.go b/pkg/github/models/enterprise_overview.go new file mode 100644 index 00000000..1336c21d --- /dev/null +++ b/pkg/github/models/enterprise_overview.go @@ -0,0 +1,341 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseOverview 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 comments property + comments EnterpriseCommentOverviewable + // The gists property + gists EnterpriseGistOverviewable + // The hooks property + hooks EnterpriseHookOverviewable + // The issues property + issues EnterpriseIssueOverviewable + // The milestones property + milestones EnterpriseMilestoneOverviewable + // The orgs property + orgs EnterpriseOrganizationOverviewable + // The pages property + pages EnterprisePageOverviewable + // The pulls property + pulls EnterprisePullRequestOverviewable + // The repos property + repos EnterpriseRepositoryOverviewable + // The users property + users EnterpriseUserOverviewable +} +// NewEnterpriseOverview instantiates a new EnterpriseOverview and sets the default values. +func NewEnterpriseOverview()(*EnterpriseOverview) { + m := &EnterpriseOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseOverview(), 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 *EnterpriseOverview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. The comments property +// returns a EnterpriseCommentOverviewable when successful +func (m *EnterpriseOverview) GetComments()(EnterpriseCommentOverviewable) { + return m.comments +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseCommentOverviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetComments(val.(EnterpriseCommentOverviewable)) + } + return nil + } + res["gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseGistOverviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetGists(val.(EnterpriseGistOverviewable)) + } + return nil + } + res["hooks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseHookOverviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHooks(val.(EnterpriseHookOverviewable)) + } + return nil + } + res["issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseIssueOverviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIssues(val.(EnterpriseIssueOverviewable)) + } + return nil + } + res["milestones"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseMilestoneOverviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestones(val.(EnterpriseMilestoneOverviewable)) + } + return nil + } + res["orgs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseOrganizationOverviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrgs(val.(EnterpriseOrganizationOverviewable)) + } + return nil + } + res["pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterprisePageOverviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPages(val.(EnterprisePageOverviewable)) + } + return nil + } + res["pulls"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterprisePullRequestOverviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPulls(val.(EnterprisePullRequestOverviewable)) + } + return nil + } + res["repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseRepositoryOverviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepos(val.(EnterpriseRepositoryOverviewable)) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseUserOverviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUsers(val.(EnterpriseUserOverviewable)) + } + return nil + } + return res +} +// GetGists gets the gists property value. The gists property +// returns a EnterpriseGistOverviewable when successful +func (m *EnterpriseOverview) GetGists()(EnterpriseGistOverviewable) { + return m.gists +} +// GetHooks gets the hooks property value. The hooks property +// returns a EnterpriseHookOverviewable when successful +func (m *EnterpriseOverview) GetHooks()(EnterpriseHookOverviewable) { + return m.hooks +} +// GetIssues gets the issues property value. The issues property +// returns a EnterpriseIssueOverviewable when successful +func (m *EnterpriseOverview) GetIssues()(EnterpriseIssueOverviewable) { + return m.issues +} +// GetMilestones gets the milestones property value. The milestones property +// returns a EnterpriseMilestoneOverviewable when successful +func (m *EnterpriseOverview) GetMilestones()(EnterpriseMilestoneOverviewable) { + return m.milestones +} +// GetOrgs gets the orgs property value. The orgs property +// returns a EnterpriseOrganizationOverviewable when successful +func (m *EnterpriseOverview) GetOrgs()(EnterpriseOrganizationOverviewable) { + return m.orgs +} +// GetPages gets the pages property value. The pages property +// returns a EnterprisePageOverviewable when successful +func (m *EnterpriseOverview) GetPages()(EnterprisePageOverviewable) { + return m.pages +} +// GetPulls gets the pulls property value. The pulls property +// returns a EnterprisePullRequestOverviewable when successful +func (m *EnterpriseOverview) GetPulls()(EnterprisePullRequestOverviewable) { + return m.pulls +} +// GetRepos gets the repos property value. The repos property +// returns a EnterpriseRepositoryOverviewable when successful +func (m *EnterpriseOverview) GetRepos()(EnterpriseRepositoryOverviewable) { + return m.repos +} +// GetUsers gets the users property value. The users property +// returns a EnterpriseUserOverviewable when successful +func (m *EnterpriseOverview) GetUsers()(EnterpriseUserOverviewable) { + return m.users +} +// Serialize serializes information the current object +func (m *EnterpriseOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("gists", m.GetGists()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("hooks", m.GetHooks()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("issues", m.GetIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestones", m.GetMilestones()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("orgs", m.GetOrgs()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pages", m.GetPages()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pulls", m.GetPulls()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repos", m.GetRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("users", m.GetUsers()) + 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 *EnterpriseOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. The comments property +func (m *EnterpriseOverview) SetComments(value EnterpriseCommentOverviewable)() { + m.comments = value +} +// SetGists sets the gists property value. The gists property +func (m *EnterpriseOverview) SetGists(value EnterpriseGistOverviewable)() { + m.gists = value +} +// SetHooks sets the hooks property value. The hooks property +func (m *EnterpriseOverview) SetHooks(value EnterpriseHookOverviewable)() { + m.hooks = value +} +// SetIssues sets the issues property value. The issues property +func (m *EnterpriseOverview) SetIssues(value EnterpriseIssueOverviewable)() { + m.issues = value +} +// SetMilestones sets the milestones property value. The milestones property +func (m *EnterpriseOverview) SetMilestones(value EnterpriseMilestoneOverviewable)() { + m.milestones = value +} +// SetOrgs sets the orgs property value. The orgs property +func (m *EnterpriseOverview) SetOrgs(value EnterpriseOrganizationOverviewable)() { + m.orgs = value +} +// SetPages sets the pages property value. The pages property +func (m *EnterpriseOverview) SetPages(value EnterprisePageOverviewable)() { + m.pages = value +} +// SetPulls sets the pulls property value. The pulls property +func (m *EnterpriseOverview) SetPulls(value EnterprisePullRequestOverviewable)() { + m.pulls = value +} +// SetRepos sets the repos property value. The repos property +func (m *EnterpriseOverview) SetRepos(value EnterpriseRepositoryOverviewable)() { + m.repos = value +} +// SetUsers sets the users property value. The users property +func (m *EnterpriseOverview) SetUsers(value EnterpriseUserOverviewable)() { + m.users = value +} +type EnterpriseOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()(EnterpriseCommentOverviewable) + GetGists()(EnterpriseGistOverviewable) + GetHooks()(EnterpriseHookOverviewable) + GetIssues()(EnterpriseIssueOverviewable) + GetMilestones()(EnterpriseMilestoneOverviewable) + GetOrgs()(EnterpriseOrganizationOverviewable) + GetPages()(EnterprisePageOverviewable) + GetPulls()(EnterprisePullRequestOverviewable) + GetRepos()(EnterpriseRepositoryOverviewable) + GetUsers()(EnterpriseUserOverviewable) + SetComments(value EnterpriseCommentOverviewable)() + SetGists(value EnterpriseGistOverviewable)() + SetHooks(value EnterpriseHookOverviewable)() + SetIssues(value EnterpriseIssueOverviewable)() + SetMilestones(value EnterpriseMilestoneOverviewable)() + SetOrgs(value EnterpriseOrganizationOverviewable)() + SetPages(value EnterprisePageOverviewable)() + SetPulls(value EnterprisePullRequestOverviewable)() + SetRepos(value EnterpriseRepositoryOverviewable)() + SetUsers(value EnterpriseUserOverviewable)() +} diff --git a/pkg/github/models/enterprise_page_overview.go b/pkg/github/models/enterprise_page_overview.go new file mode 100644 index 00000000..da9d8231 --- /dev/null +++ b/pkg/github/models/enterprise_page_overview.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterprisePageOverview 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 total_pages property + total_pages *int32 +} +// NewEnterprisePageOverview instantiates a new EnterprisePageOverview and sets the default values. +func NewEnterprisePageOverview()(*EnterprisePageOverview) { + m := &EnterprisePageOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterprisePageOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterprisePageOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterprisePageOverview(), 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 *EnterprisePageOverview) 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 *EnterprisePageOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["total_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPages(val) + } + return nil + } + return res +} +// GetTotalPages gets the total_pages property value. The total_pages property +// returns a *int32 when successful +func (m *EnterprisePageOverview) GetTotalPages()(*int32) { + return m.total_pages +} +// Serialize serializes information the current object +func (m *EnterprisePageOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_pages", m.GetTotalPages()) + 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 *EnterprisePageOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalPages sets the total_pages property value. The total_pages property +func (m *EnterprisePageOverview) SetTotalPages(value *int32)() { + m.total_pages = value +} +type EnterprisePageOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalPages()(*int32) + SetTotalPages(value *int32)() +} diff --git a/pkg/github/models/enterprise_pull_request_overview.go b/pkg/github/models/enterprise_pull_request_overview.go new file mode 100644 index 00000000..fee11615 --- /dev/null +++ b/pkg/github/models/enterprise_pull_request_overview.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterprisePullRequestOverview 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 mergeable_pulls property + mergeable_pulls *int32 + // The merged_pulls property + merged_pulls *int32 + // The total_pulls property + total_pulls *int32 + // The unmergeable_pulls property + unmergeable_pulls *int32 +} +// NewEnterprisePullRequestOverview instantiates a new EnterprisePullRequestOverview and sets the default values. +func NewEnterprisePullRequestOverview()(*EnterprisePullRequestOverview) { + m := &EnterprisePullRequestOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterprisePullRequestOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterprisePullRequestOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterprisePullRequestOverview(), 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 *EnterprisePullRequestOverview) 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 *EnterprisePullRequestOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["mergeable_pulls"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMergeablePulls(val) + } + return nil + } + res["merged_pulls"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMergedPulls(val) + } + return nil + } + res["total_pulls"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPulls(val) + } + return nil + } + res["unmergeable_pulls"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUnmergeablePulls(val) + } + return nil + } + return res +} +// GetMergeablePulls gets the mergeable_pulls property value. The mergeable_pulls property +// returns a *int32 when successful +func (m *EnterprisePullRequestOverview) GetMergeablePulls()(*int32) { + return m.mergeable_pulls +} +// GetMergedPulls gets the merged_pulls property value. The merged_pulls property +// returns a *int32 when successful +func (m *EnterprisePullRequestOverview) GetMergedPulls()(*int32) { + return m.merged_pulls +} +// GetTotalPulls gets the total_pulls property value. The total_pulls property +// returns a *int32 when successful +func (m *EnterprisePullRequestOverview) GetTotalPulls()(*int32) { + return m.total_pulls +} +// GetUnmergeablePulls gets the unmergeable_pulls property value. The unmergeable_pulls property +// returns a *int32 when successful +func (m *EnterprisePullRequestOverview) GetUnmergeablePulls()(*int32) { + return m.unmergeable_pulls +} +// Serialize serializes information the current object +func (m *EnterprisePullRequestOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("mergeable_pulls", m.GetMergeablePulls()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("merged_pulls", m.GetMergedPulls()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_pulls", m.GetTotalPulls()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("unmergeable_pulls", m.GetUnmergeablePulls()) + 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 *EnterprisePullRequestOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMergeablePulls sets the mergeable_pulls property value. The mergeable_pulls property +func (m *EnterprisePullRequestOverview) SetMergeablePulls(value *int32)() { + m.mergeable_pulls = value +} +// SetMergedPulls sets the merged_pulls property value. The merged_pulls property +func (m *EnterprisePullRequestOverview) SetMergedPulls(value *int32)() { + m.merged_pulls = value +} +// SetTotalPulls sets the total_pulls property value. The total_pulls property +func (m *EnterprisePullRequestOverview) SetTotalPulls(value *int32)() { + m.total_pulls = value +} +// SetUnmergeablePulls sets the unmergeable_pulls property value. The unmergeable_pulls property +func (m *EnterprisePullRequestOverview) SetUnmergeablePulls(value *int32)() { + m.unmergeable_pulls = value +} +type EnterprisePullRequestOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMergeablePulls()(*int32) + GetMergedPulls()(*int32) + GetTotalPulls()(*int32) + GetUnmergeablePulls()(*int32) + SetMergeablePulls(value *int32)() + SetMergedPulls(value *int32)() + SetTotalPulls(value *int32)() + SetUnmergeablePulls(value *int32)() +} diff --git a/pkg/github/models/enterprise_repository_overview.go b/pkg/github/models/enterprise_repository_overview.go new file mode 100644 index 00000000..9dd0f8b3 --- /dev/null +++ b/pkg/github/models/enterprise_repository_overview.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseRepositoryOverview 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 fork_repos property + fork_repos *int32 + // The org_repos property + org_repos *int32 + // The root_repos property + root_repos *int32 + // The total_pushes property + total_pushes *int32 + // The total_repos property + total_repos *int32 + // The total_wikis property + total_wikis *int32 +} +// NewEnterpriseRepositoryOverview instantiates a new EnterpriseRepositoryOverview and sets the default values. +func NewEnterpriseRepositoryOverview()(*EnterpriseRepositoryOverview) { + m := &EnterpriseRepositoryOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseRepositoryOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseRepositoryOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseRepositoryOverview(), 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 *EnterpriseRepositoryOverview) 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 *EnterpriseRepositoryOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fork_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForkRepos(val) + } + return nil + } + res["org_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOrgRepos(val) + } + return nil + } + res["root_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRootRepos(val) + } + return nil + } + res["total_pushes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPushes(val) + } + return nil + } + res["total_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalRepos(val) + } + return nil + } + res["total_wikis"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalWikis(val) + } + return nil + } + return res +} +// GetForkRepos gets the fork_repos property value. The fork_repos property +// returns a *int32 when successful +func (m *EnterpriseRepositoryOverview) GetForkRepos()(*int32) { + return m.fork_repos +} +// GetOrgRepos gets the org_repos property value. The org_repos property +// returns a *int32 when successful +func (m *EnterpriseRepositoryOverview) GetOrgRepos()(*int32) { + return m.org_repos +} +// GetRootRepos gets the root_repos property value. The root_repos property +// returns a *int32 when successful +func (m *EnterpriseRepositoryOverview) GetRootRepos()(*int32) { + return m.root_repos +} +// GetTotalPushes gets the total_pushes property value. The total_pushes property +// returns a *int32 when successful +func (m *EnterpriseRepositoryOverview) GetTotalPushes()(*int32) { + return m.total_pushes +} +// GetTotalRepos gets the total_repos property value. The total_repos property +// returns a *int32 when successful +func (m *EnterpriseRepositoryOverview) GetTotalRepos()(*int32) { + return m.total_repos +} +// GetTotalWikis gets the total_wikis property value. The total_wikis property +// returns a *int32 when successful +func (m *EnterpriseRepositoryOverview) GetTotalWikis()(*int32) { + return m.total_wikis +} +// Serialize serializes information the current object +func (m *EnterpriseRepositoryOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("fork_repos", m.GetForkRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("org_repos", m.GetOrgRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("root_repos", m.GetRootRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_pushes", m.GetTotalPushes()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_repos", m.GetTotalRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_wikis", m.GetTotalWikis()) + 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 *EnterpriseRepositoryOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetForkRepos sets the fork_repos property value. The fork_repos property +func (m *EnterpriseRepositoryOverview) SetForkRepos(value *int32)() { + m.fork_repos = value +} +// SetOrgRepos sets the org_repos property value. The org_repos property +func (m *EnterpriseRepositoryOverview) SetOrgRepos(value *int32)() { + m.org_repos = value +} +// SetRootRepos sets the root_repos property value. The root_repos property +func (m *EnterpriseRepositoryOverview) SetRootRepos(value *int32)() { + m.root_repos = value +} +// SetTotalPushes sets the total_pushes property value. The total_pushes property +func (m *EnterpriseRepositoryOverview) SetTotalPushes(value *int32)() { + m.total_pushes = value +} +// SetTotalRepos sets the total_repos property value. The total_repos property +func (m *EnterpriseRepositoryOverview) SetTotalRepos(value *int32)() { + m.total_repos = value +} +// SetTotalWikis sets the total_wikis property value. The total_wikis property +func (m *EnterpriseRepositoryOverview) SetTotalWikis(value *int32)() { + m.total_wikis = value +} +type EnterpriseRepositoryOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetForkRepos()(*int32) + GetOrgRepos()(*int32) + GetRootRepos()(*int32) + GetTotalPushes()(*int32) + GetTotalRepos()(*int32) + GetTotalWikis()(*int32) + SetForkRepos(value *int32)() + SetOrgRepos(value *int32)() + SetRootRepos(value *int32)() + SetTotalPushes(value *int32)() + SetTotalRepos(value *int32)() + SetTotalWikis(value *int32)() +} diff --git a/pkg/github/models/enterprise_security_analysis_settings.go b/pkg/github/models/enterprise_security_analysis_settings.go new file mode 100644 index 00000000..a736a6dd --- /dev/null +++ b/pkg/github/models/enterprise_security_analysis_settings.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSecurityAnalysisSettings 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 GitHub advanced security is automatically enabled for new repositories and repositories transferred tothis enterprise. + advanced_security_enabled_for_new_repositories *bool + // Whether GitHub Advanced Security is automatically enabled for new user namespace repositories. + advanced_security_enabled_for_new_user_namespace_repositories *bool + // Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to thisenterprise. + dependabot_alerts_enabled_for_new_repositories *bool + // Whether secret scanning is automatically enabled for new repositories and repositories transferred to thisenterprise. + secret_scanning_enabled_for_new_repositories *bool + // An optional URL string to display to contributors who are blocked from pushing a secret. + secret_scanning_push_protection_custom_link *string + // Whether secret scanning push protection is automatically enabled for new repositories and repositoriestransferred to this enterprise. + secret_scanning_push_protection_enabled_for_new_repositories *bool +} +// NewEnterpriseSecurityAnalysisSettings instantiates a new EnterpriseSecurityAnalysisSettings and sets the default values. +func NewEnterpriseSecurityAnalysisSettings()(*EnterpriseSecurityAnalysisSettings) { + m := &EnterpriseSecurityAnalysisSettings{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSecurityAnalysisSettingsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSecurityAnalysisSettingsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSecurityAnalysisSettings(), 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 *EnterpriseSecurityAnalysisSettings) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurityEnabledForNewRepositories gets the advanced_security_enabled_for_new_repositories property value. Whether GitHub advanced security is automatically enabled for new repositories and repositories transferred tothis enterprise. +// returns a *bool when successful +func (m *EnterpriseSecurityAnalysisSettings) GetAdvancedSecurityEnabledForNewRepositories()(*bool) { + return m.advanced_security_enabled_for_new_repositories +} +// GetAdvancedSecurityEnabledForNewUserNamespaceRepositories gets the advanced_security_enabled_for_new_user_namespace_repositories property value. Whether GitHub Advanced Security is automatically enabled for new user namespace repositories. +// returns a *bool when successful +func (m *EnterpriseSecurityAnalysisSettings) GetAdvancedSecurityEnabledForNewUserNamespaceRepositories()(*bool) { + return m.advanced_security_enabled_for_new_user_namespace_repositories +} +// GetDependabotAlertsEnabledForNewRepositories gets the dependabot_alerts_enabled_for_new_repositories property value. Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to thisenterprise. +// returns a *bool when successful +func (m *EnterpriseSecurityAnalysisSettings) GetDependabotAlertsEnabledForNewRepositories()(*bool) { + return m.dependabot_alerts_enabled_for_new_repositories +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSecurityAnalysisSettings) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advanced_security_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurityEnabledForNewRepositories(val) + } + return nil + } + res["advanced_security_enabled_for_new_user_namespace_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurityEnabledForNewUserNamespaceRepositories(val) + } + return nil + } + res["dependabot_alerts_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDependabotAlertsEnabledForNewRepositories(val) + } + return nil + } + res["secret_scanning_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningEnabledForNewRepositories(val) + } + return nil + } + res["secret_scanning_push_protection_custom_link"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionCustomLink(val) + } + return nil + } + res["secret_scanning_push_protection_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionEnabledForNewRepositories(val) + } + return nil + } + return res +} +// GetSecretScanningEnabledForNewRepositories gets the secret_scanning_enabled_for_new_repositories property value. Whether secret scanning is automatically enabled for new repositories and repositories transferred to thisenterprise. +// returns a *bool when successful +func (m *EnterpriseSecurityAnalysisSettings) GetSecretScanningEnabledForNewRepositories()(*bool) { + return m.secret_scanning_enabled_for_new_repositories +} +// GetSecretScanningPushProtectionCustomLink gets the secret_scanning_push_protection_custom_link property value. An optional URL string to display to contributors who are blocked from pushing a secret. +// returns a *string when successful +func (m *EnterpriseSecurityAnalysisSettings) GetSecretScanningPushProtectionCustomLink()(*string) { + return m.secret_scanning_push_protection_custom_link +} +// GetSecretScanningPushProtectionEnabledForNewRepositories gets the secret_scanning_push_protection_enabled_for_new_repositories property value. Whether secret scanning push protection is automatically enabled for new repositories and repositoriestransferred to this enterprise. +// returns a *bool when successful +func (m *EnterpriseSecurityAnalysisSettings) GetSecretScanningPushProtectionEnabledForNewRepositories()(*bool) { + return m.secret_scanning_push_protection_enabled_for_new_repositories +} +// Serialize serializes information the current object +func (m *EnterpriseSecurityAnalysisSettings) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("advanced_security_enabled_for_new_repositories", m.GetAdvancedSecurityEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("advanced_security_enabled_for_new_user_namespace_repositories", m.GetAdvancedSecurityEnabledForNewUserNamespaceRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dependabot_alerts_enabled_for_new_repositories", m.GetDependabotAlertsEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_enabled_for_new_repositories", m.GetSecretScanningEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_scanning_push_protection_custom_link", m.GetSecretScanningPushProtectionCustomLink()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_push_protection_enabled_for_new_repositories", m.GetSecretScanningPushProtectionEnabledForNewRepositories()) + 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 *EnterpriseSecurityAnalysisSettings) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurityEnabledForNewRepositories sets the advanced_security_enabled_for_new_repositories property value. Whether GitHub advanced security is automatically enabled for new repositories and repositories transferred tothis enterprise. +func (m *EnterpriseSecurityAnalysisSettings) SetAdvancedSecurityEnabledForNewRepositories(value *bool)() { + m.advanced_security_enabled_for_new_repositories = value +} +// SetAdvancedSecurityEnabledForNewUserNamespaceRepositories sets the advanced_security_enabled_for_new_user_namespace_repositories property value. Whether GitHub Advanced Security is automatically enabled for new user namespace repositories. +func (m *EnterpriseSecurityAnalysisSettings) SetAdvancedSecurityEnabledForNewUserNamespaceRepositories(value *bool)() { + m.advanced_security_enabled_for_new_user_namespace_repositories = value +} +// SetDependabotAlertsEnabledForNewRepositories sets the dependabot_alerts_enabled_for_new_repositories property value. Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to thisenterprise. +func (m *EnterpriseSecurityAnalysisSettings) SetDependabotAlertsEnabledForNewRepositories(value *bool)() { + m.dependabot_alerts_enabled_for_new_repositories = value +} +// SetSecretScanningEnabledForNewRepositories sets the secret_scanning_enabled_for_new_repositories property value. Whether secret scanning is automatically enabled for new repositories and repositories transferred to thisenterprise. +func (m *EnterpriseSecurityAnalysisSettings) SetSecretScanningEnabledForNewRepositories(value *bool)() { + m.secret_scanning_enabled_for_new_repositories = value +} +// SetSecretScanningPushProtectionCustomLink sets the secret_scanning_push_protection_custom_link property value. An optional URL string to display to contributors who are blocked from pushing a secret. +func (m *EnterpriseSecurityAnalysisSettings) SetSecretScanningPushProtectionCustomLink(value *string)() { + m.secret_scanning_push_protection_custom_link = value +} +// SetSecretScanningPushProtectionEnabledForNewRepositories sets the secret_scanning_push_protection_enabled_for_new_repositories property value. Whether secret scanning push protection is automatically enabled for new repositories and repositoriestransferred to this enterprise. +func (m *EnterpriseSecurityAnalysisSettings) SetSecretScanningPushProtectionEnabledForNewRepositories(value *bool)() { + m.secret_scanning_push_protection_enabled_for_new_repositories = value +} +type EnterpriseSecurityAnalysisSettingsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurityEnabledForNewRepositories()(*bool) + GetAdvancedSecurityEnabledForNewUserNamespaceRepositories()(*bool) + GetDependabotAlertsEnabledForNewRepositories()(*bool) + GetSecretScanningEnabledForNewRepositories()(*bool) + GetSecretScanningPushProtectionCustomLink()(*string) + GetSecretScanningPushProtectionEnabledForNewRepositories()(*bool) + SetAdvancedSecurityEnabledForNewRepositories(value *bool)() + SetAdvancedSecurityEnabledForNewUserNamespaceRepositories(value *bool)() + SetDependabotAlertsEnabledForNewRepositories(value *bool)() + SetSecretScanningEnabledForNewRepositories(value *bool)() + SetSecretScanningPushProtectionCustomLink(value *string)() + SetSecretScanningPushProtectionEnabledForNewRepositories(value *bool)() +} diff --git a/pkg/github/models/enterprise_security_products_overview.go b/pkg/github/models/enterprise_security_products_overview.go new file mode 100644 index 00000000..c5edcc80 --- /dev/null +++ b/pkg/github/models/enterprise_security_products_overview.go @@ -0,0 +1,486 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSecurityProductsOverview struct { + // The active_committers property + active_committers *int32 + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The advanced_security_enabled_repos property + advanced_security_enabled_repos *int32 + // The code_scanning_default_setup_eligible_repos property + code_scanning_default_setup_eligible_repos *int32 + // The code_scanning_default_setup_enabled_repos property + code_scanning_default_setup_enabled_repos *int32 + // The code_scanning_enabled_repos property + code_scanning_enabled_repos *int32 + // The code_scanning_pr_reviews_enabled_repos property + code_scanning_pr_reviews_enabled_repos *int32 + // The dependabot_alerts_enabled_repos property + dependabot_alerts_enabled_repos *int32 + // The dependabot_security_updates_enabled_repos property + dependabot_security_updates_enabled_repos *int32 + // The dependabot_version_updates_enabled_repos property + dependabot_version_updates_enabled_repos *int32 + // The maximum_committers property + maximum_committers *int32 + // The nonarchived_repos property + nonarchived_repos *int32 + // The purchased_committers property + purchased_committers *int32 + // The secret_scanning_enabled_repos property + secret_scanning_enabled_repos *int32 + // The secret_scanning_push_protection_enabled_repos property + secret_scanning_push_protection_enabled_repos *int32 + // The total_repos property + total_repos *int32 +} +// NewEnterpriseSecurityProductsOverview instantiates a new EnterpriseSecurityProductsOverview and sets the default values. +func NewEnterpriseSecurityProductsOverview()(*EnterpriseSecurityProductsOverview) { + m := &EnterpriseSecurityProductsOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSecurityProductsOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSecurityProductsOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSecurityProductsOverview(), nil +} +// GetActiveCommitters gets the active_committers property value. The active_committers property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetActiveCommitters()(*int32) { + return m.active_committers +} +// 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 *EnterpriseSecurityProductsOverview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurityEnabledRepos gets the advanced_security_enabled_repos property value. The advanced_security_enabled_repos property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetAdvancedSecurityEnabledRepos()(*int32) { + return m.advanced_security_enabled_repos +} +// GetCodeScanningDefaultSetupEligibleRepos gets the code_scanning_default_setup_eligible_repos property value. The code_scanning_default_setup_eligible_repos property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetCodeScanningDefaultSetupEligibleRepos()(*int32) { + return m.code_scanning_default_setup_eligible_repos +} +// GetCodeScanningDefaultSetupEnabledRepos gets the code_scanning_default_setup_enabled_repos property value. The code_scanning_default_setup_enabled_repos property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetCodeScanningDefaultSetupEnabledRepos()(*int32) { + return m.code_scanning_default_setup_enabled_repos +} +// GetCodeScanningEnabledRepos gets the code_scanning_enabled_repos property value. The code_scanning_enabled_repos property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetCodeScanningEnabledRepos()(*int32) { + return m.code_scanning_enabled_repos +} +// GetCodeScanningPrReviewsEnabledRepos gets the code_scanning_pr_reviews_enabled_repos property value. The code_scanning_pr_reviews_enabled_repos property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetCodeScanningPrReviewsEnabledRepos()(*int32) { + return m.code_scanning_pr_reviews_enabled_repos +} +// GetDependabotAlertsEnabledRepos gets the dependabot_alerts_enabled_repos property value. The dependabot_alerts_enabled_repos property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetDependabotAlertsEnabledRepos()(*int32) { + return m.dependabot_alerts_enabled_repos +} +// GetDependabotSecurityUpdatesEnabledRepos gets the dependabot_security_updates_enabled_repos property value. The dependabot_security_updates_enabled_repos property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetDependabotSecurityUpdatesEnabledRepos()(*int32) { + return m.dependabot_security_updates_enabled_repos +} +// GetDependabotVersionUpdatesEnabledRepos gets the dependabot_version_updates_enabled_repos property value. The dependabot_version_updates_enabled_repos property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetDependabotVersionUpdatesEnabledRepos()(*int32) { + return m.dependabot_version_updates_enabled_repos +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSecurityProductsOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active_committers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActiveCommitters(val) + } + return nil + } + res["advanced_security_enabled_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurityEnabledRepos(val) + } + return nil + } + res["code_scanning_default_setup_eligible_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCodeScanningDefaultSetupEligibleRepos(val) + } + return nil + } + res["code_scanning_default_setup_enabled_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCodeScanningDefaultSetupEnabledRepos(val) + } + return nil + } + res["code_scanning_enabled_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCodeScanningEnabledRepos(val) + } + return nil + } + res["code_scanning_pr_reviews_enabled_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCodeScanningPrReviewsEnabledRepos(val) + } + return nil + } + res["dependabot_alerts_enabled_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDependabotAlertsEnabledRepos(val) + } + return nil + } + res["dependabot_security_updates_enabled_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDependabotSecurityUpdatesEnabledRepos(val) + } + return nil + } + res["dependabot_version_updates_enabled_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDependabotVersionUpdatesEnabledRepos(val) + } + return nil + } + res["maximum_committers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMaximumCommitters(val) + } + return nil + } + res["nonarchived_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNonarchivedRepos(val) + } + return nil + } + res["purchased_committers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPurchasedCommitters(val) + } + return nil + } + res["secret_scanning_enabled_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningEnabledRepos(val) + } + return nil + } + res["secret_scanning_push_protection_enabled_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionEnabledRepos(val) + } + return nil + } + res["total_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalRepos(val) + } + return nil + } + return res +} +// GetMaximumCommitters gets the maximum_committers property value. The maximum_committers property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetMaximumCommitters()(*int32) { + return m.maximum_committers +} +// GetNonarchivedRepos gets the nonarchived_repos property value. The nonarchived_repos property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetNonarchivedRepos()(*int32) { + return m.nonarchived_repos +} +// GetPurchasedCommitters gets the purchased_committers property value. The purchased_committers property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetPurchasedCommitters()(*int32) { + return m.purchased_committers +} +// GetSecretScanningEnabledRepos gets the secret_scanning_enabled_repos property value. The secret_scanning_enabled_repos property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetSecretScanningEnabledRepos()(*int32) { + return m.secret_scanning_enabled_repos +} +// GetSecretScanningPushProtectionEnabledRepos gets the secret_scanning_push_protection_enabled_repos property value. The secret_scanning_push_protection_enabled_repos property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetSecretScanningPushProtectionEnabledRepos()(*int32) { + return m.secret_scanning_push_protection_enabled_repos +} +// GetTotalRepos gets the total_repos property value. The total_repos property +// returns a *int32 when successful +func (m *EnterpriseSecurityProductsOverview) GetTotalRepos()(*int32) { + return m.total_repos +} +// Serialize serializes information the current object +func (m *EnterpriseSecurityProductsOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("active_committers", m.GetActiveCommitters()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("advanced_security_enabled_repos", m.GetAdvancedSecurityEnabledRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("code_scanning_default_setup_eligible_repos", m.GetCodeScanningDefaultSetupEligibleRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("code_scanning_default_setup_enabled_repos", m.GetCodeScanningDefaultSetupEnabledRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("code_scanning_enabled_repos", m.GetCodeScanningEnabledRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("code_scanning_pr_reviews_enabled_repos", m.GetCodeScanningPrReviewsEnabledRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("dependabot_alerts_enabled_repos", m.GetDependabotAlertsEnabledRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("dependabot_security_updates_enabled_repos", m.GetDependabotSecurityUpdatesEnabledRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("dependabot_version_updates_enabled_repos", m.GetDependabotVersionUpdatesEnabledRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("maximum_committers", m.GetMaximumCommitters()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("nonarchived_repos", m.GetNonarchivedRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("purchased_committers", m.GetPurchasedCommitters()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("secret_scanning_enabled_repos", m.GetSecretScanningEnabledRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("secret_scanning_push_protection_enabled_repos", m.GetSecretScanningPushProtectionEnabledRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_repos", m.GetTotalRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveCommitters sets the active_committers property value. The active_committers property +func (m *EnterpriseSecurityProductsOverview) SetActiveCommitters(value *int32)() { + m.active_committers = 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 *EnterpriseSecurityProductsOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurityEnabledRepos sets the advanced_security_enabled_repos property value. The advanced_security_enabled_repos property +func (m *EnterpriseSecurityProductsOverview) SetAdvancedSecurityEnabledRepos(value *int32)() { + m.advanced_security_enabled_repos = value +} +// SetCodeScanningDefaultSetupEligibleRepos sets the code_scanning_default_setup_eligible_repos property value. The code_scanning_default_setup_eligible_repos property +func (m *EnterpriseSecurityProductsOverview) SetCodeScanningDefaultSetupEligibleRepos(value *int32)() { + m.code_scanning_default_setup_eligible_repos = value +} +// SetCodeScanningDefaultSetupEnabledRepos sets the code_scanning_default_setup_enabled_repos property value. The code_scanning_default_setup_enabled_repos property +func (m *EnterpriseSecurityProductsOverview) SetCodeScanningDefaultSetupEnabledRepos(value *int32)() { + m.code_scanning_default_setup_enabled_repos = value +} +// SetCodeScanningEnabledRepos sets the code_scanning_enabled_repos property value. The code_scanning_enabled_repos property +func (m *EnterpriseSecurityProductsOverview) SetCodeScanningEnabledRepos(value *int32)() { + m.code_scanning_enabled_repos = value +} +// SetCodeScanningPrReviewsEnabledRepos sets the code_scanning_pr_reviews_enabled_repos property value. The code_scanning_pr_reviews_enabled_repos property +func (m *EnterpriseSecurityProductsOverview) SetCodeScanningPrReviewsEnabledRepos(value *int32)() { + m.code_scanning_pr_reviews_enabled_repos = value +} +// SetDependabotAlertsEnabledRepos sets the dependabot_alerts_enabled_repos property value. The dependabot_alerts_enabled_repos property +func (m *EnterpriseSecurityProductsOverview) SetDependabotAlertsEnabledRepos(value *int32)() { + m.dependabot_alerts_enabled_repos = value +} +// SetDependabotSecurityUpdatesEnabledRepos sets the dependabot_security_updates_enabled_repos property value. The dependabot_security_updates_enabled_repos property +func (m *EnterpriseSecurityProductsOverview) SetDependabotSecurityUpdatesEnabledRepos(value *int32)() { + m.dependabot_security_updates_enabled_repos = value +} +// SetDependabotVersionUpdatesEnabledRepos sets the dependabot_version_updates_enabled_repos property value. The dependabot_version_updates_enabled_repos property +func (m *EnterpriseSecurityProductsOverview) SetDependabotVersionUpdatesEnabledRepos(value *int32)() { + m.dependabot_version_updates_enabled_repos = value +} +// SetMaximumCommitters sets the maximum_committers property value. The maximum_committers property +func (m *EnterpriseSecurityProductsOverview) SetMaximumCommitters(value *int32)() { + m.maximum_committers = value +} +// SetNonarchivedRepos sets the nonarchived_repos property value. The nonarchived_repos property +func (m *EnterpriseSecurityProductsOverview) SetNonarchivedRepos(value *int32)() { + m.nonarchived_repos = value +} +// SetPurchasedCommitters sets the purchased_committers property value. The purchased_committers property +func (m *EnterpriseSecurityProductsOverview) SetPurchasedCommitters(value *int32)() { + m.purchased_committers = value +} +// SetSecretScanningEnabledRepos sets the secret_scanning_enabled_repos property value. The secret_scanning_enabled_repos property +func (m *EnterpriseSecurityProductsOverview) SetSecretScanningEnabledRepos(value *int32)() { + m.secret_scanning_enabled_repos = value +} +// SetSecretScanningPushProtectionEnabledRepos sets the secret_scanning_push_protection_enabled_repos property value. The secret_scanning_push_protection_enabled_repos property +func (m *EnterpriseSecurityProductsOverview) SetSecretScanningPushProtectionEnabledRepos(value *int32)() { + m.secret_scanning_push_protection_enabled_repos = value +} +// SetTotalRepos sets the total_repos property value. The total_repos property +func (m *EnterpriseSecurityProductsOverview) SetTotalRepos(value *int32)() { + m.total_repos = value +} +type EnterpriseSecurityProductsOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveCommitters()(*int32) + GetAdvancedSecurityEnabledRepos()(*int32) + GetCodeScanningDefaultSetupEligibleRepos()(*int32) + GetCodeScanningDefaultSetupEnabledRepos()(*int32) + GetCodeScanningEnabledRepos()(*int32) + GetCodeScanningPrReviewsEnabledRepos()(*int32) + GetDependabotAlertsEnabledRepos()(*int32) + GetDependabotSecurityUpdatesEnabledRepos()(*int32) + GetDependabotVersionUpdatesEnabledRepos()(*int32) + GetMaximumCommitters()(*int32) + GetNonarchivedRepos()(*int32) + GetPurchasedCommitters()(*int32) + GetSecretScanningEnabledRepos()(*int32) + GetSecretScanningPushProtectionEnabledRepos()(*int32) + GetTotalRepos()(*int32) + SetActiveCommitters(value *int32)() + SetAdvancedSecurityEnabledRepos(value *int32)() + SetCodeScanningDefaultSetupEligibleRepos(value *int32)() + SetCodeScanningDefaultSetupEnabledRepos(value *int32)() + SetCodeScanningEnabledRepos(value *int32)() + SetCodeScanningPrReviewsEnabledRepos(value *int32)() + SetDependabotAlertsEnabledRepos(value *int32)() + SetDependabotSecurityUpdatesEnabledRepos(value *int32)() + SetDependabotVersionUpdatesEnabledRepos(value *int32)() + SetMaximumCommitters(value *int32)() + SetNonarchivedRepos(value *int32)() + SetPurchasedCommitters(value *int32)() + SetSecretScanningEnabledRepos(value *int32)() + SetSecretScanningPushProtectionEnabledRepos(value *int32)() + SetTotalRepos(value *int32)() +} diff --git a/pkg/github/models/enterprise_settings.go b/pkg/github/models/enterprise_settings.go new file mode 100644 index 00000000..4675ac7a --- /dev/null +++ b/pkg/github/models/enterprise_settings.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings 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 enterprise property + enterprise EnterpriseSettings_enterpriseable + // The run_list property + run_list []string +} +// NewEnterpriseSettings instantiates a new EnterpriseSettings and sets the default values. +func NewEnterpriseSettings()(*EnterpriseSettings) { + m := &EnterpriseSettings{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettingsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettingsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings(), 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 *EnterpriseSettings) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnterprise gets the enterprise property value. The enterprise property +// returns a EnterpriseSettings_enterpriseable when successful +func (m *EnterpriseSettings) GetEnterprise()(EnterpriseSettings_enterpriseable) { + return m.enterprise +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enterprise"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterpriseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetEnterprise(val.(EnterpriseSettings_enterpriseable)) + } + return nil + } + res["run_list"] = 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.SetRunList(res) + } + return nil + } + return res +} +// GetRunList gets the run_list property value. The run_list property +// returns a []string when successful +func (m *EnterpriseSettings) GetRunList()([]string) { + return m.run_list +} +// Serialize serializes information the current object +func (m *EnterpriseSettings) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("enterprise", m.GetEnterprise()) + if err != nil { + return err + } + } + if m.GetRunList() != nil { + err := writer.WriteCollectionOfStringValues("run_list", m.GetRunList()) + 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 *EnterpriseSettings) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnterprise sets the enterprise property value. The enterprise property +func (m *EnterpriseSettings) SetEnterprise(value EnterpriseSettings_enterpriseable)() { + m.enterprise = value +} +// SetRunList sets the run_list property value. The run_list property +func (m *EnterpriseSettings) SetRunList(value []string)() { + m.run_list = value +} +type EnterpriseSettingsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnterprise()(EnterpriseSettings_enterpriseable) + GetRunList()([]string) + SetEnterprise(value EnterpriseSettings_enterpriseable)() + SetRunList(value []string)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise.go b/pkg/github/models/enterprise_settings_escaped_enterprise.go new file mode 100644 index 00000000..eefd5a1e --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise.go @@ -0,0 +1,921 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise 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 admin_password property + admin_password *string + // The assets property + assets *string + // The auth_mode property + auth_mode *string + // The avatar property + avatar EnterpriseSettings_enterprise_avatarable + // The cas property + cas EnterpriseSettings_enterprise_casable + // The collectd property + collectd EnterpriseSettings_enterprise_collectdable + // The configuration_id property + configuration_id *int32 + // The configuration_run_count property + configuration_run_count *int32 + // The customer property + customer EnterpriseSettings_enterprise_customerable + // The expire_sessions property + expire_sessions *bool + // The github_hostname property + github_hostname *string + // The github_oauth property + github_oauth EnterpriseSettings_enterprise_github_oauthable + // The github_ssl property + github_ssl EnterpriseSettings_enterprise_github_sslable + // The http_proxy property + http_proxy *string + // The identicons_host property + identicons_host *string + // The ldap property + ldap EnterpriseSettings_enterprise_ldapable + // The license property + license EnterpriseSettings_enterprise_licenseable + // The load_balancer property + load_balancer *string + // The mapping property + mapping EnterpriseSettings_enterprise_mappingable + // The ntp property + ntp EnterpriseSettings_enterprise_ntpable + // The pages property + pages EnterpriseSettings_enterprise_pagesable + // The private_mode property + private_mode *bool + // The public_pages property + public_pages *bool + // The saml property + saml EnterpriseSettings_enterprise_samlable + // The signup_enabled property + signup_enabled *bool + // The smtp property + smtp EnterpriseSettings_enterprise_smtpable + // The snmp property + snmp EnterpriseSettings_enterprise_snmpable + // The subdomain_isolation property + subdomain_isolation *bool + // The syslog property + syslog EnterpriseSettings_enterprise_syslogable + // The timezone property + timezone *string +} +// NewEnterpriseSettings_enterprise instantiates a new EnterpriseSettings_enterprise and sets the default values. +func NewEnterpriseSettings_enterprise()(*EnterpriseSettings_enterprise) { + m := &EnterpriseSettings_enterprise{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterpriseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterpriseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise(), 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 *EnterpriseSettings_enterprise) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdminPassword gets the admin_password property value. The admin_password property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise) GetAdminPassword()(*string) { + return m.admin_password +} +// GetAssets gets the assets property value. The assets property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise) GetAssets()(*string) { + return m.assets +} +// GetAuthMode gets the auth_mode property value. The auth_mode property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise) GetAuthMode()(*string) { + return m.auth_mode +} +// GetAvatar gets the avatar property value. The avatar property +// returns a EnterpriseSettings_enterprise_avatarable when successful +func (m *EnterpriseSettings_enterprise) GetAvatar()(EnterpriseSettings_enterprise_avatarable) { + return m.avatar +} +// GetCas gets the cas property value. The cas property +// returns a EnterpriseSettings_enterprise_casable when successful +func (m *EnterpriseSettings_enterprise) GetCas()(EnterpriseSettings_enterprise_casable) { + return m.cas +} +// GetCollectd gets the collectd property value. The collectd property +// returns a EnterpriseSettings_enterprise_collectdable when successful +func (m *EnterpriseSettings_enterprise) GetCollectd()(EnterpriseSettings_enterprise_collectdable) { + return m.collectd +} +// GetConfigurationId gets the configuration_id property value. The configuration_id property +// returns a *int32 when successful +func (m *EnterpriseSettings_enterprise) GetConfigurationId()(*int32) { + return m.configuration_id +} +// GetConfigurationRunCount gets the configuration_run_count property value. The configuration_run_count property +// returns a *int32 when successful +func (m *EnterpriseSettings_enterprise) GetConfigurationRunCount()(*int32) { + return m.configuration_run_count +} +// GetCustomer gets the customer property value. The customer property +// returns a EnterpriseSettings_enterprise_customerable when successful +func (m *EnterpriseSettings_enterprise) GetCustomer()(EnterpriseSettings_enterprise_customerable) { + return m.customer +} +// GetExpireSessions gets the expire_sessions property value. The expire_sessions property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise) GetExpireSessions()(*bool) { + return m.expire_sessions +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings_enterprise) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin_password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAdminPassword(val) + } + return nil + } + res["assets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssets(val) + } + return nil + } + res["auth_mode"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAuthMode(val) + } + return nil + } + res["avatar"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_avatarFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAvatar(val.(EnterpriseSettings_enterprise_avatarable)) + } + return nil + } + res["cas"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_casFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCas(val.(EnterpriseSettings_enterprise_casable)) + } + return nil + } + res["collectd"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_collectdFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCollectd(val.(EnterpriseSettings_enterprise_collectdable)) + } + return nil + } + res["configuration_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetConfigurationId(val) + } + return nil + } + res["configuration_run_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetConfigurationRunCount(val) + } + return nil + } + res["customer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_customerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCustomer(val.(EnterpriseSettings_enterprise_customerable)) + } + return nil + } + res["expire_sessions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExpireSessions(val) + } + return nil + } + res["github_hostname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGithubHostname(val) + } + return nil + } + res["github_oauth"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_github_oauthFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetGithubOauth(val.(EnterpriseSettings_enterprise_github_oauthable)) + } + return nil + } + res["github_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_github_sslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetGithubSsl(val.(EnterpriseSettings_enterprise_github_sslable)) + } + return nil + } + res["http_proxy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHttpProxy(val) + } + return nil + } + res["identicons_host"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIdenticonsHost(val) + } + return nil + } + res["ldap"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_ldapFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLdap(val.(EnterpriseSettings_enterprise_ldapable)) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_licenseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(EnterpriseSettings_enterprise_licenseable)) + } + return nil + } + res["load_balancer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLoadBalancer(val) + } + return nil + } + res["mapping"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_mappingFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMapping(val.(EnterpriseSettings_enterprise_mappingable)) + } + return nil + } + res["ntp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_ntpFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetNtp(val.(EnterpriseSettings_enterprise_ntpable)) + } + return nil + } + res["pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_pagesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPages(val.(EnterpriseSettings_enterprise_pagesable)) + } + return nil + } + res["private_mode"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivateMode(val) + } + return nil + } + res["public_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicPages(val) + } + return nil + } + res["saml"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_samlFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSaml(val.(EnterpriseSettings_enterprise_samlable)) + } + return nil + } + res["signup_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSignupEnabled(val) + } + return nil + } + res["smtp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_smtpFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSmtp(val.(EnterpriseSettings_enterprise_smtpable)) + } + return nil + } + res["snmp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_snmpFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSnmp(val.(EnterpriseSettings_enterprise_snmpable)) + } + return nil + } + res["subdomain_isolation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSubdomainIsolation(val) + } + return nil + } + res["syslog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_syslogFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSyslog(val.(EnterpriseSettings_enterprise_syslogable)) + } + return nil + } + res["timezone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTimezone(val) + } + return nil + } + return res +} +// GetGithubHostname gets the github_hostname property value. The github_hostname property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise) GetGithubHostname()(*string) { + return m.github_hostname +} +// GetGithubOauth gets the github_oauth property value. The github_oauth property +// returns a EnterpriseSettings_enterprise_github_oauthable when successful +func (m *EnterpriseSettings_enterprise) GetGithubOauth()(EnterpriseSettings_enterprise_github_oauthable) { + return m.github_oauth +} +// GetGithubSsl gets the github_ssl property value. The github_ssl property +// returns a EnterpriseSettings_enterprise_github_sslable when successful +func (m *EnterpriseSettings_enterprise) GetGithubSsl()(EnterpriseSettings_enterprise_github_sslable) { + return m.github_ssl +} +// GetHttpProxy gets the http_proxy property value. The http_proxy property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise) GetHttpProxy()(*string) { + return m.http_proxy +} +// GetIdenticonsHost gets the identicons_host property value. The identicons_host property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise) GetIdenticonsHost()(*string) { + return m.identicons_host +} +// GetLdap gets the ldap property value. The ldap property +// returns a EnterpriseSettings_enterprise_ldapable when successful +func (m *EnterpriseSettings_enterprise) GetLdap()(EnterpriseSettings_enterprise_ldapable) { + return m.ldap +} +// GetLicense gets the license property value. The license property +// returns a EnterpriseSettings_enterprise_licenseable when successful +func (m *EnterpriseSettings_enterprise) GetLicense()(EnterpriseSettings_enterprise_licenseable) { + return m.license +} +// GetLoadBalancer gets the load_balancer property value. The load_balancer property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise) GetLoadBalancer()(*string) { + return m.load_balancer +} +// GetMapping gets the mapping property value. The mapping property +// returns a EnterpriseSettings_enterprise_mappingable when successful +func (m *EnterpriseSettings_enterprise) GetMapping()(EnterpriseSettings_enterprise_mappingable) { + return m.mapping +} +// GetNtp gets the ntp property value. The ntp property +// returns a EnterpriseSettings_enterprise_ntpable when successful +func (m *EnterpriseSettings_enterprise) GetNtp()(EnterpriseSettings_enterprise_ntpable) { + return m.ntp +} +// GetPages gets the pages property value. The pages property +// returns a EnterpriseSettings_enterprise_pagesable when successful +func (m *EnterpriseSettings_enterprise) GetPages()(EnterpriseSettings_enterprise_pagesable) { + return m.pages +} +// GetPrivateMode gets the private_mode property value. The private_mode property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise) GetPrivateMode()(*bool) { + return m.private_mode +} +// GetPublicPages gets the public_pages property value. The public_pages property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise) GetPublicPages()(*bool) { + return m.public_pages +} +// GetSaml gets the saml property value. The saml property +// returns a EnterpriseSettings_enterprise_samlable when successful +func (m *EnterpriseSettings_enterprise) GetSaml()(EnterpriseSettings_enterprise_samlable) { + return m.saml +} +// GetSignupEnabled gets the signup_enabled property value. The signup_enabled property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise) GetSignupEnabled()(*bool) { + return m.signup_enabled +} +// GetSmtp gets the smtp property value. The smtp property +// returns a EnterpriseSettings_enterprise_smtpable when successful +func (m *EnterpriseSettings_enterprise) GetSmtp()(EnterpriseSettings_enterprise_smtpable) { + return m.smtp +} +// GetSnmp gets the snmp property value. The snmp property +// returns a EnterpriseSettings_enterprise_snmpable when successful +func (m *EnterpriseSettings_enterprise) GetSnmp()(EnterpriseSettings_enterprise_snmpable) { + return m.snmp +} +// GetSubdomainIsolation gets the subdomain_isolation property value. The subdomain_isolation property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise) GetSubdomainIsolation()(*bool) { + return m.subdomain_isolation +} +// GetSyslog gets the syslog property value. The syslog property +// returns a EnterpriseSettings_enterprise_syslogable when successful +func (m *EnterpriseSettings_enterprise) GetSyslog()(EnterpriseSettings_enterprise_syslogable) { + return m.syslog +} +// GetTimezone gets the timezone property value. The timezone property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise) GetTimezone()(*string) { + return m.timezone +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("admin_password", m.GetAdminPassword()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assets", m.GetAssets()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("auth_mode", m.GetAuthMode()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("avatar", m.GetAvatar()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("cas", m.GetCas()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("collectd", m.GetCollectd()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("configuration_id", m.GetConfigurationId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("configuration_run_count", m.GetConfigurationRunCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("customer", m.GetCustomer()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("expire_sessions", m.GetExpireSessions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("github_hostname", m.GetGithubHostname()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("github_oauth", m.GetGithubOauth()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("github_ssl", m.GetGithubSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("http_proxy", m.GetHttpProxy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("identicons_host", m.GetIdenticonsHost()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("ldap", m.GetLdap()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("load_balancer", m.GetLoadBalancer()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("mapping", m.GetMapping()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("ntp", m.GetNtp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pages", m.GetPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private_mode", m.GetPrivateMode()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("public_pages", m.GetPublicPages()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("saml", m.GetSaml()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("signup_enabled", m.GetSignupEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("smtp", m.GetSmtp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("snmp", m.GetSnmp()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("subdomain_isolation", m.GetSubdomainIsolation()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("syslog", m.GetSyslog()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("timezone", m.GetTimezone()) + 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 *EnterpriseSettings_enterprise) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdminPassword sets the admin_password property value. The admin_password property +func (m *EnterpriseSettings_enterprise) SetAdminPassword(value *string)() { + m.admin_password = value +} +// SetAssets sets the assets property value. The assets property +func (m *EnterpriseSettings_enterprise) SetAssets(value *string)() { + m.assets = value +} +// SetAuthMode sets the auth_mode property value. The auth_mode property +func (m *EnterpriseSettings_enterprise) SetAuthMode(value *string)() { + m.auth_mode = value +} +// SetAvatar sets the avatar property value. The avatar property +func (m *EnterpriseSettings_enterprise) SetAvatar(value EnterpriseSettings_enterprise_avatarable)() { + m.avatar = value +} +// SetCas sets the cas property value. The cas property +func (m *EnterpriseSettings_enterprise) SetCas(value EnterpriseSettings_enterprise_casable)() { + m.cas = value +} +// SetCollectd sets the collectd property value. The collectd property +func (m *EnterpriseSettings_enterprise) SetCollectd(value EnterpriseSettings_enterprise_collectdable)() { + m.collectd = value +} +// SetConfigurationId sets the configuration_id property value. The configuration_id property +func (m *EnterpriseSettings_enterprise) SetConfigurationId(value *int32)() { + m.configuration_id = value +} +// SetConfigurationRunCount sets the configuration_run_count property value. The configuration_run_count property +func (m *EnterpriseSettings_enterprise) SetConfigurationRunCount(value *int32)() { + m.configuration_run_count = value +} +// SetCustomer sets the customer property value. The customer property +func (m *EnterpriseSettings_enterprise) SetCustomer(value EnterpriseSettings_enterprise_customerable)() { + m.customer = value +} +// SetExpireSessions sets the expire_sessions property value. The expire_sessions property +func (m *EnterpriseSettings_enterprise) SetExpireSessions(value *bool)() { + m.expire_sessions = value +} +// SetGithubHostname sets the github_hostname property value. The github_hostname property +func (m *EnterpriseSettings_enterprise) SetGithubHostname(value *string)() { + m.github_hostname = value +} +// SetGithubOauth sets the github_oauth property value. The github_oauth property +func (m *EnterpriseSettings_enterprise) SetGithubOauth(value EnterpriseSettings_enterprise_github_oauthable)() { + m.github_oauth = value +} +// SetGithubSsl sets the github_ssl property value. The github_ssl property +func (m *EnterpriseSettings_enterprise) SetGithubSsl(value EnterpriseSettings_enterprise_github_sslable)() { + m.github_ssl = value +} +// SetHttpProxy sets the http_proxy property value. The http_proxy property +func (m *EnterpriseSettings_enterprise) SetHttpProxy(value *string)() { + m.http_proxy = value +} +// SetIdenticonsHost sets the identicons_host property value. The identicons_host property +func (m *EnterpriseSettings_enterprise) SetIdenticonsHost(value *string)() { + m.identicons_host = value +} +// SetLdap sets the ldap property value. The ldap property +func (m *EnterpriseSettings_enterprise) SetLdap(value EnterpriseSettings_enterprise_ldapable)() { + m.ldap = value +} +// SetLicense sets the license property value. The license property +func (m *EnterpriseSettings_enterprise) SetLicense(value EnterpriseSettings_enterprise_licenseable)() { + m.license = value +} +// SetLoadBalancer sets the load_balancer property value. The load_balancer property +func (m *EnterpriseSettings_enterprise) SetLoadBalancer(value *string)() { + m.load_balancer = value +} +// SetMapping sets the mapping property value. The mapping property +func (m *EnterpriseSettings_enterprise) SetMapping(value EnterpriseSettings_enterprise_mappingable)() { + m.mapping = value +} +// SetNtp sets the ntp property value. The ntp property +func (m *EnterpriseSettings_enterprise) SetNtp(value EnterpriseSettings_enterprise_ntpable)() { + m.ntp = value +} +// SetPages sets the pages property value. The pages property +func (m *EnterpriseSettings_enterprise) SetPages(value EnterpriseSettings_enterprise_pagesable)() { + m.pages = value +} +// SetPrivateMode sets the private_mode property value. The private_mode property +func (m *EnterpriseSettings_enterprise) SetPrivateMode(value *bool)() { + m.private_mode = value +} +// SetPublicPages sets the public_pages property value. The public_pages property +func (m *EnterpriseSettings_enterprise) SetPublicPages(value *bool)() { + m.public_pages = value +} +// SetSaml sets the saml property value. The saml property +func (m *EnterpriseSettings_enterprise) SetSaml(value EnterpriseSettings_enterprise_samlable)() { + m.saml = value +} +// SetSignupEnabled sets the signup_enabled property value. The signup_enabled property +func (m *EnterpriseSettings_enterprise) SetSignupEnabled(value *bool)() { + m.signup_enabled = value +} +// SetSmtp sets the smtp property value. The smtp property +func (m *EnterpriseSettings_enterprise) SetSmtp(value EnterpriseSettings_enterprise_smtpable)() { + m.smtp = value +} +// SetSnmp sets the snmp property value. The snmp property +func (m *EnterpriseSettings_enterprise) SetSnmp(value EnterpriseSettings_enterprise_snmpable)() { + m.snmp = value +} +// SetSubdomainIsolation sets the subdomain_isolation property value. The subdomain_isolation property +func (m *EnterpriseSettings_enterprise) SetSubdomainIsolation(value *bool)() { + m.subdomain_isolation = value +} +// SetSyslog sets the syslog property value. The syslog property +func (m *EnterpriseSettings_enterprise) SetSyslog(value EnterpriseSettings_enterprise_syslogable)() { + m.syslog = value +} +// SetTimezone sets the timezone property value. The timezone property +func (m *EnterpriseSettings_enterprise) SetTimezone(value *string)() { + m.timezone = value +} +type EnterpriseSettings_enterpriseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdminPassword()(*string) + GetAssets()(*string) + GetAuthMode()(*string) + GetAvatar()(EnterpriseSettings_enterprise_avatarable) + GetCas()(EnterpriseSettings_enterprise_casable) + GetCollectd()(EnterpriseSettings_enterprise_collectdable) + GetConfigurationId()(*int32) + GetConfigurationRunCount()(*int32) + GetCustomer()(EnterpriseSettings_enterprise_customerable) + GetExpireSessions()(*bool) + GetGithubHostname()(*string) + GetGithubOauth()(EnterpriseSettings_enterprise_github_oauthable) + GetGithubSsl()(EnterpriseSettings_enterprise_github_sslable) + GetHttpProxy()(*string) + GetIdenticonsHost()(*string) + GetLdap()(EnterpriseSettings_enterprise_ldapable) + GetLicense()(EnterpriseSettings_enterprise_licenseable) + GetLoadBalancer()(*string) + GetMapping()(EnterpriseSettings_enterprise_mappingable) + GetNtp()(EnterpriseSettings_enterprise_ntpable) + GetPages()(EnterpriseSettings_enterprise_pagesable) + GetPrivateMode()(*bool) + GetPublicPages()(*bool) + GetSaml()(EnterpriseSettings_enterprise_samlable) + GetSignupEnabled()(*bool) + GetSmtp()(EnterpriseSettings_enterprise_smtpable) + GetSnmp()(EnterpriseSettings_enterprise_snmpable) + GetSubdomainIsolation()(*bool) + GetSyslog()(EnterpriseSettings_enterprise_syslogable) + GetTimezone()(*string) + SetAdminPassword(value *string)() + SetAssets(value *string)() + SetAuthMode(value *string)() + SetAvatar(value EnterpriseSettings_enterprise_avatarable)() + SetCas(value EnterpriseSettings_enterprise_casable)() + SetCollectd(value EnterpriseSettings_enterprise_collectdable)() + SetConfigurationId(value *int32)() + SetConfigurationRunCount(value *int32)() + SetCustomer(value EnterpriseSettings_enterprise_customerable)() + SetExpireSessions(value *bool)() + SetGithubHostname(value *string)() + SetGithubOauth(value EnterpriseSettings_enterprise_github_oauthable)() + SetGithubSsl(value EnterpriseSettings_enterprise_github_sslable)() + SetHttpProxy(value *string)() + SetIdenticonsHost(value *string)() + SetLdap(value EnterpriseSettings_enterprise_ldapable)() + SetLicense(value EnterpriseSettings_enterprise_licenseable)() + SetLoadBalancer(value *string)() + SetMapping(value EnterpriseSettings_enterprise_mappingable)() + SetNtp(value EnterpriseSettings_enterprise_ntpable)() + SetPages(value EnterpriseSettings_enterprise_pagesable)() + SetPrivateMode(value *bool)() + SetPublicPages(value *bool)() + SetSaml(value EnterpriseSettings_enterprise_samlable)() + SetSignupEnabled(value *bool)() + SetSmtp(value EnterpriseSettings_enterprise_smtpable)() + SetSnmp(value EnterpriseSettings_enterprise_snmpable)() + SetSubdomainIsolation(value *bool)() + SetSyslog(value EnterpriseSettings_enterprise_syslogable)() + SetTimezone(value *string)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_avatar.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_avatar.go new file mode 100644 index 00000000..96e9fb75 --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_avatar.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_avatar 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 enabled property + enabled *bool + // The uri property + uri *string +} +// NewEnterpriseSettings_enterprise_avatar instantiates a new EnterpriseSettings_enterprise_avatar and sets the default values. +func NewEnterpriseSettings_enterprise_avatar()(*EnterpriseSettings_enterprise_avatar) { + m := &EnterpriseSettings_enterprise_avatar{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_avatarFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_avatarFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_avatar(), 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 *EnterpriseSettings_enterprise_avatar) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_avatar) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings_enterprise_avatar) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["uri"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUri(val) + } + return nil + } + return res +} +// GetUri gets the uri property value. The uri property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_avatar) GetUri()(*string) { + return m.uri +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_avatar) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("uri", m.GetUri()) + 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 *EnterpriseSettings_enterprise_avatar) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *EnterpriseSettings_enterprise_avatar) SetEnabled(value *bool)() { + m.enabled = value +} +// SetUri sets the uri property value. The uri property +func (m *EnterpriseSettings_enterprise_avatar) SetUri(value *string)() { + m.uri = value +} +type EnterpriseSettings_enterprise_avatarable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetUri()(*string) + SetEnabled(value *bool)() + SetUri(value *string)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_cas.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_cas.go new file mode 100644 index 00000000..17e9fdbe --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_cas.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_cas 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 url property + url *string +} +// NewEnterpriseSettings_enterprise_cas instantiates a new EnterpriseSettings_enterprise_cas and sets the default values. +func NewEnterpriseSettings_enterprise_cas()(*EnterpriseSettings_enterprise_cas) { + m := &EnterpriseSettings_enterprise_cas{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_casFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_casFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_cas(), 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 *EnterpriseSettings_enterprise_cas) 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 *EnterpriseSettings_enterprise_cas) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_cas) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_cas) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *EnterpriseSettings_enterprise_cas) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetUrl sets the url property value. The url property +func (m *EnterpriseSettings_enterprise_cas) SetUrl(value *string)() { + m.url = value +} +type EnterpriseSettings_enterprise_casable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetUrl()(*string) + SetUrl(value *string)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_collectd.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_collectd.go new file mode 100644 index 00000000..4a11fc54 --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_collectd.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_collectd 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 enabled property + enabled *bool + // The encryption property + encryption *string + // The password property + password *string + // The port property + port *int32 + // The server property + server *string + // The username property + username *string +} +// NewEnterpriseSettings_enterprise_collectd instantiates a new EnterpriseSettings_enterprise_collectd and sets the default values. +func NewEnterpriseSettings_enterprise_collectd()(*EnterpriseSettings_enterprise_collectd) { + m := &EnterpriseSettings_enterprise_collectd{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_collectdFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_collectdFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_collectd(), 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 *EnterpriseSettings_enterprise_collectd) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_collectd) GetEnabled()(*bool) { + return m.enabled +} +// GetEncryption gets the encryption property value. The encryption property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_collectd) GetEncryption()(*string) { + return m.encryption +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings_enterprise_collectd) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["encryption"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncryption(val) + } + return nil + } + res["password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPassword(val) + } + return nil + } + res["port"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPort(val) + } + return nil + } + res["server"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetServer(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 + } + return res +} +// GetPassword gets the password property value. The password property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_collectd) GetPassword()(*string) { + return m.password +} +// GetPort gets the port property value. The port property +// returns a *int32 when successful +func (m *EnterpriseSettings_enterprise_collectd) GetPort()(*int32) { + return m.port +} +// GetServer gets the server property value. The server property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_collectd) GetServer()(*string) { + return m.server +} +// GetUsername gets the username property value. The username property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_collectd) GetUsername()(*string) { + return m.username +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_collectd) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("encryption", m.GetEncryption()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("password", m.GetPassword()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("port", m.GetPort()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("server", m.GetServer()) + 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 *EnterpriseSettings_enterprise_collectd) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *EnterpriseSettings_enterprise_collectd) SetEnabled(value *bool)() { + m.enabled = value +} +// SetEncryption sets the encryption property value. The encryption property +func (m *EnterpriseSettings_enterprise_collectd) SetEncryption(value *string)() { + m.encryption = value +} +// SetPassword sets the password property value. The password property +func (m *EnterpriseSettings_enterprise_collectd) SetPassword(value *string)() { + m.password = value +} +// SetPort sets the port property value. The port property +func (m *EnterpriseSettings_enterprise_collectd) SetPort(value *int32)() { + m.port = value +} +// SetServer sets the server property value. The server property +func (m *EnterpriseSettings_enterprise_collectd) SetServer(value *string)() { + m.server = value +} +// SetUsername sets the username property value. The username property +func (m *EnterpriseSettings_enterprise_collectd) SetUsername(value *string)() { + m.username = value +} +type EnterpriseSettings_enterprise_collectdable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetEncryption()(*string) + GetPassword()(*string) + GetPort()(*int32) + GetServer()(*string) + GetUsername()(*string) + SetEnabled(value *bool)() + SetEncryption(value *string)() + SetPassword(value *string)() + SetPort(value *int32)() + SetServer(value *string)() + SetUsername(value *string)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_customer.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_customer.go new file mode 100644 index 00000000..a3e784d6 --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_customer.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_customer 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 email property + email *string + // The name property + name *string + // The public_key_data property + public_key_data *string + // The secret_key_data property + secret_key_data *string + // The uuid property + uuid *string +} +// NewEnterpriseSettings_enterprise_customer instantiates a new EnterpriseSettings_enterprise_customer and sets the default values. +func NewEnterpriseSettings_enterprise_customer()(*EnterpriseSettings_enterprise_customer) { + m := &EnterpriseSettings_enterprise_customer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_customerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_customerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_customer(), 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 *EnterpriseSettings_enterprise_customer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_customer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings_enterprise_customer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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["public_key_data"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicKeyData(val) + } + return nil + } + res["secret_key_data"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretKeyData(val) + } + return nil + } + res["uuid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUuid(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_customer) GetName()(*string) { + return m.name +} +// GetPublicKeyData gets the public_key_data property value. The public_key_data property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_customer) GetPublicKeyData()(*string) { + return m.public_key_data +} +// GetSecretKeyData gets the secret_key_data property value. The secret_key_data property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_customer) GetSecretKeyData()(*string) { + return m.secret_key_data +} +// GetUuid gets the uuid property value. The uuid property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_customer) GetUuid()(*string) { + return m.uuid +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_customer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_key_data", m.GetPublicKeyData()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_key_data", m.GetSecretKeyData()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("uuid", m.GetUuid()) + 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 *EnterpriseSettings_enterprise_customer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email property +func (m *EnterpriseSettings_enterprise_customer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name property +func (m *EnterpriseSettings_enterprise_customer) SetName(value *string)() { + m.name = value +} +// SetPublicKeyData sets the public_key_data property value. The public_key_data property +func (m *EnterpriseSettings_enterprise_customer) SetPublicKeyData(value *string)() { + m.public_key_data = value +} +// SetSecretKeyData sets the secret_key_data property value. The secret_key_data property +func (m *EnterpriseSettings_enterprise_customer) SetSecretKeyData(value *string)() { + m.secret_key_data = value +} +// SetUuid sets the uuid property value. The uuid property +func (m *EnterpriseSettings_enterprise_customer) SetUuid(value *string)() { + m.uuid = value +} +type EnterpriseSettings_enterprise_customerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + GetPublicKeyData()(*string) + GetSecretKeyData()(*string) + GetUuid()(*string) + SetEmail(value *string)() + SetName(value *string)() + SetPublicKeyData(value *string)() + SetSecretKeyData(value *string)() + SetUuid(value *string)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_github_escaped_oauth.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_github_escaped_oauth.go new file mode 100644 index 00000000..dfd1da71 --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_github_escaped_oauth.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_github_oauth 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 client_id property + client_id *string + // The client_secret property + client_secret *string + // The organization_name property + organization_name *string + // The organization_team property + organization_team *string +} +// NewEnterpriseSettings_enterprise_github_oauth instantiates a new EnterpriseSettings_enterprise_github_oauth and sets the default values. +func NewEnterpriseSettings_enterprise_github_oauth()(*EnterpriseSettings_enterprise_github_oauth) { + m := &EnterpriseSettings_enterprise_github_oauth{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_github_oauthFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_github_oauthFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_github_oauth(), 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 *EnterpriseSettings_enterprise_github_oauth) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientId gets the client_id property value. The client_id property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_github_oauth) GetClientId()(*string) { + return m.client_id +} +// GetClientSecret gets the client_secret property value. The client_secret property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_github_oauth) GetClientSecret()(*string) { + return m.client_secret +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings_enterprise_github_oauth) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientId(val) + } + return nil + } + res["client_secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientSecret(val) + } + return nil + } + res["organization_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationName(val) + } + return nil + } + res["organization_team"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationTeam(val) + } + return nil + } + return res +} +// GetOrganizationName gets the organization_name property value. The organization_name property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_github_oauth) GetOrganizationName()(*string) { + return m.organization_name +} +// GetOrganizationTeam gets the organization_team property value. The organization_team property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_github_oauth) GetOrganizationTeam()(*string) { + return m.organization_team +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_github_oauth) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_id", m.GetClientId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("client_secret", m.GetClientSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_name", m.GetOrganizationName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_team", m.GetOrganizationTeam()) + 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 *EnterpriseSettings_enterprise_github_oauth) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientId sets the client_id property value. The client_id property +func (m *EnterpriseSettings_enterprise_github_oauth) SetClientId(value *string)() { + m.client_id = value +} +// SetClientSecret sets the client_secret property value. The client_secret property +func (m *EnterpriseSettings_enterprise_github_oauth) SetClientSecret(value *string)() { + m.client_secret = value +} +// SetOrganizationName sets the organization_name property value. The organization_name property +func (m *EnterpriseSettings_enterprise_github_oauth) SetOrganizationName(value *string)() { + m.organization_name = value +} +// SetOrganizationTeam sets the organization_team property value. The organization_team property +func (m *EnterpriseSettings_enterprise_github_oauth) SetOrganizationTeam(value *string)() { + m.organization_team = value +} +type EnterpriseSettings_enterprise_github_oauthable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientId()(*string) + GetClientSecret()(*string) + GetOrganizationName()(*string) + GetOrganizationTeam()(*string) + SetClientId(value *string)() + SetClientSecret(value *string)() + SetOrganizationName(value *string)() + SetOrganizationTeam(value *string)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_github_escaped_ssl.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_github_escaped_ssl.go new file mode 100644 index 00000000..b02b4ab7 --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_github_escaped_ssl.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_github_ssl 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 cert property + cert *string + // The enabled property + enabled *bool + // The key property + key *string +} +// NewEnterpriseSettings_enterprise_github_ssl instantiates a new EnterpriseSettings_enterprise_github_ssl and sets the default values. +func NewEnterpriseSettings_enterprise_github_ssl()(*EnterpriseSettings_enterprise_github_ssl) { + m := &EnterpriseSettings_enterprise_github_ssl{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_github_sslFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_github_sslFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_github_ssl(), 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 *EnterpriseSettings_enterprise_github_ssl) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCert gets the cert property value. The cert property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_github_ssl) GetCert()(*string) { + return m.cert +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_github_ssl) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings_enterprise_github_ssl) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cert"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCert(val) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_github_ssl) GetKey()(*string) { + return m.key +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_github_ssl) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("cert", m.GetCert()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + 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 *EnterpriseSettings_enterprise_github_ssl) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCert sets the cert property value. The cert property +func (m *EnterpriseSettings_enterprise_github_ssl) SetCert(value *string)() { + m.cert = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *EnterpriseSettings_enterprise_github_ssl) SetEnabled(value *bool)() { + m.enabled = value +} +// SetKey sets the key property value. The key property +func (m *EnterpriseSettings_enterprise_github_ssl) SetKey(value *string)() { + m.key = value +} +type EnterpriseSettings_enterprise_github_sslable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCert()(*string) + GetEnabled()(*bool) + GetKey()(*string) + SetCert(value *string)() + SetEnabled(value *bool)() + SetKey(value *string)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ldap.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ldap.go new file mode 100644 index 00000000..f9d73260 --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ldap.go @@ -0,0 +1,631 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_ldap 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 admin_group property + admin_group *string + // The base property + base i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + // The bind_dn property + bind_dn *string + // The host property + host *string + // The method property + method *string + // The password property + password *string + // The port property + port *int32 + // The posix_support property + posix_support *bool + // The profile property + profile EnterpriseSettings_enterprise_ldap_profileable + // The reconciliation property + reconciliation EnterpriseSettings_enterprise_ldap_reconciliationable + // The recursive_group_search property + recursive_group_search *bool + // The search_strategy property + search_strategy *string + // The sync_enabled property + sync_enabled *bool + // The team_sync_interval property + team_sync_interval *int32 + // The uid property + uid *string + // The user_groups property + user_groups i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + // The user_sync_emails property + user_sync_emails *bool + // The user_sync_interval property + user_sync_interval *int32 + // The user_sync_keys property + user_sync_keys *bool + // The virtual_attribute_enabled property + virtual_attribute_enabled *bool +} +// NewEnterpriseSettings_enterprise_ldap instantiates a new EnterpriseSettings_enterprise_ldap and sets the default values. +func NewEnterpriseSettings_enterprise_ldap()(*EnterpriseSettings_enterprise_ldap) { + m := &EnterpriseSettings_enterprise_ldap{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_ldapFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_ldapFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_ldap(), 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 *EnterpriseSettings_enterprise_ldap) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdminGroup gets the admin_group property value. The admin_group property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ldap) GetAdminGroup()(*string) { + return m.admin_group +} +// GetBase gets the base property value. The base property +// returns a UntypedNodeable when successful +func (m *EnterpriseSettings_enterprise_ldap) GetBase()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + return m.base +} +// GetBindDn gets the bind_dn property value. The bind_dn property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ldap) GetBindDn()(*string) { + return m.bind_dn +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings_enterprise_ldap) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin_group"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAdminGroup(val) + } + return nil + } + res["base"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBase(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["bind_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBindDn(val) + } + return nil + } + res["host"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHost(val) + } + return nil + } + res["method"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMethod(val) + } + return nil + } + res["password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPassword(val) + } + return nil + } + res["port"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPort(val) + } + return nil + } + res["posix_support"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPosixSupport(val) + } + return nil + } + res["profile"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_ldap_profileFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProfile(val.(EnterpriseSettings_enterprise_ldap_profileable)) + } + return nil + } + res["reconciliation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnterpriseSettings_enterprise_ldap_reconciliationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReconciliation(val.(EnterpriseSettings_enterprise_ldap_reconciliationable)) + } + return nil + } + res["recursive_group_search"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRecursiveGroupSearch(val) + } + return nil + } + res["search_strategy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSearchStrategy(val) + } + return nil + } + res["sync_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSyncEnabled(val) + } + return nil + } + res["team_sync_interval"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTeamSyncInterval(val) + } + return nil + } + res["uid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUid(val) + } + return nil + } + res["user_groups"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUserGroups(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["user_sync_emails"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUserSyncEmails(val) + } + return nil + } + res["user_sync_interval"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUserSyncInterval(val) + } + return nil + } + res["user_sync_keys"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUserSyncKeys(val) + } + return nil + } + res["virtual_attribute_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVirtualAttributeEnabled(val) + } + return nil + } + return res +} +// GetHost gets the host property value. The host property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ldap) GetHost()(*string) { + return m.host +} +// GetMethod gets the method property value. The method property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ldap) GetMethod()(*string) { + return m.method +} +// GetPassword gets the password property value. The password property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ldap) GetPassword()(*string) { + return m.password +} +// GetPort gets the port property value. The port property +// returns a *int32 when successful +func (m *EnterpriseSettings_enterprise_ldap) GetPort()(*int32) { + return m.port +} +// GetPosixSupport gets the posix_support property value. The posix_support property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_ldap) GetPosixSupport()(*bool) { + return m.posix_support +} +// GetProfile gets the profile property value. The profile property +// returns a EnterpriseSettings_enterprise_ldap_profileable when successful +func (m *EnterpriseSettings_enterprise_ldap) GetProfile()(EnterpriseSettings_enterprise_ldap_profileable) { + return m.profile +} +// GetReconciliation gets the reconciliation property value. The reconciliation property +// returns a EnterpriseSettings_enterprise_ldap_reconciliationable when successful +func (m *EnterpriseSettings_enterprise_ldap) GetReconciliation()(EnterpriseSettings_enterprise_ldap_reconciliationable) { + return m.reconciliation +} +// GetRecursiveGroupSearch gets the recursive_group_search property value. The recursive_group_search property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_ldap) GetRecursiveGroupSearch()(*bool) { + return m.recursive_group_search +} +// GetSearchStrategy gets the search_strategy property value. The search_strategy property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ldap) GetSearchStrategy()(*string) { + return m.search_strategy +} +// GetSyncEnabled gets the sync_enabled property value. The sync_enabled property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_ldap) GetSyncEnabled()(*bool) { + return m.sync_enabled +} +// GetTeamSyncInterval gets the team_sync_interval property value. The team_sync_interval property +// returns a *int32 when successful +func (m *EnterpriseSettings_enterprise_ldap) GetTeamSyncInterval()(*int32) { + return m.team_sync_interval +} +// GetUid gets the uid property value. The uid property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ldap) GetUid()(*string) { + return m.uid +} +// GetUserGroups gets the user_groups property value. The user_groups property +// returns a UntypedNodeable when successful +func (m *EnterpriseSettings_enterprise_ldap) GetUserGroups()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + return m.user_groups +} +// GetUserSyncEmails gets the user_sync_emails property value. The user_sync_emails property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_ldap) GetUserSyncEmails()(*bool) { + return m.user_sync_emails +} +// GetUserSyncInterval gets the user_sync_interval property value. The user_sync_interval property +// returns a *int32 when successful +func (m *EnterpriseSettings_enterprise_ldap) GetUserSyncInterval()(*int32) { + return m.user_sync_interval +} +// GetUserSyncKeys gets the user_sync_keys property value. The user_sync_keys property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_ldap) GetUserSyncKeys()(*bool) { + return m.user_sync_keys +} +// GetVirtualAttributeEnabled gets the virtual_attribute_enabled property value. The virtual_attribute_enabled property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_ldap) GetVirtualAttributeEnabled()(*bool) { + return m.virtual_attribute_enabled +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_ldap) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("admin_group", m.GetAdminGroup()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("base", m.GetBase()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("bind_dn", m.GetBindDn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("host", m.GetHost()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("method", m.GetMethod()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("password", m.GetPassword()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("port", m.GetPort()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("posix_support", m.GetPosixSupport()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("profile", m.GetProfile()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reconciliation", m.GetReconciliation()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("recursive_group_search", m.GetRecursiveGroupSearch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("search_strategy", m.GetSearchStrategy()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("sync_enabled", m.GetSyncEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("team_sync_interval", m.GetTeamSyncInterval()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("uid", m.GetUid()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user_groups", m.GetUserGroups()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("user_sync_emails", m.GetUserSyncEmails()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("user_sync_interval", m.GetUserSyncInterval()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("user_sync_keys", m.GetUserSyncKeys()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("virtual_attribute_enabled", m.GetVirtualAttributeEnabled()) + 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 *EnterpriseSettings_enterprise_ldap) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdminGroup sets the admin_group property value. The admin_group property +func (m *EnterpriseSettings_enterprise_ldap) SetAdminGroup(value *string)() { + m.admin_group = value +} +// SetBase sets the base property value. The base property +func (m *EnterpriseSettings_enterprise_ldap) SetBase(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() { + m.base = value +} +// SetBindDn sets the bind_dn property value. The bind_dn property +func (m *EnterpriseSettings_enterprise_ldap) SetBindDn(value *string)() { + m.bind_dn = value +} +// SetHost sets the host property value. The host property +func (m *EnterpriseSettings_enterprise_ldap) SetHost(value *string)() { + m.host = value +} +// SetMethod sets the method property value. The method property +func (m *EnterpriseSettings_enterprise_ldap) SetMethod(value *string)() { + m.method = value +} +// SetPassword sets the password property value. The password property +func (m *EnterpriseSettings_enterprise_ldap) SetPassword(value *string)() { + m.password = value +} +// SetPort sets the port property value. The port property +func (m *EnterpriseSettings_enterprise_ldap) SetPort(value *int32)() { + m.port = value +} +// SetPosixSupport sets the posix_support property value. The posix_support property +func (m *EnterpriseSettings_enterprise_ldap) SetPosixSupport(value *bool)() { + m.posix_support = value +} +// SetProfile sets the profile property value. The profile property +func (m *EnterpriseSettings_enterprise_ldap) SetProfile(value EnterpriseSettings_enterprise_ldap_profileable)() { + m.profile = value +} +// SetReconciliation sets the reconciliation property value. The reconciliation property +func (m *EnterpriseSettings_enterprise_ldap) SetReconciliation(value EnterpriseSettings_enterprise_ldap_reconciliationable)() { + m.reconciliation = value +} +// SetRecursiveGroupSearch sets the recursive_group_search property value. The recursive_group_search property +func (m *EnterpriseSettings_enterprise_ldap) SetRecursiveGroupSearch(value *bool)() { + m.recursive_group_search = value +} +// SetSearchStrategy sets the search_strategy property value. The search_strategy property +func (m *EnterpriseSettings_enterprise_ldap) SetSearchStrategy(value *string)() { + m.search_strategy = value +} +// SetSyncEnabled sets the sync_enabled property value. The sync_enabled property +func (m *EnterpriseSettings_enterprise_ldap) SetSyncEnabled(value *bool)() { + m.sync_enabled = value +} +// SetTeamSyncInterval sets the team_sync_interval property value. The team_sync_interval property +func (m *EnterpriseSettings_enterprise_ldap) SetTeamSyncInterval(value *int32)() { + m.team_sync_interval = value +} +// SetUid sets the uid property value. The uid property +func (m *EnterpriseSettings_enterprise_ldap) SetUid(value *string)() { + m.uid = value +} +// SetUserGroups sets the user_groups property value. The user_groups property +func (m *EnterpriseSettings_enterprise_ldap) SetUserGroups(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() { + m.user_groups = value +} +// SetUserSyncEmails sets the user_sync_emails property value. The user_sync_emails property +func (m *EnterpriseSettings_enterprise_ldap) SetUserSyncEmails(value *bool)() { + m.user_sync_emails = value +} +// SetUserSyncInterval sets the user_sync_interval property value. The user_sync_interval property +func (m *EnterpriseSettings_enterprise_ldap) SetUserSyncInterval(value *int32)() { + m.user_sync_interval = value +} +// SetUserSyncKeys sets the user_sync_keys property value. The user_sync_keys property +func (m *EnterpriseSettings_enterprise_ldap) SetUserSyncKeys(value *bool)() { + m.user_sync_keys = value +} +// SetVirtualAttributeEnabled sets the virtual_attribute_enabled property value. The virtual_attribute_enabled property +func (m *EnterpriseSettings_enterprise_ldap) SetVirtualAttributeEnabled(value *bool)() { + m.virtual_attribute_enabled = value +} +type EnterpriseSettings_enterprise_ldapable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdminGroup()(*string) + GetBase()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + GetBindDn()(*string) + GetHost()(*string) + GetMethod()(*string) + GetPassword()(*string) + GetPort()(*int32) + GetPosixSupport()(*bool) + GetProfile()(EnterpriseSettings_enterprise_ldap_profileable) + GetReconciliation()(EnterpriseSettings_enterprise_ldap_reconciliationable) + GetRecursiveGroupSearch()(*bool) + GetSearchStrategy()(*string) + GetSyncEnabled()(*bool) + GetTeamSyncInterval()(*int32) + GetUid()(*string) + GetUserGroups()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + GetUserSyncEmails()(*bool) + GetUserSyncInterval()(*int32) + GetUserSyncKeys()(*bool) + GetVirtualAttributeEnabled()(*bool) + SetAdminGroup(value *string)() + SetBase(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() + SetBindDn(value *string)() + SetHost(value *string)() + SetMethod(value *string)() + SetPassword(value *string)() + SetPort(value *int32)() + SetPosixSupport(value *bool)() + SetProfile(value EnterpriseSettings_enterprise_ldap_profileable)() + SetReconciliation(value EnterpriseSettings_enterprise_ldap_reconciliationable)() + SetRecursiveGroupSearch(value *bool)() + SetSearchStrategy(value *string)() + SetSyncEnabled(value *bool)() + SetTeamSyncInterval(value *int32)() + SetUid(value *string)() + SetUserGroups(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() + SetUserSyncEmails(value *bool)() + SetUserSyncInterval(value *int32)() + SetUserSyncKeys(value *bool)() + SetVirtualAttributeEnabled(value *bool)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ldap_escaped_profile.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ldap_escaped_profile.go new file mode 100644 index 00000000..5d6cf98f --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ldap_escaped_profile.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_ldap_profile 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 key property + key *string + // The mail property + mail *string + // The name property + name *string + // The uid property + uid *string +} +// NewEnterpriseSettings_enterprise_ldap_profile instantiates a new EnterpriseSettings_enterprise_ldap_profile and sets the default values. +func NewEnterpriseSettings_enterprise_ldap_profile()(*EnterpriseSettings_enterprise_ldap_profile) { + m := &EnterpriseSettings_enterprise_ldap_profile{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_ldap_profileFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_ldap_profileFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_ldap_profile(), 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 *EnterpriseSettings_enterprise_ldap_profile) 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 *EnterpriseSettings_enterprise_ldap_profile) 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["mail"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMail(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["uid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUid(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ldap_profile) GetKey()(*string) { + return m.key +} +// GetMail gets the mail property value. The mail property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ldap_profile) GetMail()(*string) { + return m.mail +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ldap_profile) GetName()(*string) { + return m.name +} +// GetUid gets the uid property value. The uid property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ldap_profile) GetUid()(*string) { + return m.uid +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_ldap_profile) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mail", m.GetMail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("uid", m.GetUid()) + 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 *EnterpriseSettings_enterprise_ldap_profile) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The key property +func (m *EnterpriseSettings_enterprise_ldap_profile) SetKey(value *string)() { + m.key = value +} +// SetMail sets the mail property value. The mail property +func (m *EnterpriseSettings_enterprise_ldap_profile) SetMail(value *string)() { + m.mail = value +} +// SetName sets the name property value. The name property +func (m *EnterpriseSettings_enterprise_ldap_profile) SetName(value *string)() { + m.name = value +} +// SetUid sets the uid property value. The uid property +func (m *EnterpriseSettings_enterprise_ldap_profile) SetUid(value *string)() { + m.uid = value +} +type EnterpriseSettings_enterprise_ldap_profileable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetMail()(*string) + GetName()(*string) + GetUid()(*string) + SetKey(value *string)() + SetMail(value *string)() + SetName(value *string)() + SetUid(value *string)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ldap_escaped_reconciliation.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ldap_escaped_reconciliation.go new file mode 100644 index 00000000..368f5261 --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ldap_escaped_reconciliation.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_ldap_reconciliation 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 org property + org *string + // The user property + user *string +} +// NewEnterpriseSettings_enterprise_ldap_reconciliation instantiates a new EnterpriseSettings_enterprise_ldap_reconciliation and sets the default values. +func NewEnterpriseSettings_enterprise_ldap_reconciliation()(*EnterpriseSettings_enterprise_ldap_reconciliation) { + m := &EnterpriseSettings_enterprise_ldap_reconciliation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_ldap_reconciliationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_ldap_reconciliationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_ldap_reconciliation(), 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 *EnterpriseSettings_enterprise_ldap_reconciliation) 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 *EnterpriseSettings_enterprise_ldap_reconciliation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["org"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrg(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUser(val) + } + return nil + } + return res +} +// GetOrg gets the org property value. The org property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ldap_reconciliation) GetOrg()(*string) { + return m.org +} +// GetUser gets the user property value. The user property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ldap_reconciliation) GetUser()(*string) { + return m.user +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_ldap_reconciliation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("org", m.GetOrg()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user", m.GetUser()) + 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 *EnterpriseSettings_enterprise_ldap_reconciliation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetOrg sets the org property value. The org property +func (m *EnterpriseSettings_enterprise_ldap_reconciliation) SetOrg(value *string)() { + m.org = value +} +// SetUser sets the user property value. The user property +func (m *EnterpriseSettings_enterprise_ldap_reconciliation) SetUser(value *string)() { + m.user = value +} +type EnterpriseSettings_enterprise_ldap_reconciliationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOrg()(*string) + GetUser()(*string) + SetOrg(value *string)() + SetUser(value *string)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_license.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_license.go new file mode 100644 index 00000000..58f5f572 --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_license.go @@ -0,0 +1,283 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_license 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 cluster_support property + cluster_support *bool + // The evaluation property + evaluation *bool + // The expire_at property + expire_at *string + // The perpetual property + perpetual *bool + // The seats property + seats *int32 + // The ssh_allowed property + ssh_allowed *bool + // The support_key property + support_key *string + // The unlimited_seating property + unlimited_seating *bool +} +// NewEnterpriseSettings_enterprise_license instantiates a new EnterpriseSettings_enterprise_license and sets the default values. +func NewEnterpriseSettings_enterprise_license()(*EnterpriseSettings_enterprise_license) { + m := &EnterpriseSettings_enterprise_license{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_licenseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_licenseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_license(), 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 *EnterpriseSettings_enterprise_license) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClusterSupport gets the cluster_support property value. The cluster_support property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_license) GetClusterSupport()(*bool) { + return m.cluster_support +} +// GetEvaluation gets the evaluation property value. The evaluation property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_license) GetEvaluation()(*bool) { + return m.evaluation +} +// GetExpireAt gets the expire_at property value. The expire_at property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_license) GetExpireAt()(*string) { + return m.expire_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings_enterprise_license) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cluster_support"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetClusterSupport(val) + } + return nil + } + res["evaluation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEvaluation(val) + } + return nil + } + res["expire_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExpireAt(val) + } + return nil + } + res["perpetual"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPerpetual(val) + } + return nil + } + res["seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSeats(val) + } + return nil + } + res["ssh_allowed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSshAllowed(val) + } + return nil + } + res["support_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSupportKey(val) + } + return nil + } + res["unlimited_seating"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUnlimitedSeating(val) + } + return nil + } + return res +} +// GetPerpetual gets the perpetual property value. The perpetual property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_license) GetPerpetual()(*bool) { + return m.perpetual +} +// GetSeats gets the seats property value. The seats property +// returns a *int32 when successful +func (m *EnterpriseSettings_enterprise_license) GetSeats()(*int32) { + return m.seats +} +// GetSshAllowed gets the ssh_allowed property value. The ssh_allowed property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_license) GetSshAllowed()(*bool) { + return m.ssh_allowed +} +// GetSupportKey gets the support_key property value. The support_key property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_license) GetSupportKey()(*string) { + return m.support_key +} +// GetUnlimitedSeating gets the unlimited_seating property value. The unlimited_seating property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_license) GetUnlimitedSeating()(*bool) { + return m.unlimited_seating +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_license) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("cluster_support", m.GetClusterSupport()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("evaluation", m.GetEvaluation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("expire_at", m.GetExpireAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("perpetual", m.GetPerpetual()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("seats", m.GetSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("ssh_allowed", m.GetSshAllowed()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("support_key", m.GetSupportKey()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("unlimited_seating", m.GetUnlimitedSeating()) + 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 *EnterpriseSettings_enterprise_license) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClusterSupport sets the cluster_support property value. The cluster_support property +func (m *EnterpriseSettings_enterprise_license) SetClusterSupport(value *bool)() { + m.cluster_support = value +} +// SetEvaluation sets the evaluation property value. The evaluation property +func (m *EnterpriseSettings_enterprise_license) SetEvaluation(value *bool)() { + m.evaluation = value +} +// SetExpireAt sets the expire_at property value. The expire_at property +func (m *EnterpriseSettings_enterprise_license) SetExpireAt(value *string)() { + m.expire_at = value +} +// SetPerpetual sets the perpetual property value. The perpetual property +func (m *EnterpriseSettings_enterprise_license) SetPerpetual(value *bool)() { + m.perpetual = value +} +// SetSeats sets the seats property value. The seats property +func (m *EnterpriseSettings_enterprise_license) SetSeats(value *int32)() { + m.seats = value +} +// SetSshAllowed sets the ssh_allowed property value. The ssh_allowed property +func (m *EnterpriseSettings_enterprise_license) SetSshAllowed(value *bool)() { + m.ssh_allowed = value +} +// SetSupportKey sets the support_key property value. The support_key property +func (m *EnterpriseSettings_enterprise_license) SetSupportKey(value *string)() { + m.support_key = value +} +// SetUnlimitedSeating sets the unlimited_seating property value. The unlimited_seating property +func (m *EnterpriseSettings_enterprise_license) SetUnlimitedSeating(value *bool)() { + m.unlimited_seating = value +} +type EnterpriseSettings_enterprise_licenseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClusterSupport()(*bool) + GetEvaluation()(*bool) + GetExpireAt()(*string) + GetPerpetual()(*bool) + GetSeats()(*int32) + GetSshAllowed()(*bool) + GetSupportKey()(*string) + GetUnlimitedSeating()(*bool) + SetClusterSupport(value *bool)() + SetEvaluation(value *bool)() + SetExpireAt(value *string)() + SetPerpetual(value *bool)() + SetSeats(value *int32)() + SetSshAllowed(value *bool)() + SetSupportKey(value *string)() + SetUnlimitedSeating(value *bool)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_mapping.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_mapping.go new file mode 100644 index 00000000..0453337b --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_mapping.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_mapping 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 basemap property + basemap *string + // The enabled property + enabled *bool + // The tileserver property + tileserver *string + // The token property + token *string +} +// NewEnterpriseSettings_enterprise_mapping instantiates a new EnterpriseSettings_enterprise_mapping and sets the default values. +func NewEnterpriseSettings_enterprise_mapping()(*EnterpriseSettings_enterprise_mapping) { + m := &EnterpriseSettings_enterprise_mapping{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_mappingFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_mappingFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_mapping(), 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 *EnterpriseSettings_enterprise_mapping) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBasemap gets the basemap property value. The basemap property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_mapping) GetBasemap()(*string) { + return m.basemap +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_mapping) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings_enterprise_mapping) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["basemap"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBasemap(val) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["tileserver"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTileserver(val) + } + return nil + } + res["token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetToken(val) + } + return nil + } + return res +} +// GetTileserver gets the tileserver property value. The tileserver property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_mapping) GetTileserver()(*string) { + return m.tileserver +} +// GetToken gets the token property value. The token property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_mapping) GetToken()(*string) { + return m.token +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_mapping) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("basemap", m.GetBasemap()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tileserver", m.GetTileserver()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token", m.GetToken()) + 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 *EnterpriseSettings_enterprise_mapping) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBasemap sets the basemap property value. The basemap property +func (m *EnterpriseSettings_enterprise_mapping) SetBasemap(value *string)() { + m.basemap = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *EnterpriseSettings_enterprise_mapping) SetEnabled(value *bool)() { + m.enabled = value +} +// SetTileserver sets the tileserver property value. The tileserver property +func (m *EnterpriseSettings_enterprise_mapping) SetTileserver(value *string)() { + m.tileserver = value +} +// SetToken sets the token property value. The token property +func (m *EnterpriseSettings_enterprise_mapping) SetToken(value *string)() { + m.token = value +} +type EnterpriseSettings_enterprise_mappingable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBasemap()(*string) + GetEnabled()(*bool) + GetTileserver()(*string) + GetToken()(*string) + SetBasemap(value *string)() + SetEnabled(value *bool)() + SetTileserver(value *string)() + SetToken(value *string)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ntp.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ntp.go new file mode 100644 index 00000000..3d4af218 --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_ntp.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_ntp 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 primary_server property + primary_server *string + // The secondary_server property + secondary_server *string +} +// NewEnterpriseSettings_enterprise_ntp instantiates a new EnterpriseSettings_enterprise_ntp and sets the default values. +func NewEnterpriseSettings_enterprise_ntp()(*EnterpriseSettings_enterprise_ntp) { + m := &EnterpriseSettings_enterprise_ntp{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_ntpFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_ntpFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_ntp(), 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 *EnterpriseSettings_enterprise_ntp) 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 *EnterpriseSettings_enterprise_ntp) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["primary_server"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPrimaryServer(val) + } + return nil + } + res["secondary_server"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecondaryServer(val) + } + return nil + } + return res +} +// GetPrimaryServer gets the primary_server property value. The primary_server property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ntp) GetPrimaryServer()(*string) { + return m.primary_server +} +// GetSecondaryServer gets the secondary_server property value. The secondary_server property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_ntp) GetSecondaryServer()(*string) { + return m.secondary_server +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_ntp) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("primary_server", m.GetPrimaryServer()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secondary_server", m.GetSecondaryServer()) + 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 *EnterpriseSettings_enterprise_ntp) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPrimaryServer sets the primary_server property value. The primary_server property +func (m *EnterpriseSettings_enterprise_ntp) SetPrimaryServer(value *string)() { + m.primary_server = value +} +// SetSecondaryServer sets the secondary_server property value. The secondary_server property +func (m *EnterpriseSettings_enterprise_ntp) SetSecondaryServer(value *string)() { + m.secondary_server = value +} +type EnterpriseSettings_enterprise_ntpable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPrimaryServer()(*string) + GetSecondaryServer()(*string) + SetPrimaryServer(value *string)() + SetSecondaryServer(value *string)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_pages.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_pages.go new file mode 100644 index 00000000..c90f13ab --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_pages.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_pages 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 enabled property + enabled *bool +} +// NewEnterpriseSettings_enterprise_pages instantiates a new EnterpriseSettings_enterprise_pages and sets the default values. +func NewEnterpriseSettings_enterprise_pages()(*EnterpriseSettings_enterprise_pages) { + m := &EnterpriseSettings_enterprise_pages{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_pagesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_pagesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_pages(), 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 *EnterpriseSettings_enterprise_pages) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_pages) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings_enterprise_pages) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_pages) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + 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 *EnterpriseSettings_enterprise_pages) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *EnterpriseSettings_enterprise_pages) SetEnabled(value *bool)() { + m.enabled = value +} +type EnterpriseSettings_enterprise_pagesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_saml.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_saml.go new file mode 100644 index 00000000..bea5af07 --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_saml.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_saml 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 certificate property + certificate *string + // The certificate_path property + certificate_path *string + // The disable_admin_demote property + disable_admin_demote *bool + // The idp_initiated_sso property + idp_initiated_sso *bool + // The issuer property + issuer *string + // The sso_url property + sso_url *string +} +// NewEnterpriseSettings_enterprise_saml instantiates a new EnterpriseSettings_enterprise_saml and sets the default values. +func NewEnterpriseSettings_enterprise_saml()(*EnterpriseSettings_enterprise_saml) { + m := &EnterpriseSettings_enterprise_saml{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_samlFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_samlFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_saml(), 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 *EnterpriseSettings_enterprise_saml) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCertificate gets the certificate property value. The certificate property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_saml) GetCertificate()(*string) { + return m.certificate +} +// GetCertificatePath gets the certificate_path property value. The certificate_path property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_saml) GetCertificatePath()(*string) { + return m.certificate_path +} +// GetDisableAdminDemote gets the disable_admin_demote property value. The disable_admin_demote property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_saml) GetDisableAdminDemote()(*bool) { + return m.disable_admin_demote +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings_enterprise_saml) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["certificate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCertificate(val) + } + return nil + } + res["certificate_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCertificatePath(val) + } + return nil + } + res["disable_admin_demote"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisableAdminDemote(val) + } + return nil + } + res["idp_initiated_sso"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIdpInitiatedSso(val) + } + return nil + } + res["issuer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuer(val) + } + return nil + } + res["sso_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSsoUrl(val) + } + return nil + } + return res +} +// GetIdpInitiatedSso gets the idp_initiated_sso property value. The idp_initiated_sso property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_saml) GetIdpInitiatedSso()(*bool) { + return m.idp_initiated_sso +} +// GetIssuer gets the issuer property value. The issuer property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_saml) GetIssuer()(*string) { + return m.issuer +} +// GetSsoUrl gets the sso_url property value. The sso_url property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_saml) GetSsoUrl()(*string) { + return m.sso_url +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_saml) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("certificate", m.GetCertificate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("certificate_path", m.GetCertificatePath()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disable_admin_demote", m.GetDisableAdminDemote()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("idp_initiated_sso", m.GetIdpInitiatedSso()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issuer", m.GetIssuer()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sso_url", m.GetSsoUrl()) + 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 *EnterpriseSettings_enterprise_saml) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCertificate sets the certificate property value. The certificate property +func (m *EnterpriseSettings_enterprise_saml) SetCertificate(value *string)() { + m.certificate = value +} +// SetCertificatePath sets the certificate_path property value. The certificate_path property +func (m *EnterpriseSettings_enterprise_saml) SetCertificatePath(value *string)() { + m.certificate_path = value +} +// SetDisableAdminDemote sets the disable_admin_demote property value. The disable_admin_demote property +func (m *EnterpriseSettings_enterprise_saml) SetDisableAdminDemote(value *bool)() { + m.disable_admin_demote = value +} +// SetIdpInitiatedSso sets the idp_initiated_sso property value. The idp_initiated_sso property +func (m *EnterpriseSettings_enterprise_saml) SetIdpInitiatedSso(value *bool)() { + m.idp_initiated_sso = value +} +// SetIssuer sets the issuer property value. The issuer property +func (m *EnterpriseSettings_enterprise_saml) SetIssuer(value *string)() { + m.issuer = value +} +// SetSsoUrl sets the sso_url property value. The sso_url property +func (m *EnterpriseSettings_enterprise_saml) SetSsoUrl(value *string)() { + m.sso_url = value +} +type EnterpriseSettings_enterprise_samlable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCertificate()(*string) + GetCertificatePath()(*string) + GetDisableAdminDemote()(*bool) + GetIdpInitiatedSso()(*bool) + GetIssuer()(*string) + GetSsoUrl()(*string) + SetCertificate(value *string)() + SetCertificatePath(value *string)() + SetDisableAdminDemote(value *bool)() + SetIdpInitiatedSso(value *bool)() + SetIssuer(value *string)() + SetSsoUrl(value *string)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_smtp.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_smtp.go new file mode 100644 index 00000000..58f9b336 --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_smtp.go @@ -0,0 +1,428 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_smtp 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 address property + address *string + // The authentication property + authentication *string + // The discardToNoreplyAddress property + discardToNoreplyAddress *bool + // The domain property + domain *string + // The enable_starttls_auto property + enable_starttls_auto *bool + // The enabled property + enabled *bool + // The noreply_address property + noreply_address *string + // The password property + password *string + // The port property + port *string + // The support_address property + support_address *string + // The support_address_type property + support_address_type *string + // The user_name property + user_name *string + // The username property + username *string +} +// NewEnterpriseSettings_enterprise_smtp instantiates a new EnterpriseSettings_enterprise_smtp and sets the default values. +func NewEnterpriseSettings_enterprise_smtp()(*EnterpriseSettings_enterprise_smtp) { + m := &EnterpriseSettings_enterprise_smtp{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_smtpFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_smtpFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_smtp(), 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 *EnterpriseSettings_enterprise_smtp) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAddress gets the address property value. The address property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_smtp) GetAddress()(*string) { + return m.address +} +// GetAuthentication gets the authentication property value. The authentication property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_smtp) GetAuthentication()(*string) { + return m.authentication +} +// GetDiscardToNoreplyAddress gets the discard-to-noreply-address property value. The discardToNoreplyAddress property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_smtp) GetDiscardToNoreplyAddress()(*bool) { + return m.discardToNoreplyAddress +} +// GetDomain gets the domain property value. The domain property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_smtp) GetDomain()(*string) { + return m.domain +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_smtp) GetEnabled()(*bool) { + return m.enabled +} +// GetEnableStarttlsAuto gets the enable_starttls_auto property value. The enable_starttls_auto property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_smtp) GetEnableStarttlsAuto()(*bool) { + return m.enable_starttls_auto +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings_enterprise_smtp) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["address"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAddress(val) + } + return nil + } + res["authentication"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAuthentication(val) + } + return nil + } + res["discard-to-noreply-address"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDiscardToNoreplyAddress(val) + } + return nil + } + res["domain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDomain(val) + } + return nil + } + res["enable_starttls_auto"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnableStarttlsAuto(val) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["noreply_address"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNoreplyAddress(val) + } + return nil + } + res["password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPassword(val) + } + return nil + } + res["port"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPort(val) + } + return nil + } + res["support_address"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSupportAddress(val) + } + return nil + } + res["support_address_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSupportAddressType(val) + } + return nil + } + res["user_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUser_name(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 + } + return res +} +// GetNoreplyAddress gets the noreply_address property value. The noreply_address property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_smtp) GetNoreplyAddress()(*string) { + return m.noreply_address +} +// GetPassword gets the password property value. The password property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_smtp) GetPassword()(*string) { + return m.password +} +// GetPort gets the port property value. The port property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_smtp) GetPort()(*string) { + return m.port +} +// GetSupportAddress gets the support_address property value. The support_address property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_smtp) GetSupportAddress()(*string) { + return m.support_address +} +// GetSupportAddressType gets the support_address_type property value. The support_address_type property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_smtp) GetSupportAddressType()(*string) { + return m.support_address_type +} +// GetUser_name gets the user_name property value. The user_name property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_smtp) GetUser_name()(*string) { + return m.user_name +} +// GetUsername gets the username property value. The username property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_smtp) GetUsername()(*string) { + return m.username +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_smtp) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("address", m.GetAddress()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("authentication", m.GetAuthentication()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("discard-to-noreply-address", m.GetDiscardToNoreplyAddress()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("domain", m.GetDomain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enable_starttls_auto", m.GetEnableStarttlsAuto()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("noreply_address", m.GetNoreplyAddress()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("password", m.GetPassword()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("port", m.GetPort()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("support_address", m.GetSupportAddress()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("support_address_type", m.GetSupportAddressType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("username", m.GetUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user_name", m.GetUser_name()) + 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 *EnterpriseSettings_enterprise_smtp) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAddress sets the address property value. The address property +func (m *EnterpriseSettings_enterprise_smtp) SetAddress(value *string)() { + m.address = value +} +// SetAuthentication sets the authentication property value. The authentication property +func (m *EnterpriseSettings_enterprise_smtp) SetAuthentication(value *string)() { + m.authentication = value +} +// SetDiscardToNoreplyAddress sets the discard-to-noreply-address property value. The discardToNoreplyAddress property +func (m *EnterpriseSettings_enterprise_smtp) SetDiscardToNoreplyAddress(value *bool)() { + m.discardToNoreplyAddress = value +} +// SetDomain sets the domain property value. The domain property +func (m *EnterpriseSettings_enterprise_smtp) SetDomain(value *string)() { + m.domain = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *EnterpriseSettings_enterprise_smtp) SetEnabled(value *bool)() { + m.enabled = value +} +// SetEnableStarttlsAuto sets the enable_starttls_auto property value. The enable_starttls_auto property +func (m *EnterpriseSettings_enterprise_smtp) SetEnableStarttlsAuto(value *bool)() { + m.enable_starttls_auto = value +} +// SetNoreplyAddress sets the noreply_address property value. The noreply_address property +func (m *EnterpriseSettings_enterprise_smtp) SetNoreplyAddress(value *string)() { + m.noreply_address = value +} +// SetPassword sets the password property value. The password property +func (m *EnterpriseSettings_enterprise_smtp) SetPassword(value *string)() { + m.password = value +} +// SetPort sets the port property value. The port property +func (m *EnterpriseSettings_enterprise_smtp) SetPort(value *string)() { + m.port = value +} +// SetSupportAddress sets the support_address property value. The support_address property +func (m *EnterpriseSettings_enterprise_smtp) SetSupportAddress(value *string)() { + m.support_address = value +} +// SetSupportAddressType sets the support_address_type property value. The support_address_type property +func (m *EnterpriseSettings_enterprise_smtp) SetSupportAddressType(value *string)() { + m.support_address_type = value +} +// SetUser_name sets the user_name property value. The user_name property +func (m *EnterpriseSettings_enterprise_smtp) SetUser_name(value *string)() { + m.user_name = value +} +// SetUsername sets the username property value. The username property +func (m *EnterpriseSettings_enterprise_smtp) SetUsername(value *string)() { + m.username = value +} +type EnterpriseSettings_enterprise_smtpable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAddress()(*string) + GetAuthentication()(*string) + GetDiscardToNoreplyAddress()(*bool) + GetDomain()(*string) + GetEnabled()(*bool) + GetEnableStarttlsAuto()(*bool) + GetNoreplyAddress()(*string) + GetPassword()(*string) + GetPort()(*string) + GetSupportAddress()(*string) + GetSupportAddressType()(*string) + GetUser_name()(*string) + GetUsername()(*string) + SetAddress(value *string)() + SetAuthentication(value *string)() + SetDiscardToNoreplyAddress(value *bool)() + SetDomain(value *string)() + SetEnabled(value *bool)() + SetEnableStarttlsAuto(value *bool)() + SetNoreplyAddress(value *string)() + SetPassword(value *string)() + SetPort(value *string)() + SetSupportAddress(value *string)() + SetSupportAddressType(value *string)() + SetUser_name(value *string)() + SetUsername(value *string)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_snmp.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_snmp.go new file mode 100644 index 00000000..9dcee710 --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_snmp.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_snmp 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 community property + community *string + // The enabled property + enabled *bool +} +// NewEnterpriseSettings_enterprise_snmp instantiates a new EnterpriseSettings_enterprise_snmp and sets the default values. +func NewEnterpriseSettings_enterprise_snmp()(*EnterpriseSettings_enterprise_snmp) { + m := &EnterpriseSettings_enterprise_snmp{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_snmpFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_snmpFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_snmp(), 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 *EnterpriseSettings_enterprise_snmp) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommunity gets the community property value. The community property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_snmp) GetCommunity()(*string) { + return m.community +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_snmp) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings_enterprise_snmp) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["community"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommunity(val) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_snmp) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("community", m.GetCommunity()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + 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 *EnterpriseSettings_enterprise_snmp) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommunity sets the community property value. The community property +func (m *EnterpriseSettings_enterprise_snmp) SetCommunity(value *string)() { + m.community = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *EnterpriseSettings_enterprise_snmp) SetEnabled(value *bool)() { + m.enabled = value +} +type EnterpriseSettings_enterprise_snmpable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommunity()(*string) + GetEnabled()(*bool) + SetCommunity(value *string)() + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_syslog.go b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_syslog.go new file mode 100644 index 00000000..bc2e4b4f --- /dev/null +++ b/pkg/github/models/enterprise_settings_escaped_enterprise_escaped_syslog.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseSettings_enterprise_syslog 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 enabled property + enabled *bool + // The protocol_name property + protocol_name *string + // The server property + server *string +} +// NewEnterpriseSettings_enterprise_syslog instantiates a new EnterpriseSettings_enterprise_syslog and sets the default values. +func NewEnterpriseSettings_enterprise_syslog()(*EnterpriseSettings_enterprise_syslog) { + m := &EnterpriseSettings_enterprise_syslog{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseSettings_enterprise_syslogFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseSettings_enterprise_syslogFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseSettings_enterprise_syslog(), 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 *EnterpriseSettings_enterprise_syslog) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *EnterpriseSettings_enterprise_syslog) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseSettings_enterprise_syslog) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["protocol_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProtocolName(val) + } + return nil + } + res["server"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetServer(val) + } + return nil + } + return res +} +// GetProtocolName gets the protocol_name property value. The protocol_name property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_syslog) GetProtocolName()(*string) { + return m.protocol_name +} +// GetServer gets the server property value. The server property +// returns a *string when successful +func (m *EnterpriseSettings_enterprise_syslog) GetServer()(*string) { + return m.server +} +// Serialize serializes information the current object +func (m *EnterpriseSettings_enterprise_syslog) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("protocol_name", m.GetProtocolName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("server", m.GetServer()) + 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 *EnterpriseSettings_enterprise_syslog) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *EnterpriseSettings_enterprise_syslog) SetEnabled(value *bool)() { + m.enabled = value +} +// SetProtocolName sets the protocol_name property value. The protocol_name property +func (m *EnterpriseSettings_enterprise_syslog) SetProtocolName(value *string)() { + m.protocol_name = value +} +// SetServer sets the server property value. The server property +func (m *EnterpriseSettings_enterprise_syslog) SetServer(value *string)() { + m.server = value +} +type EnterpriseSettings_enterprise_syslogable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetProtocolName()(*string) + GetServer()(*string) + SetEnabled(value *bool)() + SetProtocolName(value *string)() + SetServer(value *string)() +} diff --git a/pkg/github/models/enterprise_user_overview.go b/pkg/github/models/enterprise_user_overview.go new file mode 100644 index 00000000..fc59b363 --- /dev/null +++ b/pkg/github/models/enterprise_user_overview.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnterpriseUserOverview 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 admin_users property + admin_users *int32 + // The suspended_users property + suspended_users *int32 + // The total_users property + total_users *int32 +} +// NewEnterpriseUserOverview instantiates a new EnterpriseUserOverview and sets the default values. +func NewEnterpriseUserOverview()(*EnterpriseUserOverview) { + m := &EnterpriseUserOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnterpriseUserOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnterpriseUserOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnterpriseUserOverview(), 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 *EnterpriseUserOverview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdminUsers gets the admin_users property value. The admin_users property +// returns a *int32 when successful +func (m *EnterpriseUserOverview) GetAdminUsers()(*int32) { + return m.admin_users +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnterpriseUserOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin_users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAdminUsers(val) + } + return nil + } + res["suspended_users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSuspendedUsers(val) + } + return nil + } + res["total_users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalUsers(val) + } + return nil + } + return res +} +// GetSuspendedUsers gets the suspended_users property value. The suspended_users property +// returns a *int32 when successful +func (m *EnterpriseUserOverview) GetSuspendedUsers()(*int32) { + return m.suspended_users +} +// GetTotalUsers gets the total_users property value. The total_users property +// returns a *int32 when successful +func (m *EnterpriseUserOverview) GetTotalUsers()(*int32) { + return m.total_users +} +// Serialize serializes information the current object +func (m *EnterpriseUserOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("admin_users", m.GetAdminUsers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("suspended_users", m.GetSuspendedUsers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_users", m.GetTotalUsers()) + 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 *EnterpriseUserOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdminUsers sets the admin_users property value. The admin_users property +func (m *EnterpriseUserOverview) SetAdminUsers(value *int32)() { + m.admin_users = value +} +// SetSuspendedUsers sets the suspended_users property value. The suspended_users property +func (m *EnterpriseUserOverview) SetSuspendedUsers(value *int32)() { + m.suspended_users = value +} +// SetTotalUsers sets the total_users property value. The total_users property +func (m *EnterpriseUserOverview) SetTotalUsers(value *int32)() { + m.total_users = value +} +type EnterpriseUserOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdminUsers()(*int32) + GetSuspendedUsers()(*int32) + GetTotalUsers()(*int32) + SetAdminUsers(value *int32)() + SetSuspendedUsers(value *int32)() + SetTotalUsers(value *int32)() +} diff --git a/pkg/github/models/environment.go b/pkg/github/models/environment.go new file mode 100644 index 00000000..57c78b6a --- /dev/null +++ b/pkg/github/models/environment.go @@ -0,0 +1,437 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Environment details of a deployment environment +type Environment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the environment was created, in ISO 8601 format. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. + deployment_branch_policy DeploymentBranchPolicySettingsable + // The html_url property + html_url *string + // The id of the environment. + id *int64 + // The name of the environment. + name *string + // The node_id property + node_id *string + // Built-in deployment protection rules for the environment. + protection_rules []Environment_Environment_protection_rulesable + // The time that the environment was last updated, in ISO 8601 format. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// Environment_Environment_protection_rules composed type wrapper for classes Environment_protection_rulesMember1able, Environment_protection_rulesMember2able, Environment_protection_rulesMember3able +type Environment_Environment_protection_rules struct { + // Composed type representation for type Environment_protection_rulesMember1able + environment_protection_rulesMember1 Environment_protection_rulesMember1able + // Composed type representation for type Environment_protection_rulesMember2able + environment_protection_rulesMember2 Environment_protection_rulesMember2able + // Composed type representation for type Environment_protection_rulesMember3able + environment_protection_rulesMember3 Environment_protection_rulesMember3able +} +// NewEnvironment_Environment_protection_rules instantiates a new Environment_Environment_protection_rules and sets the default values. +func NewEnvironment_Environment_protection_rules()(*Environment_Environment_protection_rules) { + m := &Environment_Environment_protection_rules{ + } + return m +} +// CreateEnvironment_Environment_protection_rulesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironment_Environment_protection_rulesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewEnvironment_Environment_protection_rules() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateEnvironment_protection_rulesMember1FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(Environment_protection_rulesMember1able); ok { + result.SetEnvironmentProtectionRulesMember1(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateEnvironment_protection_rulesMember2FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(Environment_protection_rulesMember2able); ok { + result.SetEnvironmentProtectionRulesMember2(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateEnvironment_protection_rulesMember3FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(Environment_protection_rulesMember3able); ok { + result.SetEnvironmentProtectionRulesMember3(cast) + } + } + } + return result, nil +} +// GetEnvironmentProtectionRulesMember1 gets the environment_protection_rulesMember1 property value. Composed type representation for type Environment_protection_rulesMember1able +// returns a Environment_protection_rulesMember1able when successful +func (m *Environment_Environment_protection_rules) GetEnvironmentProtectionRulesMember1()(Environment_protection_rulesMember1able) { + return m.environment_protection_rulesMember1 +} +// GetEnvironmentProtectionRulesMember2 gets the environment_protection_rulesMember2 property value. Composed type representation for type Environment_protection_rulesMember2able +// returns a Environment_protection_rulesMember2able when successful +func (m *Environment_Environment_protection_rules) GetEnvironmentProtectionRulesMember2()(Environment_protection_rulesMember2able) { + return m.environment_protection_rulesMember2 +} +// GetEnvironmentProtectionRulesMember3 gets the environment_protection_rulesMember3 property value. Composed type representation for type Environment_protection_rulesMember3able +// returns a Environment_protection_rulesMember3able when successful +func (m *Environment_Environment_protection_rules) GetEnvironmentProtectionRulesMember3()(Environment_protection_rulesMember3able) { + return m.environment_protection_rulesMember3 +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Environment_Environment_protection_rules) 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 *Environment_Environment_protection_rules) GetIsComposedType()(bool) { + return true +} +// Serialize serializes information the current object +func (m *Environment_Environment_protection_rules) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEnvironmentProtectionRulesMember1() != nil { + err := writer.WriteObjectValue("", m.GetEnvironmentProtectionRulesMember1()) + if err != nil { + return err + } + } else if m.GetEnvironmentProtectionRulesMember2() != nil { + err := writer.WriteObjectValue("", m.GetEnvironmentProtectionRulesMember2()) + if err != nil { + return err + } + } else if m.GetEnvironmentProtectionRulesMember3() != nil { + err := writer.WriteObjectValue("", m.GetEnvironmentProtectionRulesMember3()) + if err != nil { + return err + } + } + return nil +} +// SetEnvironmentProtectionRulesMember1 sets the environment_protection_rulesMember1 property value. Composed type representation for type Environment_protection_rulesMember1able +func (m *Environment_Environment_protection_rules) SetEnvironmentProtectionRulesMember1(value Environment_protection_rulesMember1able)() { + m.environment_protection_rulesMember1 = value +} +// SetEnvironmentProtectionRulesMember2 sets the environment_protection_rulesMember2 property value. Composed type representation for type Environment_protection_rulesMember2able +func (m *Environment_Environment_protection_rules) SetEnvironmentProtectionRulesMember2(value Environment_protection_rulesMember2able)() { + m.environment_protection_rulesMember2 = value +} +// SetEnvironmentProtectionRulesMember3 sets the environment_protection_rulesMember3 property value. Composed type representation for type Environment_protection_rulesMember3able +func (m *Environment_Environment_protection_rules) SetEnvironmentProtectionRulesMember3(value Environment_protection_rulesMember3able)() { + m.environment_protection_rulesMember3 = value +} +type Environment_Environment_protection_rulesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnvironmentProtectionRulesMember1()(Environment_protection_rulesMember1able) + GetEnvironmentProtectionRulesMember2()(Environment_protection_rulesMember2able) + GetEnvironmentProtectionRulesMember3()(Environment_protection_rulesMember3able) + SetEnvironmentProtectionRulesMember1(value Environment_protection_rulesMember1able)() + SetEnvironmentProtectionRulesMember2(value Environment_protection_rulesMember2able)() + SetEnvironmentProtectionRulesMember3(value Environment_protection_rulesMember3able)() +} +// NewEnvironment instantiates a new Environment and sets the default values. +func NewEnvironment()(*Environment) { + m := &Environment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnvironmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnvironment(), 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 *Environment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time that the environment was created, in ISO 8601 format. +// returns a *Time when successful +func (m *Environment) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDeploymentBranchPolicy gets the deployment_branch_policy property value. The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. +// returns a DeploymentBranchPolicySettingsable when successful +func (m *Environment) GetDeploymentBranchPolicy()(DeploymentBranchPolicySettingsable) { + return m.deployment_branch_policy +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Environment) 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["deployment_branch_policy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateDeploymentBranchPolicySettingsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDeploymentBranchPolicy(val.(DeploymentBranchPolicySettingsable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["protection_rules"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateEnvironment_Environment_protection_rulesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Environment_Environment_protection_rulesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Environment_Environment_protection_rulesable) + } + } + m.SetProtectionRules(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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Environment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id of the environment. +// returns a *int64 when successful +func (m *Environment) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name of the environment. +// returns a *string when successful +func (m *Environment) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Environment) GetNodeId()(*string) { + return m.node_id +} +// GetProtectionRules gets the protection_rules property value. Built-in deployment protection rules for the environment. +// returns a []Environment_Environment_protection_rulesable when successful +func (m *Environment) GetProtectionRules()([]Environment_Environment_protection_rulesable) { + return m.protection_rules +} +// GetUpdatedAt gets the updated_at property value. The time that the environment was last updated, in ISO 8601 format. +// returns a *Time when successful +func (m *Environment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Environment) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Environment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("deployment_branch_policy", m.GetDeploymentBranchPolicy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetProtectionRules() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetProtectionRules())) + for i, v := range m.GetProtectionRules() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("protection_rules", cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Environment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time that the environment was created, in ISO 8601 format. +func (m *Environment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDeploymentBranchPolicy sets the deployment_branch_policy property value. The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. +func (m *Environment) SetDeploymentBranchPolicy(value DeploymentBranchPolicySettingsable)() { + m.deployment_branch_policy = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Environment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id of the environment. +func (m *Environment) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name of the environment. +func (m *Environment) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Environment) SetNodeId(value *string)() { + m.node_id = value +} +// SetProtectionRules sets the protection_rules property value. Built-in deployment protection rules for the environment. +func (m *Environment) SetProtectionRules(value []Environment_Environment_protection_rulesable)() { + m.protection_rules = value +} +// SetUpdatedAt sets the updated_at property value. The time that the environment was last updated, in ISO 8601 format. +func (m *Environment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Environment) SetUrl(value *string)() { + m.url = value +} +type Environmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDeploymentBranchPolicy()(DeploymentBranchPolicySettingsable) + GetHtmlUrl()(*string) + GetId()(*int64) + GetName()(*string) + GetNodeId()(*string) + GetProtectionRules()([]Environment_Environment_protection_rulesable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDeploymentBranchPolicy(value DeploymentBranchPolicySettingsable)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetName(value *string)() + SetNodeId(value *string)() + SetProtectionRules(value []Environment_Environment_protection_rulesable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/environment_approvals.go b/pkg/github/models/environment_approvals.go new file mode 100644 index 00000000..eb5bcced --- /dev/null +++ b/pkg/github/models/environment_approvals.go @@ -0,0 +1,181 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// EnvironmentApprovals an entry in the reviews log for environment deployments +type EnvironmentApprovals 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 comment submitted with the deployment review + comment *string + // The list of environments that were approved or rejected + environments []EnvironmentApprovals_environmentsable + // Whether deployment to the environment(s) was approved or rejected or pending (with comments) + state *EnvironmentApprovals_state + // A GitHub user. + user SimpleUserable +} +// NewEnvironmentApprovals instantiates a new EnvironmentApprovals and sets the default values. +func NewEnvironmentApprovals()(*EnvironmentApprovals) { + m := &EnvironmentApprovals{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnvironmentApprovalsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironmentApprovalsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnvironmentApprovals(), 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 *EnvironmentApprovals) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComment gets the comment property value. The comment submitted with the deployment review +// returns a *string when successful +func (m *EnvironmentApprovals) GetComment()(*string) { + return m.comment +} +// GetEnvironments gets the environments property value. The list of environments that were approved or rejected +// returns a []EnvironmentApprovals_environmentsable when successful +func (m *EnvironmentApprovals) GetEnvironments()([]EnvironmentApprovals_environmentsable) { + return m.environments +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EnvironmentApprovals) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetComment(val) + } + return nil + } + res["environments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateEnvironmentApprovals_environmentsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]EnvironmentApprovals_environmentsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(EnvironmentApprovals_environmentsable) + } + } + m.SetEnvironments(res) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseEnvironmentApprovals_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*EnvironmentApprovals_state)) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetState gets the state property value. Whether deployment to the environment(s) was approved or rejected or pending (with comments) +// returns a *EnvironmentApprovals_state when successful +func (m *EnvironmentApprovals) GetState()(*EnvironmentApprovals_state) { + return m.state +} +// GetUser gets the user property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *EnvironmentApprovals) GetUser()(SimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *EnvironmentApprovals) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("comment", m.GetComment()) + if err != nil { + return err + } + } + if m.GetEnvironments() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetEnvironments())) + for i, v := range m.GetEnvironments() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("environments", cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *EnvironmentApprovals) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComment sets the comment property value. The comment submitted with the deployment review +func (m *EnvironmentApprovals) SetComment(value *string)() { + m.comment = value +} +// SetEnvironments sets the environments property value. The list of environments that were approved or rejected +func (m *EnvironmentApprovals) SetEnvironments(value []EnvironmentApprovals_environmentsable)() { + m.environments = value +} +// SetState sets the state property value. Whether deployment to the environment(s) was approved or rejected or pending (with comments) +func (m *EnvironmentApprovals) SetState(value *EnvironmentApprovals_state)() { + m.state = value +} +// SetUser sets the user property value. A GitHub user. +func (m *EnvironmentApprovals) SetUser(value SimpleUserable)() { + m.user = value +} +type EnvironmentApprovalsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComment()(*string) + GetEnvironments()([]EnvironmentApprovals_environmentsable) + GetState()(*EnvironmentApprovals_state) + GetUser()(SimpleUserable) + SetComment(value *string)() + SetEnvironments(value []EnvironmentApprovals_environmentsable)() + SetState(value *EnvironmentApprovals_state)() + SetUser(value SimpleUserable)() +} diff --git a/pkg/github/models/environment_approvals_escaped_environments.go b/pkg/github/models/environment_approvals_escaped_environments.go new file mode 100644 index 00000000..13efdbfd --- /dev/null +++ b/pkg/github/models/environment_approvals_escaped_environments.go @@ -0,0 +1,255 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EnvironmentApprovals_environments struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the environment was created, in ISO 8601 format. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // The id of the environment. + id *int32 + // The name of the environment. + name *string + // The node_id property + node_id *string + // The time that the environment was last updated, in ISO 8601 format. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewEnvironmentApprovals_environments instantiates a new EnvironmentApprovals_environments and sets the default values. +func NewEnvironmentApprovals_environments()(*EnvironmentApprovals_environments) { + m := &EnvironmentApprovals_environments{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnvironmentApprovals_environmentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironmentApprovals_environmentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnvironmentApprovals_environments(), 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 *EnvironmentApprovals_environments) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time that the environment was created, in ISO 8601 format. +// returns a *Time when successful +func (m *EnvironmentApprovals_environments) 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 *EnvironmentApprovals_environments) 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["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *EnvironmentApprovals_environments) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id of the environment. +// returns a *int32 when successful +func (m *EnvironmentApprovals_environments) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the environment. +// returns a *string when successful +func (m *EnvironmentApprovals_environments) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *EnvironmentApprovals_environments) GetNodeId()(*string) { + return m.node_id +} +// GetUpdatedAt gets the updated_at property value. The time that the environment was last updated, in ISO 8601 format. +// returns a *Time when successful +func (m *EnvironmentApprovals_environments) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *EnvironmentApprovals_environments) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *EnvironmentApprovals_environments) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *EnvironmentApprovals_environments) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time that the environment was created, in ISO 8601 format. +func (m *EnvironmentApprovals_environments) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *EnvironmentApprovals_environments) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id of the environment. +func (m *EnvironmentApprovals_environments) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the environment. +func (m *EnvironmentApprovals_environments) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *EnvironmentApprovals_environments) SetNodeId(value *string)() { + m.node_id = value +} +// SetUpdatedAt sets the updated_at property value. The time that the environment was last updated, in ISO 8601 format. +func (m *EnvironmentApprovals_environments) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *EnvironmentApprovals_environments) SetUrl(value *string)() { + m.url = value +} +type EnvironmentApprovals_environmentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/environment_approvals_escaped_state.go b/pkg/github/models/environment_approvals_escaped_state.go new file mode 100644 index 00000000..4c0ac8a8 --- /dev/null +++ b/pkg/github/models/environment_approvals_escaped_state.go @@ -0,0 +1,37 @@ +package models +// Whether deployment to the environment(s) was approved or rejected or pending (with comments) +type EnvironmentApprovals_state int + +const ( + APPROVED_ENVIRONMENTAPPROVALS_STATE EnvironmentApprovals_state = iota + REJECTED_ENVIRONMENTAPPROVALS_STATE + PENDING_ENVIRONMENTAPPROVALS_STATE +) + +func (i EnvironmentApprovals_state) String() string { + return []string{"approved", "rejected", "pending"}[i] +} +func ParseEnvironmentApprovals_state(v string) (any, error) { + result := APPROVED_ENVIRONMENTAPPROVALS_STATE + switch v { + case "approved": + result = APPROVED_ENVIRONMENTAPPROVALS_STATE + case "rejected": + result = REJECTED_ENVIRONMENTAPPROVALS_STATE + case "pending": + result = PENDING_ENVIRONMENTAPPROVALS_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeEnvironmentApprovals_state(values []EnvironmentApprovals_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i EnvironmentApprovals_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/environment_escaped_protection_escaped_rules_member1.go b/pkg/github/models/environment_escaped_protection_escaped_rules_member1.go new file mode 100644 index 00000000..b0c47b69 --- /dev/null +++ b/pkg/github/models/environment_escaped_protection_escaped_rules_member1.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Environment_protection_rulesMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // The node_id property + node_id *string + // The type property + typeEscaped *string + // The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days). + wait_timer *int32 +} +// NewEnvironment_protection_rulesMember1 instantiates a new Environment_protection_rulesMember1 and sets the default values. +func NewEnvironment_protection_rulesMember1()(*Environment_protection_rulesMember1) { + m := &Environment_protection_rulesMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnvironment_protection_rulesMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironment_protection_rulesMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnvironment_protection_rulesMember1(), 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 *Environment_protection_rulesMember1) 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 *Environment_protection_rulesMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["wait_timer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWaitTimer(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Environment_protection_rulesMember1) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Environment_protection_rulesMember1) GetNodeId()(*string) { + return m.node_id +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Environment_protection_rulesMember1) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetWaitTimer gets the wait_timer property value. The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days). +// returns a *int32 when successful +func (m *Environment_protection_rulesMember1) GetWaitTimer()(*int32) { + return m.wait_timer +} +// Serialize serializes information the current object +func (m *Environment_protection_rulesMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("wait_timer", m.GetWaitTimer()) + 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 *Environment_protection_rulesMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *Environment_protection_rulesMember1) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Environment_protection_rulesMember1) SetNodeId(value *string)() { + m.node_id = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Environment_protection_rulesMember1) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetWaitTimer sets the wait_timer property value. The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days). +func (m *Environment_protection_rulesMember1) SetWaitTimer(value *int32)() { + m.wait_timer = value +} +type Environment_protection_rulesMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetNodeId()(*string) + GetTypeEscaped()(*string) + GetWaitTimer()(*int32) + SetId(value *int32)() + SetNodeId(value *string)() + SetTypeEscaped(value *string)() + SetWaitTimer(value *int32)() +} diff --git a/pkg/github/models/environment_escaped_protection_escaped_rules_member2.go b/pkg/github/models/environment_escaped_protection_escaped_rules_member2.go new file mode 100644 index 00000000..def382fe --- /dev/null +++ b/pkg/github/models/environment_escaped_protection_escaped_rules_member2.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Environment_protection_rulesMember2 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // The node_id property + node_id *string + // Whether deployments to this environment can be approved by the user who created the deployment. + prevent_self_review *bool + // The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. + reviewers []Environment_protection_rulesMember2_reviewersable + // The type property + typeEscaped *string +} +// NewEnvironment_protection_rulesMember2 instantiates a new Environment_protection_rulesMember2 and sets the default values. +func NewEnvironment_protection_rulesMember2()(*Environment_protection_rulesMember2) { + m := &Environment_protection_rulesMember2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnvironment_protection_rulesMember2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironment_protection_rulesMember2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnvironment_protection_rulesMember2(), 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 *Environment_protection_rulesMember2) 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 *Environment_protection_rulesMember2) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["prevent_self_review"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPreventSelfReview(val) + } + return nil + } + res["reviewers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateEnvironment_protection_rulesMember2_reviewersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Environment_protection_rulesMember2_reviewersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Environment_protection_rulesMember2_reviewersable) + } + } + m.SetReviewers(res) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Environment_protection_rulesMember2) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Environment_protection_rulesMember2) GetNodeId()(*string) { + return m.node_id +} +// GetPreventSelfReview gets the prevent_self_review property value. Whether deployments to this environment can be approved by the user who created the deployment. +// returns a *bool when successful +func (m *Environment_protection_rulesMember2) GetPreventSelfReview()(*bool) { + return m.prevent_self_review +} +// GetReviewers gets the reviewers property value. The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. +// returns a []Environment_protection_rulesMember2_reviewersable when successful +func (m *Environment_protection_rulesMember2) GetReviewers()([]Environment_protection_rulesMember2_reviewersable) { + return m.reviewers +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Environment_protection_rulesMember2) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *Environment_protection_rulesMember2) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("prevent_self_review", m.GetPreventSelfReview()) + if err != nil { + return err + } + } + if m.GetReviewers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetReviewers())) + for i, v := range m.GetReviewers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("reviewers", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + 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 *Environment_protection_rulesMember2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *Environment_protection_rulesMember2) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Environment_protection_rulesMember2) SetNodeId(value *string)() { + m.node_id = value +} +// SetPreventSelfReview sets the prevent_self_review property value. Whether deployments to this environment can be approved by the user who created the deployment. +func (m *Environment_protection_rulesMember2) SetPreventSelfReview(value *bool)() { + m.prevent_self_review = value +} +// SetReviewers sets the reviewers property value. The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. +func (m *Environment_protection_rulesMember2) SetReviewers(value []Environment_protection_rulesMember2_reviewersable)() { + m.reviewers = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Environment_protection_rulesMember2) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +type Environment_protection_rulesMember2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetNodeId()(*string) + GetPreventSelfReview()(*bool) + GetReviewers()([]Environment_protection_rulesMember2_reviewersable) + GetTypeEscaped()(*string) + SetId(value *int32)() + SetNodeId(value *string)() + SetPreventSelfReview(value *bool)() + SetReviewers(value []Environment_protection_rulesMember2_reviewersable)() + SetTypeEscaped(value *string)() +} diff --git a/pkg/github/models/environment_escaped_protection_escaped_rules_member2_escaped_reviewers.go b/pkg/github/models/environment_escaped_protection_escaped_rules_member2_escaped_reviewers.go new file mode 100644 index 00000000..f537c30b --- /dev/null +++ b/pkg/github/models/environment_escaped_protection_escaped_rules_member2_escaped_reviewers.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Environment_protection_rulesMember2_reviewers 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 reviewer property + reviewer Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable + // The type of reviewer. + typeEscaped *DeploymentReviewerType +} +// Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer composed type wrapper for classes SimpleUserable, Teamable +type Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer struct { + // Composed type representation for type SimpleUserable + simpleUser SimpleUserable + // Composed type representation for type Teamable + team Teamable +} +// NewEnvironment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer instantiates a new Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer and sets the default values. +func NewEnvironment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer()(*Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) { + m := &Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer{ + } + return m +} +// CreateEnvironment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewEnvironment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateSimpleUserFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(SimpleUserable); ok { + result.SetSimpleUser(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTeamFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(Teamable); ok { + result.SetTeam(cast) + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) 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 *Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) GetIsComposedType()(bool) { + return true +} +// GetSimpleUser gets the simpleUser property value. Composed type representation for type SimpleUserable +// returns a SimpleUserable when successful +func (m *Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) GetSimpleUser()(SimpleUserable) { + return m.simpleUser +} +// GetTeam gets the team property value. Composed type representation for type Teamable +// returns a Teamable when successful +func (m *Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) GetTeam()(Teamable) { + return m.team +} +// Serialize serializes information the current object +func (m *Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSimpleUser() != nil { + err := writer.WriteObjectValue("", m.GetSimpleUser()) + if err != nil { + return err + } + } else if m.GetTeam() != nil { + err := writer.WriteObjectValue("", m.GetTeam()) + if err != nil { + return err + } + } + return nil +} +// SetSimpleUser sets the simpleUser property value. Composed type representation for type SimpleUserable +func (m *Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) SetSimpleUser(value SimpleUserable)() { + m.simpleUser = value +} +// SetTeam sets the team property value. Composed type representation for type Teamable +func (m *Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewer) SetTeam(value Teamable)() { + m.team = value +} +type Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSimpleUser()(SimpleUserable) + GetTeam()(Teamable) + SetSimpleUser(value SimpleUserable)() + SetTeam(value Teamable)() +} +// NewEnvironment_protection_rulesMember2_reviewers instantiates a new Environment_protection_rulesMember2_reviewers and sets the default values. +func NewEnvironment_protection_rulesMember2_reviewers()(*Environment_protection_rulesMember2_reviewers) { + m := &Environment_protection_rulesMember2_reviewers{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnvironment_protection_rulesMember2_reviewersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironment_protection_rulesMember2_reviewersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnvironment_protection_rulesMember2_reviewers(), 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 *Environment_protection_rulesMember2_reviewers) 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 *Environment_protection_rulesMember2_reviewers) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["reviewer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEnvironment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewer(val.(Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDeploymentReviewerType) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*DeploymentReviewerType)) + } + return nil + } + return res +} +// GetReviewer gets the reviewer property value. The reviewer property +// returns a Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable when successful +func (m *Environment_protection_rulesMember2_reviewers) GetReviewer()(Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable) { + return m.reviewer +} +// GetTypeEscaped gets the type property value. The type of reviewer. +// returns a *DeploymentReviewerType when successful +func (m *Environment_protection_rulesMember2_reviewers) GetTypeEscaped()(*DeploymentReviewerType) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *Environment_protection_rulesMember2_reviewers) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("reviewer", m.GetReviewer()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *Environment_protection_rulesMember2_reviewers) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetReviewer sets the reviewer property value. The reviewer property +func (m *Environment_protection_rulesMember2_reviewers) SetReviewer(value Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable)() { + m.reviewer = value +} +// SetTypeEscaped sets the type property value. The type of reviewer. +func (m *Environment_protection_rulesMember2_reviewers) SetTypeEscaped(value *DeploymentReviewerType)() { + m.typeEscaped = value +} +type Environment_protection_rulesMember2_reviewersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetReviewer()(Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable) + GetTypeEscaped()(*DeploymentReviewerType) + SetReviewer(value Environment_protection_rulesMember2_reviewers_Environment_protection_rulesMember2_reviewers_reviewerable)() + SetTypeEscaped(value *DeploymentReviewerType)() +} diff --git a/pkg/github/models/environment_escaped_protection_escaped_rules_member3.go b/pkg/github/models/environment_escaped_protection_escaped_rules_member3.go new file mode 100644 index 00000000..fdcb073f --- /dev/null +++ b/pkg/github/models/environment_escaped_protection_escaped_rules_member3.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Environment_protection_rulesMember3 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // The node_id property + node_id *string + // The type property + typeEscaped *string +} +// NewEnvironment_protection_rulesMember3 instantiates a new Environment_protection_rulesMember3 and sets the default values. +func NewEnvironment_protection_rulesMember3()(*Environment_protection_rulesMember3) { + m := &Environment_protection_rulesMember3{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEnvironment_protection_rulesMember3FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEnvironment_protection_rulesMember3FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEnvironment_protection_rulesMember3(), 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 *Environment_protection_rulesMember3) 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 *Environment_protection_rulesMember3) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Environment_protection_rulesMember3) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Environment_protection_rulesMember3) GetNodeId()(*string) { + return m.node_id +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Environment_protection_rulesMember3) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *Environment_protection_rulesMember3) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + 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 *Environment_protection_rulesMember3) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *Environment_protection_rulesMember3) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Environment_protection_rulesMember3) SetNodeId(value *string)() { + m.node_id = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Environment_protection_rulesMember3) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +type Environment_protection_rulesMember3able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetNodeId()(*string) + GetTypeEscaped()(*string) + SetId(value *int32)() + SetNodeId(value *string)() + SetTypeEscaped(value *string)() +} diff --git a/pkg/github/models/event.go b/pkg/github/models/event.go new file mode 100644 index 00000000..8b48f643 --- /dev/null +++ b/pkg/github/models/event.go @@ -0,0 +1,285 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Event event +type Event struct { + // Actor + actor Actorable + // 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 id property + id *string + // Actor + org Actorable + // The payload property + payload Event_payloadable + // The public property + public *bool + // The repo property + repo Event_repoable + // The type property + typeEscaped *string +} +// NewEvent instantiates a new Event and sets the default values. +func NewEvent()(*Event) { + m := &Event{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEvent(), nil +} +// GetActor gets the actor property value. Actor +// returns a Actorable when successful +func (m *Event) GetActor()(Actorable) { + return m.actor +} +// 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 *Event) 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 *Event) 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 *Event) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateActorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(Actorable)) + } + return nil + } + 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["org"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateActorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrg(val.(Actorable)) + } + return nil + } + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEvent_payloadFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPayload(val.(Event_payloadable)) + } + return nil + } + res["public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPublic(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateEvent_repoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepo(val.(Event_repoable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *string when successful +func (m *Event) GetId()(*string) { + return m.id +} +// GetOrg gets the org property value. Actor +// returns a Actorable when successful +func (m *Event) GetOrg()(Actorable) { + return m.org +} +// GetPayload gets the payload property value. The payload property +// returns a Event_payloadable when successful +func (m *Event) GetPayload()(Event_payloadable) { + return m.payload +} +// GetPublic gets the public property value. The public property +// returns a *bool when successful +func (m *Event) GetPublic()(*bool) { + return m.public +} +// GetRepo gets the repo property value. The repo property +// returns a Event_repoable when successful +func (m *Event) GetRepo()(Event_repoable) { + return m.repo +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Event) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *Event) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("org", m.GetOrg()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("public", m.GetPublic()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. Actor +func (m *Event) SetActor(value Actorable)() { + m.actor = 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 *Event) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Event) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *Event) SetId(value *string)() { + m.id = value +} +// SetOrg sets the org property value. Actor +func (m *Event) SetOrg(value Actorable)() { + m.org = value +} +// SetPayload sets the payload property value. The payload property +func (m *Event) SetPayload(value Event_payloadable)() { + m.payload = value +} +// SetPublic sets the public property value. The public property +func (m *Event) SetPublic(value *bool)() { + m.public = value +} +// SetRepo sets the repo property value. The repo property +func (m *Event) SetRepo(value Event_repoable)() { + m.repo = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Event) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +type Eventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(Actorable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*string) + GetOrg()(Actorable) + GetPayload()(Event_payloadable) + GetPublic()(*bool) + GetRepo()(Event_repoable) + GetTypeEscaped()(*string) + SetActor(value Actorable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *string)() + SetOrg(value Actorable)() + SetPayload(value Event_payloadable)() + SetPublic(value *bool)() + SetRepo(value Event_repoable)() + SetTypeEscaped(value *string)() +} diff --git a/pkg/github/models/event_escaped_payload.go b/pkg/github/models/event_escaped_payload.go new file mode 100644 index 00000000..f3528f17 --- /dev/null +++ b/pkg/github/models/event_escaped_payload.go @@ -0,0 +1,179 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Event_payload struct { + // The action property + action *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Comments provide a way for people to collaborate on an issue. + comment IssueCommentable + // Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. + issue Issueable + // The pages property + pages []Event_payload_pagesable +} +// NewEvent_payload instantiates a new Event_payload and sets the default values. +func NewEvent_payload()(*Event_payload) { + m := &Event_payload{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEvent_payloadFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEvent_payloadFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEvent_payload(), nil +} +// GetAction gets the action property value. The action property +// returns a *string when successful +func (m *Event_payload) GetAction()(*string) { + return m.action +} +// 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 *Event_payload) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComment gets the comment property value. Comments provide a way for people to collaborate on an issue. +// returns a IssueCommentable when successful +func (m *Event_payload) GetComment()(IssueCommentable) { + return m.comment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Event_payload) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["action"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAction(val) + } + return nil + } + res["comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueCommentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetComment(val.(IssueCommentable)) + } + return nil + } + res["issue"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIssue(val.(Issueable)) + } + return nil + } + res["pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateEvent_payload_pagesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Event_payload_pagesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Event_payload_pagesable) + } + } + m.SetPages(res) + } + return nil + } + return res +} +// GetIssue gets the issue property value. Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +// returns a Issueable when successful +func (m *Event_payload) GetIssue()(Issueable) { + return m.issue +} +// GetPages gets the pages property value. The pages property +// returns a []Event_payload_pagesable when successful +func (m *Event_payload) GetPages()([]Event_payload_pagesable) { + return m.pages +} +// Serialize serializes information the current object +func (m *Event_payload) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("action", m.GetAction()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("comment", m.GetComment()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("issue", m.GetIssue()) + if err != nil { + return err + } + } + if m.GetPages() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetPages())) + for i, v := range m.GetPages() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("pages", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAction sets the action property value. The action property +func (m *Event_payload) SetAction(value *string)() { + m.action = 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 *Event_payload) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComment sets the comment property value. Comments provide a way for people to collaborate on an issue. +func (m *Event_payload) SetComment(value IssueCommentable)() { + m.comment = value +} +// SetIssue sets the issue property value. Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +func (m *Event_payload) SetIssue(value Issueable)() { + m.issue = value +} +// SetPages sets the pages property value. The pages property +func (m *Event_payload) SetPages(value []Event_payload_pagesable)() { + m.pages = value +} +type Event_payloadable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAction()(*string) + GetComment()(IssueCommentable) + GetIssue()(Issueable) + GetPages()([]Event_payload_pagesable) + SetAction(value *string)() + SetComment(value IssueCommentable)() + SetIssue(value Issueable)() + SetPages(value []Event_payload_pagesable)() +} diff --git a/pkg/github/models/event_escaped_payload_escaped_pages.go b/pkg/github/models/event_escaped_payload_escaped_pages.go new file mode 100644 index 00000000..73a9780c --- /dev/null +++ b/pkg/github/models/event_escaped_payload_escaped_pages.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Event_payload_pages struct { + // The action property + action *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The html_url property + html_url *string + // The page_name property + page_name *string + // The sha property + sha *string + // The summary property + summary *string + // The title property + title *string +} +// NewEvent_payload_pages instantiates a new Event_payload_pages and sets the default values. +func NewEvent_payload_pages()(*Event_payload_pages) { + m := &Event_payload_pages{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEvent_payload_pagesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEvent_payload_pagesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEvent_payload_pages(), nil +} +// GetAction gets the action property value. The action property +// returns a *string when successful +func (m *Event_payload_pages) GetAction()(*string) { + return m.action +} +// 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 *Event_payload_pages) 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 *Event_payload_pages) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["action"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAction(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["page_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPageName(val) + } + return nil + } + 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["summary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSummary(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Event_payload_pages) GetHtmlUrl()(*string) { + return m.html_url +} +// GetPageName gets the page_name property value. The page_name property +// returns a *string when successful +func (m *Event_payload_pages) GetPageName()(*string) { + return m.page_name +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *Event_payload_pages) GetSha()(*string) { + return m.sha +} +// GetSummary gets the summary property value. The summary property +// returns a *string when successful +func (m *Event_payload_pages) GetSummary()(*string) { + return m.summary +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *Event_payload_pages) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *Event_payload_pages) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("action", m.GetAction()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("page_name", m.GetPageName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("summary", m.GetSummary()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAction sets the action property value. The action property +func (m *Event_payload_pages) SetAction(value *string)() { + m.action = 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 *Event_payload_pages) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Event_payload_pages) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetPageName sets the page_name property value. The page_name property +func (m *Event_payload_pages) SetPageName(value *string)() { + m.page_name = value +} +// SetSha sets the sha property value. The sha property +func (m *Event_payload_pages) SetSha(value *string)() { + m.sha = value +} +// SetSummary sets the summary property value. The summary property +func (m *Event_payload_pages) SetSummary(value *string)() { + m.summary = value +} +// SetTitle sets the title property value. The title property +func (m *Event_payload_pages) SetTitle(value *string)() { + m.title = value +} +type Event_payload_pagesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAction()(*string) + GetHtmlUrl()(*string) + GetPageName()(*string) + GetSha()(*string) + GetSummary()(*string) + GetTitle()(*string) + SetAction(value *string)() + SetHtmlUrl(value *string)() + SetPageName(value *string)() + SetSha(value *string)() + SetSummary(value *string)() + SetTitle(value *string)() +} diff --git a/pkg/github/models/event_escaped_repo.go b/pkg/github/models/event_escaped_repo.go new file mode 100644 index 00000000..cfc4bf99 --- /dev/null +++ b/pkg/github/models/event_escaped_repo.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Event_repo struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // The name property + name *string + // The url property + url *string +} +// NewEvent_repo instantiates a new Event_repo and sets the default values. +func NewEvent_repo()(*Event_repo) { + m := &Event_repo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEvent_repoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEvent_repoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEvent_repo(), 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 *Event_repo) 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 *Event_repo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Event_repo) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Event_repo) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Event_repo) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Event_repo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Event_repo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *Event_repo) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *Event_repo) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *Event_repo) SetUrl(value *string)() { + m.url = value +} +type Event_repoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetName()(*string) + GetUrl()(*string) + SetId(value *int32)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/events503_error.go b/pkg/github/models/events503_error.go new file mode 100644 index 00000000..31ef3b79 --- /dev/null +++ b/pkg/github/models/events503_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 Events503Error 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 +} +// NewEvents503Error instantiates a new Events503Error and sets the default values. +func NewEvents503Error()(*Events503Error) { + m := &Events503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEvents503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEvents503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEvents503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Events503Error) 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 *Events503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Events503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Events503Error) 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 *Events503Error) 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 *Events503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Events503Error) 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 *Events503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Events503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Events503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Events503Error) SetMessage(value *string)() { + m.message = value +} +type Events503Errorable 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/external_group.go b/pkg/github/models/external_group.go new file mode 100644 index 00000000..41d4c3cc --- /dev/null +++ b/pkg/github/models/external_group.go @@ -0,0 +1,221 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ExternalGroup information about an external group's usage and its members +type ExternalGroup 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 internal ID of the group + group_id *int32 + // The display name for the group + group_name *string + // An array of external members linked to this group + members []ExternalGroup_membersable + // An array of teams linked to this group + teams []ExternalGroup_teamsable + // The date when the group was last updated_at + updated_at *string +} +// NewExternalGroup instantiates a new ExternalGroup and sets the default values. +func NewExternalGroup()(*ExternalGroup) { + m := &ExternalGroup{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateExternalGroupFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateExternalGroupFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewExternalGroup(), 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 *ExternalGroup) 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 *ExternalGroup) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["group_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetGroupId(val) + } + return nil + } + res["group_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGroupName(val) + } + return nil + } + res["members"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateExternalGroup_membersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ExternalGroup_membersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ExternalGroup_membersable) + } + } + m.SetMembers(res) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateExternalGroup_teamsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ExternalGroup_teamsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ExternalGroup_teamsable) + } + } + m.SetTeams(res) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetGroupId gets the group_id property value. The internal ID of the group +// returns a *int32 when successful +func (m *ExternalGroup) GetGroupId()(*int32) { + return m.group_id +} +// GetGroupName gets the group_name property value. The display name for the group +// returns a *string when successful +func (m *ExternalGroup) GetGroupName()(*string) { + return m.group_name +} +// GetMembers gets the members property value. An array of external members linked to this group +// returns a []ExternalGroup_membersable when successful +func (m *ExternalGroup) GetMembers()([]ExternalGroup_membersable) { + return m.members +} +// GetTeams gets the teams property value. An array of teams linked to this group +// returns a []ExternalGroup_teamsable when successful +func (m *ExternalGroup) GetTeams()([]ExternalGroup_teamsable) { + return m.teams +} +// GetUpdatedAt gets the updated_at property value. The date when the group was last updated_at +// returns a *string when successful +func (m *ExternalGroup) GetUpdatedAt()(*string) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *ExternalGroup) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("group_id", m.GetGroupId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("group_name", m.GetGroupName()) + if err != nil { + return err + } + } + if m.GetMembers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMembers())) + for i, v := range m.GetMembers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("members", cast) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTeams())) + for i, v := range m.GetTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("teams", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + 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 *ExternalGroup) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGroupId sets the group_id property value. The internal ID of the group +func (m *ExternalGroup) SetGroupId(value *int32)() { + m.group_id = value +} +// SetGroupName sets the group_name property value. The display name for the group +func (m *ExternalGroup) SetGroupName(value *string)() { + m.group_name = value +} +// SetMembers sets the members property value. An array of external members linked to this group +func (m *ExternalGroup) SetMembers(value []ExternalGroup_membersable)() { + m.members = value +} +// SetTeams sets the teams property value. An array of teams linked to this group +func (m *ExternalGroup) SetTeams(value []ExternalGroup_teamsable)() { + m.teams = value +} +// SetUpdatedAt sets the updated_at property value. The date when the group was last updated_at +func (m *ExternalGroup) SetUpdatedAt(value *string)() { + m.updated_at = value +} +type ExternalGroupable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGroupId()(*int32) + GetGroupName()(*string) + GetMembers()([]ExternalGroup_membersable) + GetTeams()([]ExternalGroup_teamsable) + GetUpdatedAt()(*string) + SetGroupId(value *int32)() + SetGroupName(value *string)() + SetMembers(value []ExternalGroup_membersable)() + SetTeams(value []ExternalGroup_teamsable)() + SetUpdatedAt(value *string)() +} diff --git a/pkg/github/models/external_group_escaped_members.go b/pkg/github/models/external_group_escaped_members.go new file mode 100644 index 00000000..78d17d58 --- /dev/null +++ b/pkg/github/models/external_group_escaped_members.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ExternalGroup_members 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 email attached to a user + member_email *string + // The internal user ID of the identity + member_id *int32 + // The handle/login for the user + member_login *string + // The user display name/profile name + member_name *string +} +// NewExternalGroup_members instantiates a new ExternalGroup_members and sets the default values. +func NewExternalGroup_members()(*ExternalGroup_members) { + m := &ExternalGroup_members{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateExternalGroup_membersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateExternalGroup_membersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewExternalGroup_members(), 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 *ExternalGroup_members) 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 *ExternalGroup_members) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["member_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMemberEmail(val) + } + return nil + } + res["member_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMemberId(val) + } + return nil + } + res["member_login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMemberLogin(val) + } + return nil + } + res["member_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMemberName(val) + } + return nil + } + return res +} +// GetMemberEmail gets the member_email property value. An email attached to a user +// returns a *string when successful +func (m *ExternalGroup_members) GetMemberEmail()(*string) { + return m.member_email +} +// GetMemberId gets the member_id property value. The internal user ID of the identity +// returns a *int32 when successful +func (m *ExternalGroup_members) GetMemberId()(*int32) { + return m.member_id +} +// GetMemberLogin gets the member_login property value. The handle/login for the user +// returns a *string when successful +func (m *ExternalGroup_members) GetMemberLogin()(*string) { + return m.member_login +} +// GetMemberName gets the member_name property value. The user display name/profile name +// returns a *string when successful +func (m *ExternalGroup_members) GetMemberName()(*string) { + return m.member_name +} +// Serialize serializes information the current object +func (m *ExternalGroup_members) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("member_email", m.GetMemberEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("member_id", m.GetMemberId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("member_login", m.GetMemberLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("member_name", m.GetMemberName()) + 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 *ExternalGroup_members) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMemberEmail sets the member_email property value. An email attached to a user +func (m *ExternalGroup_members) SetMemberEmail(value *string)() { + m.member_email = value +} +// SetMemberId sets the member_id property value. The internal user ID of the identity +func (m *ExternalGroup_members) SetMemberId(value *int32)() { + m.member_id = value +} +// SetMemberLogin sets the member_login property value. The handle/login for the user +func (m *ExternalGroup_members) SetMemberLogin(value *string)() { + m.member_login = value +} +// SetMemberName sets the member_name property value. The user display name/profile name +func (m *ExternalGroup_members) SetMemberName(value *string)() { + m.member_name = value +} +type ExternalGroup_membersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMemberEmail()(*string) + GetMemberId()(*int32) + GetMemberLogin()(*string) + GetMemberName()(*string) + SetMemberEmail(value *string)() + SetMemberId(value *int32)() + SetMemberLogin(value *string)() + SetMemberName(value *string)() +} diff --git a/pkg/github/models/external_group_escaped_teams.go b/pkg/github/models/external_group_escaped_teams.go new file mode 100644 index 00000000..601fc1b7 --- /dev/null +++ b/pkg/github/models/external_group_escaped_teams.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ExternalGroup_teams struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id for a team + team_id *int32 + // The name of the team + team_name *string +} +// NewExternalGroup_teams instantiates a new ExternalGroup_teams and sets the default values. +func NewExternalGroup_teams()(*ExternalGroup_teams) { + m := &ExternalGroup_teams{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateExternalGroup_teamsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateExternalGroup_teamsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewExternalGroup_teams(), 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 *ExternalGroup_teams) 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 *ExternalGroup_teams) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["team_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTeamId(val) + } + return nil + } + res["team_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamName(val) + } + return nil + } + return res +} +// GetTeamId gets the team_id property value. The id for a team +// returns a *int32 when successful +func (m *ExternalGroup_teams) GetTeamId()(*int32) { + return m.team_id +} +// GetTeamName gets the team_name property value. The name of the team +// returns a *string when successful +func (m *ExternalGroup_teams) GetTeamName()(*string) { + return m.team_name +} +// Serialize serializes information the current object +func (m *ExternalGroup_teams) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("team_id", m.GetTeamId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("team_name", m.GetTeamName()) + 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 *ExternalGroup_teams) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTeamId sets the team_id property value. The id for a team +func (m *ExternalGroup_teams) SetTeamId(value *int32)() { + m.team_id = value +} +// SetTeamName sets the team_name property value. The name of the team +func (m *ExternalGroup_teams) SetTeamName(value *string)() { + m.team_name = value +} +type ExternalGroup_teamsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTeamId()(*int32) + GetTeamName()(*string) + SetTeamId(value *int32)() + SetTeamName(value *string)() +} diff --git a/pkg/github/models/external_groups.go b/pkg/github/models/external_groups.go new file mode 100644 index 00000000..15a6d2bc --- /dev/null +++ b/pkg/github/models/external_groups.go @@ -0,0 +1,93 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ExternalGroups a list of external groups available to be connected to a team +type ExternalGroups 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 array of external groups available to be mapped to a team + groups []ExternalGroups_groupsable +} +// NewExternalGroups instantiates a new ExternalGroups and sets the default values. +func NewExternalGroups()(*ExternalGroups) { + m := &ExternalGroups{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateExternalGroupsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateExternalGroupsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewExternalGroups(), 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 *ExternalGroups) 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 *ExternalGroups) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["groups"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateExternalGroups_groupsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ExternalGroups_groupsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ExternalGroups_groupsable) + } + } + m.SetGroups(res) + } + return nil + } + return res +} +// GetGroups gets the groups property value. An array of external groups available to be mapped to a team +// returns a []ExternalGroups_groupsable when successful +func (m *ExternalGroups) GetGroups()([]ExternalGroups_groupsable) { + return m.groups +} +// Serialize serializes information the current object +func (m *ExternalGroups) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetGroups() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetGroups())) + for i, v := range m.GetGroups() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("groups", 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 *ExternalGroups) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGroups sets the groups property value. An array of external groups available to be mapped to a team +func (m *ExternalGroups) SetGroups(value []ExternalGroups_groupsable)() { + m.groups = value +} +type ExternalGroupsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGroups()([]ExternalGroups_groupsable) + SetGroups(value []ExternalGroups_groupsable)() +} diff --git a/pkg/github/models/external_groups_escaped_groups.go b/pkg/github/models/external_groups_escaped_groups.go new file mode 100644 index 00000000..0ae7e97a --- /dev/null +++ b/pkg/github/models/external_groups_escaped_groups.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ExternalGroups_groups 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 internal ID of the group + group_id *int32 + // The display name of the group + group_name *string + // The time of the last update for this group + updated_at *string +} +// NewExternalGroups_groups instantiates a new ExternalGroups_groups and sets the default values. +func NewExternalGroups_groups()(*ExternalGroups_groups) { + m := &ExternalGroups_groups{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateExternalGroups_groupsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateExternalGroups_groupsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewExternalGroups_groups(), 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 *ExternalGroups_groups) 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 *ExternalGroups_groups) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["group_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetGroupId(val) + } + return nil + } + res["group_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGroupName(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetGroupId gets the group_id property value. The internal ID of the group +// returns a *int32 when successful +func (m *ExternalGroups_groups) GetGroupId()(*int32) { + return m.group_id +} +// GetGroupName gets the group_name property value. The display name of the group +// returns a *string when successful +func (m *ExternalGroups_groups) GetGroupName()(*string) { + return m.group_name +} +// GetUpdatedAt gets the updated_at property value. The time of the last update for this group +// returns a *string when successful +func (m *ExternalGroups_groups) GetUpdatedAt()(*string) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *ExternalGroups_groups) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("group_id", m.GetGroupId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("group_name", m.GetGroupName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + 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 *ExternalGroups_groups) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGroupId sets the group_id property value. The internal ID of the group +func (m *ExternalGroups_groups) SetGroupId(value *int32)() { + m.group_id = value +} +// SetGroupName sets the group_name property value. The display name of the group +func (m *ExternalGroups_groups) SetGroupName(value *string)() { + m.group_name = value +} +// SetUpdatedAt sets the updated_at property value. The time of the last update for this group +func (m *ExternalGroups_groups) SetUpdatedAt(value *string)() { + m.updated_at = value +} +type ExternalGroups_groupsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGroupId()(*int32) + GetGroupName()(*string) + GetUpdatedAt()(*string) + SetGroupId(value *int32)() + SetGroupName(value *string)() + SetUpdatedAt(value *string)() +} diff --git a/pkg/github/models/feed.go b/pkg/github/models/feed.go new file mode 100644 index 00000000..83ce8add --- /dev/null +++ b/pkg/github/models/feed.go @@ -0,0 +1,377 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Feed feed +type Feed struct { + // The _links property + _links Feed__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The current_user_actor_url property + current_user_actor_url *string + // The current_user_organization_url property + current_user_organization_url *string + // The current_user_organization_urls property + current_user_organization_urls []string + // The current_user_public_url property + current_user_public_url *string + // The current_user_url property + current_user_url *string + // A feed of discussions for a given repository and category. + repository_discussions_category_url *string + // A feed of discussions for a given repository. + repository_discussions_url *string + // The security_advisories_url property + security_advisories_url *string + // The timeline_url property + timeline_url *string + // The user_url property + user_url *string +} +// NewFeed instantiates a new Feed and sets the default values. +func NewFeed()(*Feed) { + m := &Feed{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFeedFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFeedFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFeed(), 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 *Feed) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCurrentUserActorUrl gets the current_user_actor_url property value. The current_user_actor_url property +// returns a *string when successful +func (m *Feed) GetCurrentUserActorUrl()(*string) { + return m.current_user_actor_url +} +// GetCurrentUserOrganizationUrl gets the current_user_organization_url property value. The current_user_organization_url property +// returns a *string when successful +func (m *Feed) GetCurrentUserOrganizationUrl()(*string) { + return m.current_user_organization_url +} +// GetCurrentUserOrganizationUrls gets the current_user_organization_urls property value. The current_user_organization_urls property +// returns a []string when successful +func (m *Feed) GetCurrentUserOrganizationUrls()([]string) { + return m.current_user_organization_urls +} +// GetCurrentUserPublicUrl gets the current_user_public_url property value. The current_user_public_url property +// returns a *string when successful +func (m *Feed) GetCurrentUserPublicUrl()(*string) { + return m.current_user_public_url +} +// GetCurrentUserUrl gets the current_user_url property value. The current_user_url property +// returns a *string when successful +func (m *Feed) GetCurrentUserUrl()(*string) { + return m.current_user_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Feed) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFeed__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(Feed__linksable)) + } + return nil + } + res["current_user_actor_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserActorUrl(val) + } + return nil + } + res["current_user_organization_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserOrganizationUrl(val) + } + return nil + } + res["current_user_organization_urls"] = 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.SetCurrentUserOrganizationUrls(res) + } + return nil + } + res["current_user_public_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserPublicUrl(val) + } + return nil + } + res["current_user_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserUrl(val) + } + return nil + } + res["repository_discussions_category_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryDiscussionsCategoryUrl(val) + } + return nil + } + res["repository_discussions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryDiscussionsUrl(val) + } + return nil + } + res["security_advisories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecurityAdvisoriesUrl(val) + } + return nil + } + res["timeline_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTimelineUrl(val) + } + return nil + } + res["user_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserUrl(val) + } + return nil + } + return res +} +// GetLinks gets the _links property value. The _links property +// returns a Feed__linksable when successful +func (m *Feed) GetLinks()(Feed__linksable) { + return m._links +} +// GetRepositoryDiscussionsCategoryUrl gets the repository_discussions_category_url property value. A feed of discussions for a given repository and category. +// returns a *string when successful +func (m *Feed) GetRepositoryDiscussionsCategoryUrl()(*string) { + return m.repository_discussions_category_url +} +// GetRepositoryDiscussionsUrl gets the repository_discussions_url property value. A feed of discussions for a given repository. +// returns a *string when successful +func (m *Feed) GetRepositoryDiscussionsUrl()(*string) { + return m.repository_discussions_url +} +// GetSecurityAdvisoriesUrl gets the security_advisories_url property value. The security_advisories_url property +// returns a *string when successful +func (m *Feed) GetSecurityAdvisoriesUrl()(*string) { + return m.security_advisories_url +} +// GetTimelineUrl gets the timeline_url property value. The timeline_url property +// returns a *string when successful +func (m *Feed) GetTimelineUrl()(*string) { + return m.timeline_url +} +// GetUserUrl gets the user_url property value. The user_url property +// returns a *string when successful +func (m *Feed) GetUserUrl()(*string) { + return m.user_url +} +// Serialize serializes information the current object +func (m *Feed) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("current_user_actor_url", m.GetCurrentUserActorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("current_user_organization_url", m.GetCurrentUserOrganizationUrl()) + if err != nil { + return err + } + } + if m.GetCurrentUserOrganizationUrls() != nil { + err := writer.WriteCollectionOfStringValues("current_user_organization_urls", m.GetCurrentUserOrganizationUrls()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("current_user_public_url", m.GetCurrentUserPublicUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("current_user_url", m.GetCurrentUserUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_discussions_category_url", m.GetRepositoryDiscussionsCategoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_discussions_url", m.GetRepositoryDiscussionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("security_advisories_url", m.GetSecurityAdvisoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("timeline_url", m.GetTimelineUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user_url", m.GetUserUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *Feed) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCurrentUserActorUrl sets the current_user_actor_url property value. The current_user_actor_url property +func (m *Feed) SetCurrentUserActorUrl(value *string)() { + m.current_user_actor_url = value +} +// SetCurrentUserOrganizationUrl sets the current_user_organization_url property value. The current_user_organization_url property +func (m *Feed) SetCurrentUserOrganizationUrl(value *string)() { + m.current_user_organization_url = value +} +// SetCurrentUserOrganizationUrls sets the current_user_organization_urls property value. The current_user_organization_urls property +func (m *Feed) SetCurrentUserOrganizationUrls(value []string)() { + m.current_user_organization_urls = value +} +// SetCurrentUserPublicUrl sets the current_user_public_url property value. The current_user_public_url property +func (m *Feed) SetCurrentUserPublicUrl(value *string)() { + m.current_user_public_url = value +} +// SetCurrentUserUrl sets the current_user_url property value. The current_user_url property +func (m *Feed) SetCurrentUserUrl(value *string)() { + m.current_user_url = value +} +// SetLinks sets the _links property value. The _links property +func (m *Feed) SetLinks(value Feed__linksable)() { + m._links = value +} +// SetRepositoryDiscussionsCategoryUrl sets the repository_discussions_category_url property value. A feed of discussions for a given repository and category. +func (m *Feed) SetRepositoryDiscussionsCategoryUrl(value *string)() { + m.repository_discussions_category_url = value +} +// SetRepositoryDiscussionsUrl sets the repository_discussions_url property value. A feed of discussions for a given repository. +func (m *Feed) SetRepositoryDiscussionsUrl(value *string)() { + m.repository_discussions_url = value +} +// SetSecurityAdvisoriesUrl sets the security_advisories_url property value. The security_advisories_url property +func (m *Feed) SetSecurityAdvisoriesUrl(value *string)() { + m.security_advisories_url = value +} +// SetTimelineUrl sets the timeline_url property value. The timeline_url property +func (m *Feed) SetTimelineUrl(value *string)() { + m.timeline_url = value +} +// SetUserUrl sets the user_url property value. The user_url property +func (m *Feed) SetUserUrl(value *string)() { + m.user_url = value +} +type Feedable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCurrentUserActorUrl()(*string) + GetCurrentUserOrganizationUrl()(*string) + GetCurrentUserOrganizationUrls()([]string) + GetCurrentUserPublicUrl()(*string) + GetCurrentUserUrl()(*string) + GetLinks()(Feed__linksable) + GetRepositoryDiscussionsCategoryUrl()(*string) + GetRepositoryDiscussionsUrl()(*string) + GetSecurityAdvisoriesUrl()(*string) + GetTimelineUrl()(*string) + GetUserUrl()(*string) + SetCurrentUserActorUrl(value *string)() + SetCurrentUserOrganizationUrl(value *string)() + SetCurrentUserOrganizationUrls(value []string)() + SetCurrentUserPublicUrl(value *string)() + SetCurrentUserUrl(value *string)() + SetLinks(value Feed__linksable)() + SetRepositoryDiscussionsCategoryUrl(value *string)() + SetRepositoryDiscussionsUrl(value *string)() + SetSecurityAdvisoriesUrl(value *string)() + SetTimelineUrl(value *string)() + SetUserUrl(value *string)() +} diff --git a/pkg/github/models/feed_escaped__escaped_links.go b/pkg/github/models/feed_escaped__escaped_links.go new file mode 100644 index 00000000..c6a335b4 --- /dev/null +++ b/pkg/github/models/feed_escaped__escaped_links.go @@ -0,0 +1,353 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Feed__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Hypermedia Link with Type + current_user LinkWithTypeable + // Hypermedia Link with Type + current_user_actor LinkWithTypeable + // Hypermedia Link with Type + current_user_organization LinkWithTypeable + // The current_user_organizations property + current_user_organizations []LinkWithTypeable + // Hypermedia Link with Type + current_user_public LinkWithTypeable + // Hypermedia Link with Type + repository_discussions LinkWithTypeable + // Hypermedia Link with Type + repository_discussions_category LinkWithTypeable + // Hypermedia Link with Type + security_advisories LinkWithTypeable + // Hypermedia Link with Type + timeline LinkWithTypeable + // Hypermedia Link with Type + user LinkWithTypeable +} +// NewFeed__links instantiates a new Feed__links and sets the default values. +func NewFeed__links()(*Feed__links) { + m := &Feed__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFeed__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFeed__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFeed__links(), 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 *Feed__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCurrentUser gets the current_user property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetCurrentUser()(LinkWithTypeable) { + return m.current_user +} +// GetCurrentUserActor gets the current_user_actor property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetCurrentUserActor()(LinkWithTypeable) { + return m.current_user_actor +} +// GetCurrentUserOrganization gets the current_user_organization property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetCurrentUserOrganization()(LinkWithTypeable) { + return m.current_user_organization +} +// GetCurrentUserOrganizations gets the current_user_organizations property value. The current_user_organizations property +// returns a []LinkWithTypeable when successful +func (m *Feed__links) GetCurrentUserOrganizations()([]LinkWithTypeable) { + return m.current_user_organizations +} +// GetCurrentUserPublic gets the current_user_public property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetCurrentUserPublic()(LinkWithTypeable) { + return m.current_user_public +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Feed__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["current_user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCurrentUser(val.(LinkWithTypeable)) + } + return nil + } + res["current_user_actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserActor(val.(LinkWithTypeable)) + } + return nil + } + res["current_user_organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserOrganization(val.(LinkWithTypeable)) + } + return nil + } + res["current_user_organizations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]LinkWithTypeable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(LinkWithTypeable) + } + } + m.SetCurrentUserOrganizations(res) + } + return nil + } + res["current_user_public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserPublic(val.(LinkWithTypeable)) + } + return nil + } + res["repository_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepositoryDiscussions(val.(LinkWithTypeable)) + } + return nil + } + res["repository_discussions_category"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepositoryDiscussionsCategory(val.(LinkWithTypeable)) + } + return nil + } + res["security_advisories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAdvisories(val.(LinkWithTypeable)) + } + return nil + } + res["timeline"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTimeline(val.(LinkWithTypeable)) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkWithTypeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(LinkWithTypeable)) + } + return nil + } + return res +} +// GetRepositoryDiscussions gets the repository_discussions property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetRepositoryDiscussions()(LinkWithTypeable) { + return m.repository_discussions +} +// GetRepositoryDiscussionsCategory gets the repository_discussions_category property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetRepositoryDiscussionsCategory()(LinkWithTypeable) { + return m.repository_discussions_category +} +// GetSecurityAdvisories gets the security_advisories property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetSecurityAdvisories()(LinkWithTypeable) { + return m.security_advisories +} +// GetTimeline gets the timeline property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetTimeline()(LinkWithTypeable) { + return m.timeline +} +// GetUser gets the user property value. Hypermedia Link with Type +// returns a LinkWithTypeable when successful +func (m *Feed__links) GetUser()(LinkWithTypeable) { + return m.user +} +// Serialize serializes information the current object +func (m *Feed__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("current_user", m.GetCurrentUser()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("current_user_actor", m.GetCurrentUserActor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("current_user_organization", m.GetCurrentUserOrganization()) + if err != nil { + return err + } + } + if m.GetCurrentUserOrganizations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCurrentUserOrganizations())) + for i, v := range m.GetCurrentUserOrganizations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("current_user_organizations", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("current_user_public", m.GetCurrentUserPublic()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository_discussions", m.GetRepositoryDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository_discussions_category", m.GetRepositoryDiscussionsCategory()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("security_advisories", m.GetSecurityAdvisories()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("timeline", m.GetTimeline()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *Feed__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCurrentUser sets the current_user property value. Hypermedia Link with Type +func (m *Feed__links) SetCurrentUser(value LinkWithTypeable)() { + m.current_user = value +} +// SetCurrentUserActor sets the current_user_actor property value. Hypermedia Link with Type +func (m *Feed__links) SetCurrentUserActor(value LinkWithTypeable)() { + m.current_user_actor = value +} +// SetCurrentUserOrganization sets the current_user_organization property value. Hypermedia Link with Type +func (m *Feed__links) SetCurrentUserOrganization(value LinkWithTypeable)() { + m.current_user_organization = value +} +// SetCurrentUserOrganizations sets the current_user_organizations property value. The current_user_organizations property +func (m *Feed__links) SetCurrentUserOrganizations(value []LinkWithTypeable)() { + m.current_user_organizations = value +} +// SetCurrentUserPublic sets the current_user_public property value. Hypermedia Link with Type +func (m *Feed__links) SetCurrentUserPublic(value LinkWithTypeable)() { + m.current_user_public = value +} +// SetRepositoryDiscussions sets the repository_discussions property value. Hypermedia Link with Type +func (m *Feed__links) SetRepositoryDiscussions(value LinkWithTypeable)() { + m.repository_discussions = value +} +// SetRepositoryDiscussionsCategory sets the repository_discussions_category property value. Hypermedia Link with Type +func (m *Feed__links) SetRepositoryDiscussionsCategory(value LinkWithTypeable)() { + m.repository_discussions_category = value +} +// SetSecurityAdvisories sets the security_advisories property value. Hypermedia Link with Type +func (m *Feed__links) SetSecurityAdvisories(value LinkWithTypeable)() { + m.security_advisories = value +} +// SetTimeline sets the timeline property value. Hypermedia Link with Type +func (m *Feed__links) SetTimeline(value LinkWithTypeable)() { + m.timeline = value +} +// SetUser sets the user property value. Hypermedia Link with Type +func (m *Feed__links) SetUser(value LinkWithTypeable)() { + m.user = value +} +type Feed__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCurrentUser()(LinkWithTypeable) + GetCurrentUserActor()(LinkWithTypeable) + GetCurrentUserOrganization()(LinkWithTypeable) + GetCurrentUserOrganizations()([]LinkWithTypeable) + GetCurrentUserPublic()(LinkWithTypeable) + GetRepositoryDiscussions()(LinkWithTypeable) + GetRepositoryDiscussionsCategory()(LinkWithTypeable) + GetSecurityAdvisories()(LinkWithTypeable) + GetTimeline()(LinkWithTypeable) + GetUser()(LinkWithTypeable) + SetCurrentUser(value LinkWithTypeable)() + SetCurrentUserActor(value LinkWithTypeable)() + SetCurrentUserOrganization(value LinkWithTypeable)() + SetCurrentUserOrganizations(value []LinkWithTypeable)() + SetCurrentUserPublic(value LinkWithTypeable)() + SetRepositoryDiscussions(value LinkWithTypeable)() + SetRepositoryDiscussionsCategory(value LinkWithTypeable)() + SetSecurityAdvisories(value LinkWithTypeable)() + SetTimeline(value LinkWithTypeable)() + SetUser(value LinkWithTypeable)() +} diff --git a/pkg/github/models/file_commit.go b/pkg/github/models/file_commit.go new file mode 100644 index 00000000..6183a9ec --- /dev/null +++ b/pkg/github/models/file_commit.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// FileCommit file Commit +type FileCommit 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 commit property + commit FileCommit_commitable + // The content property + content FileCommit_contentable +} +// NewFileCommit instantiates a new FileCommit and sets the default values. +func NewFileCommit()(*FileCommit) { + m := &FileCommit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit(), 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 *FileCommit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommit gets the commit property value. The commit property +// returns a FileCommit_commitable when successful +func (m *FileCommit) GetCommit()(FileCommit_commitable) { + return m.commit +} +// GetContent gets the content property value. The content property +// returns a FileCommit_contentable when successful +func (m *FileCommit) GetContent()(FileCommit_contentable) { + return m.content +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFileCommit_commitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommit(val.(FileCommit_commitable)) + } + return nil + } + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFileCommit_contentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetContent(val.(FileCommit_contentable)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *FileCommit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("content", m.GetContent()) + 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 *FileCommit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommit sets the commit property value. The commit property +func (m *FileCommit) SetCommit(value FileCommit_commitable)() { + m.commit = value +} +// SetContent sets the content property value. The content property +func (m *FileCommit) SetContent(value FileCommit_contentable)() { + m.content = value +} +type FileCommitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommit()(FileCommit_commitable) + GetContent()(FileCommit_contentable) + SetCommit(value FileCommit_commitable)() + SetContent(value FileCommit_contentable)() +} diff --git a/pkg/github/models/file_commit503_error.go b/pkg/github/models/file_commit503_error.go new file mode 100644 index 00000000..3b309fd2 --- /dev/null +++ b/pkg/github/models/file_commit503_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 FileCommit503Error 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 +} +// NewFileCommit503Error instantiates a new FileCommit503Error and sets the default values. +func NewFileCommit503Error()(*FileCommit503Error) { + m := &FileCommit503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *FileCommit503Error) 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 *FileCommit503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *FileCommit503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *FileCommit503Error) 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 *FileCommit503Error) 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 *FileCommit503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *FileCommit503Error) 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 *FileCommit503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *FileCommit503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *FileCommit503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *FileCommit503Error) SetMessage(value *string)() { + m.message = value +} +type FileCommit503Errorable 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/file_commit_escaped_commit.go b/pkg/github/models/file_commit_escaped_commit.go new file mode 100644 index 00000000..b087f159 --- /dev/null +++ b/pkg/github/models/file_commit_escaped_commit.go @@ -0,0 +1,353 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_commit 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 author property + author FileCommit_commit_authorable + // The committer property + committer FileCommit_commit_committerable + // The html_url property + html_url *string + // The message property + message *string + // The node_id property + node_id *string + // The parents property + parents []FileCommit_commit_parentsable + // The sha property + sha *string + // The tree property + tree FileCommit_commit_treeable + // The url property + url *string + // The verification property + verification FileCommit_commit_verificationable +} +// NewFileCommit_commit instantiates a new FileCommit_commit and sets the default values. +func NewFileCommit_commit()(*FileCommit_commit) { + m := &FileCommit_commit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_commitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_commitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_commit(), 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 *FileCommit_commit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. The author property +// returns a FileCommit_commit_authorable when successful +func (m *FileCommit_commit) GetAuthor()(FileCommit_commit_authorable) { + return m.author +} +// GetCommitter gets the committer property value. The committer property +// returns a FileCommit_commit_committerable when successful +func (m *FileCommit_commit) GetCommitter()(FileCommit_commit_committerable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit_commit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFileCommit_commit_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(FileCommit_commit_authorable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFileCommit_commit_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(FileCommit_commit_committerable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(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 + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["parents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateFileCommit_commit_parentsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]FileCommit_commit_parentsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(FileCommit_commit_parentsable) + } + } + m.SetParents(res) + } + return nil + } + 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["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFileCommit_commit_treeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTree(val.(FileCommit_commit_treeable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verification"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFileCommit_commit_verificationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerification(val.(FileCommit_commit_verificationable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *FileCommit_commit) GetHtmlUrl()(*string) { + return m.html_url +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *FileCommit_commit) GetMessage()(*string) { + return m.message +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *FileCommit_commit) GetNodeId()(*string) { + return m.node_id +} +// GetParents gets the parents property value. The parents property +// returns a []FileCommit_commit_parentsable when successful +func (m *FileCommit_commit) GetParents()([]FileCommit_commit_parentsable) { + return m.parents +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *FileCommit_commit) GetSha()(*string) { + return m.sha +} +// GetTree gets the tree property value. The tree property +// returns a FileCommit_commit_treeable when successful +func (m *FileCommit_commit) GetTree()(FileCommit_commit_treeable) { + return m.tree +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *FileCommit_commit) GetUrl()(*string) { + return m.url +} +// GetVerification gets the verification property value. The verification property +// returns a FileCommit_commit_verificationable when successful +func (m *FileCommit_commit) GetVerification()(FileCommit_commit_verificationable) { + return m.verification +} +// Serialize serializes information the current object +func (m *FileCommit_commit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetParents() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetParents())) + for i, v := range m.GetParents() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("parents", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tree", m.GetTree()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verification", m.GetVerification()) + 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 *FileCommit_commit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. The author property +func (m *FileCommit_commit) SetAuthor(value FileCommit_commit_authorable)() { + m.author = value +} +// SetCommitter sets the committer property value. The committer property +func (m *FileCommit_commit) SetCommitter(value FileCommit_commit_committerable)() { + m.committer = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *FileCommit_commit) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetMessage sets the message property value. The message property +func (m *FileCommit_commit) SetMessage(value *string)() { + m.message = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *FileCommit_commit) SetNodeId(value *string)() { + m.node_id = value +} +// SetParents sets the parents property value. The parents property +func (m *FileCommit_commit) SetParents(value []FileCommit_commit_parentsable)() { + m.parents = value +} +// SetSha sets the sha property value. The sha property +func (m *FileCommit_commit) SetSha(value *string)() { + m.sha = value +} +// SetTree sets the tree property value. The tree property +func (m *FileCommit_commit) SetTree(value FileCommit_commit_treeable)() { + m.tree = value +} +// SetUrl sets the url property value. The url property +func (m *FileCommit_commit) SetUrl(value *string)() { + m.url = value +} +// SetVerification sets the verification property value. The verification property +func (m *FileCommit_commit) SetVerification(value FileCommit_commit_verificationable)() { + m.verification = value +} +type FileCommit_commitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(FileCommit_commit_authorable) + GetCommitter()(FileCommit_commit_committerable) + GetHtmlUrl()(*string) + GetMessage()(*string) + GetNodeId()(*string) + GetParents()([]FileCommit_commit_parentsable) + GetSha()(*string) + GetTree()(FileCommit_commit_treeable) + GetUrl()(*string) + GetVerification()(FileCommit_commit_verificationable) + SetAuthor(value FileCommit_commit_authorable)() + SetCommitter(value FileCommit_commit_committerable)() + SetHtmlUrl(value *string)() + SetMessage(value *string)() + SetNodeId(value *string)() + SetParents(value []FileCommit_commit_parentsable)() + SetSha(value *string)() + SetTree(value FileCommit_commit_treeable)() + SetUrl(value *string)() + SetVerification(value FileCommit_commit_verificationable)() +} diff --git a/pkg/github/models/file_commit_escaped_commit_escaped_author.go b/pkg/github/models/file_commit_escaped_commit_escaped_author.go new file mode 100644 index 00000000..0deddb04 --- /dev/null +++ b/pkg/github/models/file_commit_escaped_commit_escaped_author.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_commit_author 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 date property + date *string + // The email property + email *string + // The name property + name *string +} +// NewFileCommit_commit_author instantiates a new FileCommit_commit_author and sets the default values. +func NewFileCommit_commit_author()(*FileCommit_commit_author) { + m := &FileCommit_commit_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_commit_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_commit_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_commit_author(), 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 *FileCommit_commit_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. The date property +// returns a *string when successful +func (m *FileCommit_commit_author) GetDate()(*string) { + return m.date +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *FileCommit_commit_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit_commit_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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 property +// returns a *string when successful +func (m *FileCommit_commit_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *FileCommit_commit_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *FileCommit_commit_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. The date property +func (m *FileCommit_commit_author) SetDate(value *string)() { + m.date = value +} +// SetEmail sets the email property value. The email property +func (m *FileCommit_commit_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name property +func (m *FileCommit_commit_author) SetName(value *string)() { + m.name = value +} +type FileCommit_commit_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*string) + GetEmail()(*string) + GetName()(*string) + SetDate(value *string)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/file_commit_escaped_commit_escaped_committer.go b/pkg/github/models/file_commit_escaped_commit_escaped_committer.go new file mode 100644 index 00000000..f472c4d5 --- /dev/null +++ b/pkg/github/models/file_commit_escaped_commit_escaped_committer.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_commit_committer 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 date property + date *string + // The email property + email *string + // The name property + name *string +} +// NewFileCommit_commit_committer instantiates a new FileCommit_commit_committer and sets the default values. +func NewFileCommit_commit_committer()(*FileCommit_commit_committer) { + m := &FileCommit_commit_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_commit_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_commit_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_commit_committer(), 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 *FileCommit_commit_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. The date property +// returns a *string when successful +func (m *FileCommit_commit_committer) GetDate()(*string) { + return m.date +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *FileCommit_commit_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit_commit_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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 property +// returns a *string when successful +func (m *FileCommit_commit_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *FileCommit_commit_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *FileCommit_commit_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. The date property +func (m *FileCommit_commit_committer) SetDate(value *string)() { + m.date = value +} +// SetEmail sets the email property value. The email property +func (m *FileCommit_commit_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name property +func (m *FileCommit_commit_committer) SetName(value *string)() { + m.name = value +} +type FileCommit_commit_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*string) + GetEmail()(*string) + GetName()(*string) + SetDate(value *string)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/file_commit_escaped_commit_escaped_parents.go b/pkg/github/models/file_commit_escaped_commit_escaped_parents.go new file mode 100644 index 00000000..27e59915 --- /dev/null +++ b/pkg/github/models/file_commit_escaped_commit_escaped_parents.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_commit_parents 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 html_url property + html_url *string + // The sha property + sha *string + // The url property + url *string +} +// NewFileCommit_commit_parents instantiates a new FileCommit_commit_parents and sets the default values. +func NewFileCommit_commit_parents()(*FileCommit_commit_parents) { + m := &FileCommit_commit_parents{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_commit_parentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_commit_parentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_commit_parents(), 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 *FileCommit_commit_parents) 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 *FileCommit_commit_parents) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *FileCommit_commit_parents) GetHtmlUrl()(*string) { + return m.html_url +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *FileCommit_commit_parents) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *FileCommit_commit_parents) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *FileCommit_commit_parents) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *FileCommit_commit_parents) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *FileCommit_commit_parents) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetSha sets the sha property value. The sha property +func (m *FileCommit_commit_parents) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *FileCommit_commit_parents) SetUrl(value *string)() { + m.url = value +} +type FileCommit_commit_parentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetSha()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/file_commit_escaped_commit_escaped_tree.go b/pkg/github/models/file_commit_escaped_commit_escaped_tree.go new file mode 100644 index 00000000..64583bec --- /dev/null +++ b/pkg/github/models/file_commit_escaped_commit_escaped_tree.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_commit_tree 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 sha property + sha *string + // The url property + url *string +} +// NewFileCommit_commit_tree instantiates a new FileCommit_commit_tree and sets the default values. +func NewFileCommit_commit_tree()(*FileCommit_commit_tree) { + m := &FileCommit_commit_tree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_commit_treeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_commit_treeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_commit_tree(), 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 *FileCommit_commit_tree) 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 *FileCommit_commit_tree) 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *FileCommit_commit_tree) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *FileCommit_commit_tree) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *FileCommit_commit_tree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *FileCommit_commit_tree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *FileCommit_commit_tree) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *FileCommit_commit_tree) SetUrl(value *string)() { + m.url = value +} +type FileCommit_commit_treeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/file_commit_escaped_commit_escaped_verification.go b/pkg/github/models/file_commit_escaped_commit_escaped_verification.go new file mode 100644 index 00000000..255b309c --- /dev/null +++ b/pkg/github/models/file_commit_escaped_commit_escaped_verification.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_commit_verification 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 payload property + payload *string + // The reason property + reason *string + // The signature property + signature *string + // The verified property + verified *bool +} +// NewFileCommit_commit_verification instantiates a new FileCommit_commit_verification and sets the default values. +func NewFileCommit_commit_verification()(*FileCommit_commit_verification) { + m := &FileCommit_commit_verification{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_commit_verificationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_commit_verificationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_commit_verification(), 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 *FileCommit_commit_verification) 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 *FileCommit_commit_verification) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["signature"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSignature(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetPayload gets the payload property value. The payload property +// returns a *string when successful +func (m *FileCommit_commit_verification) GetPayload()(*string) { + return m.payload +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *FileCommit_commit_verification) GetReason()(*string) { + return m.reason +} +// GetSignature gets the signature property value. The signature property +// returns a *string when successful +func (m *FileCommit_commit_verification) GetSignature()(*string) { + return m.signature +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *FileCommit_commit_verification) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *FileCommit_commit_verification) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("signature", m.GetSignature()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + 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 *FileCommit_commit_verification) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPayload sets the payload property value. The payload property +func (m *FileCommit_commit_verification) SetPayload(value *string)() { + m.payload = value +} +// SetReason sets the reason property value. The reason property +func (m *FileCommit_commit_verification) SetReason(value *string)() { + m.reason = value +} +// SetSignature sets the signature property value. The signature property +func (m *FileCommit_commit_verification) SetSignature(value *string)() { + m.signature = value +} +// SetVerified sets the verified property value. The verified property +func (m *FileCommit_commit_verification) SetVerified(value *bool)() { + m.verified = value +} +type FileCommit_commit_verificationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPayload()(*string) + GetReason()(*string) + GetSignature()(*string) + GetVerified()(*bool) + SetPayload(value *string)() + SetReason(value *string)() + SetSignature(value *string)() + SetVerified(value *bool)() +} diff --git a/pkg/github/models/file_commit_escaped_content.go b/pkg/github/models/file_commit_escaped_content.go new file mode 100644 index 00000000..1e163574 --- /dev/null +++ b/pkg/github/models/file_commit_escaped_content.go @@ -0,0 +1,341 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_content struct { + // The _links property + _links FileCommit_content__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The download_url property + download_url *string + // The git_url property + git_url *string + // The html_url property + html_url *string + // The name property + name *string + // The path property + path *string + // The sha property + sha *string + // The size property + size *int32 + // The type property + typeEscaped *string + // The url property + url *string +} +// NewFileCommit_content instantiates a new FileCommit_content and sets the default values. +func NewFileCommit_content()(*FileCommit_content) { + m := &FileCommit_content{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_contentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_contentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_content(), 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 *FileCommit_content) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDownloadUrl gets the download_url property value. The download_url property +// returns a *string when successful +func (m *FileCommit_content) GetDownloadUrl()(*string) { + return m.download_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FileCommit_content) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFileCommit_content__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(FileCommit_content__linksable)) + } + return nil + } + res["download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(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["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + 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["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *FileCommit_content) GetGitUrl()(*string) { + return m.git_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *FileCommit_content) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLinks gets the _links property value. The _links property +// returns a FileCommit_content__linksable when successful +func (m *FileCommit_content) GetLinks()(FileCommit_content__linksable) { + return m._links +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *FileCommit_content) GetName()(*string) { + return m.name +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *FileCommit_content) GetPath()(*string) { + return m.path +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *FileCommit_content) GetSha()(*string) { + return m.sha +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *FileCommit_content) GetSize()(*int32) { + return m.size +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *FileCommit_content) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *FileCommit_content) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *FileCommit_content) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("download_url", m.GetDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *FileCommit_content) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDownloadUrl sets the download_url property value. The download_url property +func (m *FileCommit_content) SetDownloadUrl(value *string)() { + m.download_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *FileCommit_content) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *FileCommit_content) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLinks sets the _links property value. The _links property +func (m *FileCommit_content) SetLinks(value FileCommit_content__linksable)() { + m._links = value +} +// SetName sets the name property value. The name property +func (m *FileCommit_content) SetName(value *string)() { + m.name = value +} +// SetPath sets the path property value. The path property +func (m *FileCommit_content) SetPath(value *string)() { + m.path = value +} +// SetSha sets the sha property value. The sha property +func (m *FileCommit_content) SetSha(value *string)() { + m.sha = value +} +// SetSize sets the size property value. The size property +func (m *FileCommit_content) SetSize(value *int32)() { + m.size = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *FileCommit_content) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *FileCommit_content) SetUrl(value *string)() { + m.url = value +} +type FileCommit_contentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDownloadUrl()(*string) + GetGitUrl()(*string) + GetHtmlUrl()(*string) + GetLinks()(FileCommit_content__linksable) + GetName()(*string) + GetPath()(*string) + GetSha()(*string) + GetSize()(*int32) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetDownloadUrl(value *string)() + SetGitUrl(value *string)() + SetHtmlUrl(value *string)() + SetLinks(value FileCommit_content__linksable)() + SetName(value *string)() + SetPath(value *string)() + SetSha(value *string)() + SetSize(value *int32)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/file_commit_escaped_content_escaped__escaped_links.go b/pkg/github/models/file_commit_escaped_content_escaped__escaped_links.go new file mode 100644 index 00000000..0d9ac3eb --- /dev/null +++ b/pkg/github/models/file_commit_escaped_content_escaped__escaped_links.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FileCommit_content__links 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 git property + git *string + // The html property + html *string + // The self property + self *string +} +// NewFileCommit_content__links instantiates a new FileCommit_content__links and sets the default values. +func NewFileCommit_content__links()(*FileCommit_content__links) { + m := &FileCommit_content__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFileCommit_content__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFileCommit_content__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFileCommit_content__links(), 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 *FileCommit_content__links) 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 *FileCommit_content__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["git"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGit(val) + } + return nil + } + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtml(val) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelf(val) + } + return nil + } + return res +} +// GetGit gets the git property value. The git property +// returns a *string when successful +func (m *FileCommit_content__links) GetGit()(*string) { + return m.git +} +// GetHtml gets the html property value. The html property +// returns a *string when successful +func (m *FileCommit_content__links) GetHtml()(*string) { + return m.html +} +// GetSelf gets the self property value. The self property +// returns a *string when successful +func (m *FileCommit_content__links) GetSelf()(*string) { + return m.self +} +// Serialize serializes information the current object +func (m *FileCommit_content__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("git", m.GetGit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("self", m.GetSelf()) + 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 *FileCommit_content__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGit sets the git property value. The git property +func (m *FileCommit_content__links) SetGit(value *string)() { + m.git = value +} +// SetHtml sets the html property value. The html property +func (m *FileCommit_content__links) SetHtml(value *string)() { + m.html = value +} +// SetSelf sets the self property value. The self property +func (m *FileCommit_content__links) SetSelf(value *string)() { + m.self = value +} +type FileCommit_content__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGit()(*string) + GetHtml()(*string) + GetSelf()(*string) + SetGit(value *string)() + SetHtml(value *string)() + SetSelf(value *string)() +} diff --git a/pkg/github/models/files503_error.go b/pkg/github/models/files503_error.go new file mode 100644 index 00000000..886aef7c --- /dev/null +++ b/pkg/github/models/files503_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 Files503Error 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 +} +// NewFiles503Error instantiates a new Files503Error and sets the default values. +func NewFiles503Error()(*Files503Error) { + m := &Files503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFiles503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFiles503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFiles503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Files503Error) 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 *Files503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Files503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Files503Error) 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 *Files503Error) 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 *Files503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Files503Error) 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 *Files503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Files503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Files503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Files503Error) SetMessage(value *string)() { + m.message = value +} +type Files503Errorable 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/full_repository.go b/pkg/github/models/full_repository.go new file mode 100644 index 00000000..7744cef3 --- /dev/null +++ b/pkg/github/models/full_repository.go @@ -0,0 +1,3050 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// FullRepository full Repository +type FullRepository 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 allow_auto_merge property + allow_auto_merge *bool + // The allow_forking property + allow_forking *bool + // The allow_merge_commit property + allow_merge_commit *bool + // The allow_rebase_merge property + allow_rebase_merge *bool + // The allow_squash_merge property + allow_squash_merge *bool + // The allow_update_branch property + allow_update_branch *bool + // Whether anonymous git access is allowed. + anonymous_access_enabled *bool + // The archive_url property + archive_url *string + // The archived property + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // Code of Conduct Simple + code_of_conduct CodeOfConductSimpleable + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. + custom_properties FullRepository_custom_propertiesable + // The default_branch property + default_branch *string + // The delete_branch_on_merge property + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // Returns whether or not this repository disabled. + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // The has_discussions property + has_discussions *bool + // The has_downloads property + has_downloads *bool + // The has_issues property + has_issues *bool + // The has_pages property + has_pages *bool + // The has_projects property + has_projects *bool + // The has_wiki property + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int64 + // The is_template property + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // License Simple + license NullableLicenseSimpleable + // The master_branch property + master_branch *string + // The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. + merge_commit_message *FullRepository_merge_commit_message + // The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + merge_commit_title *FullRepository_merge_commit_title + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name property + name *string + // The network_count property + network_count *int32 + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // A GitHub user. + organization NullableSimpleUserable + // A GitHub user. + owner SimpleUserable + // A repository on GitHub. + parent Repositoryable + // The permissions property + permissions FullRepository_permissionsable + // The private property + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The security_and_analysis property + security_and_analysis SecurityAndAnalysisable + // The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + size *int32 + // A repository on GitHub. + source Repositoryable + // The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. + squash_merge_commit_message *FullRepository_squash_merge_commit_message + // The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + squash_merge_commit_title *FullRepository_squash_merge_commit_title + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_count property + subscribers_count *int32 + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // A repository on GitHub. + template_repository NullableRepositoryable + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The use_squash_pr_title_as_default property + use_squash_pr_title_as_default *bool + // The repository visibility: public, private, or internal. + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewFullRepository instantiates a new FullRepository and sets the default values. +func NewFullRepository()(*FullRepository) { + m := &FullRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFullRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFullRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFullRepository(), 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 *FullRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. The allow_auto_merge property +// returns a *bool when successful +func (m *FullRepository) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowForking gets the allow_forking property value. The allow_forking property +// returns a *bool when successful +func (m *FullRepository) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. The allow_merge_commit property +// returns a *bool when successful +func (m *FullRepository) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. The allow_rebase_merge property +// returns a *bool when successful +func (m *FullRepository) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. The allow_squash_merge property +// returns a *bool when successful +func (m *FullRepository) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAllowUpdateBranch gets the allow_update_branch property value. The allow_update_branch property +// returns a *bool when successful +func (m *FullRepository) GetAllowUpdateBranch()(*bool) { + return m.allow_update_branch +} +// GetAnonymousAccessEnabled gets the anonymous_access_enabled property value. Whether anonymous git access is allowed. +// returns a *bool when successful +func (m *FullRepository) GetAnonymousAccessEnabled()(*bool) { + return m.anonymous_access_enabled +} +// GetArchived gets the archived property value. The archived property +// returns a *bool when successful +func (m *FullRepository) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *FullRepository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *FullRepository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *FullRepository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *FullRepository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *FullRepository) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCodeOfConduct gets the code_of_conduct property value. Code of Conduct Simple +// returns a CodeOfConductSimpleable when successful +func (m *FullRepository) GetCodeOfConduct()(CodeOfConductSimpleable) { + return m.code_of_conduct +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *FullRepository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *FullRepository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *FullRepository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *FullRepository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *FullRepository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *FullRepository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *FullRepository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCustomProperties gets the custom_properties property value. The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. +// returns a FullRepository_custom_propertiesable when successful +func (m *FullRepository) GetCustomProperties()(FullRepository_custom_propertiesable) { + return m.custom_properties +} +// GetDefaultBranch gets the default_branch property value. The default_branch property +// returns a *string when successful +func (m *FullRepository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. The delete_branch_on_merge property +// returns a *bool when successful +func (m *FullRepository) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *FullRepository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *FullRepository) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. Returns whether or not this repository disabled. +// returns a *bool when successful +func (m *FullRepository) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *FullRepository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *FullRepository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FullRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["allow_update_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowUpdateBranch(val) + } + return nil + } + res["anonymous_access_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAnonymousAccessEnabled(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["code_of_conduct"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeOfConductSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeOfConduct(val.(CodeOfConductSimpleable)) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + 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["custom_properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFullRepository_custom_propertiesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCustomProperties(val.(FullRepository_custom_propertiesable)) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + 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["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + return nil + } + res["master_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMasterBranch(val) + } + return nil + } + res["merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseFullRepository_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitMessage(val.(*FullRepository_merge_commit_message)) + } + return nil + } + res["merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseFullRepository_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitTitle(val.(*FullRepository_merge_commit_title)) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(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["network_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNetworkCount(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(NullableSimpleUserable)) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["parent"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParent(val.(Repositoryable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateFullRepository_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(FullRepository_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["security_and_analysis"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecurityAndAnalysisFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAndAnalysis(val.(SecurityAndAnalysisable)) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSource(val.(Repositoryable)) + } + return nil + } + res["squash_merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseFullRepository_squash_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitMessage(val.(*FullRepository_squash_merge_commit_message)) + } + return nil + } + res["squash_merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseFullRepository_squash_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitTitle(val.(*FullRepository_squash_merge_commit_title)) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersCount(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["template_repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTemplateRepository(val.(NullableRepositoryable)) + } + return nil + } + res["topics"] = 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.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *FullRepository) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *FullRepository) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *FullRepository) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *FullRepository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *FullRepository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *FullRepository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *FullRepository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *FullRepository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *FullRepository) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. The has_discussions property +// returns a *bool when successful +func (m *FullRepository) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. The has_downloads property +// returns a *bool when successful +func (m *FullRepository) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. The has_issues property +// returns a *bool when successful +func (m *FullRepository) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *FullRepository) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. The has_projects property +// returns a *bool when successful +func (m *FullRepository) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. The has_wiki property +// returns a *bool when successful +func (m *FullRepository) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *FullRepository) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *FullRepository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *FullRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *FullRepository) GetId()(*int64) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *FullRepository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *FullRepository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *FullRepository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. The is_template property +// returns a *bool when successful +func (m *FullRepository) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *FullRepository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *FullRepository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *FullRepository) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *FullRepository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *FullRepository) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetMasterBranch gets the master_branch property value. The master_branch property +// returns a *string when successful +func (m *FullRepository) GetMasterBranch()(*string) { + return m.master_branch +} +// GetMergeCommitMessage gets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +// returns a *FullRepository_merge_commit_message when successful +func (m *FullRepository) GetMergeCommitMessage()(*FullRepository_merge_commit_message) { + return m.merge_commit_message +} +// GetMergeCommitTitle gets the merge_commit_title property value. The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +// returns a *FullRepository_merge_commit_title when successful +func (m *FullRepository) GetMergeCommitTitle()(*FullRepository_merge_commit_title) { + return m.merge_commit_title +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *FullRepository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *FullRepository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *FullRepository) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *FullRepository) GetName()(*string) { + return m.name +} +// GetNetworkCount gets the network_count property value. The network_count property +// returns a *int32 when successful +func (m *FullRepository) GetNetworkCount()(*int32) { + return m.network_count +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *FullRepository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *FullRepository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *FullRepository) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *FullRepository) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOrganization gets the organization property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *FullRepository) GetOrganization()(NullableSimpleUserable) { + return m.organization +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *FullRepository) GetOwner()(SimpleUserable) { + return m.owner +} +// GetParent gets the parent property value. A repository on GitHub. +// returns a Repositoryable when successful +func (m *FullRepository) GetParent()(Repositoryable) { + return m.parent +} +// GetPermissions gets the permissions property value. The permissions property +// returns a FullRepository_permissionsable when successful +func (m *FullRepository) GetPermissions()(FullRepository_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. The private property +// returns a *bool when successful +func (m *FullRepository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *FullRepository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *FullRepository) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *FullRepository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetSecurityAndAnalysis gets the security_and_analysis property value. The security_and_analysis property +// returns a SecurityAndAnalysisable when successful +func (m *FullRepository) GetSecurityAndAnalysis()(SecurityAndAnalysisable) { + return m.security_and_analysis +} +// GetSize gets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +// returns a *int32 when successful +func (m *FullRepository) GetSize()(*int32) { + return m.size +} +// GetSource gets the source property value. A repository on GitHub. +// returns a Repositoryable when successful +func (m *FullRepository) GetSource()(Repositoryable) { + return m.source +} +// GetSquashMergeCommitMessage gets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +// returns a *FullRepository_squash_merge_commit_message when successful +func (m *FullRepository) GetSquashMergeCommitMessage()(*FullRepository_squash_merge_commit_message) { + return m.squash_merge_commit_message +} +// GetSquashMergeCommitTitle gets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +// returns a *FullRepository_squash_merge_commit_title when successful +func (m *FullRepository) GetSquashMergeCommitTitle()(*FullRepository_squash_merge_commit_title) { + return m.squash_merge_commit_title +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *FullRepository) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *FullRepository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *FullRepository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *FullRepository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersCount gets the subscribers_count property value. The subscribers_count property +// returns a *int32 when successful +func (m *FullRepository) GetSubscribersCount()(*int32) { + return m.subscribers_count +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *FullRepository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *FullRepository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *FullRepository) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *FullRepository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *FullRepository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *FullRepository) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTemplateRepository gets the template_repository property value. A repository on GitHub. +// returns a NullableRepositoryable when successful +func (m *FullRepository) GetTemplateRepository()(NullableRepositoryable) { + return m.template_repository +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *FullRepository) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *FullRepository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *FullRepository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *FullRepository) GetUrl()(*string) { + return m.url +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. The use_squash_pr_title_as_default property +// returns a *bool when successful +func (m *FullRepository) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// GetVisibility gets the visibility property value. The repository visibility: public, private, or internal. +// returns a *string when successful +func (m *FullRepository) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *FullRepository) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *FullRepository) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *FullRepository) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *FullRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_update_branch", m.GetAllowUpdateBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("anonymous_access_enabled", m.GetAnonymousAccessEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("code_of_conduct", m.GetCodeOfConduct()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("custom_properties", m.GetCustomProperties()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("master_branch", m.GetMasterBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + if m.GetMergeCommitMessage() != nil { + cast := (*m.GetMergeCommitMessage()).String() + err := writer.WriteStringValue("merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetMergeCommitTitle() != nil { + cast := (*m.GetMergeCommitTitle()).String() + err := writer.WriteStringValue("merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("network_count", m.GetNetworkCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("parent", m.GetParent()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("security_and_analysis", m.GetSecurityAndAnalysis()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("source", m.GetSource()) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitMessage() != nil { + cast := (*m.GetSquashMergeCommitMessage()).String() + err := writer.WriteStringValue("squash_merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitTitle() != nil { + cast := (*m.GetSquashMergeCommitTitle()).String() + err := writer.WriteStringValue("squash_merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("subscribers_count", m.GetSubscribersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("template_repository", m.GetTemplateRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *FullRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. The allow_auto_merge property +func (m *FullRepository) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowForking sets the allow_forking property value. The allow_forking property +func (m *FullRepository) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. The allow_merge_commit property +func (m *FullRepository) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. The allow_rebase_merge property +func (m *FullRepository) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. The allow_squash_merge property +func (m *FullRepository) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAllowUpdateBranch sets the allow_update_branch property value. The allow_update_branch property +func (m *FullRepository) SetAllowUpdateBranch(value *bool)() { + m.allow_update_branch = value +} +// SetAnonymousAccessEnabled sets the anonymous_access_enabled property value. Whether anonymous git access is allowed. +func (m *FullRepository) SetAnonymousAccessEnabled(value *bool)() { + m.anonymous_access_enabled = value +} +// SetArchived sets the archived property value. The archived property +func (m *FullRepository) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *FullRepository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *FullRepository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *FullRepository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *FullRepository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *FullRepository) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCodeOfConduct sets the code_of_conduct property value. Code of Conduct Simple +func (m *FullRepository) SetCodeOfConduct(value CodeOfConductSimpleable)() { + m.code_of_conduct = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *FullRepository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *FullRepository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *FullRepository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *FullRepository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *FullRepository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *FullRepository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *FullRepository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCustomProperties sets the custom_properties property value. The custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. +func (m *FullRepository) SetCustomProperties(value FullRepository_custom_propertiesable)() { + m.custom_properties = value +} +// SetDefaultBranch sets the default_branch property value. The default_branch property +func (m *FullRepository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. The delete_branch_on_merge property +func (m *FullRepository) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *FullRepository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *FullRepository) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. Returns whether or not this repository disabled. +func (m *FullRepository) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *FullRepository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *FullRepository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *FullRepository) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *FullRepository) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *FullRepository) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *FullRepository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *FullRepository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *FullRepository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *FullRepository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *FullRepository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *FullRepository) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. The has_discussions property +func (m *FullRepository) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. The has_downloads property +func (m *FullRepository) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. The has_issues property +func (m *FullRepository) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *FullRepository) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. The has_projects property +func (m *FullRepository) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. The has_wiki property +func (m *FullRepository) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *FullRepository) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *FullRepository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *FullRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *FullRepository) SetId(value *int64)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *FullRepository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *FullRepository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *FullRepository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. The is_template property +func (m *FullRepository) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *FullRepository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *FullRepository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *FullRepository) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *FullRepository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. License Simple +func (m *FullRepository) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetMasterBranch sets the master_branch property value. The master_branch property +func (m *FullRepository) SetMasterBranch(value *string)() { + m.master_branch = value +} +// SetMergeCommitMessage sets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +func (m *FullRepository) SetMergeCommitMessage(value *FullRepository_merge_commit_message)() { + m.merge_commit_message = value +} +// SetMergeCommitTitle sets the merge_commit_title property value. The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +func (m *FullRepository) SetMergeCommitTitle(value *FullRepository_merge_commit_title)() { + m.merge_commit_title = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *FullRepository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *FullRepository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *FullRepository) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name property +func (m *FullRepository) SetName(value *string)() { + m.name = value +} +// SetNetworkCount sets the network_count property value. The network_count property +func (m *FullRepository) SetNetworkCount(value *int32)() { + m.network_count = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *FullRepository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *FullRepository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *FullRepository) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *FullRepository) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOrganization sets the organization property value. A GitHub user. +func (m *FullRepository) SetOrganization(value NullableSimpleUserable)() { + m.organization = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *FullRepository) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetParent sets the parent property value. A repository on GitHub. +func (m *FullRepository) SetParent(value Repositoryable)() { + m.parent = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *FullRepository) SetPermissions(value FullRepository_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. The private property +func (m *FullRepository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *FullRepository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *FullRepository) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *FullRepository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetSecurityAndAnalysis sets the security_and_analysis property value. The security_and_analysis property +func (m *FullRepository) SetSecurityAndAnalysis(value SecurityAndAnalysisable)() { + m.security_and_analysis = value +} +// SetSize sets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +func (m *FullRepository) SetSize(value *int32)() { + m.size = value +} +// SetSource sets the source property value. A repository on GitHub. +func (m *FullRepository) SetSource(value Repositoryable)() { + m.source = value +} +// SetSquashMergeCommitMessage sets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +func (m *FullRepository) SetSquashMergeCommitMessage(value *FullRepository_squash_merge_commit_message)() { + m.squash_merge_commit_message = value +} +// SetSquashMergeCommitTitle sets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +func (m *FullRepository) SetSquashMergeCommitTitle(value *FullRepository_squash_merge_commit_title)() { + m.squash_merge_commit_title = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *FullRepository) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *FullRepository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *FullRepository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *FullRepository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersCount sets the subscribers_count property value. The subscribers_count property +func (m *FullRepository) SetSubscribersCount(value *int32)() { + m.subscribers_count = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *FullRepository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *FullRepository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *FullRepository) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *FullRepository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *FullRepository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *FullRepository) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTemplateRepository sets the template_repository property value. A repository on GitHub. +func (m *FullRepository) SetTemplateRepository(value NullableRepositoryable)() { + m.template_repository = value +} +// SetTopics sets the topics property value. The topics property +func (m *FullRepository) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *FullRepository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *FullRepository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *FullRepository) SetUrl(value *string)() { + m.url = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. The use_squash_pr_title_as_default property +func (m *FullRepository) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +// SetVisibility sets the visibility property value. The repository visibility: public, private, or internal. +func (m *FullRepository) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *FullRepository) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *FullRepository) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *FullRepository) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type FullRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAllowUpdateBranch()(*bool) + GetAnonymousAccessEnabled()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCodeOfConduct()(CodeOfConductSimpleable) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCustomProperties()(FullRepository_custom_propertiesable) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(NullableLicenseSimpleable) + GetMasterBranch()(*string) + GetMergeCommitMessage()(*FullRepository_merge_commit_message) + GetMergeCommitTitle()(*FullRepository_merge_commit_title) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNetworkCount()(*int32) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOrganization()(NullableSimpleUserable) + GetOwner()(SimpleUserable) + GetParent()(Repositoryable) + GetPermissions()(FullRepository_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetSecurityAndAnalysis()(SecurityAndAnalysisable) + GetSize()(*int32) + GetSource()(Repositoryable) + GetSquashMergeCommitMessage()(*FullRepository_squash_merge_commit_message) + GetSquashMergeCommitTitle()(*FullRepository_squash_merge_commit_title) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersCount()(*int32) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTemplateRepository()(NullableRepositoryable) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUseSquashPrTitleAsDefault()(*bool) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAllowUpdateBranch(value *bool)() + SetAnonymousAccessEnabled(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCodeOfConduct(value CodeOfConductSimpleable)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCustomProperties(value FullRepository_custom_propertiesable)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value NullableLicenseSimpleable)() + SetMasterBranch(value *string)() + SetMergeCommitMessage(value *FullRepository_merge_commit_message)() + SetMergeCommitTitle(value *FullRepository_merge_commit_title)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNetworkCount(value *int32)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOrganization(value NullableSimpleUserable)() + SetOwner(value SimpleUserable)() + SetParent(value Repositoryable)() + SetPermissions(value FullRepository_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetSecurityAndAnalysis(value SecurityAndAnalysisable)() + SetSize(value *int32)() + SetSource(value Repositoryable)() + SetSquashMergeCommitMessage(value *FullRepository_squash_merge_commit_message)() + SetSquashMergeCommitTitle(value *FullRepository_squash_merge_commit_title)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersCount(value *int32)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTemplateRepository(value NullableRepositoryable)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUseSquashPrTitleAsDefault(value *bool)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/pkg/github/models/full_repository_escaped_custom_escaped_properties.go b/pkg/github/models/full_repository_escaped_custom_escaped_properties.go new file mode 100644 index 00000000..4087296e --- /dev/null +++ b/pkg/github/models/full_repository_escaped_custom_escaped_properties.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// FullRepository_custom_properties the custom properties that were defined for the repository. The keys are the custom property names, and the values are the corresponding custom property values. +type FullRepository_custom_properties struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewFullRepository_custom_properties instantiates a new FullRepository_custom_properties and sets the default values. +func NewFullRepository_custom_properties()(*FullRepository_custom_properties) { + m := &FullRepository_custom_properties{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFullRepository_custom_propertiesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFullRepository_custom_propertiesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFullRepository_custom_properties(), 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 *FullRepository_custom_properties) 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 *FullRepository_custom_properties) 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 *FullRepository_custom_properties) 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 *FullRepository_custom_properties) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type FullRepository_custom_propertiesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/full_repository_escaped_merge_escaped_commit_escaped_message.go b/pkg/github/models/full_repository_escaped_merge_escaped_commit_escaped_message.go new file mode 100644 index 00000000..b93673bc --- /dev/null +++ b/pkg/github/models/full_repository_escaped_merge_escaped_commit_escaped_message.go @@ -0,0 +1,37 @@ +package models +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type FullRepository_merge_commit_message int + +const ( + PR_BODY_FULLREPOSITORY_MERGE_COMMIT_MESSAGE FullRepository_merge_commit_message = iota + PR_TITLE_FULLREPOSITORY_MERGE_COMMIT_MESSAGE + BLANK_FULLREPOSITORY_MERGE_COMMIT_MESSAGE +) + +func (i FullRepository_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParseFullRepository_merge_commit_message(v string) (any, error) { + result := PR_BODY_FULLREPOSITORY_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_FULLREPOSITORY_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_FULLREPOSITORY_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_FULLREPOSITORY_MERGE_COMMIT_MESSAGE + default: + return nil, nil + } + return &result, nil +} +func SerializeFullRepository_merge_commit_message(values []FullRepository_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i FullRepository_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/full_repository_escaped_merge_escaped_commit_escaped_title.go b/pkg/github/models/full_repository_escaped_merge_escaped_commit_escaped_title.go new file mode 100644 index 00000000..83e96b04 --- /dev/null +++ b/pkg/github/models/full_repository_escaped_merge_escaped_commit_escaped_title.go @@ -0,0 +1,34 @@ +package models +// The default value for a merge commit title. - `PR_TITLE` - default to the pull request's title. - `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +type FullRepository_merge_commit_title int + +const ( + PR_TITLE_FULLREPOSITORY_MERGE_COMMIT_TITLE FullRepository_merge_commit_title = iota + MERGE_MESSAGE_FULLREPOSITORY_MERGE_COMMIT_TITLE +) + +func (i FullRepository_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParseFullRepository_merge_commit_title(v string) (any, error) { + result := PR_TITLE_FULLREPOSITORY_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_FULLREPOSITORY_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_FULLREPOSITORY_MERGE_COMMIT_TITLE + default: + return nil, nil + } + return &result, nil +} +func SerializeFullRepository_merge_commit_title(values []FullRepository_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i FullRepository_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/full_repository_escaped_permissions.go b/pkg/github/models/full_repository_escaped_permissions.go new file mode 100644 index 00000000..9915aa3c --- /dev/null +++ b/pkg/github/models/full_repository_escaped_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type FullRepository_permissions 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 admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewFullRepository_permissions instantiates a new FullRepository_permissions and sets the default values. +func NewFullRepository_permissions()(*FullRepository_permissions) { + m := &FullRepository_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateFullRepository_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateFullRepository_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewFullRepository_permissions(), 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 *FullRepository_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *FullRepository_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *FullRepository_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *FullRepository_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *FullRepository_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *FullRepository_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *FullRepository_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *FullRepository_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *FullRepository_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *FullRepository_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *FullRepository_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *FullRepository_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *FullRepository_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *FullRepository_permissions) SetTriage(value *bool)() { + m.triage = value +} +type FullRepository_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/pkg/github/models/full_repository_escaped_squash_escaped_merge_escaped_commit_escaped_message.go b/pkg/github/models/full_repository_escaped_squash_escaped_merge_escaped_commit_escaped_message.go new file mode 100644 index 00000000..aa381ea9 --- /dev/null +++ b/pkg/github/models/full_repository_escaped_squash_escaped_merge_escaped_commit_escaped_message.go @@ -0,0 +1,37 @@ +package models +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type FullRepository_squash_merge_commit_message int + +const ( + PR_BODY_FULLREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE FullRepository_squash_merge_commit_message = iota + COMMIT_MESSAGES_FULLREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_FULLREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i FullRepository_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParseFullRepository_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_FULLREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_FULLREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_FULLREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_FULLREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + default: + return nil, nil + } + return &result, nil +} +func SerializeFullRepository_squash_merge_commit_message(values []FullRepository_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i FullRepository_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/full_repository_escaped_squash_escaped_merge_escaped_commit_escaped_title.go b/pkg/github/models/full_repository_escaped_squash_escaped_merge_escaped_commit_escaped_title.go new file mode 100644 index 00000000..e4184dd1 --- /dev/null +++ b/pkg/github/models/full_repository_escaped_squash_escaped_merge_escaped_commit_escaped_title.go @@ -0,0 +1,34 @@ +package models +// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type FullRepository_squash_merge_commit_title int + +const ( + PR_TITLE_FULLREPOSITORY_SQUASH_MERGE_COMMIT_TITLE FullRepository_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_FULLREPOSITORY_SQUASH_MERGE_COMMIT_TITLE +) + +func (i FullRepository_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParseFullRepository_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_FULLREPOSITORY_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_FULLREPOSITORY_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_FULLREPOSITORY_SQUASH_MERGE_COMMIT_TITLE + default: + return nil, nil + } + return &result, nil +} +func SerializeFullRepository_squash_merge_commit_title(values []FullRepository_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i FullRepository_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/ghes_checks_result_indicator.go b/pkg/github/models/ghes_checks_result_indicator.go new file mode 100644 index 00000000..d5ad5122 --- /dev/null +++ b/pkg/github/models/ghes_checks_result_indicator.go @@ -0,0 +1,33 @@ +package models +type GhesChecksResultIndicator int + +const ( + OK_GHESCHECKSRESULTINDICATOR GhesChecksResultIndicator = iota + FAILED_GHESCHECKSRESULTINDICATOR +) + +func (i GhesChecksResultIndicator) String() string { + return []string{"OK", "FAILED"}[i] +} +func ParseGhesChecksResultIndicator(v string) (any, error) { + result := OK_GHESCHECKSRESULTINDICATOR + switch v { + case "OK": + result = OK_GHESCHECKSRESULTINDICATOR + case "FAILED": + result = FAILED_GHESCHECKSRESULTINDICATOR + default: + return nil, nil + } + return &result, nil +} +func SerializeGhesChecksResultIndicator(values []GhesChecksResultIndicator) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GhesChecksResultIndicator) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/ghes_checks_system_requirements.go b/pkg/github/models/ghes_checks_system_requirements.go new file mode 100644 index 00000000..81a44924 --- /dev/null +++ b/pkg/github/models/ghes_checks_system_requirements.go @@ -0,0 +1,122 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesChecksSystemRequirements 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 nodes property + nodes []GhesChecksSystemRequirements_nodesable + // The status property + status *GhesChecksResultIndicator +} +// NewGhesChecksSystemRequirements instantiates a new GhesChecksSystemRequirements and sets the default values. +func NewGhesChecksSystemRequirements()(*GhesChecksSystemRequirements) { + m := &GhesChecksSystemRequirements{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesChecksSystemRequirementsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesChecksSystemRequirementsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesChecksSystemRequirements(), 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 *GhesChecksSystemRequirements) 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 *GhesChecksSystemRequirements) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["nodes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGhesChecksSystemRequirements_nodesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GhesChecksSystemRequirements_nodesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GhesChecksSystemRequirements_nodesable) + } + } + m.SetNodes(res) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGhesChecksResultIndicator) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*GhesChecksResultIndicator)) + } + return nil + } + return res +} +// GetNodes gets the nodes property value. The nodes property +// returns a []GhesChecksSystemRequirements_nodesable when successful +func (m *GhesChecksSystemRequirements) GetNodes()([]GhesChecksSystemRequirements_nodesable) { + return m.nodes +} +// GetStatus gets the status property value. The status property +// returns a *GhesChecksResultIndicator when successful +func (m *GhesChecksSystemRequirements) GetStatus()(*GhesChecksResultIndicator) { + return m.status +} +// Serialize serializes information the current object +func (m *GhesChecksSystemRequirements) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetNodes() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetNodes())) + for i, v := range m.GetNodes() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("nodes", cast) + 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 *GhesChecksSystemRequirements) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNodes sets the nodes property value. The nodes property +func (m *GhesChecksSystemRequirements) SetNodes(value []GhesChecksSystemRequirements_nodesable)() { + m.nodes = value +} +// SetStatus sets the status property value. The status property +func (m *GhesChecksSystemRequirements) SetStatus(value *GhesChecksResultIndicator)() { + m.status = value +} +type GhesChecksSystemRequirementsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNodes()([]GhesChecksSystemRequirements_nodesable) + GetStatus()(*GhesChecksResultIndicator) + SetNodes(value []GhesChecksSystemRequirements_nodesable)() + SetStatus(value *GhesChecksResultIndicator)() +} diff --git a/pkg/github/models/ghes_checks_system_requirements_escaped_nodes.go b/pkg/github/models/ghes_checks_system_requirements_escaped_nodes.go new file mode 100644 index 00000000..587b9e49 --- /dev/null +++ b/pkg/github/models/ghes_checks_system_requirements_escaped_nodes.go @@ -0,0 +1,151 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesChecksSystemRequirements_nodes 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 hostname property + hostname *string + // The roles_status property + roles_status []GhesChecksSystemRequirements_nodes_roles_statusable + // The status property + status *GhesChecksResultIndicator +} +// NewGhesChecksSystemRequirements_nodes instantiates a new GhesChecksSystemRequirements_nodes and sets the default values. +func NewGhesChecksSystemRequirements_nodes()(*GhesChecksSystemRequirements_nodes) { + m := &GhesChecksSystemRequirements_nodes{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesChecksSystemRequirements_nodesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesChecksSystemRequirements_nodesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesChecksSystemRequirements_nodes(), 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 *GhesChecksSystemRequirements_nodes) 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 *GhesChecksSystemRequirements_nodes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["hostname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHostname(val) + } + return nil + } + res["roles_status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGhesChecksSystemRequirements_nodes_roles_statusFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GhesChecksSystemRequirements_nodes_roles_statusable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GhesChecksSystemRequirements_nodes_roles_statusable) + } + } + m.SetRolesStatus(res) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGhesChecksResultIndicator) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*GhesChecksResultIndicator)) + } + return nil + } + return res +} +// GetHostname gets the hostname property value. The hostname property +// returns a *string when successful +func (m *GhesChecksSystemRequirements_nodes) GetHostname()(*string) { + return m.hostname +} +// GetRolesStatus gets the roles_status property value. The roles_status property +// returns a []GhesChecksSystemRequirements_nodes_roles_statusable when successful +func (m *GhesChecksSystemRequirements_nodes) GetRolesStatus()([]GhesChecksSystemRequirements_nodes_roles_statusable) { + return m.roles_status +} +// GetStatus gets the status property value. The status property +// returns a *GhesChecksResultIndicator when successful +func (m *GhesChecksSystemRequirements_nodes) GetStatus()(*GhesChecksResultIndicator) { + return m.status +} +// Serialize serializes information the current object +func (m *GhesChecksSystemRequirements_nodes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("hostname", m.GetHostname()) + if err != nil { + return err + } + } + if m.GetRolesStatus() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRolesStatus())) + for i, v := range m.GetRolesStatus() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("roles_status", cast) + 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 *GhesChecksSystemRequirements_nodes) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHostname sets the hostname property value. The hostname property +func (m *GhesChecksSystemRequirements_nodes) SetHostname(value *string)() { + m.hostname = value +} +// SetRolesStatus sets the roles_status property value. The roles_status property +func (m *GhesChecksSystemRequirements_nodes) SetRolesStatus(value []GhesChecksSystemRequirements_nodes_roles_statusable)() { + m.roles_status = value +} +// SetStatus sets the status property value. The status property +func (m *GhesChecksSystemRequirements_nodes) SetStatus(value *GhesChecksResultIndicator)() { + m.status = value +} +type GhesChecksSystemRequirements_nodesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHostname()(*string) + GetRolesStatus()([]GhesChecksSystemRequirements_nodes_roles_statusable) + GetStatus()(*GhesChecksResultIndicator) + SetHostname(value *string)() + SetRolesStatus(value []GhesChecksSystemRequirements_nodes_roles_statusable)() + SetStatus(value *GhesChecksResultIndicator)() +} diff --git a/pkg/github/models/ghes_checks_system_requirements_escaped_nodes_escaped_roles_escaped_status.go b/pkg/github/models/ghes_checks_system_requirements_escaped_nodes_escaped_roles_escaped_status.go new file mode 100644 index 00000000..81650915 --- /dev/null +++ b/pkg/github/models/ghes_checks_system_requirements_escaped_nodes_escaped_roles_escaped_status.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesChecksSystemRequirements_nodes_roles_status 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 role property + role *string + // The status property + status *GhesChecksResultIndicator +} +// NewGhesChecksSystemRequirements_nodes_roles_status instantiates a new GhesChecksSystemRequirements_nodes_roles_status and sets the default values. +func NewGhesChecksSystemRequirements_nodes_roles_status()(*GhesChecksSystemRequirements_nodes_roles_status) { + m := &GhesChecksSystemRequirements_nodes_roles_status{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesChecksSystemRequirements_nodes_roles_statusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesChecksSystemRequirements_nodes_roles_statusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesChecksSystemRequirements_nodes_roles_status(), 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 *GhesChecksSystemRequirements_nodes_roles_status) 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 *GhesChecksSystemRequirements_nodes_roles_status) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["role"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRole(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGhesChecksResultIndicator) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*GhesChecksResultIndicator)) + } + return nil + } + return res +} +// GetRole gets the role property value. The role property +// returns a *string when successful +func (m *GhesChecksSystemRequirements_nodes_roles_status) GetRole()(*string) { + return m.role +} +// GetStatus gets the status property value. The status property +// returns a *GhesChecksResultIndicator when successful +func (m *GhesChecksSystemRequirements_nodes_roles_status) GetStatus()(*GhesChecksResultIndicator) { + return m.status +} +// Serialize serializes information the current object +func (m *GhesChecksSystemRequirements_nodes_roles_status) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("role", m.GetRole()) + 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 *GhesChecksSystemRequirements_nodes_roles_status) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRole sets the role property value. The role property +func (m *GhesChecksSystemRequirements_nodes_roles_status) SetRole(value *string)() { + m.role = value +} +// SetStatus sets the status property value. The status property +func (m *GhesChecksSystemRequirements_nodes_roles_status) SetStatus(value *GhesChecksResultIndicator)() { + m.status = value +} +type GhesChecksSystemRequirements_nodes_roles_statusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRole()(*string) + GetStatus()(*GhesChecksResultIndicator) + SetRole(value *string)() + SetStatus(value *GhesChecksResultIndicator)() +} diff --git a/pkg/github/models/ghes_cluster_roles.go b/pkg/github/models/ghes_cluster_roles.go new file mode 100644 index 00000000..c674e866 --- /dev/null +++ b/pkg/github/models/ghes_cluster_roles.go @@ -0,0 +1,72 @@ +package models +type GhesClusterRoles int + +const ( + BLANK_GHESCLUSTERROLES GhesClusterRoles = iota + ACTIONSSERVER_GHESCLUSTERROLES + CONSULSERVER_GHESCLUSTERROLES + ELASTICSEARCHSERVER_GHESCLUSTERROLES + GITSERVER_GHESCLUSTERROLES + JOBSERVER_GHESCLUSTERROLES + LAUNCHSERVER_GHESCLUSTERROLES + MEMCACHESERVER_GHESCLUSTERROLES + METRICSSERVER_GHESCLUSTERROLES + MSSQLSERVER_GHESCLUSTERROLES + MYSQLSERVER_GHESCLUSTERROLES + PAGESSERVER_GHESCLUSTERROLES + REDISSERVER_GHESCLUSTERROLES + STORAGESERVER_GHESCLUSTERROLES + WEBSERVER_GHESCLUSTERROLES +) + +func (i GhesClusterRoles) String() string { + return []string{"Blank", "ActionsServer", "ConsulServer", "ElasticsearchServer", "GitServer", "JobServer", "LaunchServer", "MemcacheServer", "MetricsServer", "MssqlServer", "MysqlServer", "PagesServer", "RedisServer", "StorageServer", "WebServer"}[i] +} +func ParseGhesClusterRoles(v string) (any, error) { + result := BLANK_GHESCLUSTERROLES + switch v { + case "Blank": + result = BLANK_GHESCLUSTERROLES + case "ActionsServer": + result = ACTIONSSERVER_GHESCLUSTERROLES + case "ConsulServer": + result = CONSULSERVER_GHESCLUSTERROLES + case "ElasticsearchServer": + result = ELASTICSEARCHSERVER_GHESCLUSTERROLES + case "GitServer": + result = GITSERVER_GHESCLUSTERROLES + case "JobServer": + result = JOBSERVER_GHESCLUSTERROLES + case "LaunchServer": + result = LAUNCHSERVER_GHESCLUSTERROLES + case "MemcacheServer": + result = MEMCACHESERVER_GHESCLUSTERROLES + case "MetricsServer": + result = METRICSSERVER_GHESCLUSTERROLES + case "MssqlServer": + result = MSSQLSERVER_GHESCLUSTERROLES + case "MysqlServer": + result = MYSQLSERVER_GHESCLUSTERROLES + case "PagesServer": + result = PAGESSERVER_GHESCLUSTERROLES + case "RedisServer": + result = REDISSERVER_GHESCLUSTERROLES + case "StorageServer": + result = STORAGESERVER_GHESCLUSTERROLES + case "WebServer": + result = WEBSERVER_GHESCLUSTERROLES + default: + return nil, nil + } + return &result, nil +} +func SerializeGhesClusterRoles(values []GhesClusterRoles) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GhesClusterRoles) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/ghes_cluster_status.go b/pkg/github/models/ghes_cluster_status.go new file mode 100644 index 00000000..40a9fba7 --- /dev/null +++ b/pkg/github/models/ghes_cluster_status.go @@ -0,0 +1,122 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesClusterStatus 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 nodes property + nodes []GhesClusterStatus_nodesable + // The status property + status *GhesClusterStatusIndicator +} +// NewGhesClusterStatus instantiates a new GhesClusterStatus and sets the default values. +func NewGhesClusterStatus()(*GhesClusterStatus) { + m := &GhesClusterStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesClusterStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesClusterStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesClusterStatus(), 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 *GhesClusterStatus) 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 *GhesClusterStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["nodes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGhesClusterStatus_nodesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GhesClusterStatus_nodesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GhesClusterStatus_nodesable) + } + } + m.SetNodes(res) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGhesClusterStatusIndicator) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*GhesClusterStatusIndicator)) + } + return nil + } + return res +} +// GetNodes gets the nodes property value. The nodes property +// returns a []GhesClusterStatus_nodesable when successful +func (m *GhesClusterStatus) GetNodes()([]GhesClusterStatus_nodesable) { + return m.nodes +} +// GetStatus gets the status property value. The status property +// returns a *GhesClusterStatusIndicator when successful +func (m *GhesClusterStatus) GetStatus()(*GhesClusterStatusIndicator) { + return m.status +} +// Serialize serializes information the current object +func (m *GhesClusterStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetNodes() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetNodes())) + for i, v := range m.GetNodes() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("nodes", cast) + 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 *GhesClusterStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNodes sets the nodes property value. The nodes property +func (m *GhesClusterStatus) SetNodes(value []GhesClusterStatus_nodesable)() { + m.nodes = value +} +// SetStatus sets the status property value. The status property +func (m *GhesClusterStatus) SetStatus(value *GhesClusterStatusIndicator)() { + m.status = value +} +type GhesClusterStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNodes()([]GhesClusterStatus_nodesable) + GetStatus()(*GhesClusterStatusIndicator) + SetNodes(value []GhesClusterStatus_nodesable)() + SetStatus(value *GhesClusterStatusIndicator)() +} diff --git a/pkg/github/models/ghes_cluster_status_escaped_nodes.go b/pkg/github/models/ghes_cluster_status_escaped_nodes.go new file mode 100644 index 00000000..a87373c4 --- /dev/null +++ b/pkg/github/models/ghes_cluster_status_escaped_nodes.go @@ -0,0 +1,151 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesClusterStatus_nodes 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 hostname property + hostname *string + // The services property + services []GhesClusterStatus_nodes_servicesable + // The status property + status *GhesClusterStatusIndicator +} +// NewGhesClusterStatus_nodes instantiates a new GhesClusterStatus_nodes and sets the default values. +func NewGhesClusterStatus_nodes()(*GhesClusterStatus_nodes) { + m := &GhesClusterStatus_nodes{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesClusterStatus_nodesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesClusterStatus_nodesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesClusterStatus_nodes(), 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 *GhesClusterStatus_nodes) 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 *GhesClusterStatus_nodes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["hostname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHostname(val) + } + return nil + } + res["services"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGhesClusterStatus_nodes_servicesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GhesClusterStatus_nodes_servicesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GhesClusterStatus_nodes_servicesable) + } + } + m.SetServices(res) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGhesClusterStatusIndicator) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*GhesClusterStatusIndicator)) + } + return nil + } + return res +} +// GetHostname gets the hostname property value. The hostname property +// returns a *string when successful +func (m *GhesClusterStatus_nodes) GetHostname()(*string) { + return m.hostname +} +// GetServices gets the services property value. The services property +// returns a []GhesClusterStatus_nodes_servicesable when successful +func (m *GhesClusterStatus_nodes) GetServices()([]GhesClusterStatus_nodes_servicesable) { + return m.services +} +// GetStatus gets the status property value. The status property +// returns a *GhesClusterStatusIndicator when successful +func (m *GhesClusterStatus_nodes) GetStatus()(*GhesClusterStatusIndicator) { + return m.status +} +// Serialize serializes information the current object +func (m *GhesClusterStatus_nodes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("hostname", m.GetHostname()) + if err != nil { + return err + } + } + if m.GetServices() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetServices())) + for i, v := range m.GetServices() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("services", cast) + 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 *GhesClusterStatus_nodes) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHostname sets the hostname property value. The hostname property +func (m *GhesClusterStatus_nodes) SetHostname(value *string)() { + m.hostname = value +} +// SetServices sets the services property value. The services property +func (m *GhesClusterStatus_nodes) SetServices(value []GhesClusterStatus_nodes_servicesable)() { + m.services = value +} +// SetStatus sets the status property value. The status property +func (m *GhesClusterStatus_nodes) SetStatus(value *GhesClusterStatusIndicator)() { + m.status = value +} +type GhesClusterStatus_nodesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHostname()(*string) + GetServices()([]GhesClusterStatus_nodes_servicesable) + GetStatus()(*GhesClusterStatusIndicator) + SetHostname(value *string)() + SetServices(value []GhesClusterStatus_nodes_servicesable)() + SetStatus(value *GhesClusterStatusIndicator)() +} diff --git a/pkg/github/models/ghes_cluster_status_escaped_nodes_escaped_services.go b/pkg/github/models/ghes_cluster_status_escaped_nodes_escaped_services.go new file mode 100644 index 00000000..2f94265e --- /dev/null +++ b/pkg/github/models/ghes_cluster_status_escaped_nodes_escaped_services.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesClusterStatus_nodes_services 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 details property + details *string + // The name property + name *string + // The status property + status *GhesClusterStatusIndicator +} +// NewGhesClusterStatus_nodes_services instantiates a new GhesClusterStatus_nodes_services and sets the default values. +func NewGhesClusterStatus_nodes_services()(*GhesClusterStatus_nodes_services) { + m := &GhesClusterStatus_nodes_services{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesClusterStatus_nodes_servicesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesClusterStatus_nodes_servicesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesClusterStatus_nodes_services(), 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 *GhesClusterStatus_nodes_services) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDetails gets the details property value. The details property +// returns a *string when successful +func (m *GhesClusterStatus_nodes_services) GetDetails()(*string) { + return m.details +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesClusterStatus_nodes_services) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["details"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDetails(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["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGhesClusterStatusIndicator) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*GhesClusterStatusIndicator)) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *GhesClusterStatus_nodes_services) GetName()(*string) { + return m.name +} +// GetStatus gets the status property value. The status property +// returns a *GhesClusterStatusIndicator when successful +func (m *GhesClusterStatus_nodes_services) GetStatus()(*GhesClusterStatusIndicator) { + return m.status +} +// Serialize serializes information the current object +func (m *GhesClusterStatus_nodes_services) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("details", m.GetDetails()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *GhesClusterStatus_nodes_services) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDetails sets the details property value. The details property +func (m *GhesClusterStatus_nodes_services) SetDetails(value *string)() { + m.details = value +} +// SetName sets the name property value. The name property +func (m *GhesClusterStatus_nodes_services) SetName(value *string)() { + m.name = value +} +// SetStatus sets the status property value. The status property +func (m *GhesClusterStatus_nodes_services) SetStatus(value *GhesClusterStatusIndicator)() { + m.status = value +} +type GhesClusterStatus_nodes_servicesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDetails()(*string) + GetName()(*string) + GetStatus()(*GhesClusterStatusIndicator) + SetDetails(value *string)() + SetName(value *string)() + SetStatus(value *GhesClusterStatusIndicator)() +} diff --git a/pkg/github/models/ghes_cluster_status_indicator.go b/pkg/github/models/ghes_cluster_status_indicator.go new file mode 100644 index 00000000..936d54f9 --- /dev/null +++ b/pkg/github/models/ghes_cluster_status_indicator.go @@ -0,0 +1,39 @@ +package models +type GhesClusterStatusIndicator int + +const ( + UNKNOWN_GHESCLUSTERSTATUSINDICATOR GhesClusterStatusIndicator = iota + OK_GHESCLUSTERSTATUSINDICATOR + WARNING_GHESCLUSTERSTATUSINDICATOR + CRITICAL_GHESCLUSTERSTATUSINDICATOR +) + +func (i GhesClusterStatusIndicator) String() string { + return []string{"UNKNOWN", "OK", "WARNING", "CRITICAL"}[i] +} +func ParseGhesClusterStatusIndicator(v string) (any, error) { + result := UNKNOWN_GHESCLUSTERSTATUSINDICATOR + switch v { + case "UNKNOWN": + result = UNKNOWN_GHESCLUSTERSTATUSINDICATOR + case "OK": + result = OK_GHESCLUSTERSTATUSINDICATOR + case "WARNING": + result = WARNING_GHESCLUSTERSTATUSINDICATOR + case "CRITICAL": + result = CRITICAL_GHESCLUSTERSTATUSINDICATOR + default: + return nil, nil + } + return &result, nil +} +func SerializeGhesClusterStatusIndicator(values []GhesClusterStatusIndicator) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GhesClusterStatusIndicator) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/ghes_cluster_topology.go b/pkg/github/models/ghes_cluster_topology.go new file mode 100644 index 00000000..0140722f --- /dev/null +++ b/pkg/github/models/ghes_cluster_topology.go @@ -0,0 +1,36 @@ +package models +type GhesClusterTopology int + +const ( + SINGLENODE_GHESCLUSTERTOPOLOGY GhesClusterTopology = iota + HA_GHESCLUSTERTOPOLOGY + CLUSTER_GHESCLUSTERTOPOLOGY +) + +func (i GhesClusterTopology) String() string { + return []string{"SingleNode", "Ha", "Cluster"}[i] +} +func ParseGhesClusterTopology(v string) (any, error) { + result := SINGLENODE_GHESCLUSTERTOPOLOGY + switch v { + case "SingleNode": + result = SINGLENODE_GHESCLUSTERTOPOLOGY + case "Ha": + result = HA_GHESCLUSTERTOPOLOGY + case "Cluster": + result = CLUSTER_GHESCLUSTERTOPOLOGY + default: + return nil, nil + } + return &result, nil +} +func SerializeGhesClusterTopology(values []GhesClusterTopology) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GhesClusterTopology) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/ghes_config_init_request.go b/pkg/github/models/ghes_config_init_request.go new file mode 100644 index 00000000..a56109ee --- /dev/null +++ b/pkg/github/models/ghes_config_init_request.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesConfigInitRequest 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 content of your _.ghl_ license file. + license *string + // The root site administrator password. + password *string +} +// NewGhesConfigInitRequest instantiates a new GhesConfigInitRequest and sets the default values. +func NewGhesConfigInitRequest()(*GhesConfigInitRequest) { + m := &GhesConfigInitRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesConfigInitRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesConfigInitRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesConfigInitRequest(), 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 *GhesConfigInitRequest) 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 *GhesConfigInitRequest) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicense(val) + } + return nil + } + res["password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPassword(val) + } + return nil + } + return res +} +// GetLicense gets the license property value. The content of your _.ghl_ license file. +// returns a *string when successful +func (m *GhesConfigInitRequest) GetLicense()(*string) { + return m.license +} +// GetPassword gets the password property value. The root site administrator password. +// returns a *string when successful +func (m *GhesConfigInitRequest) GetPassword()(*string) { + return m.password +} +// Serialize serializes information the current object +func (m *GhesConfigInitRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("password", m.GetPassword()) + 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 *GhesConfigInitRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLicense sets the license property value. The content of your _.ghl_ license file. +func (m *GhesConfigInitRequest) SetLicense(value *string)() { + m.license = value +} +// SetPassword sets the password property value. The root site administrator password. +func (m *GhesConfigInitRequest) SetPassword(value *string)() { + m.password = value +} +type GhesConfigInitRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLicense()(*string) + GetPassword()(*string) + SetLicense(value *string)() + SetPassword(value *string)() +} diff --git a/pkg/github/models/ghes_config_nodes.go b/pkg/github/models/ghes_config_nodes.go new file mode 100644 index 00000000..70a81bda --- /dev/null +++ b/pkg/github/models/ghes_config_nodes.go @@ -0,0 +1,122 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesConfigNodes 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 nodes property + nodes []GhesConfigNodes_nodesable + // The topology property + topology *GhesClusterTopology +} +// NewGhesConfigNodes instantiates a new GhesConfigNodes and sets the default values. +func NewGhesConfigNodes()(*GhesConfigNodes) { + m := &GhesConfigNodes{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesConfigNodesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesConfigNodesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesConfigNodes(), 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 *GhesConfigNodes) 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 *GhesConfigNodes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["nodes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGhesConfigNodes_nodesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GhesConfigNodes_nodesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GhesConfigNodes_nodesable) + } + } + m.SetNodes(res) + } + return nil + } + res["topology"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGhesClusterTopology) + if err != nil { + return err + } + if val != nil { + m.SetTopology(val.(*GhesClusterTopology)) + } + return nil + } + return res +} +// GetNodes gets the nodes property value. The nodes property +// returns a []GhesConfigNodes_nodesable when successful +func (m *GhesConfigNodes) GetNodes()([]GhesConfigNodes_nodesable) { + return m.nodes +} +// GetTopology gets the topology property value. The topology property +// returns a *GhesClusterTopology when successful +func (m *GhesConfigNodes) GetTopology()(*GhesClusterTopology) { + return m.topology +} +// Serialize serializes information the current object +func (m *GhesConfigNodes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetNodes() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetNodes())) + for i, v := range m.GetNodes() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("nodes", cast) + if err != nil { + return err + } + } + if m.GetTopology() != nil { + cast := (*m.GetTopology()).String() + err := writer.WriteStringValue("topology", &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 *GhesConfigNodes) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNodes sets the nodes property value. The nodes property +func (m *GhesConfigNodes) SetNodes(value []GhesConfigNodes_nodesable)() { + m.nodes = value +} +// SetTopology sets the topology property value. The topology property +func (m *GhesConfigNodes) SetTopology(value *GhesClusterTopology)() { + m.topology = value +} +type GhesConfigNodesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNodes()([]GhesConfigNodes_nodesable) + GetTopology()(*GhesClusterTopology) + SetNodes(value []GhesConfigNodes_nodesable)() + SetTopology(value *GhesClusterTopology)() +} diff --git a/pkg/github/models/ghes_config_nodes_escaped_nodes.go b/pkg/github/models/ghes_config_nodes_escaped_nodes.go new file mode 100644 index 00000000..3b499c6a --- /dev/null +++ b/pkg/github/models/ghes_config_nodes_escaped_nodes.go @@ -0,0 +1,173 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesConfigNodes_nodes 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 cluster_roles property + cluster_roles []GhesClusterRoles + // The hostname property + hostname *string + // The replica property + replica *bool + // The uuid property + uuid *string +} +// NewGhesConfigNodes_nodes instantiates a new GhesConfigNodes_nodes and sets the default values. +func NewGhesConfigNodes_nodes()(*GhesConfigNodes_nodes) { + m := &GhesConfigNodes_nodes{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesConfigNodes_nodesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesConfigNodes_nodesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesConfigNodes_nodes(), 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 *GhesConfigNodes_nodes) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClusterRoles gets the cluster_roles property value. The cluster_roles property +// returns a []GhesClusterRoles when successful +func (m *GhesConfigNodes_nodes) GetClusterRoles()([]GhesClusterRoles) { + return m.cluster_roles +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesConfigNodes_nodes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cluster_roles"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseGhesClusterRoles) + if err != nil { + return err + } + if val != nil { + res := make([]GhesClusterRoles, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*GhesClusterRoles)) + } + } + m.SetClusterRoles(res) + } + return nil + } + res["hostname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHostname(val) + } + return nil + } + res["replica"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetReplica(val) + } + return nil + } + res["uuid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUuid(val) + } + return nil + } + return res +} +// GetHostname gets the hostname property value. The hostname property +// returns a *string when successful +func (m *GhesConfigNodes_nodes) GetHostname()(*string) { + return m.hostname +} +// GetReplica gets the replica property value. The replica property +// returns a *bool when successful +func (m *GhesConfigNodes_nodes) GetReplica()(*bool) { + return m.replica +} +// GetUuid gets the uuid property value. The uuid property +// returns a *string when successful +func (m *GhesConfigNodes_nodes) GetUuid()(*string) { + return m.uuid +} +// Serialize serializes information the current object +func (m *GhesConfigNodes_nodes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetClusterRoles() != nil { + err := writer.WriteCollectionOfStringValues("cluster_roles", SerializeGhesClusterRoles(m.GetClusterRoles())) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hostname", m.GetHostname()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("replica", m.GetReplica()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("uuid", m.GetUuid()) + 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 *GhesConfigNodes_nodes) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClusterRoles sets the cluster_roles property value. The cluster_roles property +func (m *GhesConfigNodes_nodes) SetClusterRoles(value []GhesClusterRoles)() { + m.cluster_roles = value +} +// SetHostname sets the hostname property value. The hostname property +func (m *GhesConfigNodes_nodes) SetHostname(value *string)() { + m.hostname = value +} +// SetReplica sets the replica property value. The replica property +func (m *GhesConfigNodes_nodes) SetReplica(value *bool)() { + m.replica = value +} +// SetUuid sets the uuid property value. The uuid property +func (m *GhesConfigNodes_nodes) SetUuid(value *string)() { + m.uuid = value +} +type GhesConfigNodes_nodesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClusterRoles()([]GhesClusterRoles) + GetHostname()(*string) + GetReplica()(*bool) + GetUuid()(*string) + SetClusterRoles(value []GhesClusterRoles)() + SetHostname(value *string)() + SetReplica(value *bool)() + SetUuid(value *string)() +} diff --git a/pkg/github/models/ghes_delete_ssh_request.go b/pkg/github/models/ghes_delete_ssh_request.go new file mode 100644 index 00000000..d277a8d1 --- /dev/null +++ b/pkg/github/models/ghes_delete_ssh_request.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesDeleteSshRequest 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 public SSH key to remove from the `authorized_keys` file. + key *string +} +// NewGhesDeleteSshRequest instantiates a new GhesDeleteSshRequest and sets the default values. +func NewGhesDeleteSshRequest()(*GhesDeleteSshRequest) { + m := &GhesDeleteSshRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesDeleteSshRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesDeleteSshRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesDeleteSshRequest(), 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 *GhesDeleteSshRequest) 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 *GhesDeleteSshRequest) 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 + } + return res +} +// GetKey gets the key property value. The public SSH key to remove from the `authorized_keys` file. +// returns a *string when successful +func (m *GhesDeleteSshRequest) GetKey()(*string) { + return m.key +} +// Serialize serializes information the current object +func (m *GhesDeleteSshRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + 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 *GhesDeleteSshRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The public SSH key to remove from the `authorized_keys` file. +func (m *GhesDeleteSshRequest) SetKey(value *string)() { + m.key = value +} +type GhesDeleteSshRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + SetKey(value *string)() +} diff --git a/pkg/github/models/ghes_delete_ssh_response.go b/pkg/github/models/ghes_delete_ssh_response.go new file mode 100644 index 00000000..8f62c09e --- /dev/null +++ b/pkg/github/models/ghes_delete_ssh_response.go @@ -0,0 +1,168 @@ +package models + +import ( + i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22 "github.com/google/uuid" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesDeleteSshResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Error message indicating the reason for the SSH key removal failure. This field is only present if the SSH key removal failed. + error *string + // Hostname of the node where the SSH key was removed. + hostname *string + // Message indicating the result of the SSH key removal. + message *string + // UUID of the SSH key that was removed. + uuid *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID +} +// NewGhesDeleteSshResponse instantiates a new GhesDeleteSshResponse and sets the default values. +func NewGhesDeleteSshResponse()(*GhesDeleteSshResponse) { + m := &GhesDeleteSshResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesDeleteSshResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesDeleteSshResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesDeleteSshResponse(), 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 *GhesDeleteSshResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetError gets the error property value. Error message indicating the reason for the SSH key removal failure. This field is only present if the SSH key removal failed. +// returns a *string when successful +func (m *GhesDeleteSshResponse) GetError()(*string) { + return m.error +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesDeleteSshResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["error"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetError(val) + } + return nil + } + res["hostname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHostname(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 + } + res["uuid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetUUIDValue() + if err != nil { + return err + } + if val != nil { + m.SetUuid(val) + } + return nil + } + return res +} +// GetHostname gets the hostname property value. Hostname of the node where the SSH key was removed. +// returns a *string when successful +func (m *GhesDeleteSshResponse) GetHostname()(*string) { + return m.hostname +} +// GetMessage gets the message property value. Message indicating the result of the SSH key removal. +// returns a *string when successful +func (m *GhesDeleteSshResponse) GetMessage()(*string) { + return m.message +} +// GetUuid gets the uuid property value. UUID of the SSH key that was removed. +// returns a *UUID when successful +func (m *GhesDeleteSshResponse) GetUuid()(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) { + return m.uuid +} +// Serialize serializes information the current object +func (m *GhesDeleteSshResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("error", m.GetError()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hostname", m.GetHostname()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteUUIDValue("uuid", m.GetUuid()) + 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 *GhesDeleteSshResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetError sets the error property value. Error message indicating the reason for the SSH key removal failure. This field is only present if the SSH key removal failed. +func (m *GhesDeleteSshResponse) SetError(value *string)() { + m.error = value +} +// SetHostname sets the hostname property value. Hostname of the node where the SSH key was removed. +func (m *GhesDeleteSshResponse) SetHostname(value *string)() { + m.hostname = value +} +// SetMessage sets the message property value. Message indicating the result of the SSH key removal. +func (m *GhesDeleteSshResponse) SetMessage(value *string)() { + m.message = value +} +// SetUuid sets the uuid property value. UUID of the SSH key that was removed. +func (m *GhesDeleteSshResponse) SetUuid(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() { + m.uuid = value +} +type GhesDeleteSshResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetError()(*string) + GetHostname()(*string) + GetMessage()(*string) + GetUuid()(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) + SetError(value *string)() + SetHostname(value *string)() + SetMessage(value *string)() + SetUuid(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() +} diff --git a/pkg/github/models/ghes_get_maintenance.go b/pkg/github/models/ghes_get_maintenance.go new file mode 100644 index 00000000..5c23b0a5 --- /dev/null +++ b/pkg/github/models/ghes_get_maintenance.go @@ -0,0 +1,303 @@ +package models + +import ( + i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22 "github.com/google/uuid" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetMaintenance 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 can_unset_maintenance property + can_unset_maintenance *bool + // The connection_services property + connection_services []GhesGetMaintenance_connection_servicesable + // The hostname property + hostname *string + // The ip_exception_list property + ip_exception_list []string + // The maintenance_mode_message property + maintenance_mode_message *string + // The scheduled_time property + scheduled_time *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly + // The status property + status *GhesGetMaintenance_status + // The uuid property + uuid *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID +} +// NewGhesGetMaintenance instantiates a new GhesGetMaintenance and sets the default values. +func NewGhesGetMaintenance()(*GhesGetMaintenance) { + m := &GhesGetMaintenance{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetMaintenanceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetMaintenanceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetMaintenance(), 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 *GhesGetMaintenance) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCanUnsetMaintenance gets the can_unset_maintenance property value. The can_unset_maintenance property +// returns a *bool when successful +func (m *GhesGetMaintenance) GetCanUnsetMaintenance()(*bool) { + return m.can_unset_maintenance +} +// GetConnectionServices gets the connection_services property value. The connection_services property +// returns a []GhesGetMaintenance_connection_servicesable when successful +func (m *GhesGetMaintenance) GetConnectionServices()([]GhesGetMaintenance_connection_servicesable) { + return m.connection_services +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetMaintenance) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["can_unset_maintenance"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanUnsetMaintenance(val) + } + return nil + } + res["connection_services"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGhesGetMaintenance_connection_servicesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GhesGetMaintenance_connection_servicesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GhesGetMaintenance_connection_servicesable) + } + } + m.SetConnectionServices(res) + } + return nil + } + res["hostname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHostname(val) + } + return nil + } + res["ip_exception_list"] = 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.SetIpExceptionList(res) + } + return nil + } + res["maintenance_mode_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintenanceModeMessage(val) + } + return nil + } + res["scheduled_time"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetDateOnlyValue() + if err != nil { + return err + } + if val != nil { + m.SetScheduledTime(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGhesGetMaintenance_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*GhesGetMaintenance_status)) + } + return nil + } + res["uuid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetUUIDValue() + if err != nil { + return err + } + if val != nil { + m.SetUuid(val) + } + return nil + } + return res +} +// GetHostname gets the hostname property value. The hostname property +// returns a *string when successful +func (m *GhesGetMaintenance) GetHostname()(*string) { + return m.hostname +} +// GetIpExceptionList gets the ip_exception_list property value. The ip_exception_list property +// returns a []string when successful +func (m *GhesGetMaintenance) GetIpExceptionList()([]string) { + return m.ip_exception_list +} +// GetMaintenanceModeMessage gets the maintenance_mode_message property value. The maintenance_mode_message property +// returns a *string when successful +func (m *GhesGetMaintenance) GetMaintenanceModeMessage()(*string) { + return m.maintenance_mode_message +} +// GetScheduledTime gets the scheduled_time property value. The scheduled_time property +// returns a *DateOnly when successful +func (m *GhesGetMaintenance) GetScheduledTime()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly) { + return m.scheduled_time +} +// GetStatus gets the status property value. The status property +// returns a *GhesGetMaintenance_status when successful +func (m *GhesGetMaintenance) GetStatus()(*GhesGetMaintenance_status) { + return m.status +} +// GetUuid gets the uuid property value. The uuid property +// returns a *UUID when successful +func (m *GhesGetMaintenance) GetUuid()(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) { + return m.uuid +} +// Serialize serializes information the current object +func (m *GhesGetMaintenance) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("can_unset_maintenance", m.GetCanUnsetMaintenance()) + if err != nil { + return err + } + } + if m.GetConnectionServices() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetConnectionServices())) + for i, v := range m.GetConnectionServices() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("connection_services", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hostname", m.GetHostname()) + if err != nil { + return err + } + } + if m.GetIpExceptionList() != nil { + err := writer.WriteCollectionOfStringValues("ip_exception_list", m.GetIpExceptionList()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("maintenance_mode_message", m.GetMaintenanceModeMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteDateOnlyValue("scheduled_time", m.GetScheduledTime()) + 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.WriteUUIDValue("uuid", m.GetUuid()) + 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 *GhesGetMaintenance) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCanUnsetMaintenance sets the can_unset_maintenance property value. The can_unset_maintenance property +func (m *GhesGetMaintenance) SetCanUnsetMaintenance(value *bool)() { + m.can_unset_maintenance = value +} +// SetConnectionServices sets the connection_services property value. The connection_services property +func (m *GhesGetMaintenance) SetConnectionServices(value []GhesGetMaintenance_connection_servicesable)() { + m.connection_services = value +} +// SetHostname sets the hostname property value. The hostname property +func (m *GhesGetMaintenance) SetHostname(value *string)() { + m.hostname = value +} +// SetIpExceptionList sets the ip_exception_list property value. The ip_exception_list property +func (m *GhesGetMaintenance) SetIpExceptionList(value []string)() { + m.ip_exception_list = value +} +// SetMaintenanceModeMessage sets the maintenance_mode_message property value. The maintenance_mode_message property +func (m *GhesGetMaintenance) SetMaintenanceModeMessage(value *string)() { + m.maintenance_mode_message = value +} +// SetScheduledTime sets the scheduled_time property value. The scheduled_time property +func (m *GhesGetMaintenance) SetScheduledTime(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)() { + m.scheduled_time = value +} +// SetStatus sets the status property value. The status property +func (m *GhesGetMaintenance) SetStatus(value *GhesGetMaintenance_status)() { + m.status = value +} +// SetUuid sets the uuid property value. The uuid property +func (m *GhesGetMaintenance) SetUuid(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() { + m.uuid = value +} +type GhesGetMaintenanceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCanUnsetMaintenance()(*bool) + GetConnectionServices()([]GhesGetMaintenance_connection_servicesable) + GetHostname()(*string) + GetIpExceptionList()([]string) + GetMaintenanceModeMessage()(*string) + GetScheduledTime()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly) + GetStatus()(*GhesGetMaintenance_status) + GetUuid()(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) + SetCanUnsetMaintenance(value *bool)() + SetConnectionServices(value []GhesGetMaintenance_connection_servicesable)() + SetHostname(value *string)() + SetIpExceptionList(value []string)() + SetMaintenanceModeMessage(value *string)() + SetScheduledTime(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)() + SetStatus(value *GhesGetMaintenance_status)() + SetUuid(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() +} diff --git a/pkg/github/models/ghes_get_maintenance_escaped_connection_escaped_services.go b/pkg/github/models/ghes_get_maintenance_escaped_connection_escaped_services.go new file mode 100644 index 00000000..b6abd839 --- /dev/null +++ b/pkg/github/models/ghes_get_maintenance_escaped_connection_escaped_services.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetMaintenance_connection_services 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 name property + name *string + // The number property + number *int32 +} +// NewGhesGetMaintenance_connection_services instantiates a new GhesGetMaintenance_connection_services and sets the default values. +func NewGhesGetMaintenance_connection_services()(*GhesGetMaintenance_connection_services) { + m := &GhesGetMaintenance_connection_services{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetMaintenance_connection_servicesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetMaintenance_connection_servicesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetMaintenance_connection_services(), 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 *GhesGetMaintenance_connection_services) 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 *GhesGetMaintenance_connection_services) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *GhesGetMaintenance_connection_services) GetName()(*string) { + return m.name +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *GhesGetMaintenance_connection_services) GetNumber()(*int32) { + return m.number +} +// Serialize serializes information the current object +func (m *GhesGetMaintenance_connection_services) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + 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 *GhesGetMaintenance_connection_services) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name property +func (m *GhesGetMaintenance_connection_services) SetName(value *string)() { + m.name = value +} +// SetNumber sets the number property value. The number property +func (m *GhesGetMaintenance_connection_services) SetNumber(value *int32)() { + m.number = value +} +type GhesGetMaintenance_connection_servicesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetNumber()(*int32) + SetName(value *string)() + SetNumber(value *int32)() +} diff --git a/pkg/github/models/ghes_get_maintenance_escaped_status.go b/pkg/github/models/ghes_get_maintenance_escaped_status.go new file mode 100644 index 00000000..acc6700a --- /dev/null +++ b/pkg/github/models/ghes_get_maintenance_escaped_status.go @@ -0,0 +1,36 @@ +package models +type GhesGetMaintenance_status int + +const ( + ON_GHESGETMAINTENANCE_STATUS GhesGetMaintenance_status = iota + OFF_GHESGETMAINTENANCE_STATUS + SCHEDULED_GHESGETMAINTENANCE_STATUS +) + +func (i GhesGetMaintenance_status) String() string { + return []string{"on", "off", "scheduled"}[i] +} +func ParseGhesGetMaintenance_status(v string) (any, error) { + result := ON_GHESGETMAINTENANCE_STATUS + switch v { + case "on": + result = ON_GHESGETMAINTENANCE_STATUS + case "off": + result = OFF_GHESGETMAINTENANCE_STATUS + case "scheduled": + result = SCHEDULED_GHESGETMAINTENANCE_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeGhesGetMaintenance_status(values []GhesGetMaintenance_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GhesGetMaintenance_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/ghes_get_settings.go b/pkg/github/models/ghes_get_settings.go new file mode 100644 index 00000000..633b6f08 --- /dev/null +++ b/pkg/github/models/ghes_get_settings.go @@ -0,0 +1,921 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings 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 admin_password property + admin_password *string + // The assets property + assets *string + // The auth_mode property + auth_mode *string + // The avatar property + avatar GhesGetSettings_avatarable + // The cas property + cas GhesGetSettings_casable + // The collectd property + collectd GhesGetSettings_collectdable + // The configuration_id property + configuration_id *int32 + // The configuration_run_count property + configuration_run_count *int32 + // The customer property + customer GhesGetSettings_customerable + // The expire_sessions property + expire_sessions *bool + // The github_hostname property + github_hostname *string + // The github_oauth property + github_oauth GhesGetSettings_github_oauthable + // The github_ssl property + github_ssl GhesGetSettings_github_sslable + // The http_proxy property + http_proxy *string + // The identicons_host property + identicons_host *string + // The ldap property + ldap GhesGetSettings_ldapable + // The license property + license GhesGetSettings_licenseable + // The load_balancer property + load_balancer *string + // The mapping property + mapping GhesGetSettings_mappingable + // The ntp property + ntp GhesGetSettings_ntpable + // The pages property + pages GhesGetSettings_pagesable + // The private_mode property + private_mode *bool + // The public_pages property + public_pages *bool + // The saml property + saml GhesGetSettings_samlable + // The signup_enabled property + signup_enabled *bool + // The smtp property + smtp GhesGetSettings_smtpable + // The snmp property + snmp GhesGetSettings_snmpable + // The subdomain_isolation property + subdomain_isolation *bool + // The syslog property + syslog GhesGetSettings_syslogable + // The timezone property + timezone *string +} +// NewGhesGetSettings instantiates a new GhesGetSettings and sets the default values. +func NewGhesGetSettings()(*GhesGetSettings) { + m := &GhesGetSettings{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettingsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettingsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings(), 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 *GhesGetSettings) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdminPassword gets the admin_password property value. The admin_password property +// returns a *string when successful +func (m *GhesGetSettings) GetAdminPassword()(*string) { + return m.admin_password +} +// GetAssets gets the assets property value. The assets property +// returns a *string when successful +func (m *GhesGetSettings) GetAssets()(*string) { + return m.assets +} +// GetAuthMode gets the auth_mode property value. The auth_mode property +// returns a *string when successful +func (m *GhesGetSettings) GetAuthMode()(*string) { + return m.auth_mode +} +// GetAvatar gets the avatar property value. The avatar property +// returns a GhesGetSettings_avatarable when successful +func (m *GhesGetSettings) GetAvatar()(GhesGetSettings_avatarable) { + return m.avatar +} +// GetCas gets the cas property value. The cas property +// returns a GhesGetSettings_casable when successful +func (m *GhesGetSettings) GetCas()(GhesGetSettings_casable) { + return m.cas +} +// GetCollectd gets the collectd property value. The collectd property +// returns a GhesGetSettings_collectdable when successful +func (m *GhesGetSettings) GetCollectd()(GhesGetSettings_collectdable) { + return m.collectd +} +// GetConfigurationId gets the configuration_id property value. The configuration_id property +// returns a *int32 when successful +func (m *GhesGetSettings) GetConfigurationId()(*int32) { + return m.configuration_id +} +// GetConfigurationRunCount gets the configuration_run_count property value. The configuration_run_count property +// returns a *int32 when successful +func (m *GhesGetSettings) GetConfigurationRunCount()(*int32) { + return m.configuration_run_count +} +// GetCustomer gets the customer property value. The customer property +// returns a GhesGetSettings_customerable when successful +func (m *GhesGetSettings) GetCustomer()(GhesGetSettings_customerable) { + return m.customer +} +// GetExpireSessions gets the expire_sessions property value. The expire_sessions property +// returns a *bool when successful +func (m *GhesGetSettings) GetExpireSessions()(*bool) { + return m.expire_sessions +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetSettings) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin_password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAdminPassword(val) + } + return nil + } + res["assets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssets(val) + } + return nil + } + res["auth_mode"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAuthMode(val) + } + return nil + } + res["avatar"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_avatarFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAvatar(val.(GhesGetSettings_avatarable)) + } + return nil + } + res["cas"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_casFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCas(val.(GhesGetSettings_casable)) + } + return nil + } + res["collectd"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_collectdFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCollectd(val.(GhesGetSettings_collectdable)) + } + return nil + } + res["configuration_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetConfigurationId(val) + } + return nil + } + res["configuration_run_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetConfigurationRunCount(val) + } + return nil + } + res["customer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_customerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCustomer(val.(GhesGetSettings_customerable)) + } + return nil + } + res["expire_sessions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExpireSessions(val) + } + return nil + } + res["github_hostname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGithubHostname(val) + } + return nil + } + res["github_oauth"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_github_oauthFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetGithubOauth(val.(GhesGetSettings_github_oauthable)) + } + return nil + } + res["github_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_github_sslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetGithubSsl(val.(GhesGetSettings_github_sslable)) + } + return nil + } + res["http_proxy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHttpProxy(val) + } + return nil + } + res["identicons_host"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIdenticonsHost(val) + } + return nil + } + res["ldap"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_ldapFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLdap(val.(GhesGetSettings_ldapable)) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_licenseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(GhesGetSettings_licenseable)) + } + return nil + } + res["load_balancer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLoadBalancer(val) + } + return nil + } + res["mapping"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_mappingFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMapping(val.(GhesGetSettings_mappingable)) + } + return nil + } + res["ntp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_ntpFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetNtp(val.(GhesGetSettings_ntpable)) + } + return nil + } + res["pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_pagesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPages(val.(GhesGetSettings_pagesable)) + } + return nil + } + res["private_mode"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivateMode(val) + } + return nil + } + res["public_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicPages(val) + } + return nil + } + res["saml"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_samlFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSaml(val.(GhesGetSettings_samlable)) + } + return nil + } + res["signup_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSignupEnabled(val) + } + return nil + } + res["smtp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_smtpFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSmtp(val.(GhesGetSettings_smtpable)) + } + return nil + } + res["snmp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_snmpFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSnmp(val.(GhesGetSettings_snmpable)) + } + return nil + } + res["subdomain_isolation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSubdomainIsolation(val) + } + return nil + } + res["syslog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_syslogFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSyslog(val.(GhesGetSettings_syslogable)) + } + return nil + } + res["timezone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTimezone(val) + } + return nil + } + return res +} +// GetGithubHostname gets the github_hostname property value. The github_hostname property +// returns a *string when successful +func (m *GhesGetSettings) GetGithubHostname()(*string) { + return m.github_hostname +} +// GetGithubOauth gets the github_oauth property value. The github_oauth property +// returns a GhesGetSettings_github_oauthable when successful +func (m *GhesGetSettings) GetGithubOauth()(GhesGetSettings_github_oauthable) { + return m.github_oauth +} +// GetGithubSsl gets the github_ssl property value. The github_ssl property +// returns a GhesGetSettings_github_sslable when successful +func (m *GhesGetSettings) GetGithubSsl()(GhesGetSettings_github_sslable) { + return m.github_ssl +} +// GetHttpProxy gets the http_proxy property value. The http_proxy property +// returns a *string when successful +func (m *GhesGetSettings) GetHttpProxy()(*string) { + return m.http_proxy +} +// GetIdenticonsHost gets the identicons_host property value. The identicons_host property +// returns a *string when successful +func (m *GhesGetSettings) GetIdenticonsHost()(*string) { + return m.identicons_host +} +// GetLdap gets the ldap property value. The ldap property +// returns a GhesGetSettings_ldapable when successful +func (m *GhesGetSettings) GetLdap()(GhesGetSettings_ldapable) { + return m.ldap +} +// GetLicense gets the license property value. The license property +// returns a GhesGetSettings_licenseable when successful +func (m *GhesGetSettings) GetLicense()(GhesGetSettings_licenseable) { + return m.license +} +// GetLoadBalancer gets the load_balancer property value. The load_balancer property +// returns a *string when successful +func (m *GhesGetSettings) GetLoadBalancer()(*string) { + return m.load_balancer +} +// GetMapping gets the mapping property value. The mapping property +// returns a GhesGetSettings_mappingable when successful +func (m *GhesGetSettings) GetMapping()(GhesGetSettings_mappingable) { + return m.mapping +} +// GetNtp gets the ntp property value. The ntp property +// returns a GhesGetSettings_ntpable when successful +func (m *GhesGetSettings) GetNtp()(GhesGetSettings_ntpable) { + return m.ntp +} +// GetPages gets the pages property value. The pages property +// returns a GhesGetSettings_pagesable when successful +func (m *GhesGetSettings) GetPages()(GhesGetSettings_pagesable) { + return m.pages +} +// GetPrivateMode gets the private_mode property value. The private_mode property +// returns a *bool when successful +func (m *GhesGetSettings) GetPrivateMode()(*bool) { + return m.private_mode +} +// GetPublicPages gets the public_pages property value. The public_pages property +// returns a *bool when successful +func (m *GhesGetSettings) GetPublicPages()(*bool) { + return m.public_pages +} +// GetSaml gets the saml property value. The saml property +// returns a GhesGetSettings_samlable when successful +func (m *GhesGetSettings) GetSaml()(GhesGetSettings_samlable) { + return m.saml +} +// GetSignupEnabled gets the signup_enabled property value. The signup_enabled property +// returns a *bool when successful +func (m *GhesGetSettings) GetSignupEnabled()(*bool) { + return m.signup_enabled +} +// GetSmtp gets the smtp property value. The smtp property +// returns a GhesGetSettings_smtpable when successful +func (m *GhesGetSettings) GetSmtp()(GhesGetSettings_smtpable) { + return m.smtp +} +// GetSnmp gets the snmp property value. The snmp property +// returns a GhesGetSettings_snmpable when successful +func (m *GhesGetSettings) GetSnmp()(GhesGetSettings_snmpable) { + return m.snmp +} +// GetSubdomainIsolation gets the subdomain_isolation property value. The subdomain_isolation property +// returns a *bool when successful +func (m *GhesGetSettings) GetSubdomainIsolation()(*bool) { + return m.subdomain_isolation +} +// GetSyslog gets the syslog property value. The syslog property +// returns a GhesGetSettings_syslogable when successful +func (m *GhesGetSettings) GetSyslog()(GhesGetSettings_syslogable) { + return m.syslog +} +// GetTimezone gets the timezone property value. The timezone property +// returns a *string when successful +func (m *GhesGetSettings) GetTimezone()(*string) { + return m.timezone +} +// Serialize serializes information the current object +func (m *GhesGetSettings) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("admin_password", m.GetAdminPassword()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assets", m.GetAssets()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("auth_mode", m.GetAuthMode()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("avatar", m.GetAvatar()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("cas", m.GetCas()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("collectd", m.GetCollectd()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("configuration_id", m.GetConfigurationId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("configuration_run_count", m.GetConfigurationRunCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("customer", m.GetCustomer()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("expire_sessions", m.GetExpireSessions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("github_hostname", m.GetGithubHostname()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("github_oauth", m.GetGithubOauth()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("github_ssl", m.GetGithubSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("http_proxy", m.GetHttpProxy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("identicons_host", m.GetIdenticonsHost()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("ldap", m.GetLdap()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("load_balancer", m.GetLoadBalancer()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("mapping", m.GetMapping()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("ntp", m.GetNtp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pages", m.GetPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private_mode", m.GetPrivateMode()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("public_pages", m.GetPublicPages()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("saml", m.GetSaml()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("signup_enabled", m.GetSignupEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("smtp", m.GetSmtp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("snmp", m.GetSnmp()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("subdomain_isolation", m.GetSubdomainIsolation()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("syslog", m.GetSyslog()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("timezone", m.GetTimezone()) + 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 *GhesGetSettings) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdminPassword sets the admin_password property value. The admin_password property +func (m *GhesGetSettings) SetAdminPassword(value *string)() { + m.admin_password = value +} +// SetAssets sets the assets property value. The assets property +func (m *GhesGetSettings) SetAssets(value *string)() { + m.assets = value +} +// SetAuthMode sets the auth_mode property value. The auth_mode property +func (m *GhesGetSettings) SetAuthMode(value *string)() { + m.auth_mode = value +} +// SetAvatar sets the avatar property value. The avatar property +func (m *GhesGetSettings) SetAvatar(value GhesGetSettings_avatarable)() { + m.avatar = value +} +// SetCas sets the cas property value. The cas property +func (m *GhesGetSettings) SetCas(value GhesGetSettings_casable)() { + m.cas = value +} +// SetCollectd sets the collectd property value. The collectd property +func (m *GhesGetSettings) SetCollectd(value GhesGetSettings_collectdable)() { + m.collectd = value +} +// SetConfigurationId sets the configuration_id property value. The configuration_id property +func (m *GhesGetSettings) SetConfigurationId(value *int32)() { + m.configuration_id = value +} +// SetConfigurationRunCount sets the configuration_run_count property value. The configuration_run_count property +func (m *GhesGetSettings) SetConfigurationRunCount(value *int32)() { + m.configuration_run_count = value +} +// SetCustomer sets the customer property value. The customer property +func (m *GhesGetSettings) SetCustomer(value GhesGetSettings_customerable)() { + m.customer = value +} +// SetExpireSessions sets the expire_sessions property value. The expire_sessions property +func (m *GhesGetSettings) SetExpireSessions(value *bool)() { + m.expire_sessions = value +} +// SetGithubHostname sets the github_hostname property value. The github_hostname property +func (m *GhesGetSettings) SetGithubHostname(value *string)() { + m.github_hostname = value +} +// SetGithubOauth sets the github_oauth property value. The github_oauth property +func (m *GhesGetSettings) SetGithubOauth(value GhesGetSettings_github_oauthable)() { + m.github_oauth = value +} +// SetGithubSsl sets the github_ssl property value. The github_ssl property +func (m *GhesGetSettings) SetGithubSsl(value GhesGetSettings_github_sslable)() { + m.github_ssl = value +} +// SetHttpProxy sets the http_proxy property value. The http_proxy property +func (m *GhesGetSettings) SetHttpProxy(value *string)() { + m.http_proxy = value +} +// SetIdenticonsHost sets the identicons_host property value. The identicons_host property +func (m *GhesGetSettings) SetIdenticonsHost(value *string)() { + m.identicons_host = value +} +// SetLdap sets the ldap property value. The ldap property +func (m *GhesGetSettings) SetLdap(value GhesGetSettings_ldapable)() { + m.ldap = value +} +// SetLicense sets the license property value. The license property +func (m *GhesGetSettings) SetLicense(value GhesGetSettings_licenseable)() { + m.license = value +} +// SetLoadBalancer sets the load_balancer property value. The load_balancer property +func (m *GhesGetSettings) SetLoadBalancer(value *string)() { + m.load_balancer = value +} +// SetMapping sets the mapping property value. The mapping property +func (m *GhesGetSettings) SetMapping(value GhesGetSettings_mappingable)() { + m.mapping = value +} +// SetNtp sets the ntp property value. The ntp property +func (m *GhesGetSettings) SetNtp(value GhesGetSettings_ntpable)() { + m.ntp = value +} +// SetPages sets the pages property value. The pages property +func (m *GhesGetSettings) SetPages(value GhesGetSettings_pagesable)() { + m.pages = value +} +// SetPrivateMode sets the private_mode property value. The private_mode property +func (m *GhesGetSettings) SetPrivateMode(value *bool)() { + m.private_mode = value +} +// SetPublicPages sets the public_pages property value. The public_pages property +func (m *GhesGetSettings) SetPublicPages(value *bool)() { + m.public_pages = value +} +// SetSaml sets the saml property value. The saml property +func (m *GhesGetSettings) SetSaml(value GhesGetSettings_samlable)() { + m.saml = value +} +// SetSignupEnabled sets the signup_enabled property value. The signup_enabled property +func (m *GhesGetSettings) SetSignupEnabled(value *bool)() { + m.signup_enabled = value +} +// SetSmtp sets the smtp property value. The smtp property +func (m *GhesGetSettings) SetSmtp(value GhesGetSettings_smtpable)() { + m.smtp = value +} +// SetSnmp sets the snmp property value. The snmp property +func (m *GhesGetSettings) SetSnmp(value GhesGetSettings_snmpable)() { + m.snmp = value +} +// SetSubdomainIsolation sets the subdomain_isolation property value. The subdomain_isolation property +func (m *GhesGetSettings) SetSubdomainIsolation(value *bool)() { + m.subdomain_isolation = value +} +// SetSyslog sets the syslog property value. The syslog property +func (m *GhesGetSettings) SetSyslog(value GhesGetSettings_syslogable)() { + m.syslog = value +} +// SetTimezone sets the timezone property value. The timezone property +func (m *GhesGetSettings) SetTimezone(value *string)() { + m.timezone = value +} +type GhesGetSettingsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdminPassword()(*string) + GetAssets()(*string) + GetAuthMode()(*string) + GetAvatar()(GhesGetSettings_avatarable) + GetCas()(GhesGetSettings_casable) + GetCollectd()(GhesGetSettings_collectdable) + GetConfigurationId()(*int32) + GetConfigurationRunCount()(*int32) + GetCustomer()(GhesGetSettings_customerable) + GetExpireSessions()(*bool) + GetGithubHostname()(*string) + GetGithubOauth()(GhesGetSettings_github_oauthable) + GetGithubSsl()(GhesGetSettings_github_sslable) + GetHttpProxy()(*string) + GetIdenticonsHost()(*string) + GetLdap()(GhesGetSettings_ldapable) + GetLicense()(GhesGetSettings_licenseable) + GetLoadBalancer()(*string) + GetMapping()(GhesGetSettings_mappingable) + GetNtp()(GhesGetSettings_ntpable) + GetPages()(GhesGetSettings_pagesable) + GetPrivateMode()(*bool) + GetPublicPages()(*bool) + GetSaml()(GhesGetSettings_samlable) + GetSignupEnabled()(*bool) + GetSmtp()(GhesGetSettings_smtpable) + GetSnmp()(GhesGetSettings_snmpable) + GetSubdomainIsolation()(*bool) + GetSyslog()(GhesGetSettings_syslogable) + GetTimezone()(*string) + SetAdminPassword(value *string)() + SetAssets(value *string)() + SetAuthMode(value *string)() + SetAvatar(value GhesGetSettings_avatarable)() + SetCas(value GhesGetSettings_casable)() + SetCollectd(value GhesGetSettings_collectdable)() + SetConfigurationId(value *int32)() + SetConfigurationRunCount(value *int32)() + SetCustomer(value GhesGetSettings_customerable)() + SetExpireSessions(value *bool)() + SetGithubHostname(value *string)() + SetGithubOauth(value GhesGetSettings_github_oauthable)() + SetGithubSsl(value GhesGetSettings_github_sslable)() + SetHttpProxy(value *string)() + SetIdenticonsHost(value *string)() + SetLdap(value GhesGetSettings_ldapable)() + SetLicense(value GhesGetSettings_licenseable)() + SetLoadBalancer(value *string)() + SetMapping(value GhesGetSettings_mappingable)() + SetNtp(value GhesGetSettings_ntpable)() + SetPages(value GhesGetSettings_pagesable)() + SetPrivateMode(value *bool)() + SetPublicPages(value *bool)() + SetSaml(value GhesGetSettings_samlable)() + SetSignupEnabled(value *bool)() + SetSmtp(value GhesGetSettings_smtpable)() + SetSnmp(value GhesGetSettings_snmpable)() + SetSubdomainIsolation(value *bool)() + SetSyslog(value GhesGetSettings_syslogable)() + SetTimezone(value *string)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_avatar.go b/pkg/github/models/ghes_get_settings_escaped_avatar.go new file mode 100644 index 00000000..9f837e77 --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_avatar.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_avatar 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 enabled property + enabled *bool + // The uri property + uri *string +} +// NewGhesGetSettings_avatar instantiates a new GhesGetSettings_avatar and sets the default values. +func NewGhesGetSettings_avatar()(*GhesGetSettings_avatar) { + m := &GhesGetSettings_avatar{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_avatarFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_avatarFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_avatar(), 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 *GhesGetSettings_avatar) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *GhesGetSettings_avatar) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetSettings_avatar) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["uri"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUri(val) + } + return nil + } + return res +} +// GetUri gets the uri property value. The uri property +// returns a *string when successful +func (m *GhesGetSettings_avatar) GetUri()(*string) { + return m.uri +} +// Serialize serializes information the current object +func (m *GhesGetSettings_avatar) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("uri", m.GetUri()) + 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 *GhesGetSettings_avatar) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *GhesGetSettings_avatar) SetEnabled(value *bool)() { + m.enabled = value +} +// SetUri sets the uri property value. The uri property +func (m *GhesGetSettings_avatar) SetUri(value *string)() { + m.uri = value +} +type GhesGetSettings_avatarable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetUri()(*string) + SetEnabled(value *bool)() + SetUri(value *string)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_cas.go b/pkg/github/models/ghes_get_settings_escaped_cas.go new file mode 100644 index 00000000..778d3b47 --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_cas.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_cas 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 url property + url *string +} +// NewGhesGetSettings_cas instantiates a new GhesGetSettings_cas and sets the default values. +func NewGhesGetSettings_cas()(*GhesGetSettings_cas) { + m := &GhesGetSettings_cas{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_casFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_casFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_cas(), 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 *GhesGetSettings_cas) 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 *GhesGetSettings_cas) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GhesGetSettings_cas) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GhesGetSettings_cas) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GhesGetSettings_cas) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetUrl sets the url property value. The url property +func (m *GhesGetSettings_cas) SetUrl(value *string)() { + m.url = value +} +type GhesGetSettings_casable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetUrl()(*string) + SetUrl(value *string)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_collectd.go b/pkg/github/models/ghes_get_settings_escaped_collectd.go new file mode 100644 index 00000000..e5bb097c --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_collectd.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_collectd 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 enabled property + enabled *bool + // The encryption property + encryption *string + // The password property + password *string + // The port property + port *int32 + // The server property + server *string + // The username property + username *string +} +// NewGhesGetSettings_collectd instantiates a new GhesGetSettings_collectd and sets the default values. +func NewGhesGetSettings_collectd()(*GhesGetSettings_collectd) { + m := &GhesGetSettings_collectd{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_collectdFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_collectdFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_collectd(), 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 *GhesGetSettings_collectd) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *GhesGetSettings_collectd) GetEnabled()(*bool) { + return m.enabled +} +// GetEncryption gets the encryption property value. The encryption property +// returns a *string when successful +func (m *GhesGetSettings_collectd) GetEncryption()(*string) { + return m.encryption +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetSettings_collectd) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["encryption"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncryption(val) + } + return nil + } + res["password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPassword(val) + } + return nil + } + res["port"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPort(val) + } + return nil + } + res["server"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetServer(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 + } + return res +} +// GetPassword gets the password property value. The password property +// returns a *string when successful +func (m *GhesGetSettings_collectd) GetPassword()(*string) { + return m.password +} +// GetPort gets the port property value. The port property +// returns a *int32 when successful +func (m *GhesGetSettings_collectd) GetPort()(*int32) { + return m.port +} +// GetServer gets the server property value. The server property +// returns a *string when successful +func (m *GhesGetSettings_collectd) GetServer()(*string) { + return m.server +} +// GetUsername gets the username property value. The username property +// returns a *string when successful +func (m *GhesGetSettings_collectd) GetUsername()(*string) { + return m.username +} +// Serialize serializes information the current object +func (m *GhesGetSettings_collectd) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("encryption", m.GetEncryption()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("password", m.GetPassword()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("port", m.GetPort()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("server", m.GetServer()) + 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 *GhesGetSettings_collectd) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *GhesGetSettings_collectd) SetEnabled(value *bool)() { + m.enabled = value +} +// SetEncryption sets the encryption property value. The encryption property +func (m *GhesGetSettings_collectd) SetEncryption(value *string)() { + m.encryption = value +} +// SetPassword sets the password property value. The password property +func (m *GhesGetSettings_collectd) SetPassword(value *string)() { + m.password = value +} +// SetPort sets the port property value. The port property +func (m *GhesGetSettings_collectd) SetPort(value *int32)() { + m.port = value +} +// SetServer sets the server property value. The server property +func (m *GhesGetSettings_collectd) SetServer(value *string)() { + m.server = value +} +// SetUsername sets the username property value. The username property +func (m *GhesGetSettings_collectd) SetUsername(value *string)() { + m.username = value +} +type GhesGetSettings_collectdable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetEncryption()(*string) + GetPassword()(*string) + GetPort()(*int32) + GetServer()(*string) + GetUsername()(*string) + SetEnabled(value *bool)() + SetEncryption(value *string)() + SetPassword(value *string)() + SetPort(value *int32)() + SetServer(value *string)() + SetUsername(value *string)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_customer.go b/pkg/github/models/ghes_get_settings_escaped_customer.go new file mode 100644 index 00000000..064a90a5 --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_customer.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_customer 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 email property + email *string + // The name property + name *string + // The public_key_data property + public_key_data *string + // The secret_key_data property + secret_key_data *string + // The uuid property + uuid *string +} +// NewGhesGetSettings_customer instantiates a new GhesGetSettings_customer and sets the default values. +func NewGhesGetSettings_customer()(*GhesGetSettings_customer) { + m := &GhesGetSettings_customer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_customerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_customerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_customer(), 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 *GhesGetSettings_customer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *GhesGetSettings_customer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetSettings_customer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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["public_key_data"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicKeyData(val) + } + return nil + } + res["secret_key_data"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretKeyData(val) + } + return nil + } + res["uuid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUuid(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *GhesGetSettings_customer) GetName()(*string) { + return m.name +} +// GetPublicKeyData gets the public_key_data property value. The public_key_data property +// returns a *string when successful +func (m *GhesGetSettings_customer) GetPublicKeyData()(*string) { + return m.public_key_data +} +// GetSecretKeyData gets the secret_key_data property value. The secret_key_data property +// returns a *string when successful +func (m *GhesGetSettings_customer) GetSecretKeyData()(*string) { + return m.secret_key_data +} +// GetUuid gets the uuid property value. The uuid property +// returns a *string when successful +func (m *GhesGetSettings_customer) GetUuid()(*string) { + return m.uuid +} +// Serialize serializes information the current object +func (m *GhesGetSettings_customer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_key_data", m.GetPublicKeyData()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_key_data", m.GetSecretKeyData()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("uuid", m.GetUuid()) + 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 *GhesGetSettings_customer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email property +func (m *GhesGetSettings_customer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name property +func (m *GhesGetSettings_customer) SetName(value *string)() { + m.name = value +} +// SetPublicKeyData sets the public_key_data property value. The public_key_data property +func (m *GhesGetSettings_customer) SetPublicKeyData(value *string)() { + m.public_key_data = value +} +// SetSecretKeyData sets the secret_key_data property value. The secret_key_data property +func (m *GhesGetSettings_customer) SetSecretKeyData(value *string)() { + m.secret_key_data = value +} +// SetUuid sets the uuid property value. The uuid property +func (m *GhesGetSettings_customer) SetUuid(value *string)() { + m.uuid = value +} +type GhesGetSettings_customerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + GetPublicKeyData()(*string) + GetSecretKeyData()(*string) + GetUuid()(*string) + SetEmail(value *string)() + SetName(value *string)() + SetPublicKeyData(value *string)() + SetSecretKeyData(value *string)() + SetUuid(value *string)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_github_escaped_oauth.go b/pkg/github/models/ghes_get_settings_escaped_github_escaped_oauth.go new file mode 100644 index 00000000..b94db32e --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_github_escaped_oauth.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_github_oauth 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 client_id property + client_id *string + // The client_secret property + client_secret *string + // The organization_name property + organization_name *string + // The organization_team property + organization_team *string +} +// NewGhesGetSettings_github_oauth instantiates a new GhesGetSettings_github_oauth and sets the default values. +func NewGhesGetSettings_github_oauth()(*GhesGetSettings_github_oauth) { + m := &GhesGetSettings_github_oauth{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_github_oauthFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_github_oauthFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_github_oauth(), 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 *GhesGetSettings_github_oauth) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientId gets the client_id property value. The client_id property +// returns a *string when successful +func (m *GhesGetSettings_github_oauth) GetClientId()(*string) { + return m.client_id +} +// GetClientSecret gets the client_secret property value. The client_secret property +// returns a *string when successful +func (m *GhesGetSettings_github_oauth) GetClientSecret()(*string) { + return m.client_secret +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetSettings_github_oauth) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientId(val) + } + return nil + } + res["client_secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientSecret(val) + } + return nil + } + res["organization_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationName(val) + } + return nil + } + res["organization_team"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationTeam(val) + } + return nil + } + return res +} +// GetOrganizationName gets the organization_name property value. The organization_name property +// returns a *string when successful +func (m *GhesGetSettings_github_oauth) GetOrganizationName()(*string) { + return m.organization_name +} +// GetOrganizationTeam gets the organization_team property value. The organization_team property +// returns a *string when successful +func (m *GhesGetSettings_github_oauth) GetOrganizationTeam()(*string) { + return m.organization_team +} +// Serialize serializes information the current object +func (m *GhesGetSettings_github_oauth) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_id", m.GetClientId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("client_secret", m.GetClientSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_name", m.GetOrganizationName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_team", m.GetOrganizationTeam()) + 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 *GhesGetSettings_github_oauth) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientId sets the client_id property value. The client_id property +func (m *GhesGetSettings_github_oauth) SetClientId(value *string)() { + m.client_id = value +} +// SetClientSecret sets the client_secret property value. The client_secret property +func (m *GhesGetSettings_github_oauth) SetClientSecret(value *string)() { + m.client_secret = value +} +// SetOrganizationName sets the organization_name property value. The organization_name property +func (m *GhesGetSettings_github_oauth) SetOrganizationName(value *string)() { + m.organization_name = value +} +// SetOrganizationTeam sets the organization_team property value. The organization_team property +func (m *GhesGetSettings_github_oauth) SetOrganizationTeam(value *string)() { + m.organization_team = value +} +type GhesGetSettings_github_oauthable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientId()(*string) + GetClientSecret()(*string) + GetOrganizationName()(*string) + GetOrganizationTeam()(*string) + SetClientId(value *string)() + SetClientSecret(value *string)() + SetOrganizationName(value *string)() + SetOrganizationTeam(value *string)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_github_escaped_ssl.go b/pkg/github/models/ghes_get_settings_escaped_github_escaped_ssl.go new file mode 100644 index 00000000..0a713dbe --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_github_escaped_ssl.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_github_ssl 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 cert property + cert *string + // The enabled property + enabled *bool + // The key property + key *string +} +// NewGhesGetSettings_github_ssl instantiates a new GhesGetSettings_github_ssl and sets the default values. +func NewGhesGetSettings_github_ssl()(*GhesGetSettings_github_ssl) { + m := &GhesGetSettings_github_ssl{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_github_sslFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_github_sslFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_github_ssl(), 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 *GhesGetSettings_github_ssl) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCert gets the cert property value. The cert property +// returns a *string when successful +func (m *GhesGetSettings_github_ssl) GetCert()(*string) { + return m.cert +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *GhesGetSettings_github_ssl) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetSettings_github_ssl) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cert"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCert(val) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *GhesGetSettings_github_ssl) GetKey()(*string) { + return m.key +} +// Serialize serializes information the current object +func (m *GhesGetSettings_github_ssl) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("cert", m.GetCert()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + 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 *GhesGetSettings_github_ssl) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCert sets the cert property value. The cert property +func (m *GhesGetSettings_github_ssl) SetCert(value *string)() { + m.cert = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *GhesGetSettings_github_ssl) SetEnabled(value *bool)() { + m.enabled = value +} +// SetKey sets the key property value. The key property +func (m *GhesGetSettings_github_ssl) SetKey(value *string)() { + m.key = value +} +type GhesGetSettings_github_sslable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCert()(*string) + GetEnabled()(*bool) + GetKey()(*string) + SetCert(value *string)() + SetEnabled(value *bool)() + SetKey(value *string)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_ldap.go b/pkg/github/models/ghes_get_settings_escaped_ldap.go new file mode 100644 index 00000000..6d95ba88 --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_ldap.go @@ -0,0 +1,643 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_ldap 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 admin_group property + admin_group *string + // The base property + base []string + // The bind_dn property + bind_dn *string + // The host property + host *string + // The method property + method *string + // The password property + password *string + // The port property + port *int32 + // The posix_support property + posix_support *bool + // The profile property + profile GhesGetSettings_ldap_profileable + // The reconciliation property + reconciliation GhesGetSettings_ldap_reconciliationable + // The recursive_group_search property + recursive_group_search *bool + // The search_strategy property + search_strategy *string + // The sync_enabled property + sync_enabled *bool + // The team_sync_interval property + team_sync_interval *int32 + // The uid property + uid *string + // The user_groups property + user_groups []string + // The user_sync_emails property + user_sync_emails *bool + // The user_sync_interval property + user_sync_interval *int32 + // The user_sync_keys property + user_sync_keys *bool + // The virtual_attribute_enabled property + virtual_attribute_enabled *bool +} +// NewGhesGetSettings_ldap instantiates a new GhesGetSettings_ldap and sets the default values. +func NewGhesGetSettings_ldap()(*GhesGetSettings_ldap) { + m := &GhesGetSettings_ldap{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_ldapFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_ldapFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_ldap(), 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 *GhesGetSettings_ldap) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdminGroup gets the admin_group property value. The admin_group property +// returns a *string when successful +func (m *GhesGetSettings_ldap) GetAdminGroup()(*string) { + return m.admin_group +} +// GetBase gets the base property value. The base property +// returns a []string when successful +func (m *GhesGetSettings_ldap) GetBase()([]string) { + return m.base +} +// GetBindDn gets the bind_dn property value. The bind_dn property +// returns a *string when successful +func (m *GhesGetSettings_ldap) GetBindDn()(*string) { + return m.bind_dn +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetSettings_ldap) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin_group"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAdminGroup(val) + } + return nil + } + res["base"] = 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.SetBase(res) + } + return nil + } + res["bind_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBindDn(val) + } + return nil + } + res["host"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHost(val) + } + return nil + } + res["method"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMethod(val) + } + return nil + } + res["password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPassword(val) + } + return nil + } + res["port"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPort(val) + } + return nil + } + res["posix_support"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPosixSupport(val) + } + return nil + } + res["profile"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_ldap_profileFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProfile(val.(GhesGetSettings_ldap_profileable)) + } + return nil + } + res["reconciliation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesGetSettings_ldap_reconciliationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReconciliation(val.(GhesGetSettings_ldap_reconciliationable)) + } + return nil + } + res["recursive_group_search"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRecursiveGroupSearch(val) + } + return nil + } + res["search_strategy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSearchStrategy(val) + } + return nil + } + res["sync_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSyncEnabled(val) + } + return nil + } + res["team_sync_interval"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTeamSyncInterval(val) + } + return nil + } + res["uid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUid(val) + } + return nil + } + res["user_groups"] = 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.SetUserGroups(res) + } + return nil + } + res["user_sync_emails"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUserSyncEmails(val) + } + return nil + } + res["user_sync_interval"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUserSyncInterval(val) + } + return nil + } + res["user_sync_keys"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUserSyncKeys(val) + } + return nil + } + res["virtual_attribute_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVirtualAttributeEnabled(val) + } + return nil + } + return res +} +// GetHost gets the host property value. The host property +// returns a *string when successful +func (m *GhesGetSettings_ldap) GetHost()(*string) { + return m.host +} +// GetMethod gets the method property value. The method property +// returns a *string when successful +func (m *GhesGetSettings_ldap) GetMethod()(*string) { + return m.method +} +// GetPassword gets the password property value. The password property +// returns a *string when successful +func (m *GhesGetSettings_ldap) GetPassword()(*string) { + return m.password +} +// GetPort gets the port property value. The port property +// returns a *int32 when successful +func (m *GhesGetSettings_ldap) GetPort()(*int32) { + return m.port +} +// GetPosixSupport gets the posix_support property value. The posix_support property +// returns a *bool when successful +func (m *GhesGetSettings_ldap) GetPosixSupport()(*bool) { + return m.posix_support +} +// GetProfile gets the profile property value. The profile property +// returns a GhesGetSettings_ldap_profileable when successful +func (m *GhesGetSettings_ldap) GetProfile()(GhesGetSettings_ldap_profileable) { + return m.profile +} +// GetReconciliation gets the reconciliation property value. The reconciliation property +// returns a GhesGetSettings_ldap_reconciliationable when successful +func (m *GhesGetSettings_ldap) GetReconciliation()(GhesGetSettings_ldap_reconciliationable) { + return m.reconciliation +} +// GetRecursiveGroupSearch gets the recursive_group_search property value. The recursive_group_search property +// returns a *bool when successful +func (m *GhesGetSettings_ldap) GetRecursiveGroupSearch()(*bool) { + return m.recursive_group_search +} +// GetSearchStrategy gets the search_strategy property value. The search_strategy property +// returns a *string when successful +func (m *GhesGetSettings_ldap) GetSearchStrategy()(*string) { + return m.search_strategy +} +// GetSyncEnabled gets the sync_enabled property value. The sync_enabled property +// returns a *bool when successful +func (m *GhesGetSettings_ldap) GetSyncEnabled()(*bool) { + return m.sync_enabled +} +// GetTeamSyncInterval gets the team_sync_interval property value. The team_sync_interval property +// returns a *int32 when successful +func (m *GhesGetSettings_ldap) GetTeamSyncInterval()(*int32) { + return m.team_sync_interval +} +// GetUid gets the uid property value. The uid property +// returns a *string when successful +func (m *GhesGetSettings_ldap) GetUid()(*string) { + return m.uid +} +// GetUserGroups gets the user_groups property value. The user_groups property +// returns a []string when successful +func (m *GhesGetSettings_ldap) GetUserGroups()([]string) { + return m.user_groups +} +// GetUserSyncEmails gets the user_sync_emails property value. The user_sync_emails property +// returns a *bool when successful +func (m *GhesGetSettings_ldap) GetUserSyncEmails()(*bool) { + return m.user_sync_emails +} +// GetUserSyncInterval gets the user_sync_interval property value. The user_sync_interval property +// returns a *int32 when successful +func (m *GhesGetSettings_ldap) GetUserSyncInterval()(*int32) { + return m.user_sync_interval +} +// GetUserSyncKeys gets the user_sync_keys property value. The user_sync_keys property +// returns a *bool when successful +func (m *GhesGetSettings_ldap) GetUserSyncKeys()(*bool) { + return m.user_sync_keys +} +// GetVirtualAttributeEnabled gets the virtual_attribute_enabled property value. The virtual_attribute_enabled property +// returns a *bool when successful +func (m *GhesGetSettings_ldap) GetVirtualAttributeEnabled()(*bool) { + return m.virtual_attribute_enabled +} +// Serialize serializes information the current object +func (m *GhesGetSettings_ldap) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("admin_group", m.GetAdminGroup()) + if err != nil { + return err + } + } + if m.GetBase() != nil { + err := writer.WriteCollectionOfStringValues("base", m.GetBase()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("bind_dn", m.GetBindDn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("host", m.GetHost()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("method", m.GetMethod()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("password", m.GetPassword()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("port", m.GetPort()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("posix_support", m.GetPosixSupport()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("profile", m.GetProfile()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reconciliation", m.GetReconciliation()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("recursive_group_search", m.GetRecursiveGroupSearch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("search_strategy", m.GetSearchStrategy()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("sync_enabled", m.GetSyncEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("team_sync_interval", m.GetTeamSyncInterval()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("uid", m.GetUid()) + if err != nil { + return err + } + } + if m.GetUserGroups() != nil { + err := writer.WriteCollectionOfStringValues("user_groups", m.GetUserGroups()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("user_sync_emails", m.GetUserSyncEmails()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("user_sync_interval", m.GetUserSyncInterval()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("user_sync_keys", m.GetUserSyncKeys()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("virtual_attribute_enabled", m.GetVirtualAttributeEnabled()) + 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 *GhesGetSettings_ldap) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdminGroup sets the admin_group property value. The admin_group property +func (m *GhesGetSettings_ldap) SetAdminGroup(value *string)() { + m.admin_group = value +} +// SetBase sets the base property value. The base property +func (m *GhesGetSettings_ldap) SetBase(value []string)() { + m.base = value +} +// SetBindDn sets the bind_dn property value. The bind_dn property +func (m *GhesGetSettings_ldap) SetBindDn(value *string)() { + m.bind_dn = value +} +// SetHost sets the host property value. The host property +func (m *GhesGetSettings_ldap) SetHost(value *string)() { + m.host = value +} +// SetMethod sets the method property value. The method property +func (m *GhesGetSettings_ldap) SetMethod(value *string)() { + m.method = value +} +// SetPassword sets the password property value. The password property +func (m *GhesGetSettings_ldap) SetPassword(value *string)() { + m.password = value +} +// SetPort sets the port property value. The port property +func (m *GhesGetSettings_ldap) SetPort(value *int32)() { + m.port = value +} +// SetPosixSupport sets the posix_support property value. The posix_support property +func (m *GhesGetSettings_ldap) SetPosixSupport(value *bool)() { + m.posix_support = value +} +// SetProfile sets the profile property value. The profile property +func (m *GhesGetSettings_ldap) SetProfile(value GhesGetSettings_ldap_profileable)() { + m.profile = value +} +// SetReconciliation sets the reconciliation property value. The reconciliation property +func (m *GhesGetSettings_ldap) SetReconciliation(value GhesGetSettings_ldap_reconciliationable)() { + m.reconciliation = value +} +// SetRecursiveGroupSearch sets the recursive_group_search property value. The recursive_group_search property +func (m *GhesGetSettings_ldap) SetRecursiveGroupSearch(value *bool)() { + m.recursive_group_search = value +} +// SetSearchStrategy sets the search_strategy property value. The search_strategy property +func (m *GhesGetSettings_ldap) SetSearchStrategy(value *string)() { + m.search_strategy = value +} +// SetSyncEnabled sets the sync_enabled property value. The sync_enabled property +func (m *GhesGetSettings_ldap) SetSyncEnabled(value *bool)() { + m.sync_enabled = value +} +// SetTeamSyncInterval sets the team_sync_interval property value. The team_sync_interval property +func (m *GhesGetSettings_ldap) SetTeamSyncInterval(value *int32)() { + m.team_sync_interval = value +} +// SetUid sets the uid property value. The uid property +func (m *GhesGetSettings_ldap) SetUid(value *string)() { + m.uid = value +} +// SetUserGroups sets the user_groups property value. The user_groups property +func (m *GhesGetSettings_ldap) SetUserGroups(value []string)() { + m.user_groups = value +} +// SetUserSyncEmails sets the user_sync_emails property value. The user_sync_emails property +func (m *GhesGetSettings_ldap) SetUserSyncEmails(value *bool)() { + m.user_sync_emails = value +} +// SetUserSyncInterval sets the user_sync_interval property value. The user_sync_interval property +func (m *GhesGetSettings_ldap) SetUserSyncInterval(value *int32)() { + m.user_sync_interval = value +} +// SetUserSyncKeys sets the user_sync_keys property value. The user_sync_keys property +func (m *GhesGetSettings_ldap) SetUserSyncKeys(value *bool)() { + m.user_sync_keys = value +} +// SetVirtualAttributeEnabled sets the virtual_attribute_enabled property value. The virtual_attribute_enabled property +func (m *GhesGetSettings_ldap) SetVirtualAttributeEnabled(value *bool)() { + m.virtual_attribute_enabled = value +} +type GhesGetSettings_ldapable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdminGroup()(*string) + GetBase()([]string) + GetBindDn()(*string) + GetHost()(*string) + GetMethod()(*string) + GetPassword()(*string) + GetPort()(*int32) + GetPosixSupport()(*bool) + GetProfile()(GhesGetSettings_ldap_profileable) + GetReconciliation()(GhesGetSettings_ldap_reconciliationable) + GetRecursiveGroupSearch()(*bool) + GetSearchStrategy()(*string) + GetSyncEnabled()(*bool) + GetTeamSyncInterval()(*int32) + GetUid()(*string) + GetUserGroups()([]string) + GetUserSyncEmails()(*bool) + GetUserSyncInterval()(*int32) + GetUserSyncKeys()(*bool) + GetVirtualAttributeEnabled()(*bool) + SetAdminGroup(value *string)() + SetBase(value []string)() + SetBindDn(value *string)() + SetHost(value *string)() + SetMethod(value *string)() + SetPassword(value *string)() + SetPort(value *int32)() + SetPosixSupport(value *bool)() + SetProfile(value GhesGetSettings_ldap_profileable)() + SetReconciliation(value GhesGetSettings_ldap_reconciliationable)() + SetRecursiveGroupSearch(value *bool)() + SetSearchStrategy(value *string)() + SetSyncEnabled(value *bool)() + SetTeamSyncInterval(value *int32)() + SetUid(value *string)() + SetUserGroups(value []string)() + SetUserSyncEmails(value *bool)() + SetUserSyncInterval(value *int32)() + SetUserSyncKeys(value *bool)() + SetVirtualAttributeEnabled(value *bool)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_ldap_escaped_profile.go b/pkg/github/models/ghes_get_settings_escaped_ldap_escaped_profile.go new file mode 100644 index 00000000..23cff02f --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_ldap_escaped_profile.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_ldap_profile 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 key property + key *string + // The mail property + mail *string + // The name property + name *string + // The uid property + uid *string +} +// NewGhesGetSettings_ldap_profile instantiates a new GhesGetSettings_ldap_profile and sets the default values. +func NewGhesGetSettings_ldap_profile()(*GhesGetSettings_ldap_profile) { + m := &GhesGetSettings_ldap_profile{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_ldap_profileFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_ldap_profileFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_ldap_profile(), 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 *GhesGetSettings_ldap_profile) 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 *GhesGetSettings_ldap_profile) 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["mail"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMail(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["uid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUid(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *GhesGetSettings_ldap_profile) GetKey()(*string) { + return m.key +} +// GetMail gets the mail property value. The mail property +// returns a *string when successful +func (m *GhesGetSettings_ldap_profile) GetMail()(*string) { + return m.mail +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *GhesGetSettings_ldap_profile) GetName()(*string) { + return m.name +} +// GetUid gets the uid property value. The uid property +// returns a *string when successful +func (m *GhesGetSettings_ldap_profile) GetUid()(*string) { + return m.uid +} +// Serialize serializes information the current object +func (m *GhesGetSettings_ldap_profile) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mail", m.GetMail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("uid", m.GetUid()) + 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 *GhesGetSettings_ldap_profile) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The key property +func (m *GhesGetSettings_ldap_profile) SetKey(value *string)() { + m.key = value +} +// SetMail sets the mail property value. The mail property +func (m *GhesGetSettings_ldap_profile) SetMail(value *string)() { + m.mail = value +} +// SetName sets the name property value. The name property +func (m *GhesGetSettings_ldap_profile) SetName(value *string)() { + m.name = value +} +// SetUid sets the uid property value. The uid property +func (m *GhesGetSettings_ldap_profile) SetUid(value *string)() { + m.uid = value +} +type GhesGetSettings_ldap_profileable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetMail()(*string) + GetName()(*string) + GetUid()(*string) + SetKey(value *string)() + SetMail(value *string)() + SetName(value *string)() + SetUid(value *string)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_ldap_escaped_reconciliation.go b/pkg/github/models/ghes_get_settings_escaped_ldap_escaped_reconciliation.go new file mode 100644 index 00000000..da4306ea --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_ldap_escaped_reconciliation.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_ldap_reconciliation 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 org property + org *string + // The user property + user *string +} +// NewGhesGetSettings_ldap_reconciliation instantiates a new GhesGetSettings_ldap_reconciliation and sets the default values. +func NewGhesGetSettings_ldap_reconciliation()(*GhesGetSettings_ldap_reconciliation) { + m := &GhesGetSettings_ldap_reconciliation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_ldap_reconciliationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_ldap_reconciliationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_ldap_reconciliation(), 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 *GhesGetSettings_ldap_reconciliation) 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 *GhesGetSettings_ldap_reconciliation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["org"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrg(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUser(val) + } + return nil + } + return res +} +// GetOrg gets the org property value. The org property +// returns a *string when successful +func (m *GhesGetSettings_ldap_reconciliation) GetOrg()(*string) { + return m.org +} +// GetUser gets the user property value. The user property +// returns a *string when successful +func (m *GhesGetSettings_ldap_reconciliation) GetUser()(*string) { + return m.user +} +// Serialize serializes information the current object +func (m *GhesGetSettings_ldap_reconciliation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("org", m.GetOrg()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user", m.GetUser()) + 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 *GhesGetSettings_ldap_reconciliation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetOrg sets the org property value. The org property +func (m *GhesGetSettings_ldap_reconciliation) SetOrg(value *string)() { + m.org = value +} +// SetUser sets the user property value. The user property +func (m *GhesGetSettings_ldap_reconciliation) SetUser(value *string)() { + m.user = value +} +type GhesGetSettings_ldap_reconciliationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOrg()(*string) + GetUser()(*string) + SetOrg(value *string)() + SetUser(value *string)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_license.go b/pkg/github/models/ghes_get_settings_escaped_license.go new file mode 100644 index 00000000..1f8381bc --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_license.go @@ -0,0 +1,283 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_license 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 cluster_support property + cluster_support *bool + // The evaluation property + evaluation *bool + // The expire_at property + expire_at *string + // The perpetual property + perpetual *bool + // The seats property + seats *int32 + // The ssh_allowed property + ssh_allowed *bool + // The support_key property + support_key *string + // The unlimited_seating property + unlimited_seating *bool +} +// NewGhesGetSettings_license instantiates a new GhesGetSettings_license and sets the default values. +func NewGhesGetSettings_license()(*GhesGetSettings_license) { + m := &GhesGetSettings_license{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_licenseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_licenseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_license(), 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 *GhesGetSettings_license) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClusterSupport gets the cluster_support property value. The cluster_support property +// returns a *bool when successful +func (m *GhesGetSettings_license) GetClusterSupport()(*bool) { + return m.cluster_support +} +// GetEvaluation gets the evaluation property value. The evaluation property +// returns a *bool when successful +func (m *GhesGetSettings_license) GetEvaluation()(*bool) { + return m.evaluation +} +// GetExpireAt gets the expire_at property value. The expire_at property +// returns a *string when successful +func (m *GhesGetSettings_license) GetExpireAt()(*string) { + return m.expire_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetSettings_license) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cluster_support"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetClusterSupport(val) + } + return nil + } + res["evaluation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEvaluation(val) + } + return nil + } + res["expire_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExpireAt(val) + } + return nil + } + res["perpetual"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPerpetual(val) + } + return nil + } + res["seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSeats(val) + } + return nil + } + res["ssh_allowed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSshAllowed(val) + } + return nil + } + res["support_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSupportKey(val) + } + return nil + } + res["unlimited_seating"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUnlimitedSeating(val) + } + return nil + } + return res +} +// GetPerpetual gets the perpetual property value. The perpetual property +// returns a *bool when successful +func (m *GhesGetSettings_license) GetPerpetual()(*bool) { + return m.perpetual +} +// GetSeats gets the seats property value. The seats property +// returns a *int32 when successful +func (m *GhesGetSettings_license) GetSeats()(*int32) { + return m.seats +} +// GetSshAllowed gets the ssh_allowed property value. The ssh_allowed property +// returns a *bool when successful +func (m *GhesGetSettings_license) GetSshAllowed()(*bool) { + return m.ssh_allowed +} +// GetSupportKey gets the support_key property value. The support_key property +// returns a *string when successful +func (m *GhesGetSettings_license) GetSupportKey()(*string) { + return m.support_key +} +// GetUnlimitedSeating gets the unlimited_seating property value. The unlimited_seating property +// returns a *bool when successful +func (m *GhesGetSettings_license) GetUnlimitedSeating()(*bool) { + return m.unlimited_seating +} +// Serialize serializes information the current object +func (m *GhesGetSettings_license) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("cluster_support", m.GetClusterSupport()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("evaluation", m.GetEvaluation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("expire_at", m.GetExpireAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("perpetual", m.GetPerpetual()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("seats", m.GetSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("ssh_allowed", m.GetSshAllowed()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("support_key", m.GetSupportKey()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("unlimited_seating", m.GetUnlimitedSeating()) + 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 *GhesGetSettings_license) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClusterSupport sets the cluster_support property value. The cluster_support property +func (m *GhesGetSettings_license) SetClusterSupport(value *bool)() { + m.cluster_support = value +} +// SetEvaluation sets the evaluation property value. The evaluation property +func (m *GhesGetSettings_license) SetEvaluation(value *bool)() { + m.evaluation = value +} +// SetExpireAt sets the expire_at property value. The expire_at property +func (m *GhesGetSettings_license) SetExpireAt(value *string)() { + m.expire_at = value +} +// SetPerpetual sets the perpetual property value. The perpetual property +func (m *GhesGetSettings_license) SetPerpetual(value *bool)() { + m.perpetual = value +} +// SetSeats sets the seats property value. The seats property +func (m *GhesGetSettings_license) SetSeats(value *int32)() { + m.seats = value +} +// SetSshAllowed sets the ssh_allowed property value. The ssh_allowed property +func (m *GhesGetSettings_license) SetSshAllowed(value *bool)() { + m.ssh_allowed = value +} +// SetSupportKey sets the support_key property value. The support_key property +func (m *GhesGetSettings_license) SetSupportKey(value *string)() { + m.support_key = value +} +// SetUnlimitedSeating sets the unlimited_seating property value. The unlimited_seating property +func (m *GhesGetSettings_license) SetUnlimitedSeating(value *bool)() { + m.unlimited_seating = value +} +type GhesGetSettings_licenseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClusterSupport()(*bool) + GetEvaluation()(*bool) + GetExpireAt()(*string) + GetPerpetual()(*bool) + GetSeats()(*int32) + GetSshAllowed()(*bool) + GetSupportKey()(*string) + GetUnlimitedSeating()(*bool) + SetClusterSupport(value *bool)() + SetEvaluation(value *bool)() + SetExpireAt(value *string)() + SetPerpetual(value *bool)() + SetSeats(value *int32)() + SetSshAllowed(value *bool)() + SetSupportKey(value *string)() + SetUnlimitedSeating(value *bool)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_mapping.go b/pkg/github/models/ghes_get_settings_escaped_mapping.go new file mode 100644 index 00000000..9fb6177c --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_mapping.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_mapping 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 basemap property + basemap *string + // The enabled property + enabled *bool + // The tileserver property + tileserver *string + // The token property + token *string +} +// NewGhesGetSettings_mapping instantiates a new GhesGetSettings_mapping and sets the default values. +func NewGhesGetSettings_mapping()(*GhesGetSettings_mapping) { + m := &GhesGetSettings_mapping{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_mappingFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_mappingFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_mapping(), 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 *GhesGetSettings_mapping) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBasemap gets the basemap property value. The basemap property +// returns a *string when successful +func (m *GhesGetSettings_mapping) GetBasemap()(*string) { + return m.basemap +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *GhesGetSettings_mapping) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetSettings_mapping) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["basemap"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBasemap(val) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["tileserver"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTileserver(val) + } + return nil + } + res["token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetToken(val) + } + return nil + } + return res +} +// GetTileserver gets the tileserver property value. The tileserver property +// returns a *string when successful +func (m *GhesGetSettings_mapping) GetTileserver()(*string) { + return m.tileserver +} +// GetToken gets the token property value. The token property +// returns a *string when successful +func (m *GhesGetSettings_mapping) GetToken()(*string) { + return m.token +} +// Serialize serializes information the current object +func (m *GhesGetSettings_mapping) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("basemap", m.GetBasemap()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tileserver", m.GetTileserver()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token", m.GetToken()) + 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 *GhesGetSettings_mapping) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBasemap sets the basemap property value. The basemap property +func (m *GhesGetSettings_mapping) SetBasemap(value *string)() { + m.basemap = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *GhesGetSettings_mapping) SetEnabled(value *bool)() { + m.enabled = value +} +// SetTileserver sets the tileserver property value. The tileserver property +func (m *GhesGetSettings_mapping) SetTileserver(value *string)() { + m.tileserver = value +} +// SetToken sets the token property value. The token property +func (m *GhesGetSettings_mapping) SetToken(value *string)() { + m.token = value +} +type GhesGetSettings_mappingable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBasemap()(*string) + GetEnabled()(*bool) + GetTileserver()(*string) + GetToken()(*string) + SetBasemap(value *string)() + SetEnabled(value *bool)() + SetTileserver(value *string)() + SetToken(value *string)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_ntp.go b/pkg/github/models/ghes_get_settings_escaped_ntp.go new file mode 100644 index 00000000..3785a4af --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_ntp.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_ntp 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 primary_server property + primary_server *string + // The secondary_server property + secondary_server *string +} +// NewGhesGetSettings_ntp instantiates a new GhesGetSettings_ntp and sets the default values. +func NewGhesGetSettings_ntp()(*GhesGetSettings_ntp) { + m := &GhesGetSettings_ntp{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_ntpFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_ntpFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_ntp(), 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 *GhesGetSettings_ntp) 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 *GhesGetSettings_ntp) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["primary_server"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPrimaryServer(val) + } + return nil + } + res["secondary_server"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecondaryServer(val) + } + return nil + } + return res +} +// GetPrimaryServer gets the primary_server property value. The primary_server property +// returns a *string when successful +func (m *GhesGetSettings_ntp) GetPrimaryServer()(*string) { + return m.primary_server +} +// GetSecondaryServer gets the secondary_server property value. The secondary_server property +// returns a *string when successful +func (m *GhesGetSettings_ntp) GetSecondaryServer()(*string) { + return m.secondary_server +} +// Serialize serializes information the current object +func (m *GhesGetSettings_ntp) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("primary_server", m.GetPrimaryServer()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secondary_server", m.GetSecondaryServer()) + 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 *GhesGetSettings_ntp) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPrimaryServer sets the primary_server property value. The primary_server property +func (m *GhesGetSettings_ntp) SetPrimaryServer(value *string)() { + m.primary_server = value +} +// SetSecondaryServer sets the secondary_server property value. The secondary_server property +func (m *GhesGetSettings_ntp) SetSecondaryServer(value *string)() { + m.secondary_server = value +} +type GhesGetSettings_ntpable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPrimaryServer()(*string) + GetSecondaryServer()(*string) + SetPrimaryServer(value *string)() + SetSecondaryServer(value *string)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_pages.go b/pkg/github/models/ghes_get_settings_escaped_pages.go new file mode 100644 index 00000000..d3be5384 --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_pages.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_pages 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 enabled property + enabled *bool +} +// NewGhesGetSettings_pages instantiates a new GhesGetSettings_pages and sets the default values. +func NewGhesGetSettings_pages()(*GhesGetSettings_pages) { + m := &GhesGetSettings_pages{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_pagesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_pagesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_pages(), 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 *GhesGetSettings_pages) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *GhesGetSettings_pages) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetSettings_pages) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *GhesGetSettings_pages) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + 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 *GhesGetSettings_pages) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *GhesGetSettings_pages) SetEnabled(value *bool)() { + m.enabled = value +} +type GhesGetSettings_pagesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_saml.go b/pkg/github/models/ghes_get_settings_escaped_saml.go new file mode 100644 index 00000000..c7e28bb7 --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_saml.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_saml 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 certificate property + certificate *string + // The certificate_path property + certificate_path *string + // The disable_admin_demote property + disable_admin_demote *bool + // The idp_initiated_sso property + idp_initiated_sso *bool + // The issuer property + issuer *string + // The sso_url property + sso_url *string +} +// NewGhesGetSettings_saml instantiates a new GhesGetSettings_saml and sets the default values. +func NewGhesGetSettings_saml()(*GhesGetSettings_saml) { + m := &GhesGetSettings_saml{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_samlFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_samlFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_saml(), 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 *GhesGetSettings_saml) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCertificate gets the certificate property value. The certificate property +// returns a *string when successful +func (m *GhesGetSettings_saml) GetCertificate()(*string) { + return m.certificate +} +// GetCertificatePath gets the certificate_path property value. The certificate_path property +// returns a *string when successful +func (m *GhesGetSettings_saml) GetCertificatePath()(*string) { + return m.certificate_path +} +// GetDisableAdminDemote gets the disable_admin_demote property value. The disable_admin_demote property +// returns a *bool when successful +func (m *GhesGetSettings_saml) GetDisableAdminDemote()(*bool) { + return m.disable_admin_demote +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetSettings_saml) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["certificate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCertificate(val) + } + return nil + } + res["certificate_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCertificatePath(val) + } + return nil + } + res["disable_admin_demote"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisableAdminDemote(val) + } + return nil + } + res["idp_initiated_sso"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIdpInitiatedSso(val) + } + return nil + } + res["issuer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuer(val) + } + return nil + } + res["sso_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSsoUrl(val) + } + return nil + } + return res +} +// GetIdpInitiatedSso gets the idp_initiated_sso property value. The idp_initiated_sso property +// returns a *bool when successful +func (m *GhesGetSettings_saml) GetIdpInitiatedSso()(*bool) { + return m.idp_initiated_sso +} +// GetIssuer gets the issuer property value. The issuer property +// returns a *string when successful +func (m *GhesGetSettings_saml) GetIssuer()(*string) { + return m.issuer +} +// GetSsoUrl gets the sso_url property value. The sso_url property +// returns a *string when successful +func (m *GhesGetSettings_saml) GetSsoUrl()(*string) { + return m.sso_url +} +// Serialize serializes information the current object +func (m *GhesGetSettings_saml) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("certificate", m.GetCertificate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("certificate_path", m.GetCertificatePath()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disable_admin_demote", m.GetDisableAdminDemote()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("idp_initiated_sso", m.GetIdpInitiatedSso()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issuer", m.GetIssuer()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sso_url", m.GetSsoUrl()) + 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 *GhesGetSettings_saml) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCertificate sets the certificate property value. The certificate property +func (m *GhesGetSettings_saml) SetCertificate(value *string)() { + m.certificate = value +} +// SetCertificatePath sets the certificate_path property value. The certificate_path property +func (m *GhesGetSettings_saml) SetCertificatePath(value *string)() { + m.certificate_path = value +} +// SetDisableAdminDemote sets the disable_admin_demote property value. The disable_admin_demote property +func (m *GhesGetSettings_saml) SetDisableAdminDemote(value *bool)() { + m.disable_admin_demote = value +} +// SetIdpInitiatedSso sets the idp_initiated_sso property value. The idp_initiated_sso property +func (m *GhesGetSettings_saml) SetIdpInitiatedSso(value *bool)() { + m.idp_initiated_sso = value +} +// SetIssuer sets the issuer property value. The issuer property +func (m *GhesGetSettings_saml) SetIssuer(value *string)() { + m.issuer = value +} +// SetSsoUrl sets the sso_url property value. The sso_url property +func (m *GhesGetSettings_saml) SetSsoUrl(value *string)() { + m.sso_url = value +} +type GhesGetSettings_samlable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCertificate()(*string) + GetCertificatePath()(*string) + GetDisableAdminDemote()(*bool) + GetIdpInitiatedSso()(*bool) + GetIssuer()(*string) + GetSsoUrl()(*string) + SetCertificate(value *string)() + SetCertificatePath(value *string)() + SetDisableAdminDemote(value *bool)() + SetIdpInitiatedSso(value *bool)() + SetIssuer(value *string)() + SetSsoUrl(value *string)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_smtp.go b/pkg/github/models/ghes_get_settings_escaped_smtp.go new file mode 100644 index 00000000..7d418abb --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_smtp.go @@ -0,0 +1,428 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_smtp 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 address property + address *string + // The authentication property + authentication *string + // The discardToNoreplyAddress property + discardToNoreplyAddress *bool + // The domain property + domain *string + // The enable_starttls_auto property + enable_starttls_auto *bool + // The enabled property + enabled *bool + // The noreply_address property + noreply_address *string + // The password property + password *string + // The port property + port *string + // The support_address property + support_address *string + // The support_address_type property + support_address_type *string + // The user_name property + user_name *string + // The username property + username *string +} +// NewGhesGetSettings_smtp instantiates a new GhesGetSettings_smtp and sets the default values. +func NewGhesGetSettings_smtp()(*GhesGetSettings_smtp) { + m := &GhesGetSettings_smtp{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_smtpFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_smtpFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_smtp(), 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 *GhesGetSettings_smtp) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAddress gets the address property value. The address property +// returns a *string when successful +func (m *GhesGetSettings_smtp) GetAddress()(*string) { + return m.address +} +// GetAuthentication gets the authentication property value. The authentication property +// returns a *string when successful +func (m *GhesGetSettings_smtp) GetAuthentication()(*string) { + return m.authentication +} +// GetDiscardToNoreplyAddress gets the discard-to-noreply-address property value. The discardToNoreplyAddress property +// returns a *bool when successful +func (m *GhesGetSettings_smtp) GetDiscardToNoreplyAddress()(*bool) { + return m.discardToNoreplyAddress +} +// GetDomain gets the domain property value. The domain property +// returns a *string when successful +func (m *GhesGetSettings_smtp) GetDomain()(*string) { + return m.domain +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *GhesGetSettings_smtp) GetEnabled()(*bool) { + return m.enabled +} +// GetEnableStarttlsAuto gets the enable_starttls_auto property value. The enable_starttls_auto property +// returns a *bool when successful +func (m *GhesGetSettings_smtp) GetEnableStarttlsAuto()(*bool) { + return m.enable_starttls_auto +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetSettings_smtp) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["address"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAddress(val) + } + return nil + } + res["authentication"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAuthentication(val) + } + return nil + } + res["discard-to-noreply-address"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDiscardToNoreplyAddress(val) + } + return nil + } + res["domain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDomain(val) + } + return nil + } + res["enable_starttls_auto"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnableStarttlsAuto(val) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["noreply_address"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNoreplyAddress(val) + } + return nil + } + res["password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPassword(val) + } + return nil + } + res["port"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPort(val) + } + return nil + } + res["support_address"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSupportAddress(val) + } + return nil + } + res["support_address_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSupportAddressType(val) + } + return nil + } + res["user_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUser_name(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 + } + return res +} +// GetNoreplyAddress gets the noreply_address property value. The noreply_address property +// returns a *string when successful +func (m *GhesGetSettings_smtp) GetNoreplyAddress()(*string) { + return m.noreply_address +} +// GetPassword gets the password property value. The password property +// returns a *string when successful +func (m *GhesGetSettings_smtp) GetPassword()(*string) { + return m.password +} +// GetPort gets the port property value. The port property +// returns a *string when successful +func (m *GhesGetSettings_smtp) GetPort()(*string) { + return m.port +} +// GetSupportAddress gets the support_address property value. The support_address property +// returns a *string when successful +func (m *GhesGetSettings_smtp) GetSupportAddress()(*string) { + return m.support_address +} +// GetSupportAddressType gets the support_address_type property value. The support_address_type property +// returns a *string when successful +func (m *GhesGetSettings_smtp) GetSupportAddressType()(*string) { + return m.support_address_type +} +// GetUser_name gets the user_name property value. The user_name property +// returns a *string when successful +func (m *GhesGetSettings_smtp) GetUser_name()(*string) { + return m.user_name +} +// GetUsername gets the username property value. The username property +// returns a *string when successful +func (m *GhesGetSettings_smtp) GetUsername()(*string) { + return m.username +} +// Serialize serializes information the current object +func (m *GhesGetSettings_smtp) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("address", m.GetAddress()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("authentication", m.GetAuthentication()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("discard-to-noreply-address", m.GetDiscardToNoreplyAddress()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("domain", m.GetDomain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enable_starttls_auto", m.GetEnableStarttlsAuto()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("noreply_address", m.GetNoreplyAddress()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("password", m.GetPassword()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("port", m.GetPort()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("support_address", m.GetSupportAddress()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("support_address_type", m.GetSupportAddressType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("username", m.GetUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user_name", m.GetUser_name()) + 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 *GhesGetSettings_smtp) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAddress sets the address property value. The address property +func (m *GhesGetSettings_smtp) SetAddress(value *string)() { + m.address = value +} +// SetAuthentication sets the authentication property value. The authentication property +func (m *GhesGetSettings_smtp) SetAuthentication(value *string)() { + m.authentication = value +} +// SetDiscardToNoreplyAddress sets the discard-to-noreply-address property value. The discardToNoreplyAddress property +func (m *GhesGetSettings_smtp) SetDiscardToNoreplyAddress(value *bool)() { + m.discardToNoreplyAddress = value +} +// SetDomain sets the domain property value. The domain property +func (m *GhesGetSettings_smtp) SetDomain(value *string)() { + m.domain = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *GhesGetSettings_smtp) SetEnabled(value *bool)() { + m.enabled = value +} +// SetEnableStarttlsAuto sets the enable_starttls_auto property value. The enable_starttls_auto property +func (m *GhesGetSettings_smtp) SetEnableStarttlsAuto(value *bool)() { + m.enable_starttls_auto = value +} +// SetNoreplyAddress sets the noreply_address property value. The noreply_address property +func (m *GhesGetSettings_smtp) SetNoreplyAddress(value *string)() { + m.noreply_address = value +} +// SetPassword sets the password property value. The password property +func (m *GhesGetSettings_smtp) SetPassword(value *string)() { + m.password = value +} +// SetPort sets the port property value. The port property +func (m *GhesGetSettings_smtp) SetPort(value *string)() { + m.port = value +} +// SetSupportAddress sets the support_address property value. The support_address property +func (m *GhesGetSettings_smtp) SetSupportAddress(value *string)() { + m.support_address = value +} +// SetSupportAddressType sets the support_address_type property value. The support_address_type property +func (m *GhesGetSettings_smtp) SetSupportAddressType(value *string)() { + m.support_address_type = value +} +// SetUser_name sets the user_name property value. The user_name property +func (m *GhesGetSettings_smtp) SetUser_name(value *string)() { + m.user_name = value +} +// SetUsername sets the username property value. The username property +func (m *GhesGetSettings_smtp) SetUsername(value *string)() { + m.username = value +} +type GhesGetSettings_smtpable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAddress()(*string) + GetAuthentication()(*string) + GetDiscardToNoreplyAddress()(*bool) + GetDomain()(*string) + GetEnabled()(*bool) + GetEnableStarttlsAuto()(*bool) + GetNoreplyAddress()(*string) + GetPassword()(*string) + GetPort()(*string) + GetSupportAddress()(*string) + GetSupportAddressType()(*string) + GetUser_name()(*string) + GetUsername()(*string) + SetAddress(value *string)() + SetAuthentication(value *string)() + SetDiscardToNoreplyAddress(value *bool)() + SetDomain(value *string)() + SetEnabled(value *bool)() + SetEnableStarttlsAuto(value *bool)() + SetNoreplyAddress(value *string)() + SetPassword(value *string)() + SetPort(value *string)() + SetSupportAddress(value *string)() + SetSupportAddressType(value *string)() + SetUser_name(value *string)() + SetUsername(value *string)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_snmp.go b/pkg/github/models/ghes_get_settings_escaped_snmp.go new file mode 100644 index 00000000..6c524b41 --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_snmp.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_snmp 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 community property + community *string + // The enabled property + enabled *bool +} +// NewGhesGetSettings_snmp instantiates a new GhesGetSettings_snmp and sets the default values. +func NewGhesGetSettings_snmp()(*GhesGetSettings_snmp) { + m := &GhesGetSettings_snmp{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_snmpFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_snmpFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_snmp(), 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 *GhesGetSettings_snmp) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommunity gets the community property value. The community property +// returns a *string when successful +func (m *GhesGetSettings_snmp) GetCommunity()(*string) { + return m.community +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *GhesGetSettings_snmp) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetSettings_snmp) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["community"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommunity(val) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *GhesGetSettings_snmp) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("community", m.GetCommunity()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + 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 *GhesGetSettings_snmp) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommunity sets the community property value. The community property +func (m *GhesGetSettings_snmp) SetCommunity(value *string)() { + m.community = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *GhesGetSettings_snmp) SetEnabled(value *bool)() { + m.enabled = value +} +type GhesGetSettings_snmpable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommunity()(*string) + GetEnabled()(*bool) + SetCommunity(value *string)() + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/ghes_get_settings_escaped_syslog.go b/pkg/github/models/ghes_get_settings_escaped_syslog.go new file mode 100644 index 00000000..9ea668a9 --- /dev/null +++ b/pkg/github/models/ghes_get_settings_escaped_syslog.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSettings_syslog 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 enabled property + enabled *bool + // The protocol_name property + protocol_name *string + // The server property + server *string +} +// NewGhesGetSettings_syslog instantiates a new GhesGetSettings_syslog and sets the default values. +func NewGhesGetSettings_syslog()(*GhesGetSettings_syslog) { + m := &GhesGetSettings_syslog{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSettings_syslogFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSettings_syslogFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSettings_syslog(), 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 *GhesGetSettings_syslog) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *GhesGetSettings_syslog) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesGetSettings_syslog) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["protocol_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProtocolName(val) + } + return nil + } + res["server"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetServer(val) + } + return nil + } + return res +} +// GetProtocolName gets the protocol_name property value. The protocol_name property +// returns a *string when successful +func (m *GhesGetSettings_syslog) GetProtocolName()(*string) { + return m.protocol_name +} +// GetServer gets the server property value. The server property +// returns a *string when successful +func (m *GhesGetSettings_syslog) GetServer()(*string) { + return m.server +} +// Serialize serializes information the current object +func (m *GhesGetSettings_syslog) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("protocol_name", m.GetProtocolName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("server", m.GetServer()) + 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 *GhesGetSettings_syslog) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *GhesGetSettings_syslog) SetEnabled(value *bool)() { + m.enabled = value +} +// SetProtocolName sets the protocol_name property value. The protocol_name property +func (m *GhesGetSettings_syslog) SetProtocolName(value *string)() { + m.protocol_name = value +} +// SetServer sets the server property value. The server property +func (m *GhesGetSettings_syslog) SetServer(value *string)() { + m.server = value +} +type GhesGetSettings_syslogable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetProtocolName()(*string) + GetServer()(*string) + SetEnabled(value *bool)() + SetProtocolName(value *string)() + SetServer(value *string)() +} diff --git a/pkg/github/models/ghes_get_ssh.go b/pkg/github/models/ghes_get_ssh.go new file mode 100644 index 00000000..13363e0c --- /dev/null +++ b/pkg/github/models/ghes_get_ssh.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesGetSsh 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 fingerprint of the key + fingerprint *string + // The full public key + key *string +} +// NewGhesGetSsh instantiates a new GhesGetSsh and sets the default values. +func NewGhesGetSsh()(*GhesGetSsh) { + m := &GhesGetSsh{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesGetSshFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesGetSshFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesGetSsh(), 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 *GhesGetSsh) 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 *GhesGetSsh) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fingerprint"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFingerprint(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + return res +} +// GetFingerprint gets the fingerprint property value. The fingerprint of the key +// returns a *string when successful +func (m *GhesGetSsh) GetFingerprint()(*string) { + return m.fingerprint +} +// GetKey gets the key property value. The full public key +// returns a *string when successful +func (m *GhesGetSsh) GetKey()(*string) { + return m.key +} +// Serialize serializes information the current object +func (m *GhesGetSsh) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("fingerprint", m.GetFingerprint()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + 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 *GhesGetSsh) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFingerprint sets the fingerprint property value. The fingerprint of the key +func (m *GhesGetSsh) SetFingerprint(value *string)() { + m.fingerprint = value +} +// SetKey sets the key property value. The full public key +func (m *GhesGetSsh) SetKey(value *string)() { + m.key = value +} +type GhesGetSshable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFingerprint()(*string) + GetKey()(*string) + SetFingerprint(value *string)() + SetKey(value *string)() +} diff --git a/pkg/github/models/ghes_license_check.go b/pkg/github/models/ghes_license_check.go new file mode 100644 index 00000000..88775478 --- /dev/null +++ b/pkg/github/models/ghes_license_check.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesLicenseCheck 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 license status of the currently active enterprise license. + status *GhesLicenseCheck_status +} +// NewGhesLicenseCheck instantiates a new GhesLicenseCheck and sets the default values. +func NewGhesLicenseCheck()(*GhesLicenseCheck) { + m := &GhesLicenseCheck{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesLicenseCheckFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesLicenseCheckFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesLicenseCheck(), 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 *GhesLicenseCheck) 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 *GhesLicenseCheck) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGhesLicenseCheck_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*GhesLicenseCheck_status)) + } + return nil + } + return res +} +// GetStatus gets the status property value. The license status of the currently active enterprise license. +// returns a *GhesLicenseCheck_status when successful +func (m *GhesLicenseCheck) GetStatus()(*GhesLicenseCheck_status) { + return m.status +} +// Serialize serializes information the current object +func (m *GhesLicenseCheck) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + 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 *GhesLicenseCheck) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The license status of the currently active enterprise license. +func (m *GhesLicenseCheck) SetStatus(value *GhesLicenseCheck_status)() { + m.status = value +} +type GhesLicenseCheckable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*GhesLicenseCheck_status) + SetStatus(value *GhesLicenseCheck_status)() +} diff --git a/pkg/github/models/ghes_license_check_escaped_status.go b/pkg/github/models/ghes_license_check_escaped_status.go new file mode 100644 index 00000000..b6ef7687 --- /dev/null +++ b/pkg/github/models/ghes_license_check_escaped_status.go @@ -0,0 +1,40 @@ +package models +// The license status of the currently active enterprise license. +type GhesLicenseCheck_status int + +const ( + VALID_GHESLICENSECHECK_STATUS GhesLicenseCheck_status = iota + INVALID_GHESLICENSECHECK_STATUS + EXPIRED_GHESLICENSECHECK_STATUS + CLUSTERMODENOTSUPPORTED_GHESLICENSECHECK_STATUS +) + +func (i GhesLicenseCheck_status) String() string { + return []string{"valid", "invalid", "expired", "cluster mode not supported"}[i] +} +func ParseGhesLicenseCheck_status(v string) (any, error) { + result := VALID_GHESLICENSECHECK_STATUS + switch v { + case "valid": + result = VALID_GHESLICENSECHECK_STATUS + case "invalid": + result = INVALID_GHESLICENSECHECK_STATUS + case "expired": + result = EXPIRED_GHESLICENSECHECK_STATUS + case "cluster mode not supported": + result = CLUSTERMODENOTSUPPORTED_GHESLICENSECHECK_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeGhesLicenseCheck_status(values []GhesLicenseCheck_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GhesLicenseCheck_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/ghes_license_info.go b/pkg/github/models/ghes_license_info.go new file mode 100644 index 00000000..20957fa1 --- /dev/null +++ b/pkg/github/models/ghes_license_info.go @@ -0,0 +1,574 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesLicenseInfo 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 the GitHub Advanced Security feature is enabled. + advancedSecurityEnabled *bool + // If the GitHub Advanced Security feature is enabled, the seat count. + advancedSecuritySeats *int32 + // Whether the cluster support feature is enabled. + clusterSupport *bool + // The company under which the license is issued. + company *string + // Whether the Github Connect feature is enabled. + croquetSupport *bool + // Whether this license is issued under custom terms. + customTerms *bool + // Wheter this license is issued as an evaluation license. + evaluation *bool + // The expiration date of the license. + expireAt *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Whether the insights feature is enabled. + insightsEnabled *bool + // If the insights feature is enabled, the expiration date. + insightsExpireAt *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // If the learning lab feature is enabled, the expiration date. + learningLabEvaluationExpires *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // If the learning lab feature is enabled, the seat count. + learningLabSeats *int32 + // Whether the perpetual feature is enabled. + perpetual *bool + // The unique reference number of the license. + referenceNumber *string + // If the license is issued with limited seating, the seat count. + seats *int32 + // Whether the SSH feature is enabled. + sshAllowed *bool + // The support key of the license. + supportKey *string + // Whether the license is issued with unlimited seat count. + unlimitedSeating *bool +} +// NewGhesLicenseInfo instantiates a new GhesLicenseInfo and sets the default values. +func NewGhesLicenseInfo()(*GhesLicenseInfo) { + m := &GhesLicenseInfo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesLicenseInfoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesLicenseInfoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesLicenseInfo(), 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 *GhesLicenseInfo) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurityEnabled gets the advancedSecurityEnabled property value. Whether the GitHub Advanced Security feature is enabled. +// returns a *bool when successful +func (m *GhesLicenseInfo) GetAdvancedSecurityEnabled()(*bool) { + return m.advancedSecurityEnabled +} +// GetAdvancedSecuritySeats gets the advancedSecuritySeats property value. If the GitHub Advanced Security feature is enabled, the seat count. +// returns a *int32 when successful +func (m *GhesLicenseInfo) GetAdvancedSecuritySeats()(*int32) { + return m.advancedSecuritySeats +} +// GetClusterSupport gets the clusterSupport property value. Whether the cluster support feature is enabled. +// returns a *bool when successful +func (m *GhesLicenseInfo) GetClusterSupport()(*bool) { + return m.clusterSupport +} +// GetCompany gets the company property value. The company under which the license is issued. +// returns a *string when successful +func (m *GhesLicenseInfo) GetCompany()(*string) { + return m.company +} +// GetCroquetSupport gets the croquetSupport property value. Whether the Github Connect feature is enabled. +// returns a *bool when successful +func (m *GhesLicenseInfo) GetCroquetSupport()(*bool) { + return m.croquetSupport +} +// GetCustomTerms gets the customTerms property value. Whether this license is issued under custom terms. +// returns a *bool when successful +func (m *GhesLicenseInfo) GetCustomTerms()(*bool) { + return m.customTerms +} +// GetEvaluation gets the evaluation property value. Wheter this license is issued as an evaluation license. +// returns a *bool when successful +func (m *GhesLicenseInfo) GetEvaluation()(*bool) { + return m.evaluation +} +// GetExpireAt gets the expireAt property value. The expiration date of the license. +// returns a *Time when successful +func (m *GhesLicenseInfo) GetExpireAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.expireAt +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesLicenseInfo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advancedSecurityEnabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurityEnabled(val) + } + return nil + } + res["advancedSecuritySeats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecuritySeats(val) + } + return nil + } + res["clusterSupport"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetClusterSupport(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + res["croquetSupport"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCroquetSupport(val) + } + return nil + } + res["customTerms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCustomTerms(val) + } + return nil + } + res["evaluation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEvaluation(val) + } + return nil + } + res["expireAt"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpireAt(val) + } + return nil + } + res["insightsEnabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetInsightsEnabled(val) + } + return nil + } + res["insightsExpireAt"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetInsightsExpireAt(val) + } + return nil + } + res["learningLabEvaluationExpires"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLearningLabEvaluationExpires(val) + } + return nil + } + res["learningLabSeats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLearningLabSeats(val) + } + return nil + } + res["perpetual"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPerpetual(val) + } + return nil + } + res["referenceNumber"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReferenceNumber(val) + } + return nil + } + res["seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSeats(val) + } + return nil + } + res["sshAllowed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSshAllowed(val) + } + return nil + } + res["supportKey"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSupportKey(val) + } + return nil + } + res["unlimitedSeating"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUnlimitedSeating(val) + } + return nil + } + return res +} +// GetInsightsEnabled gets the insightsEnabled property value. Whether the insights feature is enabled. +// returns a *bool when successful +func (m *GhesLicenseInfo) GetInsightsEnabled()(*bool) { + return m.insightsEnabled +} +// GetInsightsExpireAt gets the insightsExpireAt property value. If the insights feature is enabled, the expiration date. +// returns a *Time when successful +func (m *GhesLicenseInfo) GetInsightsExpireAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.insightsExpireAt +} +// GetLearningLabEvaluationExpires gets the learningLabEvaluationExpires property value. If the learning lab feature is enabled, the expiration date. +// returns a *Time when successful +func (m *GhesLicenseInfo) GetLearningLabEvaluationExpires()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.learningLabEvaluationExpires +} +// GetLearningLabSeats gets the learningLabSeats property value. If the learning lab feature is enabled, the seat count. +// returns a *int32 when successful +func (m *GhesLicenseInfo) GetLearningLabSeats()(*int32) { + return m.learningLabSeats +} +// GetPerpetual gets the perpetual property value. Whether the perpetual feature is enabled. +// returns a *bool when successful +func (m *GhesLicenseInfo) GetPerpetual()(*bool) { + return m.perpetual +} +// GetReferenceNumber gets the referenceNumber property value. The unique reference number of the license. +// returns a *string when successful +func (m *GhesLicenseInfo) GetReferenceNumber()(*string) { + return m.referenceNumber +} +// GetSeats gets the seats property value. If the license is issued with limited seating, the seat count. +// returns a *int32 when successful +func (m *GhesLicenseInfo) GetSeats()(*int32) { + return m.seats +} +// GetSshAllowed gets the sshAllowed property value. Whether the SSH feature is enabled. +// returns a *bool when successful +func (m *GhesLicenseInfo) GetSshAllowed()(*bool) { + return m.sshAllowed +} +// GetSupportKey gets the supportKey property value. The support key of the license. +// returns a *string when successful +func (m *GhesLicenseInfo) GetSupportKey()(*string) { + return m.supportKey +} +// GetUnlimitedSeating gets the unlimitedSeating property value. Whether the license is issued with unlimited seat count. +// returns a *bool when successful +func (m *GhesLicenseInfo) GetUnlimitedSeating()(*bool) { + return m.unlimitedSeating +} +// Serialize serializes information the current object +func (m *GhesLicenseInfo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("advancedSecurityEnabled", m.GetAdvancedSecurityEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("advancedSecuritySeats", m.GetAdvancedSecuritySeats()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("clusterSupport", m.GetClusterSupport()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("croquetSupport", m.GetCroquetSupport()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("customTerms", m.GetCustomTerms()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("evaluation", m.GetEvaluation()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("expireAt", m.GetExpireAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("insightsEnabled", m.GetInsightsEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("insightsExpireAt", m.GetInsightsExpireAt()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("learningLabEvaluationExpires", m.GetLearningLabEvaluationExpires()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("learningLabSeats", m.GetLearningLabSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("perpetual", m.GetPerpetual()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("referenceNumber", m.GetReferenceNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("seats", m.GetSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("sshAllowed", m.GetSshAllowed()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("supportKey", m.GetSupportKey()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("unlimitedSeating", m.GetUnlimitedSeating()) + 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 *GhesLicenseInfo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurityEnabled sets the advancedSecurityEnabled property value. Whether the GitHub Advanced Security feature is enabled. +func (m *GhesLicenseInfo) SetAdvancedSecurityEnabled(value *bool)() { + m.advancedSecurityEnabled = value +} +// SetAdvancedSecuritySeats sets the advancedSecuritySeats property value. If the GitHub Advanced Security feature is enabled, the seat count. +func (m *GhesLicenseInfo) SetAdvancedSecuritySeats(value *int32)() { + m.advancedSecuritySeats = value +} +// SetClusterSupport sets the clusterSupport property value. Whether the cluster support feature is enabled. +func (m *GhesLicenseInfo) SetClusterSupport(value *bool)() { + m.clusterSupport = value +} +// SetCompany sets the company property value. The company under which the license is issued. +func (m *GhesLicenseInfo) SetCompany(value *string)() { + m.company = value +} +// SetCroquetSupport sets the croquetSupport property value. Whether the Github Connect feature is enabled. +func (m *GhesLicenseInfo) SetCroquetSupport(value *bool)() { + m.croquetSupport = value +} +// SetCustomTerms sets the customTerms property value. Whether this license is issued under custom terms. +func (m *GhesLicenseInfo) SetCustomTerms(value *bool)() { + m.customTerms = value +} +// SetEvaluation sets the evaluation property value. Wheter this license is issued as an evaluation license. +func (m *GhesLicenseInfo) SetEvaluation(value *bool)() { + m.evaluation = value +} +// SetExpireAt sets the expireAt property value. The expiration date of the license. +func (m *GhesLicenseInfo) SetExpireAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.expireAt = value +} +// SetInsightsEnabled sets the insightsEnabled property value. Whether the insights feature is enabled. +func (m *GhesLicenseInfo) SetInsightsEnabled(value *bool)() { + m.insightsEnabled = value +} +// SetInsightsExpireAt sets the insightsExpireAt property value. If the insights feature is enabled, the expiration date. +func (m *GhesLicenseInfo) SetInsightsExpireAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.insightsExpireAt = value +} +// SetLearningLabEvaluationExpires sets the learningLabEvaluationExpires property value. If the learning lab feature is enabled, the expiration date. +func (m *GhesLicenseInfo) SetLearningLabEvaluationExpires(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.learningLabEvaluationExpires = value +} +// SetLearningLabSeats sets the learningLabSeats property value. If the learning lab feature is enabled, the seat count. +func (m *GhesLicenseInfo) SetLearningLabSeats(value *int32)() { + m.learningLabSeats = value +} +// SetPerpetual sets the perpetual property value. Whether the perpetual feature is enabled. +func (m *GhesLicenseInfo) SetPerpetual(value *bool)() { + m.perpetual = value +} +// SetReferenceNumber sets the referenceNumber property value. The unique reference number of the license. +func (m *GhesLicenseInfo) SetReferenceNumber(value *string)() { + m.referenceNumber = value +} +// SetSeats sets the seats property value. If the license is issued with limited seating, the seat count. +func (m *GhesLicenseInfo) SetSeats(value *int32)() { + m.seats = value +} +// SetSshAllowed sets the sshAllowed property value. Whether the SSH feature is enabled. +func (m *GhesLicenseInfo) SetSshAllowed(value *bool)() { + m.sshAllowed = value +} +// SetSupportKey sets the supportKey property value. The support key of the license. +func (m *GhesLicenseInfo) SetSupportKey(value *string)() { + m.supportKey = value +} +// SetUnlimitedSeating sets the unlimitedSeating property value. Whether the license is issued with unlimited seat count. +func (m *GhesLicenseInfo) SetUnlimitedSeating(value *bool)() { + m.unlimitedSeating = value +} +type GhesLicenseInfoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurityEnabled()(*bool) + GetAdvancedSecuritySeats()(*int32) + GetClusterSupport()(*bool) + GetCompany()(*string) + GetCroquetSupport()(*bool) + GetCustomTerms()(*bool) + GetEvaluation()(*bool) + GetExpireAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetInsightsEnabled()(*bool) + GetInsightsExpireAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetLearningLabEvaluationExpires()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetLearningLabSeats()(*int32) + GetPerpetual()(*bool) + GetReferenceNumber()(*string) + GetSeats()(*int32) + GetSshAllowed()(*bool) + GetSupportKey()(*string) + GetUnlimitedSeating()(*bool) + SetAdvancedSecurityEnabled(value *bool)() + SetAdvancedSecuritySeats(value *int32)() + SetClusterSupport(value *bool)() + SetCompany(value *string)() + SetCroquetSupport(value *bool)() + SetCustomTerms(value *bool)() + SetEvaluation(value *bool)() + SetExpireAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetInsightsEnabled(value *bool)() + SetInsightsExpireAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetLearningLabEvaluationExpires(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetLearningLabSeats(value *int32)() + SetPerpetual(value *bool)() + SetReferenceNumber(value *string)() + SetSeats(value *int32)() + SetSshAllowed(value *bool)() + SetSupportKey(value *string)() + SetUnlimitedSeating(value *bool)() +} diff --git a/pkg/github/models/ghes_replication_status.go b/pkg/github/models/ghes_replication_status.go new file mode 100644 index 00000000..f3aba083 --- /dev/null +++ b/pkg/github/models/ghes_replication_status.go @@ -0,0 +1,122 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesReplicationStatus 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 nodes property + nodes []GhesReplicationStatus_nodesable + // The status property + status *GhesReplicationStatusIndicator +} +// NewGhesReplicationStatus instantiates a new GhesReplicationStatus and sets the default values. +func NewGhesReplicationStatus()(*GhesReplicationStatus) { + m := &GhesReplicationStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesReplicationStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesReplicationStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesReplicationStatus(), 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 *GhesReplicationStatus) 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 *GhesReplicationStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["nodes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGhesReplicationStatus_nodesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GhesReplicationStatus_nodesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GhesReplicationStatus_nodesable) + } + } + m.SetNodes(res) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGhesReplicationStatusIndicator) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*GhesReplicationStatusIndicator)) + } + return nil + } + return res +} +// GetNodes gets the nodes property value. The nodes property +// returns a []GhesReplicationStatus_nodesable when successful +func (m *GhesReplicationStatus) GetNodes()([]GhesReplicationStatus_nodesable) { + return m.nodes +} +// GetStatus gets the status property value. The status property +// returns a *GhesReplicationStatusIndicator when successful +func (m *GhesReplicationStatus) GetStatus()(*GhesReplicationStatusIndicator) { + return m.status +} +// Serialize serializes information the current object +func (m *GhesReplicationStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetNodes() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetNodes())) + for i, v := range m.GetNodes() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("nodes", cast) + 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 *GhesReplicationStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNodes sets the nodes property value. The nodes property +func (m *GhesReplicationStatus) SetNodes(value []GhesReplicationStatus_nodesable)() { + m.nodes = value +} +// SetStatus sets the status property value. The status property +func (m *GhesReplicationStatus) SetStatus(value *GhesReplicationStatusIndicator)() { + m.status = value +} +type GhesReplicationStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNodes()([]GhesReplicationStatus_nodesable) + GetStatus()(*GhesReplicationStatusIndicator) + SetNodes(value []GhesReplicationStatus_nodesable)() + SetStatus(value *GhesReplicationStatusIndicator)() +} diff --git a/pkg/github/models/ghes_replication_status_escaped_nodes.go b/pkg/github/models/ghes_replication_status_escaped_nodes.go new file mode 100644 index 00000000..f4f3caa4 --- /dev/null +++ b/pkg/github/models/ghes_replication_status_escaped_nodes.go @@ -0,0 +1,151 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesReplicationStatus_nodes 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 hostname property + hostname *string + // The services property + services []GhesReplicationStatus_nodes_servicesable + // The status property + status *GhesReplicationStatusIndicator +} +// NewGhesReplicationStatus_nodes instantiates a new GhesReplicationStatus_nodes and sets the default values. +func NewGhesReplicationStatus_nodes()(*GhesReplicationStatus_nodes) { + m := &GhesReplicationStatus_nodes{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesReplicationStatus_nodesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesReplicationStatus_nodesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesReplicationStatus_nodes(), 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 *GhesReplicationStatus_nodes) 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 *GhesReplicationStatus_nodes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["hostname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHostname(val) + } + return nil + } + res["services"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGhesReplicationStatus_nodes_servicesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GhesReplicationStatus_nodes_servicesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GhesReplicationStatus_nodes_servicesable) + } + } + m.SetServices(res) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGhesReplicationStatusIndicator) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*GhesReplicationStatusIndicator)) + } + return nil + } + return res +} +// GetHostname gets the hostname property value. The hostname property +// returns a *string when successful +func (m *GhesReplicationStatus_nodes) GetHostname()(*string) { + return m.hostname +} +// GetServices gets the services property value. The services property +// returns a []GhesReplicationStatus_nodes_servicesable when successful +func (m *GhesReplicationStatus_nodes) GetServices()([]GhesReplicationStatus_nodes_servicesable) { + return m.services +} +// GetStatus gets the status property value. The status property +// returns a *GhesReplicationStatusIndicator when successful +func (m *GhesReplicationStatus_nodes) GetStatus()(*GhesReplicationStatusIndicator) { + return m.status +} +// Serialize serializes information the current object +func (m *GhesReplicationStatus_nodes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("hostname", m.GetHostname()) + if err != nil { + return err + } + } + if m.GetServices() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetServices())) + for i, v := range m.GetServices() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("services", cast) + 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 *GhesReplicationStatus_nodes) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHostname sets the hostname property value. The hostname property +func (m *GhesReplicationStatus_nodes) SetHostname(value *string)() { + m.hostname = value +} +// SetServices sets the services property value. The services property +func (m *GhesReplicationStatus_nodes) SetServices(value []GhesReplicationStatus_nodes_servicesable)() { + m.services = value +} +// SetStatus sets the status property value. The status property +func (m *GhesReplicationStatus_nodes) SetStatus(value *GhesReplicationStatusIndicator)() { + m.status = value +} +type GhesReplicationStatus_nodesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHostname()(*string) + GetServices()([]GhesReplicationStatus_nodes_servicesable) + GetStatus()(*GhesReplicationStatusIndicator) + SetHostname(value *string)() + SetServices(value []GhesReplicationStatus_nodes_servicesable)() + SetStatus(value *GhesReplicationStatusIndicator)() +} diff --git a/pkg/github/models/ghes_replication_status_escaped_nodes_escaped_services.go b/pkg/github/models/ghes_replication_status_escaped_nodes_escaped_services.go new file mode 100644 index 00000000..e322ad5d --- /dev/null +++ b/pkg/github/models/ghes_replication_status_escaped_nodes_escaped_services.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesReplicationStatus_nodes_services 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 details property + details *string + // The name property + name *string + // The status property + status *GhesReplicationStatusIndicator +} +// NewGhesReplicationStatus_nodes_services instantiates a new GhesReplicationStatus_nodes_services and sets the default values. +func NewGhesReplicationStatus_nodes_services()(*GhesReplicationStatus_nodes_services) { + m := &GhesReplicationStatus_nodes_services{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesReplicationStatus_nodes_servicesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesReplicationStatus_nodes_servicesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesReplicationStatus_nodes_services(), 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 *GhesReplicationStatus_nodes_services) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDetails gets the details property value. The details property +// returns a *string when successful +func (m *GhesReplicationStatus_nodes_services) GetDetails()(*string) { + return m.details +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesReplicationStatus_nodes_services) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["details"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDetails(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["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGhesReplicationStatusIndicator) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*GhesReplicationStatusIndicator)) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *GhesReplicationStatus_nodes_services) GetName()(*string) { + return m.name +} +// GetStatus gets the status property value. The status property +// returns a *GhesReplicationStatusIndicator when successful +func (m *GhesReplicationStatus_nodes_services) GetStatus()(*GhesReplicationStatusIndicator) { + return m.status +} +// Serialize serializes information the current object +func (m *GhesReplicationStatus_nodes_services) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("details", m.GetDetails()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *GhesReplicationStatus_nodes_services) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDetails sets the details property value. The details property +func (m *GhesReplicationStatus_nodes_services) SetDetails(value *string)() { + m.details = value +} +// SetName sets the name property value. The name property +func (m *GhesReplicationStatus_nodes_services) SetName(value *string)() { + m.name = value +} +// SetStatus sets the status property value. The status property +func (m *GhesReplicationStatus_nodes_services) SetStatus(value *GhesReplicationStatusIndicator)() { + m.status = value +} +type GhesReplicationStatus_nodes_servicesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDetails()(*string) + GetName()(*string) + GetStatus()(*GhesReplicationStatusIndicator) + SetDetails(value *string)() + SetName(value *string)() + SetStatus(value *GhesReplicationStatusIndicator)() +} diff --git a/pkg/github/models/ghes_replication_status_indicator.go b/pkg/github/models/ghes_replication_status_indicator.go new file mode 100644 index 00000000..07686a68 --- /dev/null +++ b/pkg/github/models/ghes_replication_status_indicator.go @@ -0,0 +1,39 @@ +package models +type GhesReplicationStatusIndicator int + +const ( + UNKNOWN_GHESREPLICATIONSTATUSINDICATOR GhesReplicationStatusIndicator = iota + OK_GHESREPLICATIONSTATUSINDICATOR + WARNING_GHESREPLICATIONSTATUSINDICATOR + CRITICAL_GHESREPLICATIONSTATUSINDICATOR +) + +func (i GhesReplicationStatusIndicator) String() string { + return []string{"UNKNOWN", "OK", "WARNING", "CRITICAL"}[i] +} +func ParseGhesReplicationStatusIndicator(v string) (any, error) { + result := UNKNOWN_GHESREPLICATIONSTATUSINDICATOR + switch v { + case "UNKNOWN": + result = UNKNOWN_GHESREPLICATIONSTATUSINDICATOR + case "OK": + result = OK_GHESREPLICATIONSTATUSINDICATOR + case "WARNING": + result = WARNING_GHESREPLICATIONSTATUSINDICATOR + case "CRITICAL": + result = CRITICAL_GHESREPLICATIONSTATUSINDICATOR + default: + return nil, nil + } + return &result, nil +} +func SerializeGhesReplicationStatusIndicator(values []GhesReplicationStatusIndicator) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GhesReplicationStatusIndicator) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/ghes_set_maintenance_request.go b/pkg/github/models/ghes_set_maintenance_request.go new file mode 100644 index 00000000..ccad2833 --- /dev/null +++ b/pkg/github/models/ghes_set_maintenance_request.go @@ -0,0 +1,204 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22 "github.com/google/uuid" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesSetMaintenanceRequest 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 enable maintenance mode. + enabled *bool + // The list of IP addresses to exclude from maintenance mode. IPv4, IPv6, and CIDR addresses are supported. + ip_exception_list []string + // The message to display to users when maintenance mode is enabled. + maintenance_mode_message *string + // The UUID of the node to target. This parameter is incompatible with maintenance mode scheduling. Only use `uuid` if the value of `when` is empty or `now`. + uuid *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID + // The time to enable maintenance mode. If this parameter is empty or set to `now`, maintenance mode is enabled immediately. Otherwise, maintenance mode is enabled at the specified time. The format is ISO 8601. + when *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewGhesSetMaintenanceRequest instantiates a new GhesSetMaintenanceRequest and sets the default values. +func NewGhesSetMaintenanceRequest()(*GhesSetMaintenanceRequest) { + m := &GhesSetMaintenanceRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesSetMaintenanceRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesSetMaintenanceRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesSetMaintenanceRequest(), 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 *GhesSetMaintenanceRequest) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. Whether to enable maintenance mode. +// returns a *bool when successful +func (m *GhesSetMaintenanceRequest) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesSetMaintenanceRequest) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["ip_exception_list"] = 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.SetIpExceptionList(res) + } + return nil + } + res["maintenance_mode_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintenanceModeMessage(val) + } + return nil + } + res["uuid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetUUIDValue() + if err != nil { + return err + } + if val != nil { + m.SetUuid(val) + } + return nil + } + res["when"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetWhen(val) + } + return nil + } + return res +} +// GetIpExceptionList gets the ip_exception_list property value. The list of IP addresses to exclude from maintenance mode. IPv4, IPv6, and CIDR addresses are supported. +// returns a []string when successful +func (m *GhesSetMaintenanceRequest) GetIpExceptionList()([]string) { + return m.ip_exception_list +} +// GetMaintenanceModeMessage gets the maintenance_mode_message property value. The message to display to users when maintenance mode is enabled. +// returns a *string when successful +func (m *GhesSetMaintenanceRequest) GetMaintenanceModeMessage()(*string) { + return m.maintenance_mode_message +} +// GetUuid gets the uuid property value. The UUID of the node to target. This parameter is incompatible with maintenance mode scheduling. Only use `uuid` if the value of `when` is empty or `now`. +// returns a *UUID when successful +func (m *GhesSetMaintenanceRequest) GetUuid()(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) { + return m.uuid +} +// GetWhen gets the when property value. The time to enable maintenance mode. If this parameter is empty or set to `now`, maintenance mode is enabled immediately. Otherwise, maintenance mode is enabled at the specified time. The format is ISO 8601. +// returns a *Time when successful +func (m *GhesSetMaintenanceRequest) GetWhen()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.when +} +// Serialize serializes information the current object +func (m *GhesSetMaintenanceRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + if m.GetIpExceptionList() != nil { + err := writer.WriteCollectionOfStringValues("ip_exception_list", m.GetIpExceptionList()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("maintenance_mode_message", m.GetMaintenanceModeMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteUUIDValue("uuid", m.GetUuid()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("when", m.GetWhen()) + 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 *GhesSetMaintenanceRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. Whether to enable maintenance mode. +func (m *GhesSetMaintenanceRequest) SetEnabled(value *bool)() { + m.enabled = value +} +// SetIpExceptionList sets the ip_exception_list property value. The list of IP addresses to exclude from maintenance mode. IPv4, IPv6, and CIDR addresses are supported. +func (m *GhesSetMaintenanceRequest) SetIpExceptionList(value []string)() { + m.ip_exception_list = value +} +// SetMaintenanceModeMessage sets the maintenance_mode_message property value. The message to display to users when maintenance mode is enabled. +func (m *GhesSetMaintenanceRequest) SetMaintenanceModeMessage(value *string)() { + m.maintenance_mode_message = value +} +// SetUuid sets the uuid property value. The UUID of the node to target. This parameter is incompatible with maintenance mode scheduling. Only use `uuid` if the value of `when` is empty or `now`. +func (m *GhesSetMaintenanceRequest) SetUuid(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() { + m.uuid = value +} +// SetWhen sets the when property value. The time to enable maintenance mode. If this parameter is empty or set to `now`, maintenance mode is enabled immediately. Otherwise, maintenance mode is enabled at the specified time. The format is ISO 8601. +func (m *GhesSetMaintenanceRequest) SetWhen(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.when = value +} +type GhesSetMaintenanceRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetIpExceptionList()([]string) + GetMaintenanceModeMessage()(*string) + GetUuid()(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) + GetWhen()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetEnabled(value *bool)() + SetIpExceptionList(value []string)() + SetMaintenanceModeMessage(value *string)() + SetUuid(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() + SetWhen(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/ghes_set_maintenance_response.go b/pkg/github/models/ghes_set_maintenance_response.go new file mode 100644 index 00000000..db422a3e --- /dev/null +++ b/pkg/github/models/ghes_set_maintenance_response.go @@ -0,0 +1,168 @@ +package models + +import ( + i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22 "github.com/google/uuid" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesSetMaintenanceResponse 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 error property + error *string + // The hostname property + hostname *string + // The message property + message *string + // The uuid property + uuid *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID +} +// NewGhesSetMaintenanceResponse instantiates a new GhesSetMaintenanceResponse and sets the default values. +func NewGhesSetMaintenanceResponse()(*GhesSetMaintenanceResponse) { + m := &GhesSetMaintenanceResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesSetMaintenanceResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesSetMaintenanceResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesSetMaintenanceResponse(), 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 *GhesSetMaintenanceResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetError gets the error property value. The error property +// returns a *string when successful +func (m *GhesSetMaintenanceResponse) GetError()(*string) { + return m.error +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesSetMaintenanceResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["error"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetError(val) + } + return nil + } + res["hostname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHostname(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 + } + res["uuid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetUUIDValue() + if err != nil { + return err + } + if val != nil { + m.SetUuid(val) + } + return nil + } + return res +} +// GetHostname gets the hostname property value. The hostname property +// returns a *string when successful +func (m *GhesSetMaintenanceResponse) GetHostname()(*string) { + return m.hostname +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *GhesSetMaintenanceResponse) GetMessage()(*string) { + return m.message +} +// GetUuid gets the uuid property value. The uuid property +// returns a *UUID when successful +func (m *GhesSetMaintenanceResponse) GetUuid()(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) { + return m.uuid +} +// Serialize serializes information the current object +func (m *GhesSetMaintenanceResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("error", m.GetError()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hostname", m.GetHostname()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteUUIDValue("uuid", m.GetUuid()) + 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 *GhesSetMaintenanceResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetError sets the error property value. The error property +func (m *GhesSetMaintenanceResponse) SetError(value *string)() { + m.error = value +} +// SetHostname sets the hostname property value. The hostname property +func (m *GhesSetMaintenanceResponse) SetHostname(value *string)() { + m.hostname = value +} +// SetMessage sets the message property value. The message property +func (m *GhesSetMaintenanceResponse) SetMessage(value *string)() { + m.message = value +} +// SetUuid sets the uuid property value. The uuid property +func (m *GhesSetMaintenanceResponse) SetUuid(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() { + m.uuid = value +} +type GhesSetMaintenanceResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetError()(*string) + GetHostname()(*string) + GetMessage()(*string) + GetUuid()(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) + SetError(value *string)() + SetHostname(value *string)() + SetMessage(value *string)() + SetUuid(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() +} diff --git a/pkg/github/models/ghes_set_ssh_request.go b/pkg/github/models/ghes_set_ssh_request.go new file mode 100644 index 00000000..6c9682b5 --- /dev/null +++ b/pkg/github/models/ghes_set_ssh_request.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesSetSshRequest 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 public SSH key to add to the `authorized_keys` file. + key *string +} +// NewGhesSetSshRequest instantiates a new GhesSetSshRequest and sets the default values. +func NewGhesSetSshRequest()(*GhesSetSshRequest) { + m := &GhesSetSshRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesSetSshRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesSetSshRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesSetSshRequest(), 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 *GhesSetSshRequest) 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 *GhesSetSshRequest) 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 + } + return res +} +// GetKey gets the key property value. The public SSH key to add to the `authorized_keys` file. +// returns a *string when successful +func (m *GhesSetSshRequest) GetKey()(*string) { + return m.key +} +// Serialize serializes information the current object +func (m *GhesSetSshRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + 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 *GhesSetSshRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The public SSH key to add to the `authorized_keys` file. +func (m *GhesSetSshRequest) SetKey(value *string)() { + m.key = value +} +type GhesSetSshRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + SetKey(value *string)() +} diff --git a/pkg/github/models/ghes_set_ssh_response.go b/pkg/github/models/ghes_set_ssh_response.go new file mode 100644 index 00000000..6e2837ec --- /dev/null +++ b/pkg/github/models/ghes_set_ssh_response.go @@ -0,0 +1,197 @@ +package models + +import ( + i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22 "github.com/google/uuid" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesSetSshResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Error message indicating the reason for the SSH key addition failure. This field is only present if the SSH key addition failed. + error *string + // Hostname of the node where the SSH key was added. + hostname *string + // Message indicating the result of the SSH key addition. + message *string + // Whether the SSH key was already present on the `authorized_keys` file. + modified *bool + // UUID of the SSH key that was added. + uuid *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID +} +// NewGhesSetSshResponse instantiates a new GhesSetSshResponse and sets the default values. +func NewGhesSetSshResponse()(*GhesSetSshResponse) { + m := &GhesSetSshResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesSetSshResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesSetSshResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesSetSshResponse(), 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 *GhesSetSshResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetError gets the error property value. Error message indicating the reason for the SSH key addition failure. This field is only present if the SSH key addition failed. +// returns a *string when successful +func (m *GhesSetSshResponse) GetError()(*string) { + return m.error +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesSetSshResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["error"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetError(val) + } + return nil + } + res["hostname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHostname(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 + } + res["modified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetModified(val) + } + return nil + } + res["uuid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetUUIDValue() + if err != nil { + return err + } + if val != nil { + m.SetUuid(val) + } + return nil + } + return res +} +// GetHostname gets the hostname property value. Hostname of the node where the SSH key was added. +// returns a *string when successful +func (m *GhesSetSshResponse) GetHostname()(*string) { + return m.hostname +} +// GetMessage gets the message property value. Message indicating the result of the SSH key addition. +// returns a *string when successful +func (m *GhesSetSshResponse) GetMessage()(*string) { + return m.message +} +// GetModified gets the modified property value. Whether the SSH key was already present on the `authorized_keys` file. +// returns a *bool when successful +func (m *GhesSetSshResponse) GetModified()(*bool) { + return m.modified +} +// GetUuid gets the uuid property value. UUID of the SSH key that was added. +// returns a *UUID when successful +func (m *GhesSetSshResponse) GetUuid()(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) { + return m.uuid +} +// Serialize serializes information the current object +func (m *GhesSetSshResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("error", m.GetError()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hostname", m.GetHostname()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("modified", m.GetModified()) + if err != nil { + return err + } + } + { + err := writer.WriteUUIDValue("uuid", m.GetUuid()) + 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 *GhesSetSshResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetError sets the error property value. Error message indicating the reason for the SSH key addition failure. This field is only present if the SSH key addition failed. +func (m *GhesSetSshResponse) SetError(value *string)() { + m.error = value +} +// SetHostname sets the hostname property value. Hostname of the node where the SSH key was added. +func (m *GhesSetSshResponse) SetHostname(value *string)() { + m.hostname = value +} +// SetMessage sets the message property value. Message indicating the result of the SSH key addition. +func (m *GhesSetSshResponse) SetMessage(value *string)() { + m.message = value +} +// SetModified sets the modified property value. Whether the SSH key was already present on the `authorized_keys` file. +func (m *GhesSetSshResponse) SetModified(value *bool)() { + m.modified = value +} +// SetUuid sets the uuid property value. UUID of the SSH key that was added. +func (m *GhesSetSshResponse) SetUuid(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() { + m.uuid = value +} +type GhesSetSshResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetError()(*string) + GetHostname()(*string) + GetMessage()(*string) + GetModified()(*bool) + GetUuid()(*i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID) + SetError(value *string)() + SetHostname(value *string)() + SetMessage(value *string)() + SetModified(value *bool)() + SetUuid(value *i561e97a8befe7661a44c8f54600992b4207a3a0cf6770e5559949bc276de2e22.UUID)() +} diff --git a/pkg/github/models/ghes_upload_license_request.go b/pkg/github/models/ghes_upload_license_request.go new file mode 100644 index 00000000..c4a20f65 --- /dev/null +++ b/pkg/github/models/ghes_upload_license_request.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesUploadLicenseRequest 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 content of your _.ghl_ license file. + license *string +} +// NewGhesUploadLicenseRequest instantiates a new GhesUploadLicenseRequest and sets the default values. +func NewGhesUploadLicenseRequest()(*GhesUploadLicenseRequest) { + m := &GhesUploadLicenseRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesUploadLicenseRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesUploadLicenseRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesUploadLicenseRequest(), 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 *GhesUploadLicenseRequest) 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 *GhesUploadLicenseRequest) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicense(val) + } + return nil + } + return res +} +// GetLicense gets the license property value. The content of your _.ghl_ license file. +// returns a *string when successful +func (m *GhesUploadLicenseRequest) GetLicense()(*string) { + return m.license +} +// Serialize serializes information the current object +func (m *GhesUploadLicenseRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("license", m.GetLicense()) + 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 *GhesUploadLicenseRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLicense sets the license property value. The content of your _.ghl_ license file. +func (m *GhesUploadLicenseRequest) SetLicense(value *string)() { + m.license = value +} +type GhesUploadLicenseRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLicense()(*string) + SetLicense(value *string)() +} diff --git a/pkg/github/models/ghes_version.go b/pkg/github/models/ghes_version.go new file mode 100644 index 00000000..476a580b --- /dev/null +++ b/pkg/github/models/ghes_version.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesVersion 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 hostname property + hostname *string + // The version property + version GhesVersion_versionable +} +// NewGhesVersion instantiates a new GhesVersion and sets the default values. +func NewGhesVersion()(*GhesVersion) { + m := &GhesVersion{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesVersionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesVersionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesVersion(), 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 *GhesVersion) 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 *GhesVersion) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["hostname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHostname(val) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGhesVersion_versionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVersion(val.(GhesVersion_versionable)) + } + return nil + } + return res +} +// GetHostname gets the hostname property value. The hostname property +// returns a *string when successful +func (m *GhesVersion) GetHostname()(*string) { + return m.hostname +} +// GetVersion gets the version property value. The version property +// returns a GhesVersion_versionable when successful +func (m *GhesVersion) GetVersion()(GhesVersion_versionable) { + return m.version +} +// Serialize serializes information the current object +func (m *GhesVersion) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("hostname", m.GetHostname()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("version", m.GetVersion()) + 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 *GhesVersion) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHostname sets the hostname property value. The hostname property +func (m *GhesVersion) SetHostname(value *string)() { + m.hostname = value +} +// SetVersion sets the version property value. The version property +func (m *GhesVersion) SetVersion(value GhesVersion_versionable)() { + m.version = value +} +type GhesVersionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHostname()(*string) + GetVersion()(GhesVersion_versionable) + SetHostname(value *string)() + SetVersion(value GhesVersion_versionable)() +} diff --git a/pkg/github/models/ghes_version_escaped_version.go b/pkg/github/models/ghes_version_escaped_version.go new file mode 100644 index 00000000..22e76fd6 --- /dev/null +++ b/pkg/github/models/ghes_version_escaped_version.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GhesVersion_version 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 build_date property + build_date *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly + // The build_id property + build_id *string + // The platform property + platform *GhesVersion_version_platform + // The version property + version *string +} +// NewGhesVersion_version instantiates a new GhesVersion_version and sets the default values. +func NewGhesVersion_version()(*GhesVersion_version) { + m := &GhesVersion_version{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGhesVersion_versionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGhesVersion_versionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGhesVersion_version(), 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 *GhesVersion_version) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBuildDate gets the build_date property value. The build_date property +// returns a *DateOnly when successful +func (m *GhesVersion_version) GetBuildDate()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly) { + return m.build_date +} +// GetBuildId gets the build_id property value. The build_id property +// returns a *string when successful +func (m *GhesVersion_version) GetBuildId()(*string) { + return m.build_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GhesVersion_version) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["build_date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetDateOnlyValue() + if err != nil { + return err + } + if val != nil { + m.SetBuildDate(val) + } + return nil + } + res["build_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBuildId(val) + } + return nil + } + res["platform"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGhesVersion_version_platform) + if err != nil { + return err + } + if val != nil { + m.SetPlatform(val.(*GhesVersion_version_platform)) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} +// GetPlatform gets the platform property value. The platform property +// returns a *GhesVersion_version_platform when successful +func (m *GhesVersion_version) GetPlatform()(*GhesVersion_version_platform) { + return m.platform +} +// GetVersion gets the version property value. The version property +// returns a *string when successful +func (m *GhesVersion_version) GetVersion()(*string) { + return m.version +} +// Serialize serializes information the current object +func (m *GhesVersion_version) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteDateOnlyValue("build_date", m.GetBuildDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("build_id", m.GetBuildId()) + if err != nil { + return err + } + } + if m.GetPlatform() != nil { + cast := (*m.GetPlatform()).String() + err := writer.WriteStringValue("platform", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("version", m.GetVersion()) + 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 *GhesVersion_version) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBuildDate sets the build_date property value. The build_date property +func (m *GhesVersion_version) SetBuildDate(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)() { + m.build_date = value +} +// SetBuildId sets the build_id property value. The build_id property +func (m *GhesVersion_version) SetBuildId(value *string)() { + m.build_id = value +} +// SetPlatform sets the platform property value. The platform property +func (m *GhesVersion_version) SetPlatform(value *GhesVersion_version_platform)() { + m.platform = value +} +// SetVersion sets the version property value. The version property +func (m *GhesVersion_version) SetVersion(value *string)() { + m.version = value +} +type GhesVersion_versionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBuildDate()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly) + GetBuildId()(*string) + GetPlatform()(*GhesVersion_version_platform) + GetVersion()(*string) + SetBuildDate(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)() + SetBuildId(value *string)() + SetPlatform(value *GhesVersion_version_platform)() + SetVersion(value *string)() +} diff --git a/pkg/github/models/ghes_version_escaped_version_escaped_platform.go b/pkg/github/models/ghes_version_escaped_version_escaped_platform.go new file mode 100644 index 00000000..7ab83f76 --- /dev/null +++ b/pkg/github/models/ghes_version_escaped_version_escaped_platform.go @@ -0,0 +1,45 @@ +package models +type GhesVersion_version_platform int + +const ( + AMI_GHESVERSION_VERSION_PLATFORM GhesVersion_version_platform = iota + AZURE_GHESVERSION_VERSION_PLATFORM + ESX_GHESVERSION_VERSION_PLATFORM + GCE_GHESVERSION_VERSION_PLATFORM + HYPERV_GHESVERSION_VERSION_PLATFORM + KVM_GHESVERSION_VERSION_PLATFORM +) + +func (i GhesVersion_version_platform) String() string { + return []string{"ami", "azure", "esx", "gce", "hyperv", "kvm"}[i] +} +func ParseGhesVersion_version_platform(v string) (any, error) { + result := AMI_GHESVERSION_VERSION_PLATFORM + switch v { + case "ami": + result = AMI_GHESVERSION_VERSION_PLATFORM + case "azure": + result = AZURE_GHESVERSION_VERSION_PLATFORM + case "esx": + result = ESX_GHESVERSION_VERSION_PLATFORM + case "gce": + result = GCE_GHESVERSION_VERSION_PLATFORM + case "hyperv": + result = HYPERV_GHESVERSION_VERSION_PLATFORM + case "kvm": + result = KVM_GHESVERSION_VERSION_PLATFORM + default: + return nil, nil + } + return &result, nil +} +func SerializeGhesVersion_version_platform(values []GhesVersion_version_platform) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GhesVersion_version_platform) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/gist_comment.go b/pkg/github/models/gist_comment.go new file mode 100644 index 00000000..fcefb8ed --- /dev/null +++ b/pkg/github/models/gist_comment.go @@ -0,0 +1,286 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GistComment a comment made to a gist. +type GistComment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // The comment text. + body *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The id property + id *int32 + // The node_id property + node_id *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewGistComment instantiates a new GistComment and sets the default values. +func NewGistComment()(*GistComment) { + m := &GistComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistComment(), 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 *GistComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *GistComment) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. The comment text. +// returns a *string when successful +func (m *GistComment) GetBody()(*string) { + return m.body +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *GistComment) 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 *GistComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *GistComment) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *GistComment) GetNodeId()(*string) { + return m.node_id +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *GistComment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GistComment) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *GistComment) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *GistComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *GistComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *GistComment) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. The comment text. +func (m *GistComment) SetBody(value *string)() { + m.body = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GistComment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *GistComment) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *GistComment) SetNodeId(value *string)() { + m.node_id = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *GistComment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *GistComment) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *GistComment) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type GistCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetNodeId()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetNodeId(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/gist_comment403_error.go b/pkg/github/models/gist_comment403_error.go new file mode 100644 index 00000000..1cdf600c --- /dev/null +++ b/pkg/github/models/gist_comment403_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 GistComment403Error 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 block property + block GistComment403Error_blockable + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewGistComment403Error instantiates a new GistComment403Error and sets the default values. +func NewGistComment403Error()(*GistComment403Error) { + m := &GistComment403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistComment403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistComment403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistComment403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *GistComment403Error) 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 *GistComment403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBlock gets the block property value. The block property +// returns a GistComment403Error_blockable when successful +func (m *GistComment403Error) GetBlock()(GistComment403Error_blockable) { + return m.block +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *GistComment403Error) 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 *GistComment403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["block"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistComment403Error_blockFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBlock(val.(GistComment403Error_blockable)) + } + 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 *GistComment403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *GistComment403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("block", m.GetBlock()) + 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 *GistComment403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBlock sets the block property value. The block property +func (m *GistComment403Error) SetBlock(value GistComment403Error_blockable)() { + m.block = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *GistComment403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *GistComment403Error) SetMessage(value *string)() { + m.message = value +} +type GistComment403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBlock()(GistComment403Error_blockable) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetBlock(value GistComment403Error_blockable)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/pkg/github/models/gist_comment403_error_escaped_block.go b/pkg/github/models/gist_comment403_error_escaped_block.go new file mode 100644 index 00000000..b90ac299 --- /dev/null +++ b/pkg/github/models/gist_comment403_error_escaped_block.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistComment403Error_block 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 *string + // The html_url property + html_url *string + // The reason property + reason *string +} +// NewGistComment403Error_block instantiates a new GistComment403Error_block and sets the default values. +func NewGistComment403Error_block()(*GistComment403Error_block) { + m := &GistComment403Error_block{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistComment403Error_blockFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistComment403Error_blockFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistComment403Error_block(), 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 *GistComment403Error_block) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *GistComment403Error_block) GetCreatedAt()(*string) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistComment403Error_block) 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.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *GistComment403Error_block) GetHtmlUrl()(*string) { + return m.html_url +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *GistComment403Error_block) GetReason()(*string) { + return m.reason +} +// Serialize serializes information the current object +func (m *GistComment403Error_block) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + 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 *GistComment403Error_block) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GistComment403Error_block) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *GistComment403Error_block) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetReason sets the reason property value. The reason property +func (m *GistComment403Error_block) SetReason(value *string)() { + m.reason = value +} +type GistComment403Error_blockable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetHtmlUrl()(*string) + GetReason()(*string) + SetCreatedAt(value *string)() + SetHtmlUrl(value *string)() + SetReason(value *string)() +} diff --git a/pkg/github/models/gist_commit.go b/pkg/github/models/gist_commit.go new file mode 100644 index 00000000..3f92d641 --- /dev/null +++ b/pkg/github/models/gist_commit.go @@ -0,0 +1,198 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GistCommit gist Commit +type GistCommit 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 change_status property + change_status GistCommit_change_statusable + // The committed_at property + committed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable + // The version property + version *string +} +// NewGistCommit instantiates a new GistCommit and sets the default values. +func NewGistCommit()(*GistCommit) { + m := &GistCommit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistCommit(), 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 *GistCommit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChangeStatus gets the change_status property value. The change_status property +// returns a GistCommit_change_statusable when successful +func (m *GistCommit) GetChangeStatus()(GistCommit_change_statusable) { + return m.change_status +} +// GetCommittedAt gets the committed_at property value. The committed_at property +// returns a *Time when successful +func (m *GistCommit) GetCommittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.committed_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistCommit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["change_status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistCommit_change_statusFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetChangeStatus(val.(GistCommit_change_statusable)) + } + return nil + } + res["committed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCommittedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GistCommit) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *GistCommit) GetUser()(NullableSimpleUserable) { + return m.user +} +// GetVersion gets the version property value. The version property +// returns a *string when successful +func (m *GistCommit) GetVersion()(*string) { + return m.version +} +// Serialize serializes information the current object +func (m *GistCommit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("change_status", m.GetChangeStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("committed_at", m.GetCommittedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("version", m.GetVersion()) + 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 *GistCommit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChangeStatus sets the change_status property value. The change_status property +func (m *GistCommit) SetChangeStatus(value GistCommit_change_statusable)() { + m.change_status = value +} +// SetCommittedAt sets the committed_at property value. The committed_at property +func (m *GistCommit) SetCommittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.committed_at = value +} +// SetUrl sets the url property value. The url property +func (m *GistCommit) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *GistCommit) SetUser(value NullableSimpleUserable)() { + m.user = value +} +// SetVersion sets the version property value. The version property +func (m *GistCommit) SetVersion(value *string)() { + m.version = value +} +type GistCommitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChangeStatus()(GistCommit_change_statusable) + GetCommittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + GetVersion()(*string) + SetChangeStatus(value GistCommit_change_statusable)() + SetCommittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() + SetVersion(value *string)() +} diff --git a/pkg/github/models/gist_commit_escaped_change_escaped_status.go b/pkg/github/models/gist_commit_escaped_change_escaped_status.go new file mode 100644 index 00000000..356c9de3 --- /dev/null +++ b/pkg/github/models/gist_commit_escaped_change_escaped_status.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistCommit_change_status 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 additions property + additions *int32 + // The deletions property + deletions *int32 + // The total property + total *int32 +} +// NewGistCommit_change_status instantiates a new GistCommit_change_status and sets the default values. +func NewGistCommit_change_status()(*GistCommit_change_status) { + m := &GistCommit_change_status{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistCommit_change_statusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistCommit_change_statusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistCommit_change_status(), 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 *GistCommit_change_status) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdditions gets the additions property value. The additions property +// returns a *int32 when successful +func (m *GistCommit_change_status) GetAdditions()(*int32) { + return m.additions +} +// GetDeletions gets the deletions property value. The deletions property +// returns a *int32 when successful +func (m *GistCommit_change_status) GetDeletions()(*int32) { + return m.deletions +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistCommit_change_status) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["additions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAdditions(val) + } + return nil + } + res["deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDeletions(val) + } + return nil + } + res["total"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotal(val) + } + return nil + } + return res +} +// GetTotal gets the total property value. The total property +// returns a *int32 when successful +func (m *GistCommit_change_status) GetTotal()(*int32) { + return m.total +} +// Serialize serializes information the current object +func (m *GistCommit_change_status) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("additions", m.GetAdditions()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("deletions", m.GetDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total", m.GetTotal()) + 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 *GistCommit_change_status) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdditions sets the additions property value. The additions property +func (m *GistCommit_change_status) SetAdditions(value *int32)() { + m.additions = value +} +// SetDeletions sets the deletions property value. The deletions property +func (m *GistCommit_change_status) SetDeletions(value *int32)() { + m.deletions = value +} +// SetTotal sets the total property value. The total property +func (m *GistCommit_change_status) SetTotal(value *int32)() { + m.total = value +} +type GistCommit_change_statusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdditions()(*int32) + GetDeletions()(*int32) + GetTotal()(*int32) + SetAdditions(value *int32)() + SetDeletions(value *int32)() + SetTotal(value *int32)() +} diff --git a/pkg/github/models/gist_history.go b/pkg/github/models/gist_history.go new file mode 100644 index 00000000..1c1afaf8 --- /dev/null +++ b/pkg/github/models/gist_history.go @@ -0,0 +1,198 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GistHistory gist History +type GistHistory 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 change_status property + change_status GistHistory_change_statusable + // The committed_at property + committed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable + // The version property + version *string +} +// NewGistHistory instantiates a new GistHistory and sets the default values. +func NewGistHistory()(*GistHistory) { + m := &GistHistory{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistHistoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistHistoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistHistory(), 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 *GistHistory) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChangeStatus gets the change_status property value. The change_status property +// returns a GistHistory_change_statusable when successful +func (m *GistHistory) GetChangeStatus()(GistHistory_change_statusable) { + return m.change_status +} +// GetCommittedAt gets the committed_at property value. The committed_at property +// returns a *Time when successful +func (m *GistHistory) GetCommittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.committed_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistHistory) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["change_status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistHistory_change_statusFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetChangeStatus(val.(GistHistory_change_statusable)) + } + return nil + } + res["committed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCommittedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GistHistory) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *GistHistory) GetUser()(NullableSimpleUserable) { + return m.user +} +// GetVersion gets the version property value. The version property +// returns a *string when successful +func (m *GistHistory) GetVersion()(*string) { + return m.version +} +// Serialize serializes information the current object +func (m *GistHistory) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("change_status", m.GetChangeStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("committed_at", m.GetCommittedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("version", m.GetVersion()) + 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 *GistHistory) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChangeStatus sets the change_status property value. The change_status property +func (m *GistHistory) SetChangeStatus(value GistHistory_change_statusable)() { + m.change_status = value +} +// SetCommittedAt sets the committed_at property value. The committed_at property +func (m *GistHistory) SetCommittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.committed_at = value +} +// SetUrl sets the url property value. The url property +func (m *GistHistory) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *GistHistory) SetUser(value NullableSimpleUserable)() { + m.user = value +} +// SetVersion sets the version property value. The version property +func (m *GistHistory) SetVersion(value *string)() { + m.version = value +} +type GistHistoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChangeStatus()(GistHistory_change_statusable) + GetCommittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + GetVersion()(*string) + SetChangeStatus(value GistHistory_change_statusable)() + SetCommittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() + SetVersion(value *string)() +} diff --git a/pkg/github/models/gist_history_escaped_change_escaped_status.go b/pkg/github/models/gist_history_escaped_change_escaped_status.go new file mode 100644 index 00000000..6217ceb8 --- /dev/null +++ b/pkg/github/models/gist_history_escaped_change_escaped_status.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistHistory_change_status 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 additions property + additions *int32 + // The deletions property + deletions *int32 + // The total property + total *int32 +} +// NewGistHistory_change_status instantiates a new GistHistory_change_status and sets the default values. +func NewGistHistory_change_status()(*GistHistory_change_status) { + m := &GistHistory_change_status{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistHistory_change_statusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistHistory_change_statusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistHistory_change_status(), 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 *GistHistory_change_status) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdditions gets the additions property value. The additions property +// returns a *int32 when successful +func (m *GistHistory_change_status) GetAdditions()(*int32) { + return m.additions +} +// GetDeletions gets the deletions property value. The deletions property +// returns a *int32 when successful +func (m *GistHistory_change_status) GetDeletions()(*int32) { + return m.deletions +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistHistory_change_status) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["additions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAdditions(val) + } + return nil + } + res["deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDeletions(val) + } + return nil + } + res["total"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotal(val) + } + return nil + } + return res +} +// GetTotal gets the total property value. The total property +// returns a *int32 when successful +func (m *GistHistory_change_status) GetTotal()(*int32) { + return m.total +} +// Serialize serializes information the current object +func (m *GistHistory_change_status) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("additions", m.GetAdditions()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("deletions", m.GetDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total", m.GetTotal()) + 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 *GistHistory_change_status) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdditions sets the additions property value. The additions property +func (m *GistHistory_change_status) SetAdditions(value *int32)() { + m.additions = value +} +// SetDeletions sets the deletions property value. The deletions property +func (m *GistHistory_change_status) SetDeletions(value *int32)() { + m.deletions = value +} +// SetTotal sets the total property value. The total property +func (m *GistHistory_change_status) SetTotal(value *int32)() { + m.total = value +} +type GistHistory_change_statusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdditions()(*int32) + GetDeletions()(*int32) + GetTotal()(*int32) + SetAdditions(value *int32)() + SetDeletions(value *int32)() + SetTotal(value *int32)() +} diff --git a/pkg/github/models/gist_simple.go b/pkg/github/models/gist_simple.go new file mode 100644 index 00000000..a6d9d046 --- /dev/null +++ b/pkg/github/models/gist_simple.go @@ -0,0 +1,691 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GistSimple gist Simple +type GistSimple 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 comments property + comments *int32 + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The created_at property + created_at *string + // The description property + description *string + // The files property + files GistSimple_filesable + // Gist + fork_of GistSimple_fork_ofable + // The forks property + // Deprecated: + forks []GistSimple_forksable + // The forks_url property + forks_url *string + // The git_pull_url property + git_pull_url *string + // The git_push_url property + git_push_url *string + // The history property + // Deprecated: + history []GistHistoryable + // The html_url property + html_url *string + // The id property + id *string + // The node_id property + node_id *string + // A GitHub user. + owner SimpleUserable + // The public property + public *bool + // The truncated property + truncated *bool + // The updated_at property + updated_at *string + // The url property + url *string + // The user property + user *string +} +// NewGistSimple instantiates a new GistSimple and sets the default values. +func NewGistSimple()(*GistSimple) { + m := &GistSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistSimple(), 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 *GistSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. The comments property +// returns a *int32 when successful +func (m *GistSimple) GetComments()(*int32) { + return m.comments +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *GistSimple) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *GistSimple) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *GistSimple) GetCreatedAt()(*string) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *GistSimple) 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 *GistSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetComments(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + 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["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistSimple_filesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetFiles(val.(GistSimple_filesable)) + } + return nil + } + res["fork_of"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistSimple_fork_ofFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetForkOf(val.(GistSimple_fork_ofable)) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGistSimple_forksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GistSimple_forksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GistSimple_forksable) + } + } + m.SetForks(res) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["git_pull_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitPullUrl(val) + } + return nil + } + res["git_push_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitPushUrl(val) + } + return nil + } + res["history"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGistHistoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GistHistoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GistHistoryable) + } + } + m.SetHistory(res) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPublic(val) + } + return nil + } + res["truncated"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTruncated(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUser(val) + } + return nil + } + return res +} +// GetFiles gets the files property value. The files property +// returns a GistSimple_filesable when successful +func (m *GistSimple) GetFiles()(GistSimple_filesable) { + return m.files +} +// GetForkOf gets the fork_of property value. Gist +// returns a GistSimple_fork_ofable when successful +func (m *GistSimple) GetForkOf()(GistSimple_fork_ofable) { + return m.fork_of +} +// GetForks gets the forks property value. The forks property +// Deprecated: +// returns a []GistSimple_forksable when successful +func (m *GistSimple) GetForks()([]GistSimple_forksable) { + return m.forks +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *GistSimple) GetForksUrl()(*string) { + return m.forks_url +} +// GetGitPullUrl gets the git_pull_url property value. The git_pull_url property +// returns a *string when successful +func (m *GistSimple) GetGitPullUrl()(*string) { + return m.git_pull_url +} +// GetGitPushUrl gets the git_push_url property value. The git_push_url property +// returns a *string when successful +func (m *GistSimple) GetGitPushUrl()(*string) { + return m.git_push_url +} +// GetHistory gets the history property value. The history property +// Deprecated: +// returns a []GistHistoryable when successful +func (m *GistSimple) GetHistory()([]GistHistoryable) { + return m.history +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *GistSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *string when successful +func (m *GistSimple) GetId()(*string) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *GistSimple) GetNodeId()(*string) { + return m.node_id +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *GistSimple) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPublic gets the public property value. The public property +// returns a *bool when successful +func (m *GistSimple) GetPublic()(*bool) { + return m.public +} +// GetTruncated gets the truncated property value. The truncated property +// returns a *bool when successful +func (m *GistSimple) GetTruncated()(*bool) { + return m.truncated +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *GistSimple) GetUpdatedAt()(*string) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GistSimple) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. The user property +// returns a *string when successful +func (m *GistSimple) GetUser()(*string) { + return m.user +} +// Serialize serializes information the current object +func (m *GistSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("files", m.GetFiles()) + if err != nil { + return err + } + } + if m.GetForks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetForks())) + for i, v := range m.GetForks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("forks", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("fork_of", m.GetForkOf()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_pull_url", m.GetGitPullUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_push_url", m.GetGitPushUrl()) + if err != nil { + return err + } + } + if m.GetHistory() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetHistory())) + for i, v := range m.GetHistory() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("history", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("public", m.GetPublic()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("truncated", m.GetTruncated()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user", m.GetUser()) + 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 *GistSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. The comments property +func (m *GistSimple) SetComments(value *int32)() { + m.comments = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *GistSimple) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *GistSimple) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GistSimple) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *GistSimple) SetDescription(value *string)() { + m.description = value +} +// SetFiles sets the files property value. The files property +func (m *GistSimple) SetFiles(value GistSimple_filesable)() { + m.files = value +} +// SetForkOf sets the fork_of property value. Gist +func (m *GistSimple) SetForkOf(value GistSimple_fork_ofable)() { + m.fork_of = value +} +// SetForks sets the forks property value. The forks property +// Deprecated: +func (m *GistSimple) SetForks(value []GistSimple_forksable)() { + m.forks = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *GistSimple) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetGitPullUrl sets the git_pull_url property value. The git_pull_url property +func (m *GistSimple) SetGitPullUrl(value *string)() { + m.git_pull_url = value +} +// SetGitPushUrl sets the git_push_url property value. The git_push_url property +func (m *GistSimple) SetGitPushUrl(value *string)() { + m.git_push_url = value +} +// SetHistory sets the history property value. The history property +// Deprecated: +func (m *GistSimple) SetHistory(value []GistHistoryable)() { + m.history = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *GistSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *GistSimple) SetId(value *string)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *GistSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *GistSimple) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPublic sets the public property value. The public property +func (m *GistSimple) SetPublic(value *bool)() { + m.public = value +} +// SetTruncated sets the truncated property value. The truncated property +func (m *GistSimple) SetTruncated(value *bool)() { + m.truncated = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *GistSimple) SetUpdatedAt(value *string)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *GistSimple) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. The user property +func (m *GistSimple) SetUser(value *string)() { + m.user = value +} +type GistSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()(*int32) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCreatedAt()(*string) + GetDescription()(*string) + GetFiles()(GistSimple_filesable) + GetForkOf()(GistSimple_fork_ofable) + GetForks()([]GistSimple_forksable) + GetForksUrl()(*string) + GetGitPullUrl()(*string) + GetGitPushUrl()(*string) + GetHistory()([]GistHistoryable) + GetHtmlUrl()(*string) + GetId()(*string) + GetNodeId()(*string) + GetOwner()(SimpleUserable) + GetPublic()(*bool) + GetTruncated()(*bool) + GetUpdatedAt()(*string) + GetUrl()(*string) + GetUser()(*string) + SetComments(value *int32)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCreatedAt(value *string)() + SetDescription(value *string)() + SetFiles(value GistSimple_filesable)() + SetForkOf(value GistSimple_fork_ofable)() + SetForks(value []GistSimple_forksable)() + SetForksUrl(value *string)() + SetGitPullUrl(value *string)() + SetGitPushUrl(value *string)() + SetHistory(value []GistHistoryable)() + SetHtmlUrl(value *string)() + SetId(value *string)() + SetNodeId(value *string)() + SetOwner(value SimpleUserable)() + SetPublic(value *bool)() + SetTruncated(value *bool)() + SetUpdatedAt(value *string)() + SetUrl(value *string)() + SetUser(value *string)() +} diff --git a/pkg/github/models/gist_simple403_error.go b/pkg/github/models/gist_simple403_error.go new file mode 100644 index 00000000..fa0e1758 --- /dev/null +++ b/pkg/github/models/gist_simple403_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 GistSimple403Error 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 block property + block GistSimple403Error_blockable + // The documentation_url property + documentation_url *string + // The message property + message *string +} +// NewGistSimple403Error instantiates a new GistSimple403Error and sets the default values. +func NewGistSimple403Error()(*GistSimple403Error) { + m := &GistSimple403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistSimple403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistSimple403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistSimple403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *GistSimple403Error) 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 *GistSimple403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBlock gets the block property value. The block property +// returns a GistSimple403Error_blockable when successful +func (m *GistSimple403Error) GetBlock()(GistSimple403Error_blockable) { + return m.block +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *GistSimple403Error) 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 *GistSimple403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["block"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistSimple403Error_blockFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBlock(val.(GistSimple403Error_blockable)) + } + 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 *GistSimple403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *GistSimple403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("block", m.GetBlock()) + 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 *GistSimple403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBlock sets the block property value. The block property +func (m *GistSimple403Error) SetBlock(value GistSimple403Error_blockable)() { + m.block = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *GistSimple403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *GistSimple403Error) SetMessage(value *string)() { + m.message = value +} +type GistSimple403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBlock()(GistSimple403Error_blockable) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetBlock(value GistSimple403Error_blockable)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/pkg/github/models/gist_simple403_error_escaped_block.go b/pkg/github/models/gist_simple403_error_escaped_block.go new file mode 100644 index 00000000..b5a16f2c --- /dev/null +++ b/pkg/github/models/gist_simple403_error_escaped_block.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistSimple403Error_block 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 *string + // The html_url property + html_url *string + // The reason property + reason *string +} +// NewGistSimple403Error_block instantiates a new GistSimple403Error_block and sets the default values. +func NewGistSimple403Error_block()(*GistSimple403Error_block) { + m := &GistSimple403Error_block{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistSimple403Error_blockFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistSimple403Error_blockFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistSimple403Error_block(), 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 *GistSimple403Error_block) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *GistSimple403Error_block) GetCreatedAt()(*string) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GistSimple403Error_block) 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.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *GistSimple403Error_block) GetHtmlUrl()(*string) { + return m.html_url +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *GistSimple403Error_block) GetReason()(*string) { + return m.reason +} +// Serialize serializes information the current object +func (m *GistSimple403Error_block) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + 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 *GistSimple403Error_block) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GistSimple403Error_block) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *GistSimple403Error_block) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetReason sets the reason property value. The reason property +func (m *GistSimple403Error_block) SetReason(value *string)() { + m.reason = value +} +type GistSimple403Error_blockable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetHtmlUrl()(*string) + GetReason()(*string) + SetCreatedAt(value *string)() + SetHtmlUrl(value *string)() + SetReason(value *string)() +} diff --git a/pkg/github/models/gist_simple_escaped_files.go b/pkg/github/models/gist_simple_escaped_files.go new file mode 100644 index 00000000..aff8eb1b --- /dev/null +++ b/pkg/github/models/gist_simple_escaped_files.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistSimple_files struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewGistSimple_files instantiates a new GistSimple_files and sets the default values. +func NewGistSimple_files()(*GistSimple_files) { + m := &GistSimple_files{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistSimple_filesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistSimple_filesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistSimple_files(), 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 *GistSimple_files) 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 *GistSimple_files) 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 *GistSimple_files) 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 *GistSimple_files) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type GistSimple_filesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/gist_simple_escaped_fork_escaped_of.go b/pkg/github/models/gist_simple_escaped_fork_escaped_of.go new file mode 100644 index 00000000..2971159b --- /dev/null +++ b/pkg/github/models/gist_simple_escaped_fork_escaped_of.go @@ -0,0 +1,633 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GistSimple_fork_of gist +type GistSimple_fork_of 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 comments property + comments *int32 + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + description *string + // The files property + files GistSimple_fork_of_filesable + // The forks property + forks i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + // The forks_url property + forks_url *string + // The git_pull_url property + git_pull_url *string + // The git_push_url property + git_push_url *string + // The history property + history i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + // The html_url property + html_url *string + // The id property + id *string + // The node_id property + node_id *string + // A GitHub user. + owner NullableSimpleUserable + // The public property + public *bool + // The truncated property + truncated *bool + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewGistSimple_fork_of instantiates a new GistSimple_fork_of and sets the default values. +func NewGistSimple_fork_of()(*GistSimple_fork_of) { + m := &GistSimple_fork_of{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistSimple_fork_ofFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistSimple_fork_ofFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistSimple_fork_of(), 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 *GistSimple_fork_of) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. The comments property +// returns a *int32 when successful +func (m *GistSimple_fork_of) GetComments()(*int32) { + return m.comments +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *GistSimple_fork_of) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *GistSimple_fork_of) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *GistSimple_fork_of) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *GistSimple_fork_of) 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 *GistSimple_fork_of) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetComments(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + 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["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGistSimple_fork_of_filesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetFiles(val.(GistSimple_fork_of_filesable)) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetForks(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["git_pull_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitPullUrl(val) + } + return nil + } + res["git_push_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitPushUrl(val) + } + return nil + } + res["history"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHistory(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableSimpleUserable)) + } + return nil + } + res["public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPublic(val) + } + return nil + } + res["truncated"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTruncated(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetFiles gets the files property value. The files property +// returns a GistSimple_fork_of_filesable when successful +func (m *GistSimple_fork_of) GetFiles()(GistSimple_fork_of_filesable) { + return m.files +} +// GetForks gets the forks property value. The forks property +// returns a UntypedNodeable when successful +func (m *GistSimple_fork_of) GetForks()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + return m.forks +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *GistSimple_fork_of) GetForksUrl()(*string) { + return m.forks_url +} +// GetGitPullUrl gets the git_pull_url property value. The git_pull_url property +// returns a *string when successful +func (m *GistSimple_fork_of) GetGitPullUrl()(*string) { + return m.git_pull_url +} +// GetGitPushUrl gets the git_push_url property value. The git_push_url property +// returns a *string when successful +func (m *GistSimple_fork_of) GetGitPushUrl()(*string) { + return m.git_push_url +} +// GetHistory gets the history property value. The history property +// returns a UntypedNodeable when successful +func (m *GistSimple_fork_of) GetHistory()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + return m.history +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *GistSimple_fork_of) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *string when successful +func (m *GistSimple_fork_of) GetId()(*string) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *GistSimple_fork_of) GetNodeId()(*string) { + return m.node_id +} +// GetOwner gets the owner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *GistSimple_fork_of) GetOwner()(NullableSimpleUserable) { + return m.owner +} +// GetPublic gets the public property value. The public property +// returns a *bool when successful +func (m *GistSimple_fork_of) GetPublic()(*bool) { + return m.public +} +// GetTruncated gets the truncated property value. The truncated property +// returns a *bool when successful +func (m *GistSimple_fork_of) GetTruncated()(*bool) { + return m.truncated +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *GistSimple_fork_of) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GistSimple_fork_of) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *GistSimple_fork_of) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *GistSimple_fork_of) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("files", m.GetFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_pull_url", m.GetGitPullUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_push_url", m.GetGitPushUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("history", m.GetHistory()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("public", m.GetPublic()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("truncated", m.GetTruncated()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *GistSimple_fork_of) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. The comments property +func (m *GistSimple_fork_of) SetComments(value *int32)() { + m.comments = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *GistSimple_fork_of) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *GistSimple_fork_of) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GistSimple_fork_of) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *GistSimple_fork_of) SetDescription(value *string)() { + m.description = value +} +// SetFiles sets the files property value. The files property +func (m *GistSimple_fork_of) SetFiles(value GistSimple_fork_of_filesable)() { + m.files = value +} +// SetForks sets the forks property value. The forks property +func (m *GistSimple_fork_of) SetForks(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() { + m.forks = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *GistSimple_fork_of) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetGitPullUrl sets the git_pull_url property value. The git_pull_url property +func (m *GistSimple_fork_of) SetGitPullUrl(value *string)() { + m.git_pull_url = value +} +// SetGitPushUrl sets the git_push_url property value. The git_push_url property +func (m *GistSimple_fork_of) SetGitPushUrl(value *string)() { + m.git_push_url = value +} +// SetHistory sets the history property value. The history property +func (m *GistSimple_fork_of) SetHistory(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() { + m.history = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *GistSimple_fork_of) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *GistSimple_fork_of) SetId(value *string)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *GistSimple_fork_of) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *GistSimple_fork_of) SetOwner(value NullableSimpleUserable)() { + m.owner = value +} +// SetPublic sets the public property value. The public property +func (m *GistSimple_fork_of) SetPublic(value *bool)() { + m.public = value +} +// SetTruncated sets the truncated property value. The truncated property +func (m *GistSimple_fork_of) SetTruncated(value *bool)() { + m.truncated = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *GistSimple_fork_of) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *GistSimple_fork_of) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *GistSimple_fork_of) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type GistSimple_fork_ofable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()(*int32) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetFiles()(GistSimple_fork_of_filesable) + GetForks()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + GetForksUrl()(*string) + GetGitPullUrl()(*string) + GetGitPushUrl()(*string) + GetHistory()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + GetHtmlUrl()(*string) + GetId()(*string) + GetNodeId()(*string) + GetOwner()(NullableSimpleUserable) + GetPublic()(*bool) + GetTruncated()(*bool) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetComments(value *int32)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetFiles(value GistSimple_fork_of_filesable)() + SetForks(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() + SetForksUrl(value *string)() + SetGitPullUrl(value *string)() + SetGitPushUrl(value *string)() + SetHistory(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() + SetHtmlUrl(value *string)() + SetId(value *string)() + SetNodeId(value *string)() + SetOwner(value NullableSimpleUserable)() + SetPublic(value *bool)() + SetTruncated(value *bool)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/gist_simple_escaped_fork_escaped_of_escaped_files.go b/pkg/github/models/gist_simple_escaped_fork_escaped_of_escaped_files.go new file mode 100644 index 00000000..9c4e8587 --- /dev/null +++ b/pkg/github/models/gist_simple_escaped_fork_escaped_of_escaped_files.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistSimple_fork_of_files struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewGistSimple_fork_of_files instantiates a new GistSimple_fork_of_files and sets the default values. +func NewGistSimple_fork_of_files()(*GistSimple_fork_of_files) { + m := &GistSimple_fork_of_files{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistSimple_fork_of_filesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistSimple_fork_of_filesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistSimple_fork_of_files(), 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 *GistSimple_fork_of_files) 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 *GistSimple_fork_of_files) 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 *GistSimple_fork_of_files) 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 *GistSimple_fork_of_files) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type GistSimple_fork_of_filesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/gist_simple_escaped_forks.go b/pkg/github/models/gist_simple_escaped_forks.go new file mode 100644 index 00000000..7f07a35d --- /dev/null +++ b/pkg/github/models/gist_simple_escaped_forks.go @@ -0,0 +1,197 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GistSimple_forks 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 id property + id *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // Public User + user PublicUserable +} +// NewGistSimple_forks instantiates a new GistSimple_forks and sets the default values. +func NewGistSimple_forks()(*GistSimple_forks) { + m := &GistSimple_forks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGistSimple_forksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGistSimple_forksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGistSimple_forks(), 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 *GistSimple_forks) 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 *GistSimple_forks) 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 *GistSimple_forks) 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePublicUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(PublicUserable)) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *string when successful +func (m *GistSimple_forks) GetId()(*string) { + return m.id +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *GistSimple_forks) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GistSimple_forks) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. Public User +// returns a PublicUserable when successful +func (m *GistSimple_forks) GetUser()(PublicUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *GistSimple_forks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *GistSimple_forks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GistSimple_forks) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *GistSimple_forks) SetId(value *string)() { + m.id = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *GistSimple_forks) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *GistSimple_forks) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. Public User +func (m *GistSimple_forks) SetUser(value PublicUserable)() { + m.user = value +} +type GistSimple_forksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(PublicUserable) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value PublicUserable)() +} diff --git a/pkg/github/models/git_commit.go b/pkg/github/models/git_commit.go new file mode 100644 index 00000000..47e88258 --- /dev/null +++ b/pkg/github/models/git_commit.go @@ -0,0 +1,354 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GitCommit low-level Git commit operations within a repository +type GitCommit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Identifying information for the git-user + author GitCommit_authorable + // Identifying information for the git-user + committer GitCommit_committerable + // The html_url property + html_url *string + // Message describing the purpose of the commit + message *string + // The node_id property + node_id *string + // The parents property + parents []GitCommit_parentsable + // SHA for the commit + sha *string + // The tree property + tree GitCommit_treeable + // The url property + url *string + // The verification property + verification GitCommit_verificationable +} +// NewGitCommit instantiates a new GitCommit and sets the default values. +func NewGitCommit()(*GitCommit) { + m := &GitCommit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitCommit(), 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 *GitCommit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. Identifying information for the git-user +// returns a GitCommit_authorable when successful +func (m *GitCommit) GetAuthor()(GitCommit_authorable) { + return m.author +} +// GetCommitter gets the committer property value. Identifying information for the git-user +// returns a GitCommit_committerable when successful +func (m *GitCommit) GetCommitter()(GitCommit_committerable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitCommit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGitCommit_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(GitCommit_authorable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGitCommit_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(GitCommit_committerable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(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 + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["parents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGitCommit_parentsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GitCommit_parentsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GitCommit_parentsable) + } + } + m.SetParents(res) + } + return nil + } + 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["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGitCommit_treeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTree(val.(GitCommit_treeable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verification"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGitCommit_verificationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerification(val.(GitCommit_verificationable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *GitCommit) GetHtmlUrl()(*string) { + return m.html_url +} +// GetMessage gets the message property value. Message describing the purpose of the commit +// returns a *string when successful +func (m *GitCommit) GetMessage()(*string) { + return m.message +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *GitCommit) GetNodeId()(*string) { + return m.node_id +} +// GetParents gets the parents property value. The parents property +// returns a []GitCommit_parentsable when successful +func (m *GitCommit) GetParents()([]GitCommit_parentsable) { + return m.parents +} +// GetSha gets the sha property value. SHA for the commit +// returns a *string when successful +func (m *GitCommit) GetSha()(*string) { + return m.sha +} +// GetTree gets the tree property value. The tree property +// returns a GitCommit_treeable when successful +func (m *GitCommit) GetTree()(GitCommit_treeable) { + return m.tree +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitCommit) GetUrl()(*string) { + return m.url +} +// GetVerification gets the verification property value. The verification property +// returns a GitCommit_verificationable when successful +func (m *GitCommit) GetVerification()(GitCommit_verificationable) { + return m.verification +} +// Serialize serializes information the current object +func (m *GitCommit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetParents() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetParents())) + for i, v := range m.GetParents() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("parents", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tree", m.GetTree()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verification", m.GetVerification()) + 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 *GitCommit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. Identifying information for the git-user +func (m *GitCommit) SetAuthor(value GitCommit_authorable)() { + m.author = value +} +// SetCommitter sets the committer property value. Identifying information for the git-user +func (m *GitCommit) SetCommitter(value GitCommit_committerable)() { + m.committer = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *GitCommit) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetMessage sets the message property value. Message describing the purpose of the commit +func (m *GitCommit) SetMessage(value *string)() { + m.message = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *GitCommit) SetNodeId(value *string)() { + m.node_id = value +} +// SetParents sets the parents property value. The parents property +func (m *GitCommit) SetParents(value []GitCommit_parentsable)() { + m.parents = value +} +// SetSha sets the sha property value. SHA for the commit +func (m *GitCommit) SetSha(value *string)() { + m.sha = value +} +// SetTree sets the tree property value. The tree property +func (m *GitCommit) SetTree(value GitCommit_treeable)() { + m.tree = value +} +// SetUrl sets the url property value. The url property +func (m *GitCommit) SetUrl(value *string)() { + m.url = value +} +// SetVerification sets the verification property value. The verification property +func (m *GitCommit) SetVerification(value GitCommit_verificationable)() { + m.verification = value +} +type GitCommitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(GitCommit_authorable) + GetCommitter()(GitCommit_committerable) + GetHtmlUrl()(*string) + GetMessage()(*string) + GetNodeId()(*string) + GetParents()([]GitCommit_parentsable) + GetSha()(*string) + GetTree()(GitCommit_treeable) + GetUrl()(*string) + GetVerification()(GitCommit_verificationable) + SetAuthor(value GitCommit_authorable)() + SetCommitter(value GitCommit_committerable)() + SetHtmlUrl(value *string)() + SetMessage(value *string)() + SetNodeId(value *string)() + SetParents(value []GitCommit_parentsable)() + SetSha(value *string)() + SetTree(value GitCommit_treeable)() + SetUrl(value *string)() + SetVerification(value GitCommit_verificationable)() +} diff --git a/pkg/github/models/git_commit_escaped_author.go b/pkg/github/models/git_commit_escaped_author.go new file mode 100644 index 00000000..c385face --- /dev/null +++ b/pkg/github/models/git_commit_escaped_author.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GitCommit_author identifying information for the git-user +type GitCommit_author struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Timestamp of the commit + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Git email address of the user + email *string + // Name of the git user + name *string +} +// NewGitCommit_author instantiates a new GitCommit_author and sets the default values. +func NewGitCommit_author()(*GitCommit_author) { + m := &GitCommit_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitCommit_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitCommit_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitCommit_author(), 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 *GitCommit_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. Timestamp of the commit +// returns a *Time when successful +func (m *GitCommit_author) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. Git email address of the user +// returns a *string when successful +func (m *GitCommit_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitCommit_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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. Name of the git user +// returns a *string when successful +func (m *GitCommit_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *GitCommit_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *GitCommit_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. Timestamp of the commit +func (m *GitCommit_author) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. Git email address of the user +func (m *GitCommit_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the git user +func (m *GitCommit_author) SetName(value *string)() { + m.name = value +} +type GitCommit_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/git_commit_escaped_committer.go b/pkg/github/models/git_commit_escaped_committer.go new file mode 100644 index 00000000..45b9e141 --- /dev/null +++ b/pkg/github/models/git_commit_escaped_committer.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GitCommit_committer identifying information for the git-user +type GitCommit_committer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Timestamp of the commit + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Git email address of the user + email *string + // Name of the git user + name *string +} +// NewGitCommit_committer instantiates a new GitCommit_committer and sets the default values. +func NewGitCommit_committer()(*GitCommit_committer) { + m := &GitCommit_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitCommit_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitCommit_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitCommit_committer(), 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 *GitCommit_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. Timestamp of the commit +// returns a *Time when successful +func (m *GitCommit_committer) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. Git email address of the user +// returns a *string when successful +func (m *GitCommit_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitCommit_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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. Name of the git user +// returns a *string when successful +func (m *GitCommit_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *GitCommit_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *GitCommit_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. Timestamp of the commit +func (m *GitCommit_committer) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. Git email address of the user +func (m *GitCommit_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the git user +func (m *GitCommit_committer) SetName(value *string)() { + m.name = value +} +type GitCommit_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/git_commit_escaped_parents.go b/pkg/github/models/git_commit_escaped_parents.go new file mode 100644 index 00000000..f439f62f --- /dev/null +++ b/pkg/github/models/git_commit_escaped_parents.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GitCommit_parents 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 html_url property + html_url *string + // SHA for the commit + sha *string + // The url property + url *string +} +// NewGitCommit_parents instantiates a new GitCommit_parents and sets the default values. +func NewGitCommit_parents()(*GitCommit_parents) { + m := &GitCommit_parents{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitCommit_parentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitCommit_parentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitCommit_parents(), 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 *GitCommit_parents) 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 *GitCommit_parents) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *GitCommit_parents) GetHtmlUrl()(*string) { + return m.html_url +} +// GetSha gets the sha property value. SHA for the commit +// returns a *string when successful +func (m *GitCommit_parents) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitCommit_parents) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GitCommit_parents) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GitCommit_parents) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *GitCommit_parents) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetSha sets the sha property value. SHA for the commit +func (m *GitCommit_parents) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *GitCommit_parents) SetUrl(value *string)() { + m.url = value +} +type GitCommit_parentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetSha()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/git_commit_escaped_tree.go b/pkg/github/models/git_commit_escaped_tree.go new file mode 100644 index 00000000..6c2fb88b --- /dev/null +++ b/pkg/github/models/git_commit_escaped_tree.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GitCommit_tree 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 for the commit + sha *string + // The url property + url *string +} +// NewGitCommit_tree instantiates a new GitCommit_tree and sets the default values. +func NewGitCommit_tree()(*GitCommit_tree) { + m := &GitCommit_tree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitCommit_treeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitCommit_treeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitCommit_tree(), 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 *GitCommit_tree) 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 *GitCommit_tree) 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. SHA for the commit +// returns a *string when successful +func (m *GitCommit_tree) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitCommit_tree) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GitCommit_tree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GitCommit_tree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. SHA for the commit +func (m *GitCommit_tree) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *GitCommit_tree) SetUrl(value *string)() { + m.url = value +} +type GitCommit_treeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/git_commit_escaped_verification.go b/pkg/github/models/git_commit_escaped_verification.go new file mode 100644 index 00000000..aa555741 --- /dev/null +++ b/pkg/github/models/git_commit_escaped_verification.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GitCommit_verification 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 payload property + payload *string + // The reason property + reason *string + // The signature property + signature *string + // The verified property + verified *bool +} +// NewGitCommit_verification instantiates a new GitCommit_verification and sets the default values. +func NewGitCommit_verification()(*GitCommit_verification) { + m := &GitCommit_verification{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitCommit_verificationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitCommit_verificationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitCommit_verification(), 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 *GitCommit_verification) 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 *GitCommit_verification) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["signature"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSignature(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetPayload gets the payload property value. The payload property +// returns a *string when successful +func (m *GitCommit_verification) GetPayload()(*string) { + return m.payload +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *GitCommit_verification) GetReason()(*string) { + return m.reason +} +// GetSignature gets the signature property value. The signature property +// returns a *string when successful +func (m *GitCommit_verification) GetSignature()(*string) { + return m.signature +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *GitCommit_verification) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *GitCommit_verification) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("signature", m.GetSignature()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + 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 *GitCommit_verification) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPayload sets the payload property value. The payload property +func (m *GitCommit_verification) SetPayload(value *string)() { + m.payload = value +} +// SetReason sets the reason property value. The reason property +func (m *GitCommit_verification) SetReason(value *string)() { + m.reason = value +} +// SetSignature sets the signature property value. The signature property +func (m *GitCommit_verification) SetSignature(value *string)() { + m.signature = value +} +// SetVerified sets the verified property value. The verified property +func (m *GitCommit_verification) SetVerified(value *bool)() { + m.verified = value +} +type GitCommit_verificationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPayload()(*string) + GetReason()(*string) + GetSignature()(*string) + GetVerified()(*bool) + SetPayload(value *string)() + SetReason(value *string)() + SetSignature(value *string)() + SetVerified(value *bool)() +} diff --git a/pkg/github/models/git_ref.go b/pkg/github/models/git_ref.go new file mode 100644 index 00000000..c99f171a --- /dev/null +++ b/pkg/github/models/git_ref.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GitRef git references within a repository +type GitRef 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 node_id property + node_id *string + // The object property + object GitRef_objectable + // The ref property + ref *string + // The url property + url *string +} +// NewGitRef instantiates a new GitRef and sets the default values. +func NewGitRef()(*GitRef) { + m := &GitRef{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitRefFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitRefFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitRef(), 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 *GitRef) 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 *GitRef) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["object"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGitRef_objectFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetObject(val.(GitRef_objectable)) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *GitRef) GetNodeId()(*string) { + return m.node_id +} +// GetObject gets the object property value. The object property +// returns a GitRef_objectable when successful +func (m *GitRef) GetObject()(GitRef_objectable) { + return m.object +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *GitRef) GetRef()(*string) { + return m.ref +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitRef) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GitRef) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("object", m.GetObject()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GitRef) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *GitRef) SetNodeId(value *string)() { + m.node_id = value +} +// SetObject sets the object property value. The object property +func (m *GitRef) SetObject(value GitRef_objectable)() { + m.object = value +} +// SetRef sets the ref property value. The ref property +func (m *GitRef) SetRef(value *string)() { + m.ref = value +} +// SetUrl sets the url property value. The url property +func (m *GitRef) SetUrl(value *string)() { + m.url = value +} +type GitRefable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNodeId()(*string) + GetObject()(GitRef_objectable) + GetRef()(*string) + GetUrl()(*string) + SetNodeId(value *string)() + SetObject(value GitRef_objectable)() + SetRef(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/git_ref_escaped_object.go b/pkg/github/models/git_ref_escaped_object.go new file mode 100644 index 00000000..594d4e89 --- /dev/null +++ b/pkg/github/models/git_ref_escaped_object.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GitRef_object 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 for the reference + sha *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewGitRef_object instantiates a new GitRef_object and sets the default values. +func NewGitRef_object()(*GitRef_object) { + m := &GitRef_object{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitRef_objectFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitRef_objectFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitRef_object(), 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 *GitRef_object) 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 *GitRef_object) 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["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. SHA for the reference +// returns a *string when successful +func (m *GitRef_object) GetSha()(*string) { + return m.sha +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *GitRef_object) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitRef_object) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GitRef_object) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GitRef_object) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. SHA for the reference +func (m *GitRef_object) SetSha(value *string)() { + m.sha = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *GitRef_object) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *GitRef_object) SetUrl(value *string)() { + m.url = value +} +type GitRef_objectable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/git_tag.go b/pkg/github/models/git_tag.go new file mode 100644 index 00000000..1a3d31c4 --- /dev/null +++ b/pkg/github/models/git_tag.go @@ -0,0 +1,284 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GitTag metadata for a Git tag +type GitTag struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Message describing the purpose of the tag + message *string + // The node_id property + node_id *string + // The object property + object GitTag_objectable + // The sha property + sha *string + // Name of the tag + tag *string + // The tagger property + tagger GitTag_taggerable + // URL for the tag + url *string + // The verification property + verification Verificationable +} +// NewGitTag instantiates a new GitTag and sets the default values. +func NewGitTag()(*GitTag) { + m := &GitTag{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitTagFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitTagFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitTag(), 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 *GitTag) 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 *GitTag) 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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["object"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGitTag_objectFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetObject(val.(GitTag_objectable)) + } + return nil + } + 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["tag"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTag(val) + } + return nil + } + res["tagger"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGitTag_taggerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTagger(val.(GitTag_taggerable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verification"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateVerificationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerification(val.(Verificationable)) + } + return nil + } + return res +} +// GetMessage gets the message property value. Message describing the purpose of the tag +// returns a *string when successful +func (m *GitTag) GetMessage()(*string) { + return m.message +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *GitTag) GetNodeId()(*string) { + return m.node_id +} +// GetObject gets the object property value. The object property +// returns a GitTag_objectable when successful +func (m *GitTag) GetObject()(GitTag_objectable) { + return m.object +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *GitTag) GetSha()(*string) { + return m.sha +} +// GetTag gets the tag property value. Name of the tag +// returns a *string when successful +func (m *GitTag) GetTag()(*string) { + return m.tag +} +// GetTagger gets the tagger property value. The tagger property +// returns a GitTag_taggerable when successful +func (m *GitTag) GetTagger()(GitTag_taggerable) { + return m.tagger +} +// GetUrl gets the url property value. URL for the tag +// returns a *string when successful +func (m *GitTag) GetUrl()(*string) { + return m.url +} +// GetVerification gets the verification property value. The verification property +// returns a Verificationable when successful +func (m *GitTag) GetVerification()(Verificationable) { + return m.verification +} +// Serialize serializes information the current object +func (m *GitTag) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("object", m.GetObject()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tag", m.GetTag()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tagger", m.GetTagger()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verification", m.GetVerification()) + 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 *GitTag) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. Message describing the purpose of the tag +func (m *GitTag) SetMessage(value *string)() { + m.message = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *GitTag) SetNodeId(value *string)() { + m.node_id = value +} +// SetObject sets the object property value. The object property +func (m *GitTag) SetObject(value GitTag_objectable)() { + m.object = value +} +// SetSha sets the sha property value. The sha property +func (m *GitTag) SetSha(value *string)() { + m.sha = value +} +// SetTag sets the tag property value. Name of the tag +func (m *GitTag) SetTag(value *string)() { + m.tag = value +} +// SetTagger sets the tagger property value. The tagger property +func (m *GitTag) SetTagger(value GitTag_taggerable)() { + m.tagger = value +} +// SetUrl sets the url property value. URL for the tag +func (m *GitTag) SetUrl(value *string)() { + m.url = value +} +// SetVerification sets the verification property value. The verification property +func (m *GitTag) SetVerification(value Verificationable)() { + m.verification = value +} +type GitTagable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + GetNodeId()(*string) + GetObject()(GitTag_objectable) + GetSha()(*string) + GetTag()(*string) + GetTagger()(GitTag_taggerable) + GetUrl()(*string) + GetVerification()(Verificationable) + SetMessage(value *string)() + SetNodeId(value *string)() + SetObject(value GitTag_objectable)() + SetSha(value *string)() + SetTag(value *string)() + SetTagger(value GitTag_taggerable)() + SetUrl(value *string)() + SetVerification(value Verificationable)() +} diff --git a/pkg/github/models/git_tag_escaped_object.go b/pkg/github/models/git_tag_escaped_object.go new file mode 100644 index 00000000..dd8dff41 --- /dev/null +++ b/pkg/github/models/git_tag_escaped_object.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GitTag_object 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 sha property + sha *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewGitTag_object instantiates a new GitTag_object and sets the default values. +func NewGitTag_object()(*GitTag_object) { + m := &GitTag_object{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitTag_objectFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitTag_objectFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitTag_object(), 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 *GitTag_object) 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 *GitTag_object) 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["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *GitTag_object) GetSha()(*string) { + return m.sha +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *GitTag_object) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitTag_object) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GitTag_object) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GitTag_object) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *GitTag_object) SetSha(value *string)() { + m.sha = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *GitTag_object) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *GitTag_object) SetUrl(value *string)() { + m.url = value +} +type GitTag_objectable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/git_tag_escaped_tagger.go b/pkg/github/models/git_tag_escaped_tagger.go new file mode 100644 index 00000000..b4f8c328 --- /dev/null +++ b/pkg/github/models/git_tag_escaped_tagger.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GitTag_tagger 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 date property + date *string + // The email property + email *string + // The name property + name *string +} +// NewGitTag_tagger instantiates a new GitTag_tagger and sets the default values. +func NewGitTag_tagger()(*GitTag_tagger) { + m := &GitTag_tagger{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitTag_taggerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitTag_taggerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitTag_tagger(), 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 *GitTag_tagger) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. The date property +// returns a *string when successful +func (m *GitTag_tagger) GetDate()(*string) { + return m.date +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *GitTag_tagger) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GitTag_tagger) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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 property +// returns a *string when successful +func (m *GitTag_tagger) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *GitTag_tagger) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *GitTag_tagger) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. The date property +func (m *GitTag_tagger) SetDate(value *string)() { + m.date = value +} +// SetEmail sets the email property value. The email property +func (m *GitTag_tagger) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name property +func (m *GitTag_tagger) SetName(value *string)() { + m.name = value +} +type GitTag_taggerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*string) + GetEmail()(*string) + GetName()(*string) + SetDate(value *string)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/git_tree.go b/pkg/github/models/git_tree.go new file mode 100644 index 00000000..6bc98bff --- /dev/null +++ b/pkg/github/models/git_tree.go @@ -0,0 +1,180 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GitTree the hierarchy between files in a Git repository. +type GitTree 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 sha property + sha *string + // Objects specifying a tree structure + tree []GitTree_treeable + // The truncated property + truncated *bool + // The url property + url *string +} +// NewGitTree instantiates a new GitTree and sets the default values. +func NewGitTree()(*GitTree) { + m := &GitTree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitTreeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitTreeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitTree(), 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 *GitTree) 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 *GitTree) 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["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGitTree_treeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GitTree_treeable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GitTree_treeable) + } + } + m.SetTree(res) + } + return nil + } + res["truncated"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTruncated(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *GitTree) GetSha()(*string) { + return m.sha +} +// GetTree gets the tree property value. Objects specifying a tree structure +// returns a []GitTree_treeable when successful +func (m *GitTree) GetTree()([]GitTree_treeable) { + return m.tree +} +// GetTruncated gets the truncated property value. The truncated property +// returns a *bool when successful +func (m *GitTree) GetTruncated()(*bool) { + return m.truncated +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitTree) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GitTree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + if m.GetTree() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTree())) + for i, v := range m.GetTree() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("tree", cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("truncated", m.GetTruncated()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GitTree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *GitTree) SetSha(value *string)() { + m.sha = value +} +// SetTree sets the tree property value. Objects specifying a tree structure +func (m *GitTree) SetTree(value []GitTree_treeable)() { + m.tree = value +} +// SetTruncated sets the truncated property value. The truncated property +func (m *GitTree) SetTruncated(value *bool)() { + m.truncated = value +} +// SetUrl sets the url property value. The url property +func (m *GitTree) SetUrl(value *string)() { + m.url = value +} +type GitTreeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetTree()([]GitTree_treeable) + GetTruncated()(*bool) + GetUrl()(*string) + SetSha(value *string)() + SetTree(value []GitTree_treeable)() + SetTruncated(value *bool)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/git_tree_escaped_tree.go b/pkg/github/models/git_tree_escaped_tree.go new file mode 100644 index 00000000..de2ab5cc --- /dev/null +++ b/pkg/github/models/git_tree_escaped_tree.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GitTree_tree 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 mode property + mode *string + // The path property + path *string + // The sha property + sha *string + // The size property + size *int32 + // The type property + typeEscaped *string + // The url property + url *string +} +// NewGitTree_tree instantiates a new GitTree_tree and sets the default values. +func NewGitTree_tree()(*GitTree_tree) { + m := &GitTree_tree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitTree_treeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitTree_treeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitTree_tree(), 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 *GitTree_tree) 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 *GitTree_tree) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["mode"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMode(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + 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["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetMode gets the mode property value. The mode property +// returns a *string when successful +func (m *GitTree_tree) GetMode()(*string) { + return m.mode +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *GitTree_tree) GetPath()(*string) { + return m.path +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *GitTree_tree) GetSha()(*string) { + return m.sha +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *GitTree_tree) GetSize()(*int32) { + return m.size +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *GitTree_tree) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GitTree_tree) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GitTree_tree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("mode", m.GetMode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GitTree_tree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMode sets the mode property value. The mode property +func (m *GitTree_tree) SetMode(value *string)() { + m.mode = value +} +// SetPath sets the path property value. The path property +func (m *GitTree_tree) SetPath(value *string)() { + m.path = value +} +// SetSha sets the sha property value. The sha property +func (m *GitTree_tree) SetSha(value *string)() { + m.sha = value +} +// SetSize sets the size property value. The size property +func (m *GitTree_tree) SetSize(value *int32)() { + m.size = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *GitTree_tree) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *GitTree_tree) SetUrl(value *string)() { + m.url = value +} +type GitTree_treeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMode()(*string) + GetPath()(*string) + GetSha()(*string) + GetSize()(*int32) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetMode(value *string)() + SetPath(value *string)() + SetSha(value *string)() + SetSize(value *int32)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/gitignore_template.go b/pkg/github/models/gitignore_template.go new file mode 100644 index 00000000..0ddd602f --- /dev/null +++ b/pkg/github/models/gitignore_template.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GitignoreTemplate gitignore Template +type GitignoreTemplate 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 name property + name *string + // The source property + source *string +} +// NewGitignoreTemplate instantiates a new GitignoreTemplate and sets the default values. +func NewGitignoreTemplate()(*GitignoreTemplate) { + m := &GitignoreTemplate{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGitignoreTemplateFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGitignoreTemplateFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGitignoreTemplate(), 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 *GitignoreTemplate) 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 *GitignoreTemplate) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSource(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *GitignoreTemplate) GetName()(*string) { + return m.name +} +// GetSource gets the source property value. The source property +// returns a *string when successful +func (m *GitignoreTemplate) GetSource()(*string) { + return m.source +} +// Serialize serializes information the current object +func (m *GitignoreTemplate) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("source", m.GetSource()) + 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 *GitignoreTemplate) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name property +func (m *GitignoreTemplate) SetName(value *string)() { + m.name = value +} +// SetSource sets the source property value. The source property +func (m *GitignoreTemplate) SetSource(value *string)() { + m.source = value +} +type GitignoreTemplateable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetSource()(*string) + SetName(value *string)() + SetSource(value *string)() +} diff --git a/pkg/github/models/global_advisory.go b/pkg/github/models/global_advisory.go new file mode 100644 index 00000000..ac8eb3f4 --- /dev/null +++ b/pkg/github/models/global_advisory.go @@ -0,0 +1,666 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GlobalAdvisory a GitHub Security Advisory. +type GlobalAdvisory struct { + // In GitHub Enterprise Server, this field will always be empty because the user metadata of credited users will not be available. + credits []GlobalAdvisory_creditsable + // The Common Vulnerabilities and Exposures (CVE) ID. + cve_id *string + // The cvss property + cvss GlobalAdvisory_cvssable + // The cvss_severities property + cvss_severities CvssSeveritiesable + // The cwes property + cwes []GlobalAdvisory_cwesable + // A detailed description of what the advisory entails. + description *string + // The epss property + epss GlobalAdvisory_epssable + // The GitHub Security Advisory ID. + ghsa_id *string + // The date and time of when the advisory was reviewed by GitHub, in ISO 8601 format. + github_reviewed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The URL for the advisory. + html_url *string + // The identifiers property + identifiers []GlobalAdvisory_identifiersable + // The date and time when the advisory was published in the National Vulnerability Database, in ISO 8601 format.This field is only populated when the advisory is imported from the National Vulnerability Database. + nvd_published_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The date and time of when the advisory was published, in ISO 8601 format. + published_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The references property + references []string + // The API URL for the repository advisory. + repository_advisory_url *string + // The severity of the advisory. + severity *GlobalAdvisory_severity + // The URL of the advisory's source code. + source_code_location *string + // A short summary of the advisory. + summary *string + // The type of advisory. + typeEscaped *GlobalAdvisory_type + // The date and time of when the advisory was last updated, in ISO 8601 format. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The API URL for the advisory. + url *string + // The products and respective version ranges affected by the advisory. + vulnerabilities []Vulnerabilityable + // The date and time of when the advisory was withdrawn, in ISO 8601 format. + withdrawn_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewGlobalAdvisory instantiates a new GlobalAdvisory and sets the default values. +func NewGlobalAdvisory()(*GlobalAdvisory) { + m := &GlobalAdvisory{ + } + return m +} +// CreateGlobalAdvisoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalAdvisoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalAdvisory(), nil +} +// GetCredits gets the credits property value. In GitHub Enterprise Server, this field will always be empty because the user metadata of credited users will not be available. +// returns a []GlobalAdvisory_creditsable when successful +func (m *GlobalAdvisory) GetCredits()([]GlobalAdvisory_creditsable) { + return m.credits +} +// GetCveId gets the cve_id property value. The Common Vulnerabilities and Exposures (CVE) ID. +// returns a *string when successful +func (m *GlobalAdvisory) GetCveId()(*string) { + return m.cve_id +} +// GetCvss gets the cvss property value. The cvss property +// returns a GlobalAdvisory_cvssable when successful +func (m *GlobalAdvisory) GetCvss()(GlobalAdvisory_cvssable) { + return m.cvss +} +// GetCvssSeverities gets the cvss_severities property value. The cvss_severities property +// returns a CvssSeveritiesable when successful +func (m *GlobalAdvisory) GetCvssSeverities()(CvssSeveritiesable) { + return m.cvss_severities +} +// GetCwes gets the cwes property value. The cwes property +// returns a []GlobalAdvisory_cwesable when successful +func (m *GlobalAdvisory) GetCwes()([]GlobalAdvisory_cwesable) { + return m.cwes +} +// GetDescription gets the description property value. A detailed description of what the advisory entails. +// returns a *string when successful +func (m *GlobalAdvisory) GetDescription()(*string) { + return m.description +} +// GetEpss gets the epss property value. The epss property +// returns a GlobalAdvisory_epssable when successful +func (m *GlobalAdvisory) GetEpss()(GlobalAdvisory_epssable) { + return m.epss +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GlobalAdvisory) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["credits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGlobalAdvisory_creditsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GlobalAdvisory_creditsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GlobalAdvisory_creditsable) + } + } + m.SetCredits(res) + } + return nil + } + res["cve_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCveId(val) + } + return nil + } + res["cvss"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGlobalAdvisory_cvssFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCvss(val.(GlobalAdvisory_cvssable)) + } + return nil + } + res["cvss_severities"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCvssSeveritiesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCvssSeverities(val.(CvssSeveritiesable)) + } + return nil + } + res["cwes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGlobalAdvisory_cwesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GlobalAdvisory_cwesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GlobalAdvisory_cwesable) + } + } + m.SetCwes(res) + } + 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["epss"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGlobalAdvisory_epssFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetEpss(val.(GlobalAdvisory_epssable)) + } + return nil + } + res["ghsa_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGhsaId(val) + } + return nil + } + res["github_reviewed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetGithubReviewedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["identifiers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGlobalAdvisory_identifiersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GlobalAdvisory_identifiersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GlobalAdvisory_identifiersable) + } + } + m.SetIdentifiers(res) + } + return nil + } + res["nvd_published_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetNvdPublishedAt(val) + } + return nil + } + res["published_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPublishedAt(val) + } + return nil + } + res["references"] = 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.SetReferences(res) + } + return nil + } + res["repository_advisory_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryAdvisoryUrl(val) + } + return nil + } + res["severity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGlobalAdvisory_severity) + if err != nil { + return err + } + if val != nil { + m.SetSeverity(val.(*GlobalAdvisory_severity)) + } + return nil + } + res["source_code_location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSourceCodeLocation(val) + } + return nil + } + res["summary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSummary(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGlobalAdvisory_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*GlobalAdvisory_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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["vulnerabilities"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateVulnerabilityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Vulnerabilityable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Vulnerabilityable) + } + } + m.SetVulnerabilities(res) + } + return nil + } + res["withdrawn_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetWithdrawnAt(val) + } + return nil + } + return res +} +// GetGhsaId gets the ghsa_id property value. The GitHub Security Advisory ID. +// returns a *string when successful +func (m *GlobalAdvisory) GetGhsaId()(*string) { + return m.ghsa_id +} +// GetGithubReviewedAt gets the github_reviewed_at property value. The date and time of when the advisory was reviewed by GitHub, in ISO 8601 format. +// returns a *Time when successful +func (m *GlobalAdvisory) GetGithubReviewedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.github_reviewed_at +} +// GetHtmlUrl gets the html_url property value. The URL for the advisory. +// returns a *string when successful +func (m *GlobalAdvisory) GetHtmlUrl()(*string) { + return m.html_url +} +// GetIdentifiers gets the identifiers property value. The identifiers property +// returns a []GlobalAdvisory_identifiersable when successful +func (m *GlobalAdvisory) GetIdentifiers()([]GlobalAdvisory_identifiersable) { + return m.identifiers +} +// GetNvdPublishedAt gets the nvd_published_at property value. The date and time when the advisory was published in the National Vulnerability Database, in ISO 8601 format.This field is only populated when the advisory is imported from the National Vulnerability Database. +// returns a *Time when successful +func (m *GlobalAdvisory) GetNvdPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.nvd_published_at +} +// GetPublishedAt gets the published_at property value. The date and time of when the advisory was published, in ISO 8601 format. +// returns a *Time when successful +func (m *GlobalAdvisory) GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.published_at +} +// GetReferences gets the references property value. The references property +// returns a []string when successful +func (m *GlobalAdvisory) GetReferences()([]string) { + return m.references +} +// GetRepositoryAdvisoryUrl gets the repository_advisory_url property value. The API URL for the repository advisory. +// returns a *string when successful +func (m *GlobalAdvisory) GetRepositoryAdvisoryUrl()(*string) { + return m.repository_advisory_url +} +// GetSeverity gets the severity property value. The severity of the advisory. +// returns a *GlobalAdvisory_severity when successful +func (m *GlobalAdvisory) GetSeverity()(*GlobalAdvisory_severity) { + return m.severity +} +// GetSourceCodeLocation gets the source_code_location property value. The URL of the advisory's source code. +// returns a *string when successful +func (m *GlobalAdvisory) GetSourceCodeLocation()(*string) { + return m.source_code_location +} +// GetSummary gets the summary property value. A short summary of the advisory. +// returns a *string when successful +func (m *GlobalAdvisory) GetSummary()(*string) { + return m.summary +} +// GetTypeEscaped gets the type property value. The type of advisory. +// returns a *GlobalAdvisory_type when successful +func (m *GlobalAdvisory) GetTypeEscaped()(*GlobalAdvisory_type) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The date and time of when the advisory was last updated, in ISO 8601 format. +// returns a *Time when successful +func (m *GlobalAdvisory) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The API URL for the advisory. +// returns a *string when successful +func (m *GlobalAdvisory) GetUrl()(*string) { + return m.url +} +// GetVulnerabilities gets the vulnerabilities property value. The products and respective version ranges affected by the advisory. +// returns a []Vulnerabilityable when successful +func (m *GlobalAdvisory) GetVulnerabilities()([]Vulnerabilityable) { + return m.vulnerabilities +} +// GetWithdrawnAt gets the withdrawn_at property value. The date and time of when the advisory was withdrawn, in ISO 8601 format. +// returns a *Time when successful +func (m *GlobalAdvisory) GetWithdrawnAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.withdrawn_at +} +// Serialize serializes information the current object +func (m *GlobalAdvisory) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("cvss", m.GetCvss()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("cvss_severities", m.GetCvssSeverities()) + if err != nil { + return err + } + } + if m.GetCwes() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCwes())) + for i, v := range m.GetCwes() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("cwes", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("epss", m.GetEpss()) + if err != nil { + return err + } + } + if m.GetReferences() != nil { + err := writer.WriteCollectionOfStringValues("references", m.GetReferences()) + if err != nil { + return err + } + } + if m.GetSeverity() != nil { + cast := (*m.GetSeverity()).String() + err := writer.WriteStringValue("severity", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("source_code_location", m.GetSourceCodeLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("summary", m.GetSummary()) + if err != nil { + return err + } + } + if m.GetVulnerabilities() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVulnerabilities())) + for i, v := range m.GetVulnerabilities() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("vulnerabilities", cast) + if err != nil { + return err + } + } + return nil +} +// SetCredits sets the credits property value. In GitHub Enterprise Server, this field will always be empty because the user metadata of credited users will not be available. +func (m *GlobalAdvisory) SetCredits(value []GlobalAdvisory_creditsable)() { + m.credits = value +} +// SetCveId sets the cve_id property value. The Common Vulnerabilities and Exposures (CVE) ID. +func (m *GlobalAdvisory) SetCveId(value *string)() { + m.cve_id = value +} +// SetCvss sets the cvss property value. The cvss property +func (m *GlobalAdvisory) SetCvss(value GlobalAdvisory_cvssable)() { + m.cvss = value +} +// SetCvssSeverities sets the cvss_severities property value. The cvss_severities property +func (m *GlobalAdvisory) SetCvssSeverities(value CvssSeveritiesable)() { + m.cvss_severities = value +} +// SetCwes sets the cwes property value. The cwes property +func (m *GlobalAdvisory) SetCwes(value []GlobalAdvisory_cwesable)() { + m.cwes = value +} +// SetDescription sets the description property value. A detailed description of what the advisory entails. +func (m *GlobalAdvisory) SetDescription(value *string)() { + m.description = value +} +// SetEpss sets the epss property value. The epss property +func (m *GlobalAdvisory) SetEpss(value GlobalAdvisory_epssable)() { + m.epss = value +} +// SetGhsaId sets the ghsa_id property value. The GitHub Security Advisory ID. +func (m *GlobalAdvisory) SetGhsaId(value *string)() { + m.ghsa_id = value +} +// SetGithubReviewedAt sets the github_reviewed_at property value. The date and time of when the advisory was reviewed by GitHub, in ISO 8601 format. +func (m *GlobalAdvisory) SetGithubReviewedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.github_reviewed_at = value +} +// SetHtmlUrl sets the html_url property value. The URL for the advisory. +func (m *GlobalAdvisory) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetIdentifiers sets the identifiers property value. The identifiers property +func (m *GlobalAdvisory) SetIdentifiers(value []GlobalAdvisory_identifiersable)() { + m.identifiers = value +} +// SetNvdPublishedAt sets the nvd_published_at property value. The date and time when the advisory was published in the National Vulnerability Database, in ISO 8601 format.This field is only populated when the advisory is imported from the National Vulnerability Database. +func (m *GlobalAdvisory) SetNvdPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.nvd_published_at = value +} +// SetPublishedAt sets the published_at property value. The date and time of when the advisory was published, in ISO 8601 format. +func (m *GlobalAdvisory) SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.published_at = value +} +// SetReferences sets the references property value. The references property +func (m *GlobalAdvisory) SetReferences(value []string)() { + m.references = value +} +// SetRepositoryAdvisoryUrl sets the repository_advisory_url property value. The API URL for the repository advisory. +func (m *GlobalAdvisory) SetRepositoryAdvisoryUrl(value *string)() { + m.repository_advisory_url = value +} +// SetSeverity sets the severity property value. The severity of the advisory. +func (m *GlobalAdvisory) SetSeverity(value *GlobalAdvisory_severity)() { + m.severity = value +} +// SetSourceCodeLocation sets the source_code_location property value. The URL of the advisory's source code. +func (m *GlobalAdvisory) SetSourceCodeLocation(value *string)() { + m.source_code_location = value +} +// SetSummary sets the summary property value. A short summary of the advisory. +func (m *GlobalAdvisory) SetSummary(value *string)() { + m.summary = value +} +// SetTypeEscaped sets the type property value. The type of advisory. +func (m *GlobalAdvisory) SetTypeEscaped(value *GlobalAdvisory_type)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The date and time of when the advisory was last updated, in ISO 8601 format. +func (m *GlobalAdvisory) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The API URL for the advisory. +func (m *GlobalAdvisory) SetUrl(value *string)() { + m.url = value +} +// SetVulnerabilities sets the vulnerabilities property value. The products and respective version ranges affected by the advisory. +func (m *GlobalAdvisory) SetVulnerabilities(value []Vulnerabilityable)() { + m.vulnerabilities = value +} +// SetWithdrawnAt sets the withdrawn_at property value. The date and time of when the advisory was withdrawn, in ISO 8601 format. +func (m *GlobalAdvisory) SetWithdrawnAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.withdrawn_at = value +} +type GlobalAdvisoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCredits()([]GlobalAdvisory_creditsable) + GetCveId()(*string) + GetCvss()(GlobalAdvisory_cvssable) + GetCvssSeverities()(CvssSeveritiesable) + GetCwes()([]GlobalAdvisory_cwesable) + GetDescription()(*string) + GetEpss()(GlobalAdvisory_epssable) + GetGhsaId()(*string) + GetGithubReviewedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetIdentifiers()([]GlobalAdvisory_identifiersable) + GetNvdPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReferences()([]string) + GetRepositoryAdvisoryUrl()(*string) + GetSeverity()(*GlobalAdvisory_severity) + GetSourceCodeLocation()(*string) + GetSummary()(*string) + GetTypeEscaped()(*GlobalAdvisory_type) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVulnerabilities()([]Vulnerabilityable) + GetWithdrawnAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCredits(value []GlobalAdvisory_creditsable)() + SetCveId(value *string)() + SetCvss(value GlobalAdvisory_cvssable)() + SetCvssSeverities(value CvssSeveritiesable)() + SetCwes(value []GlobalAdvisory_cwesable)() + SetDescription(value *string)() + SetEpss(value GlobalAdvisory_epssable)() + SetGhsaId(value *string)() + SetGithubReviewedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetIdentifiers(value []GlobalAdvisory_identifiersable)() + SetNvdPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReferences(value []string)() + SetRepositoryAdvisoryUrl(value *string)() + SetSeverity(value *GlobalAdvisory_severity)() + SetSourceCodeLocation(value *string)() + SetSummary(value *string)() + SetTypeEscaped(value *GlobalAdvisory_type)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVulnerabilities(value []Vulnerabilityable)() + SetWithdrawnAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/global_advisory_escaped_credits.go b/pkg/github/models/global_advisory_escaped_credits.go new file mode 100644 index 00000000..43eb1686 --- /dev/null +++ b/pkg/github/models/global_advisory_escaped_credits.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GlobalAdvisory_credits 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 type of credit the user is receiving. + typeEscaped *SecurityAdvisoryCreditTypes + // A GitHub user. + user SimpleUserable +} +// NewGlobalAdvisory_credits instantiates a new GlobalAdvisory_credits and sets the default values. +func NewGlobalAdvisory_credits()(*GlobalAdvisory_credits) { + m := &GlobalAdvisory_credits{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalAdvisory_creditsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalAdvisory_creditsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalAdvisory_credits(), 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 *GlobalAdvisory_credits) 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 *GlobalAdvisory_credits) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAdvisoryCreditTypes) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*SecurityAdvisoryCreditTypes)) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type of credit the user is receiving. +// returns a *SecurityAdvisoryCreditTypes when successful +func (m *GlobalAdvisory_credits) GetTypeEscaped()(*SecurityAdvisoryCreditTypes) { + return m.typeEscaped +} +// GetUser gets the user property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *GlobalAdvisory_credits) GetUser()(SimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *GlobalAdvisory_credits) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *GlobalAdvisory_credits) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type of credit the user is receiving. +func (m *GlobalAdvisory_credits) SetTypeEscaped(value *SecurityAdvisoryCreditTypes)() { + m.typeEscaped = value +} +// SetUser sets the user property value. A GitHub user. +func (m *GlobalAdvisory_credits) SetUser(value SimpleUserable)() { + m.user = value +} +type GlobalAdvisory_creditsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*SecurityAdvisoryCreditTypes) + GetUser()(SimpleUserable) + SetTypeEscaped(value *SecurityAdvisoryCreditTypes)() + SetUser(value SimpleUserable)() +} diff --git a/pkg/github/models/global_advisory_escaped_cvss.go b/pkg/github/models/global_advisory_escaped_cvss.go new file mode 100644 index 00000000..f3d25765 --- /dev/null +++ b/pkg/github/models/global_advisory_escaped_cvss.go @@ -0,0 +1,103 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GlobalAdvisory_cvss 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 CVSS score. + score *float64 + // The CVSS vector. + vector_string *string +} +// NewGlobalAdvisory_cvss instantiates a new GlobalAdvisory_cvss and sets the default values. +func NewGlobalAdvisory_cvss()(*GlobalAdvisory_cvss) { + m := &GlobalAdvisory_cvss{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalAdvisory_cvssFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalAdvisory_cvssFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalAdvisory_cvss(), 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 *GlobalAdvisory_cvss) 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 *GlobalAdvisory_cvss) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["vector_string"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVectorString(val) + } + return nil + } + return res +} +// GetScore gets the score property value. The CVSS score. +// returns a *float64 when successful +func (m *GlobalAdvisory_cvss) GetScore()(*float64) { + return m.score +} +// GetVectorString gets the vector_string property value. The CVSS vector. +// returns a *string when successful +func (m *GlobalAdvisory_cvss) GetVectorString()(*string) { + return m.vector_string +} +// Serialize serializes information the current object +func (m *GlobalAdvisory_cvss) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("vector_string", m.GetVectorString()) + 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 *GlobalAdvisory_cvss) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetScore sets the score property value. The CVSS score. +func (m *GlobalAdvisory_cvss) SetScore(value *float64)() { + m.score = value +} +// SetVectorString sets the vector_string property value. The CVSS vector. +func (m *GlobalAdvisory_cvss) SetVectorString(value *string)() { + m.vector_string = value +} +type GlobalAdvisory_cvssable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetScore()(*float64) + GetVectorString()(*string) + SetScore(value *float64)() + SetVectorString(value *string)() +} diff --git a/pkg/github/models/global_advisory_escaped_cwes.go b/pkg/github/models/global_advisory_escaped_cwes.go new file mode 100644 index 00000000..e041244d --- /dev/null +++ b/pkg/github/models/global_advisory_escaped_cwes.go @@ -0,0 +1,103 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GlobalAdvisory_cwes 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 Common Weakness Enumeration (CWE) identifier. + cwe_id *string + // The name of the CWE. + name *string +} +// NewGlobalAdvisory_cwes instantiates a new GlobalAdvisory_cwes and sets the default values. +func NewGlobalAdvisory_cwes()(*GlobalAdvisory_cwes) { + m := &GlobalAdvisory_cwes{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalAdvisory_cwesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalAdvisory_cwesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalAdvisory_cwes(), 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 *GlobalAdvisory_cwes) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCweId gets the cwe_id property value. The Common Weakness Enumeration (CWE) identifier. +// returns a *string when successful +func (m *GlobalAdvisory_cwes) GetCweId()(*string) { + return m.cwe_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GlobalAdvisory_cwes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cwe_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCweId(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 CWE. +// returns a *string when successful +func (m *GlobalAdvisory_cwes) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *GlobalAdvisory_cwes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("cwe_id", m.GetCweId()) + 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 *GlobalAdvisory_cwes) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCweId sets the cwe_id property value. The Common Weakness Enumeration (CWE) identifier. +func (m *GlobalAdvisory_cwes) SetCweId(value *string)() { + m.cwe_id = value +} +// SetName sets the name property value. The name of the CWE. +func (m *GlobalAdvisory_cwes) SetName(value *string)() { + m.name = value +} +type GlobalAdvisory_cwesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCweId()(*string) + GetName()(*string) + SetCweId(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/global_advisory_escaped_epss.go b/pkg/github/models/global_advisory_escaped_epss.go new file mode 100644 index 00000000..4203bf3c --- /dev/null +++ b/pkg/github/models/global_advisory_escaped_epss.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GlobalAdvisory_epss 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 percentage property + percentage *float64 + // The percentile property + percentile *float64 +} +// NewGlobalAdvisory_epss instantiates a new GlobalAdvisory_epss and sets the default values. +func NewGlobalAdvisory_epss()(*GlobalAdvisory_epss) { + m := &GlobalAdvisory_epss{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalAdvisory_epssFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalAdvisory_epssFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalAdvisory_epss(), 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 *GlobalAdvisory_epss) 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 *GlobalAdvisory_epss) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["percentage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetPercentage(val) + } + return nil + } + res["percentile"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetPercentile(val) + } + return nil + } + return res +} +// GetPercentage gets the percentage property value. The percentage property +// returns a *float64 when successful +func (m *GlobalAdvisory_epss) GetPercentage()(*float64) { + return m.percentage +} +// GetPercentile gets the percentile property value. The percentile property +// returns a *float64 when successful +func (m *GlobalAdvisory_epss) GetPercentile()(*float64) { + return m.percentile +} +// Serialize serializes information the current object +func (m *GlobalAdvisory_epss) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteFloat64Value("percentage", m.GetPercentage()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("percentile", m.GetPercentile()) + 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 *GlobalAdvisory_epss) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPercentage sets the percentage property value. The percentage property +func (m *GlobalAdvisory_epss) SetPercentage(value *float64)() { + m.percentage = value +} +// SetPercentile sets the percentile property value. The percentile property +func (m *GlobalAdvisory_epss) SetPercentile(value *float64)() { + m.percentile = value +} +type GlobalAdvisory_epssable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPercentage()(*float64) + GetPercentile()(*float64) + SetPercentage(value *float64)() + SetPercentile(value *float64)() +} diff --git a/pkg/github/models/global_advisory_escaped_identifiers.go b/pkg/github/models/global_advisory_escaped_identifiers.go new file mode 100644 index 00000000..51e94cf6 --- /dev/null +++ b/pkg/github/models/global_advisory_escaped_identifiers.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GlobalAdvisory_identifiers 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 type of identifier. + typeEscaped *GlobalAdvisory_identifiers_type + // The identifier value. + value *string +} +// NewGlobalAdvisory_identifiers instantiates a new GlobalAdvisory_identifiers and sets the default values. +func NewGlobalAdvisory_identifiers()(*GlobalAdvisory_identifiers) { + m := &GlobalAdvisory_identifiers{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalAdvisory_identifiersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalAdvisory_identifiersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalAdvisory_identifiers(), 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 *GlobalAdvisory_identifiers) 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 *GlobalAdvisory_identifiers) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseGlobalAdvisory_identifiers_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*GlobalAdvisory_identifiers_type)) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type of identifier. +// returns a *GlobalAdvisory_identifiers_type when successful +func (m *GlobalAdvisory_identifiers) GetTypeEscaped()(*GlobalAdvisory_identifiers_type) { + return m.typeEscaped +} +// GetValue gets the value property value. The identifier value. +// returns a *string when successful +func (m *GlobalAdvisory_identifiers) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *GlobalAdvisory_identifiers) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + 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 *GlobalAdvisory_identifiers) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type of identifier. +func (m *GlobalAdvisory_identifiers) SetTypeEscaped(value *GlobalAdvisory_identifiers_type)() { + m.typeEscaped = value +} +// SetValue sets the value property value. The identifier value. +func (m *GlobalAdvisory_identifiers) SetValue(value *string)() { + m.value = value +} +type GlobalAdvisory_identifiersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*GlobalAdvisory_identifiers_type) + GetValue()(*string) + SetTypeEscaped(value *GlobalAdvisory_identifiers_type)() + SetValue(value *string)() +} diff --git a/pkg/github/models/global_advisory_escaped_identifiers_escaped_type.go b/pkg/github/models/global_advisory_escaped_identifiers_escaped_type.go new file mode 100644 index 00000000..7edd7dae --- /dev/null +++ b/pkg/github/models/global_advisory_escaped_identifiers_escaped_type.go @@ -0,0 +1,34 @@ +package models +// The type of identifier. +type GlobalAdvisory_identifiers_type int + +const ( + CVE_GLOBALADVISORY_IDENTIFIERS_TYPE GlobalAdvisory_identifiers_type = iota + GHSA_GLOBALADVISORY_IDENTIFIERS_TYPE +) + +func (i GlobalAdvisory_identifiers_type) String() string { + return []string{"CVE", "GHSA"}[i] +} +func ParseGlobalAdvisory_identifiers_type(v string) (any, error) { + result := CVE_GLOBALADVISORY_IDENTIFIERS_TYPE + switch v { + case "CVE": + result = CVE_GLOBALADVISORY_IDENTIFIERS_TYPE + case "GHSA": + result = GHSA_GLOBALADVISORY_IDENTIFIERS_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGlobalAdvisory_identifiers_type(values []GlobalAdvisory_identifiers_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GlobalAdvisory_identifiers_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/global_advisory_escaped_severity.go b/pkg/github/models/global_advisory_escaped_severity.go new file mode 100644 index 00000000..38f9e0f8 --- /dev/null +++ b/pkg/github/models/global_advisory_escaped_severity.go @@ -0,0 +1,43 @@ +package models +// The severity of the advisory. +type GlobalAdvisory_severity int + +const ( + CRITICAL_GLOBALADVISORY_SEVERITY GlobalAdvisory_severity = iota + HIGH_GLOBALADVISORY_SEVERITY + MEDIUM_GLOBALADVISORY_SEVERITY + LOW_GLOBALADVISORY_SEVERITY + UNKNOWN_GLOBALADVISORY_SEVERITY +) + +func (i GlobalAdvisory_severity) String() string { + return []string{"critical", "high", "medium", "low", "unknown"}[i] +} +func ParseGlobalAdvisory_severity(v string) (any, error) { + result := CRITICAL_GLOBALADVISORY_SEVERITY + switch v { + case "critical": + result = CRITICAL_GLOBALADVISORY_SEVERITY + case "high": + result = HIGH_GLOBALADVISORY_SEVERITY + case "medium": + result = MEDIUM_GLOBALADVISORY_SEVERITY + case "low": + result = LOW_GLOBALADVISORY_SEVERITY + case "unknown": + result = UNKNOWN_GLOBALADVISORY_SEVERITY + default: + return nil, nil + } + return &result, nil +} +func SerializeGlobalAdvisory_severity(values []GlobalAdvisory_severity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GlobalAdvisory_severity) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/global_advisory_escaped_type.go b/pkg/github/models/global_advisory_escaped_type.go new file mode 100644 index 00000000..e22f11db --- /dev/null +++ b/pkg/github/models/global_advisory_escaped_type.go @@ -0,0 +1,37 @@ +package models +// The type of advisory. +type GlobalAdvisory_type int + +const ( + REVIEWED_GLOBALADVISORY_TYPE GlobalAdvisory_type = iota + UNREVIEWED_GLOBALADVISORY_TYPE + MALWARE_GLOBALADVISORY_TYPE +) + +func (i GlobalAdvisory_type) String() string { + return []string{"reviewed", "unreviewed", "malware"}[i] +} +func ParseGlobalAdvisory_type(v string) (any, error) { + result := REVIEWED_GLOBALADVISORY_TYPE + switch v { + case "reviewed": + result = REVIEWED_GLOBALADVISORY_TYPE + case "unreviewed": + result = UNREVIEWED_GLOBALADVISORY_TYPE + case "malware": + result = MALWARE_GLOBALADVISORY_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGlobalAdvisory_type(values []GlobalAdvisory_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GlobalAdvisory_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/global_hook.go b/pkg/github/models/global_hook.go new file mode 100644 index 00000000..84daf6d5 --- /dev/null +++ b/pkg/github/models/global_hook.go @@ -0,0 +1,347 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GlobalHook struct { + // The active property + active *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The config property + config GlobalHook_configable + // The created_at property + created_at *string + // The events property + events []string + // The id property + id *int32 + // The name property + name *string + // The ping_url property + ping_url *string + // The type property + typeEscaped *string + // The updated_at property + updated_at *string + // The url property + url *string +} +// NewGlobalHook instantiates a new GlobalHook and sets the default values. +func NewGlobalHook()(*GlobalHook) { + m := &GlobalHook{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalHookFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalHookFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalHook(), nil +} +// GetActive gets the active property value. The active property +// returns a *bool when successful +func (m *GlobalHook) GetActive()(*bool) { + return m.active +} +// 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 *GlobalHook) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfig gets the config property value. The config property +// returns a GlobalHook_configable when successful +func (m *GlobalHook) GetConfig()(GlobalHook_configable) { + return m.config +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *GlobalHook) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvents gets the events property value. The events property +// returns a []string when successful +func (m *GlobalHook) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GlobalHook) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGlobalHook_configFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(GlobalHook_configable)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["events"] = 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.SetEvents(res) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["ping_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPingUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *GlobalHook) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *GlobalHook) GetName()(*string) { + return m.name +} +// GetPingUrl gets the ping_url property value. The ping_url property +// returns a *string when successful +func (m *GlobalHook) GetPingUrl()(*string) { + return m.ping_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *GlobalHook) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *GlobalHook) GetUpdatedAt()(*string) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GlobalHook) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GlobalHook) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ping_url", m.GetPingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. The active property +func (m *GlobalHook) SetActive(value *bool)() { + m.active = 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 *GlobalHook) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfig sets the config property value. The config property +func (m *GlobalHook) SetConfig(value GlobalHook_configable)() { + m.config = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GlobalHook) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvents sets the events property value. The events property +func (m *GlobalHook) SetEvents(value []string)() { + m.events = value +} +// SetId sets the id property value. The id property +func (m *GlobalHook) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *GlobalHook) SetName(value *string)() { + m.name = value +} +// SetPingUrl sets the ping_url property value. The ping_url property +func (m *GlobalHook) SetPingUrl(value *string)() { + m.ping_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *GlobalHook) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *GlobalHook) SetUpdatedAt(value *string)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *GlobalHook) SetUrl(value *string)() { + m.url = value +} +type GlobalHookable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetConfig()(GlobalHook_configable) + GetCreatedAt()(*string) + GetEvents()([]string) + GetId()(*int32) + GetName()(*string) + GetPingUrl()(*string) + GetTypeEscaped()(*string) + GetUpdatedAt()(*string) + GetUrl()(*string) + SetActive(value *bool)() + SetConfig(value GlobalHook_configable)() + SetCreatedAt(value *string)() + SetEvents(value []string)() + SetId(value *int32)() + SetName(value *string)() + SetPingUrl(value *string)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/global_hook2.go b/pkg/github/models/global_hook2.go new file mode 100644 index 00000000..2c391434 --- /dev/null +++ b/pkg/github/models/global_hook2.go @@ -0,0 +1,347 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GlobalHook2 struct { + // The active property + active *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The config property + config GlobalHook2_configable + // The created_at property + created_at *string + // The events property + events []string + // The id property + id *int32 + // The name property + name *string + // The ping_url property + ping_url *string + // The type property + typeEscaped *string + // The updated_at property + updated_at *string + // The url property + url *string +} +// NewGlobalHook2 instantiates a new GlobalHook2 and sets the default values. +func NewGlobalHook2()(*GlobalHook2) { + m := &GlobalHook2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalHook2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalHook2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalHook2(), nil +} +// GetActive gets the active property value. The active property +// returns a *bool when successful +func (m *GlobalHook2) GetActive()(*bool) { + return m.active +} +// 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 *GlobalHook2) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfig gets the config property value. The config property +// returns a GlobalHook2_configable when successful +func (m *GlobalHook2) GetConfig()(GlobalHook2_configable) { + return m.config +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *GlobalHook2) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvents gets the events property value. The events property +// returns a []string when successful +func (m *GlobalHook2) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GlobalHook2) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateGlobalHook2_configFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(GlobalHook2_configable)) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["events"] = 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.SetEvents(res) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["ping_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPingUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *GlobalHook2) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *GlobalHook2) GetName()(*string) { + return m.name +} +// GetPingUrl gets the ping_url property value. The ping_url property +// returns a *string when successful +func (m *GlobalHook2) GetPingUrl()(*string) { + return m.ping_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *GlobalHook2) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *GlobalHook2) GetUpdatedAt()(*string) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GlobalHook2) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GlobalHook2) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ping_url", m.GetPingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. The active property +func (m *GlobalHook2) SetActive(value *bool)() { + m.active = 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 *GlobalHook2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfig sets the config property value. The config property +func (m *GlobalHook2) SetConfig(value GlobalHook2_configable)() { + m.config = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GlobalHook2) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvents sets the events property value. The events property +func (m *GlobalHook2) SetEvents(value []string)() { + m.events = value +} +// SetId sets the id property value. The id property +func (m *GlobalHook2) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *GlobalHook2) SetName(value *string)() { + m.name = value +} +// SetPingUrl sets the ping_url property value. The ping_url property +func (m *GlobalHook2) SetPingUrl(value *string)() { + m.ping_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *GlobalHook2) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *GlobalHook2) SetUpdatedAt(value *string)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *GlobalHook2) SetUrl(value *string)() { + m.url = value +} +type GlobalHook2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetConfig()(GlobalHook2_configable) + GetCreatedAt()(*string) + GetEvents()([]string) + GetId()(*int32) + GetName()(*string) + GetPingUrl()(*string) + GetTypeEscaped()(*string) + GetUpdatedAt()(*string) + GetUrl()(*string) + SetActive(value *bool)() + SetConfig(value GlobalHook2_configable)() + SetCreatedAt(value *string)() + SetEvents(value []string)() + SetId(value *int32)() + SetName(value *string)() + SetPingUrl(value *string)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/global_hook2_escaped_config.go b/pkg/github/models/global_hook2_escaped_config.go new file mode 100644 index 00000000..cf0e5fe9 --- /dev/null +++ b/pkg/github/models/global_hook2_escaped_config.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GlobalHook2_config 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 content_type property + content_type *string + // The insecure_ssl property + insecure_ssl *string + // The url property + url *string +} +// NewGlobalHook2_config instantiates a new GlobalHook2_config and sets the default values. +func NewGlobalHook2_config()(*GlobalHook2_config) { + m := &GlobalHook2_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalHook2_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalHook2_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalHook2_config(), 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 *GlobalHook2_config) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The content_type property +// returns a *string when successful +func (m *GlobalHook2_config) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GlobalHook2_config) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a *string when successful +func (m *GlobalHook2_config) GetInsecureSsl()(*string) { + return m.insecure_ssl +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GlobalHook2_config) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GlobalHook2_config) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GlobalHook2_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The content_type property +func (m *GlobalHook2_config) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *GlobalHook2_config) SetInsecureSsl(value *string)() { + m.insecure_ssl = value +} +// SetUrl sets the url property value. The url property +func (m *GlobalHook2_config) SetUrl(value *string)() { + m.url = value +} +type GlobalHook2_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/global_hook_escaped_config.go b/pkg/github/models/global_hook_escaped_config.go new file mode 100644 index 00000000..c2d37c74 --- /dev/null +++ b/pkg/github/models/global_hook_escaped_config.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GlobalHook_config 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 content_type property + content_type *string + // The insecure_ssl property + insecure_ssl *string + // The secret property + secret *string + // The url property + url *string +} +// NewGlobalHook_config instantiates a new GlobalHook_config and sets the default values. +func NewGlobalHook_config()(*GlobalHook_config) { + m := &GlobalHook_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGlobalHook_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGlobalHook_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGlobalHook_config(), 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 *GlobalHook_config) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The content_type property +// returns a *string when successful +func (m *GlobalHook_config) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GlobalHook_config) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a *string when successful +func (m *GlobalHook_config) GetInsecureSsl()(*string) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. The secret property +// returns a *string when successful +func (m *GlobalHook_config) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *GlobalHook_config) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *GlobalHook_config) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *GlobalHook_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The content_type property +func (m *GlobalHook_config) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *GlobalHook_config) SetInsecureSsl(value *string)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. The secret property +func (m *GlobalHook_config) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The url property +func (m *GlobalHook_config) SetUrl(value *string)() { + m.url = value +} +type GlobalHook_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(*string) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value *string)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/gpg_key.go b/pkg/github/models/gpg_key.go new file mode 100644 index 00000000..6e3e5e3b --- /dev/null +++ b/pkg/github/models/gpg_key.go @@ -0,0 +1,512 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// GpgKey a unique encryption key +type GpgKey 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 can_certify property + can_certify *bool + // The can_encrypt_comms property + can_encrypt_comms *bool + // The can_encrypt_storage property + can_encrypt_storage *bool + // The can_sign property + can_sign *bool + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The emails property + emails []GpgKey_emailsable + // The expires_at property + expires_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The id property + id *int64 + // The key_id property + key_id *string + // The name property + name *string + // The primary_key_id property + primary_key_id *int32 + // The public_key property + public_key *string + // The raw_key property + raw_key *string + // The revoked property + revoked *bool + // The subkeys property + subkeys []GpgKey_subkeysable +} +// NewGpgKey instantiates a new GpgKey and sets the default values. +func NewGpgKey()(*GpgKey) { + m := &GpgKey{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGpgKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGpgKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGpgKey(), 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 *GpgKey) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCanCertify gets the can_certify property value. The can_certify property +// returns a *bool when successful +func (m *GpgKey) GetCanCertify()(*bool) { + return m.can_certify +} +// GetCanEncryptComms gets the can_encrypt_comms property value. The can_encrypt_comms property +// returns a *bool when successful +func (m *GpgKey) GetCanEncryptComms()(*bool) { + return m.can_encrypt_comms +} +// GetCanEncryptStorage gets the can_encrypt_storage property value. The can_encrypt_storage property +// returns a *bool when successful +func (m *GpgKey) GetCanEncryptStorage()(*bool) { + return m.can_encrypt_storage +} +// GetCanSign gets the can_sign property value. The can_sign property +// returns a *bool when successful +func (m *GpgKey) GetCanSign()(*bool) { + return m.can_sign +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *GpgKey) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetEmails gets the emails property value. The emails property +// returns a []GpgKey_emailsable when successful +func (m *GpgKey) GetEmails()([]GpgKey_emailsable) { + return m.emails +} +// GetExpiresAt gets the expires_at property value. The expires_at property +// returns a *Time when successful +func (m *GpgKey) GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GpgKey) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["can_certify"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanCertify(val) + } + return nil + } + res["can_encrypt_comms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanEncryptComms(val) + } + return nil + } + res["can_encrypt_storage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanEncryptStorage(val) + } + return nil + } + res["can_sign"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanSign(val) + } + return nil + } + 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["emails"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGpgKey_emailsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GpgKey_emailsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GpgKey_emailsable) + } + } + m.SetEmails(res) + } + return nil + } + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["primary_key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrimaryKeyId(val) + } + return nil + } + res["public_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicKey(val) + } + return nil + } + res["raw_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRawKey(val) + } + return nil + } + res["revoked"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRevoked(val) + } + return nil + } + res["subkeys"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGpgKey_subkeysFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GpgKey_subkeysable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GpgKey_subkeysable) + } + } + m.SetSubkeys(res) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *GpgKey) GetId()(*int64) { + return m.id +} +// GetKeyId gets the key_id property value. The key_id property +// returns a *string when successful +func (m *GpgKey) GetKeyId()(*string) { + return m.key_id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *GpgKey) GetName()(*string) { + return m.name +} +// GetPrimaryKeyId gets the primary_key_id property value. The primary_key_id property +// returns a *int32 when successful +func (m *GpgKey) GetPrimaryKeyId()(*int32) { + return m.primary_key_id +} +// GetPublicKey gets the public_key property value. The public_key property +// returns a *string when successful +func (m *GpgKey) GetPublicKey()(*string) { + return m.public_key +} +// GetRawKey gets the raw_key property value. The raw_key property +// returns a *string when successful +func (m *GpgKey) GetRawKey()(*string) { + return m.raw_key +} +// GetRevoked gets the revoked property value. The revoked property +// returns a *bool when successful +func (m *GpgKey) GetRevoked()(*bool) { + return m.revoked +} +// GetSubkeys gets the subkeys property value. The subkeys property +// returns a []GpgKey_subkeysable when successful +func (m *GpgKey) GetSubkeys()([]GpgKey_subkeysable) { + return m.subkeys +} +// Serialize serializes information the current object +func (m *GpgKey) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("can_certify", m.GetCanCertify()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("can_encrypt_comms", m.GetCanEncryptComms()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("can_encrypt_storage", m.GetCanEncryptStorage()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("can_sign", m.GetCanSign()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + if m.GetEmails() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetEmails())) + for i, v := range m.GetEmails() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("emails", cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("primary_key_id", m.GetPrimaryKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_key", m.GetPublicKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("raw_key", m.GetRawKey()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("revoked", m.GetRevoked()) + if err != nil { + return err + } + } + if m.GetSubkeys() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSubkeys())) + for i, v := range m.GetSubkeys() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("subkeys", 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 *GpgKey) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCanCertify sets the can_certify property value. The can_certify property +func (m *GpgKey) SetCanCertify(value *bool)() { + m.can_certify = value +} +// SetCanEncryptComms sets the can_encrypt_comms property value. The can_encrypt_comms property +func (m *GpgKey) SetCanEncryptComms(value *bool)() { + m.can_encrypt_comms = value +} +// SetCanEncryptStorage sets the can_encrypt_storage property value. The can_encrypt_storage property +func (m *GpgKey) SetCanEncryptStorage(value *bool)() { + m.can_encrypt_storage = value +} +// SetCanSign sets the can_sign property value. The can_sign property +func (m *GpgKey) SetCanSign(value *bool)() { + m.can_sign = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GpgKey) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetEmails sets the emails property value. The emails property +func (m *GpgKey) SetEmails(value []GpgKey_emailsable)() { + m.emails = value +} +// SetExpiresAt sets the expires_at property value. The expires_at property +func (m *GpgKey) SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.expires_at = value +} +// SetId sets the id property value. The id property +func (m *GpgKey) SetId(value *int64)() { + m.id = value +} +// SetKeyId sets the key_id property value. The key_id property +func (m *GpgKey) SetKeyId(value *string)() { + m.key_id = value +} +// SetName sets the name property value. The name property +func (m *GpgKey) SetName(value *string)() { + m.name = value +} +// SetPrimaryKeyId sets the primary_key_id property value. The primary_key_id property +func (m *GpgKey) SetPrimaryKeyId(value *int32)() { + m.primary_key_id = value +} +// SetPublicKey sets the public_key property value. The public_key property +func (m *GpgKey) SetPublicKey(value *string)() { + m.public_key = value +} +// SetRawKey sets the raw_key property value. The raw_key property +func (m *GpgKey) SetRawKey(value *string)() { + m.raw_key = value +} +// SetRevoked sets the revoked property value. The revoked property +func (m *GpgKey) SetRevoked(value *bool)() { + m.revoked = value +} +// SetSubkeys sets the subkeys property value. The subkeys property +func (m *GpgKey) SetSubkeys(value []GpgKey_subkeysable)() { + m.subkeys = value +} +type GpgKeyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCanCertify()(*bool) + GetCanEncryptComms()(*bool) + GetCanEncryptStorage()(*bool) + GetCanSign()(*bool) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmails()([]GpgKey_emailsable) + GetExpiresAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int64) + GetKeyId()(*string) + GetName()(*string) + GetPrimaryKeyId()(*int32) + GetPublicKey()(*string) + GetRawKey()(*string) + GetRevoked()(*bool) + GetSubkeys()([]GpgKey_subkeysable) + SetCanCertify(value *bool)() + SetCanEncryptComms(value *bool)() + SetCanEncryptStorage(value *bool)() + SetCanSign(value *bool)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmails(value []GpgKey_emailsable)() + SetExpiresAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int64)() + SetKeyId(value *string)() + SetName(value *string)() + SetPrimaryKeyId(value *int32)() + SetPublicKey(value *string)() + SetRawKey(value *string)() + SetRevoked(value *bool)() + SetSubkeys(value []GpgKey_subkeysable)() +} diff --git a/pkg/github/models/gpg_key_escaped_emails.go b/pkg/github/models/gpg_key_escaped_emails.go new file mode 100644 index 00000000..9a75970c --- /dev/null +++ b/pkg/github/models/gpg_key_escaped_emails.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GpgKey_emails 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 email property + email *string + // The verified property + verified *bool +} +// NewGpgKey_emails instantiates a new GpgKey_emails and sets the default values. +func NewGpgKey_emails()(*GpgKey_emails) { + m := &GpgKey_emails{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGpgKey_emailsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGpgKey_emailsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGpgKey_emails(), 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 *GpgKey_emails) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *GpgKey_emails) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GpgKey_emails) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *GpgKey_emails) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *GpgKey_emails) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + 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 *GpgKey_emails) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email property +func (m *GpgKey_emails) SetEmail(value *string)() { + m.email = value +} +// SetVerified sets the verified property value. The verified property +func (m *GpgKey_emails) SetVerified(value *bool)() { + m.verified = value +} +type GpgKey_emailsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetVerified()(*bool) + SetEmail(value *string)() + SetVerified(value *bool)() +} diff --git a/pkg/github/models/gpg_key_escaped_subkeys.go b/pkg/github/models/gpg_key_escaped_subkeys.go new file mode 100644 index 00000000..5eb328b0 --- /dev/null +++ b/pkg/github/models/gpg_key_escaped_subkeys.go @@ -0,0 +1,469 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GpgKey_subkeys 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 can_certify property + can_certify *bool + // The can_encrypt_comms property + can_encrypt_comms *bool + // The can_encrypt_storage property + can_encrypt_storage *bool + // The can_sign property + can_sign *bool + // The created_at property + created_at *string + // The emails property + emails []GpgKey_subkeys_emailsable + // The expires_at property + expires_at *string + // The id property + id *int64 + // The key_id property + key_id *string + // The primary_key_id property + primary_key_id *int32 + // The public_key property + public_key *string + // The raw_key property + raw_key *string + // The revoked property + revoked *bool + // The subkeys property + subkeys i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable +} +// NewGpgKey_subkeys instantiates a new GpgKey_subkeys and sets the default values. +func NewGpgKey_subkeys()(*GpgKey_subkeys) { + m := &GpgKey_subkeys{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGpgKey_subkeysFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGpgKey_subkeysFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGpgKey_subkeys(), 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 *GpgKey_subkeys) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCanCertify gets the can_certify property value. The can_certify property +// returns a *bool when successful +func (m *GpgKey_subkeys) GetCanCertify()(*bool) { + return m.can_certify +} +// GetCanEncryptComms gets the can_encrypt_comms property value. The can_encrypt_comms property +// returns a *bool when successful +func (m *GpgKey_subkeys) GetCanEncryptComms()(*bool) { + return m.can_encrypt_comms +} +// GetCanEncryptStorage gets the can_encrypt_storage property value. The can_encrypt_storage property +// returns a *bool when successful +func (m *GpgKey_subkeys) GetCanEncryptStorage()(*bool) { + return m.can_encrypt_storage +} +// GetCanSign gets the can_sign property value. The can_sign property +// returns a *bool when successful +func (m *GpgKey_subkeys) GetCanSign()(*bool) { + return m.can_sign +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *GpgKey_subkeys) GetCreatedAt()(*string) { + return m.created_at +} +// GetEmails gets the emails property value. The emails property +// returns a []GpgKey_subkeys_emailsable when successful +func (m *GpgKey_subkeys) GetEmails()([]GpgKey_subkeys_emailsable) { + return m.emails +} +// GetExpiresAt gets the expires_at property value. The expires_at property +// returns a *string when successful +func (m *GpgKey_subkeys) GetExpiresAt()(*string) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GpgKey_subkeys) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["can_certify"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanCertify(val) + } + return nil + } + res["can_encrypt_comms"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanEncryptComms(val) + } + return nil + } + res["can_encrypt_storage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanEncryptStorage(val) + } + return nil + } + res["can_sign"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanSign(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["emails"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGpgKey_subkeys_emailsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GpgKey_subkeys_emailsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GpgKey_subkeys_emailsable) + } + } + m.SetEmails(res) + } + return nil + } + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["primary_key_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrimaryKeyId(val) + } + return nil + } + res["public_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicKey(val) + } + return nil + } + res["raw_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRawKey(val) + } + return nil + } + res["revoked"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRevoked(val) + } + return nil + } + res["subkeys"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSubkeys(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *GpgKey_subkeys) GetId()(*int64) { + return m.id +} +// GetKeyId gets the key_id property value. The key_id property +// returns a *string when successful +func (m *GpgKey_subkeys) GetKeyId()(*string) { + return m.key_id +} +// GetPrimaryKeyId gets the primary_key_id property value. The primary_key_id property +// returns a *int32 when successful +func (m *GpgKey_subkeys) GetPrimaryKeyId()(*int32) { + return m.primary_key_id +} +// GetPublicKey gets the public_key property value. The public_key property +// returns a *string when successful +func (m *GpgKey_subkeys) GetPublicKey()(*string) { + return m.public_key +} +// GetRawKey gets the raw_key property value. The raw_key property +// returns a *string when successful +func (m *GpgKey_subkeys) GetRawKey()(*string) { + return m.raw_key +} +// GetRevoked gets the revoked property value. The revoked property +// returns a *bool when successful +func (m *GpgKey_subkeys) GetRevoked()(*bool) { + return m.revoked +} +// GetSubkeys gets the subkeys property value. The subkeys property +// returns a UntypedNodeable when successful +func (m *GpgKey_subkeys) GetSubkeys()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + return m.subkeys +} +// Serialize serializes information the current object +func (m *GpgKey_subkeys) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("can_certify", m.GetCanCertify()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("can_encrypt_comms", m.GetCanEncryptComms()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("can_encrypt_storage", m.GetCanEncryptStorage()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("can_sign", m.GetCanSign()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + if m.GetEmails() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetEmails())) + for i, v := range m.GetEmails() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("emails", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_id", m.GetKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("primary_key_id", m.GetPrimaryKeyId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_key", m.GetPublicKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("raw_key", m.GetRawKey()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("revoked", m.GetRevoked()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("subkeys", m.GetSubkeys()) + 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 *GpgKey_subkeys) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCanCertify sets the can_certify property value. The can_certify property +func (m *GpgKey_subkeys) SetCanCertify(value *bool)() { + m.can_certify = value +} +// SetCanEncryptComms sets the can_encrypt_comms property value. The can_encrypt_comms property +func (m *GpgKey_subkeys) SetCanEncryptComms(value *bool)() { + m.can_encrypt_comms = value +} +// SetCanEncryptStorage sets the can_encrypt_storage property value. The can_encrypt_storage property +func (m *GpgKey_subkeys) SetCanEncryptStorage(value *bool)() { + m.can_encrypt_storage = value +} +// SetCanSign sets the can_sign property value. The can_sign property +func (m *GpgKey_subkeys) SetCanSign(value *bool)() { + m.can_sign = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *GpgKey_subkeys) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEmails sets the emails property value. The emails property +func (m *GpgKey_subkeys) SetEmails(value []GpgKey_subkeys_emailsable)() { + m.emails = value +} +// SetExpiresAt sets the expires_at property value. The expires_at property +func (m *GpgKey_subkeys) SetExpiresAt(value *string)() { + m.expires_at = value +} +// SetId sets the id property value. The id property +func (m *GpgKey_subkeys) SetId(value *int64)() { + m.id = value +} +// SetKeyId sets the key_id property value. The key_id property +func (m *GpgKey_subkeys) SetKeyId(value *string)() { + m.key_id = value +} +// SetPrimaryKeyId sets the primary_key_id property value. The primary_key_id property +func (m *GpgKey_subkeys) SetPrimaryKeyId(value *int32)() { + m.primary_key_id = value +} +// SetPublicKey sets the public_key property value. The public_key property +func (m *GpgKey_subkeys) SetPublicKey(value *string)() { + m.public_key = value +} +// SetRawKey sets the raw_key property value. The raw_key property +func (m *GpgKey_subkeys) SetRawKey(value *string)() { + m.raw_key = value +} +// SetRevoked sets the revoked property value. The revoked property +func (m *GpgKey_subkeys) SetRevoked(value *bool)() { + m.revoked = value +} +// SetSubkeys sets the subkeys property value. The subkeys property +func (m *GpgKey_subkeys) SetSubkeys(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() { + m.subkeys = value +} +type GpgKey_subkeysable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCanCertify()(*bool) + GetCanEncryptComms()(*bool) + GetCanEncryptStorage()(*bool) + GetCanSign()(*bool) + GetCreatedAt()(*string) + GetEmails()([]GpgKey_subkeys_emailsable) + GetExpiresAt()(*string) + GetId()(*int64) + GetKeyId()(*string) + GetPrimaryKeyId()(*int32) + GetPublicKey()(*string) + GetRawKey()(*string) + GetRevoked()(*bool) + GetSubkeys()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + SetCanCertify(value *bool)() + SetCanEncryptComms(value *bool)() + SetCanEncryptStorage(value *bool)() + SetCanSign(value *bool)() + SetCreatedAt(value *string)() + SetEmails(value []GpgKey_subkeys_emailsable)() + SetExpiresAt(value *string)() + SetId(value *int64)() + SetKeyId(value *string)() + SetPrimaryKeyId(value *int32)() + SetPublicKey(value *string)() + SetRawKey(value *string)() + SetRevoked(value *bool)() + SetSubkeys(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() +} diff --git a/pkg/github/models/gpg_key_escaped_subkeys_escaped_emails.go b/pkg/github/models/gpg_key_escaped_subkeys_escaped_emails.go new file mode 100644 index 00000000..7fdffcce --- /dev/null +++ b/pkg/github/models/gpg_key_escaped_subkeys_escaped_emails.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GpgKey_subkeys_emails 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 email property + email *string + // The verified property + verified *bool +} +// NewGpgKey_subkeys_emails instantiates a new GpgKey_subkeys_emails and sets the default values. +func NewGpgKey_subkeys_emails()(*GpgKey_subkeys_emails) { + m := &GpgKey_subkeys_emails{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGpgKey_subkeys_emailsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGpgKey_subkeys_emailsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGpgKey_subkeys_emails(), 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 *GpgKey_subkeys_emails) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *GpgKey_subkeys_emails) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GpgKey_subkeys_emails) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *GpgKey_subkeys_emails) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *GpgKey_subkeys_emails) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + 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 *GpgKey_subkeys_emails) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email property +func (m *GpgKey_subkeys_emails) SetEmail(value *string)() { + m.email = value +} +// SetVerified sets the verified property value. The verified property +func (m *GpgKey_subkeys_emails) SetVerified(value *bool)() { + m.verified = value +} +type GpgKey_subkeys_emailsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetVerified()(*bool) + SetEmail(value *string)() + SetVerified(value *bool)() +} diff --git a/pkg/github/models/group.go b/pkg/github/models/group.go new file mode 100644 index 00000000..acc4dd7b --- /dev/null +++ b/pkg/github/models/group.go @@ -0,0 +1,185 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Group 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 human-readable name for a security group. + displayName *string + // A unique identifier for the resource as defined by the provisioning client. + externalId *string + // The group members. + members []Group_membersable + // The URIs that are used to indicate the namespaces of the SCIM schemas. + schemas []Group_schemas +} +// NewGroup instantiates a new Group and sets the default values. +func NewGroup()(*Group) { + m := &Group{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGroupFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGroupFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGroup(), 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 *Group) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDisplayName gets the displayName property value. A human-readable name for a security group. +// returns a *string when successful +func (m *Group) GetDisplayName()(*string) { + return m.displayName +} +// GetExternalId gets the externalId property value. A unique identifier for the resource as defined by the provisioning client. +// returns a *string when successful +func (m *Group) GetExternalId()(*string) { + return m.externalId +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Group) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["displayName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["externalId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExternalId(val) + } + return nil + } + res["members"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGroup_membersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Group_membersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Group_membersable) + } + } + m.SetMembers(res) + } + return nil + } + res["schemas"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseGroup_schemas) + if err != nil { + return err + } + if val != nil { + res := make([]Group_schemas, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*Group_schemas)) + } + } + m.SetSchemas(res) + } + return nil + } + return res +} +// GetMembers gets the members property value. The group members. +// returns a []Group_membersable when successful +func (m *Group) GetMembers()([]Group_membersable) { + return m.members +} +// GetSchemas gets the schemas property value. The URIs that are used to indicate the namespaces of the SCIM schemas. +// returns a []Group_schemas when successful +func (m *Group) GetSchemas()([]Group_schemas) { + return m.schemas +} +// Serialize serializes information the current object +func (m *Group) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("displayName", m.GetDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("externalId", m.GetExternalId()) + if err != nil { + return err + } + } + if m.GetMembers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMembers())) + for i, v := range m.GetMembers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("members", cast) + if err != nil { + return err + } + } + if m.GetSchemas() != nil { + err := writer.WriteCollectionOfStringValues("schemas", SerializeGroup_schemas(m.GetSchemas())) + 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 *Group) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDisplayName sets the displayName property value. A human-readable name for a security group. +func (m *Group) SetDisplayName(value *string)() { + m.displayName = value +} +// SetExternalId sets the externalId property value. A unique identifier for the resource as defined by the provisioning client. +func (m *Group) SetExternalId(value *string)() { + m.externalId = value +} +// SetMembers sets the members property value. The group members. +func (m *Group) SetMembers(value []Group_membersable)() { + m.members = value +} +// SetSchemas sets the schemas property value. The URIs that are used to indicate the namespaces of the SCIM schemas. +func (m *Group) SetSchemas(value []Group_schemas)() { + m.schemas = value +} +type Groupable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDisplayName()(*string) + GetExternalId()(*string) + GetMembers()([]Group_membersable) + GetSchemas()([]Group_schemas) + SetDisplayName(value *string)() + SetExternalId(value *string)() + SetMembers(value []Group_membersable)() + SetSchemas(value []Group_schemas)() +} diff --git a/pkg/github/models/group_escaped_members.go b/pkg/github/models/group_escaped_members.go new file mode 100644 index 00000000..367f9496 --- /dev/null +++ b/pkg/github/models/group_escaped_members.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Group_members 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 display name associated with the member + displayName *string + // The local unique identifier for the member + value *string +} +// NewGroup_members instantiates a new Group_members and sets the default values. +func NewGroup_members()(*Group_members) { + m := &Group_members{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGroup_membersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGroup_membersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGroup_members(), 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 *Group_members) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDisplayName gets the displayName property value. The display name associated with the member +// returns a *string when successful +func (m *Group_members) GetDisplayName()(*string) { + return m.displayName +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Group_members) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["displayName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetValue gets the value property value. The local unique identifier for the member +// returns a *string when successful +func (m *Group_members) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *Group_members) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("displayName", m.GetDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + 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 *Group_members) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDisplayName sets the displayName property value. The display name associated with the member +func (m *Group_members) SetDisplayName(value *string)() { + m.displayName = value +} +// SetValue sets the value property value. The local unique identifier for the member +func (m *Group_members) SetValue(value *string)() { + m.value = value +} +type Group_membersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDisplayName()(*string) + GetValue()(*string) + SetDisplayName(value *string)() + SetValue(value *string)() +} diff --git a/pkg/github/models/group_escaped_schemas.go b/pkg/github/models/group_escaped_schemas.go new file mode 100644 index 00000000..1149ed26 --- /dev/null +++ b/pkg/github/models/group_escaped_schemas.go @@ -0,0 +1,30 @@ +package models +type Group_schemas int + +const ( + URNIETFPARAMSSCIMSCHEMASCORE20GROUP_GROUP_SCHEMAS Group_schemas = iota +) + +func (i Group_schemas) String() string { + return []string{"urn:ietf:params:scim:schemas:core:2.0:Group"}[i] +} +func ParseGroup_schemas(v string) (any, error) { + result := URNIETFPARAMSSCIMSCHEMASCORE20GROUP_GROUP_SCHEMAS + switch v { + case "urn:ietf:params:scim:schemas:core:2.0:Group": + result = URNIETFPARAMSSCIMSCHEMASCORE20GROUP_GROUP_SCHEMAS + default: + return nil, nil + } + return &result, nil +} +func SerializeGroup_schemas(values []Group_schemas) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Group_schemas) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/group_response.go b/pkg/github/models/group_response.go new file mode 100644 index 00000000..0e2abf30 --- /dev/null +++ b/pkg/github/models/group_response.go @@ -0,0 +1,185 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GroupResponse 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 human-readable name for a security group. + displayName *string + // A unique identifier for the resource as defined by the provisioning client. + externalId *string + // The group members. + members []GroupResponse_membersable + // The URIs that are used to indicate the namespaces of the SCIM schemas. + schemas []GroupResponse_schemas +} +// NewGroupResponse instantiates a new GroupResponse and sets the default values. +func NewGroupResponse()(*GroupResponse) { + m := &GroupResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGroupResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGroupResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGroupResponse(), 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 *GroupResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDisplayName gets the displayName property value. A human-readable name for a security group. +// returns a *string when successful +func (m *GroupResponse) GetDisplayName()(*string) { + return m.displayName +} +// GetExternalId gets the externalId property value. A unique identifier for the resource as defined by the provisioning client. +// returns a *string when successful +func (m *GroupResponse) GetExternalId()(*string) { + return m.externalId +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GroupResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["displayName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["externalId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExternalId(val) + } + return nil + } + res["members"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateGroupResponse_membersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]GroupResponse_membersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(GroupResponse_membersable) + } + } + m.SetMembers(res) + } + return nil + } + res["schemas"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseGroupResponse_schemas) + if err != nil { + return err + } + if val != nil { + res := make([]GroupResponse_schemas, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*GroupResponse_schemas)) + } + } + m.SetSchemas(res) + } + return nil + } + return res +} +// GetMembers gets the members property value. The group members. +// returns a []GroupResponse_membersable when successful +func (m *GroupResponse) GetMembers()([]GroupResponse_membersable) { + return m.members +} +// GetSchemas gets the schemas property value. The URIs that are used to indicate the namespaces of the SCIM schemas. +// returns a []GroupResponse_schemas when successful +func (m *GroupResponse) GetSchemas()([]GroupResponse_schemas) { + return m.schemas +} +// Serialize serializes information the current object +func (m *GroupResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("displayName", m.GetDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("externalId", m.GetExternalId()) + if err != nil { + return err + } + } + if m.GetMembers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMembers())) + for i, v := range m.GetMembers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("members", cast) + if err != nil { + return err + } + } + if m.GetSchemas() != nil { + err := writer.WriteCollectionOfStringValues("schemas", SerializeGroupResponse_schemas(m.GetSchemas())) + 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 *GroupResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDisplayName sets the displayName property value. A human-readable name for a security group. +func (m *GroupResponse) SetDisplayName(value *string)() { + m.displayName = value +} +// SetExternalId sets the externalId property value. A unique identifier for the resource as defined by the provisioning client. +func (m *GroupResponse) SetExternalId(value *string)() { + m.externalId = value +} +// SetMembers sets the members property value. The group members. +func (m *GroupResponse) SetMembers(value []GroupResponse_membersable)() { + m.members = value +} +// SetSchemas sets the schemas property value. The URIs that are used to indicate the namespaces of the SCIM schemas. +func (m *GroupResponse) SetSchemas(value []GroupResponse_schemas)() { + m.schemas = value +} +type GroupResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDisplayName()(*string) + GetExternalId()(*string) + GetMembers()([]GroupResponse_membersable) + GetSchemas()([]GroupResponse_schemas) + SetDisplayName(value *string)() + SetExternalId(value *string)() + SetMembers(value []GroupResponse_membersable)() + SetSchemas(value []GroupResponse_schemas)() +} diff --git a/pkg/github/models/group_response_escaped_members.go b/pkg/github/models/group_response_escaped_members.go new file mode 100644 index 00000000..7dd3d038 --- /dev/null +++ b/pkg/github/models/group_response_escaped_members.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type GroupResponse_members 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 display name associated with the member + display *string + // The Ref property + ref *string + // The local unique identifier for the member + value *string +} +// NewGroupResponse_members instantiates a new GroupResponse_members and sets the default values. +func NewGroupResponse_members()(*GroupResponse_members) { + m := &GroupResponse_members{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGroupResponse_membersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGroupResponse_membersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGroupResponse_members(), 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 *GroupResponse_members) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDisplay gets the display property value. The display name associated with the member +// returns a *string when successful +func (m *GroupResponse_members) GetDisplay()(*string) { + return m.display +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *GroupResponse_members) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["display"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplay(val) + } + return nil + } + res["$ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetRef gets the $ref property value. The Ref property +// returns a *string when successful +func (m *GroupResponse_members) GetRef()(*string) { + return m.ref +} +// GetValue gets the value property value. The local unique identifier for the member +// returns a *string when successful +func (m *GroupResponse_members) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *GroupResponse_members) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("display", m.GetDisplay()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("$ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + 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 *GroupResponse_members) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDisplay sets the display property value. The display name associated with the member +func (m *GroupResponse_members) SetDisplay(value *string)() { + m.display = value +} +// SetRef sets the $ref property value. The Ref property +func (m *GroupResponse_members) SetRef(value *string)() { + m.ref = value +} +// SetValue sets the value property value. The local unique identifier for the member +func (m *GroupResponse_members) SetValue(value *string)() { + m.value = value +} +type GroupResponse_membersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDisplay()(*string) + GetRef()(*string) + GetValue()(*string) + SetDisplay(value *string)() + SetRef(value *string)() + SetValue(value *string)() +} diff --git a/pkg/github/models/group_response_escaped_schemas.go b/pkg/github/models/group_response_escaped_schemas.go new file mode 100644 index 00000000..ebd4199a --- /dev/null +++ b/pkg/github/models/group_response_escaped_schemas.go @@ -0,0 +1,33 @@ +package models +type GroupResponse_schemas int + +const ( + URNIETFPARAMSSCIMSCHEMASCORE20GROUP_GROUPRESPONSE_SCHEMAS GroupResponse_schemas = iota + URNIETFPARAMSSCIMAPIMESSAGES20LISTRESPONSE_GROUPRESPONSE_SCHEMAS +) + +func (i GroupResponse_schemas) String() string { + return []string{"urn:ietf:params:scim:schemas:core:2.0:Group", "urn:ietf:params:scim:api:messages:2.0:ListResponse"}[i] +} +func ParseGroupResponse_schemas(v string) (any, error) { + result := URNIETFPARAMSSCIMSCHEMASCORE20GROUP_GROUPRESPONSE_SCHEMAS + switch v { + case "urn:ietf:params:scim:schemas:core:2.0:Group": + result = URNIETFPARAMSSCIMSCHEMASCORE20GROUP_GROUPRESPONSE_SCHEMAS + case "urn:ietf:params:scim:api:messages:2.0:ListResponse": + result = URNIETFPARAMSSCIMAPIMESSAGES20LISTRESPONSE_GROUPRESPONSE_SCHEMAS + default: + return nil, nil + } + return &result, nil +} +func SerializeGroupResponse_schemas(values []GroupResponse_schemas) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GroupResponse_schemas) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/hook.go b/pkg/github/models/hook.go new file mode 100644 index 00000000..83d41cf1 --- /dev/null +++ b/pkg/github/models/hook.go @@ -0,0 +1,436 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Hook webhooks for repositories. +type Hook struct { + // Determines whether the hook is actually triggered on pushes. + active *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Configuration object of the webhook + config WebhookConfigable + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The deliveries_url property + deliveries_url *string + // Determines what events the hook is triggered for. Default: ['push']. + events []string + // Unique identifier of the webhook. + id *int32 + // The last_response property + last_response HookResponseable + // The name of a valid service, use 'web' for a webhook. + name *string + // The ping_url property + ping_url *string + // The test_url property + test_url *string + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewHook instantiates a new Hook and sets the default values. +func NewHook()(*Hook) { + m := &Hook{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHook(), nil +} +// GetActive gets the active property value. Determines whether the hook is actually triggered on pushes. +// returns a *bool when successful +func (m *Hook) GetActive()(*bool) { + return m.active +} +// 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 *Hook) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfig gets the config property value. Configuration object of the webhook +// returns a WebhookConfigable when successful +func (m *Hook) GetConfig()(WebhookConfigable) { + return m.config +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Hook) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDeliveriesUrl gets the deliveries_url property value. The deliveries_url property +// returns a *string when successful +func (m *Hook) GetDeliveriesUrl()(*string) { + return m.deliveries_url +} +// GetEvents gets the events property value. Determines what events the hook is triggered for. Default: ['push']. +// returns a []string when successful +func (m *Hook) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Hook) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateWebhookConfigFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(WebhookConfigable)) + } + return nil + } + 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["deliveries_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeliveriesUrl(val) + } + return nil + } + res["events"] = 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.SetEvents(res) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["last_response"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateHookResponseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLastResponse(val.(HookResponseable)) + } + 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["ping_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPingUrl(val) + } + return nil + } + res["test_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTestUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the webhook. +// returns a *int32 when successful +func (m *Hook) GetId()(*int32) { + return m.id +} +// GetLastResponse gets the last_response property value. The last_response property +// returns a HookResponseable when successful +func (m *Hook) GetLastResponse()(HookResponseable) { + return m.last_response +} +// GetName gets the name property value. The name of a valid service, use 'web' for a webhook. +// returns a *string when successful +func (m *Hook) GetName()(*string) { + return m.name +} +// GetPingUrl gets the ping_url property value. The ping_url property +// returns a *string when successful +func (m *Hook) GetPingUrl()(*string) { + return m.ping_url +} +// GetTestUrl gets the test_url property value. The test_url property +// returns a *string when successful +func (m *Hook) GetTestUrl()(*string) { + return m.test_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Hook) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Hook) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Hook) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Hook) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deliveries_url", m.GetDeliveriesUrl()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("last_response", m.GetLastResponse()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ping_url", m.GetPingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("test_url", m.GetTestUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. Determines whether the hook is actually triggered on pushes. +func (m *Hook) SetActive(value *bool)() { + m.active = 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 *Hook) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfig sets the config property value. Configuration object of the webhook +func (m *Hook) SetConfig(value WebhookConfigable)() { + m.config = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Hook) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDeliveriesUrl sets the deliveries_url property value. The deliveries_url property +func (m *Hook) SetDeliveriesUrl(value *string)() { + m.deliveries_url = value +} +// SetEvents sets the events property value. Determines what events the hook is triggered for. Default: ['push']. +func (m *Hook) SetEvents(value []string)() { + m.events = value +} +// SetId sets the id property value. Unique identifier of the webhook. +func (m *Hook) SetId(value *int32)() { + m.id = value +} +// SetLastResponse sets the last_response property value. The last_response property +func (m *Hook) SetLastResponse(value HookResponseable)() { + m.last_response = value +} +// SetName sets the name property value. The name of a valid service, use 'web' for a webhook. +func (m *Hook) SetName(value *string)() { + m.name = value +} +// SetPingUrl sets the ping_url property value. The ping_url property +func (m *Hook) SetPingUrl(value *string)() { + m.ping_url = value +} +// SetTestUrl sets the test_url property value. The test_url property +func (m *Hook) SetTestUrl(value *string)() { + m.test_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Hook) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Hook) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Hook) SetUrl(value *string)() { + m.url = value +} +type Hookable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetConfig()(WebhookConfigable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDeliveriesUrl()(*string) + GetEvents()([]string) + GetId()(*int32) + GetLastResponse()(HookResponseable) + GetName()(*string) + GetPingUrl()(*string) + GetTestUrl()(*string) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetActive(value *bool)() + SetConfig(value WebhookConfigable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDeliveriesUrl(value *string)() + SetEvents(value []string)() + SetId(value *int32)() + SetLastResponse(value HookResponseable)() + SetName(value *string)() + SetPingUrl(value *string)() + SetTestUrl(value *string)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/hook_delivery.go b/pkg/github/models/hook_delivery.go new file mode 100644 index 00000000..a2e0b7a6 --- /dev/null +++ b/pkg/github/models/hook_delivery.go @@ -0,0 +1,488 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// HookDelivery delivery made by a webhook. +type HookDelivery struct { + // The type of activity for the event that triggered the delivery. + action *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Time when the delivery was delivered. + delivered_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Time spent delivering. + duration *float64 + // The event that triggered the delivery. + event *string + // Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). + guid *string + // Unique identifier of the delivery. + id *int32 + // The id of the GitHub App installation associated with this event. + installation_id *int32 + // Whether the delivery is a redelivery. + redelivery *bool + // The id of the repository associated with this event. + repository_id *int32 + // The request property + request HookDelivery_requestable + // The response property + response HookDelivery_responseable + // Description of the status of the attempted delivery + status *string + // Status code received when delivery was made. + status_code *int32 + // Time when the webhook delivery was throttled. + throttled_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The URL target of the delivery. + url *string +} +// NewHookDelivery instantiates a new HookDelivery and sets the default values. +func NewHookDelivery()(*HookDelivery) { + m := &HookDelivery{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDeliveryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDeliveryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDelivery(), nil +} +// GetAction gets the action property value. The type of activity for the event that triggered the delivery. +// returns a *string when successful +func (m *HookDelivery) GetAction()(*string) { + return m.action +} +// 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 *HookDelivery) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDeliveredAt gets the delivered_at property value. Time when the delivery was delivered. +// returns a *Time when successful +func (m *HookDelivery) GetDeliveredAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.delivered_at +} +// GetDuration gets the duration property value. Time spent delivering. +// returns a *float64 when successful +func (m *HookDelivery) GetDuration()(*float64) { + return m.duration +} +// GetEvent gets the event property value. The event that triggered the delivery. +// returns a *string when successful +func (m *HookDelivery) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HookDelivery) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["action"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAction(val) + } + return nil + } + res["delivered_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDeliveredAt(val) + } + return nil + } + res["duration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetDuration(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["guid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGuid(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["installation_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInstallationId(val) + } + return nil + } + res["redelivery"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRedelivery(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + res["request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateHookDelivery_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequest(val.(HookDelivery_requestable)) + } + return nil + } + res["response"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateHookDelivery_responseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetResponse(val.(HookDelivery_responseable)) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + res["status_code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStatusCode(val) + } + return nil + } + res["throttled_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetThrottledAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGuid gets the guid property value. Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). +// returns a *string when successful +func (m *HookDelivery) GetGuid()(*string) { + return m.guid +} +// GetId gets the id property value. Unique identifier of the delivery. +// returns a *int32 when successful +func (m *HookDelivery) GetId()(*int32) { + return m.id +} +// GetInstallationId gets the installation_id property value. The id of the GitHub App installation associated with this event. +// returns a *int32 when successful +func (m *HookDelivery) GetInstallationId()(*int32) { + return m.installation_id +} +// GetRedelivery gets the redelivery property value. Whether the delivery is a redelivery. +// returns a *bool when successful +func (m *HookDelivery) GetRedelivery()(*bool) { + return m.redelivery +} +// GetRepositoryId gets the repository_id property value. The id of the repository associated with this event. +// returns a *int32 when successful +func (m *HookDelivery) GetRepositoryId()(*int32) { + return m.repository_id +} +// GetRequest gets the request property value. The request property +// returns a HookDelivery_requestable when successful +func (m *HookDelivery) GetRequest()(HookDelivery_requestable) { + return m.request +} +// GetResponse gets the response property value. The response property +// returns a HookDelivery_responseable when successful +func (m *HookDelivery) GetResponse()(HookDelivery_responseable) { + return m.response +} +// GetStatus gets the status property value. Description of the status of the attempted delivery +// returns a *string when successful +func (m *HookDelivery) GetStatus()(*string) { + return m.status +} +// GetStatusCode gets the status_code property value. Status code received when delivery was made. +// returns a *int32 when successful +func (m *HookDelivery) GetStatusCode()(*int32) { + return m.status_code +} +// GetThrottledAt gets the throttled_at property value. Time when the webhook delivery was throttled. +// returns a *Time when successful +func (m *HookDelivery) GetThrottledAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.throttled_at +} +// GetUrl gets the url property value. The URL target of the delivery. +// returns a *string when successful +func (m *HookDelivery) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *HookDelivery) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("action", m.GetAction()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("delivered_at", m.GetDeliveredAt()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("duration", m.GetDuration()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("guid", m.GetGuid()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("installation_id", m.GetInstallationId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("redelivery", m.GetRedelivery()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("request", m.GetRequest()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("response", m.GetResponse()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("status_code", m.GetStatusCode()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("throttled_at", m.GetThrottledAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAction sets the action property value. The type of activity for the event that triggered the delivery. +func (m *HookDelivery) SetAction(value *string)() { + m.action = 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 *HookDelivery) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDeliveredAt sets the delivered_at property value. Time when the delivery was delivered. +func (m *HookDelivery) SetDeliveredAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.delivered_at = value +} +// SetDuration sets the duration property value. Time spent delivering. +func (m *HookDelivery) SetDuration(value *float64)() { + m.duration = value +} +// SetEvent sets the event property value. The event that triggered the delivery. +func (m *HookDelivery) SetEvent(value *string)() { + m.event = value +} +// SetGuid sets the guid property value. Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). +func (m *HookDelivery) SetGuid(value *string)() { + m.guid = value +} +// SetId sets the id property value. Unique identifier of the delivery. +func (m *HookDelivery) SetId(value *int32)() { + m.id = value +} +// SetInstallationId sets the installation_id property value. The id of the GitHub App installation associated with this event. +func (m *HookDelivery) SetInstallationId(value *int32)() { + m.installation_id = value +} +// SetRedelivery sets the redelivery property value. Whether the delivery is a redelivery. +func (m *HookDelivery) SetRedelivery(value *bool)() { + m.redelivery = value +} +// SetRepositoryId sets the repository_id property value. The id of the repository associated with this event. +func (m *HookDelivery) SetRepositoryId(value *int32)() { + m.repository_id = value +} +// SetRequest sets the request property value. The request property +func (m *HookDelivery) SetRequest(value HookDelivery_requestable)() { + m.request = value +} +// SetResponse sets the response property value. The response property +func (m *HookDelivery) SetResponse(value HookDelivery_responseable)() { + m.response = value +} +// SetStatus sets the status property value. Description of the status of the attempted delivery +func (m *HookDelivery) SetStatus(value *string)() { + m.status = value +} +// SetStatusCode sets the status_code property value. Status code received when delivery was made. +func (m *HookDelivery) SetStatusCode(value *int32)() { + m.status_code = value +} +// SetThrottledAt sets the throttled_at property value. Time when the webhook delivery was throttled. +func (m *HookDelivery) SetThrottledAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.throttled_at = value +} +// SetUrl sets the url property value. The URL target of the delivery. +func (m *HookDelivery) SetUrl(value *string)() { + m.url = value +} +type HookDeliveryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAction()(*string) + GetDeliveredAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDuration()(*float64) + GetEvent()(*string) + GetGuid()(*string) + GetId()(*int32) + GetInstallationId()(*int32) + GetRedelivery()(*bool) + GetRepositoryId()(*int32) + GetRequest()(HookDelivery_requestable) + GetResponse()(HookDelivery_responseable) + GetStatus()(*string) + GetStatusCode()(*int32) + GetThrottledAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAction(value *string)() + SetDeliveredAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDuration(value *float64)() + SetEvent(value *string)() + SetGuid(value *string)() + SetId(value *int32)() + SetInstallationId(value *int32)() + SetRedelivery(value *bool)() + SetRepositoryId(value *int32)() + SetRequest(value HookDelivery_requestable)() + SetResponse(value HookDelivery_responseable)() + SetStatus(value *string)() + SetStatusCode(value *int32)() + SetThrottledAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/hook_delivery_escaped_request.go b/pkg/github/models/hook_delivery_escaped_request.go new file mode 100644 index 00000000..9a116e43 --- /dev/null +++ b/pkg/github/models/hook_delivery_escaped_request.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type HookDelivery_request 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 request headers sent with the webhook delivery. + headers HookDelivery_request_headersable + // The webhook payload. + payload HookDelivery_request_payloadable +} +// NewHookDelivery_request instantiates a new HookDelivery_request and sets the default values. +func NewHookDelivery_request()(*HookDelivery_request) { + m := &HookDelivery_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDelivery_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDelivery_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDelivery_request(), 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 *HookDelivery_request) 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 *HookDelivery_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["headers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateHookDelivery_request_headersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHeaders(val.(HookDelivery_request_headersable)) + } + return nil + } + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateHookDelivery_request_payloadFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPayload(val.(HookDelivery_request_payloadable)) + } + return nil + } + return res +} +// GetHeaders gets the headers property value. The request headers sent with the webhook delivery. +// returns a HookDelivery_request_headersable when successful +func (m *HookDelivery_request) GetHeaders()(HookDelivery_request_headersable) { + return m.headers +} +// GetPayload gets the payload property value. The webhook payload. +// returns a HookDelivery_request_payloadable when successful +func (m *HookDelivery_request) GetPayload()(HookDelivery_request_payloadable) { + return m.payload +} +// Serialize serializes information the current object +func (m *HookDelivery_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("headers", m.GetHeaders()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("payload", m.GetPayload()) + 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 *HookDelivery_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHeaders sets the headers property value. The request headers sent with the webhook delivery. +func (m *HookDelivery_request) SetHeaders(value HookDelivery_request_headersable)() { + m.headers = value +} +// SetPayload sets the payload property value. The webhook payload. +func (m *HookDelivery_request) SetPayload(value HookDelivery_request_payloadable)() { + m.payload = value +} +type HookDelivery_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHeaders()(HookDelivery_request_headersable) + GetPayload()(HookDelivery_request_payloadable) + SetHeaders(value HookDelivery_request_headersable)() + SetPayload(value HookDelivery_request_payloadable)() +} diff --git a/pkg/github/models/hook_delivery_escaped_request_escaped_headers.go b/pkg/github/models/hook_delivery_escaped_request_escaped_headers.go new file mode 100644 index 00000000..24156dfe --- /dev/null +++ b/pkg/github/models/hook_delivery_escaped_request_escaped_headers.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// HookDelivery_request_headers the request headers sent with the webhook delivery. +type HookDelivery_request_headers struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewHookDelivery_request_headers instantiates a new HookDelivery_request_headers and sets the default values. +func NewHookDelivery_request_headers()(*HookDelivery_request_headers) { + m := &HookDelivery_request_headers{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDelivery_request_headersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDelivery_request_headersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDelivery_request_headers(), 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 *HookDelivery_request_headers) 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 *HookDelivery_request_headers) 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 *HookDelivery_request_headers) 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 *HookDelivery_request_headers) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type HookDelivery_request_headersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/hook_delivery_escaped_request_escaped_payload.go b/pkg/github/models/hook_delivery_escaped_request_escaped_payload.go new file mode 100644 index 00000000..5eb11a22 --- /dev/null +++ b/pkg/github/models/hook_delivery_escaped_request_escaped_payload.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// HookDelivery_request_payload the webhook payload. +type HookDelivery_request_payload struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewHookDelivery_request_payload instantiates a new HookDelivery_request_payload and sets the default values. +func NewHookDelivery_request_payload()(*HookDelivery_request_payload) { + m := &HookDelivery_request_payload{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDelivery_request_payloadFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDelivery_request_payloadFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDelivery_request_payload(), 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 *HookDelivery_request_payload) 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 *HookDelivery_request_payload) 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 *HookDelivery_request_payload) 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 *HookDelivery_request_payload) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type HookDelivery_request_payloadable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/hook_delivery_escaped_response.go b/pkg/github/models/hook_delivery_escaped_response.go new file mode 100644 index 00000000..5f86f882 --- /dev/null +++ b/pkg/github/models/hook_delivery_escaped_response.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type HookDelivery_response 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 response headers received when the delivery was made. + headers HookDelivery_response_headersable + // The response payload received. + payload *string +} +// NewHookDelivery_response instantiates a new HookDelivery_response and sets the default values. +func NewHookDelivery_response()(*HookDelivery_response) { + m := &HookDelivery_response{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDelivery_responseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDelivery_responseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDelivery_response(), 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 *HookDelivery_response) 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 *HookDelivery_response) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["headers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateHookDelivery_response_headersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHeaders(val.(HookDelivery_response_headersable)) + } + return nil + } + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + return res +} +// GetHeaders gets the headers property value. The response headers received when the delivery was made. +// returns a HookDelivery_response_headersable when successful +func (m *HookDelivery_response) GetHeaders()(HookDelivery_response_headersable) { + return m.headers +} +// GetPayload gets the payload property value. The response payload received. +// returns a *string when successful +func (m *HookDelivery_response) GetPayload()(*string) { + return m.payload +} +// Serialize serializes information the current object +func (m *HookDelivery_response) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("headers", m.GetHeaders()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("payload", m.GetPayload()) + 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 *HookDelivery_response) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHeaders sets the headers property value. The response headers received when the delivery was made. +func (m *HookDelivery_response) SetHeaders(value HookDelivery_response_headersable)() { + m.headers = value +} +// SetPayload sets the payload property value. The response payload received. +func (m *HookDelivery_response) SetPayload(value *string)() { + m.payload = value +} +type HookDelivery_responseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHeaders()(HookDelivery_response_headersable) + GetPayload()(*string) + SetHeaders(value HookDelivery_response_headersable)() + SetPayload(value *string)() +} diff --git a/pkg/github/models/hook_delivery_escaped_response_escaped_headers.go b/pkg/github/models/hook_delivery_escaped_response_escaped_headers.go new file mode 100644 index 00000000..dde90a90 --- /dev/null +++ b/pkg/github/models/hook_delivery_escaped_response_escaped_headers.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// HookDelivery_response_headers the response headers received when the delivery was made. +type HookDelivery_response_headers struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewHookDelivery_response_headers instantiates a new HookDelivery_response_headers and sets the default values. +func NewHookDelivery_response_headers()(*HookDelivery_response_headers) { + m := &HookDelivery_response_headers{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDelivery_response_headersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDelivery_response_headersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDelivery_response_headers(), 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 *HookDelivery_response_headers) 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 *HookDelivery_response_headers) 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 *HookDelivery_response_headers) 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 *HookDelivery_response_headers) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type HookDelivery_response_headersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/hook_delivery_item.go b/pkg/github/models/hook_delivery_item.go new file mode 100644 index 00000000..0340ded1 --- /dev/null +++ b/pkg/github/models/hook_delivery_item.go @@ -0,0 +1,401 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// HookDeliveryItem delivery made by a webhook, without request and response information. +type HookDeliveryItem struct { + // The type of activity for the event that triggered the delivery. + action *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Time when the webhook delivery occurred. + delivered_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Time spent delivering. + duration *float64 + // The event that triggered the delivery. + event *string + // Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). + guid *string + // Unique identifier of the webhook delivery. + id *int32 + // The id of the GitHub App installation associated with this event. + installation_id *int32 + // Whether the webhook delivery is a redelivery. + redelivery *bool + // The id of the repository associated with this event. + repository_id *int32 + // Describes the response returned after attempting the delivery. + status *string + // Status code received when delivery was made. + status_code *int32 + // Time when the webhook delivery was throttled. + throttled_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewHookDeliveryItem instantiates a new HookDeliveryItem and sets the default values. +func NewHookDeliveryItem()(*HookDeliveryItem) { + m := &HookDeliveryItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookDeliveryItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookDeliveryItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookDeliveryItem(), nil +} +// GetAction gets the action property value. The type of activity for the event that triggered the delivery. +// returns a *string when successful +func (m *HookDeliveryItem) GetAction()(*string) { + return m.action +} +// 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 *HookDeliveryItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDeliveredAt gets the delivered_at property value. Time when the webhook delivery occurred. +// returns a *Time when successful +func (m *HookDeliveryItem) GetDeliveredAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.delivered_at +} +// GetDuration gets the duration property value. Time spent delivering. +// returns a *float64 when successful +func (m *HookDeliveryItem) GetDuration()(*float64) { + return m.duration +} +// GetEvent gets the event property value. The event that triggered the delivery. +// returns a *string when successful +func (m *HookDeliveryItem) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HookDeliveryItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["action"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAction(val) + } + return nil + } + res["delivered_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDeliveredAt(val) + } + return nil + } + res["duration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetDuration(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["guid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGuid(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["installation_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInstallationId(val) + } + return nil + } + res["redelivery"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRedelivery(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + res["status_code"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStatusCode(val) + } + return nil + } + res["throttled_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetThrottledAt(val) + } + return nil + } + return res +} +// GetGuid gets the guid property value. Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). +// returns a *string when successful +func (m *HookDeliveryItem) GetGuid()(*string) { + return m.guid +} +// GetId gets the id property value. Unique identifier of the webhook delivery. +// returns a *int32 when successful +func (m *HookDeliveryItem) GetId()(*int32) { + return m.id +} +// GetInstallationId gets the installation_id property value. The id of the GitHub App installation associated with this event. +// returns a *int32 when successful +func (m *HookDeliveryItem) GetInstallationId()(*int32) { + return m.installation_id +} +// GetRedelivery gets the redelivery property value. Whether the webhook delivery is a redelivery. +// returns a *bool when successful +func (m *HookDeliveryItem) GetRedelivery()(*bool) { + return m.redelivery +} +// GetRepositoryId gets the repository_id property value. The id of the repository associated with this event. +// returns a *int32 when successful +func (m *HookDeliveryItem) GetRepositoryId()(*int32) { + return m.repository_id +} +// GetStatus gets the status property value. Describes the response returned after attempting the delivery. +// returns a *string when successful +func (m *HookDeliveryItem) GetStatus()(*string) { + return m.status +} +// GetStatusCode gets the status_code property value. Status code received when delivery was made. +// returns a *int32 when successful +func (m *HookDeliveryItem) GetStatusCode()(*int32) { + return m.status_code +} +// GetThrottledAt gets the throttled_at property value. Time when the webhook delivery was throttled. +// returns a *Time when successful +func (m *HookDeliveryItem) GetThrottledAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.throttled_at +} +// Serialize serializes information the current object +func (m *HookDeliveryItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("action", m.GetAction()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("delivered_at", m.GetDeliveredAt()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("duration", m.GetDuration()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("guid", m.GetGuid()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("installation_id", m.GetInstallationId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("redelivery", m.GetRedelivery()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("status_code", m.GetStatusCode()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("throttled_at", m.GetThrottledAt()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAction sets the action property value. The type of activity for the event that triggered the delivery. +func (m *HookDeliveryItem) SetAction(value *string)() { + m.action = 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 *HookDeliveryItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDeliveredAt sets the delivered_at property value. Time when the webhook delivery occurred. +func (m *HookDeliveryItem) SetDeliveredAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.delivered_at = value +} +// SetDuration sets the duration property value. Time spent delivering. +func (m *HookDeliveryItem) SetDuration(value *float64)() { + m.duration = value +} +// SetEvent sets the event property value. The event that triggered the delivery. +func (m *HookDeliveryItem) SetEvent(value *string)() { + m.event = value +} +// SetGuid sets the guid property value. Unique identifier for the event (shared with all deliveries for all webhooks that subscribe to this event). +func (m *HookDeliveryItem) SetGuid(value *string)() { + m.guid = value +} +// SetId sets the id property value. Unique identifier of the webhook delivery. +func (m *HookDeliveryItem) SetId(value *int32)() { + m.id = value +} +// SetInstallationId sets the installation_id property value. The id of the GitHub App installation associated with this event. +func (m *HookDeliveryItem) SetInstallationId(value *int32)() { + m.installation_id = value +} +// SetRedelivery sets the redelivery property value. Whether the webhook delivery is a redelivery. +func (m *HookDeliveryItem) SetRedelivery(value *bool)() { + m.redelivery = value +} +// SetRepositoryId sets the repository_id property value. The id of the repository associated with this event. +func (m *HookDeliveryItem) SetRepositoryId(value *int32)() { + m.repository_id = value +} +// SetStatus sets the status property value. Describes the response returned after attempting the delivery. +func (m *HookDeliveryItem) SetStatus(value *string)() { + m.status = value +} +// SetStatusCode sets the status_code property value. Status code received when delivery was made. +func (m *HookDeliveryItem) SetStatusCode(value *int32)() { + m.status_code = value +} +// SetThrottledAt sets the throttled_at property value. Time when the webhook delivery was throttled. +func (m *HookDeliveryItem) SetThrottledAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.throttled_at = value +} +type HookDeliveryItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAction()(*string) + GetDeliveredAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDuration()(*float64) + GetEvent()(*string) + GetGuid()(*string) + GetId()(*int32) + GetInstallationId()(*int32) + GetRedelivery()(*bool) + GetRepositoryId()(*int32) + GetStatus()(*string) + GetStatusCode()(*int32) + GetThrottledAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetAction(value *string)() + SetDeliveredAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDuration(value *float64)() + SetEvent(value *string)() + SetGuid(value *string)() + SetId(value *int32)() + SetInstallationId(value *int32)() + SetRedelivery(value *bool)() + SetRepositoryId(value *int32)() + SetStatus(value *string)() + SetStatusCode(value *int32)() + SetThrottledAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/hook_response.go b/pkg/github/models/hook_response.go new file mode 100644 index 00000000..98bd9219 --- /dev/null +++ b/pkg/github/models/hook_response.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type HookResponse 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 code property + code *int32 + // The message property + message *string + // The status property + status *string +} +// NewHookResponse instantiates a new HookResponse and sets the default values. +func NewHookResponse()(*HookResponse) { + m := &HookResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHookResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHookResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHookResponse(), 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 *HookResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *int32 when successful +func (m *HookResponse) GetCode()(*int32) { + return m.code +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *HookResponse) 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.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCode(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 + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *HookResponse) GetMessage()(*string) { + return m.message +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *HookResponse) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *HookResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *HookResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *HookResponse) SetCode(value *int32)() { + m.code = value +} +// SetMessage sets the message property value. The message property +func (m *HookResponse) SetMessage(value *string)() { + m.message = value +} +// SetStatus sets the status property value. The status property +func (m *HookResponse) SetStatus(value *string)() { + m.status = value +} +type HookResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*int32) + GetMessage()(*string) + GetStatus()(*string) + SetCode(value *int32)() + SetMessage(value *string)() + SetStatus(value *string)() +} diff --git a/pkg/github/models/hovercard.go b/pkg/github/models/hovercard.go new file mode 100644 index 00000000..f3ab9743 --- /dev/null +++ b/pkg/github/models/hovercard.go @@ -0,0 +1,93 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Hovercard hovercard +type Hovercard 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 contexts property + contexts []Hovercard_contextsable +} +// NewHovercard instantiates a new Hovercard and sets the default values. +func NewHovercard()(*Hovercard) { + m := &Hovercard{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHovercardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHovercardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHovercard(), 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 *Hovercard) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContexts gets the contexts property value. The contexts property +// returns a []Hovercard_contextsable when successful +func (m *Hovercard) GetContexts()([]Hovercard_contextsable) { + return m.contexts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Hovercard) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["contexts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateHovercard_contextsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Hovercard_contextsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Hovercard_contextsable) + } + } + m.SetContexts(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *Hovercard) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContexts() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetContexts())) + for i, v := range m.GetContexts() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("contexts", 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 *Hovercard) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContexts sets the contexts property value. The contexts property +func (m *Hovercard) SetContexts(value []Hovercard_contextsable)() { + m.contexts = value +} +type Hovercardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContexts()([]Hovercard_contextsable) + SetContexts(value []Hovercard_contextsable)() +} diff --git a/pkg/github/models/hovercard_escaped_contexts.go b/pkg/github/models/hovercard_escaped_contexts.go new file mode 100644 index 00000000..9239a0fc --- /dev/null +++ b/pkg/github/models/hovercard_escaped_contexts.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Hovercard_contexts 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 message property + message *string + // The octicon property + octicon *string +} +// NewHovercard_contexts instantiates a new Hovercard_contexts and sets the default values. +func NewHovercard_contexts()(*Hovercard_contexts) { + m := &Hovercard_contexts{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateHovercard_contextsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateHovercard_contextsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewHovercard_contexts(), 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 *Hovercard_contexts) 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 *Hovercard_contexts) 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["octicon"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOcticon(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *Hovercard_contexts) GetMessage()(*string) { + return m.message +} +// GetOcticon gets the octicon property value. The octicon property +// returns a *string when successful +func (m *Hovercard_contexts) GetOcticon()(*string) { + return m.octicon +} +// Serialize serializes information the current object +func (m *Hovercard_contexts) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("octicon", m.GetOcticon()) + 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 *Hovercard_contexts) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The message property +func (m *Hovercard_contexts) SetMessage(value *string)() { + m.message = value +} +// SetOcticon sets the octicon property value. The octicon property +func (m *Hovercard_contexts) SetOcticon(value *string)() { + m.octicon = value +} +type Hovercard_contextsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + GetOcticon()(*string) + SetMessage(value *string)() + SetOcticon(value *string)() +} diff --git a/pkg/github/models/installation.go b/pkg/github/models/installation.go new file mode 100644 index 00000000..dc40355d --- /dev/null +++ b/pkg/github/models/installation.go @@ -0,0 +1,732 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Installation installation +type Installation struct { + // The access_tokens_url property + access_tokens_url *string + // The account property + account Installation_Installation_accountable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The app_id property + app_id *int32 + // The app_slug property + app_slug *string + // The contact_email property + contact_email *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The events property + events []string + // The has_multiple_single_files property + has_multiple_single_files *bool + // The html_url property + html_url *string + // The ID of the installation. + id *int32 + // The permissions granted to the user access token. + permissions AppPermissionsable + // The repositories_url property + repositories_url *string + // Describe whether all repositories have been selected or there's a selection involved + repository_selection *Installation_repository_selection + // The single_file_name property + single_file_name *string + // The single_file_paths property + single_file_paths []string + // The suspended_at property + suspended_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + suspended_by NullableSimpleUserable + // The ID of the user or organization this token is being scoped to. + target_id *int32 + // The target_type property + target_type *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// Installation_Installation_account composed type wrapper for classes Enterpriseable, SimpleUserable +type Installation_Installation_account struct { + // Composed type representation for type Enterpriseable + enterprise Enterpriseable + // Composed type representation for type SimpleUserable + simpleUser SimpleUserable +} +// NewInstallation_Installation_account instantiates a new Installation_Installation_account and sets the default values. +func NewInstallation_Installation_account()(*Installation_Installation_account) { + m := &Installation_Installation_account{ + } + return m +} +// CreateInstallation_Installation_accountFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInstallation_Installation_accountFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewInstallation_Installation_account() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateEnterpriseFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(Enterpriseable); ok { + result.SetEnterprise(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateSimpleUserFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(SimpleUserable); ok { + result.SetSimpleUser(cast) + } + } + } + return result, nil +} +// GetEnterprise gets the enterprise property value. Composed type representation for type Enterpriseable +// returns a Enterpriseable when successful +func (m *Installation_Installation_account) GetEnterprise()(Enterpriseable) { + return m.enterprise +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Installation_Installation_account) 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 *Installation_Installation_account) GetIsComposedType()(bool) { + return true +} +// GetSimpleUser gets the simpleUser property value. Composed type representation for type SimpleUserable +// returns a SimpleUserable when successful +func (m *Installation_Installation_account) GetSimpleUser()(SimpleUserable) { + return m.simpleUser +} +// Serialize serializes information the current object +func (m *Installation_Installation_account) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEnterprise() != nil { + err := writer.WriteObjectValue("", m.GetEnterprise()) + if err != nil { + return err + } + } else if m.GetSimpleUser() != nil { + err := writer.WriteObjectValue("", m.GetSimpleUser()) + if err != nil { + return err + } + } + return nil +} +// SetEnterprise sets the enterprise property value. Composed type representation for type Enterpriseable +func (m *Installation_Installation_account) SetEnterprise(value Enterpriseable)() { + m.enterprise = value +} +// SetSimpleUser sets the simpleUser property value. Composed type representation for type SimpleUserable +func (m *Installation_Installation_account) SetSimpleUser(value SimpleUserable)() { + m.simpleUser = value +} +type Installation_Installation_accountable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnterprise()(Enterpriseable) + GetSimpleUser()(SimpleUserable) + SetEnterprise(value Enterpriseable)() + SetSimpleUser(value SimpleUserable)() +} +// NewInstallation instantiates a new Installation and sets the default values. +func NewInstallation()(*Installation) { + m := &Installation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateInstallationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInstallationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInstallation(), nil +} +// GetAccessTokensUrl gets the access_tokens_url property value. The access_tokens_url property +// returns a *string when successful +func (m *Installation) GetAccessTokensUrl()(*string) { + return m.access_tokens_url +} +// GetAccount gets the account property value. The account property +// returns a Installation_Installation_accountable when successful +func (m *Installation) GetAccount()(Installation_Installation_accountable) { + return m.account +} +// 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 *Installation) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAppId gets the app_id property value. The app_id property +// returns a *int32 when successful +func (m *Installation) GetAppId()(*int32) { + return m.app_id +} +// GetAppSlug gets the app_slug property value. The app_slug property +// returns a *string when successful +func (m *Installation) GetAppSlug()(*string) { + return m.app_slug +} +// GetContactEmail gets the contact_email property value. The contact_email property +// returns a *string when successful +func (m *Installation) GetContactEmail()(*string) { + return m.contact_email +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Installation) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetEvents gets the events property value. The events property +// returns a []string when successful +func (m *Installation) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Installation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_tokens_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccessTokensUrl(val) + } + return nil + } + res["account"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateInstallation_Installation_accountFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAccount(val.(Installation_Installation_accountable)) + } + return nil + } + res["app_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["app_slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAppSlug(val) + } + return nil + } + res["contact_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContactEmail(val) + } + return nil + } + 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["events"] = 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.SetEvents(res) + } + return nil + } + res["has_multiple_single_files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasMultipleSingleFiles(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAppPermissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(AppPermissionsable)) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseInstallation_repository_selection) + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val.(*Installation_repository_selection)) + } + return nil + } + res["single_file_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSingleFileName(val) + } + return nil + } + res["single_file_paths"] = 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.SetSingleFilePaths(res) + } + return nil + } + res["suspended_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetSuspendedAt(val) + } + return nil + } + res["suspended_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSuspendedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["target_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTargetId(val) + } + return nil + } + res["target_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetType(val) + } + 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 + } + return res +} +// GetHasMultipleSingleFiles gets the has_multiple_single_files property value. The has_multiple_single_files property +// returns a *bool when successful +func (m *Installation) GetHasMultipleSingleFiles()(*bool) { + return m.has_multiple_single_files +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Installation) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The ID of the installation. +// returns a *int32 when successful +func (m *Installation) GetId()(*int32) { + return m.id +} +// GetPermissions gets the permissions property value. The permissions granted to the user access token. +// returns a AppPermissionsable when successful +func (m *Installation) GetPermissions()(AppPermissionsable) { + return m.permissions +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *Installation) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetRepositorySelection gets the repository_selection property value. Describe whether all repositories have been selected or there's a selection involved +// returns a *Installation_repository_selection when successful +func (m *Installation) GetRepositorySelection()(*Installation_repository_selection) { + return m.repository_selection +} +// GetSingleFileName gets the single_file_name property value. The single_file_name property +// returns a *string when successful +func (m *Installation) GetSingleFileName()(*string) { + return m.single_file_name +} +// GetSingleFilePaths gets the single_file_paths property value. The single_file_paths property +// returns a []string when successful +func (m *Installation) GetSingleFilePaths()([]string) { + return m.single_file_paths +} +// GetSuspendedAt gets the suspended_at property value. The suspended_at property +// returns a *Time when successful +func (m *Installation) GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.suspended_at +} +// GetSuspendedBy gets the suspended_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Installation) GetSuspendedBy()(NullableSimpleUserable) { + return m.suspended_by +} +// GetTargetId gets the target_id property value. The ID of the user or organization this token is being scoped to. +// returns a *int32 when successful +func (m *Installation) GetTargetId()(*int32) { + return m.target_id +} +// GetTargetType gets the target_type property value. The target_type property +// returns a *string when successful +func (m *Installation) GetTargetType()(*string) { + return m.target_type +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Installation) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *Installation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("access_tokens_url", m.GetAccessTokensUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("account", m.GetAccount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("app_id", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("app_slug", m.GetAppSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contact_email", m.GetContactEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_multiple_single_files", m.GetHasMultipleSingleFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + if m.GetRepositorySelection() != nil { + cast := (*m.GetRepositorySelection()).String() + err := writer.WriteStringValue("repository_selection", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("single_file_name", m.GetSingleFileName()) + if err != nil { + return err + } + } + if m.GetSingleFilePaths() != nil { + err := writer.WriteCollectionOfStringValues("single_file_paths", m.GetSingleFilePaths()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("suspended_at", m.GetSuspendedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("suspended_by", m.GetSuspendedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("target_id", m.GetTargetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_type", m.GetTargetType()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessTokensUrl sets the access_tokens_url property value. The access_tokens_url property +func (m *Installation) SetAccessTokensUrl(value *string)() { + m.access_tokens_url = value +} +// SetAccount sets the account property value. The account property +func (m *Installation) SetAccount(value Installation_Installation_accountable)() { + m.account = 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 *Installation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAppId sets the app_id property value. The app_id property +func (m *Installation) SetAppId(value *int32)() { + m.app_id = value +} +// SetAppSlug sets the app_slug property value. The app_slug property +func (m *Installation) SetAppSlug(value *string)() { + m.app_slug = value +} +// SetContactEmail sets the contact_email property value. The contact_email property +func (m *Installation) SetContactEmail(value *string)() { + m.contact_email = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Installation) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetEvents sets the events property value. The events property +func (m *Installation) SetEvents(value []string)() { + m.events = value +} +// SetHasMultipleSingleFiles sets the has_multiple_single_files property value. The has_multiple_single_files property +func (m *Installation) SetHasMultipleSingleFiles(value *bool)() { + m.has_multiple_single_files = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Installation) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The ID of the installation. +func (m *Installation) SetId(value *int32)() { + m.id = value +} +// SetPermissions sets the permissions property value. The permissions granted to the user access token. +func (m *Installation) SetPermissions(value AppPermissionsable)() { + m.permissions = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *Installation) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetRepositorySelection sets the repository_selection property value. Describe whether all repositories have been selected or there's a selection involved +func (m *Installation) SetRepositorySelection(value *Installation_repository_selection)() { + m.repository_selection = value +} +// SetSingleFileName sets the single_file_name property value. The single_file_name property +func (m *Installation) SetSingleFileName(value *string)() { + m.single_file_name = value +} +// SetSingleFilePaths sets the single_file_paths property value. The single_file_paths property +func (m *Installation) SetSingleFilePaths(value []string)() { + m.single_file_paths = value +} +// SetSuspendedAt sets the suspended_at property value. The suspended_at property +func (m *Installation) SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.suspended_at = value +} +// SetSuspendedBy sets the suspended_by property value. A GitHub user. +func (m *Installation) SetSuspendedBy(value NullableSimpleUserable)() { + m.suspended_by = value +} +// SetTargetId sets the target_id property value. The ID of the user or organization this token is being scoped to. +func (m *Installation) SetTargetId(value *int32)() { + m.target_id = value +} +// SetTargetType sets the target_type property value. The target_type property +func (m *Installation) SetTargetType(value *string)() { + m.target_type = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Installation) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type Installationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessTokensUrl()(*string) + GetAccount()(Installation_Installation_accountable) + GetAppId()(*int32) + GetAppSlug()(*string) + GetContactEmail()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEvents()([]string) + GetHasMultipleSingleFiles()(*bool) + GetHtmlUrl()(*string) + GetId()(*int32) + GetPermissions()(AppPermissionsable) + GetRepositoriesUrl()(*string) + GetRepositorySelection()(*Installation_repository_selection) + GetSingleFileName()(*string) + GetSingleFilePaths()([]string) + GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetSuspendedBy()(NullableSimpleUserable) + GetTargetId()(*int32) + GetTargetType()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetAccessTokensUrl(value *string)() + SetAccount(value Installation_Installation_accountable)() + SetAppId(value *int32)() + SetAppSlug(value *string)() + SetContactEmail(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEvents(value []string)() + SetHasMultipleSingleFiles(value *bool)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetPermissions(value AppPermissionsable)() + SetRepositoriesUrl(value *string)() + SetRepositorySelection(value *Installation_repository_selection)() + SetSingleFileName(value *string)() + SetSingleFilePaths(value []string)() + SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetSuspendedBy(value NullableSimpleUserable)() + SetTargetId(value *int32)() + SetTargetType(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/installation_escaped_repository_escaped_selection.go b/pkg/github/models/installation_escaped_repository_escaped_selection.go new file mode 100644 index 00000000..7fe82de7 --- /dev/null +++ b/pkg/github/models/installation_escaped_repository_escaped_selection.go @@ -0,0 +1,34 @@ +package models +// Describe whether all repositories have been selected or there's a selection involved +type Installation_repository_selection int + +const ( + ALL_INSTALLATION_REPOSITORY_SELECTION Installation_repository_selection = iota + SELECTED_INSTALLATION_REPOSITORY_SELECTION +) + +func (i Installation_repository_selection) String() string { + return []string{"all", "selected"}[i] +} +func ParseInstallation_repository_selection(v string) (any, error) { + result := ALL_INSTALLATION_REPOSITORY_SELECTION + switch v { + case "all": + result = ALL_INSTALLATION_REPOSITORY_SELECTION + case "selected": + result = SELECTED_INSTALLATION_REPOSITORY_SELECTION + default: + return nil, nil + } + return &result, nil +} +func SerializeInstallation_repository_selection(values []Installation_repository_selection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Installation_repository_selection) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/installation_token.go b/pkg/github/models/installation_token.go new file mode 100644 index 00000000..e84bbad6 --- /dev/null +++ b/pkg/github/models/installation_token.go @@ -0,0 +1,303 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// InstallationToken authentication token for a GitHub App installed on a user or org. +type InstallationToken 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 expires_at property + expires_at *string + // The has_multiple_single_files property + has_multiple_single_files *bool + // The permissions granted to the user access token. + permissions AppPermissionsable + // The repositories property + repositories []Repositoryable + // The repository_selection property + repository_selection *InstallationToken_repository_selection + // The single_file property + single_file *string + // The single_file_paths property + single_file_paths []string + // The token property + token *string +} +// NewInstallationToken instantiates a new InstallationToken and sets the default values. +func NewInstallationToken()(*InstallationToken) { + m := &InstallationToken{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateInstallationTokenFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInstallationTokenFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInstallationToken(), 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 *InstallationToken) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExpiresAt gets the expires_at property value. The expires_at property +// returns a *string when successful +func (m *InstallationToken) GetExpiresAt()(*string) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *InstallationToken) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["has_multiple_single_files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasMultipleSingleFiles(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAppPermissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(AppPermissionsable)) + } + return nil + } + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Repositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Repositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseInstallationToken_repository_selection) + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val.(*InstallationToken_repository_selection)) + } + return nil + } + res["single_file"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSingleFile(val) + } + return nil + } + res["single_file_paths"] = 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.SetSingleFilePaths(res) + } + return nil + } + res["token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetToken(val) + } + return nil + } + return res +} +// GetHasMultipleSingleFiles gets the has_multiple_single_files property value. The has_multiple_single_files property +// returns a *bool when successful +func (m *InstallationToken) GetHasMultipleSingleFiles()(*bool) { + return m.has_multiple_single_files +} +// GetPermissions gets the permissions property value. The permissions granted to the user access token. +// returns a AppPermissionsable when successful +func (m *InstallationToken) GetPermissions()(AppPermissionsable) { + return m.permissions +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []Repositoryable when successful +func (m *InstallationToken) GetRepositories()([]Repositoryable) { + return m.repositories +} +// GetRepositorySelection gets the repository_selection property value. The repository_selection property +// returns a *InstallationToken_repository_selection when successful +func (m *InstallationToken) GetRepositorySelection()(*InstallationToken_repository_selection) { + return m.repository_selection +} +// GetSingleFile gets the single_file property value. The single_file property +// returns a *string when successful +func (m *InstallationToken) GetSingleFile()(*string) { + return m.single_file +} +// GetSingleFilePaths gets the single_file_paths property value. The single_file_paths property +// returns a []string when successful +func (m *InstallationToken) GetSingleFilePaths()([]string) { + return m.single_file_paths +} +// GetToken gets the token property value. The token property +// returns a *string when successful +func (m *InstallationToken) GetToken()(*string) { + return m.token +} +// Serialize serializes information the current object +func (m *InstallationToken) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_multiple_single_files", m.GetHasMultipleSingleFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + if m.GetRepositorySelection() != nil { + cast := (*m.GetRepositorySelection()).String() + err := writer.WriteStringValue("repository_selection", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("single_file", m.GetSingleFile()) + if err != nil { + return err + } + } + if m.GetSingleFilePaths() != nil { + err := writer.WriteCollectionOfStringValues("single_file_paths", m.GetSingleFilePaths()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token", m.GetToken()) + 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 *InstallationToken) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExpiresAt sets the expires_at property value. The expires_at property +func (m *InstallationToken) SetExpiresAt(value *string)() { + m.expires_at = value +} +// SetHasMultipleSingleFiles sets the has_multiple_single_files property value. The has_multiple_single_files property +func (m *InstallationToken) SetHasMultipleSingleFiles(value *bool)() { + m.has_multiple_single_files = value +} +// SetPermissions sets the permissions property value. The permissions granted to the user access token. +func (m *InstallationToken) SetPermissions(value AppPermissionsable)() { + m.permissions = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *InstallationToken) SetRepositories(value []Repositoryable)() { + m.repositories = value +} +// SetRepositorySelection sets the repository_selection property value. The repository_selection property +func (m *InstallationToken) SetRepositorySelection(value *InstallationToken_repository_selection)() { + m.repository_selection = value +} +// SetSingleFile sets the single_file property value. The single_file property +func (m *InstallationToken) SetSingleFile(value *string)() { + m.single_file = value +} +// SetSingleFilePaths sets the single_file_paths property value. The single_file_paths property +func (m *InstallationToken) SetSingleFilePaths(value []string)() { + m.single_file_paths = value +} +// SetToken sets the token property value. The token property +func (m *InstallationToken) SetToken(value *string)() { + m.token = value +} +type InstallationTokenable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExpiresAt()(*string) + GetHasMultipleSingleFiles()(*bool) + GetPermissions()(AppPermissionsable) + GetRepositories()([]Repositoryable) + GetRepositorySelection()(*InstallationToken_repository_selection) + GetSingleFile()(*string) + GetSingleFilePaths()([]string) + GetToken()(*string) + SetExpiresAt(value *string)() + SetHasMultipleSingleFiles(value *bool)() + SetPermissions(value AppPermissionsable)() + SetRepositories(value []Repositoryable)() + SetRepositorySelection(value *InstallationToken_repository_selection)() + SetSingleFile(value *string)() + SetSingleFilePaths(value []string)() + SetToken(value *string)() +} diff --git a/pkg/github/models/installation_token_escaped_repository_escaped_selection.go b/pkg/github/models/installation_token_escaped_repository_escaped_selection.go new file mode 100644 index 00000000..49cfe54e --- /dev/null +++ b/pkg/github/models/installation_token_escaped_repository_escaped_selection.go @@ -0,0 +1,33 @@ +package models +type InstallationToken_repository_selection int + +const ( + ALL_INSTALLATIONTOKEN_REPOSITORY_SELECTION InstallationToken_repository_selection = iota + SELECTED_INSTALLATIONTOKEN_REPOSITORY_SELECTION +) + +func (i InstallationToken_repository_selection) String() string { + return []string{"all", "selected"}[i] +} +func ParseInstallationToken_repository_selection(v string) (any, error) { + result := ALL_INSTALLATIONTOKEN_REPOSITORY_SELECTION + switch v { + case "all": + result = ALL_INSTALLATIONTOKEN_REPOSITORY_SELECTION + case "selected": + result = SELECTED_INSTALLATIONTOKEN_REPOSITORY_SELECTION + default: + return nil, nil + } + return &result, nil +} +func SerializeInstallationToken_repository_selection(values []InstallationToken_repository_selection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i InstallationToken_repository_selection) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/instances503_error.go b/pkg/github/models/instances503_error.go new file mode 100644 index 00000000..6361ee82 --- /dev/null +++ b/pkg/github/models/instances503_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 Instances503Error 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 +} +// NewInstances503Error instantiates a new Instances503Error and sets the default values. +func NewInstances503Error()(*Instances503Error) { + m := &Instances503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateInstances503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInstances503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInstances503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Instances503Error) 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 *Instances503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Instances503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Instances503Error) 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 *Instances503Error) 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 *Instances503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Instances503Error) 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 *Instances503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Instances503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Instances503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Instances503Error) SetMessage(value *string)() { + m.message = value +} +type Instances503Errorable 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/integration.go b/pkg/github/models/integration.go new file mode 100644 index 00000000..6eb8c956 --- /dev/null +++ b/pkg/github/models/integration.go @@ -0,0 +1,523 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Integration gitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +type Integration 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 client_secret property + client_secret *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + description *string + // The list of events for the GitHub app + events []string + // The external_url property + external_url *string + // The html_url property + html_url *string + // Unique identifier of the GitHub app + id *int32 + // The number of installations associated with the GitHub app + installations_count *int32 + // The name of the GitHub app + name *string + // The node_id property + node_id *string + // A GitHub user. + owner NullableSimpleUserable + // The pem property + pem *string + // The set of permissions for the GitHub app + permissions Integration_permissionsable + // The slug name of the GitHub app + slug *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The webhook_secret property + webhook_secret *string +} +// NewIntegration instantiates a new Integration and sets the default values. +func NewIntegration()(*Integration) { + m := &Integration{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIntegrationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIntegrationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIntegration(), 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 *Integration) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientSecret gets the client_secret property value. The client_secret property +// returns a *string when successful +func (m *Integration) GetClientSecret()(*string) { + return m.client_secret +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Integration) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *Integration) GetDescription()(*string) { + return m.description +} +// GetEvents gets the events property value. The list of events for the GitHub app +// returns a []string when successful +func (m *Integration) GetEvents()([]string) { + return m.events +} +// GetExternalUrl gets the external_url property value. The external_url property +// returns a *string when successful +func (m *Integration) GetExternalUrl()(*string) { + return m.external_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Integration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientSecret(val) + } + return nil + } + 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["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["events"] = 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.SetEvents(res) + } + return nil + } + res["external_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExternalUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["installations_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInstallationsCount(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableSimpleUserable)) + } + return nil + } + res["pem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPem(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIntegration_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(Integration_permissionsable)) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + 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["webhook_secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWebhookSecret(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Integration) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the GitHub app +// returns a *int32 when successful +func (m *Integration) GetId()(*int32) { + return m.id +} +// GetInstallationsCount gets the installations_count property value. The number of installations associated with the GitHub app +// returns a *int32 when successful +func (m *Integration) GetInstallationsCount()(*int32) { + return m.installations_count +} +// GetName gets the name property value. The name of the GitHub app +// returns a *string when successful +func (m *Integration) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Integration) GetNodeId()(*string) { + return m.node_id +} +// GetOwner gets the owner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Integration) GetOwner()(NullableSimpleUserable) { + return m.owner +} +// GetPem gets the pem property value. The pem property +// returns a *string when successful +func (m *Integration) GetPem()(*string) { + return m.pem +} +// GetPermissions gets the permissions property value. The set of permissions for the GitHub app +// returns a Integration_permissionsable when successful +func (m *Integration) GetPermissions()(Integration_permissionsable) { + return m.permissions +} +// GetSlug gets the slug property value. The slug name of the GitHub app +// returns a *string when successful +func (m *Integration) GetSlug()(*string) { + return m.slug +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Integration) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetWebhookSecret gets the webhook_secret property value. The webhook_secret property +// returns a *string when successful +func (m *Integration) GetWebhookSecret()(*string) { + return m.webhook_secret +} +// Serialize serializes information the current object +func (m *Integration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_secret", m.GetClientSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("external_url", m.GetExternalUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("installations_count", m.GetInstallationsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pem", m.GetPem()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("webhook_secret", m.GetWebhookSecret()) + 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 *Integration) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientSecret sets the client_secret property value. The client_secret property +func (m *Integration) SetClientSecret(value *string)() { + m.client_secret = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Integration) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *Integration) SetDescription(value *string)() { + m.description = value +} +// SetEvents sets the events property value. The list of events for the GitHub app +func (m *Integration) SetEvents(value []string)() { + m.events = value +} +// SetExternalUrl sets the external_url property value. The external_url property +func (m *Integration) SetExternalUrl(value *string)() { + m.external_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Integration) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the GitHub app +func (m *Integration) SetId(value *int32)() { + m.id = value +} +// SetInstallationsCount sets the installations_count property value. The number of installations associated with the GitHub app +func (m *Integration) SetInstallationsCount(value *int32)() { + m.installations_count = value +} +// SetName sets the name property value. The name of the GitHub app +func (m *Integration) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Integration) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *Integration) SetOwner(value NullableSimpleUserable)() { + m.owner = value +} +// SetPem sets the pem property value. The pem property +func (m *Integration) SetPem(value *string)() { + m.pem = value +} +// SetPermissions sets the permissions property value. The set of permissions for the GitHub app +func (m *Integration) SetPermissions(value Integration_permissionsable)() { + m.permissions = value +} +// SetSlug sets the slug property value. The slug name of the GitHub app +func (m *Integration) SetSlug(value *string)() { + m.slug = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Integration) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetWebhookSecret sets the webhook_secret property value. The webhook_secret property +func (m *Integration) SetWebhookSecret(value *string)() { + m.webhook_secret = value +} +type Integrationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientSecret()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetEvents()([]string) + GetExternalUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetInstallationsCount()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetOwner()(NullableSimpleUserable) + GetPem()(*string) + GetPermissions()(Integration_permissionsable) + GetSlug()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetWebhookSecret()(*string) + SetClientSecret(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetEvents(value []string)() + SetExternalUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetInstallationsCount(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetOwner(value NullableSimpleUserable)() + SetPem(value *string)() + SetPermissions(value Integration_permissionsable)() + SetSlug(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetWebhookSecret(value *string)() +} diff --git a/pkg/github/models/integration_escaped_permissions.go b/pkg/github/models/integration_escaped_permissions.go new file mode 100644 index 00000000..b147bc90 --- /dev/null +++ b/pkg/github/models/integration_escaped_permissions.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Integration_permissions the set of permissions for the GitHub app +type Integration_permissions 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 checks property + checks *string + // The contents property + contents *string + // The deployments property + deployments *string + // The issues property + issues *string + // The metadata property + metadata *string +} +// NewIntegration_permissions instantiates a new Integration_permissions and sets the default values. +func NewIntegration_permissions()(*Integration_permissions) { + m := &Integration_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIntegration_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIntegration_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIntegration_permissions(), 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 *Integration_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChecks gets the checks property value. The checks property +// returns a *string when successful +func (m *Integration_permissions) GetChecks()(*string) { + return m.checks +} +// GetContents gets the contents property value. The contents property +// returns a *string when successful +func (m *Integration_permissions) GetContents()(*string) { + return m.contents +} +// GetDeployments gets the deployments property value. The deployments property +// returns a *string when successful +func (m *Integration_permissions) GetDeployments()(*string) { + return m.deployments +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Integration_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetChecks(val) + } + return nil + } + res["contents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContents(val) + } + return nil + } + res["deployments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeployments(val) + } + return nil + } + res["issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssues(val) + } + return nil + } + res["metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMetadata(val) + } + return nil + } + return res +} +// GetIssues gets the issues property value. The issues property +// returns a *string when successful +func (m *Integration_permissions) GetIssues()(*string) { + return m.issues +} +// GetMetadata gets the metadata property value. The metadata property +// returns a *string when successful +func (m *Integration_permissions) GetMetadata()(*string) { + return m.metadata +} +// Serialize serializes information the current object +func (m *Integration_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("checks", m.GetChecks()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents", m.GetContents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments", m.GetDeployments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues", m.GetIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("metadata", m.GetMetadata()) + 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 *Integration_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChecks sets the checks property value. The checks property +func (m *Integration_permissions) SetChecks(value *string)() { + m.checks = value +} +// SetContents sets the contents property value. The contents property +func (m *Integration_permissions) SetContents(value *string)() { + m.contents = value +} +// SetDeployments sets the deployments property value. The deployments property +func (m *Integration_permissions) SetDeployments(value *string)() { + m.deployments = value +} +// SetIssues sets the issues property value. The issues property +func (m *Integration_permissions) SetIssues(value *string)() { + m.issues = value +} +// SetMetadata sets the metadata property value. The metadata property +func (m *Integration_permissions) SetMetadata(value *string)() { + m.metadata = value +} +type Integration_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChecks()(*string) + GetContents()(*string) + GetDeployments()(*string) + GetIssues()(*string) + GetMetadata()(*string) + SetChecks(value *string)() + SetContents(value *string)() + SetDeployments(value *string)() + SetIssues(value *string)() + SetMetadata(value *string)() +} diff --git a/pkg/github/models/integration_installation_request.go b/pkg/github/models/integration_installation_request.go new file mode 100644 index 00000000..c524829d --- /dev/null +++ b/pkg/github/models/integration_installation_request.go @@ -0,0 +1,284 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IntegrationInstallationRequest request to install an integration on a target +type IntegrationInstallationRequest struct { + // The account property + account IntegrationInstallationRequest_IntegrationInstallationRequest_accountable + // 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 + // Unique identifier of the request installation. + id *int32 + // The node_id property + node_id *string + // A GitHub user. + requester SimpleUserable +} +// IntegrationInstallationRequest_IntegrationInstallationRequest_account composed type wrapper for classes Enterpriseable, SimpleUserable +type IntegrationInstallationRequest_IntegrationInstallationRequest_account struct { + // Composed type representation for type Enterpriseable + enterprise Enterpriseable + // Composed type representation for type SimpleUserable + simpleUser SimpleUserable +} +// NewIntegrationInstallationRequest_IntegrationInstallationRequest_account instantiates a new IntegrationInstallationRequest_IntegrationInstallationRequest_account and sets the default values. +func NewIntegrationInstallationRequest_IntegrationInstallationRequest_account()(*IntegrationInstallationRequest_IntegrationInstallationRequest_account) { + m := &IntegrationInstallationRequest_IntegrationInstallationRequest_account{ + } + return m +} +// CreateIntegrationInstallationRequest_IntegrationInstallationRequest_accountFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIntegrationInstallationRequest_IntegrationInstallationRequest_accountFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewIntegrationInstallationRequest_IntegrationInstallationRequest_account() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateEnterpriseFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(Enterpriseable); ok { + result.SetEnterprise(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateSimpleUserFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(SimpleUserable); ok { + result.SetSimpleUser(cast) + } + } + } + return result, nil +} +// GetEnterprise gets the enterprise property value. Composed type representation for type Enterpriseable +// returns a Enterpriseable when successful +func (m *IntegrationInstallationRequest_IntegrationInstallationRequest_account) GetEnterprise()(Enterpriseable) { + return m.enterprise +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IntegrationInstallationRequest_IntegrationInstallationRequest_account) 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 *IntegrationInstallationRequest_IntegrationInstallationRequest_account) GetIsComposedType()(bool) { + return true +} +// GetSimpleUser gets the simpleUser property value. Composed type representation for type SimpleUserable +// returns a SimpleUserable when successful +func (m *IntegrationInstallationRequest_IntegrationInstallationRequest_account) GetSimpleUser()(SimpleUserable) { + return m.simpleUser +} +// Serialize serializes information the current object +func (m *IntegrationInstallationRequest_IntegrationInstallationRequest_account) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEnterprise() != nil { + err := writer.WriteObjectValue("", m.GetEnterprise()) + if err != nil { + return err + } + } else if m.GetSimpleUser() != nil { + err := writer.WriteObjectValue("", m.GetSimpleUser()) + if err != nil { + return err + } + } + return nil +} +// SetEnterprise sets the enterprise property value. Composed type representation for type Enterpriseable +func (m *IntegrationInstallationRequest_IntegrationInstallationRequest_account) SetEnterprise(value Enterpriseable)() { + m.enterprise = value +} +// SetSimpleUser sets the simpleUser property value. Composed type representation for type SimpleUserable +func (m *IntegrationInstallationRequest_IntegrationInstallationRequest_account) SetSimpleUser(value SimpleUserable)() { + m.simpleUser = value +} +type IntegrationInstallationRequest_IntegrationInstallationRequest_accountable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnterprise()(Enterpriseable) + GetSimpleUser()(SimpleUserable) + SetEnterprise(value Enterpriseable)() + SetSimpleUser(value SimpleUserable)() +} +// NewIntegrationInstallationRequest instantiates a new IntegrationInstallationRequest and sets the default values. +func NewIntegrationInstallationRequest()(*IntegrationInstallationRequest) { + m := &IntegrationInstallationRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIntegrationInstallationRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIntegrationInstallationRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIntegrationInstallationRequest(), nil +} +// GetAccount gets the account property value. The account property +// returns a IntegrationInstallationRequest_IntegrationInstallationRequest_accountable when successful +func (m *IntegrationInstallationRequest) GetAccount()(IntegrationInstallationRequest_IntegrationInstallationRequest_accountable) { + return m.account +} +// 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 *IntegrationInstallationRequest) 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 *IntegrationInstallationRequest) 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 *IntegrationInstallationRequest) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["account"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIntegrationInstallationRequest_IntegrationInstallationRequest_accountFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAccount(val.(IntegrationInstallationRequest_IntegrationInstallationRequest_accountable)) + } + return nil + } + 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["requester"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequester(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the request installation. +// returns a *int32 when successful +func (m *IntegrationInstallationRequest) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *IntegrationInstallationRequest) GetNodeId()(*string) { + return m.node_id +} +// GetRequester gets the requester property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *IntegrationInstallationRequest) GetRequester()(SimpleUserable) { + return m.requester +} +// Serialize serializes information the current object +func (m *IntegrationInstallationRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("account", m.GetAccount()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("requester", m.GetRequester()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccount sets the account property value. The account property +func (m *IntegrationInstallationRequest) SetAccount(value IntegrationInstallationRequest_IntegrationInstallationRequest_accountable)() { + m.account = 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 *IntegrationInstallationRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *IntegrationInstallationRequest) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. Unique identifier of the request installation. +func (m *IntegrationInstallationRequest) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *IntegrationInstallationRequest) SetNodeId(value *string)() { + m.node_id = value +} +// SetRequester sets the requester property value. A GitHub user. +func (m *IntegrationInstallationRequest) SetRequester(value SimpleUserable)() { + m.requester = value +} +type IntegrationInstallationRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccount()(IntegrationInstallationRequest_IntegrationInstallationRequest_accountable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetNodeId()(*string) + GetRequester()(SimpleUserable) + SetAccount(value IntegrationInstallationRequest_IntegrationInstallationRequest_accountable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetNodeId(value *string)() + SetRequester(value SimpleUserable)() +} diff --git a/pkg/github/models/issue.go b/pkg/github/models/issue.go new file mode 100644 index 00000000..465c7bb2 --- /dev/null +++ b/pkg/github/models/issue.go @@ -0,0 +1,1059 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Issue issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +type Issue struct { + // The active_lock_reason property + active_lock_reason *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee NullableSimpleUserable + // The assignees property + assignees []SimpleUserable + // How the author is associated with the repository. + author_association *AuthorAssociation + // Contents of the issue + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The closed_at property + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + closed_by NullableSimpleUserable + // The comments property + comments *int32 + // The comments_url property + comments_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The draft property + draft *bool + // The events_url property + events_url *string + // The html_url property + html_url *string + // The id property + id *int64 + // Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository + labels []string + // The labels_url property + labels_url *string + // The locked property + locked *bool + // A collection of related issues and pull requests. + milestone NullableMilestoneable + // The node_id property + node_id *string + // Number uniquely identifying the issue within its repository + number *int32 + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The pull_request property + pull_request Issue_pull_requestable + // The reactions property + reactions ReactionRollupable + // A repository on GitHub. + repository Repositoryable + // The repository_url property + repository_url *string + // State of the issue; either 'open' or 'closed' + state *string + // The reason for the current state + state_reason *Issue_state_reason + // The timeline_url property + timeline_url *string + // Title of the issue + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // URL for the issue + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewIssue instantiates a new Issue and sets the default values. +func NewIssue()(*Issue) { + m := &Issue{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssue(), nil +} +// GetActiveLockReason gets the active_lock_reason property value. The active_lock_reason property +// returns a *string when successful +func (m *Issue) GetActiveLockReason()(*string) { + return m.active_lock_reason +} +// 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 *Issue) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Issue) GetAssignee()(NullableSimpleUserable) { + return m.assignee +} +// GetAssignees gets the assignees property value. The assignees property +// returns a []SimpleUserable when successful +func (m *Issue) GetAssignees()([]SimpleUserable) { + return m.assignees +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *Issue) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. Contents of the issue +// returns a *string when successful +func (m *Issue) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *Issue) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *Issue) GetBodyText()(*string) { + return m.body_text +} +// GetClosedAt gets the closed_at property value. The closed_at property +// returns a *Time when successful +func (m *Issue) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetClosedBy gets the closed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Issue) GetClosedBy()(NullableSimpleUserable) { + return m.closed_by +} +// GetComments gets the comments property value. The comments property +// returns a *int32 when successful +func (m *Issue) GetComments()(*int32) { + return m.comments +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *Issue) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Issue) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDraft gets the draft property value. The draft property +// returns a *bool when successful +func (m *Issue) GetDraft()(*bool) { + return m.draft +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *Issue) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Issue) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active_lock_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActiveLockReason(val) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(NullableSimpleUserable)) + } + return nil + } + res["assignees"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetAssignees(res) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["closed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetClosedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetComments(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + 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["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["labels"] = 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.SetLabels(res) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["locked"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLocked(val) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMilestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(NullableMilestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssue_pull_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(Issue_pull_requestable)) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(Repositoryable)) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["state_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseIssue_state_reason) + if err != nil { + return err + } + if val != nil { + m.SetStateReason(val.(*Issue_state_reason)) + } + return nil + } + res["timeline_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTimelineUrl(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Issue) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *Issue) GetId()(*int64) { + return m.id +} +// GetLabels gets the labels property value. Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository +// returns a []string when successful +func (m *Issue) GetLabels()([]string) { + return m.labels +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *Issue) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLocked gets the locked property value. The locked property +// returns a *bool when successful +func (m *Issue) GetLocked()(*bool) { + return m.locked +} +// GetMilestone gets the milestone property value. A collection of related issues and pull requests. +// returns a NullableMilestoneable when successful +func (m *Issue) GetMilestone()(NullableMilestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Issue) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. Number uniquely identifying the issue within its repository +// returns a *int32 when successful +func (m *Issue) GetNumber()(*int32) { + return m.number +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *Issue) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetPullRequest gets the pull_request property value. The pull_request property +// returns a Issue_pull_requestable when successful +func (m *Issue) GetPullRequest()(Issue_pull_requestable) { + return m.pull_request +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *Issue) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetRepository gets the repository property value. A repository on GitHub. +// returns a Repositoryable when successful +func (m *Issue) GetRepository()(Repositoryable) { + return m.repository +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *Issue) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetState gets the state property value. State of the issue; either 'open' or 'closed' +// returns a *string when successful +func (m *Issue) GetState()(*string) { + return m.state +} +// GetStateReason gets the state_reason property value. The reason for the current state +// returns a *Issue_state_reason when successful +func (m *Issue) GetStateReason()(*Issue_state_reason) { + return m.state_reason +} +// GetTimelineUrl gets the timeline_url property value. The timeline_url property +// returns a *string when successful +func (m *Issue) GetTimelineUrl()(*string) { + return m.timeline_url +} +// GetTitle gets the title property value. Title of the issue +// returns a *string when successful +func (m *Issue) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Issue) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. URL for the issue +// returns a *string when successful +func (m *Issue) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Issue) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *Issue) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("active_lock_reason", m.GetActiveLockReason()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + if m.GetAssignees() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssignees())) + for i, v := range m.GetAssignees() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("assignees", cast) + if err != nil { + return err + } + } + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("closed_at", m.GetClosedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("closed_by", m.GetClosedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("locked", m.GetLocked()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + if m.GetStateReason() != nil { + cast := (*m.GetStateReason()).String() + err := writer.WriteStringValue("state_reason", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("timeline_url", m.GetTimelineUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveLockReason sets the active_lock_reason property value. The active_lock_reason property +func (m *Issue) SetActiveLockReason(value *string)() { + m.active_lock_reason = 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 *Issue) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *Issue) SetAssignee(value NullableSimpleUserable)() { + m.assignee = value +} +// SetAssignees sets the assignees property value. The assignees property +func (m *Issue) SetAssignees(value []SimpleUserable)() { + m.assignees = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *Issue) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. Contents of the issue +func (m *Issue) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *Issue) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *Issue) SetBodyText(value *string)() { + m.body_text = value +} +// SetClosedAt sets the closed_at property value. The closed_at property +func (m *Issue) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetClosedBy sets the closed_by property value. A GitHub user. +func (m *Issue) SetClosedBy(value NullableSimpleUserable)() { + m.closed_by = value +} +// SetComments sets the comments property value. The comments property +func (m *Issue) SetComments(value *int32)() { + m.comments = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *Issue) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Issue) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDraft sets the draft property value. The draft property +func (m *Issue) SetDraft(value *bool)() { + m.draft = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *Issue) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Issue) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Issue) SetId(value *int64)() { + m.id = value +} +// SetLabels sets the labels property value. Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository +func (m *Issue) SetLabels(value []string)() { + m.labels = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *Issue) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLocked sets the locked property value. The locked property +func (m *Issue) SetLocked(value *bool)() { + m.locked = value +} +// SetMilestone sets the milestone property value. A collection of related issues and pull requests. +func (m *Issue) SetMilestone(value NullableMilestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Issue) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. Number uniquely identifying the issue within its repository +func (m *Issue) SetNumber(value *int32)() { + m.number = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *Issue) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetPullRequest sets the pull_request property value. The pull_request property +func (m *Issue) SetPullRequest(value Issue_pull_requestable)() { + m.pull_request = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *Issue) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetRepository sets the repository property value. A repository on GitHub. +func (m *Issue) SetRepository(value Repositoryable)() { + m.repository = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *Issue) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetState sets the state property value. State of the issue; either 'open' or 'closed' +func (m *Issue) SetState(value *string)() { + m.state = value +} +// SetStateReason sets the state_reason property value. The reason for the current state +func (m *Issue) SetStateReason(value *Issue_state_reason)() { + m.state_reason = value +} +// SetTimelineUrl sets the timeline_url property value. The timeline_url property +func (m *Issue) SetTimelineUrl(value *string)() { + m.timeline_url = value +} +// SetTitle sets the title property value. Title of the issue +func (m *Issue) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Issue) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. URL for the issue +func (m *Issue) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *Issue) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type Issueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveLockReason()(*string) + GetAssignee()(NullableSimpleUserable) + GetAssignees()([]SimpleUserable) + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetClosedBy()(NullableSimpleUserable) + GetComments()(*int32) + GetCommentsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDraft()(*bool) + GetEventsUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLabels()([]string) + GetLabelsUrl()(*string) + GetLocked()(*bool) + GetMilestone()(NullableMilestoneable) + GetNodeId()(*string) + GetNumber()(*int32) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetPullRequest()(Issue_pull_requestable) + GetReactions()(ReactionRollupable) + GetRepository()(Repositoryable) + GetRepositoryUrl()(*string) + GetState()(*string) + GetStateReason()(*Issue_state_reason) + GetTimelineUrl()(*string) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetActiveLockReason(value *string)() + SetAssignee(value NullableSimpleUserable)() + SetAssignees(value []SimpleUserable)() + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetClosedBy(value NullableSimpleUserable)() + SetComments(value *int32)() + SetCommentsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDraft(value *bool)() + SetEventsUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLabels(value []string)() + SetLabelsUrl(value *string)() + SetLocked(value *bool)() + SetMilestone(value NullableMilestoneable)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetPullRequest(value Issue_pull_requestable)() + SetReactions(value ReactionRollupable)() + SetRepository(value Repositoryable)() + SetRepositoryUrl(value *string)() + SetState(value *string)() + SetStateReason(value *Issue_state_reason)() + SetTimelineUrl(value *string)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/issue503_error.go b/pkg/github/models/issue503_error.go new file mode 100644 index 00000000..13e279b0 --- /dev/null +++ b/pkg/github/models/issue503_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 Issue503Error 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 +} +// NewIssue503Error instantiates a new Issue503Error and sets the default values. +func NewIssue503Error()(*Issue503Error) { + m := &Issue503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssue503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssue503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssue503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Issue503Error) 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 *Issue503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Issue503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Issue503Error) 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 *Issue503Error) 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 *Issue503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Issue503Error) 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 *Issue503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Issue503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Issue503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Issue503Error) SetMessage(value *string)() { + m.message = value +} +type Issue503Errorable 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/issue_comment.go b/pkg/github/models/issue_comment.go new file mode 100644 index 00000000..f462410b --- /dev/null +++ b/pkg/github/models/issue_comment.go @@ -0,0 +1,460 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueComment comments provide a way for people to collaborate on an issue. +type IssueComment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // Contents of the issue comment + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // Unique identifier of the issue comment + id *int64 + // The issue_url property + issue_url *string + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The reactions property + reactions ReactionRollupable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // URL for the issue comment + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewIssueComment instantiates a new IssueComment and sets the default values. +func NewIssueComment()(*IssueComment) { + m := &IssueComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueComment(), 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 *IssueComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *IssueComment) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. Contents of the issue comment +// returns a *string when successful +func (m *IssueComment) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *IssueComment) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *IssueComment) GetBodyText()(*string) { + return m.body_text +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *IssueComment) 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 *IssueComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + 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["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issue_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *IssueComment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the issue comment +// returns a *int64 when successful +func (m *IssueComment) GetId()(*int64) { + return m.id +} +// GetIssueUrl gets the issue_url property value. The issue_url property +// returns a *string when successful +func (m *IssueComment) GetIssueUrl()(*string) { + return m.issue_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *IssueComment) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *IssueComment) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *IssueComment) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *IssueComment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. URL for the issue comment +// returns a *string when successful +func (m *IssueComment) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueComment) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *IssueComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_url", m.GetIssueUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *IssueComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *IssueComment) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. Contents of the issue comment +func (m *IssueComment) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *IssueComment) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *IssueComment) SetBodyText(value *string)() { + m.body_text = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *IssueComment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *IssueComment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the issue comment +func (m *IssueComment) SetId(value *int64)() { + m.id = value +} +// SetIssueUrl sets the issue_url property value. The issue_url property +func (m *IssueComment) SetIssueUrl(value *string)() { + m.issue_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *IssueComment) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *IssueComment) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *IssueComment) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *IssueComment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. URL for the issue comment +func (m *IssueComment) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *IssueComment) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type IssueCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueUrl()(*string) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetReactions()(ReactionRollupable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueUrl(value *string)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetReactions(value ReactionRollupable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/issue_escaped_pull_escaped_request.go b/pkg/github/models/issue_escaped_pull_escaped_request.go new file mode 100644 index 00000000..d34957e2 --- /dev/null +++ b/pkg/github/models/issue_escaped_pull_escaped_request.go @@ -0,0 +1,197 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Issue_pull_request 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 diff_url property + diff_url *string + // The html_url property + html_url *string + // The merged_at property + merged_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The patch_url property + patch_url *string + // The url property + url *string +} +// NewIssue_pull_request instantiates a new Issue_pull_request and sets the default values. +func NewIssue_pull_request()(*Issue_pull_request) { + m := &Issue_pull_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssue_pull_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssue_pull_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssue_pull_request(), 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 *Issue_pull_request) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDiffUrl gets the diff_url property value. The diff_url property +// returns a *string when successful +func (m *Issue_pull_request) GetDiffUrl()(*string) { + return m.diff_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Issue_pull_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["diff_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["merged_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetMergedAt(val) + } + return nil + } + res["patch_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Issue_pull_request) GetHtmlUrl()(*string) { + return m.html_url +} +// GetMergedAt gets the merged_at property value. The merged_at property +// returns a *Time when successful +func (m *Issue_pull_request) GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.merged_at +} +// GetPatchUrl gets the patch_url property value. The patch_url property +// returns a *string when successful +func (m *Issue_pull_request) GetPatchUrl()(*string) { + return m.patch_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Issue_pull_request) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Issue_pull_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("diff_url", m.GetDiffUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("merged_at", m.GetMergedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patch_url", m.GetPatchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Issue_pull_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDiffUrl sets the diff_url property value. The diff_url property +func (m *Issue_pull_request) SetDiffUrl(value *string)() { + m.diff_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Issue_pull_request) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetMergedAt sets the merged_at property value. The merged_at property +func (m *Issue_pull_request) SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.merged_at = value +} +// SetPatchUrl sets the patch_url property value. The patch_url property +func (m *Issue_pull_request) SetPatchUrl(value *string)() { + m.patch_url = value +} +// SetUrl sets the url property value. The url property +func (m *Issue_pull_request) SetUrl(value *string)() { + m.url = value +} +type Issue_pull_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDiffUrl()(*string) + GetHtmlUrl()(*string) + GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPatchUrl()(*string) + GetUrl()(*string) + SetDiffUrl(value *string)() + SetHtmlUrl(value *string)() + SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPatchUrl(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/issue_escaped_state_escaped_reason.go b/pkg/github/models/issue_escaped_state_escaped_reason.go new file mode 100644 index 00000000..5a18af7a --- /dev/null +++ b/pkg/github/models/issue_escaped_state_escaped_reason.go @@ -0,0 +1,37 @@ +package models +// The reason for the current state +type Issue_state_reason int + +const ( + COMPLETED_ISSUE_STATE_REASON Issue_state_reason = iota + REOPENED_ISSUE_STATE_REASON + NOT_PLANNED_ISSUE_STATE_REASON +) + +func (i Issue_state_reason) String() string { + return []string{"completed", "reopened", "not_planned"}[i] +} +func ParseIssue_state_reason(v string) (any, error) { + result := COMPLETED_ISSUE_STATE_REASON + switch v { + case "completed": + result = COMPLETED_ISSUE_STATE_REASON + case "reopened": + result = REOPENED_ISSUE_STATE_REASON + case "not_planned": + result = NOT_PLANNED_ISSUE_STATE_REASON + default: + return nil, nil + } + return &result, nil +} +func SerializeIssue_state_reason(values []Issue_state_reason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Issue_state_reason) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/issue_event.go b/pkg/github/models/issue_event.go new file mode 100644 index 00000000..43fcef63 --- /dev/null +++ b/pkg/github/models/issue_event.go @@ -0,0 +1,692 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueEvent issue Event +type IssueEvent struct { + // A GitHub user. + actor NullableSimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee NullableSimpleUserable + // A GitHub user. + assigner NullableSimpleUserable + // How the author is associated with the repository. + author_association *AuthorAssociation + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The dismissed_review property + dismissed_review IssueEventDismissedReviewable + // The event property + event *string + // The id property + id *int64 + // Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. + issue NullableIssueable + // Issue Event Label + label IssueEventLabelable + // The lock_reason property + lock_reason *string + // Issue Event Milestone + milestone IssueEventMilestoneable + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // Issue Event Project Card + project_card IssueEventProjectCardable + // Issue Event Rename + rename IssueEventRenameable + // A GitHub user. + requested_reviewer NullableSimpleUserable + // Groups of organization members that gives permissions on specified repositories. + requested_team Teamable + // A GitHub user. + review_requester NullableSimpleUserable + // The url property + url *string +} +// NewIssueEvent instantiates a new IssueEvent and sets the default values. +func NewIssueEvent()(*IssueEvent) { + m := &IssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueEvent) GetActor()(NullableSimpleUserable) { + return m.actor +} +// 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 *IssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueEvent) GetAssignee()(NullableSimpleUserable) { + return m.assignee +} +// GetAssigner gets the assigner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueEvent) GetAssigner()(NullableSimpleUserable) { + return m.assigner +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *IssueEvent) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *IssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *IssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *IssueEvent) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDismissedReview gets the dismissed_review property value. The dismissed_review property +// returns a IssueEventDismissedReviewable when successful +func (m *IssueEvent) GetDismissedReview()(IssueEventDismissedReviewable) { + return m.dismissed_review +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *IssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(NullableSimpleUserable)) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(NullableSimpleUserable)) + } + return nil + } + res["assigner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssigner(val.(NullableSimpleUserable)) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + 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["dismissed_review"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueEventDismissedReviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReview(val.(IssueEventDismissedReviewable)) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issue"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIssueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIssue(val.(NullableIssueable)) + } + return nil + } + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueEventLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLabel(val.(IssueEventLabelable)) + } + return nil + } + res["lock_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLockReason(val) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueEventMilestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(IssueEventMilestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["project_card"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueEventProjectCardFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProjectCard(val.(IssueEventProjectCardable)) + } + return nil + } + res["rename"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueEventRenameFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRename(val.(IssueEventRenameable)) + } + return nil + } + res["requested_reviewer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequestedReviewer(val.(NullableSimpleUserable)) + } + return nil + } + res["requested_team"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequestedTeam(val.(Teamable)) + } + return nil + } + res["review_requester"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewRequester(val.(NullableSimpleUserable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *IssueEvent) GetId()(*int64) { + return m.id +} +// GetIssue gets the issue property value. Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +// returns a NullableIssueable when successful +func (m *IssueEvent) GetIssue()(NullableIssueable) { + return m.issue +} +// GetLabel gets the label property value. Issue Event Label +// returns a IssueEventLabelable when successful +func (m *IssueEvent) GetLabel()(IssueEventLabelable) { + return m.label +} +// GetLockReason gets the lock_reason property value. The lock_reason property +// returns a *string when successful +func (m *IssueEvent) GetLockReason()(*string) { + return m.lock_reason +} +// GetMilestone gets the milestone property value. Issue Event Milestone +// returns a IssueEventMilestoneable when successful +func (m *IssueEvent) GetMilestone()(IssueEventMilestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *IssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *IssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetProjectCard gets the project_card property value. Issue Event Project Card +// returns a IssueEventProjectCardable when successful +func (m *IssueEvent) GetProjectCard()(IssueEventProjectCardable) { + return m.project_card +} +// GetRename gets the rename property value. Issue Event Rename +// returns a IssueEventRenameable when successful +func (m *IssueEvent) GetRename()(IssueEventRenameable) { + return m.rename +} +// GetRequestedReviewer gets the requested_reviewer property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueEvent) GetRequestedReviewer()(NullableSimpleUserable) { + return m.requested_reviewer +} +// GetRequestedTeam gets the requested_team property value. Groups of organization members that gives permissions on specified repositories. +// returns a Teamable when successful +func (m *IssueEvent) GetRequestedTeam()(Teamable) { + return m.requested_team +} +// GetReviewRequester gets the review_requester property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueEvent) GetReviewRequester()(NullableSimpleUserable) { + return m.review_requester +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *IssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *IssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assigner", m.GetAssigner()) + if err != nil { + return err + } + } + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dismissed_review", m.GetDismissedReview()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("issue", m.GetIssue()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("lock_reason", m.GetLockReason()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("project_card", m.GetProjectCard()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("rename", m.GetRename()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("requested_reviewer", m.GetRequestedReviewer()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("requested_team", m.GetRequestedTeam()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("review_requester", m.GetReviewRequester()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *IssueEvent) SetActor(value NullableSimpleUserable)() { + m.actor = 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 *IssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *IssueEvent) SetAssignee(value NullableSimpleUserable)() { + m.assignee = value +} +// SetAssigner sets the assigner property value. A GitHub user. +func (m *IssueEvent) SetAssigner(value NullableSimpleUserable)() { + m.assigner = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *IssueEvent) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *IssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *IssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *IssueEvent) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDismissedReview sets the dismissed_review property value. The dismissed_review property +func (m *IssueEvent) SetDismissedReview(value IssueEventDismissedReviewable)() { + m.dismissed_review = value +} +// SetEvent sets the event property value. The event property +func (m *IssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *IssueEvent) SetId(value *int64)() { + m.id = value +} +// SetIssue sets the issue property value. Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +func (m *IssueEvent) SetIssue(value NullableIssueable)() { + m.issue = value +} +// SetLabel sets the label property value. Issue Event Label +func (m *IssueEvent) SetLabel(value IssueEventLabelable)() { + m.label = value +} +// SetLockReason sets the lock_reason property value. The lock_reason property +func (m *IssueEvent) SetLockReason(value *string)() { + m.lock_reason = value +} +// SetMilestone sets the milestone property value. Issue Event Milestone +func (m *IssueEvent) SetMilestone(value IssueEventMilestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *IssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *IssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetProjectCard sets the project_card property value. Issue Event Project Card +func (m *IssueEvent) SetProjectCard(value IssueEventProjectCardable)() { + m.project_card = value +} +// SetRename sets the rename property value. Issue Event Rename +func (m *IssueEvent) SetRename(value IssueEventRenameable)() { + m.rename = value +} +// SetRequestedReviewer sets the requested_reviewer property value. A GitHub user. +func (m *IssueEvent) SetRequestedReviewer(value NullableSimpleUserable)() { + m.requested_reviewer = value +} +// SetRequestedTeam sets the requested_team property value. Groups of organization members that gives permissions on specified repositories. +func (m *IssueEvent) SetRequestedTeam(value Teamable)() { + m.requested_team = value +} +// SetReviewRequester sets the review_requester property value. A GitHub user. +func (m *IssueEvent) SetReviewRequester(value NullableSimpleUserable)() { + m.review_requester = value +} +// SetUrl sets the url property value. The url property +func (m *IssueEvent) SetUrl(value *string)() { + m.url = value +} +type IssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(NullableSimpleUserable) + GetAssignee()(NullableSimpleUserable) + GetAssigner()(NullableSimpleUserable) + GetAuthorAssociation()(*AuthorAssociation) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDismissedReview()(IssueEventDismissedReviewable) + GetEvent()(*string) + GetId()(*int64) + GetIssue()(NullableIssueable) + GetLabel()(IssueEventLabelable) + GetLockReason()(*string) + GetMilestone()(IssueEventMilestoneable) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetProjectCard()(IssueEventProjectCardable) + GetRename()(IssueEventRenameable) + GetRequestedReviewer()(NullableSimpleUserable) + GetRequestedTeam()(Teamable) + GetReviewRequester()(NullableSimpleUserable) + GetUrl()(*string) + SetActor(value NullableSimpleUserable)() + SetAssignee(value NullableSimpleUserable)() + SetAssigner(value NullableSimpleUserable)() + SetAuthorAssociation(value *AuthorAssociation)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDismissedReview(value IssueEventDismissedReviewable)() + SetEvent(value *string)() + SetId(value *int64)() + SetIssue(value NullableIssueable)() + SetLabel(value IssueEventLabelable)() + SetLockReason(value *string)() + SetMilestone(value IssueEventMilestoneable)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetProjectCard(value IssueEventProjectCardable)() + SetRename(value IssueEventRenameable)() + SetRequestedReviewer(value NullableSimpleUserable)() + SetRequestedTeam(value Teamable)() + SetReviewRequester(value NullableSimpleUserable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/issue_event_dismissed_review.go b/pkg/github/models/issue_event_dismissed_review.go new file mode 100644 index 00000000..4e4a9e39 --- /dev/null +++ b/pkg/github/models/issue_event_dismissed_review.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type IssueEventDismissedReview 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 dismissal_commit_id property + dismissal_commit_id *string + // The dismissal_message property + dismissal_message *string + // The review_id property + review_id *int32 + // The state property + state *string +} +// NewIssueEventDismissedReview instantiates a new IssueEventDismissedReview and sets the default values. +func NewIssueEventDismissedReview()(*IssueEventDismissedReview) { + m := &IssueEventDismissedReview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueEventDismissedReviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueEventDismissedReviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueEventDismissedReview(), 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 *IssueEventDismissedReview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDismissalCommitId gets the dismissal_commit_id property value. The dismissal_commit_id property +// returns a *string when successful +func (m *IssueEventDismissedReview) GetDismissalCommitId()(*string) { + return m.dismissal_commit_id +} +// GetDismissalMessage gets the dismissal_message property value. The dismissal_message property +// returns a *string when successful +func (m *IssueEventDismissedReview) GetDismissalMessage()(*string) { + return m.dismissal_message +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueEventDismissedReview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["dismissal_commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissalCommitId(val) + } + return nil + } + res["dismissal_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissalMessage(val) + } + return nil + } + res["review_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetReviewId(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + return res +} +// GetReviewId gets the review_id property value. The review_id property +// returns a *int32 when successful +func (m *IssueEventDismissedReview) GetReviewId()(*int32) { + return m.review_id +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *IssueEventDismissedReview) GetState()(*string) { + return m.state +} +// Serialize serializes information the current object +func (m *IssueEventDismissedReview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("dismissal_commit_id", m.GetDismissalCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dismissal_message", m.GetDismissalMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("review_id", m.GetReviewId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + 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 *IssueEventDismissedReview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDismissalCommitId sets the dismissal_commit_id property value. The dismissal_commit_id property +func (m *IssueEventDismissedReview) SetDismissalCommitId(value *string)() { + m.dismissal_commit_id = value +} +// SetDismissalMessage sets the dismissal_message property value. The dismissal_message property +func (m *IssueEventDismissedReview) SetDismissalMessage(value *string)() { + m.dismissal_message = value +} +// SetReviewId sets the review_id property value. The review_id property +func (m *IssueEventDismissedReview) SetReviewId(value *int32)() { + m.review_id = value +} +// SetState sets the state property value. The state property +func (m *IssueEventDismissedReview) SetState(value *string)() { + m.state = value +} +type IssueEventDismissedReviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDismissalCommitId()(*string) + GetDismissalMessage()(*string) + GetReviewId()(*int32) + GetState()(*string) + SetDismissalCommitId(value *string)() + SetDismissalMessage(value *string)() + SetReviewId(value *int32)() + SetState(value *string)() +} diff --git a/pkg/github/models/issue_event_for_issue.go b/pkg/github/models/issue_event_for_issue.go new file mode 100644 index 00000000..498fd5c2 --- /dev/null +++ b/pkg/github/models/issue_event_for_issue.go @@ -0,0 +1,417 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueEventForIssue composed type wrapper for classes AddedToProjectIssueEventable, AssignedIssueEventable, ConvertedNoteToIssueIssueEventable, DemilestonedIssueEventable, LabeledIssueEventable, LockedIssueEventable, MilestonedIssueEventable, MovedColumnInProjectIssueEventable, RemovedFromProjectIssueEventable, RenamedIssueEventable, ReviewDismissedIssueEventable, ReviewRequestedIssueEventable, ReviewRequestRemovedIssueEventable, UnassignedIssueEventable, UnlabeledIssueEventable +type IssueEventForIssue struct { + // Composed type representation for type AddedToProjectIssueEventable + addedToProjectIssueEvent AddedToProjectIssueEventable + // Composed type representation for type AssignedIssueEventable + assignedIssueEvent AssignedIssueEventable + // Composed type representation for type ConvertedNoteToIssueIssueEventable + convertedNoteToIssueIssueEvent ConvertedNoteToIssueIssueEventable + // Composed type representation for type DemilestonedIssueEventable + demilestonedIssueEvent DemilestonedIssueEventable + // Composed type representation for type LabeledIssueEventable + labeledIssueEvent LabeledIssueEventable + // Composed type representation for type LockedIssueEventable + lockedIssueEvent LockedIssueEventable + // Composed type representation for type MilestonedIssueEventable + milestonedIssueEvent MilestonedIssueEventable + // Composed type representation for type MovedColumnInProjectIssueEventable + movedColumnInProjectIssueEvent MovedColumnInProjectIssueEventable + // Composed type representation for type RemovedFromProjectIssueEventable + removedFromProjectIssueEvent RemovedFromProjectIssueEventable + // Composed type representation for type RenamedIssueEventable + renamedIssueEvent RenamedIssueEventable + // Composed type representation for type ReviewDismissedIssueEventable + reviewDismissedIssueEvent ReviewDismissedIssueEventable + // Composed type representation for type ReviewRequestedIssueEventable + reviewRequestedIssueEvent ReviewRequestedIssueEventable + // Composed type representation for type ReviewRequestRemovedIssueEventable + reviewRequestRemovedIssueEvent ReviewRequestRemovedIssueEventable + // Composed type representation for type UnassignedIssueEventable + unassignedIssueEvent UnassignedIssueEventable + // Composed type representation for type UnlabeledIssueEventable + unlabeledIssueEvent UnlabeledIssueEventable +} +// NewIssueEventForIssue instantiates a new IssueEventForIssue and sets the default values. +func NewIssueEventForIssue()(*IssueEventForIssue) { + m := &IssueEventForIssue{ + } + return m +} +// CreateIssueEventForIssueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueEventForIssueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewIssueEventForIssue() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateAddedToProjectIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(AddedToProjectIssueEventable); ok { + result.SetAddedToProjectIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateAssignedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(AssignedIssueEventable); ok { + result.SetAssignedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateConvertedNoteToIssueIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ConvertedNoteToIssueIssueEventable); ok { + result.SetConvertedNoteToIssueIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateDemilestonedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(DemilestonedIssueEventable); ok { + result.SetDemilestonedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateLabeledIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(LabeledIssueEventable); ok { + result.SetLabeledIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateLockedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(LockedIssueEventable); ok { + result.SetLockedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateMilestonedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(MilestonedIssueEventable); ok { + result.SetMilestonedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateMovedColumnInProjectIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(MovedColumnInProjectIssueEventable); ok { + result.SetMovedColumnInProjectIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateRemovedFromProjectIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(RemovedFromProjectIssueEventable); ok { + result.SetRemovedFromProjectIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateRenamedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(RenamedIssueEventable); ok { + result.SetRenamedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateReviewDismissedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ReviewDismissedIssueEventable); ok { + result.SetReviewDismissedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateReviewRequestedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ReviewRequestedIssueEventable); ok { + result.SetReviewRequestedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateReviewRequestRemovedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ReviewRequestRemovedIssueEventable); ok { + result.SetReviewRequestRemovedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateUnassignedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(UnassignedIssueEventable); ok { + result.SetUnassignedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateUnlabeledIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(UnlabeledIssueEventable); ok { + result.SetUnlabeledIssueEvent(cast) + } + } + } + return result, nil +} +// GetAddedToProjectIssueEvent gets the addedToProjectIssueEvent property value. Composed type representation for type AddedToProjectIssueEventable +// returns a AddedToProjectIssueEventable when successful +func (m *IssueEventForIssue) GetAddedToProjectIssueEvent()(AddedToProjectIssueEventable) { + return m.addedToProjectIssueEvent +} +// GetAssignedIssueEvent gets the assignedIssueEvent property value. Composed type representation for type AssignedIssueEventable +// returns a AssignedIssueEventable when successful +func (m *IssueEventForIssue) GetAssignedIssueEvent()(AssignedIssueEventable) { + return m.assignedIssueEvent +} +// GetConvertedNoteToIssueIssueEvent gets the convertedNoteToIssueIssueEvent property value. Composed type representation for type ConvertedNoteToIssueIssueEventable +// returns a ConvertedNoteToIssueIssueEventable when successful +func (m *IssueEventForIssue) GetConvertedNoteToIssueIssueEvent()(ConvertedNoteToIssueIssueEventable) { + return m.convertedNoteToIssueIssueEvent +} +// GetDemilestonedIssueEvent gets the demilestonedIssueEvent property value. Composed type representation for type DemilestonedIssueEventable +// returns a DemilestonedIssueEventable when successful +func (m *IssueEventForIssue) GetDemilestonedIssueEvent()(DemilestonedIssueEventable) { + return m.demilestonedIssueEvent +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueEventForIssue) 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 *IssueEventForIssue) GetIsComposedType()(bool) { + return true +} +// GetLabeledIssueEvent gets the labeledIssueEvent property value. Composed type representation for type LabeledIssueEventable +// returns a LabeledIssueEventable when successful +func (m *IssueEventForIssue) GetLabeledIssueEvent()(LabeledIssueEventable) { + return m.labeledIssueEvent +} +// GetLockedIssueEvent gets the lockedIssueEvent property value. Composed type representation for type LockedIssueEventable +// returns a LockedIssueEventable when successful +func (m *IssueEventForIssue) GetLockedIssueEvent()(LockedIssueEventable) { + return m.lockedIssueEvent +} +// GetMilestonedIssueEvent gets the milestonedIssueEvent property value. Composed type representation for type MilestonedIssueEventable +// returns a MilestonedIssueEventable when successful +func (m *IssueEventForIssue) GetMilestonedIssueEvent()(MilestonedIssueEventable) { + return m.milestonedIssueEvent +} +// GetMovedColumnInProjectIssueEvent gets the movedColumnInProjectIssueEvent property value. Composed type representation for type MovedColumnInProjectIssueEventable +// returns a MovedColumnInProjectIssueEventable when successful +func (m *IssueEventForIssue) GetMovedColumnInProjectIssueEvent()(MovedColumnInProjectIssueEventable) { + return m.movedColumnInProjectIssueEvent +} +// GetRemovedFromProjectIssueEvent gets the removedFromProjectIssueEvent property value. Composed type representation for type RemovedFromProjectIssueEventable +// returns a RemovedFromProjectIssueEventable when successful +func (m *IssueEventForIssue) GetRemovedFromProjectIssueEvent()(RemovedFromProjectIssueEventable) { + return m.removedFromProjectIssueEvent +} +// GetRenamedIssueEvent gets the renamedIssueEvent property value. Composed type representation for type RenamedIssueEventable +// returns a RenamedIssueEventable when successful +func (m *IssueEventForIssue) GetRenamedIssueEvent()(RenamedIssueEventable) { + return m.renamedIssueEvent +} +// GetReviewDismissedIssueEvent gets the reviewDismissedIssueEvent property value. Composed type representation for type ReviewDismissedIssueEventable +// returns a ReviewDismissedIssueEventable when successful +func (m *IssueEventForIssue) GetReviewDismissedIssueEvent()(ReviewDismissedIssueEventable) { + return m.reviewDismissedIssueEvent +} +// GetReviewRequestedIssueEvent gets the reviewRequestedIssueEvent property value. Composed type representation for type ReviewRequestedIssueEventable +// returns a ReviewRequestedIssueEventable when successful +func (m *IssueEventForIssue) GetReviewRequestedIssueEvent()(ReviewRequestedIssueEventable) { + return m.reviewRequestedIssueEvent +} +// GetReviewRequestRemovedIssueEvent gets the reviewRequestRemovedIssueEvent property value. Composed type representation for type ReviewRequestRemovedIssueEventable +// returns a ReviewRequestRemovedIssueEventable when successful +func (m *IssueEventForIssue) GetReviewRequestRemovedIssueEvent()(ReviewRequestRemovedIssueEventable) { + return m.reviewRequestRemovedIssueEvent +} +// GetUnassignedIssueEvent gets the unassignedIssueEvent property value. Composed type representation for type UnassignedIssueEventable +// returns a UnassignedIssueEventable when successful +func (m *IssueEventForIssue) GetUnassignedIssueEvent()(UnassignedIssueEventable) { + return m.unassignedIssueEvent +} +// GetUnlabeledIssueEvent gets the unlabeledIssueEvent property value. Composed type representation for type UnlabeledIssueEventable +// returns a UnlabeledIssueEventable when successful +func (m *IssueEventForIssue) GetUnlabeledIssueEvent()(UnlabeledIssueEventable) { + return m.unlabeledIssueEvent +} +// Serialize serializes information the current object +func (m *IssueEventForIssue) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAddedToProjectIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetAddedToProjectIssueEvent()) + if err != nil { + return err + } + } else if m.GetAssignedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetAssignedIssueEvent()) + if err != nil { + return err + } + } else if m.GetConvertedNoteToIssueIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetConvertedNoteToIssueIssueEvent()) + if err != nil { + return err + } + } else if m.GetDemilestonedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetDemilestonedIssueEvent()) + if err != nil { + return err + } + } else if m.GetLabeledIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetLabeledIssueEvent()) + if err != nil { + return err + } + } else if m.GetLockedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetLockedIssueEvent()) + if err != nil { + return err + } + } else if m.GetMilestonedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetMilestonedIssueEvent()) + if err != nil { + return err + } + } else if m.GetMovedColumnInProjectIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetMovedColumnInProjectIssueEvent()) + if err != nil { + return err + } + } else if m.GetRemovedFromProjectIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetRemovedFromProjectIssueEvent()) + if err != nil { + return err + } + } else if m.GetRenamedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetRenamedIssueEvent()) + if err != nil { + return err + } + } else if m.GetReviewDismissedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetReviewDismissedIssueEvent()) + if err != nil { + return err + } + } else if m.GetReviewRequestedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetReviewRequestedIssueEvent()) + if err != nil { + return err + } + } else if m.GetReviewRequestRemovedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetReviewRequestRemovedIssueEvent()) + if err != nil { + return err + } + } else if m.GetUnassignedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetUnassignedIssueEvent()) + if err != nil { + return err + } + } else if m.GetUnlabeledIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetUnlabeledIssueEvent()) + if err != nil { + return err + } + } + return nil +} +// SetAddedToProjectIssueEvent sets the addedToProjectIssueEvent property value. Composed type representation for type AddedToProjectIssueEventable +func (m *IssueEventForIssue) SetAddedToProjectIssueEvent(value AddedToProjectIssueEventable)() { + m.addedToProjectIssueEvent = value +} +// SetAssignedIssueEvent sets the assignedIssueEvent property value. Composed type representation for type AssignedIssueEventable +func (m *IssueEventForIssue) SetAssignedIssueEvent(value AssignedIssueEventable)() { + m.assignedIssueEvent = value +} +// SetConvertedNoteToIssueIssueEvent sets the convertedNoteToIssueIssueEvent property value. Composed type representation for type ConvertedNoteToIssueIssueEventable +func (m *IssueEventForIssue) SetConvertedNoteToIssueIssueEvent(value ConvertedNoteToIssueIssueEventable)() { + m.convertedNoteToIssueIssueEvent = value +} +// SetDemilestonedIssueEvent sets the demilestonedIssueEvent property value. Composed type representation for type DemilestonedIssueEventable +func (m *IssueEventForIssue) SetDemilestonedIssueEvent(value DemilestonedIssueEventable)() { + m.demilestonedIssueEvent = value +} +// SetLabeledIssueEvent sets the labeledIssueEvent property value. Composed type representation for type LabeledIssueEventable +func (m *IssueEventForIssue) SetLabeledIssueEvent(value LabeledIssueEventable)() { + m.labeledIssueEvent = value +} +// SetLockedIssueEvent sets the lockedIssueEvent property value. Composed type representation for type LockedIssueEventable +func (m *IssueEventForIssue) SetLockedIssueEvent(value LockedIssueEventable)() { + m.lockedIssueEvent = value +} +// SetMilestonedIssueEvent sets the milestonedIssueEvent property value. Composed type representation for type MilestonedIssueEventable +func (m *IssueEventForIssue) SetMilestonedIssueEvent(value MilestonedIssueEventable)() { + m.milestonedIssueEvent = value +} +// SetMovedColumnInProjectIssueEvent sets the movedColumnInProjectIssueEvent property value. Composed type representation for type MovedColumnInProjectIssueEventable +func (m *IssueEventForIssue) SetMovedColumnInProjectIssueEvent(value MovedColumnInProjectIssueEventable)() { + m.movedColumnInProjectIssueEvent = value +} +// SetRemovedFromProjectIssueEvent sets the removedFromProjectIssueEvent property value. Composed type representation for type RemovedFromProjectIssueEventable +func (m *IssueEventForIssue) SetRemovedFromProjectIssueEvent(value RemovedFromProjectIssueEventable)() { + m.removedFromProjectIssueEvent = value +} +// SetRenamedIssueEvent sets the renamedIssueEvent property value. Composed type representation for type RenamedIssueEventable +func (m *IssueEventForIssue) SetRenamedIssueEvent(value RenamedIssueEventable)() { + m.renamedIssueEvent = value +} +// SetReviewDismissedIssueEvent sets the reviewDismissedIssueEvent property value. Composed type representation for type ReviewDismissedIssueEventable +func (m *IssueEventForIssue) SetReviewDismissedIssueEvent(value ReviewDismissedIssueEventable)() { + m.reviewDismissedIssueEvent = value +} +// SetReviewRequestedIssueEvent sets the reviewRequestedIssueEvent property value. Composed type representation for type ReviewRequestedIssueEventable +func (m *IssueEventForIssue) SetReviewRequestedIssueEvent(value ReviewRequestedIssueEventable)() { + m.reviewRequestedIssueEvent = value +} +// SetReviewRequestRemovedIssueEvent sets the reviewRequestRemovedIssueEvent property value. Composed type representation for type ReviewRequestRemovedIssueEventable +func (m *IssueEventForIssue) SetReviewRequestRemovedIssueEvent(value ReviewRequestRemovedIssueEventable)() { + m.reviewRequestRemovedIssueEvent = value +} +// SetUnassignedIssueEvent sets the unassignedIssueEvent property value. Composed type representation for type UnassignedIssueEventable +func (m *IssueEventForIssue) SetUnassignedIssueEvent(value UnassignedIssueEventable)() { + m.unassignedIssueEvent = value +} +// SetUnlabeledIssueEvent sets the unlabeledIssueEvent property value. Composed type representation for type UnlabeledIssueEventable +func (m *IssueEventForIssue) SetUnlabeledIssueEvent(value UnlabeledIssueEventable)() { + m.unlabeledIssueEvent = value +} +type IssueEventForIssueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAddedToProjectIssueEvent()(AddedToProjectIssueEventable) + GetAssignedIssueEvent()(AssignedIssueEventable) + GetConvertedNoteToIssueIssueEvent()(ConvertedNoteToIssueIssueEventable) + GetDemilestonedIssueEvent()(DemilestonedIssueEventable) + GetLabeledIssueEvent()(LabeledIssueEventable) + GetLockedIssueEvent()(LockedIssueEventable) + GetMilestonedIssueEvent()(MilestonedIssueEventable) + GetMovedColumnInProjectIssueEvent()(MovedColumnInProjectIssueEventable) + GetRemovedFromProjectIssueEvent()(RemovedFromProjectIssueEventable) + GetRenamedIssueEvent()(RenamedIssueEventable) + GetReviewDismissedIssueEvent()(ReviewDismissedIssueEventable) + GetReviewRequestedIssueEvent()(ReviewRequestedIssueEventable) + GetReviewRequestRemovedIssueEvent()(ReviewRequestRemovedIssueEventable) + GetUnassignedIssueEvent()(UnassignedIssueEventable) + GetUnlabeledIssueEvent()(UnlabeledIssueEventable) + SetAddedToProjectIssueEvent(value AddedToProjectIssueEventable)() + SetAssignedIssueEvent(value AssignedIssueEventable)() + SetConvertedNoteToIssueIssueEvent(value ConvertedNoteToIssueIssueEventable)() + SetDemilestonedIssueEvent(value DemilestonedIssueEventable)() + SetLabeledIssueEvent(value LabeledIssueEventable)() + SetLockedIssueEvent(value LockedIssueEventable)() + SetMilestonedIssueEvent(value MilestonedIssueEventable)() + SetMovedColumnInProjectIssueEvent(value MovedColumnInProjectIssueEventable)() + SetRemovedFromProjectIssueEvent(value RemovedFromProjectIssueEventable)() + SetRenamedIssueEvent(value RenamedIssueEventable)() + SetReviewDismissedIssueEvent(value ReviewDismissedIssueEventable)() + SetReviewRequestedIssueEvent(value ReviewRequestedIssueEventable)() + SetReviewRequestRemovedIssueEvent(value ReviewRequestRemovedIssueEventable)() + SetUnassignedIssueEvent(value UnassignedIssueEventable)() + SetUnlabeledIssueEvent(value UnlabeledIssueEventable)() +} diff --git a/pkg/github/models/issue_event_label.go b/pkg/github/models/issue_event_label.go new file mode 100644 index 00000000..8cd5a978 --- /dev/null +++ b/pkg/github/models/issue_event_label.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueEventLabel issue Event Label +type IssueEventLabel 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 color property + color *string + // The name property + name *string +} +// NewIssueEventLabel instantiates a new IssueEventLabel and sets the default values. +func NewIssueEventLabel()(*IssueEventLabel) { + m := &IssueEventLabel{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueEventLabelFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueEventLabelFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueEventLabel(), 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 *IssueEventLabel) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The color property +// returns a *string when successful +func (m *IssueEventLabel) GetColor()(*string) { + return m.color +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueEventLabel) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(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 property +// returns a *string when successful +func (m *IssueEventLabel) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *IssueEventLabel) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *IssueEventLabel) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The color property +func (m *IssueEventLabel) SetColor(value *string)() { + m.color = value +} +// SetName sets the name property value. The name property +func (m *IssueEventLabel) SetName(value *string)() { + m.name = value +} +type IssueEventLabelable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetName()(*string) + SetColor(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/issue_event_milestone.go b/pkg/github/models/issue_event_milestone.go new file mode 100644 index 00000000..e43340dc --- /dev/null +++ b/pkg/github/models/issue_event_milestone.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueEventMilestone issue Event Milestone +type IssueEventMilestone 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 title property + title *string +} +// NewIssueEventMilestone instantiates a new IssueEventMilestone and sets the default values. +func NewIssueEventMilestone()(*IssueEventMilestone) { + m := &IssueEventMilestone{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueEventMilestoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueEventMilestoneFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueEventMilestone(), 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 *IssueEventMilestone) 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 *IssueEventMilestone) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *IssueEventMilestone) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *IssueEventMilestone) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *IssueEventMilestone) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTitle sets the title property value. The title property +func (m *IssueEventMilestone) SetTitle(value *string)() { + m.title = value +} +type IssueEventMilestoneable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTitle()(*string) + SetTitle(value *string)() +} diff --git a/pkg/github/models/issue_event_project_card.go b/pkg/github/models/issue_event_project_card.go new file mode 100644 index 00000000..ca87cbd9 --- /dev/null +++ b/pkg/github/models/issue_event_project_card.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueEventProjectCard issue Event Project Card +type IssueEventProjectCard 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 column_name property + column_name *string + // The id property + id *int32 + // The previous_column_name property + previous_column_name *string + // The project_id property + project_id *int32 + // The project_url property + project_url *string + // The url property + url *string +} +// NewIssueEventProjectCard instantiates a new IssueEventProjectCard and sets the default values. +func NewIssueEventProjectCard()(*IssueEventProjectCard) { + m := &IssueEventProjectCard{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueEventProjectCardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueEventProjectCardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueEventProjectCard(), 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 *IssueEventProjectCard) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColumnName gets the column_name property value. The column_name property +// returns a *string when successful +func (m *IssueEventProjectCard) GetColumnName()(*string) { + return m.column_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueEventProjectCard) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnName(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["previous_column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousColumnName(val) + } + return nil + } + res["project_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetProjectId(val) + } + return nil + } + res["project_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *IssueEventProjectCard) GetId()(*int32) { + return m.id +} +// GetPreviousColumnName gets the previous_column_name property value. The previous_column_name property +// returns a *string when successful +func (m *IssueEventProjectCard) GetPreviousColumnName()(*string) { + return m.previous_column_name +} +// GetProjectId gets the project_id property value. The project_id property +// returns a *int32 when successful +func (m *IssueEventProjectCard) GetProjectId()(*int32) { + return m.project_id +} +// GetProjectUrl gets the project_url property value. The project_url property +// returns a *string when successful +func (m *IssueEventProjectCard) GetProjectUrl()(*string) { + return m.project_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *IssueEventProjectCard) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *IssueEventProjectCard) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("column_name", m.GetColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_column_name", m.GetPreviousColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("project_id", m.GetProjectId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_url", m.GetProjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *IssueEventProjectCard) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColumnName sets the column_name property value. The column_name property +func (m *IssueEventProjectCard) SetColumnName(value *string)() { + m.column_name = value +} +// SetId sets the id property value. The id property +func (m *IssueEventProjectCard) SetId(value *int32)() { + m.id = value +} +// SetPreviousColumnName sets the previous_column_name property value. The previous_column_name property +func (m *IssueEventProjectCard) SetPreviousColumnName(value *string)() { + m.previous_column_name = value +} +// SetProjectId sets the project_id property value. The project_id property +func (m *IssueEventProjectCard) SetProjectId(value *int32)() { + m.project_id = value +} +// SetProjectUrl sets the project_url property value. The project_url property +func (m *IssueEventProjectCard) SetProjectUrl(value *string)() { + m.project_url = value +} +// SetUrl sets the url property value. The url property +func (m *IssueEventProjectCard) SetUrl(value *string)() { + m.url = value +} +type IssueEventProjectCardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumnName()(*string) + GetId()(*int32) + GetPreviousColumnName()(*string) + GetProjectId()(*int32) + GetProjectUrl()(*string) + GetUrl()(*string) + SetColumnName(value *string)() + SetId(value *int32)() + SetPreviousColumnName(value *string)() + SetProjectId(value *int32)() + SetProjectUrl(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/issue_event_rename.go b/pkg/github/models/issue_event_rename.go new file mode 100644 index 00000000..0d8b43c5 --- /dev/null +++ b/pkg/github/models/issue_event_rename.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueEventRename issue Event Rename +type IssueEventRename 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 from property + from *string + // The to property + to *string +} +// NewIssueEventRename instantiates a new IssueEventRename and sets the default values. +func NewIssueEventRename()(*IssueEventRename) { + m := &IssueEventRename{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueEventRenameFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueEventRenameFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueEventRename(), 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 *IssueEventRename) 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 *IssueEventRename) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["from"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFrom(val) + } + return nil + } + res["to"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTo(val) + } + return nil + } + return res +} +// GetFrom gets the from property value. The from property +// returns a *string when successful +func (m *IssueEventRename) GetFrom()(*string) { + return m.from +} +// GetTo gets the to property value. The to property +// returns a *string when successful +func (m *IssueEventRename) GetTo()(*string) { + return m.to +} +// Serialize serializes information the current object +func (m *IssueEventRename) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("from", m.GetFrom()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("to", m.GetTo()) + 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 *IssueEventRename) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFrom sets the from property value. The from property +func (m *IssueEventRename) SetFrom(value *string)() { + m.from = value +} +// SetTo sets the to property value. The to property +func (m *IssueEventRename) SetTo(value *string)() { + m.to = value +} +type IssueEventRenameable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFrom()(*string) + GetTo()(*string) + SetFrom(value *string)() + SetTo(value *string)() +} diff --git a/pkg/github/models/issue_search_result_item.go b/pkg/github/models/issue_search_result_item.go new file mode 100644 index 00000000..bb48360b --- /dev/null +++ b/pkg/github/models/issue_search_result_item.go @@ -0,0 +1,1105 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// IssueSearchResultItem issue Search Result Item +type IssueSearchResultItem struct { + // The active_lock_reason property + active_lock_reason *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee NullableSimpleUserable + // The assignees property + assignees []SimpleUserable + // How the author is associated with the repository. + author_association *AuthorAssociation + // The body property + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The closed_at property + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The comments property + comments *int32 + // The comments_url property + comments_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The draft property + draft *bool + // The events_url property + events_url *string + // The html_url property + html_url *string + // The id property + id *int64 + // The labels property + labels []IssueSearchResultItem_labelsable + // The labels_url property + labels_url *string + // The locked property + locked *bool + // A collection of related issues and pull requests. + milestone NullableMilestoneable + // The node_id property + node_id *string + // The number property + number *int32 + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The pull_request property + pull_request IssueSearchResultItem_pull_requestable + // The reactions property + reactions ReactionRollupable + // A repository on GitHub. + repository Repositoryable + // The repository_url property + repository_url *string + // The score property + score *float64 + // The state property + state *string + // The state_reason property + state_reason *string + // The text_matches property + text_matches []Issuesable + // The timeline_url property + timeline_url *string + // The title property + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewIssueSearchResultItem instantiates a new IssueSearchResultItem and sets the default values. +func NewIssueSearchResultItem()(*IssueSearchResultItem) { + m := &IssueSearchResultItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueSearchResultItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueSearchResultItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueSearchResultItem(), nil +} +// GetActiveLockReason gets the active_lock_reason property value. The active_lock_reason property +// returns a *string when successful +func (m *IssueSearchResultItem) GetActiveLockReason()(*string) { + return m.active_lock_reason +} +// 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 *IssueSearchResultItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueSearchResultItem) GetAssignee()(NullableSimpleUserable) { + return m.assignee +} +// GetAssignees gets the assignees property value. The assignees property +// returns a []SimpleUserable when successful +func (m *IssueSearchResultItem) GetAssignees()([]SimpleUserable) { + return m.assignees +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *IssueSearchResultItem) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *IssueSearchResultItem) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *IssueSearchResultItem) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *IssueSearchResultItem) GetBodyText()(*string) { + return m.body_text +} +// GetClosedAt gets the closed_at property value. The closed_at property +// returns a *Time when successful +func (m *IssueSearchResultItem) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetComments gets the comments property value. The comments property +// returns a *int32 when successful +func (m *IssueSearchResultItem) GetComments()(*int32) { + return m.comments +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *IssueSearchResultItem) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *IssueSearchResultItem) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDraft gets the draft property value. The draft property +// returns a *bool when successful +func (m *IssueSearchResultItem) GetDraft()(*bool) { + return m.draft +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *IssueSearchResultItem) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueSearchResultItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active_lock_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActiveLockReason(val) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(NullableSimpleUserable)) + } + return nil + } + res["assignees"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetAssignees(res) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetComments(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + 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["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIssueSearchResultItem_labelsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]IssueSearchResultItem_labelsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(IssueSearchResultItem_labelsable) + } + } + m.SetLabels(res) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["locked"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLocked(val) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMilestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(NullableMilestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueSearchResultItem_pull_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(IssueSearchResultItem_pull_requestable)) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(Repositoryable)) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["state_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStateReason(val) + } + return nil + } + res["text_matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIssuesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Issuesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Issuesable) + } + } + m.SetTextMatches(res) + } + return nil + } + res["timeline_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTimelineUrl(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *IssueSearchResultItem) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *IssueSearchResultItem) GetId()(*int64) { + return m.id +} +// GetLabels gets the labels property value. The labels property +// returns a []IssueSearchResultItem_labelsable when successful +func (m *IssueSearchResultItem) GetLabels()([]IssueSearchResultItem_labelsable) { + return m.labels +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *IssueSearchResultItem) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLocked gets the locked property value. The locked property +// returns a *bool when successful +func (m *IssueSearchResultItem) GetLocked()(*bool) { + return m.locked +} +// GetMilestone gets the milestone property value. A collection of related issues and pull requests. +// returns a NullableMilestoneable when successful +func (m *IssueSearchResultItem) GetMilestone()(NullableMilestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *IssueSearchResultItem) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *IssueSearchResultItem) GetNumber()(*int32) { + return m.number +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *IssueSearchResultItem) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetPullRequest gets the pull_request property value. The pull_request property +// returns a IssueSearchResultItem_pull_requestable when successful +func (m *IssueSearchResultItem) GetPullRequest()(IssueSearchResultItem_pull_requestable) { + return m.pull_request +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *IssueSearchResultItem) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetRepository gets the repository property value. A repository on GitHub. +// returns a Repositoryable when successful +func (m *IssueSearchResultItem) GetRepository()(Repositoryable) { + return m.repository +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *IssueSearchResultItem) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetScore gets the score property value. The score property +// returns a *float64 when successful +func (m *IssueSearchResultItem) GetScore()(*float64) { + return m.score +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *IssueSearchResultItem) GetState()(*string) { + return m.state +} +// GetStateReason gets the state_reason property value. The state_reason property +// returns a *string when successful +func (m *IssueSearchResultItem) GetStateReason()(*string) { + return m.state_reason +} +// GetTextMatches gets the text_matches property value. The text_matches property +// returns a []Issuesable when successful +func (m *IssueSearchResultItem) GetTextMatches()([]Issuesable) { + return m.text_matches +} +// GetTimelineUrl gets the timeline_url property value. The timeline_url property +// returns a *string when successful +func (m *IssueSearchResultItem) GetTimelineUrl()(*string) { + return m.timeline_url +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *IssueSearchResultItem) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *IssueSearchResultItem) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *IssueSearchResultItem) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *IssueSearchResultItem) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *IssueSearchResultItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("active_lock_reason", m.GetActiveLockReason()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + if m.GetAssignees() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssignees())) + for i, v := range m.GetAssignees() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("assignees", cast) + if err != nil { + return err + } + } + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("closed_at", m.GetClosedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("locked", m.GetLocked()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("score", m.GetScore()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state_reason", m.GetStateReason()) + if err != nil { + return err + } + } + if m.GetTextMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTextMatches())) + for i, v := range m.GetTextMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("text_matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("timeline_url", m.GetTimelineUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveLockReason sets the active_lock_reason property value. The active_lock_reason property +func (m *IssueSearchResultItem) SetActiveLockReason(value *string)() { + m.active_lock_reason = 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 *IssueSearchResultItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *IssueSearchResultItem) SetAssignee(value NullableSimpleUserable)() { + m.assignee = value +} +// SetAssignees sets the assignees property value. The assignees property +func (m *IssueSearchResultItem) SetAssignees(value []SimpleUserable)() { + m.assignees = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *IssueSearchResultItem) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. The body property +func (m *IssueSearchResultItem) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *IssueSearchResultItem) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *IssueSearchResultItem) SetBodyText(value *string)() { + m.body_text = value +} +// SetClosedAt sets the closed_at property value. The closed_at property +func (m *IssueSearchResultItem) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetComments sets the comments property value. The comments property +func (m *IssueSearchResultItem) SetComments(value *int32)() { + m.comments = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *IssueSearchResultItem) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *IssueSearchResultItem) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDraft sets the draft property value. The draft property +func (m *IssueSearchResultItem) SetDraft(value *bool)() { + m.draft = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *IssueSearchResultItem) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *IssueSearchResultItem) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *IssueSearchResultItem) SetId(value *int64)() { + m.id = value +} +// SetLabels sets the labels property value. The labels property +func (m *IssueSearchResultItem) SetLabels(value []IssueSearchResultItem_labelsable)() { + m.labels = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *IssueSearchResultItem) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLocked sets the locked property value. The locked property +func (m *IssueSearchResultItem) SetLocked(value *bool)() { + m.locked = value +} +// SetMilestone sets the milestone property value. A collection of related issues and pull requests. +func (m *IssueSearchResultItem) SetMilestone(value NullableMilestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *IssueSearchResultItem) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The number property +func (m *IssueSearchResultItem) SetNumber(value *int32)() { + m.number = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *IssueSearchResultItem) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetPullRequest sets the pull_request property value. The pull_request property +func (m *IssueSearchResultItem) SetPullRequest(value IssueSearchResultItem_pull_requestable)() { + m.pull_request = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *IssueSearchResultItem) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetRepository sets the repository property value. A repository on GitHub. +func (m *IssueSearchResultItem) SetRepository(value Repositoryable)() { + m.repository = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *IssueSearchResultItem) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetScore sets the score property value. The score property +func (m *IssueSearchResultItem) SetScore(value *float64)() { + m.score = value +} +// SetState sets the state property value. The state property +func (m *IssueSearchResultItem) SetState(value *string)() { + m.state = value +} +// SetStateReason sets the state_reason property value. The state_reason property +func (m *IssueSearchResultItem) SetStateReason(value *string)() { + m.state_reason = value +} +// SetTextMatches sets the text_matches property value. The text_matches property +func (m *IssueSearchResultItem) SetTextMatches(value []Issuesable)() { + m.text_matches = value +} +// SetTimelineUrl sets the timeline_url property value. The timeline_url property +func (m *IssueSearchResultItem) SetTimelineUrl(value *string)() { + m.timeline_url = value +} +// SetTitle sets the title property value. The title property +func (m *IssueSearchResultItem) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *IssueSearchResultItem) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *IssueSearchResultItem) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *IssueSearchResultItem) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type IssueSearchResultItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveLockReason()(*string) + GetAssignee()(NullableSimpleUserable) + GetAssignees()([]SimpleUserable) + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetComments()(*int32) + GetCommentsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDraft()(*bool) + GetEventsUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLabels()([]IssueSearchResultItem_labelsable) + GetLabelsUrl()(*string) + GetLocked()(*bool) + GetMilestone()(NullableMilestoneable) + GetNodeId()(*string) + GetNumber()(*int32) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetPullRequest()(IssueSearchResultItem_pull_requestable) + GetReactions()(ReactionRollupable) + GetRepository()(Repositoryable) + GetRepositoryUrl()(*string) + GetScore()(*float64) + GetState()(*string) + GetStateReason()(*string) + GetTextMatches()([]Issuesable) + GetTimelineUrl()(*string) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetActiveLockReason(value *string)() + SetAssignee(value NullableSimpleUserable)() + SetAssignees(value []SimpleUserable)() + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetComments(value *int32)() + SetCommentsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDraft(value *bool)() + SetEventsUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLabels(value []IssueSearchResultItem_labelsable)() + SetLabelsUrl(value *string)() + SetLocked(value *bool)() + SetMilestone(value NullableMilestoneable)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetPullRequest(value IssueSearchResultItem_pull_requestable)() + SetReactions(value ReactionRollupable)() + SetRepository(value Repositoryable)() + SetRepositoryUrl(value *string)() + SetScore(value *float64)() + SetState(value *string)() + SetStateReason(value *string)() + SetTextMatches(value []Issuesable)() + SetTimelineUrl(value *string)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/issue_search_result_item_escaped_labels.go b/pkg/github/models/issue_search_result_item_escaped_labels.go new file mode 100644 index 00000000..e3603569 --- /dev/null +++ b/pkg/github/models/issue_search_result_item_escaped_labels.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type IssueSearchResultItem_labels 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 color property + color *string + // The default property + defaultEscaped *bool + // The description property + description *string + // The id property + id *int64 + // The name property + name *string + // The node_id property + node_id *string + // The url property + url *string +} +// NewIssueSearchResultItem_labels instantiates a new IssueSearchResultItem_labels and sets the default values. +func NewIssueSearchResultItem_labels()(*IssueSearchResultItem_labels) { + m := &IssueSearchResultItem_labels{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueSearchResultItem_labelsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueSearchResultItem_labelsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueSearchResultItem_labels(), 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 *IssueSearchResultItem_labels) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The color property +// returns a *string when successful +func (m *IssueSearchResultItem_labels) GetColor()(*string) { + return m.color +} +// GetDefaultEscaped gets the default property value. The default property +// returns a *bool when successful +func (m *IssueSearchResultItem_labels) GetDefaultEscaped()(*bool) { + return m.defaultEscaped +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *IssueSearchResultItem_labels) 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 *IssueSearchResultItem_labels) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultEscaped(val) + } + 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *IssueSearchResultItem_labels) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *IssueSearchResultItem_labels) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *IssueSearchResultItem_labels) GetNodeId()(*string) { + return m.node_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *IssueSearchResultItem_labels) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *IssueSearchResultItem_labels) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("default", m.GetDefaultEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *IssueSearchResultItem_labels) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The color property +func (m *IssueSearchResultItem_labels) SetColor(value *string)() { + m.color = value +} +// SetDefaultEscaped sets the default property value. The default property +func (m *IssueSearchResultItem_labels) SetDefaultEscaped(value *bool)() { + m.defaultEscaped = value +} +// SetDescription sets the description property value. The description property +func (m *IssueSearchResultItem_labels) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The id property +func (m *IssueSearchResultItem_labels) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *IssueSearchResultItem_labels) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *IssueSearchResultItem_labels) SetNodeId(value *string)() { + m.node_id = value +} +// SetUrl sets the url property value. The url property +func (m *IssueSearchResultItem_labels) SetUrl(value *string)() { + m.url = value +} +type IssueSearchResultItem_labelsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetDefaultEscaped()(*bool) + GetDescription()(*string) + GetId()(*int64) + GetName()(*string) + GetNodeId()(*string) + GetUrl()(*string) + SetColor(value *string)() + SetDefaultEscaped(value *bool)() + SetDescription(value *string)() + SetId(value *int64)() + SetName(value *string)() + SetNodeId(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/issue_search_result_item_escaped_pull_escaped_request.go b/pkg/github/models/issue_search_result_item_escaped_pull_escaped_request.go new file mode 100644 index 00000000..d6568fb3 --- /dev/null +++ b/pkg/github/models/issue_search_result_item_escaped_pull_escaped_request.go @@ -0,0 +1,197 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type IssueSearchResultItem_pull_request 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 diff_url property + diff_url *string + // The html_url property + html_url *string + // The merged_at property + merged_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The patch_url property + patch_url *string + // The url property + url *string +} +// NewIssueSearchResultItem_pull_request instantiates a new IssueSearchResultItem_pull_request and sets the default values. +func NewIssueSearchResultItem_pull_request()(*IssueSearchResultItem_pull_request) { + m := &IssueSearchResultItem_pull_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssueSearchResultItem_pull_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssueSearchResultItem_pull_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssueSearchResultItem_pull_request(), 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 *IssueSearchResultItem_pull_request) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDiffUrl gets the diff_url property value. The diff_url property +// returns a *string when successful +func (m *IssueSearchResultItem_pull_request) GetDiffUrl()(*string) { + return m.diff_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *IssueSearchResultItem_pull_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["diff_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["merged_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetMergedAt(val) + } + return nil + } + res["patch_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *IssueSearchResultItem_pull_request) GetHtmlUrl()(*string) { + return m.html_url +} +// GetMergedAt gets the merged_at property value. The merged_at property +// returns a *Time when successful +func (m *IssueSearchResultItem_pull_request) GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.merged_at +} +// GetPatchUrl gets the patch_url property value. The patch_url property +// returns a *string when successful +func (m *IssueSearchResultItem_pull_request) GetPatchUrl()(*string) { + return m.patch_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *IssueSearchResultItem_pull_request) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *IssueSearchResultItem_pull_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("diff_url", m.GetDiffUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("merged_at", m.GetMergedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patch_url", m.GetPatchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *IssueSearchResultItem_pull_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDiffUrl sets the diff_url property value. The diff_url property +func (m *IssueSearchResultItem_pull_request) SetDiffUrl(value *string)() { + m.diff_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *IssueSearchResultItem_pull_request) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetMergedAt sets the merged_at property value. The merged_at property +func (m *IssueSearchResultItem_pull_request) SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.merged_at = value +} +// SetPatchUrl sets the patch_url property value. The patch_url property +func (m *IssueSearchResultItem_pull_request) SetPatchUrl(value *string)() { + m.patch_url = value +} +// SetUrl sets the url property value. The url property +func (m *IssueSearchResultItem_pull_request) SetUrl(value *string)() { + m.url = value +} +type IssueSearchResultItem_pull_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDiffUrl()(*string) + GetHtmlUrl()(*string) + GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPatchUrl()(*string) + GetUrl()(*string) + SetDiffUrl(value *string)() + SetHtmlUrl(value *string)() + SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPatchUrl(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/issues.go b/pkg/github/models/issues.go new file mode 100644 index 00000000..1f217837 --- /dev/null +++ b/pkg/github/models/issues.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Issues struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The fragment property + fragment *string + // The matches property + matches []Issues_matchesable + // The object_type property + object_type *string + // The object_url property + object_url *string + // The property property + property *string +} +// NewIssues instantiates a new Issues and sets the default values. +func NewIssues()(*Issues) { + m := &Issues{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssuesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssuesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssues(), 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 *Issues) 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 *Issues) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fragment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFragment(val) + } + return nil + } + res["matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIssues_matchesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Issues_matchesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Issues_matchesable) + } + } + m.SetMatches(res) + } + return nil + } + res["object_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectType(val) + } + return nil + } + res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectUrl(val) + } + return nil + } + res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProperty(val) + } + return nil + } + return res +} +// GetFragment gets the fragment property value. The fragment property +// returns a *string when successful +func (m *Issues) GetFragment()(*string) { + return m.fragment +} +// GetMatches gets the matches property value. The matches property +// returns a []Issues_matchesable when successful +func (m *Issues) GetMatches()([]Issues_matchesable) { + return m.matches +} +// GetObjectType gets the object_type property value. The object_type property +// returns a *string when successful +func (m *Issues) GetObjectType()(*string) { + return m.object_type +} +// GetObjectUrl gets the object_url property value. The object_url property +// returns a *string when successful +func (m *Issues) GetObjectUrl()(*string) { + return m.object_url +} +// GetProperty gets the property property value. The property property +// returns a *string when successful +func (m *Issues) GetProperty()(*string) { + return m.property +} +// Serialize serializes information the current object +func (m *Issues) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("fragment", m.GetFragment()) + if err != nil { + return err + } + } + if m.GetMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMatches())) + for i, v := range m.GetMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_type", m.GetObjectType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_url", m.GetObjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("property", m.GetProperty()) + 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 *Issues) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFragment sets the fragment property value. The fragment property +func (m *Issues) SetFragment(value *string)() { + m.fragment = value +} +// SetMatches sets the matches property value. The matches property +func (m *Issues) SetMatches(value []Issues_matchesable)() { + m.matches = value +} +// SetObjectType sets the object_type property value. The object_type property +func (m *Issues) SetObjectType(value *string)() { + m.object_type = value +} +// SetObjectUrl sets the object_url property value. The object_url property +func (m *Issues) SetObjectUrl(value *string)() { + m.object_url = value +} +// SetProperty sets the property property value. The property property +func (m *Issues) SetProperty(value *string)() { + m.property = value +} +type Issuesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFragment()(*string) + GetMatches()([]Issues_matchesable) + GetObjectType()(*string) + GetObjectUrl()(*string) + GetProperty()(*string) + SetFragment(value *string)() + SetMatches(value []Issues_matchesable)() + SetObjectType(value *string)() + SetObjectUrl(value *string)() + SetProperty(value *string)() +} diff --git a/pkg/github/models/issues503_error.go b/pkg/github/models/issues503_error.go new file mode 100644 index 00000000..6d8d5094 --- /dev/null +++ b/pkg/github/models/issues503_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 Issues503Error 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 +} +// NewIssues503Error instantiates a new Issues503Error and sets the default values. +func NewIssues503Error()(*Issues503Error) { + m := &Issues503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssues503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssues503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssues503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Issues503Error) 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 *Issues503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Issues503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Issues503Error) 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 *Issues503Error) 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 *Issues503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Issues503Error) 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 *Issues503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Issues503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Issues503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Issues503Error) SetMessage(value *string)() { + m.message = value +} +type Issues503Errorable 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/issues_escaped_matches.go b/pkg/github/models/issues_escaped_matches.go new file mode 100644 index 00000000..918b2c59 --- /dev/null +++ b/pkg/github/models/issues_escaped_matches.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Issues_matches struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The indices property + indices []int32 + // The text property + text *string +} +// NewIssues_matches instantiates a new Issues_matches and sets the default values. +func NewIssues_matches()(*Issues_matches) { + m := &Issues_matches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssues_matchesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssues_matchesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssues_matches(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Issues_matches) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Issues_matches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["indices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetIndices(res) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetIndices gets the indices property value. The indices property +// returns a []int32 when successful +func (m *Issues_matches) GetIndices()([]int32) { + return m.indices +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *Issues_matches) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *Issues_matches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIndices() != nil { + err := writer.WriteCollectionOfInt32Values("indices", m.GetIndices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *Issues_matches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIndices sets the indices property value. The indices property +func (m *Issues_matches) SetIndices(value []int32)() { + m.indices = value +} +// SetText sets the text property value. The text property +func (m *Issues_matches) SetText(value *string)() { + m.text = value +} +type Issues_matchesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIndices()([]int32) + GetText()(*string) + SetIndices(value []int32)() + SetText(value *string)() +} diff --git a/pkg/github/models/job.go b/pkg/github/models/job.go new file mode 100644 index 00000000..48fbc93d --- /dev/null +++ b/pkg/github/models/job.go @@ -0,0 +1,740 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Job information of a job execution in a workflow run +type Job 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 check_run_url property + check_run_url *string + // The time that the job finished, in ISO 8601 format. + completed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The outcome of the job. + conclusion *Job_conclusion + // The time that the job created, in ISO 8601 format. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the current branch. + head_branch *string + // The SHA of the commit that is being run. + head_sha *string + // The html_url property + html_url *string + // The id of the job. + id *int32 + // Labels for the workflow job. Specified by the "runs_on" attribute in the action's workflow file. + labels []string + // The name of the job. + name *string + // The node_id property + node_id *string + // Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run. + run_attempt *int32 + // The id of the associated workflow run. + run_id *int32 + // The run_url property + run_url *string + // The ID of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) + runner_group_id *int32 + // The name of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) + runner_group_name *string + // The ID of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) + runner_id *int32 + // The name of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) + runner_name *string + // The time that the job started, in ISO 8601 format. + started_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The phase of the lifecycle that the job is currently in. + status *Job_status + // Steps in this job. + steps []Job_stepsable + // The url property + url *string + // The name of the workflow. + workflow_name *string +} +// NewJob instantiates a new Job and sets the default values. +func NewJob()(*Job) { + m := &Job{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateJobFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateJobFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewJob(), 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 *Job) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCheckRunUrl gets the check_run_url property value. The check_run_url property +// returns a *string when successful +func (m *Job) GetCheckRunUrl()(*string) { + return m.check_run_url +} +// GetCompletedAt gets the completed_at property value. The time that the job finished, in ISO 8601 format. +// returns a *Time when successful +func (m *Job) GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.completed_at +} +// GetConclusion gets the conclusion property value. The outcome of the job. +// returns a *Job_conclusion when successful +func (m *Job) GetConclusion()(*Job_conclusion) { + return m.conclusion +} +// GetCreatedAt gets the created_at property value. The time that the job created, in ISO 8601 format. +// returns a *Time when successful +func (m *Job) 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 *Job) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["check_run_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCheckRunUrl(val) + } + return nil + } + res["completed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCompletedAt(val) + } + return nil + } + res["conclusion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseJob_conclusion) + if err != nil { + return err + } + if val != nil { + m.SetConclusion(val.(*Job_conclusion)) + } + return nil + } + 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["head_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadBranch(val) + } + return nil + } + res["head_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadSha(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["labels"] = 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.SetLabels(res) + } + 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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["run_attempt"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunAttempt(val) + } + return nil + } + res["run_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunId(val) + } + return nil + } + res["run_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRunUrl(val) + } + return nil + } + res["runner_group_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunnerGroupId(val) + } + return nil + } + res["runner_group_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRunnerGroupName(val) + } + return nil + } + res["runner_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunnerId(val) + } + return nil + } + res["runner_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRunnerName(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(ParseJob_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*Job_status)) + } + return nil + } + res["steps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateJob_stepsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Job_stepsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Job_stepsable) + } + } + m.SetSteps(res) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["workflow_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkflowName(val) + } + return nil + } + return res +} +// GetHeadBranch gets the head_branch property value. The name of the current branch. +// returns a *string when successful +func (m *Job) GetHeadBranch()(*string) { + return m.head_branch +} +// GetHeadSha gets the head_sha property value. The SHA of the commit that is being run. +// returns a *string when successful +func (m *Job) GetHeadSha()(*string) { + return m.head_sha +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Job) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id of the job. +// returns a *int32 when successful +func (m *Job) GetId()(*int32) { + return m.id +} +// GetLabels gets the labels property value. Labels for the workflow job. Specified by the "runs_on" attribute in the action's workflow file. +// returns a []string when successful +func (m *Job) GetLabels()([]string) { + return m.labels +} +// GetName gets the name property value. The name of the job. +// returns a *string when successful +func (m *Job) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Job) GetNodeId()(*string) { + return m.node_id +} +// GetRunAttempt gets the run_attempt property value. Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run. +// returns a *int32 when successful +func (m *Job) GetRunAttempt()(*int32) { + return m.run_attempt +} +// GetRunId gets the run_id property value. The id of the associated workflow run. +// returns a *int32 when successful +func (m *Job) GetRunId()(*int32) { + return m.run_id +} +// GetRunnerGroupId gets the runner_group_id property value. The ID of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +// returns a *int32 when successful +func (m *Job) GetRunnerGroupId()(*int32) { + return m.runner_group_id +} +// GetRunnerGroupName gets the runner_group_name property value. The name of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +// returns a *string when successful +func (m *Job) GetRunnerGroupName()(*string) { + return m.runner_group_name +} +// GetRunnerId gets the runner_id property value. The ID of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +// returns a *int32 when successful +func (m *Job) GetRunnerId()(*int32) { + return m.runner_id +} +// GetRunnerName gets the runner_name property value. The name of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +// returns a *string when successful +func (m *Job) GetRunnerName()(*string) { + return m.runner_name +} +// GetRunUrl gets the run_url property value. The run_url property +// returns a *string when successful +func (m *Job) GetRunUrl()(*string) { + return m.run_url +} +// GetStartedAt gets the started_at property value. The time that the job started, in ISO 8601 format. +// returns a *Time when successful +func (m *Job) GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.started_at +} +// GetStatus gets the status property value. The phase of the lifecycle that the job is currently in. +// returns a *Job_status when successful +func (m *Job) GetStatus()(*Job_status) { + return m.status +} +// GetSteps gets the steps property value. Steps in this job. +// returns a []Job_stepsable when successful +func (m *Job) GetSteps()([]Job_stepsable) { + return m.steps +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Job) GetUrl()(*string) { + return m.url +} +// GetWorkflowName gets the workflow_name property value. The name of the workflow. +// returns a *string when successful +func (m *Job) GetWorkflowName()(*string) { + return m.workflow_name +} +// Serialize serializes information the current object +func (m *Job) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("check_run_url", m.GetCheckRunUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("completed_at", m.GetCompletedAt()) + if err != nil { + return err + } + } + if m.GetConclusion() != nil { + cast := (*m.GetConclusion()).String() + err := writer.WriteStringValue("conclusion", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_branch", m.GetHeadBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_sha", m.GetHeadSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("runner_group_id", m.GetRunnerGroupId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("runner_group_name", m.GetRunnerGroupName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("runner_id", m.GetRunnerId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("runner_name", m.GetRunnerName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("run_attempt", m.GetRunAttempt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("run_id", m.GetRunId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("run_url", m.GetRunUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("started_at", m.GetStartedAt()) + if err != nil { + return err + } + } + if m.GetStatus() != nil { + cast := (*m.GetStatus()).String() + err := writer.WriteStringValue("status", &cast) + if err != nil { + return err + } + } + if m.GetSteps() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSteps())) + for i, v := range m.GetSteps() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("steps", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("workflow_name", m.GetWorkflowName()) + 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 *Job) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCheckRunUrl sets the check_run_url property value. The check_run_url property +func (m *Job) SetCheckRunUrl(value *string)() { + m.check_run_url = value +} +// SetCompletedAt sets the completed_at property value. The time that the job finished, in ISO 8601 format. +func (m *Job) SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.completed_at = value +} +// SetConclusion sets the conclusion property value. The outcome of the job. +func (m *Job) SetConclusion(value *Job_conclusion)() { + m.conclusion = value +} +// SetCreatedAt sets the created_at property value. The time that the job created, in ISO 8601 format. +func (m *Job) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHeadBranch sets the head_branch property value. The name of the current branch. +func (m *Job) SetHeadBranch(value *string)() { + m.head_branch = value +} +// SetHeadSha sets the head_sha property value. The SHA of the commit that is being run. +func (m *Job) SetHeadSha(value *string)() { + m.head_sha = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Job) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id of the job. +func (m *Job) SetId(value *int32)() { + m.id = value +} +// SetLabels sets the labels property value. Labels for the workflow job. Specified by the "runs_on" attribute in the action's workflow file. +func (m *Job) SetLabels(value []string)() { + m.labels = value +} +// SetName sets the name property value. The name of the job. +func (m *Job) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Job) SetNodeId(value *string)() { + m.node_id = value +} +// SetRunAttempt sets the run_attempt property value. Attempt number of the associated workflow run, 1 for first attempt and higher if the workflow was re-run. +func (m *Job) SetRunAttempt(value *int32)() { + m.run_attempt = value +} +// SetRunId sets the run_id property value. The id of the associated workflow run. +func (m *Job) SetRunId(value *int32)() { + m.run_id = value +} +// SetRunnerGroupId sets the runner_group_id property value. The ID of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +func (m *Job) SetRunnerGroupId(value *int32)() { + m.runner_group_id = value +} +// SetRunnerGroupName sets the runner_group_name property value. The name of the runner group to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +func (m *Job) SetRunnerGroupName(value *string)() { + m.runner_group_name = value +} +// SetRunnerId sets the runner_id property value. The ID of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +func (m *Job) SetRunnerId(value *int32)() { + m.runner_id = value +} +// SetRunnerName sets the runner_name property value. The name of the runner to which this job has been assigned. (If a runner hasn't yet been assigned, this will be null.) +func (m *Job) SetRunnerName(value *string)() { + m.runner_name = value +} +// SetRunUrl sets the run_url property value. The run_url property +func (m *Job) SetRunUrl(value *string)() { + m.run_url = value +} +// SetStartedAt sets the started_at property value. The time that the job started, in ISO 8601 format. +func (m *Job) SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.started_at = value +} +// SetStatus sets the status property value. The phase of the lifecycle that the job is currently in. +func (m *Job) SetStatus(value *Job_status)() { + m.status = value +} +// SetSteps sets the steps property value. Steps in this job. +func (m *Job) SetSteps(value []Job_stepsable)() { + m.steps = value +} +// SetUrl sets the url property value. The url property +func (m *Job) SetUrl(value *string)() { + m.url = value +} +// SetWorkflowName sets the workflow_name property value. The name of the workflow. +func (m *Job) SetWorkflowName(value *string)() { + m.workflow_name = value +} +type Jobable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCheckRunUrl()(*string) + GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetConclusion()(*Job_conclusion) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHeadBranch()(*string) + GetHeadSha()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLabels()([]string) + GetName()(*string) + GetNodeId()(*string) + GetRunAttempt()(*int32) + GetRunId()(*int32) + GetRunnerGroupId()(*int32) + GetRunnerGroupName()(*string) + GetRunnerId()(*int32) + GetRunnerName()(*string) + GetRunUrl()(*string) + GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetStatus()(*Job_status) + GetSteps()([]Job_stepsable) + GetUrl()(*string) + GetWorkflowName()(*string) + SetCheckRunUrl(value *string)() + SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetConclusion(value *Job_conclusion)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHeadBranch(value *string)() + SetHeadSha(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLabels(value []string)() + SetName(value *string)() + SetNodeId(value *string)() + SetRunAttempt(value *int32)() + SetRunId(value *int32)() + SetRunnerGroupId(value *int32)() + SetRunnerGroupName(value *string)() + SetRunnerId(value *int32)() + SetRunnerName(value *string)() + SetRunUrl(value *string)() + SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetStatus(value *Job_status)() + SetSteps(value []Job_stepsable)() + SetUrl(value *string)() + SetWorkflowName(value *string)() +} diff --git a/pkg/github/models/job_escaped_conclusion.go b/pkg/github/models/job_escaped_conclusion.go new file mode 100644 index 00000000..3c573f4f --- /dev/null +++ b/pkg/github/models/job_escaped_conclusion.go @@ -0,0 +1,49 @@ +package models +// The outcome of the job. +type Job_conclusion int + +const ( + SUCCESS_JOB_CONCLUSION Job_conclusion = iota + FAILURE_JOB_CONCLUSION + NEUTRAL_JOB_CONCLUSION + CANCELLED_JOB_CONCLUSION + SKIPPED_JOB_CONCLUSION + TIMED_OUT_JOB_CONCLUSION + ACTION_REQUIRED_JOB_CONCLUSION +) + +func (i Job_conclusion) String() string { + return []string{"success", "failure", "neutral", "cancelled", "skipped", "timed_out", "action_required"}[i] +} +func ParseJob_conclusion(v string) (any, error) { + result := SUCCESS_JOB_CONCLUSION + switch v { + case "success": + result = SUCCESS_JOB_CONCLUSION + case "failure": + result = FAILURE_JOB_CONCLUSION + case "neutral": + result = NEUTRAL_JOB_CONCLUSION + case "cancelled": + result = CANCELLED_JOB_CONCLUSION + case "skipped": + result = SKIPPED_JOB_CONCLUSION + case "timed_out": + result = TIMED_OUT_JOB_CONCLUSION + case "action_required": + result = ACTION_REQUIRED_JOB_CONCLUSION + default: + return nil, nil + } + return &result, nil +} +func SerializeJob_conclusion(values []Job_conclusion) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Job_conclusion) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/job_escaped_status.go b/pkg/github/models/job_escaped_status.go new file mode 100644 index 00000000..364598d5 --- /dev/null +++ b/pkg/github/models/job_escaped_status.go @@ -0,0 +1,46 @@ +package models +// The phase of the lifecycle that the job is currently in. +type Job_status int + +const ( + QUEUED_JOB_STATUS Job_status = iota + IN_PROGRESS_JOB_STATUS + COMPLETED_JOB_STATUS + WAITING_JOB_STATUS + REQUESTED_JOB_STATUS + PENDING_JOB_STATUS +) + +func (i Job_status) String() string { + return []string{"queued", "in_progress", "completed", "waiting", "requested", "pending"}[i] +} +func ParseJob_status(v string) (any, error) { + result := QUEUED_JOB_STATUS + switch v { + case "queued": + result = QUEUED_JOB_STATUS + case "in_progress": + result = IN_PROGRESS_JOB_STATUS + case "completed": + result = COMPLETED_JOB_STATUS + case "waiting": + result = WAITING_JOB_STATUS + case "requested": + result = REQUESTED_JOB_STATUS + case "pending": + result = PENDING_JOB_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeJob_status(values []Job_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Job_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/job_escaped_steps.go b/pkg/github/models/job_escaped_steps.go new file mode 100644 index 00000000..cc926427 --- /dev/null +++ b/pkg/github/models/job_escaped_steps.go @@ -0,0 +1,227 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Job_steps struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the job finished, in ISO 8601 format. + completed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The outcome of the job. + conclusion *string + // The name of the job. + name *string + // The number property + number *int32 + // The time that the step started, in ISO 8601 format. + started_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The phase of the lifecycle that the job is currently in. + status *Job_steps_status +} +// NewJob_steps instantiates a new Job_steps and sets the default values. +func NewJob_steps()(*Job_steps) { + m := &Job_steps{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateJob_stepsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateJob_stepsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewJob_steps(), 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 *Job_steps) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCompletedAt gets the completed_at property value. The time that the job finished, in ISO 8601 format. +// returns a *Time when successful +func (m *Job_steps) GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.completed_at +} +// GetConclusion gets the conclusion property value. The outcome of the job. +// returns a *string when successful +func (m *Job_steps) GetConclusion()(*string) { + return m.conclusion +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Job_steps) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["completed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetCompletedAt(val) + } + return nil + } + res["conclusion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetConclusion(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["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(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(ParseJob_steps_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*Job_steps_status)) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the job. +// returns a *string when successful +func (m *Job_steps) GetName()(*string) { + return m.name +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *Job_steps) GetNumber()(*int32) { + return m.number +} +// GetStartedAt gets the started_at property value. The time that the step started, in ISO 8601 format. +// returns a *Time when successful +func (m *Job_steps) GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.started_at +} +// GetStatus gets the status property value. The phase of the lifecycle that the job is currently in. +// returns a *Job_steps_status when successful +func (m *Job_steps) GetStatus()(*Job_steps_status) { + return m.status +} +// Serialize serializes information the current object +func (m *Job_steps) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("completed_at", m.GetCompletedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("conclusion", m.GetConclusion()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("started_at", m.GetStartedAt()) + 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 *Job_steps) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCompletedAt sets the completed_at property value. The time that the job finished, in ISO 8601 format. +func (m *Job_steps) SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.completed_at = value +} +// SetConclusion sets the conclusion property value. The outcome of the job. +func (m *Job_steps) SetConclusion(value *string)() { + m.conclusion = value +} +// SetName sets the name property value. The name of the job. +func (m *Job_steps) SetName(value *string)() { + m.name = value +} +// SetNumber sets the number property value. The number property +func (m *Job_steps) SetNumber(value *int32)() { + m.number = value +} +// SetStartedAt sets the started_at property value. The time that the step started, in ISO 8601 format. +func (m *Job_steps) SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.started_at = value +} +// SetStatus sets the status property value. The phase of the lifecycle that the job is currently in. +func (m *Job_steps) SetStatus(value *Job_steps_status)() { + m.status = value +} +type Job_stepsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCompletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetConclusion()(*string) + GetName()(*string) + GetNumber()(*int32) + GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetStatus()(*Job_steps_status) + SetCompletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetConclusion(value *string)() + SetName(value *string)() + SetNumber(value *int32)() + SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetStatus(value *Job_steps_status)() +} diff --git a/pkg/github/models/job_escaped_steps_escaped_status.go b/pkg/github/models/job_escaped_steps_escaped_status.go new file mode 100644 index 00000000..a06fa003 --- /dev/null +++ b/pkg/github/models/job_escaped_steps_escaped_status.go @@ -0,0 +1,37 @@ +package models +// The phase of the lifecycle that the job is currently in. +type Job_steps_status int + +const ( + QUEUED_JOB_STEPS_STATUS Job_steps_status = iota + IN_PROGRESS_JOB_STEPS_STATUS + COMPLETED_JOB_STEPS_STATUS +) + +func (i Job_steps_status) String() string { + return []string{"queued", "in_progress", "completed"}[i] +} +func ParseJob_steps_status(v string) (any, error) { + result := QUEUED_JOB_STEPS_STATUS + switch v { + case "queued": + result = QUEUED_JOB_STEPS_STATUS + case "in_progress": + result = IN_PROGRESS_JOB_STEPS_STATUS + case "completed": + result = COMPLETED_JOB_STEPS_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeJob_steps_status(values []Job_steps_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Job_steps_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/key.go b/pkg/github/models/key.go new file mode 100644 index 00000000..0ab58bcc --- /dev/null +++ b/pkg/github/models/key.go @@ -0,0 +1,256 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Key key +type Key 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 id property + id *int64 + // The key property + key *string + // The read_only property + read_only *bool + // The title property + title *string + // The url property + url *string + // The verified property + verified *bool +} +// NewKey instantiates a new Key and sets the default values. +func NewKey()(*Key) { + m := &Key{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewKey(), 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 *Key) 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 *Key) 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 *Key) 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + 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["read_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetReadOnly(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *Key) GetId()(*int64) { + return m.id +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *Key) GetKey()(*string) { + return m.key +} +// GetReadOnly gets the read_only property value. The read_only property +// returns a *bool when successful +func (m *Key) GetReadOnly()(*bool) { + return m.read_only +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *Key) GetTitle()(*string) { + return m.title +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Key) GetUrl()(*string) { + return m.url +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *Key) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *Key) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("read_only", m.GetReadOnly()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + 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 *Key) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Key) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *Key) SetId(value *int64)() { + m.id = value +} +// SetKey sets the key property value. The key property +func (m *Key) SetKey(value *string)() { + m.key = value +} +// SetReadOnly sets the read_only property value. The read_only property +func (m *Key) SetReadOnly(value *bool)() { + m.read_only = value +} +// SetTitle sets the title property value. The title property +func (m *Key) SetTitle(value *string)() { + m.title = value +} +// SetUrl sets the url property value. The url property +func (m *Key) SetUrl(value *string)() { + m.url = value +} +// SetVerified sets the verified property value. The verified property +func (m *Key) SetVerified(value *bool)() { + m.verified = value +} +type Keyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int64) + GetKey()(*string) + GetReadOnly()(*bool) + GetTitle()(*string) + GetUrl()(*string) + GetVerified()(*bool) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int64)() + SetKey(value *string)() + SetReadOnly(value *bool)() + SetTitle(value *string)() + SetUrl(value *string)() + SetVerified(value *bool)() +} diff --git a/pkg/github/models/key_simple.go b/pkg/github/models/key_simple.go new file mode 100644 index 00000000..0dfbdac0 --- /dev/null +++ b/pkg/github/models/key_simple.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// KeySimple key Simple +type KeySimple struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // The key property + key *string +} +// NewKeySimple instantiates a new KeySimple and sets the default values. +func NewKeySimple()(*KeySimple) { + m := &KeySimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateKeySimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateKeySimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewKeySimple(), 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 *KeySimple) 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 *KeySimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKey(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *KeySimple) GetId()(*int32) { + return m.id +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *KeySimple) GetKey()(*string) { + return m.key +} +// Serialize serializes information the current object +func (m *KeySimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + 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 *KeySimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *KeySimple) SetId(value *int32)() { + m.id = value +} +// SetKey sets the key property value. The key property +func (m *KeySimple) SetKey(value *string)() { + m.key = value +} +type KeySimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetKey()(*string) + SetId(value *int32)() + SetKey(value *string)() +} diff --git a/pkg/github/models/label.go b/pkg/github/models/label.go new file mode 100644 index 00000000..82986b47 --- /dev/null +++ b/pkg/github/models/label.go @@ -0,0 +1,255 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Label color-coded labels help you categorize and filter your issues (just like labels in Gmail). +type Label struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // 6-character hex code, without the leading #, identifying the color + color *string + // Whether this label comes by default in a new repository. + defaultEscaped *bool + // Optional description of the label, such as its purpose. + description *string + // Unique identifier for the label. + id *int64 + // The name of the label. + name *string + // The node_id property + node_id *string + // URL for the label + url *string +} +// NewLabel instantiates a new Label and sets the default values. +func NewLabel()(*Label) { + m := &Label{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLabelFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabelFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabel(), 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 *Label) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. 6-character hex code, without the leading #, identifying the color +// returns a *string when successful +func (m *Label) GetColor()(*string) { + return m.color +} +// GetDefaultEscaped gets the default property value. Whether this label comes by default in a new repository. +// returns a *bool when successful +func (m *Label) GetDefaultEscaped()(*bool) { + return m.defaultEscaped +} +// GetDescription gets the description property value. Optional description of the label, such as its purpose. +// returns a *string when successful +func (m *Label) 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 *Label) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultEscaped(val) + } + 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier for the label. +// returns a *int64 when successful +func (m *Label) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name of the label. +// returns a *string when successful +func (m *Label) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Label) GetNodeId()(*string) { + return m.node_id +} +// GetUrl gets the url property value. URL for the label +// returns a *string when successful +func (m *Label) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Label) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("default", m.GetDefaultEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Label) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. 6-character hex code, without the leading #, identifying the color +func (m *Label) SetColor(value *string)() { + m.color = value +} +// SetDefaultEscaped sets the default property value. Whether this label comes by default in a new repository. +func (m *Label) SetDefaultEscaped(value *bool)() { + m.defaultEscaped = value +} +// SetDescription sets the description property value. Optional description of the label, such as its purpose. +func (m *Label) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. Unique identifier for the label. +func (m *Label) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name of the label. +func (m *Label) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Label) SetNodeId(value *string)() { + m.node_id = value +} +// SetUrl sets the url property value. URL for the label +func (m *Label) SetUrl(value *string)() { + m.url = value +} +type Labelable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetDefaultEscaped()(*bool) + GetDescription()(*string) + GetId()(*int64) + GetName()(*string) + GetNodeId()(*string) + GetUrl()(*string) + SetColor(value *string)() + SetDefaultEscaped(value *bool)() + SetDescription(value *string)() + SetId(value *int64)() + SetName(value *string)() + SetNodeId(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/label_search_result_item.go b/pkg/github/models/label_search_result_item.go new file mode 100644 index 00000000..be1ea866 --- /dev/null +++ b/pkg/github/models/label_search_result_item.go @@ -0,0 +1,325 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// LabelSearchResultItem label Search Result Item +type LabelSearchResultItem 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 color property + color *string + // The default property + defaultEscaped *bool + // The description property + description *string + // The id property + id *int32 + // The name property + name *string + // The node_id property + node_id *string + // The score property + score *float64 + // The text_matches property + text_matches []Labelsable + // The url property + url *string +} +// NewLabelSearchResultItem instantiates a new LabelSearchResultItem and sets the default values. +func NewLabelSearchResultItem()(*LabelSearchResultItem) { + m := &LabelSearchResultItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLabelSearchResultItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabelSearchResultItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabelSearchResultItem(), 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 *LabelSearchResultItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The color property +// returns a *string when successful +func (m *LabelSearchResultItem) GetColor()(*string) { + return m.color +} +// GetDefaultEscaped gets the default property value. The default property +// returns a *bool when successful +func (m *LabelSearchResultItem) GetDefaultEscaped()(*bool) { + return m.defaultEscaped +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *LabelSearchResultItem) 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 *LabelSearchResultItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultEscaped(val) + } + 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["text_matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateLabelsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Labelsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Labelsable) + } + } + m.SetTextMatches(res) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *LabelSearchResultItem) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *LabelSearchResultItem) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *LabelSearchResultItem) GetNodeId()(*string) { + return m.node_id +} +// GetScore gets the score property value. The score property +// returns a *float64 when successful +func (m *LabelSearchResultItem) GetScore()(*float64) { + return m.score +} +// GetTextMatches gets the text_matches property value. The text_matches property +// returns a []Labelsable when successful +func (m *LabelSearchResultItem) GetTextMatches()([]Labelsable) { + return m.text_matches +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *LabelSearchResultItem) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *LabelSearchResultItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("default", m.GetDefaultEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("score", m.GetScore()) + if err != nil { + return err + } + } + if m.GetTextMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTextMatches())) + for i, v := range m.GetTextMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("text_matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *LabelSearchResultItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The color property +func (m *LabelSearchResultItem) SetColor(value *string)() { + m.color = value +} +// SetDefaultEscaped sets the default property value. The default property +func (m *LabelSearchResultItem) SetDefaultEscaped(value *bool)() { + m.defaultEscaped = value +} +// SetDescription sets the description property value. The description property +func (m *LabelSearchResultItem) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The id property +func (m *LabelSearchResultItem) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *LabelSearchResultItem) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *LabelSearchResultItem) SetNodeId(value *string)() { + m.node_id = value +} +// SetScore sets the score property value. The score property +func (m *LabelSearchResultItem) SetScore(value *float64)() { + m.score = value +} +// SetTextMatches sets the text_matches property value. The text_matches property +func (m *LabelSearchResultItem) SetTextMatches(value []Labelsable)() { + m.text_matches = value +} +// SetUrl sets the url property value. The url property +func (m *LabelSearchResultItem) SetUrl(value *string)() { + m.url = value +} +type LabelSearchResultItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetDefaultEscaped()(*bool) + GetDescription()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetScore()(*float64) + GetTextMatches()([]Labelsable) + GetUrl()(*string) + SetColor(value *string)() + SetDefaultEscaped(value *bool)() + SetDescription(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetScore(value *float64)() + SetTextMatches(value []Labelsable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/labeled_issue_event.go b/pkg/github/models/labeled_issue_event.go new file mode 100644 index 00000000..414317d4 --- /dev/null +++ b/pkg/github/models/labeled_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// LabeledIssueEvent labeled Issue Event +type LabeledIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The label property + label LabeledIssueEvent_labelable + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewLabeledIssueEvent instantiates a new LabeledIssueEvent and sets the default values. +func NewLabeledIssueEvent()(*LabeledIssueEvent) { + m := &LabeledIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLabeledIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabeledIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabeledIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *LabeledIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *LabeledIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *LabeledIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *LabeledIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *LabeledIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *LabeledIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LabeledIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLabeledIssueEvent_labelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLabel(val.(LabeledIssueEvent_labelable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *LabeledIssueEvent) GetId()(*int32) { + return m.id +} +// GetLabel gets the label property value. The label property +// returns a LabeledIssueEvent_labelable when successful +func (m *LabeledIssueEvent) GetLabel()(LabeledIssueEvent_labelable) { + return m.label +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *LabeledIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *LabeledIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *LabeledIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *LabeledIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *LabeledIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *LabeledIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *LabeledIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *LabeledIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *LabeledIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *LabeledIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *LabeledIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetLabel sets the label property value. The label property +func (m *LabeledIssueEvent) SetLabel(value LabeledIssueEvent_labelable)() { + m.label = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *LabeledIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *LabeledIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *LabeledIssueEvent) SetUrl(value *string)() { + m.url = value +} +type LabeledIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetLabel()(LabeledIssueEvent_labelable) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetLabel(value LabeledIssueEvent_labelable)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/labeled_issue_event_escaped_label.go b/pkg/github/models/labeled_issue_event_escaped_label.go new file mode 100644 index 00000000..07147d27 --- /dev/null +++ b/pkg/github/models/labeled_issue_event_escaped_label.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type LabeledIssueEvent_label 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 color property + color *string + // The name property + name *string +} +// NewLabeledIssueEvent_label instantiates a new LabeledIssueEvent_label and sets the default values. +func NewLabeledIssueEvent_label()(*LabeledIssueEvent_label) { + m := &LabeledIssueEvent_label{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLabeledIssueEvent_labelFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabeledIssueEvent_labelFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabeledIssueEvent_label(), 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 *LabeledIssueEvent_label) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The color property +// returns a *string when successful +func (m *LabeledIssueEvent_label) GetColor()(*string) { + return m.color +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LabeledIssueEvent_label) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(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 property +// returns a *string when successful +func (m *LabeledIssueEvent_label) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *LabeledIssueEvent_label) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *LabeledIssueEvent_label) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The color property +func (m *LabeledIssueEvent_label) SetColor(value *string)() { + m.color = value +} +// SetName sets the name property value. The name property +func (m *LabeledIssueEvent_label) SetName(value *string)() { + m.name = value +} +type LabeledIssueEvent_labelable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetName()(*string) + SetColor(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/labels.go b/pkg/github/models/labels.go new file mode 100644 index 00000000..03d0d7f0 --- /dev/null +++ b/pkg/github/models/labels.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Labels struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The fragment property + fragment *string + // The matches property + matches []Labels_matchesable + // The object_type property + object_type *string + // The object_url property + object_url *string + // The property property + property *string +} +// NewLabels instantiates a new Labels and sets the default values. +func NewLabels()(*Labels) { + m := &Labels{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLabelsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabelsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabels(), 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 *Labels) 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 *Labels) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fragment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFragment(val) + } + return nil + } + res["matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateLabels_matchesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Labels_matchesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Labels_matchesable) + } + } + m.SetMatches(res) + } + return nil + } + res["object_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectType(val) + } + return nil + } + res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectUrl(val) + } + return nil + } + res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProperty(val) + } + return nil + } + return res +} +// GetFragment gets the fragment property value. The fragment property +// returns a *string when successful +func (m *Labels) GetFragment()(*string) { + return m.fragment +} +// GetMatches gets the matches property value. The matches property +// returns a []Labels_matchesable when successful +func (m *Labels) GetMatches()([]Labels_matchesable) { + return m.matches +} +// GetObjectType gets the object_type property value. The object_type property +// returns a *string when successful +func (m *Labels) GetObjectType()(*string) { + return m.object_type +} +// GetObjectUrl gets the object_url property value. The object_url property +// returns a *string when successful +func (m *Labels) GetObjectUrl()(*string) { + return m.object_url +} +// GetProperty gets the property property value. The property property +// returns a *string when successful +func (m *Labels) GetProperty()(*string) { + return m.property +} +// Serialize serializes information the current object +func (m *Labels) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("fragment", m.GetFragment()) + if err != nil { + return err + } + } + if m.GetMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMatches())) + for i, v := range m.GetMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_type", m.GetObjectType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_url", m.GetObjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("property", m.GetProperty()) + 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 *Labels) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFragment sets the fragment property value. The fragment property +func (m *Labels) SetFragment(value *string)() { + m.fragment = value +} +// SetMatches sets the matches property value. The matches property +func (m *Labels) SetMatches(value []Labels_matchesable)() { + m.matches = value +} +// SetObjectType sets the object_type property value. The object_type property +func (m *Labels) SetObjectType(value *string)() { + m.object_type = value +} +// SetObjectUrl sets the object_url property value. The object_url property +func (m *Labels) SetObjectUrl(value *string)() { + m.object_url = value +} +// SetProperty sets the property property value. The property property +func (m *Labels) SetProperty(value *string)() { + m.property = value +} +type Labelsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFragment()(*string) + GetMatches()([]Labels_matchesable) + GetObjectType()(*string) + GetObjectUrl()(*string) + GetProperty()(*string) + SetFragment(value *string)() + SetMatches(value []Labels_matchesable)() + SetObjectType(value *string)() + SetObjectUrl(value *string)() + SetProperty(value *string)() +} diff --git a/pkg/github/models/labels_escaped_matches.go b/pkg/github/models/labels_escaped_matches.go new file mode 100644 index 00000000..d8ee8204 --- /dev/null +++ b/pkg/github/models/labels_escaped_matches.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Labels_matches struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The indices property + indices []int32 + // The text property + text *string +} +// NewLabels_matches instantiates a new Labels_matches and sets the default values. +func NewLabels_matches()(*Labels_matches) { + m := &Labels_matches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLabels_matchesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabels_matchesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabels_matches(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Labels_matches) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Labels_matches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["indices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetIndices(res) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetIndices gets the indices property value. The indices property +// returns a []int32 when successful +func (m *Labels_matches) GetIndices()([]int32) { + return m.indices +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *Labels_matches) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *Labels_matches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIndices() != nil { + err := writer.WriteCollectionOfInt32Values("indices", m.GetIndices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *Labels_matches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIndices sets the indices property value. The indices property +func (m *Labels_matches) SetIndices(value []int32)() { + m.indices = value +} +// SetText sets the text property value. The text property +func (m *Labels_matches) SetText(value *string)() { + m.text = value +} +type Labels_matchesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIndices()([]int32) + GetText()(*string) + SetIndices(value []int32)() + SetText(value *string)() +} diff --git a/pkg/github/models/language.go b/pkg/github/models/language.go new file mode 100644 index 00000000..8ac27c3e --- /dev/null +++ b/pkg/github/models/language.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Language language +type Language struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewLanguage instantiates a new Language and sets the default values. +func NewLanguage()(*Language) { + m := &Language{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLanguageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLanguageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLanguage(), 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 *Language) 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 *Language) 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 *Language) 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 *Language) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type Languageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/ldap_mapping_team.go b/pkg/github/models/ldap_mapping_team.go new file mode 100644 index 00000000..bbfe0e03 --- /dev/null +++ b/pkg/github/models/ldap_mapping_team.go @@ -0,0 +1,457 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type LdapMappingTeam 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 property + description *string + // The html_url property + html_url *string + // The id property + id *int32 + // The ldap_dn property + ldap_dn *string + // The members_url property + members_url *string + // The name property + name *string + // The node_id property + node_id *string + // The notification_setting property + notification_setting *string + // The parent property + parent i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable + // The permission property + permission *string + // The privacy property + privacy *string + // The repositories_url property + repositories_url *string + // The slug property + slug *string + // The url property + url *string +} +// NewLdapMappingTeam instantiates a new LdapMappingTeam and sets the default values. +func NewLdapMappingTeam()(*LdapMappingTeam) { + m := &LdapMappingTeam{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLdapMappingTeamFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLdapMappingTeamFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLdapMappingTeam(), 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 *LdapMappingTeam) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *LdapMappingTeam) 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 *LdapMappingTeam) 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["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["ldap_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLdapDn(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationSetting(val) + } + return nil + } + res["parent"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParent(val.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)) + } + return nil + } + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["privacy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivacy(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *LdapMappingTeam) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *LdapMappingTeam) GetId()(*int32) { + return m.id +} +// GetLdapDn gets the ldap_dn property value. The ldap_dn property +// returns a *string when successful +func (m *LdapMappingTeam) GetLdapDn()(*string) { + return m.ldap_dn +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *LdapMappingTeam) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *LdapMappingTeam) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *LdapMappingTeam) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationSetting gets the notification_setting property value. The notification_setting property +// returns a *string when successful +func (m *LdapMappingTeam) GetNotificationSetting()(*string) { + return m.notification_setting +} +// GetParent gets the parent property value. The parent property +// returns a UntypedNodeable when successful +func (m *LdapMappingTeam) GetParent()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) { + return m.parent +} +// GetPermission gets the permission property value. The permission property +// returns a *string when successful +func (m *LdapMappingTeam) GetPermission()(*string) { + return m.permission +} +// GetPrivacy gets the privacy property value. The privacy property +// returns a *string when successful +func (m *LdapMappingTeam) GetPrivacy()(*string) { + return m.privacy +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *LdapMappingTeam) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *LdapMappingTeam) GetSlug()(*string) { + return m.slug +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *LdapMappingTeam) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *LdapMappingTeam) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ldap_dn", m.GetLdapDn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_setting", m.GetNotificationSetting()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("parent", m.GetParent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("privacy", m.GetPrivacy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *LdapMappingTeam) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description property +func (m *LdapMappingTeam) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *LdapMappingTeam) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *LdapMappingTeam) SetId(value *int32)() { + m.id = value +} +// SetLdapDn sets the ldap_dn property value. The ldap_dn property +func (m *LdapMappingTeam) SetLdapDn(value *string)() { + m.ldap_dn = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *LdapMappingTeam) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. The name property +func (m *LdapMappingTeam) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *LdapMappingTeam) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationSetting sets the notification_setting property value. The notification_setting property +func (m *LdapMappingTeam) SetNotificationSetting(value *string)() { + m.notification_setting = value +} +// SetParent sets the parent property value. The parent property +func (m *LdapMappingTeam) SetParent(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() { + m.parent = value +} +// SetPermission sets the permission property value. The permission property +func (m *LdapMappingTeam) SetPermission(value *string)() { + m.permission = value +} +// SetPrivacy sets the privacy property value. The privacy property +func (m *LdapMappingTeam) SetPrivacy(value *string)() { + m.privacy = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *LdapMappingTeam) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetSlug sets the slug property value. The slug property +func (m *LdapMappingTeam) SetSlug(value *string)() { + m.slug = value +} +// SetUrl sets the url property value. The url property +func (m *LdapMappingTeam) SetUrl(value *string)() { + m.url = value +} +type LdapMappingTeamable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLdapDn()(*string) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationSetting()(*string) + GetParent()(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable) + GetPermission()(*string) + GetPrivacy()(*string) + GetRepositoriesUrl()(*string) + GetSlug()(*string) + GetUrl()(*string) + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLdapDn(value *string)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationSetting(value *string)() + SetParent(value i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable)() + SetPermission(value *string)() + SetPrivacy(value *string)() + SetRepositoriesUrl(value *string)() + SetSlug(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/ldap_mapping_user.go b/pkg/github/models/ldap_mapping_user.go new file mode 100644 index 00000000..0b6dda04 --- /dev/null +++ b/pkg/github/models/ldap_mapping_user.go @@ -0,0 +1,1271 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// LdapMappingUser ldap Private User +type LdapMappingUser 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 avatar_url property + avatar_url *string + // The bio property + bio *string + // The blog property + blog *string + // The business_plus property + business_plus *bool + // The collaborators property + collaborators *int32 + // The company property + company *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The disk_usage property + disk_usage *int32 + // The email property + email *string + // The events_url property + events_url *string + // The followers property + followers *int32 + // The followers_url property + followers_url *string + // The following property + following *int32 + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The hireable property + hireable *bool + // The html_url property + html_url *string + // The id property + id *int64 + // The ldap_dn property + ldap_dn *string + // The location property + location *string + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The owned_private_repos property + owned_private_repos *int32 + // The plan property + plan LdapMappingUser_planable + // The private_gists property + private_gists *int32 + // The public_gists property + public_gists *int32 + // The public_repos property + public_repos *int32 + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The suspended_at property + suspended_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The total_private_repos property + total_private_repos *int32 + // The twitter_username property + twitter_username *string + // The two_factor_authentication property + two_factor_authentication *bool + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewLdapMappingUser instantiates a new LdapMappingUser and sets the default values. +func NewLdapMappingUser()(*LdapMappingUser) { + m := &LdapMappingUser{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLdapMappingUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLdapMappingUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLdapMappingUser(), 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 *LdapMappingUser) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *LdapMappingUser) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetBio gets the bio property value. The bio property +// returns a *string when successful +func (m *LdapMappingUser) GetBio()(*string) { + return m.bio +} +// GetBlog gets the blog property value. The blog property +// returns a *string when successful +func (m *LdapMappingUser) GetBlog()(*string) { + return m.blog +} +// GetBusinessPlus gets the business_plus property value. The business_plus property +// returns a *bool when successful +func (m *LdapMappingUser) GetBusinessPlus()(*bool) { + return m.business_plus +} +// GetCollaborators gets the collaborators property value. The collaborators property +// returns a *int32 when successful +func (m *LdapMappingUser) GetCollaborators()(*int32) { + return m.collaborators +} +// GetCompany gets the company property value. The company property +// returns a *string when successful +func (m *LdapMappingUser) GetCompany()(*string) { + return m.company +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *LdapMappingUser) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDiskUsage gets the disk_usage property value. The disk_usage property +// returns a *int32 when successful +func (m *LdapMappingUser) GetDiskUsage()(*int32) { + return m.disk_usage +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *LdapMappingUser) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *LdapMappingUser) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LdapMappingUser) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["bio"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBio(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["business_plus"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetBusinessPlus(val) + } + return nil + } + res["collaborators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCollaborators(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + 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["disk_usage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDiskUsage(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowers(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowing(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["hireable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHireable(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["ldap_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLdapDn(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["owned_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOwnedPrivateRepos(val) + } + return nil + } + res["plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLdapMappingUser_planFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPlan(val.(LdapMappingUser_planable)) + } + return nil + } + res["private_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateGists(val) + } + return nil + } + res["public_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicGists(val) + } + return nil + } + res["public_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicRepos(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["suspended_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetSuspendedAt(val) + } + return nil + } + res["total_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPrivateRepos(val) + } + return nil + } + res["twitter_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTwitterUsername(val) + } + return nil + } + res["two_factor_authentication"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTwoFactorAuthentication(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowers gets the followers property value. The followers property +// returns a *int32 when successful +func (m *LdapMappingUser) GetFollowers()(*int32) { + return m.followers +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *LdapMappingUser) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowing gets the following property value. The following property +// returns a *int32 when successful +func (m *LdapMappingUser) GetFollowing()(*int32) { + return m.following +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *LdapMappingUser) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *LdapMappingUser) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *LdapMappingUser) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHireable gets the hireable property value. The hireable property +// returns a *bool when successful +func (m *LdapMappingUser) GetHireable()(*bool) { + return m.hireable +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *LdapMappingUser) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *LdapMappingUser) GetId()(*int64) { + return m.id +} +// GetLdapDn gets the ldap_dn property value. The ldap_dn property +// returns a *string when successful +func (m *LdapMappingUser) GetLdapDn()(*string) { + return m.ldap_dn +} +// GetLocation gets the location property value. The location property +// returns a *string when successful +func (m *LdapMappingUser) GetLocation()(*string) { + return m.location +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *LdapMappingUser) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *LdapMappingUser) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *LdapMappingUser) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *LdapMappingUser) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetOwnedPrivateRepos gets the owned_private_repos property value. The owned_private_repos property +// returns a *int32 when successful +func (m *LdapMappingUser) GetOwnedPrivateRepos()(*int32) { + return m.owned_private_repos +} +// GetPlan gets the plan property value. The plan property +// returns a LdapMappingUser_planable when successful +func (m *LdapMappingUser) GetPlan()(LdapMappingUser_planable) { + return m.plan +} +// GetPrivateGists gets the private_gists property value. The private_gists property +// returns a *int32 when successful +func (m *LdapMappingUser) GetPrivateGists()(*int32) { + return m.private_gists +} +// GetPublicGists gets the public_gists property value. The public_gists property +// returns a *int32 when successful +func (m *LdapMappingUser) GetPublicGists()(*int32) { + return m.public_gists +} +// GetPublicRepos gets the public_repos property value. The public_repos property +// returns a *int32 when successful +func (m *LdapMappingUser) GetPublicRepos()(*int32) { + return m.public_repos +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *LdapMappingUser) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *LdapMappingUser) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *LdapMappingUser) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *LdapMappingUser) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *LdapMappingUser) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetSuspendedAt gets the suspended_at property value. The suspended_at property +// returns a *Time when successful +func (m *LdapMappingUser) GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.suspended_at +} +// GetTotalPrivateRepos gets the total_private_repos property value. The total_private_repos property +// returns a *int32 when successful +func (m *LdapMappingUser) GetTotalPrivateRepos()(*int32) { + return m.total_private_repos +} +// GetTwitterUsername gets the twitter_username property value. The twitter_username property +// returns a *string when successful +func (m *LdapMappingUser) GetTwitterUsername()(*string) { + return m.twitter_username +} +// GetTwoFactorAuthentication gets the two_factor_authentication property value. The two_factor_authentication property +// returns a *bool when successful +func (m *LdapMappingUser) GetTwoFactorAuthentication()(*bool) { + return m.two_factor_authentication +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *LdapMappingUser) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *LdapMappingUser) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *LdapMappingUser) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *LdapMappingUser) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("bio", m.GetBio()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("business_plus", m.GetBusinessPlus()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("collaborators", m.GetCollaborators()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("disk_usage", m.GetDiskUsage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("followers", m.GetFollowers()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("following", m.GetFollowing()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("hireable", m.GetHireable()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ldap_dn", m.GetLdapDn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("owned_private_repos", m.GetOwnedPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("plan", m.GetPlan()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_gists", m.GetPrivateGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_gists", m.GetPublicGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_repos", m.GetPublicRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("suspended_at", m.GetSuspendedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_private_repos", m.GetTotalPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("twitter_username", m.GetTwitterUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("two_factor_authentication", m.GetTwoFactorAuthentication()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *LdapMappingUser) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *LdapMappingUser) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetBio sets the bio property value. The bio property +func (m *LdapMappingUser) SetBio(value *string)() { + m.bio = value +} +// SetBlog sets the blog property value. The blog property +func (m *LdapMappingUser) SetBlog(value *string)() { + m.blog = value +} +// SetBusinessPlus sets the business_plus property value. The business_plus property +func (m *LdapMappingUser) SetBusinessPlus(value *bool)() { + m.business_plus = value +} +// SetCollaborators sets the collaborators property value. The collaborators property +func (m *LdapMappingUser) SetCollaborators(value *int32)() { + m.collaborators = value +} +// SetCompany sets the company property value. The company property +func (m *LdapMappingUser) SetCompany(value *string)() { + m.company = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *LdapMappingUser) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDiskUsage sets the disk_usage property value. The disk_usage property +func (m *LdapMappingUser) SetDiskUsage(value *int32)() { + m.disk_usage = value +} +// SetEmail sets the email property value. The email property +func (m *LdapMappingUser) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *LdapMappingUser) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowers sets the followers property value. The followers property +func (m *LdapMappingUser) SetFollowers(value *int32)() { + m.followers = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *LdapMappingUser) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowing sets the following property value. The following property +func (m *LdapMappingUser) SetFollowing(value *int32)() { + m.following = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *LdapMappingUser) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *LdapMappingUser) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *LdapMappingUser) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHireable sets the hireable property value. The hireable property +func (m *LdapMappingUser) SetHireable(value *bool)() { + m.hireable = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *LdapMappingUser) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *LdapMappingUser) SetId(value *int64)() { + m.id = value +} +// SetLdapDn sets the ldap_dn property value. The ldap_dn property +func (m *LdapMappingUser) SetLdapDn(value *string)() { + m.ldap_dn = value +} +// SetLocation sets the location property value. The location property +func (m *LdapMappingUser) SetLocation(value *string)() { + m.location = value +} +// SetLogin sets the login property value. The login property +func (m *LdapMappingUser) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *LdapMappingUser) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *LdapMappingUser) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *LdapMappingUser) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetOwnedPrivateRepos sets the owned_private_repos property value. The owned_private_repos property +func (m *LdapMappingUser) SetOwnedPrivateRepos(value *int32)() { + m.owned_private_repos = value +} +// SetPlan sets the plan property value. The plan property +func (m *LdapMappingUser) SetPlan(value LdapMappingUser_planable)() { + m.plan = value +} +// SetPrivateGists sets the private_gists property value. The private_gists property +func (m *LdapMappingUser) SetPrivateGists(value *int32)() { + m.private_gists = value +} +// SetPublicGists sets the public_gists property value. The public_gists property +func (m *LdapMappingUser) SetPublicGists(value *int32)() { + m.public_gists = value +} +// SetPublicRepos sets the public_repos property value. The public_repos property +func (m *LdapMappingUser) SetPublicRepos(value *int32)() { + m.public_repos = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *LdapMappingUser) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *LdapMappingUser) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *LdapMappingUser) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *LdapMappingUser) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *LdapMappingUser) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetSuspendedAt sets the suspended_at property value. The suspended_at property +func (m *LdapMappingUser) SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.suspended_at = value +} +// SetTotalPrivateRepos sets the total_private_repos property value. The total_private_repos property +func (m *LdapMappingUser) SetTotalPrivateRepos(value *int32)() { + m.total_private_repos = value +} +// SetTwitterUsername sets the twitter_username property value. The twitter_username property +func (m *LdapMappingUser) SetTwitterUsername(value *string)() { + m.twitter_username = value +} +// SetTwoFactorAuthentication sets the two_factor_authentication property value. The two_factor_authentication property +func (m *LdapMappingUser) SetTwoFactorAuthentication(value *bool)() { + m.two_factor_authentication = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *LdapMappingUser) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *LdapMappingUser) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *LdapMappingUser) SetUrl(value *string)() { + m.url = value +} +type LdapMappingUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetBio()(*string) + GetBlog()(*string) + GetBusinessPlus()(*bool) + GetCollaborators()(*int32) + GetCompany()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDiskUsage()(*int32) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowers()(*int32) + GetFollowersUrl()(*string) + GetFollowing()(*int32) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHireable()(*bool) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLdapDn()(*string) + GetLocation()(*string) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetOwnedPrivateRepos()(*int32) + GetPlan()(LdapMappingUser_planable) + GetPrivateGists()(*int32) + GetPublicGists()(*int32) + GetPublicRepos()(*int32) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTotalPrivateRepos()(*int32) + GetTwitterUsername()(*string) + GetTwoFactorAuthentication()(*bool) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetBio(value *string)() + SetBlog(value *string)() + SetBusinessPlus(value *bool)() + SetCollaborators(value *int32)() + SetCompany(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDiskUsage(value *int32)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowers(value *int32)() + SetFollowersUrl(value *string)() + SetFollowing(value *int32)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHireable(value *bool)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLdapDn(value *string)() + SetLocation(value *string)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetOwnedPrivateRepos(value *int32)() + SetPlan(value LdapMappingUser_planable)() + SetPrivateGists(value *int32)() + SetPublicGists(value *int32)() + SetPublicRepos(value *int32)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTotalPrivateRepos(value *int32)() + SetTwitterUsername(value *string)() + SetTwoFactorAuthentication(value *bool)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/ldap_mapping_user_escaped_plan.go b/pkg/github/models/ldap_mapping_user_escaped_plan.go new file mode 100644 index 00000000..e89089ce --- /dev/null +++ b/pkg/github/models/ldap_mapping_user_escaped_plan.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type LdapMappingUser_plan 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 collaborators property + collaborators *int32 + // The name property + name *string + // The private_repos property + private_repos *int32 + // The space property + space *int32 +} +// NewLdapMappingUser_plan instantiates a new LdapMappingUser_plan and sets the default values. +func NewLdapMappingUser_plan()(*LdapMappingUser_plan) { + m := &LdapMappingUser_plan{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLdapMappingUser_planFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLdapMappingUser_planFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLdapMappingUser_plan(), 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 *LdapMappingUser_plan) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCollaborators gets the collaborators property value. The collaborators property +// returns a *int32 when successful +func (m *LdapMappingUser_plan) GetCollaborators()(*int32) { + return m.collaborators +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LdapMappingUser_plan) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["collaborators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCollaborators(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["private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateRepos(val) + } + return nil + } + res["space"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSpace(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *LdapMappingUser_plan) GetName()(*string) { + return m.name +} +// GetPrivateRepos gets the private_repos property value. The private_repos property +// returns a *int32 when successful +func (m *LdapMappingUser_plan) GetPrivateRepos()(*int32) { + return m.private_repos +} +// GetSpace gets the space property value. The space property +// returns a *int32 when successful +func (m *LdapMappingUser_plan) GetSpace()(*int32) { + return m.space +} +// Serialize serializes information the current object +func (m *LdapMappingUser_plan) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("collaborators", m.GetCollaborators()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_repos", m.GetPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("space", m.GetSpace()) + 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 *LdapMappingUser_plan) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCollaborators sets the collaborators property value. The collaborators property +func (m *LdapMappingUser_plan) SetCollaborators(value *int32)() { + m.collaborators = value +} +// SetName sets the name property value. The name property +func (m *LdapMappingUser_plan) SetName(value *string)() { + m.name = value +} +// SetPrivateRepos sets the private_repos property value. The private_repos property +func (m *LdapMappingUser_plan) SetPrivateRepos(value *int32)() { + m.private_repos = value +} +// SetSpace sets the space property value. The space property +func (m *LdapMappingUser_plan) SetSpace(value *int32)() { + m.space = value +} +type LdapMappingUser_planable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCollaborators()(*int32) + GetName()(*string) + GetPrivateRepos()(*int32) + GetSpace()(*int32) + SetCollaborators(value *int32)() + SetName(value *string)() + SetPrivateRepos(value *int32)() + SetSpace(value *int32)() +} diff --git a/pkg/github/models/license.go b/pkg/github/models/license.go new file mode 100644 index 00000000..adb21e66 --- /dev/null +++ b/pkg/github/models/license.go @@ -0,0 +1,447 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// License license +type License 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 body property + body *string + // The conditions property + conditions []string + // The description property + description *string + // The featured property + featured *bool + // The html_url property + html_url *string + // The implementation property + implementation *string + // The key property + key *string + // The limitations property + limitations []string + // The name property + name *string + // The node_id property + node_id *string + // The permissions property + permissions []string + // The spdx_id property + spdx_id *string + // The url property + url *string +} +// NewLicense instantiates a new License and sets the default values. +func NewLicense()(*License) { + m := &License{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLicenseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLicenseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLicense(), 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 *License) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *License) GetBody()(*string) { + return m.body +} +// GetConditions gets the conditions property value. The conditions property +// returns a []string when successful +func (m *License) GetConditions()([]string) { + return m.conditions +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *License) GetDescription()(*string) { + return m.description +} +// GetFeatured gets the featured property value. The featured property +// returns a *bool when successful +func (m *License) GetFeatured()(*bool) { + return m.featured +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *License) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["conditions"] = 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.SetConditions(res) + } + 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["featured"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFeatured(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["implementation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetImplementation(val) + } + return nil + } + 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["limitations"] = 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.SetLimitations(res) + } + 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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["permissions"] = 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.SetPermissions(res) + } + return nil + } + res["spdx_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpdxId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *License) GetHtmlUrl()(*string) { + return m.html_url +} +// GetImplementation gets the implementation property value. The implementation property +// returns a *string when successful +func (m *License) GetImplementation()(*string) { + return m.implementation +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *License) GetKey()(*string) { + return m.key +} +// GetLimitations gets the limitations property value. The limitations property +// returns a []string when successful +func (m *License) GetLimitations()([]string) { + return m.limitations +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *License) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *License) GetNodeId()(*string) { + return m.node_id +} +// GetPermissions gets the permissions property value. The permissions property +// returns a []string when successful +func (m *License) GetPermissions()([]string) { + return m.permissions +} +// GetSpdxId gets the spdx_id property value. The spdx_id property +// returns a *string when successful +func (m *License) GetSpdxId()(*string) { + return m.spdx_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *License) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *License) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + if m.GetConditions() != nil { + err := writer.WriteCollectionOfStringValues("conditions", m.GetConditions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("featured", m.GetFeatured()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("implementation", m.GetImplementation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + if m.GetLimitations() != nil { + err := writer.WriteCollectionOfStringValues("limitations", m.GetLimitations()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetPermissions() != nil { + err := writer.WriteCollectionOfStringValues("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("spdx_id", m.GetSpdxId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *License) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The body property +func (m *License) SetBody(value *string)() { + m.body = value +} +// SetConditions sets the conditions property value. The conditions property +func (m *License) SetConditions(value []string)() { + m.conditions = value +} +// SetDescription sets the description property value. The description property +func (m *License) SetDescription(value *string)() { + m.description = value +} +// SetFeatured sets the featured property value. The featured property +func (m *License) SetFeatured(value *bool)() { + m.featured = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *License) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetImplementation sets the implementation property value. The implementation property +func (m *License) SetImplementation(value *string)() { + m.implementation = value +} +// SetKey sets the key property value. The key property +func (m *License) SetKey(value *string)() { + m.key = value +} +// SetLimitations sets the limitations property value. The limitations property +func (m *License) SetLimitations(value []string)() { + m.limitations = value +} +// SetName sets the name property value. The name property +func (m *License) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *License) SetNodeId(value *string)() { + m.node_id = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *License) SetPermissions(value []string)() { + m.permissions = value +} +// SetSpdxId sets the spdx_id property value. The spdx_id property +func (m *License) SetSpdxId(value *string)() { + m.spdx_id = value +} +// SetUrl sets the url property value. The url property +func (m *License) SetUrl(value *string)() { + m.url = value +} +type Licenseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetConditions()([]string) + GetDescription()(*string) + GetFeatured()(*bool) + GetHtmlUrl()(*string) + GetImplementation()(*string) + GetKey()(*string) + GetLimitations()([]string) + GetName()(*string) + GetNodeId()(*string) + GetPermissions()([]string) + GetSpdxId()(*string) + GetUrl()(*string) + SetBody(value *string)() + SetConditions(value []string)() + SetDescription(value *string)() + SetFeatured(value *bool)() + SetHtmlUrl(value *string)() + SetImplementation(value *string)() + SetKey(value *string)() + SetLimitations(value []string)() + SetName(value *string)() + SetNodeId(value *string)() + SetPermissions(value []string)() + SetSpdxId(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/license_content.go b/pkg/github/models/license_content.go new file mode 100644 index 00000000..2b8ebed2 --- /dev/null +++ b/pkg/github/models/license_content.go @@ -0,0 +1,429 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// LicenseContent license Content +type LicenseContent struct { + // The _links property + _links LicenseContent__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The content property + content *string + // The download_url property + download_url *string + // The encoding property + encoding *string + // The git_url property + git_url *string + // The html_url property + html_url *string + // License Simple + license NullableLicenseSimpleable + // The name property + name *string + // The path property + path *string + // The sha property + sha *string + // The size property + size *int32 + // The type property + typeEscaped *string + // The url property + url *string +} +// NewLicenseContent instantiates a new LicenseContent and sets the default values. +func NewLicenseContent()(*LicenseContent) { + m := &LicenseContent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLicenseContentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLicenseContentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLicenseContent(), 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 *LicenseContent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContent gets the content property value. The content property +// returns a *string when successful +func (m *LicenseContent) GetContent()(*string) { + return m.content +} +// GetDownloadUrl gets the download_url property value. The download_url property +// returns a *string when successful +func (m *LicenseContent) GetDownloadUrl()(*string) { + return m.download_url +} +// GetEncoding gets the encoding property value. The encoding property +// returns a *string when successful +func (m *LicenseContent) GetEncoding()(*string) { + return m.encoding +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LicenseContent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLicenseContent__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(LicenseContent__linksable)) + } + return nil + } + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContent(val) + } + return nil + } + res["download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadUrl(val) + } + return nil + } + res["encoding"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncoding(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + 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["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + 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["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *LicenseContent) GetGitUrl()(*string) { + return m.git_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *LicenseContent) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *LicenseContent) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetLinks gets the _links property value. The _links property +// returns a LicenseContent__linksable when successful +func (m *LicenseContent) GetLinks()(LicenseContent__linksable) { + return m._links +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *LicenseContent) GetName()(*string) { + return m.name +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *LicenseContent) GetPath()(*string) { + return m.path +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *LicenseContent) GetSha()(*string) { + return m.sha +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *LicenseContent) GetSize()(*int32) { + return m.size +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *LicenseContent) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *LicenseContent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *LicenseContent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content", m.GetContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("download_url", m.GetDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("encoding", m.GetEncoding()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *LicenseContent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContent sets the content property value. The content property +func (m *LicenseContent) SetContent(value *string)() { + m.content = value +} +// SetDownloadUrl sets the download_url property value. The download_url property +func (m *LicenseContent) SetDownloadUrl(value *string)() { + m.download_url = value +} +// SetEncoding sets the encoding property value. The encoding property +func (m *LicenseContent) SetEncoding(value *string)() { + m.encoding = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *LicenseContent) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *LicenseContent) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLicense sets the license property value. License Simple +func (m *LicenseContent) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetLinks sets the _links property value. The _links property +func (m *LicenseContent) SetLinks(value LicenseContent__linksable)() { + m._links = value +} +// SetName sets the name property value. The name property +func (m *LicenseContent) SetName(value *string)() { + m.name = value +} +// SetPath sets the path property value. The path property +func (m *LicenseContent) SetPath(value *string)() { + m.path = value +} +// SetSha sets the sha property value. The sha property +func (m *LicenseContent) SetSha(value *string)() { + m.sha = value +} +// SetSize sets the size property value. The size property +func (m *LicenseContent) SetSize(value *int32)() { + m.size = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *LicenseContent) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *LicenseContent) SetUrl(value *string)() { + m.url = value +} +type LicenseContentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContent()(*string) + GetDownloadUrl()(*string) + GetEncoding()(*string) + GetGitUrl()(*string) + GetHtmlUrl()(*string) + GetLicense()(NullableLicenseSimpleable) + GetLinks()(LicenseContent__linksable) + GetName()(*string) + GetPath()(*string) + GetSha()(*string) + GetSize()(*int32) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetContent(value *string)() + SetDownloadUrl(value *string)() + SetEncoding(value *string)() + SetGitUrl(value *string)() + SetHtmlUrl(value *string)() + SetLicense(value NullableLicenseSimpleable)() + SetLinks(value LicenseContent__linksable)() + SetName(value *string)() + SetPath(value *string)() + SetSha(value *string)() + SetSize(value *int32)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/license_content_escaped__escaped_links.go b/pkg/github/models/license_content_escaped__escaped_links.go new file mode 100644 index 00000000..a6137d54 --- /dev/null +++ b/pkg/github/models/license_content_escaped__escaped_links.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type LicenseContent__links 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 git property + git *string + // The html property + html *string + // The self property + self *string +} +// NewLicenseContent__links instantiates a new LicenseContent__links and sets the default values. +func NewLicenseContent__links()(*LicenseContent__links) { + m := &LicenseContent__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLicenseContent__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLicenseContent__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLicenseContent__links(), 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 *LicenseContent__links) 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 *LicenseContent__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["git"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGit(val) + } + return nil + } + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtml(val) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelf(val) + } + return nil + } + return res +} +// GetGit gets the git property value. The git property +// returns a *string when successful +func (m *LicenseContent__links) GetGit()(*string) { + return m.git +} +// GetHtml gets the html property value. The html property +// returns a *string when successful +func (m *LicenseContent__links) GetHtml()(*string) { + return m.html +} +// GetSelf gets the self property value. The self property +// returns a *string when successful +func (m *LicenseContent__links) GetSelf()(*string) { + return m.self +} +// Serialize serializes information the current object +func (m *LicenseContent__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("git", m.GetGit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("self", m.GetSelf()) + 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 *LicenseContent__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGit sets the git property value. The git property +func (m *LicenseContent__links) SetGit(value *string)() { + m.git = value +} +// SetHtml sets the html property value. The html property +func (m *LicenseContent__links) SetHtml(value *string)() { + m.html = value +} +// SetSelf sets the self property value. The self property +func (m *LicenseContent__links) SetSelf(value *string)() { + m.self = value +} +type LicenseContent__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGit()(*string) + GetHtml()(*string) + GetSelf()(*string) + SetGit(value *string)() + SetHtml(value *string)() + SetSelf(value *string)() +} diff --git a/pkg/github/models/license_info.go b/pkg/github/models/license_info.go new file mode 100644 index 00000000..2019180c --- /dev/null +++ b/pkg/github/models/license_info.go @@ -0,0 +1,413 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type LicenseInfo 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 days_until_expiration property + days_until_expiration *int32 + // The expire_at property + expire_at *string + // The kind property + kind *string + // The seats property + seats LicenseInfo_LicenseInfo_seatsable + // The seats_available property + seats_available LicenseInfo_LicenseInfo_seats_availableable + // The seats_used property + seats_used *int32 +} +// LicenseInfo_LicenseInfo_seats composed type wrapper for classes int32, string +type LicenseInfo_LicenseInfo_seats struct { + // Composed type representation for type int32 + integer *int32 + // Composed type representation for type string + string *string +} +// NewLicenseInfo_LicenseInfo_seats instantiates a new LicenseInfo_LicenseInfo_seats and sets the default values. +func NewLicenseInfo_LicenseInfo_seats()(*LicenseInfo_LicenseInfo_seats) { + m := &LicenseInfo_LicenseInfo_seats{ + } + return m +} +// CreateLicenseInfo_LicenseInfo_seatsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLicenseInfo_LicenseInfo_seatsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewLicenseInfo_LicenseInfo_seats() + 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.GetInt32Value(); val != nil { + if err != nil { + return nil, err + } + result.SetInteger(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LicenseInfo_LicenseInfo_seats) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetInteger gets the integer property value. Composed type representation for type int32 +// returns a *int32 when successful +func (m *LicenseInfo_LicenseInfo_seats) GetInteger()(*int32) { + return m.integer +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *LicenseInfo_LicenseInfo_seats) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *LicenseInfo_LicenseInfo_seats) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *LicenseInfo_LicenseInfo_seats) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInteger() != nil { + err := writer.WriteInt32Value("", m.GetInteger()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetInteger sets the integer property value. Composed type representation for type int32 +func (m *LicenseInfo_LicenseInfo_seats) SetInteger(value *int32)() { + m.integer = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *LicenseInfo_LicenseInfo_seats) SetString(value *string)() { + m.string = value +} +// LicenseInfo_LicenseInfo_seats_available composed type wrapper for classes int32, string +type LicenseInfo_LicenseInfo_seats_available struct { + // Composed type representation for type int32 + integer *int32 + // Composed type representation for type string + string *string +} +// NewLicenseInfo_LicenseInfo_seats_available instantiates a new LicenseInfo_LicenseInfo_seats_available and sets the default values. +func NewLicenseInfo_LicenseInfo_seats_available()(*LicenseInfo_LicenseInfo_seats_available) { + m := &LicenseInfo_LicenseInfo_seats_available{ + } + return m +} +// CreateLicenseInfo_LicenseInfo_seats_availableFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLicenseInfo_LicenseInfo_seats_availableFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewLicenseInfo_LicenseInfo_seats_available() + 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.GetInt32Value(); val != nil { + if err != nil { + return nil, err + } + result.SetInteger(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LicenseInfo_LicenseInfo_seats_available) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetInteger gets the integer property value. Composed type representation for type int32 +// returns a *int32 when successful +func (m *LicenseInfo_LicenseInfo_seats_available) GetInteger()(*int32) { + return m.integer +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *LicenseInfo_LicenseInfo_seats_available) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *LicenseInfo_LicenseInfo_seats_available) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *LicenseInfo_LicenseInfo_seats_available) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInteger() != nil { + err := writer.WriteInt32Value("", m.GetInteger()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetInteger sets the integer property value. Composed type representation for type int32 +func (m *LicenseInfo_LicenseInfo_seats_available) SetInteger(value *int32)() { + m.integer = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *LicenseInfo_LicenseInfo_seats_available) SetString(value *string)() { + m.string = value +} +type LicenseInfo_LicenseInfo_seats_availableable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInteger()(*int32) + GetString()(*string) + SetInteger(value *int32)() + SetString(value *string)() +} +type LicenseInfo_LicenseInfo_seatsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInteger()(*int32) + GetString()(*string) + SetInteger(value *int32)() + SetString(value *string)() +} +// NewLicenseInfo instantiates a new LicenseInfo and sets the default values. +func NewLicenseInfo()(*LicenseInfo) { + m := &LicenseInfo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLicenseInfoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLicenseInfoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLicenseInfo(), 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 *LicenseInfo) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDaysUntilExpiration gets the days_until_expiration property value. The days_until_expiration property +// returns a *int32 when successful +func (m *LicenseInfo) GetDaysUntilExpiration()(*int32) { + return m.days_until_expiration +} +// GetExpireAt gets the expire_at property value. The expire_at property +// returns a *string when successful +func (m *LicenseInfo) GetExpireAt()(*string) { + return m.expire_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LicenseInfo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["days_until_expiration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDaysUntilExpiration(val) + } + return nil + } + res["expire_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExpireAt(val) + } + return nil + } + res["kind"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKind(val) + } + return nil + } + res["seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLicenseInfo_LicenseInfo_seatsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSeats(val.(LicenseInfo_LicenseInfo_seatsable)) + } + return nil + } + res["seats_available"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLicenseInfo_LicenseInfo_seats_availableFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSeatsAvailable(val.(LicenseInfo_LicenseInfo_seats_availableable)) + } + return nil + } + res["seats_used"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSeatsUsed(val) + } + return nil + } + return res +} +// GetKind gets the kind property value. The kind property +// returns a *string when successful +func (m *LicenseInfo) GetKind()(*string) { + return m.kind +} +// GetSeats gets the seats property value. The seats property +// returns a LicenseInfo_LicenseInfo_seatsable when successful +func (m *LicenseInfo) GetSeats()(LicenseInfo_LicenseInfo_seatsable) { + return m.seats +} +// GetSeatsAvailable gets the seats_available property value. The seats_available property +// returns a LicenseInfo_LicenseInfo_seats_availableable when successful +func (m *LicenseInfo) GetSeatsAvailable()(LicenseInfo_LicenseInfo_seats_availableable) { + return m.seats_available +} +// GetSeatsUsed gets the seats_used property value. The seats_used property +// returns a *int32 when successful +func (m *LicenseInfo) GetSeatsUsed()(*int32) { + return m.seats_used +} +// Serialize serializes information the current object +func (m *LicenseInfo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("days_until_expiration", m.GetDaysUntilExpiration()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("expire_at", m.GetExpireAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("kind", m.GetKind()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("seats", m.GetSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("seats_available", m.GetSeatsAvailable()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("seats_used", m.GetSeatsUsed()) + 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 *LicenseInfo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDaysUntilExpiration sets the days_until_expiration property value. The days_until_expiration property +func (m *LicenseInfo) SetDaysUntilExpiration(value *int32)() { + m.days_until_expiration = value +} +// SetExpireAt sets the expire_at property value. The expire_at property +func (m *LicenseInfo) SetExpireAt(value *string)() { + m.expire_at = value +} +// SetKind sets the kind property value. The kind property +func (m *LicenseInfo) SetKind(value *string)() { + m.kind = value +} +// SetSeats sets the seats property value. The seats property +func (m *LicenseInfo) SetSeats(value LicenseInfo_LicenseInfo_seatsable)() { + m.seats = value +} +// SetSeatsAvailable sets the seats_available property value. The seats_available property +func (m *LicenseInfo) SetSeatsAvailable(value LicenseInfo_LicenseInfo_seats_availableable)() { + m.seats_available = value +} +// SetSeatsUsed sets the seats_used property value. The seats_used property +func (m *LicenseInfo) SetSeatsUsed(value *int32)() { + m.seats_used = value +} +type LicenseInfoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDaysUntilExpiration()(*int32) + GetExpireAt()(*string) + GetKind()(*string) + GetSeats()(LicenseInfo_LicenseInfo_seatsable) + GetSeatsAvailable()(LicenseInfo_LicenseInfo_seats_availableable) + GetSeatsUsed()(*int32) + SetDaysUntilExpiration(value *int32)() + SetExpireAt(value *string)() + SetKind(value *string)() + SetSeats(value LicenseInfo_LicenseInfo_seatsable)() + SetSeatsAvailable(value LicenseInfo_LicenseInfo_seats_availableable)() + SetSeatsUsed(value *int32)() +} diff --git a/pkg/github/models/license_simple.go b/pkg/github/models/license_simple.go new file mode 100644 index 00000000..48241e6d --- /dev/null +++ b/pkg/github/models/license_simple.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// LicenseSimple license Simple +type LicenseSimple 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 html_url property + html_url *string + // The key property + key *string + // The name property + name *string + // The node_id property + node_id *string + // The spdx_id property + spdx_id *string + // The url property + url *string +} +// NewLicenseSimple instantiates a new LicenseSimple and sets the default values. +func NewLicenseSimple()(*LicenseSimple) { + m := &LicenseSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLicenseSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLicenseSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLicenseSimple(), 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 *LicenseSimple) 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 *LicenseSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + 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["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["spdx_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpdxId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *LicenseSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *LicenseSimple) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *LicenseSimple) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *LicenseSimple) GetNodeId()(*string) { + return m.node_id +} +// GetSpdxId gets the spdx_id property value. The spdx_id property +// returns a *string when successful +func (m *LicenseSimple) GetSpdxId()(*string) { + return m.spdx_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *LicenseSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *LicenseSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("spdx_id", m.GetSpdxId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *LicenseSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *LicenseSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetKey sets the key property value. The key property +func (m *LicenseSimple) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *LicenseSimple) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *LicenseSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetSpdxId sets the spdx_id property value. The spdx_id property +func (m *LicenseSimple) SetSpdxId(value *string)() { + m.spdx_id = value +} +// SetUrl sets the url property value. The url property +func (m *LicenseSimple) SetUrl(value *string)() { + m.url = value +} +type LicenseSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetKey()(*string) + GetName()(*string) + GetNodeId()(*string) + GetSpdxId()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetKey(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetSpdxId(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/link.go b/pkg/github/models/link.go new file mode 100644 index 00000000..66228f90 --- /dev/null +++ b/pkg/github/models/link.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Link hypermedia Link +type Link 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 href property + href *string +} +// NewLink instantiates a new Link and sets the default values. +func NewLink()(*Link) { + m := &Link{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLinkFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLinkFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLink(), 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 *Link) 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 *Link) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *Link) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *Link) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *Link) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *Link) SetHref(value *string)() { + m.href = value +} +type Linkable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/pkg/github/models/link_with_type.go b/pkg/github/models/link_with_type.go new file mode 100644 index 00000000..5666a0a8 --- /dev/null +++ b/pkg/github/models/link_with_type.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// LinkWithType hypermedia Link with Type +type LinkWithType 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 href property + href *string + // The type property + typeEscaped *string +} +// NewLinkWithType instantiates a new LinkWithType and sets the default values. +func NewLinkWithType()(*LinkWithType) { + m := &LinkWithType{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLinkWithTypeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLinkWithTypeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLinkWithType(), 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 *LinkWithType) 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 *LinkWithType) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *LinkWithType) GetHref()(*string) { + return m.href +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *LinkWithType) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *LinkWithType) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + 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 *LinkWithType) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *LinkWithType) SetHref(value *string)() { + m.href = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *LinkWithType) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +type LinkWithTypeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + GetTypeEscaped()(*string) + SetHref(value *string)() + SetTypeEscaped(value *string)() +} diff --git a/pkg/github/models/locations503_error.go b/pkg/github/models/locations503_error.go new file mode 100644 index 00000000..57633e10 --- /dev/null +++ b/pkg/github/models/locations503_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 Locations503Error 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 +} +// NewLocations503Error instantiates a new Locations503Error and sets the default values. +func NewLocations503Error()(*Locations503Error) { + m := &Locations503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLocations503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLocations503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLocations503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Locations503Error) 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 *Locations503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Locations503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Locations503Error) 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 *Locations503Error) 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 *Locations503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Locations503Error) 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 *Locations503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Locations503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Locations503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Locations503Error) SetMessage(value *string)() { + m.message = value +} +type Locations503Errorable 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/locked_issue_event.go b/pkg/github/models/locked_issue_event.go new file mode 100644 index 00000000..e31d9782 --- /dev/null +++ b/pkg/github/models/locked_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// LockedIssueEvent locked Issue Event +type LockedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The lock_reason property + lock_reason *string + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewLockedIssueEvent instantiates a new LockedIssueEvent and sets the default values. +func NewLockedIssueEvent()(*LockedIssueEvent) { + m := &LockedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLockedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLockedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLockedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *LockedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *LockedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *LockedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *LockedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *LockedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *LockedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LockedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["lock_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLockReason(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *LockedIssueEvent) GetId()(*int32) { + return m.id +} +// GetLockReason gets the lock_reason property value. The lock_reason property +// returns a *string when successful +func (m *LockedIssueEvent) GetLockReason()(*string) { + return m.lock_reason +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *LockedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *LockedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *LockedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *LockedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("lock_reason", m.GetLockReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *LockedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *LockedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *LockedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *LockedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *LockedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *LockedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *LockedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetLockReason sets the lock_reason property value. The lock_reason property +func (m *LockedIssueEvent) SetLockReason(value *string)() { + m.lock_reason = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *LockedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *LockedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *LockedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type LockedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetLockReason()(*string) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetLockReason(value *string)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/maintenance_status.go b/pkg/github/models/maintenance_status.go new file mode 100644 index 00000000..0ac3deb7 --- /dev/null +++ b/pkg/github/models/maintenance_status.go @@ -0,0 +1,150 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MaintenanceStatus 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 connection_services property + connection_services []MaintenanceStatus_connection_servicesable + // The scheduled_time property + scheduled_time *string + // The status property + status *string +} +// NewMaintenanceStatus instantiates a new MaintenanceStatus and sets the default values. +func NewMaintenanceStatus()(*MaintenanceStatus) { + m := &MaintenanceStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMaintenanceStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMaintenanceStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMaintenanceStatus(), 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 *MaintenanceStatus) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConnectionServices gets the connection_services property value. The connection_services property +// returns a []MaintenanceStatus_connection_servicesable when successful +func (m *MaintenanceStatus) GetConnectionServices()([]MaintenanceStatus_connection_servicesable) { + return m.connection_services +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MaintenanceStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["connection_services"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateMaintenanceStatus_connection_servicesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]MaintenanceStatus_connection_servicesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(MaintenanceStatus_connection_servicesable) + } + } + m.SetConnectionServices(res) + } + return nil + } + res["scheduled_time"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetScheduledTime(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetScheduledTime gets the scheduled_time property value. The scheduled_time property +// returns a *string when successful +func (m *MaintenanceStatus) GetScheduledTime()(*string) { + return m.scheduled_time +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *MaintenanceStatus) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *MaintenanceStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetConnectionServices() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetConnectionServices())) + for i, v := range m.GetConnectionServices() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("connection_services", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("scheduled_time", m.GetScheduledTime()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *MaintenanceStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConnectionServices sets the connection_services property value. The connection_services property +func (m *MaintenanceStatus) SetConnectionServices(value []MaintenanceStatus_connection_servicesable)() { + m.connection_services = value +} +// SetScheduledTime sets the scheduled_time property value. The scheduled_time property +func (m *MaintenanceStatus) SetScheduledTime(value *string)() { + m.scheduled_time = value +} +// SetStatus sets the status property value. The status property +func (m *MaintenanceStatus) SetStatus(value *string)() { + m.status = value +} +type MaintenanceStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConnectionServices()([]MaintenanceStatus_connection_servicesable) + GetScheduledTime()(*string) + GetStatus()(*string) + SetConnectionServices(value []MaintenanceStatus_connection_servicesable)() + SetScheduledTime(value *string)() + SetStatus(value *string)() +} diff --git a/pkg/github/models/maintenance_status_escaped_connection_escaped_services.go b/pkg/github/models/maintenance_status_escaped_connection_escaped_services.go new file mode 100644 index 00000000..3161d5d9 --- /dev/null +++ b/pkg/github/models/maintenance_status_escaped_connection_escaped_services.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MaintenanceStatus_connection_services 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 name property + name *string + // The number property + number *int32 +} +// NewMaintenanceStatus_connection_services instantiates a new MaintenanceStatus_connection_services and sets the default values. +func NewMaintenanceStatus_connection_services()(*MaintenanceStatus_connection_services) { + m := &MaintenanceStatus_connection_services{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMaintenanceStatus_connection_servicesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMaintenanceStatus_connection_servicesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMaintenanceStatus_connection_services(), 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 *MaintenanceStatus_connection_services) 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 *MaintenanceStatus_connection_services) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *MaintenanceStatus_connection_services) GetName()(*string) { + return m.name +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *MaintenanceStatus_connection_services) GetNumber()(*int32) { + return m.number +} +// Serialize serializes information the current object +func (m *MaintenanceStatus_connection_services) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + 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 *MaintenanceStatus_connection_services) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name property +func (m *MaintenanceStatus_connection_services) SetName(value *string)() { + m.name = value +} +// SetNumber sets the number property value. The number property +func (m *MaintenanceStatus_connection_services) SetNumber(value *int32)() { + m.number = value +} +type MaintenanceStatus_connection_servicesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetNumber()(*int32) + SetName(value *string)() + SetNumber(value *int32)() +} diff --git a/pkg/github/models/merged_upstream.go b/pkg/github/models/merged_upstream.go new file mode 100644 index 00000000..42558b5a --- /dev/null +++ b/pkg/github/models/merged_upstream.go @@ -0,0 +1,140 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MergedUpstream results of a successful merge upstream request +type MergedUpstream 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 base_branch property + base_branch *string + // The merge_type property + merge_type *MergedUpstream_merge_type + // The message property + message *string +} +// NewMergedUpstream instantiates a new MergedUpstream and sets the default values. +func NewMergedUpstream()(*MergedUpstream) { + m := &MergedUpstream{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMergedUpstreamFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMergedUpstreamFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMergedUpstream(), 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 *MergedUpstream) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBaseBranch gets the base_branch property value. The base_branch property +// returns a *string when successful +func (m *MergedUpstream) GetBaseBranch()(*string) { + return m.base_branch +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MergedUpstream) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBaseBranch(val) + } + return nil + } + res["merge_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseMergedUpstream_merge_type) + if err != nil { + return err + } + if val != nil { + m.SetMergeType(val.(*MergedUpstream_merge_type)) + } + 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 +} +// GetMergeType gets the merge_type property value. The merge_type property +// returns a *MergedUpstream_merge_type when successful +func (m *MergedUpstream) GetMergeType()(*MergedUpstream_merge_type) { + return m.merge_type +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *MergedUpstream) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *MergedUpstream) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("base_branch", m.GetBaseBranch()) + if err != nil { + return err + } + } + if m.GetMergeType() != nil { + cast := (*m.GetMergeType()).String() + err := writer.WriteStringValue("merge_type", &cast) + 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 *MergedUpstream) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBaseBranch sets the base_branch property value. The base_branch property +func (m *MergedUpstream) SetBaseBranch(value *string)() { + m.base_branch = value +} +// SetMergeType sets the merge_type property value. The merge_type property +func (m *MergedUpstream) SetMergeType(value *MergedUpstream_merge_type)() { + m.merge_type = value +} +// SetMessage sets the message property value. The message property +func (m *MergedUpstream) SetMessage(value *string)() { + m.message = value +} +type MergedUpstreamable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBaseBranch()(*string) + GetMergeType()(*MergedUpstream_merge_type) + GetMessage()(*string) + SetBaseBranch(value *string)() + SetMergeType(value *MergedUpstream_merge_type)() + SetMessage(value *string)() +} diff --git a/pkg/github/models/merged_upstream_escaped_merge_escaped_type.go b/pkg/github/models/merged_upstream_escaped_merge_escaped_type.go new file mode 100644 index 00000000..7ab5e88a --- /dev/null +++ b/pkg/github/models/merged_upstream_escaped_merge_escaped_type.go @@ -0,0 +1,36 @@ +package models +type MergedUpstream_merge_type int + +const ( + MERGE_MERGEDUPSTREAM_MERGE_TYPE MergedUpstream_merge_type = iota + FASTFORWARD_MERGEDUPSTREAM_MERGE_TYPE + NONE_MERGEDUPSTREAM_MERGE_TYPE +) + +func (i MergedUpstream_merge_type) String() string { + return []string{"merge", "fast-forward", "none"}[i] +} +func ParseMergedUpstream_merge_type(v string) (any, error) { + result := MERGE_MERGEDUPSTREAM_MERGE_TYPE + switch v { + case "merge": + result = MERGE_MERGEDUPSTREAM_MERGE_TYPE + case "fast-forward": + result = FASTFORWARD_MERGEDUPSTREAM_MERGE_TYPE + case "none": + result = NONE_MERGEDUPSTREAM_MERGE_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeMergedUpstream_merge_type(values []MergedUpstream_merge_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i MergedUpstream_merge_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/meta.go b/pkg/github/models/meta.go new file mode 100644 index 00000000..3ef60932 --- /dev/null +++ b/pkg/github/models/meta.go @@ -0,0 +1,169 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Meta the metadata associated with the creation/updates to the user. +type Meta 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 date and time when the user was created. + created *string + // A data and time when the user was last modified. + lastModified *string + // A URL location of an object + location *string + // A type of a resource + resourceType *Meta_resourceType +} +// NewMeta instantiates a new Meta and sets the default values. +func NewMeta()(*Meta) { + m := &Meta{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMetaFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMetaFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMeta(), 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 *Meta) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreated gets the created property value. A date and time when the user was created. +// returns a *string when successful +func (m *Meta) GetCreated()(*string) { + return m.created +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Meta) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["created"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreated(val) + } + return nil + } + res["lastModified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLastModified(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["resourceType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseMeta_resourceType) + if err != nil { + return err + } + if val != nil { + m.SetResourceType(val.(*Meta_resourceType)) + } + return nil + } + return res +} +// GetLastModified gets the lastModified property value. A data and time when the user was last modified. +// returns a *string when successful +func (m *Meta) GetLastModified()(*string) { + return m.lastModified +} +// GetLocation gets the location property value. A URL location of an object +// returns a *string when successful +func (m *Meta) GetLocation()(*string) { + return m.location +} +// GetResourceType gets the resourceType property value. A type of a resource +// returns a *Meta_resourceType when successful +func (m *Meta) GetResourceType()(*Meta_resourceType) { + return m.resourceType +} +// Serialize serializes information the current object +func (m *Meta) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created", m.GetCreated()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("lastModified", m.GetLastModified()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + if m.GetResourceType() != nil { + cast := (*m.GetResourceType()).String() + err := writer.WriteStringValue("resourceType", &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 *Meta) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreated sets the created property value. A date and time when the user was created. +func (m *Meta) SetCreated(value *string)() { + m.created = value +} +// SetLastModified sets the lastModified property value. A data and time when the user was last modified. +func (m *Meta) SetLastModified(value *string)() { + m.lastModified = value +} +// SetLocation sets the location property value. A URL location of an object +func (m *Meta) SetLocation(value *string)() { + m.location = value +} +// SetResourceType sets the resourceType property value. A type of a resource +func (m *Meta) SetResourceType(value *Meta_resourceType)() { + m.resourceType = value +} +type Metaable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreated()(*string) + GetLastModified()(*string) + GetLocation()(*string) + GetResourceType()(*Meta_resourceType) + SetCreated(value *string)() + SetLastModified(value *string)() + SetLocation(value *string)() + SetResourceType(value *Meta_resourceType)() +} diff --git a/pkg/github/models/meta_escaped_resource_type.go b/pkg/github/models/meta_escaped_resource_type.go new file mode 100644 index 00000000..465e5189 --- /dev/null +++ b/pkg/github/models/meta_escaped_resource_type.go @@ -0,0 +1,34 @@ +package models +// A type of a resource +type Meta_resourceType int + +const ( + USER_META_RESOURCETYPE Meta_resourceType = iota + GROUP_META_RESOURCETYPE +) + +func (i Meta_resourceType) String() string { + return []string{"User", "Group"}[i] +} +func ParseMeta_resourceType(v string) (any, error) { + result := USER_META_RESOURCETYPE + switch v { + case "User": + result = USER_META_RESOURCETYPE + case "Group": + result = GROUP_META_RESOURCETYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeMeta_resourceType(values []Meta_resourceType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Meta_resourceType) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/metadata.go b/pkg/github/models/metadata.go new file mode 100644 index 00000000..06ce8d14 --- /dev/null +++ b/pkg/github/models/metadata.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Metadata user-defined metadata to store domain-specific information limited to 8 keys with scalar values. +type Metadata struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewMetadata instantiates a new Metadata and sets the default values. +func NewMetadata()(*Metadata) { + m := &Metadata{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMetadataFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMetadataFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMetadata(), 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 *Metadata) 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 *Metadata) 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 *Metadata) 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 *Metadata) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type Metadataable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/migration.go b/pkg/github/models/migration.go new file mode 100644 index 00000000..247d723d --- /dev/null +++ b/pkg/github/models/migration.go @@ -0,0 +1,593 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Migration a migration. +type Migration 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 archive_url property + archive_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Exclude related items from being returned in the response in order to improve performance of the request. The array can include any of: `"repositories"`. + exclude []string + // The exclude_attachments property + exclude_attachments *bool + // The exclude_git_data property + exclude_git_data *bool + // The exclude_metadata property + exclude_metadata *bool + // The exclude_owner_projects property + exclude_owner_projects *bool + // The exclude_releases property + exclude_releases *bool + // The guid property + guid *string + // The id property + id *int64 + // The lock_repositories property + lock_repositories *bool + // The node_id property + node_id *string + // The org_metadata_only property + org_metadata_only *bool + // A GitHub user. + owner NullableSimpleUserable + // The repositories included in the migration. Only returned for export migrations. + repositories []Repositoryable + // The state property + state *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewMigration instantiates a new Migration and sets the default values. +func NewMigration()(*Migration) { + m := &Migration{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMigrationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMigrationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMigration(), 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 *Migration) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *Migration) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Migration) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetExclude gets the exclude property value. Exclude related items from being returned in the response in order to improve performance of the request. The array can include any of: `"repositories"`. +// returns a []string when successful +func (m *Migration) GetExclude()([]string) { + return m.exclude +} +// GetExcludeAttachments gets the exclude_attachments property value. The exclude_attachments property +// returns a *bool when successful +func (m *Migration) GetExcludeAttachments()(*bool) { + return m.exclude_attachments +} +// GetExcludeGitData gets the exclude_git_data property value. The exclude_git_data property +// returns a *bool when successful +func (m *Migration) GetExcludeGitData()(*bool) { + return m.exclude_git_data +} +// GetExcludeMetadata gets the exclude_metadata property value. The exclude_metadata property +// returns a *bool when successful +func (m *Migration) GetExcludeMetadata()(*bool) { + return m.exclude_metadata +} +// GetExcludeOwnerProjects gets the exclude_owner_projects property value. The exclude_owner_projects property +// returns a *bool when successful +func (m *Migration) GetExcludeOwnerProjects()(*bool) { + return m.exclude_owner_projects +} +// GetExcludeReleases gets the exclude_releases property value. The exclude_releases property +// returns a *bool when successful +func (m *Migration) GetExcludeReleases()(*bool) { + return m.exclude_releases +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Migration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + 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["exclude"] = 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.SetExclude(res) + } + return nil + } + res["exclude_attachments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeAttachments(val) + } + return nil + } + res["exclude_git_data"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeGitData(val) + } + return nil + } + res["exclude_metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeMetadata(val) + } + return nil + } + res["exclude_owner_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeOwnerProjects(val) + } + return nil + } + res["exclude_releases"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeReleases(val) + } + return nil + } + res["guid"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGuid(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["lock_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLockRepositories(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["org_metadata_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetOrgMetadataOnly(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableSimpleUserable)) + } + return nil + } + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Repositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Repositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetGuid gets the guid property value. The guid property +// returns a *string when successful +func (m *Migration) GetGuid()(*string) { + return m.guid +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *Migration) GetId()(*int64) { + return m.id +} +// GetLockRepositories gets the lock_repositories property value. The lock_repositories property +// returns a *bool when successful +func (m *Migration) GetLockRepositories()(*bool) { + return m.lock_repositories +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Migration) GetNodeId()(*string) { + return m.node_id +} +// GetOrgMetadataOnly gets the org_metadata_only property value. The org_metadata_only property +// returns a *bool when successful +func (m *Migration) GetOrgMetadataOnly()(*bool) { + return m.org_metadata_only +} +// GetOwner gets the owner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Migration) GetOwner()(NullableSimpleUserable) { + return m.owner +} +// GetRepositories gets the repositories property value. The repositories included in the migration. Only returned for export migrations. +// returns a []Repositoryable when successful +func (m *Migration) GetRepositories()([]Repositoryable) { + return m.repositories +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *Migration) GetState()(*string) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Migration) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Migration) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Migration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + if m.GetExclude() != nil { + err := writer.WriteCollectionOfStringValues("exclude", m.GetExclude()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_attachments", m.GetExcludeAttachments()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_git_data", m.GetExcludeGitData()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_metadata", m.GetExcludeMetadata()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_owner_projects", m.GetExcludeOwnerProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_releases", m.GetExcludeReleases()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("guid", m.GetGuid()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("lock_repositories", m.GetLockRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("org_metadata_only", m.GetOrgMetadataOnly()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Migration) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *Migration) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Migration) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetExclude sets the exclude property value. Exclude related items from being returned in the response in order to improve performance of the request. The array can include any of: `"repositories"`. +func (m *Migration) SetExclude(value []string)() { + m.exclude = value +} +// SetExcludeAttachments sets the exclude_attachments property value. The exclude_attachments property +func (m *Migration) SetExcludeAttachments(value *bool)() { + m.exclude_attachments = value +} +// SetExcludeGitData sets the exclude_git_data property value. The exclude_git_data property +func (m *Migration) SetExcludeGitData(value *bool)() { + m.exclude_git_data = value +} +// SetExcludeMetadata sets the exclude_metadata property value. The exclude_metadata property +func (m *Migration) SetExcludeMetadata(value *bool)() { + m.exclude_metadata = value +} +// SetExcludeOwnerProjects sets the exclude_owner_projects property value. The exclude_owner_projects property +func (m *Migration) SetExcludeOwnerProjects(value *bool)() { + m.exclude_owner_projects = value +} +// SetExcludeReleases sets the exclude_releases property value. The exclude_releases property +func (m *Migration) SetExcludeReleases(value *bool)() { + m.exclude_releases = value +} +// SetGuid sets the guid property value. The guid property +func (m *Migration) SetGuid(value *string)() { + m.guid = value +} +// SetId sets the id property value. The id property +func (m *Migration) SetId(value *int64)() { + m.id = value +} +// SetLockRepositories sets the lock_repositories property value. The lock_repositories property +func (m *Migration) SetLockRepositories(value *bool)() { + m.lock_repositories = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Migration) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrgMetadataOnly sets the org_metadata_only property value. The org_metadata_only property +func (m *Migration) SetOrgMetadataOnly(value *bool)() { + m.org_metadata_only = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *Migration) SetOwner(value NullableSimpleUserable)() { + m.owner = value +} +// SetRepositories sets the repositories property value. The repositories included in the migration. Only returned for export migrations. +func (m *Migration) SetRepositories(value []Repositoryable)() { + m.repositories = value +} +// SetState sets the state property value. The state property +func (m *Migration) SetState(value *string)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Migration) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Migration) SetUrl(value *string)() { + m.url = value +} +type Migrationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchiveUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetExclude()([]string) + GetExcludeAttachments()(*bool) + GetExcludeGitData()(*bool) + GetExcludeMetadata()(*bool) + GetExcludeOwnerProjects()(*bool) + GetExcludeReleases()(*bool) + GetGuid()(*string) + GetId()(*int64) + GetLockRepositories()(*bool) + GetNodeId()(*string) + GetOrgMetadataOnly()(*bool) + GetOwner()(NullableSimpleUserable) + GetRepositories()([]Repositoryable) + GetState()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetArchiveUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetExclude(value []string)() + SetExcludeAttachments(value *bool)() + SetExcludeGitData(value *bool)() + SetExcludeMetadata(value *bool)() + SetExcludeOwnerProjects(value *bool)() + SetExcludeReleases(value *bool)() + SetGuid(value *string)() + SetId(value *int64)() + SetLockRepositories(value *bool)() + SetNodeId(value *string)() + SetOrgMetadataOnly(value *bool)() + SetOwner(value NullableSimpleUserable)() + SetRepositories(value []Repositoryable)() + SetState(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/milestone.go b/pkg/github/models/milestone.go new file mode 100644 index 00000000..6e613c0c --- /dev/null +++ b/pkg/github/models/milestone.go @@ -0,0 +1,520 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Milestone a collection of related issues and pull requests. +type Milestone 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 closed_at property + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The closed_issues property + closed_issues *int32 + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + creator NullableSimpleUserable + // The description property + description *string + // The due_on property + due_on *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // The id property + id *int32 + // The labels_url property + labels_url *string + // The node_id property + node_id *string + // The number of the milestone. + number *int32 + // The open_issues property + open_issues *int32 + // The state of the milestone. + state *Milestone_state + // The title of the milestone. + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewMilestone instantiates a new Milestone and sets the default values. +func NewMilestone()(*Milestone) { + m := &Milestone{ + } + m.SetAdditionalData(make(map[string]any)) + stateValue := OPEN_MILESTONE_STATE + m.SetState(&stateValue) + return m +} +// CreateMilestoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMilestoneFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMilestone(), 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 *Milestone) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClosedAt gets the closed_at property value. The closed_at property +// returns a *Time when successful +func (m *Milestone) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetClosedIssues gets the closed_issues property value. The closed_issues property +// returns a *int32 when successful +func (m *Milestone) GetClosedIssues()(*int32) { + return m.closed_issues +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Milestone) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Milestone) GetCreator()(NullableSimpleUserable) { + return m.creator +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *Milestone) GetDescription()(*string) { + return m.description +} +// GetDueOn gets the due_on property value. The due_on property +// returns a *Time when successful +func (m *Milestone) GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.due_on +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Milestone) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["closed_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetClosedIssues(val) + } + return nil + } + 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["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(NullableSimpleUserable)) + } + 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["due_on"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDueOn(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseMilestone_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*Milestone_state)) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Milestone) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Milestone) GetId()(*int32) { + return m.id +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *Milestone) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Milestone) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The number of the milestone. +// returns a *int32 when successful +func (m *Milestone) GetNumber()(*int32) { + return m.number +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *Milestone) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetState gets the state property value. The state of the milestone. +// returns a *Milestone_state when successful +func (m *Milestone) GetState()(*Milestone_state) { + return m.state +} +// GetTitle gets the title property value. The title of the milestone. +// returns a *string when successful +func (m *Milestone) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Milestone) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Milestone) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Milestone) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("closed_at", m.GetClosedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("closed_issues", m.GetClosedIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("due_on", m.GetDueOn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Milestone) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClosedAt sets the closed_at property value. The closed_at property +func (m *Milestone) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetClosedIssues sets the closed_issues property value. The closed_issues property +func (m *Milestone) SetClosedIssues(value *int32)() { + m.closed_issues = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Milestone) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *Milestone) SetCreator(value NullableSimpleUserable)() { + m.creator = value +} +// SetDescription sets the description property value. The description property +func (m *Milestone) SetDescription(value *string)() { + m.description = value +} +// SetDueOn sets the due_on property value. The due_on property +func (m *Milestone) SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.due_on = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Milestone) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Milestone) SetId(value *int32)() { + m.id = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *Milestone) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Milestone) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The number of the milestone. +func (m *Milestone) SetNumber(value *int32)() { + m.number = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *Milestone) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetState sets the state property value. The state of the milestone. +func (m *Milestone) SetState(value *Milestone_state)() { + m.state = value +} +// SetTitle sets the title property value. The title of the milestone. +func (m *Milestone) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Milestone) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Milestone) SetUrl(value *string)() { + m.url = value +} +type Milestoneable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetClosedIssues()(*int32) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreator()(NullableSimpleUserable) + GetDescription()(*string) + GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLabelsUrl()(*string) + GetNodeId()(*string) + GetNumber()(*int32) + GetOpenIssues()(*int32) + GetState()(*Milestone_state) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetClosedIssues(value *int32)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreator(value NullableSimpleUserable)() + SetDescription(value *string)() + SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLabelsUrl(value *string)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetOpenIssues(value *int32)() + SetState(value *Milestone_state)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/milestone_escaped_state.go b/pkg/github/models/milestone_escaped_state.go new file mode 100644 index 00000000..e1210a90 --- /dev/null +++ b/pkg/github/models/milestone_escaped_state.go @@ -0,0 +1,34 @@ +package models +// The state of the milestone. +type Milestone_state int + +const ( + OPEN_MILESTONE_STATE Milestone_state = iota + CLOSED_MILESTONE_STATE +) + +func (i Milestone_state) String() string { + return []string{"open", "closed"}[i] +} +func ParseMilestone_state(v string) (any, error) { + result := OPEN_MILESTONE_STATE + switch v { + case "open": + result = OPEN_MILESTONE_STATE + case "closed": + result = CLOSED_MILESTONE_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeMilestone_state(values []Milestone_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Milestone_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/milestoned_issue_event.go b/pkg/github/models/milestoned_issue_event.go new file mode 100644 index 00000000..0184fee9 --- /dev/null +++ b/pkg/github/models/milestoned_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MilestonedIssueEvent milestoned Issue Event +type MilestonedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The milestone property + milestone MilestonedIssueEvent_milestoneable + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewMilestonedIssueEvent instantiates a new MilestonedIssueEvent and sets the default values. +func NewMilestonedIssueEvent()(*MilestonedIssueEvent) { + m := &MilestonedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMilestonedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMilestonedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMilestonedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *MilestonedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *MilestonedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *MilestonedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *MilestonedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *MilestonedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *MilestonedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MilestonedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMilestonedIssueEvent_milestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(MilestonedIssueEvent_milestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *MilestonedIssueEvent) GetId()(*int32) { + return m.id +} +// GetMilestone gets the milestone property value. The milestone property +// returns a MilestonedIssueEvent_milestoneable when successful +func (m *MilestonedIssueEvent) GetMilestone()(MilestonedIssueEvent_milestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *MilestonedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *MilestonedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *MilestonedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *MilestonedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *MilestonedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *MilestonedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *MilestonedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *MilestonedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *MilestonedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *MilestonedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *MilestonedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetMilestone sets the milestone property value. The milestone property +func (m *MilestonedIssueEvent) SetMilestone(value MilestonedIssueEvent_milestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *MilestonedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *MilestonedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *MilestonedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type MilestonedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetMilestone()(MilestonedIssueEvent_milestoneable) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetMilestone(value MilestonedIssueEvent_milestoneable)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/milestoned_issue_event_escaped_milestone.go b/pkg/github/models/milestoned_issue_event_escaped_milestone.go new file mode 100644 index 00000000..bfb57493 --- /dev/null +++ b/pkg/github/models/milestoned_issue_event_escaped_milestone.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MilestonedIssueEvent_milestone 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 title property + title *string +} +// NewMilestonedIssueEvent_milestone instantiates a new MilestonedIssueEvent_milestone and sets the default values. +func NewMilestonedIssueEvent_milestone()(*MilestonedIssueEvent_milestone) { + m := &MilestonedIssueEvent_milestone{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMilestonedIssueEvent_milestoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMilestonedIssueEvent_milestoneFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMilestonedIssueEvent_milestone(), 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 *MilestonedIssueEvent_milestone) 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 *MilestonedIssueEvent_milestone) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *MilestonedIssueEvent_milestone) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *MilestonedIssueEvent_milestone) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *MilestonedIssueEvent_milestone) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTitle sets the title property value. The title property +func (m *MilestonedIssueEvent_milestone) SetTitle(value *string)() { + m.title = value +} +type MilestonedIssueEvent_milestoneable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTitle()(*string) + SetTitle(value *string)() +} diff --git a/pkg/github/models/minimal_repository.go b/pkg/github/models/minimal_repository.go new file mode 100644 index 00000000..39576166 --- /dev/null +++ b/pkg/github/models/minimal_repository.go @@ -0,0 +1,2582 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MinimalRepository minimal Repository +type MinimalRepository 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 allow_forking property + allow_forking *bool + // The archive_url property + archive_url *string + // The archived property + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // Code Of Conduct + code_of_conduct CodeOfConductable + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default_branch property + default_branch *string + // The delete_branch_on_merge property + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // The disabled property + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // The has_discussions property + has_discussions *bool + // The has_downloads property + has_downloads *bool + // The has_issues property + has_issues *bool + // The has_pages property + has_pages *bool + // The has_projects property + has_projects *bool + // The has_wiki property + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int64 + // The is_template property + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // The license property + license MinimalRepository_licenseable + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name property + name *string + // The network_count property + network_count *int32 + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // A GitHub user. + owner SimpleUserable + // The permissions property + permissions MinimalRepository_permissionsable + // The private property + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The role_name property + role_name *string + // The security_and_analysis property + security_and_analysis SecurityAndAnalysisable + // The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + size *int32 + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_count property + subscribers_count *int32 + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The visibility property + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewMinimalRepository instantiates a new MinimalRepository and sets the default values. +func NewMinimalRepository()(*MinimalRepository) { + m := &MinimalRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMinimalRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMinimalRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMinimalRepository(), 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 *MinimalRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowForking gets the allow_forking property value. The allow_forking property +// returns a *bool when successful +func (m *MinimalRepository) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetArchived gets the archived property value. The archived property +// returns a *bool when successful +func (m *MinimalRepository) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *MinimalRepository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *MinimalRepository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *MinimalRepository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *MinimalRepository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *MinimalRepository) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCodeOfConduct gets the code_of_conduct property value. Code Of Conduct +// returns a CodeOfConductable when successful +func (m *MinimalRepository) GetCodeOfConduct()(CodeOfConductable) { + return m.code_of_conduct +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *MinimalRepository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *MinimalRepository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *MinimalRepository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *MinimalRepository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *MinimalRepository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *MinimalRepository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *MinimalRepository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default_branch property +// returns a *string when successful +func (m *MinimalRepository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. The delete_branch_on_merge property +// returns a *bool when successful +func (m *MinimalRepository) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *MinimalRepository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *MinimalRepository) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. The disabled property +// returns a *bool when successful +func (m *MinimalRepository) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *MinimalRepository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *MinimalRepository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MinimalRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["code_of_conduct"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeOfConductFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeOfConduct(val.(CodeOfConductable)) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + 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["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + 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["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepository_licenseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(MinimalRepository_licenseable)) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(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["network_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNetworkCount(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepository_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(MinimalRepository_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["role_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRoleName(val) + } + return nil + } + res["security_and_analysis"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecurityAndAnalysisFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAndAnalysis(val.(SecurityAndAnalysisable)) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersCount(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = 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.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *MinimalRepository) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *MinimalRepository) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *MinimalRepository) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *MinimalRepository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *MinimalRepository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *MinimalRepository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *MinimalRepository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *MinimalRepository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *MinimalRepository) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. The has_discussions property +// returns a *bool when successful +func (m *MinimalRepository) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. The has_downloads property +// returns a *bool when successful +func (m *MinimalRepository) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. The has_issues property +// returns a *bool when successful +func (m *MinimalRepository) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *MinimalRepository) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. The has_projects property +// returns a *bool when successful +func (m *MinimalRepository) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. The has_wiki property +// returns a *bool when successful +func (m *MinimalRepository) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *MinimalRepository) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *MinimalRepository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *MinimalRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *MinimalRepository) GetId()(*int64) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *MinimalRepository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *MinimalRepository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *MinimalRepository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. The is_template property +// returns a *bool when successful +func (m *MinimalRepository) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *MinimalRepository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *MinimalRepository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *MinimalRepository) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *MinimalRepository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. The license property +// returns a MinimalRepository_licenseable when successful +func (m *MinimalRepository) GetLicense()(MinimalRepository_licenseable) { + return m.license +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *MinimalRepository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *MinimalRepository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *MinimalRepository) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *MinimalRepository) GetName()(*string) { + return m.name +} +// GetNetworkCount gets the network_count property value. The network_count property +// returns a *int32 when successful +func (m *MinimalRepository) GetNetworkCount()(*int32) { + return m.network_count +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *MinimalRepository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *MinimalRepository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *MinimalRepository) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *MinimalRepository) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *MinimalRepository) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a MinimalRepository_permissionsable when successful +func (m *MinimalRepository) GetPermissions()(MinimalRepository_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. The private property +// returns a *bool when successful +func (m *MinimalRepository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *MinimalRepository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *MinimalRepository) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *MinimalRepository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetRoleName gets the role_name property value. The role_name property +// returns a *string when successful +func (m *MinimalRepository) GetRoleName()(*string) { + return m.role_name +} +// GetSecurityAndAnalysis gets the security_and_analysis property value. The security_and_analysis property +// returns a SecurityAndAnalysisable when successful +func (m *MinimalRepository) GetSecurityAndAnalysis()(SecurityAndAnalysisable) { + return m.security_and_analysis +} +// GetSize gets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +// returns a *int32 when successful +func (m *MinimalRepository) GetSize()(*int32) { + return m.size +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *MinimalRepository) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *MinimalRepository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *MinimalRepository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *MinimalRepository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersCount gets the subscribers_count property value. The subscribers_count property +// returns a *int32 when successful +func (m *MinimalRepository) GetSubscribersCount()(*int32) { + return m.subscribers_count +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *MinimalRepository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *MinimalRepository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *MinimalRepository) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *MinimalRepository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *MinimalRepository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *MinimalRepository) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *MinimalRepository) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *MinimalRepository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *MinimalRepository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *MinimalRepository) GetUrl()(*string) { + return m.url +} +// GetVisibility gets the visibility property value. The visibility property +// returns a *string when successful +func (m *MinimalRepository) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *MinimalRepository) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *MinimalRepository) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *MinimalRepository) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *MinimalRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("code_of_conduct", m.GetCodeOfConduct()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("network_count", m.GetNetworkCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("role_name", m.GetRoleName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("security_and_analysis", m.GetSecurityAndAnalysis()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("subscribers_count", m.GetSubscribersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *MinimalRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowForking sets the allow_forking property value. The allow_forking property +func (m *MinimalRepository) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetArchived sets the archived property value. The archived property +func (m *MinimalRepository) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *MinimalRepository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *MinimalRepository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *MinimalRepository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *MinimalRepository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *MinimalRepository) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCodeOfConduct sets the code_of_conduct property value. Code Of Conduct +func (m *MinimalRepository) SetCodeOfConduct(value CodeOfConductable)() { + m.code_of_conduct = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *MinimalRepository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *MinimalRepository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *MinimalRepository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *MinimalRepository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *MinimalRepository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *MinimalRepository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *MinimalRepository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default_branch property +func (m *MinimalRepository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. The delete_branch_on_merge property +func (m *MinimalRepository) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *MinimalRepository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *MinimalRepository) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. The disabled property +func (m *MinimalRepository) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *MinimalRepository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *MinimalRepository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *MinimalRepository) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *MinimalRepository) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *MinimalRepository) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *MinimalRepository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *MinimalRepository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *MinimalRepository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *MinimalRepository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *MinimalRepository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *MinimalRepository) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. The has_discussions property +func (m *MinimalRepository) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. The has_downloads property +func (m *MinimalRepository) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. The has_issues property +func (m *MinimalRepository) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *MinimalRepository) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. The has_projects property +func (m *MinimalRepository) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. The has_wiki property +func (m *MinimalRepository) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *MinimalRepository) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *MinimalRepository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *MinimalRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *MinimalRepository) SetId(value *int64)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *MinimalRepository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *MinimalRepository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *MinimalRepository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. The is_template property +func (m *MinimalRepository) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *MinimalRepository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *MinimalRepository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *MinimalRepository) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *MinimalRepository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. The license property +func (m *MinimalRepository) SetLicense(value MinimalRepository_licenseable)() { + m.license = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *MinimalRepository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *MinimalRepository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *MinimalRepository) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name property +func (m *MinimalRepository) SetName(value *string)() { + m.name = value +} +// SetNetworkCount sets the network_count property value. The network_count property +func (m *MinimalRepository) SetNetworkCount(value *int32)() { + m.network_count = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *MinimalRepository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *MinimalRepository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *MinimalRepository) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *MinimalRepository) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *MinimalRepository) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *MinimalRepository) SetPermissions(value MinimalRepository_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. The private property +func (m *MinimalRepository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *MinimalRepository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *MinimalRepository) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *MinimalRepository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetRoleName sets the role_name property value. The role_name property +func (m *MinimalRepository) SetRoleName(value *string)() { + m.role_name = value +} +// SetSecurityAndAnalysis sets the security_and_analysis property value. The security_and_analysis property +func (m *MinimalRepository) SetSecurityAndAnalysis(value SecurityAndAnalysisable)() { + m.security_and_analysis = value +} +// SetSize sets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +func (m *MinimalRepository) SetSize(value *int32)() { + m.size = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *MinimalRepository) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *MinimalRepository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *MinimalRepository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *MinimalRepository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersCount sets the subscribers_count property value. The subscribers_count property +func (m *MinimalRepository) SetSubscribersCount(value *int32)() { + m.subscribers_count = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *MinimalRepository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *MinimalRepository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *MinimalRepository) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *MinimalRepository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *MinimalRepository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *MinimalRepository) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *MinimalRepository) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *MinimalRepository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *MinimalRepository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *MinimalRepository) SetUrl(value *string)() { + m.url = value +} +// SetVisibility sets the visibility property value. The visibility property +func (m *MinimalRepository) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *MinimalRepository) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *MinimalRepository) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *MinimalRepository) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type MinimalRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowForking()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCodeOfConduct()(CodeOfConductable) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(MinimalRepository_licenseable) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNetworkCount()(*int32) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(SimpleUserable) + GetPermissions()(MinimalRepository_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetRoleName()(*string) + GetSecurityAndAnalysis()(SecurityAndAnalysisable) + GetSize()(*int32) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersCount()(*int32) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowForking(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCodeOfConduct(value CodeOfConductable)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value MinimalRepository_licenseable)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNetworkCount(value *int32)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value SimpleUserable)() + SetPermissions(value MinimalRepository_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetRoleName(value *string)() + SetSecurityAndAnalysis(value SecurityAndAnalysisable)() + SetSize(value *int32)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersCount(value *int32)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/pkg/github/models/minimal_repository_escaped_license.go b/pkg/github/models/minimal_repository_escaped_license.go new file mode 100644 index 00000000..24e81d1e --- /dev/null +++ b/pkg/github/models/minimal_repository_escaped_license.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MinimalRepository_license 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 key property + key *string + // The name property + name *string + // The node_id property + node_id *string + // The spdx_id property + spdx_id *string + // The url property + url *string +} +// NewMinimalRepository_license instantiates a new MinimalRepository_license and sets the default values. +func NewMinimalRepository_license()(*MinimalRepository_license) { + m := &MinimalRepository_license{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMinimalRepository_licenseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMinimalRepository_licenseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMinimalRepository_license(), 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 *MinimalRepository_license) 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 *MinimalRepository_license) 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["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["spdx_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpdxId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *MinimalRepository_license) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *MinimalRepository_license) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *MinimalRepository_license) GetNodeId()(*string) { + return m.node_id +} +// GetSpdxId gets the spdx_id property value. The spdx_id property +// returns a *string when successful +func (m *MinimalRepository_license) GetSpdxId()(*string) { + return m.spdx_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *MinimalRepository_license) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *MinimalRepository_license) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("spdx_id", m.GetSpdxId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *MinimalRepository_license) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The key property +func (m *MinimalRepository_license) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *MinimalRepository_license) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *MinimalRepository_license) SetNodeId(value *string)() { + m.node_id = value +} +// SetSpdxId sets the spdx_id property value. The spdx_id property +func (m *MinimalRepository_license) SetSpdxId(value *string)() { + m.spdx_id = value +} +// SetUrl sets the url property value. The url property +func (m *MinimalRepository_license) SetUrl(value *string)() { + m.url = value +} +type MinimalRepository_licenseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetName()(*string) + GetNodeId()(*string) + GetSpdxId()(*string) + GetUrl()(*string) + SetKey(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetSpdxId(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/minimal_repository_escaped_permissions.go b/pkg/github/models/minimal_repository_escaped_permissions.go new file mode 100644 index 00000000..b52bacc0 --- /dev/null +++ b/pkg/github/models/minimal_repository_escaped_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MinimalRepository_permissions 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 admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewMinimalRepository_permissions instantiates a new MinimalRepository_permissions and sets the default values. +func NewMinimalRepository_permissions()(*MinimalRepository_permissions) { + m := &MinimalRepository_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMinimalRepository_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMinimalRepository_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMinimalRepository_permissions(), 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 *MinimalRepository_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *MinimalRepository_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MinimalRepository_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *MinimalRepository_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *MinimalRepository_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *MinimalRepository_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *MinimalRepository_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *MinimalRepository_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *MinimalRepository_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *MinimalRepository_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *MinimalRepository_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *MinimalRepository_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *MinimalRepository_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *MinimalRepository_permissions) SetTriage(value *bool)() { + m.triage = value +} +type MinimalRepository_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/pkg/github/models/moved_column_in_project_issue_event.go b/pkg/github/models/moved_column_in_project_issue_event.go new file mode 100644 index 00000000..bc060709 --- /dev/null +++ b/pkg/github/models/moved_column_in_project_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// MovedColumnInProjectIssueEvent moved Column in Project Issue Event +type MovedColumnInProjectIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The project_card property + project_card MovedColumnInProjectIssueEvent_project_cardable + // The url property + url *string +} +// NewMovedColumnInProjectIssueEvent instantiates a new MovedColumnInProjectIssueEvent and sets the default values. +func NewMovedColumnInProjectIssueEvent()(*MovedColumnInProjectIssueEvent) { + m := &MovedColumnInProjectIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMovedColumnInProjectIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMovedColumnInProjectIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMovedColumnInProjectIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *MovedColumnInProjectIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *MovedColumnInProjectIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MovedColumnInProjectIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["project_card"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMovedColumnInProjectIssueEvent_project_cardFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProjectCard(val.(MovedColumnInProjectIssueEvent_project_cardable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *MovedColumnInProjectIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *MovedColumnInProjectIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetProjectCard gets the project_card property value. The project_card property +// returns a MovedColumnInProjectIssueEvent_project_cardable when successful +func (m *MovedColumnInProjectIssueEvent) GetProjectCard()(MovedColumnInProjectIssueEvent_project_cardable) { + return m.project_card +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *MovedColumnInProjectIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("project_card", m.GetProjectCard()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *MovedColumnInProjectIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *MovedColumnInProjectIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *MovedColumnInProjectIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *MovedColumnInProjectIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *MovedColumnInProjectIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *MovedColumnInProjectIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *MovedColumnInProjectIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *MovedColumnInProjectIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *MovedColumnInProjectIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetProjectCard sets the project_card property value. The project_card property +func (m *MovedColumnInProjectIssueEvent) SetProjectCard(value MovedColumnInProjectIssueEvent_project_cardable)() { + m.project_card = value +} +// SetUrl sets the url property value. The url property +func (m *MovedColumnInProjectIssueEvent) SetUrl(value *string)() { + m.url = value +} +type MovedColumnInProjectIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetProjectCard()(MovedColumnInProjectIssueEvent_project_cardable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetProjectCard(value MovedColumnInProjectIssueEvent_project_cardable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/moved_column_in_project_issue_event_escaped_project_escaped_card.go b/pkg/github/models/moved_column_in_project_issue_event_escaped_project_escaped_card.go new file mode 100644 index 00000000..b0542eca --- /dev/null +++ b/pkg/github/models/moved_column_in_project_issue_event_escaped_project_escaped_card.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MovedColumnInProjectIssueEvent_project_card 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 column_name property + column_name *string + // The id property + id *int32 + // The previous_column_name property + previous_column_name *string + // The project_id property + project_id *int32 + // The project_url property + project_url *string + // The url property + url *string +} +// NewMovedColumnInProjectIssueEvent_project_card instantiates a new MovedColumnInProjectIssueEvent_project_card and sets the default values. +func NewMovedColumnInProjectIssueEvent_project_card()(*MovedColumnInProjectIssueEvent_project_card) { + m := &MovedColumnInProjectIssueEvent_project_card{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMovedColumnInProjectIssueEvent_project_cardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMovedColumnInProjectIssueEvent_project_cardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMovedColumnInProjectIssueEvent_project_card(), 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 *MovedColumnInProjectIssueEvent_project_card) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColumnName gets the column_name property value. The column_name property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent_project_card) GetColumnName()(*string) { + return m.column_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MovedColumnInProjectIssueEvent_project_card) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnName(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["previous_column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousColumnName(val) + } + return nil + } + res["project_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetProjectId(val) + } + return nil + } + res["project_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *MovedColumnInProjectIssueEvent_project_card) GetId()(*int32) { + return m.id +} +// GetPreviousColumnName gets the previous_column_name property value. The previous_column_name property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent_project_card) GetPreviousColumnName()(*string) { + return m.previous_column_name +} +// GetProjectId gets the project_id property value. The project_id property +// returns a *int32 when successful +func (m *MovedColumnInProjectIssueEvent_project_card) GetProjectId()(*int32) { + return m.project_id +} +// GetProjectUrl gets the project_url property value. The project_url property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent_project_card) GetProjectUrl()(*string) { + return m.project_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *MovedColumnInProjectIssueEvent_project_card) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *MovedColumnInProjectIssueEvent_project_card) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("column_name", m.GetColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_column_name", m.GetPreviousColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("project_id", m.GetProjectId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_url", m.GetProjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *MovedColumnInProjectIssueEvent_project_card) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColumnName sets the column_name property value. The column_name property +func (m *MovedColumnInProjectIssueEvent_project_card) SetColumnName(value *string)() { + m.column_name = value +} +// SetId sets the id property value. The id property +func (m *MovedColumnInProjectIssueEvent_project_card) SetId(value *int32)() { + m.id = value +} +// SetPreviousColumnName sets the previous_column_name property value. The previous_column_name property +func (m *MovedColumnInProjectIssueEvent_project_card) SetPreviousColumnName(value *string)() { + m.previous_column_name = value +} +// SetProjectId sets the project_id property value. The project_id property +func (m *MovedColumnInProjectIssueEvent_project_card) SetProjectId(value *int32)() { + m.project_id = value +} +// SetProjectUrl sets the project_url property value. The project_url property +func (m *MovedColumnInProjectIssueEvent_project_card) SetProjectUrl(value *string)() { + m.project_url = value +} +// SetUrl sets the url property value. The url property +func (m *MovedColumnInProjectIssueEvent_project_card) SetUrl(value *string)() { + m.url = value +} +type MovedColumnInProjectIssueEvent_project_cardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumnName()(*string) + GetId()(*int32) + GetPreviousColumnName()(*string) + GetProjectId()(*int32) + GetProjectUrl()(*string) + GetUrl()(*string) + SetColumnName(value *string)() + SetId(value *int32)() + SetPreviousColumnName(value *string)() + SetProjectId(value *int32)() + SetProjectUrl(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/nullable_collaborator.go b/pkg/github/models/nullable_collaborator.go new file mode 100644 index 00000000..3eab0a57 --- /dev/null +++ b/pkg/github/models/nullable_collaborator.go @@ -0,0 +1,690 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableCollaborator collaborator +type NullableCollaborator 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 avatar_url property + avatar_url *string + // The email property + email *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int64 + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The permissions property + permissions NullableCollaborator_permissionsable + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The role_name property + role_name *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewNullableCollaborator instantiates a new NullableCollaborator and sets the default values. +func NewNullableCollaborator()(*NullableCollaborator) { + m := &NullableCollaborator{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableCollaboratorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableCollaboratorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableCollaborator(), 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 *NullableCollaborator) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *NullableCollaborator) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *NullableCollaborator) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *NullableCollaborator) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableCollaborator) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableCollaborator_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(NullableCollaborator_permissionsable)) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["role_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRoleName(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *NullableCollaborator) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *NullableCollaborator) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *NullableCollaborator) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *NullableCollaborator) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableCollaborator) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *NullableCollaborator) GetId()(*int64) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *NullableCollaborator) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *NullableCollaborator) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableCollaborator) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *NullableCollaborator) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetPermissions gets the permissions property value. The permissions property +// returns a NullableCollaborator_permissionsable when successful +func (m *NullableCollaborator) GetPermissions()(NullableCollaborator_permissionsable) { + return m.permissions +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *NullableCollaborator) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *NullableCollaborator) GetReposUrl()(*string) { + return m.repos_url +} +// GetRoleName gets the role_name property value. The role_name property +// returns a *string when successful +func (m *NullableCollaborator) GetRoleName()(*string) { + return m.role_name +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *NullableCollaborator) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *NullableCollaborator) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *NullableCollaborator) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *NullableCollaborator) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableCollaborator) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableCollaborator) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("role_name", m.GetRoleName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableCollaborator) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *NullableCollaborator) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEmail sets the email property value. The email property +func (m *NullableCollaborator) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *NullableCollaborator) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *NullableCollaborator) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *NullableCollaborator) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *NullableCollaborator) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *NullableCollaborator) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableCollaborator) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *NullableCollaborator) SetId(value *int64)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *NullableCollaborator) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *NullableCollaborator) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableCollaborator) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *NullableCollaborator) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *NullableCollaborator) SetPermissions(value NullableCollaborator_permissionsable)() { + m.permissions = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *NullableCollaborator) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *NullableCollaborator) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetRoleName sets the role_name property value. The role_name property +func (m *NullableCollaborator) SetRoleName(value *string)() { + m.role_name = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *NullableCollaborator) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *NullableCollaborator) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *NullableCollaborator) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *NullableCollaborator) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *NullableCollaborator) SetUrl(value *string)() { + m.url = value +} +type NullableCollaboratorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetPermissions()(NullableCollaborator_permissionsable) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetRoleName()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetPermissions(value NullableCollaborator_permissionsable)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetRoleName(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/nullable_collaborator_escaped_permissions.go b/pkg/github/models/nullable_collaborator_escaped_permissions.go new file mode 100644 index 00000000..fb3065f0 --- /dev/null +++ b/pkg/github/models/nullable_collaborator_escaped_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NullableCollaborator_permissions 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 admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewNullableCollaborator_permissions instantiates a new NullableCollaborator_permissions and sets the default values. +func NewNullableCollaborator_permissions()(*NullableCollaborator_permissions) { + m := &NullableCollaborator_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableCollaborator_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableCollaborator_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableCollaborator_permissions(), 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 *NullableCollaborator_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *NullableCollaborator_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableCollaborator_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *NullableCollaborator_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *NullableCollaborator_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *NullableCollaborator_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *NullableCollaborator_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *NullableCollaborator_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *NullableCollaborator_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *NullableCollaborator_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *NullableCollaborator_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *NullableCollaborator_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *NullableCollaborator_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *NullableCollaborator_permissions) SetTriage(value *bool)() { + m.triage = value +} +type NullableCollaborator_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/pkg/github/models/nullable_git_user.go b/pkg/github/models/nullable_git_user.go new file mode 100644 index 00000000..ab70ce38 --- /dev/null +++ b/pkg/github/models/nullable_git_user.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableGitUser metaproperties for Git author/committer information. +type NullableGitUser 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 date property + date *string + // The email property + email *string + // The name property + name *string +} +// NewNullableGitUser instantiates a new NullableGitUser and sets the default values. +func NewNullableGitUser()(*NullableGitUser) { + m := &NullableGitUser{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableGitUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableGitUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableGitUser(), 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 *NullableGitUser) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. The date property +// returns a *string when successful +func (m *NullableGitUser) GetDate()(*string) { + return m.date +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *NullableGitUser) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableGitUser) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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 property +// returns a *string when successful +func (m *NullableGitUser) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *NullableGitUser) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *NullableGitUser) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. The date property +func (m *NullableGitUser) SetDate(value *string)() { + m.date = value +} +// SetEmail sets the email property value. The email property +func (m *NullableGitUser) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name property +func (m *NullableGitUser) SetName(value *string)() { + m.name = value +} +type NullableGitUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*string) + GetEmail()(*string) + GetName()(*string) + SetDate(value *string)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/nullable_integration.go b/pkg/github/models/nullable_integration.go new file mode 100644 index 00000000..ac9d668a --- /dev/null +++ b/pkg/github/models/nullable_integration.go @@ -0,0 +1,523 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableIntegration gitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +type NullableIntegration 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 client_secret property + client_secret *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + description *string + // The list of events for the GitHub app + events []string + // The external_url property + external_url *string + // The html_url property + html_url *string + // Unique identifier of the GitHub app + id *int32 + // The number of installations associated with the GitHub app + installations_count *int32 + // The name of the GitHub app + name *string + // The node_id property + node_id *string + // A GitHub user. + owner NullableSimpleUserable + // The pem property + pem *string + // The set of permissions for the GitHub app + permissions NullableIntegration_permissionsable + // The slug name of the GitHub app + slug *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The webhook_secret property + webhook_secret *string +} +// NewNullableIntegration instantiates a new NullableIntegration and sets the default values. +func NewNullableIntegration()(*NullableIntegration) { + m := &NullableIntegration{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableIntegrationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableIntegrationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableIntegration(), 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 *NullableIntegration) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientSecret gets the client_secret property value. The client_secret property +// returns a *string when successful +func (m *NullableIntegration) GetClientSecret()(*string) { + return m.client_secret +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *NullableIntegration) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *NullableIntegration) GetDescription()(*string) { + return m.description +} +// GetEvents gets the events property value. The list of events for the GitHub app +// returns a []string when successful +func (m *NullableIntegration) GetEvents()([]string) { + return m.events +} +// GetExternalUrl gets the external_url property value. The external_url property +// returns a *string when successful +func (m *NullableIntegration) GetExternalUrl()(*string) { + return m.external_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableIntegration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetClientSecret(val) + } + return nil + } + 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["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["events"] = 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.SetEvents(res) + } + return nil + } + res["external_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExternalUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["installations_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInstallationsCount(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableSimpleUserable)) + } + return nil + } + res["pem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPem(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegration_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(NullableIntegration_permissionsable)) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + 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["webhook_secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWebhookSecret(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableIntegration) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the GitHub app +// returns a *int32 when successful +func (m *NullableIntegration) GetId()(*int32) { + return m.id +} +// GetInstallationsCount gets the installations_count property value. The number of installations associated with the GitHub app +// returns a *int32 when successful +func (m *NullableIntegration) GetInstallationsCount()(*int32) { + return m.installations_count +} +// GetName gets the name property value. The name of the GitHub app +// returns a *string when successful +func (m *NullableIntegration) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableIntegration) GetNodeId()(*string) { + return m.node_id +} +// GetOwner gets the owner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *NullableIntegration) GetOwner()(NullableSimpleUserable) { + return m.owner +} +// GetPem gets the pem property value. The pem property +// returns a *string when successful +func (m *NullableIntegration) GetPem()(*string) { + return m.pem +} +// GetPermissions gets the permissions property value. The set of permissions for the GitHub app +// returns a NullableIntegration_permissionsable when successful +func (m *NullableIntegration) GetPermissions()(NullableIntegration_permissionsable) { + return m.permissions +} +// GetSlug gets the slug property value. The slug name of the GitHub app +// returns a *string when successful +func (m *NullableIntegration) GetSlug()(*string) { + return m.slug +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *NullableIntegration) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetWebhookSecret gets the webhook_secret property value. The webhook_secret property +// returns a *string when successful +func (m *NullableIntegration) GetWebhookSecret()(*string) { + return m.webhook_secret +} +// Serialize serializes information the current object +func (m *NullableIntegration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("client_secret", m.GetClientSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("external_url", m.GetExternalUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("installations_count", m.GetInstallationsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pem", m.GetPem()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("webhook_secret", m.GetWebhookSecret()) + 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 *NullableIntegration) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientSecret sets the client_secret property value. The client_secret property +func (m *NullableIntegration) SetClientSecret(value *string)() { + m.client_secret = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *NullableIntegration) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *NullableIntegration) SetDescription(value *string)() { + m.description = value +} +// SetEvents sets the events property value. The list of events for the GitHub app +func (m *NullableIntegration) SetEvents(value []string)() { + m.events = value +} +// SetExternalUrl sets the external_url property value. The external_url property +func (m *NullableIntegration) SetExternalUrl(value *string)() { + m.external_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableIntegration) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the GitHub app +func (m *NullableIntegration) SetId(value *int32)() { + m.id = value +} +// SetInstallationsCount sets the installations_count property value. The number of installations associated with the GitHub app +func (m *NullableIntegration) SetInstallationsCount(value *int32)() { + m.installations_count = value +} +// SetName sets the name property value. The name of the GitHub app +func (m *NullableIntegration) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableIntegration) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *NullableIntegration) SetOwner(value NullableSimpleUserable)() { + m.owner = value +} +// SetPem sets the pem property value. The pem property +func (m *NullableIntegration) SetPem(value *string)() { + m.pem = value +} +// SetPermissions sets the permissions property value. The set of permissions for the GitHub app +func (m *NullableIntegration) SetPermissions(value NullableIntegration_permissionsable)() { + m.permissions = value +} +// SetSlug sets the slug property value. The slug name of the GitHub app +func (m *NullableIntegration) SetSlug(value *string)() { + m.slug = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *NullableIntegration) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetWebhookSecret sets the webhook_secret property value. The webhook_secret property +func (m *NullableIntegration) SetWebhookSecret(value *string)() { + m.webhook_secret = value +} +type NullableIntegrationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientSecret()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetEvents()([]string) + GetExternalUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetInstallationsCount()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetOwner()(NullableSimpleUserable) + GetPem()(*string) + GetPermissions()(NullableIntegration_permissionsable) + GetSlug()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetWebhookSecret()(*string) + SetClientSecret(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetEvents(value []string)() + SetExternalUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetInstallationsCount(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetOwner(value NullableSimpleUserable)() + SetPem(value *string)() + SetPermissions(value NullableIntegration_permissionsable)() + SetSlug(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetWebhookSecret(value *string)() +} diff --git a/pkg/github/models/nullable_integration_escaped_permissions.go b/pkg/github/models/nullable_integration_escaped_permissions.go new file mode 100644 index 00000000..d7f5b02d --- /dev/null +++ b/pkg/github/models/nullable_integration_escaped_permissions.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableIntegration_permissions the set of permissions for the GitHub app +type NullableIntegration_permissions 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 checks property + checks *string + // The contents property + contents *string + // The deployments property + deployments *string + // The issues property + issues *string + // The metadata property + metadata *string +} +// NewNullableIntegration_permissions instantiates a new NullableIntegration_permissions and sets the default values. +func NewNullableIntegration_permissions()(*NullableIntegration_permissions) { + m := &NullableIntegration_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableIntegration_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableIntegration_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableIntegration_permissions(), 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 *NullableIntegration_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChecks gets the checks property value. The checks property +// returns a *string when successful +func (m *NullableIntegration_permissions) GetChecks()(*string) { + return m.checks +} +// GetContents gets the contents property value. The contents property +// returns a *string when successful +func (m *NullableIntegration_permissions) GetContents()(*string) { + return m.contents +} +// GetDeployments gets the deployments property value. The deployments property +// returns a *string when successful +func (m *NullableIntegration_permissions) GetDeployments()(*string) { + return m.deployments +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableIntegration_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetChecks(val) + } + return nil + } + res["contents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContents(val) + } + return nil + } + res["deployments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeployments(val) + } + return nil + } + res["issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssues(val) + } + return nil + } + res["metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMetadata(val) + } + return nil + } + return res +} +// GetIssues gets the issues property value. The issues property +// returns a *string when successful +func (m *NullableIntegration_permissions) GetIssues()(*string) { + return m.issues +} +// GetMetadata gets the metadata property value. The metadata property +// returns a *string when successful +func (m *NullableIntegration_permissions) GetMetadata()(*string) { + return m.metadata +} +// Serialize serializes information the current object +func (m *NullableIntegration_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("checks", m.GetChecks()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents", m.GetContents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments", m.GetDeployments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues", m.GetIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("metadata", m.GetMetadata()) + 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 *NullableIntegration_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChecks sets the checks property value. The checks property +func (m *NullableIntegration_permissions) SetChecks(value *string)() { + m.checks = value +} +// SetContents sets the contents property value. The contents property +func (m *NullableIntegration_permissions) SetContents(value *string)() { + m.contents = value +} +// SetDeployments sets the deployments property value. The deployments property +func (m *NullableIntegration_permissions) SetDeployments(value *string)() { + m.deployments = value +} +// SetIssues sets the issues property value. The issues property +func (m *NullableIntegration_permissions) SetIssues(value *string)() { + m.issues = value +} +// SetMetadata sets the metadata property value. The metadata property +func (m *NullableIntegration_permissions) SetMetadata(value *string)() { + m.metadata = value +} +type NullableIntegration_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChecks()(*string) + GetContents()(*string) + GetDeployments()(*string) + GetIssues()(*string) + GetMetadata()(*string) + SetChecks(value *string)() + SetContents(value *string)() + SetDeployments(value *string)() + SetIssues(value *string)() + SetMetadata(value *string)() +} diff --git a/pkg/github/models/nullable_issue.go b/pkg/github/models/nullable_issue.go new file mode 100644 index 00000000..8eb356a5 --- /dev/null +++ b/pkg/github/models/nullable_issue.go @@ -0,0 +1,1059 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableIssue issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +type NullableIssue struct { + // The active_lock_reason property + active_lock_reason *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee NullableSimpleUserable + // The assignees property + assignees []SimpleUserable + // How the author is associated with the repository. + author_association *AuthorAssociation + // Contents of the issue + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The closed_at property + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + closed_by NullableSimpleUserable + // The comments property + comments *int32 + // The comments_url property + comments_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The draft property + draft *bool + // The events_url property + events_url *string + // The html_url property + html_url *string + // The id property + id *int64 + // Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository + labels []string + // The labels_url property + labels_url *string + // The locked property + locked *bool + // A collection of related issues and pull requests. + milestone NullableMilestoneable + // The node_id property + node_id *string + // Number uniquely identifying the issue within its repository + number *int32 + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The pull_request property + pull_request NullableIssue_pull_requestable + // The reactions property + reactions ReactionRollupable + // A repository on GitHub. + repository Repositoryable + // The repository_url property + repository_url *string + // State of the issue; either 'open' or 'closed' + state *string + // The reason for the current state + state_reason *NullableIssue_state_reason + // The timeline_url property + timeline_url *string + // Title of the issue + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // URL for the issue + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewNullableIssue instantiates a new NullableIssue and sets the default values. +func NewNullableIssue()(*NullableIssue) { + m := &NullableIssue{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableIssueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableIssueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableIssue(), nil +} +// GetActiveLockReason gets the active_lock_reason property value. The active_lock_reason property +// returns a *string when successful +func (m *NullableIssue) GetActiveLockReason()(*string) { + return m.active_lock_reason +} +// 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 *NullableIssue) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *NullableIssue) GetAssignee()(NullableSimpleUserable) { + return m.assignee +} +// GetAssignees gets the assignees property value. The assignees property +// returns a []SimpleUserable when successful +func (m *NullableIssue) GetAssignees()([]SimpleUserable) { + return m.assignees +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *NullableIssue) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. Contents of the issue +// returns a *string when successful +func (m *NullableIssue) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *NullableIssue) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *NullableIssue) GetBodyText()(*string) { + return m.body_text +} +// GetClosedAt gets the closed_at property value. The closed_at property +// returns a *Time when successful +func (m *NullableIssue) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetClosedBy gets the closed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *NullableIssue) GetClosedBy()(NullableSimpleUserable) { + return m.closed_by +} +// GetComments gets the comments property value. The comments property +// returns a *int32 when successful +func (m *NullableIssue) GetComments()(*int32) { + return m.comments +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *NullableIssue) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *NullableIssue) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDraft gets the draft property value. The draft property +// returns a *bool when successful +func (m *NullableIssue) GetDraft()(*bool) { + return m.draft +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *NullableIssue) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableIssue) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active_lock_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActiveLockReason(val) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(NullableSimpleUserable)) + } + return nil + } + res["assignees"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetAssignees(res) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["closed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetClosedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetComments(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + 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["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["labels"] = 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.SetLabels(res) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["locked"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLocked(val) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMilestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(NullableMilestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIssue_pull_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(NullableIssue_pull_requestable)) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(Repositoryable)) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["state_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableIssue_state_reason) + if err != nil { + return err + } + if val != nil { + m.SetStateReason(val.(*NullableIssue_state_reason)) + } + return nil + } + res["timeline_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTimelineUrl(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableIssue) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *NullableIssue) GetId()(*int64) { + return m.id +} +// GetLabels gets the labels property value. Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository +// returns a []string when successful +func (m *NullableIssue) GetLabels()([]string) { + return m.labels +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *NullableIssue) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLocked gets the locked property value. The locked property +// returns a *bool when successful +func (m *NullableIssue) GetLocked()(*bool) { + return m.locked +} +// GetMilestone gets the milestone property value. A collection of related issues and pull requests. +// returns a NullableMilestoneable when successful +func (m *NullableIssue) GetMilestone()(NullableMilestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableIssue) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. Number uniquely identifying the issue within its repository +// returns a *int32 when successful +func (m *NullableIssue) GetNumber()(*int32) { + return m.number +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *NullableIssue) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetPullRequest gets the pull_request property value. The pull_request property +// returns a NullableIssue_pull_requestable when successful +func (m *NullableIssue) GetPullRequest()(NullableIssue_pull_requestable) { + return m.pull_request +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *NullableIssue) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetRepository gets the repository property value. A repository on GitHub. +// returns a Repositoryable when successful +func (m *NullableIssue) GetRepository()(Repositoryable) { + return m.repository +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *NullableIssue) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetState gets the state property value. State of the issue; either 'open' or 'closed' +// returns a *string when successful +func (m *NullableIssue) GetState()(*string) { + return m.state +} +// GetStateReason gets the state_reason property value. The reason for the current state +// returns a *NullableIssue_state_reason when successful +func (m *NullableIssue) GetStateReason()(*NullableIssue_state_reason) { + return m.state_reason +} +// GetTimelineUrl gets the timeline_url property value. The timeline_url property +// returns a *string when successful +func (m *NullableIssue) GetTimelineUrl()(*string) { + return m.timeline_url +} +// GetTitle gets the title property value. Title of the issue +// returns a *string when successful +func (m *NullableIssue) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *NullableIssue) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. URL for the issue +// returns a *string when successful +func (m *NullableIssue) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *NullableIssue) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *NullableIssue) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("active_lock_reason", m.GetActiveLockReason()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + if m.GetAssignees() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssignees())) + for i, v := range m.GetAssignees() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("assignees", cast) + if err != nil { + return err + } + } + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("closed_at", m.GetClosedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("closed_by", m.GetClosedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("locked", m.GetLocked()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + if m.GetStateReason() != nil { + cast := (*m.GetStateReason()).String() + err := writer.WriteStringValue("state_reason", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("timeline_url", m.GetTimelineUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveLockReason sets the active_lock_reason property value. The active_lock_reason property +func (m *NullableIssue) SetActiveLockReason(value *string)() { + m.active_lock_reason = 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 *NullableIssue) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *NullableIssue) SetAssignee(value NullableSimpleUserable)() { + m.assignee = value +} +// SetAssignees sets the assignees property value. The assignees property +func (m *NullableIssue) SetAssignees(value []SimpleUserable)() { + m.assignees = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *NullableIssue) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. Contents of the issue +func (m *NullableIssue) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *NullableIssue) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *NullableIssue) SetBodyText(value *string)() { + m.body_text = value +} +// SetClosedAt sets the closed_at property value. The closed_at property +func (m *NullableIssue) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetClosedBy sets the closed_by property value. A GitHub user. +func (m *NullableIssue) SetClosedBy(value NullableSimpleUserable)() { + m.closed_by = value +} +// SetComments sets the comments property value. The comments property +func (m *NullableIssue) SetComments(value *int32)() { + m.comments = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *NullableIssue) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *NullableIssue) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDraft sets the draft property value. The draft property +func (m *NullableIssue) SetDraft(value *bool)() { + m.draft = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *NullableIssue) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableIssue) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *NullableIssue) SetId(value *int64)() { + m.id = value +} +// SetLabels sets the labels property value. Labels to associate with this issue; pass one or more label names to replace the set of labels on this issue; send an empty array to clear all labels from the issue; note that the labels are silently dropped for users without push access to the repository +func (m *NullableIssue) SetLabels(value []string)() { + m.labels = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *NullableIssue) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLocked sets the locked property value. The locked property +func (m *NullableIssue) SetLocked(value *bool)() { + m.locked = value +} +// SetMilestone sets the milestone property value. A collection of related issues and pull requests. +func (m *NullableIssue) SetMilestone(value NullableMilestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableIssue) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. Number uniquely identifying the issue within its repository +func (m *NullableIssue) SetNumber(value *int32)() { + m.number = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *NullableIssue) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetPullRequest sets the pull_request property value. The pull_request property +func (m *NullableIssue) SetPullRequest(value NullableIssue_pull_requestable)() { + m.pull_request = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *NullableIssue) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetRepository sets the repository property value. A repository on GitHub. +func (m *NullableIssue) SetRepository(value Repositoryable)() { + m.repository = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *NullableIssue) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetState sets the state property value. State of the issue; either 'open' or 'closed' +func (m *NullableIssue) SetState(value *string)() { + m.state = value +} +// SetStateReason sets the state_reason property value. The reason for the current state +func (m *NullableIssue) SetStateReason(value *NullableIssue_state_reason)() { + m.state_reason = value +} +// SetTimelineUrl sets the timeline_url property value. The timeline_url property +func (m *NullableIssue) SetTimelineUrl(value *string)() { + m.timeline_url = value +} +// SetTitle sets the title property value. Title of the issue +func (m *NullableIssue) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *NullableIssue) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. URL for the issue +func (m *NullableIssue) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *NullableIssue) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type NullableIssueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveLockReason()(*string) + GetAssignee()(NullableSimpleUserable) + GetAssignees()([]SimpleUserable) + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetClosedBy()(NullableSimpleUserable) + GetComments()(*int32) + GetCommentsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDraft()(*bool) + GetEventsUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLabels()([]string) + GetLabelsUrl()(*string) + GetLocked()(*bool) + GetMilestone()(NullableMilestoneable) + GetNodeId()(*string) + GetNumber()(*int32) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetPullRequest()(NullableIssue_pull_requestable) + GetReactions()(ReactionRollupable) + GetRepository()(Repositoryable) + GetRepositoryUrl()(*string) + GetState()(*string) + GetStateReason()(*NullableIssue_state_reason) + GetTimelineUrl()(*string) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetActiveLockReason(value *string)() + SetAssignee(value NullableSimpleUserable)() + SetAssignees(value []SimpleUserable)() + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetClosedBy(value NullableSimpleUserable)() + SetComments(value *int32)() + SetCommentsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDraft(value *bool)() + SetEventsUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLabels(value []string)() + SetLabelsUrl(value *string)() + SetLocked(value *bool)() + SetMilestone(value NullableMilestoneable)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetPullRequest(value NullableIssue_pull_requestable)() + SetReactions(value ReactionRollupable)() + SetRepository(value Repositoryable)() + SetRepositoryUrl(value *string)() + SetState(value *string)() + SetStateReason(value *NullableIssue_state_reason)() + SetTimelineUrl(value *string)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/nullable_issue_escaped_pull_escaped_request.go b/pkg/github/models/nullable_issue_escaped_pull_escaped_request.go new file mode 100644 index 00000000..6929bb29 --- /dev/null +++ b/pkg/github/models/nullable_issue_escaped_pull_escaped_request.go @@ -0,0 +1,197 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NullableIssue_pull_request 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 diff_url property + diff_url *string + // The html_url property + html_url *string + // The merged_at property + merged_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The patch_url property + patch_url *string + // The url property + url *string +} +// NewNullableIssue_pull_request instantiates a new NullableIssue_pull_request and sets the default values. +func NewNullableIssue_pull_request()(*NullableIssue_pull_request) { + m := &NullableIssue_pull_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableIssue_pull_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableIssue_pull_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableIssue_pull_request(), 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 *NullableIssue_pull_request) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDiffUrl gets the diff_url property value. The diff_url property +// returns a *string when successful +func (m *NullableIssue_pull_request) GetDiffUrl()(*string) { + return m.diff_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableIssue_pull_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["diff_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["merged_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetMergedAt(val) + } + return nil + } + res["patch_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableIssue_pull_request) GetHtmlUrl()(*string) { + return m.html_url +} +// GetMergedAt gets the merged_at property value. The merged_at property +// returns a *Time when successful +func (m *NullableIssue_pull_request) GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.merged_at +} +// GetPatchUrl gets the patch_url property value. The patch_url property +// returns a *string when successful +func (m *NullableIssue_pull_request) GetPatchUrl()(*string) { + return m.patch_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableIssue_pull_request) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableIssue_pull_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("diff_url", m.GetDiffUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("merged_at", m.GetMergedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patch_url", m.GetPatchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableIssue_pull_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDiffUrl sets the diff_url property value. The diff_url property +func (m *NullableIssue_pull_request) SetDiffUrl(value *string)() { + m.diff_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableIssue_pull_request) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetMergedAt sets the merged_at property value. The merged_at property +func (m *NullableIssue_pull_request) SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.merged_at = value +} +// SetPatchUrl sets the patch_url property value. The patch_url property +func (m *NullableIssue_pull_request) SetPatchUrl(value *string)() { + m.patch_url = value +} +// SetUrl sets the url property value. The url property +func (m *NullableIssue_pull_request) SetUrl(value *string)() { + m.url = value +} +type NullableIssue_pull_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDiffUrl()(*string) + GetHtmlUrl()(*string) + GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPatchUrl()(*string) + GetUrl()(*string) + SetDiffUrl(value *string)() + SetHtmlUrl(value *string)() + SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPatchUrl(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/nullable_issue_escaped_state_escaped_reason.go b/pkg/github/models/nullable_issue_escaped_state_escaped_reason.go new file mode 100644 index 00000000..61d0ed5b --- /dev/null +++ b/pkg/github/models/nullable_issue_escaped_state_escaped_reason.go @@ -0,0 +1,37 @@ +package models +// The reason for the current state +type NullableIssue_state_reason int + +const ( + COMPLETED_NULLABLEISSUE_STATE_REASON NullableIssue_state_reason = iota + REOPENED_NULLABLEISSUE_STATE_REASON + NOT_PLANNED_NULLABLEISSUE_STATE_REASON +) + +func (i NullableIssue_state_reason) String() string { + return []string{"completed", "reopened", "not_planned"}[i] +} +func ParseNullableIssue_state_reason(v string) (any, error) { + result := COMPLETED_NULLABLEISSUE_STATE_REASON + switch v { + case "completed": + result = COMPLETED_NULLABLEISSUE_STATE_REASON + case "reopened": + result = REOPENED_NULLABLEISSUE_STATE_REASON + case "not_planned": + result = NOT_PLANNED_NULLABLEISSUE_STATE_REASON + default: + return nil, nil + } + return &result, nil +} +func SerializeNullableIssue_state_reason(values []NullableIssue_state_reason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableIssue_state_reason) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/nullable_license_simple.go b/pkg/github/models/nullable_license_simple.go new file mode 100644 index 00000000..38f6ea7d --- /dev/null +++ b/pkg/github/models/nullable_license_simple.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableLicenseSimple license Simple +type NullableLicenseSimple 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 html_url property + html_url *string + // The key property + key *string + // The name property + name *string + // The node_id property + node_id *string + // The spdx_id property + spdx_id *string + // The url property + url *string +} +// NewNullableLicenseSimple instantiates a new NullableLicenseSimple and sets the default values. +func NewNullableLicenseSimple()(*NullableLicenseSimple) { + m := &NullableLicenseSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableLicenseSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableLicenseSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableLicenseSimple(), 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 *NullableLicenseSimple) 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 *NullableLicenseSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + 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["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["spdx_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpdxId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableLicenseSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *NullableLicenseSimple) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *NullableLicenseSimple) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableLicenseSimple) GetNodeId()(*string) { + return m.node_id +} +// GetSpdxId gets the spdx_id property value. The spdx_id property +// returns a *string when successful +func (m *NullableLicenseSimple) GetSpdxId()(*string) { + return m.spdx_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableLicenseSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableLicenseSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("spdx_id", m.GetSpdxId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableLicenseSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableLicenseSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetKey sets the key property value. The key property +func (m *NullableLicenseSimple) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *NullableLicenseSimple) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableLicenseSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetSpdxId sets the spdx_id property value. The spdx_id property +func (m *NullableLicenseSimple) SetSpdxId(value *string)() { + m.spdx_id = value +} +// SetUrl sets the url property value. The url property +func (m *NullableLicenseSimple) SetUrl(value *string)() { + m.url = value +} +type NullableLicenseSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetKey()(*string) + GetName()(*string) + GetNodeId()(*string) + GetSpdxId()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetKey(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetSpdxId(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/nullable_milestone.go b/pkg/github/models/nullable_milestone.go new file mode 100644 index 00000000..d997e357 --- /dev/null +++ b/pkg/github/models/nullable_milestone.go @@ -0,0 +1,520 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableMilestone a collection of related issues and pull requests. +type NullableMilestone 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 closed_at property + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The closed_issues property + closed_issues *int32 + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + creator NullableSimpleUserable + // The description property + description *string + // The due_on property + due_on *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // The id property + id *int32 + // The labels_url property + labels_url *string + // The node_id property + node_id *string + // The number of the milestone. + number *int32 + // The open_issues property + open_issues *int32 + // The state of the milestone. + state *NullableMilestone_state + // The title of the milestone. + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewNullableMilestone instantiates a new NullableMilestone and sets the default values. +func NewNullableMilestone()(*NullableMilestone) { + m := &NullableMilestone{ + } + m.SetAdditionalData(make(map[string]any)) + stateValue := OPEN_NULLABLEMILESTONE_STATE + m.SetState(&stateValue) + return m +} +// CreateNullableMilestoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableMilestoneFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableMilestone(), 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 *NullableMilestone) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClosedAt gets the closed_at property value. The closed_at property +// returns a *Time when successful +func (m *NullableMilestone) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetClosedIssues gets the closed_issues property value. The closed_issues property +// returns a *int32 when successful +func (m *NullableMilestone) GetClosedIssues()(*int32) { + return m.closed_issues +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *NullableMilestone) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *NullableMilestone) GetCreator()(NullableSimpleUserable) { + return m.creator +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *NullableMilestone) GetDescription()(*string) { + return m.description +} +// GetDueOn gets the due_on property value. The due_on property +// returns a *Time when successful +func (m *NullableMilestone) GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.due_on +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableMilestone) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["closed_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetClosedIssues(val) + } + return nil + } + 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["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(NullableSimpleUserable)) + } + 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["due_on"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDueOn(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableMilestone_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*NullableMilestone_state)) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableMilestone) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *NullableMilestone) GetId()(*int32) { + return m.id +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *NullableMilestone) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableMilestone) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The number of the milestone. +// returns a *int32 when successful +func (m *NullableMilestone) GetNumber()(*int32) { + return m.number +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *NullableMilestone) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetState gets the state property value. The state of the milestone. +// returns a *NullableMilestone_state when successful +func (m *NullableMilestone) GetState()(*NullableMilestone_state) { + return m.state +} +// GetTitle gets the title property value. The title of the milestone. +// returns a *string when successful +func (m *NullableMilestone) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *NullableMilestone) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableMilestone) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableMilestone) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("closed_at", m.GetClosedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("closed_issues", m.GetClosedIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("due_on", m.GetDueOn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableMilestone) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClosedAt sets the closed_at property value. The closed_at property +func (m *NullableMilestone) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetClosedIssues sets the closed_issues property value. The closed_issues property +func (m *NullableMilestone) SetClosedIssues(value *int32)() { + m.closed_issues = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *NullableMilestone) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *NullableMilestone) SetCreator(value NullableSimpleUserable)() { + m.creator = value +} +// SetDescription sets the description property value. The description property +func (m *NullableMilestone) SetDescription(value *string)() { + m.description = value +} +// SetDueOn sets the due_on property value. The due_on property +func (m *NullableMilestone) SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.due_on = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableMilestone) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *NullableMilestone) SetId(value *int32)() { + m.id = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *NullableMilestone) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableMilestone) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The number of the milestone. +func (m *NullableMilestone) SetNumber(value *int32)() { + m.number = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *NullableMilestone) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetState sets the state property value. The state of the milestone. +func (m *NullableMilestone) SetState(value *NullableMilestone_state)() { + m.state = value +} +// SetTitle sets the title property value. The title of the milestone. +func (m *NullableMilestone) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *NullableMilestone) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *NullableMilestone) SetUrl(value *string)() { + m.url = value +} +type NullableMilestoneable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetClosedIssues()(*int32) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreator()(NullableSimpleUserable) + GetDescription()(*string) + GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLabelsUrl()(*string) + GetNodeId()(*string) + GetNumber()(*int32) + GetOpenIssues()(*int32) + GetState()(*NullableMilestone_state) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetClosedIssues(value *int32)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreator(value NullableSimpleUserable)() + SetDescription(value *string)() + SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLabelsUrl(value *string)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetOpenIssues(value *int32)() + SetState(value *NullableMilestone_state)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/nullable_milestone_escaped_state.go b/pkg/github/models/nullable_milestone_escaped_state.go new file mode 100644 index 00000000..abcd5ae3 --- /dev/null +++ b/pkg/github/models/nullable_milestone_escaped_state.go @@ -0,0 +1,34 @@ +package models +// The state of the milestone. +type NullableMilestone_state int + +const ( + OPEN_NULLABLEMILESTONE_STATE NullableMilestone_state = iota + CLOSED_NULLABLEMILESTONE_STATE +) + +func (i NullableMilestone_state) String() string { + return []string{"open", "closed"}[i] +} +func ParseNullableMilestone_state(v string) (any, error) { + result := OPEN_NULLABLEMILESTONE_STATE + switch v { + case "open": + result = OPEN_NULLABLEMILESTONE_STATE + case "closed": + result = CLOSED_NULLABLEMILESTONE_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeNullableMilestone_state(values []NullableMilestone_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableMilestone_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/nullable_minimal_repository.go b/pkg/github/models/nullable_minimal_repository.go new file mode 100644 index 00000000..56399ad4 --- /dev/null +++ b/pkg/github/models/nullable_minimal_repository.go @@ -0,0 +1,2582 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableMinimalRepository minimal Repository +type NullableMinimalRepository 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 allow_forking property + allow_forking *bool + // The archive_url property + archive_url *string + // The archived property + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // Code Of Conduct + code_of_conduct CodeOfConductable + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default_branch property + default_branch *string + // The delete_branch_on_merge property + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // The disabled property + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // The has_discussions property + has_discussions *bool + // The has_downloads property + has_downloads *bool + // The has_issues property + has_issues *bool + // The has_pages property + has_pages *bool + // The has_projects property + has_projects *bool + // The has_wiki property + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int64 + // The is_template property + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // The license property + license NullableMinimalRepository_licenseable + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name property + name *string + // The network_count property + network_count *int32 + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // A GitHub user. + owner SimpleUserable + // The permissions property + permissions NullableMinimalRepository_permissionsable + // The private property + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The role_name property + role_name *string + // The security_and_analysis property + security_and_analysis SecurityAndAnalysisable + // The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + size *int32 + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_count property + subscribers_count *int32 + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The visibility property + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewNullableMinimalRepository instantiates a new NullableMinimalRepository and sets the default values. +func NewNullableMinimalRepository()(*NullableMinimalRepository) { + m := &NullableMinimalRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableMinimalRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableMinimalRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableMinimalRepository(), 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 *NullableMinimalRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowForking gets the allow_forking property value. The allow_forking property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetArchived gets the archived property value. The archived property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCodeOfConduct gets the code_of_conduct property value. Code Of Conduct +// returns a CodeOfConductable when successful +func (m *NullableMinimalRepository) GetCodeOfConduct()(CodeOfConductable) { + return m.code_of_conduct +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *NullableMinimalRepository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default_branch property +// returns a *string when successful +func (m *NullableMinimalRepository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. The delete_branch_on_merge property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *NullableMinimalRepository) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. The disabled property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableMinimalRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["code_of_conduct"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateCodeOfConductFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeOfConduct(val.(CodeOfConductable)) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + 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["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + 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["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMinimalRepository_licenseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableMinimalRepository_licenseable)) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(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["network_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNetworkCount(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMinimalRepository_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(NullableMinimalRepository_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["role_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRoleName(val) + } + return nil + } + res["security_and_analysis"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecurityAndAnalysisFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAndAnalysis(val.(SecurityAndAnalysisable)) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersCount(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = 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.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *NullableMinimalRepository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. The has_discussions property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. The has_downloads property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. The has_issues property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. The has_projects property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. The has_wiki property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *NullableMinimalRepository) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *NullableMinimalRepository) GetId()(*int64) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. The is_template property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *NullableMinimalRepository) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. The license property +// returns a NullableMinimalRepository_licenseable when successful +func (m *NullableMinimalRepository) GetLicense()(NullableMinimalRepository_licenseable) { + return m.license +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *NullableMinimalRepository) GetName()(*string) { + return m.name +} +// GetNetworkCount gets the network_count property value. The network_count property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetNetworkCount()(*int32) { + return m.network_count +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableMinimalRepository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *NullableMinimalRepository) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a NullableMinimalRepository_permissionsable when successful +func (m *NullableMinimalRepository) GetPermissions()(NullableMinimalRepository_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. The private property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *NullableMinimalRepository) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetRoleName gets the role_name property value. The role_name property +// returns a *string when successful +func (m *NullableMinimalRepository) GetRoleName()(*string) { + return m.role_name +} +// GetSecurityAndAnalysis gets the security_and_analysis property value. The security_and_analysis property +// returns a SecurityAndAnalysisable when successful +func (m *NullableMinimalRepository) GetSecurityAndAnalysis()(SecurityAndAnalysisable) { + return m.security_and_analysis +} +// GetSize gets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetSize()(*int32) { + return m.size +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersCount gets the subscribers_count property value. The subscribers_count property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetSubscribersCount()(*int32) { + return m.subscribers_count +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *NullableMinimalRepository) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *NullableMinimalRepository) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *NullableMinimalRepository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableMinimalRepository) GetUrl()(*string) { + return m.url +} +// GetVisibility gets the visibility property value. The visibility property +// returns a *string when successful +func (m *NullableMinimalRepository) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *NullableMinimalRepository) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *NullableMinimalRepository) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *NullableMinimalRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("code_of_conduct", m.GetCodeOfConduct()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("network_count", m.GetNetworkCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("role_name", m.GetRoleName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("security_and_analysis", m.GetSecurityAndAnalysis()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("subscribers_count", m.GetSubscribersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *NullableMinimalRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowForking sets the allow_forking property value. The allow_forking property +func (m *NullableMinimalRepository) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetArchived sets the archived property value. The archived property +func (m *NullableMinimalRepository) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *NullableMinimalRepository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *NullableMinimalRepository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *NullableMinimalRepository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *NullableMinimalRepository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *NullableMinimalRepository) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCodeOfConduct sets the code_of_conduct property value. Code Of Conduct +func (m *NullableMinimalRepository) SetCodeOfConduct(value CodeOfConductable)() { + m.code_of_conduct = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *NullableMinimalRepository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *NullableMinimalRepository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *NullableMinimalRepository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *NullableMinimalRepository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *NullableMinimalRepository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *NullableMinimalRepository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *NullableMinimalRepository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default_branch property +func (m *NullableMinimalRepository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. The delete_branch_on_merge property +func (m *NullableMinimalRepository) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *NullableMinimalRepository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *NullableMinimalRepository) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. The disabled property +func (m *NullableMinimalRepository) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *NullableMinimalRepository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *NullableMinimalRepository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *NullableMinimalRepository) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *NullableMinimalRepository) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *NullableMinimalRepository) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *NullableMinimalRepository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *NullableMinimalRepository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *NullableMinimalRepository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *NullableMinimalRepository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *NullableMinimalRepository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *NullableMinimalRepository) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. The has_discussions property +func (m *NullableMinimalRepository) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. The has_downloads property +func (m *NullableMinimalRepository) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. The has_issues property +func (m *NullableMinimalRepository) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *NullableMinimalRepository) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. The has_projects property +func (m *NullableMinimalRepository) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. The has_wiki property +func (m *NullableMinimalRepository) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *NullableMinimalRepository) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *NullableMinimalRepository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableMinimalRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *NullableMinimalRepository) SetId(value *int64)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *NullableMinimalRepository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *NullableMinimalRepository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *NullableMinimalRepository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. The is_template property +func (m *NullableMinimalRepository) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *NullableMinimalRepository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *NullableMinimalRepository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *NullableMinimalRepository) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *NullableMinimalRepository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. The license property +func (m *NullableMinimalRepository) SetLicense(value NullableMinimalRepository_licenseable)() { + m.license = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *NullableMinimalRepository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *NullableMinimalRepository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *NullableMinimalRepository) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name property +func (m *NullableMinimalRepository) SetName(value *string)() { + m.name = value +} +// SetNetworkCount sets the network_count property value. The network_count property +func (m *NullableMinimalRepository) SetNetworkCount(value *int32)() { + m.network_count = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableMinimalRepository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *NullableMinimalRepository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *NullableMinimalRepository) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *NullableMinimalRepository) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *NullableMinimalRepository) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *NullableMinimalRepository) SetPermissions(value NullableMinimalRepository_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. The private property +func (m *NullableMinimalRepository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *NullableMinimalRepository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *NullableMinimalRepository) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *NullableMinimalRepository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetRoleName sets the role_name property value. The role_name property +func (m *NullableMinimalRepository) SetRoleName(value *string)() { + m.role_name = value +} +// SetSecurityAndAnalysis sets the security_and_analysis property value. The security_and_analysis property +func (m *NullableMinimalRepository) SetSecurityAndAnalysis(value SecurityAndAnalysisable)() { + m.security_and_analysis = value +} +// SetSize sets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +func (m *NullableMinimalRepository) SetSize(value *int32)() { + m.size = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *NullableMinimalRepository) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *NullableMinimalRepository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *NullableMinimalRepository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *NullableMinimalRepository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersCount sets the subscribers_count property value. The subscribers_count property +func (m *NullableMinimalRepository) SetSubscribersCount(value *int32)() { + m.subscribers_count = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *NullableMinimalRepository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *NullableMinimalRepository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *NullableMinimalRepository) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *NullableMinimalRepository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *NullableMinimalRepository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *NullableMinimalRepository) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *NullableMinimalRepository) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *NullableMinimalRepository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *NullableMinimalRepository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *NullableMinimalRepository) SetUrl(value *string)() { + m.url = value +} +// SetVisibility sets the visibility property value. The visibility property +func (m *NullableMinimalRepository) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *NullableMinimalRepository) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *NullableMinimalRepository) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *NullableMinimalRepository) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type NullableMinimalRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowForking()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCodeOfConduct()(CodeOfConductable) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(NullableMinimalRepository_licenseable) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNetworkCount()(*int32) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(SimpleUserable) + GetPermissions()(NullableMinimalRepository_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetRoleName()(*string) + GetSecurityAndAnalysis()(SecurityAndAnalysisable) + GetSize()(*int32) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersCount()(*int32) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowForking(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCodeOfConduct(value CodeOfConductable)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value NullableMinimalRepository_licenseable)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNetworkCount(value *int32)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value SimpleUserable)() + SetPermissions(value NullableMinimalRepository_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetRoleName(value *string)() + SetSecurityAndAnalysis(value SecurityAndAnalysisable)() + SetSize(value *int32)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersCount(value *int32)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/pkg/github/models/nullable_minimal_repository_escaped_license.go b/pkg/github/models/nullable_minimal_repository_escaped_license.go new file mode 100644 index 00000000..fc5616a8 --- /dev/null +++ b/pkg/github/models/nullable_minimal_repository_escaped_license.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NullableMinimalRepository_license 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 key property + key *string + // The name property + name *string + // The node_id property + node_id *string + // The spdx_id property + spdx_id *string + // The url property + url *string +} +// NewNullableMinimalRepository_license instantiates a new NullableMinimalRepository_license and sets the default values. +func NewNullableMinimalRepository_license()(*NullableMinimalRepository_license) { + m := &NullableMinimalRepository_license{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableMinimalRepository_licenseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableMinimalRepository_licenseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableMinimalRepository_license(), 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 *NullableMinimalRepository_license) 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 *NullableMinimalRepository_license) 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["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["spdx_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpdxId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *NullableMinimalRepository_license) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *NullableMinimalRepository_license) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableMinimalRepository_license) GetNodeId()(*string) { + return m.node_id +} +// GetSpdxId gets the spdx_id property value. The spdx_id property +// returns a *string when successful +func (m *NullableMinimalRepository_license) GetSpdxId()(*string) { + return m.spdx_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableMinimalRepository_license) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableMinimalRepository_license) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("spdx_id", m.GetSpdxId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableMinimalRepository_license) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The key property +func (m *NullableMinimalRepository_license) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *NullableMinimalRepository_license) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableMinimalRepository_license) SetNodeId(value *string)() { + m.node_id = value +} +// SetSpdxId sets the spdx_id property value. The spdx_id property +func (m *NullableMinimalRepository_license) SetSpdxId(value *string)() { + m.spdx_id = value +} +// SetUrl sets the url property value. The url property +func (m *NullableMinimalRepository_license) SetUrl(value *string)() { + m.url = value +} +type NullableMinimalRepository_licenseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetName()(*string) + GetNodeId()(*string) + GetSpdxId()(*string) + GetUrl()(*string) + SetKey(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetSpdxId(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/nullable_minimal_repository_escaped_permissions.go b/pkg/github/models/nullable_minimal_repository_escaped_permissions.go new file mode 100644 index 00000000..4a043afc --- /dev/null +++ b/pkg/github/models/nullable_minimal_repository_escaped_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NullableMinimalRepository_permissions 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 admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewNullableMinimalRepository_permissions instantiates a new NullableMinimalRepository_permissions and sets the default values. +func NewNullableMinimalRepository_permissions()(*NullableMinimalRepository_permissions) { + m := &NullableMinimalRepository_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableMinimalRepository_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableMinimalRepository_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableMinimalRepository_permissions(), 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 *NullableMinimalRepository_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *NullableMinimalRepository_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableMinimalRepository_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *NullableMinimalRepository_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *NullableMinimalRepository_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *NullableMinimalRepository_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *NullableMinimalRepository_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *NullableMinimalRepository_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *NullableMinimalRepository_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *NullableMinimalRepository_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *NullableMinimalRepository_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *NullableMinimalRepository_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *NullableMinimalRepository_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *NullableMinimalRepository_permissions) SetTriage(value *bool)() { + m.triage = value +} +type NullableMinimalRepository_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/pkg/github/models/nullable_repository.go b/pkg/github/models/nullable_repository.go new file mode 100644 index 00000000..c3080c62 --- /dev/null +++ b/pkg/github/models/nullable_repository.go @@ -0,0 +1,2826 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableRepository a repository on GitHub. +type NullableRepository 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 allow Auto-merge to be used on pull requests. + allow_auto_merge *bool + // Whether to allow forking this repo + allow_forking *bool + // Whether to allow merge commits for pull requests. + allow_merge_commit *bool + // Whether to allow rebase merges for pull requests. + allow_rebase_merge *bool + // Whether to allow squash merges for pull requests. + allow_squash_merge *bool + // Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. + allow_update_branch *bool + // Whether anonymous git access is enabled for this repository + anonymous_access_enabled *bool + // The archive_url property + archive_url *string + // Whether the repository is archived. + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default branch of the repository. + default_branch *string + // Whether to delete head branches when pull requests are merged + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // Returns whether or not this repository disabled. + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // Whether discussions are enabled. + has_discussions *bool + // Whether downloads are enabled. + // Deprecated: + has_downloads *bool + // Whether issues are enabled. + has_issues *bool + // The has_pages property + has_pages *bool + // Whether projects are enabled. + has_projects *bool + // Whether the wiki is enabled. + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // Unique identifier of the repository + id *int64 + // Whether this repository acts as a template that can be used to generate new repositories. + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // License Simple + license NullableLicenseSimpleable + // The master_branch property + master_branch *string + // The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. + merge_commit_message *NullableRepository_merge_commit_message + // The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + merge_commit_title *NullableRepository_merge_commit_title + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name of the repository. + name *string + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // A GitHub user. + owner SimpleUserable + // The permissions property + permissions NullableRepository_permissionsable + // Whether the repository is private or public. + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + size *int32 + // The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. + squash_merge_commit_message *NullableRepository_squash_merge_commit_message + // The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + squash_merge_commit_title *NullableRepository_squash_merge_commit_title + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The starred_at property + starred_at *string + // The statuses_url property + statuses_url *string + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + // Deprecated: + use_squash_pr_title_as_default *bool + // The repository visibility: public, private, or internal. + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // Whether to require contributors to sign off on web-based commits + web_commit_signoff_required *bool +} +// NewNullableRepository instantiates a new NullableRepository and sets the default values. +func NewNullableRepository()(*NullableRepository) { + m := &NullableRepository{ + } + m.SetAdditionalData(make(map[string]any)) + visibilityValue := "public" + m.SetVisibility(&visibilityValue) + return m +} +// CreateNullableRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableRepository(), 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 *NullableRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +// returns a *bool when successful +func (m *NullableRepository) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowForking gets the allow_forking property value. Whether to allow forking this repo +// returns a *bool when successful +func (m *NullableRepository) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +// returns a *bool when successful +func (m *NullableRepository) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +// returns a *bool when successful +func (m *NullableRepository) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +// returns a *bool when successful +func (m *NullableRepository) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAllowUpdateBranch gets the allow_update_branch property value. Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. +// returns a *bool when successful +func (m *NullableRepository) GetAllowUpdateBranch()(*bool) { + return m.allow_update_branch +} +// GetAnonymousAccessEnabled gets the anonymous_access_enabled property value. Whether anonymous git access is enabled for this repository +// returns a *bool when successful +func (m *NullableRepository) GetAnonymousAccessEnabled()(*bool) { + return m.anonymous_access_enabled +} +// GetArchived gets the archived property value. Whether the repository is archived. +// returns a *bool when successful +func (m *NullableRepository) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *NullableRepository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *NullableRepository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *NullableRepository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *NullableRepository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *NullableRepository) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *NullableRepository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *NullableRepository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *NullableRepository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *NullableRepository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *NullableRepository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *NullableRepository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *NullableRepository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default branch of the repository. +// returns a *string when successful +func (m *NullableRepository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +// returns a *bool when successful +func (m *NullableRepository) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *NullableRepository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *NullableRepository) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. Returns whether or not this repository disabled. +// returns a *bool when successful +func (m *NullableRepository) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *NullableRepository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *NullableRepository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["allow_update_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowUpdateBranch(val) + } + return nil + } + res["anonymous_access_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAnonymousAccessEnabled(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + 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["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + 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["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + return nil + } + res["master_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMasterBranch(val) + } + return nil + } + res["merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableRepository_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitMessage(val.(*NullableRepository_merge_commit_message)) + } + return nil + } + res["merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableRepository_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitTitle(val.(*NullableRepository_merge_commit_title)) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableRepository_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(NullableRepository_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["squash_merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableRepository_squash_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitMessage(val.(*NullableRepository_squash_merge_commit_message)) + } + return nil + } + res["squash_merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableRepository_squash_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitTitle(val.(*NullableRepository_squash_merge_commit_title)) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["starred_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredAt(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = 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.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *NullableRepository) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *NullableRepository) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *NullableRepository) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *NullableRepository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *NullableRepository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *NullableRepository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *NullableRepository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *NullableRepository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *NullableRepository) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. Whether discussions are enabled. +// returns a *bool when successful +func (m *NullableRepository) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. Whether downloads are enabled. +// Deprecated: +// returns a *bool when successful +func (m *NullableRepository) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. Whether issues are enabled. +// returns a *bool when successful +func (m *NullableRepository) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *NullableRepository) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. Whether projects are enabled. +// returns a *bool when successful +func (m *NullableRepository) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. Whether the wiki is enabled. +// returns a *bool when successful +func (m *NullableRepository) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *NullableRepository) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *NullableRepository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the repository +// returns a *int64 when successful +func (m *NullableRepository) GetId()(*int64) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *NullableRepository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *NullableRepository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *NullableRepository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +// returns a *bool when successful +func (m *NullableRepository) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *NullableRepository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *NullableRepository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *NullableRepository) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *NullableRepository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *NullableRepository) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetMasterBranch gets the master_branch property value. The master_branch property +// returns a *string when successful +func (m *NullableRepository) GetMasterBranch()(*string) { + return m.master_branch +} +// GetMergeCommitMessage gets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +// returns a *NullableRepository_merge_commit_message when successful +func (m *NullableRepository) GetMergeCommitMessage()(*NullableRepository_merge_commit_message) { + return m.merge_commit_message +} +// GetMergeCommitTitle gets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +// returns a *NullableRepository_merge_commit_title when successful +func (m *NullableRepository) GetMergeCommitTitle()(*NullableRepository_merge_commit_title) { + return m.merge_commit_title +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *NullableRepository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *NullableRepository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *NullableRepository) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *NullableRepository) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableRepository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *NullableRepository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *NullableRepository) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *NullableRepository) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *NullableRepository) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a NullableRepository_permissionsable when successful +func (m *NullableRepository) GetPermissions()(NullableRepository_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. Whether the repository is private or public. +// returns a *bool when successful +func (m *NullableRepository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *NullableRepository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *NullableRepository) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *NullableRepository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetSize gets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +// returns a *int32 when successful +func (m *NullableRepository) GetSize()(*int32) { + return m.size +} +// GetSquashMergeCommitMessage gets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +// returns a *NullableRepository_squash_merge_commit_message when successful +func (m *NullableRepository) GetSquashMergeCommitMessage()(*NullableRepository_squash_merge_commit_message) { + return m.squash_merge_commit_message +} +// GetSquashMergeCommitTitle gets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +// returns a *NullableRepository_squash_merge_commit_title when successful +func (m *NullableRepository) GetSquashMergeCommitTitle()(*NullableRepository_squash_merge_commit_title) { + return m.squash_merge_commit_title +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *NullableRepository) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *NullableRepository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *NullableRepository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStarredAt gets the starred_at property value. The starred_at property +// returns a *string when successful +func (m *NullableRepository) GetStarredAt()(*string) { + return m.starred_at +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *NullableRepository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *NullableRepository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *NullableRepository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *NullableRepository) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *NullableRepository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *NullableRepository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *NullableRepository) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *NullableRepository) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *NullableRepository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *NullableRepository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableRepository) GetUrl()(*string) { + return m.url +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +// returns a *bool when successful +func (m *NullableRepository) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// GetVisibility gets the visibility property value. The repository visibility: public, private, or internal. +// returns a *string when successful +func (m *NullableRepository) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *NullableRepository) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *NullableRepository) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. Whether to require contributors to sign off on web-based commits +// returns a *bool when successful +func (m *NullableRepository) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *NullableRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_update_branch", m.GetAllowUpdateBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("anonymous_access_enabled", m.GetAnonymousAccessEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("master_branch", m.GetMasterBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + if m.GetMergeCommitMessage() != nil { + cast := (*m.GetMergeCommitMessage()).String() + err := writer.WriteStringValue("merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetMergeCommitTitle() != nil { + cast := (*m.GetMergeCommitTitle()).String() + err := writer.WriteStringValue("merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitMessage() != nil { + cast := (*m.GetSquashMergeCommitMessage()).String() + err := writer.WriteStringValue("squash_merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitTitle() != nil { + cast := (*m.GetSquashMergeCommitTitle()).String() + err := writer.WriteStringValue("squash_merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_at", m.GetStarredAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *NullableRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +func (m *NullableRepository) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowForking sets the allow_forking property value. Whether to allow forking this repo +func (m *NullableRepository) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +func (m *NullableRepository) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +func (m *NullableRepository) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +func (m *NullableRepository) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAllowUpdateBranch sets the allow_update_branch property value. Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. +func (m *NullableRepository) SetAllowUpdateBranch(value *bool)() { + m.allow_update_branch = value +} +// SetAnonymousAccessEnabled sets the anonymous_access_enabled property value. Whether anonymous git access is enabled for this repository +func (m *NullableRepository) SetAnonymousAccessEnabled(value *bool)() { + m.anonymous_access_enabled = value +} +// SetArchived sets the archived property value. Whether the repository is archived. +func (m *NullableRepository) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *NullableRepository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *NullableRepository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *NullableRepository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *NullableRepository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *NullableRepository) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *NullableRepository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *NullableRepository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *NullableRepository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *NullableRepository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *NullableRepository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *NullableRepository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *NullableRepository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default branch of the repository. +func (m *NullableRepository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +func (m *NullableRepository) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *NullableRepository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *NullableRepository) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. Returns whether or not this repository disabled. +func (m *NullableRepository) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *NullableRepository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *NullableRepository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *NullableRepository) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *NullableRepository) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *NullableRepository) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *NullableRepository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *NullableRepository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *NullableRepository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *NullableRepository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *NullableRepository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *NullableRepository) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. Whether discussions are enabled. +func (m *NullableRepository) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. Whether downloads are enabled. +// Deprecated: +func (m *NullableRepository) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. Whether issues are enabled. +func (m *NullableRepository) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *NullableRepository) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. Whether projects are enabled. +func (m *NullableRepository) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. Whether the wiki is enabled. +func (m *NullableRepository) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *NullableRepository) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *NullableRepository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the repository +func (m *NullableRepository) SetId(value *int64)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *NullableRepository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *NullableRepository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *NullableRepository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +func (m *NullableRepository) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *NullableRepository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *NullableRepository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *NullableRepository) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *NullableRepository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. License Simple +func (m *NullableRepository) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetMasterBranch sets the master_branch property value. The master_branch property +func (m *NullableRepository) SetMasterBranch(value *string)() { + m.master_branch = value +} +// SetMergeCommitMessage sets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +func (m *NullableRepository) SetMergeCommitMessage(value *NullableRepository_merge_commit_message)() { + m.merge_commit_message = value +} +// SetMergeCommitTitle sets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +func (m *NullableRepository) SetMergeCommitTitle(value *NullableRepository_merge_commit_title)() { + m.merge_commit_title = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *NullableRepository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *NullableRepository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *NullableRepository) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name of the repository. +func (m *NullableRepository) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableRepository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *NullableRepository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *NullableRepository) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *NullableRepository) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *NullableRepository) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *NullableRepository) SetPermissions(value NullableRepository_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. Whether the repository is private or public. +func (m *NullableRepository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *NullableRepository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *NullableRepository) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *NullableRepository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetSize sets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +func (m *NullableRepository) SetSize(value *int32)() { + m.size = value +} +// SetSquashMergeCommitMessage sets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +func (m *NullableRepository) SetSquashMergeCommitMessage(value *NullableRepository_squash_merge_commit_message)() { + m.squash_merge_commit_message = value +} +// SetSquashMergeCommitTitle sets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +func (m *NullableRepository) SetSquashMergeCommitTitle(value *NullableRepository_squash_merge_commit_title)() { + m.squash_merge_commit_title = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *NullableRepository) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *NullableRepository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *NullableRepository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStarredAt sets the starred_at property value. The starred_at property +func (m *NullableRepository) SetStarredAt(value *string)() { + m.starred_at = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *NullableRepository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *NullableRepository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *NullableRepository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *NullableRepository) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *NullableRepository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *NullableRepository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *NullableRepository) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *NullableRepository) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *NullableRepository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *NullableRepository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *NullableRepository) SetUrl(value *string)() { + m.url = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +func (m *NullableRepository) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +// SetVisibility sets the visibility property value. The repository visibility: public, private, or internal. +func (m *NullableRepository) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *NullableRepository) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *NullableRepository) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. Whether to require contributors to sign off on web-based commits +func (m *NullableRepository) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type NullableRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAllowUpdateBranch()(*bool) + GetAnonymousAccessEnabled()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(NullableLicenseSimpleable) + GetMasterBranch()(*string) + GetMergeCommitMessage()(*NullableRepository_merge_commit_message) + GetMergeCommitTitle()(*NullableRepository_merge_commit_title) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(SimpleUserable) + GetPermissions()(NullableRepository_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetSize()(*int32) + GetSquashMergeCommitMessage()(*NullableRepository_squash_merge_commit_message) + GetSquashMergeCommitTitle()(*NullableRepository_squash_merge_commit_title) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStarredAt()(*string) + GetStatusesUrl()(*string) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUseSquashPrTitleAsDefault()(*bool) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAllowUpdateBranch(value *bool)() + SetAnonymousAccessEnabled(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value NullableLicenseSimpleable)() + SetMasterBranch(value *string)() + SetMergeCommitMessage(value *NullableRepository_merge_commit_message)() + SetMergeCommitTitle(value *NullableRepository_merge_commit_title)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value SimpleUserable)() + SetPermissions(value NullableRepository_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetSize(value *int32)() + SetSquashMergeCommitMessage(value *NullableRepository_squash_merge_commit_message)() + SetSquashMergeCommitTitle(value *NullableRepository_squash_merge_commit_title)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStarredAt(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUseSquashPrTitleAsDefault(value *bool)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/pkg/github/models/nullable_repository_escaped_merge_escaped_commit_escaped_message.go b/pkg/github/models/nullable_repository_escaped_merge_escaped_commit_escaped_message.go new file mode 100644 index 00000000..fe229660 --- /dev/null +++ b/pkg/github/models/nullable_repository_escaped_merge_escaped_commit_escaped_message.go @@ -0,0 +1,37 @@ +package models +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type NullableRepository_merge_commit_message int + +const ( + PR_BODY_NULLABLEREPOSITORY_MERGE_COMMIT_MESSAGE NullableRepository_merge_commit_message = iota + PR_TITLE_NULLABLEREPOSITORY_MERGE_COMMIT_MESSAGE + BLANK_NULLABLEREPOSITORY_MERGE_COMMIT_MESSAGE +) + +func (i NullableRepository_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParseNullableRepository_merge_commit_message(v string) (any, error) { + result := PR_BODY_NULLABLEREPOSITORY_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_NULLABLEREPOSITORY_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_NULLABLEREPOSITORY_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_NULLABLEREPOSITORY_MERGE_COMMIT_MESSAGE + default: + return nil, nil + } + return &result, nil +} +func SerializeNullableRepository_merge_commit_message(values []NullableRepository_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableRepository_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/nullable_repository_escaped_merge_escaped_commit_escaped_title.go b/pkg/github/models/nullable_repository_escaped_merge_escaped_commit_escaped_title.go new file mode 100644 index 00000000..06fbbd7f --- /dev/null +++ b/pkg/github/models/nullable_repository_escaped_merge_escaped_commit_escaped_title.go @@ -0,0 +1,34 @@ +package models +// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +type NullableRepository_merge_commit_title int + +const ( + PR_TITLE_NULLABLEREPOSITORY_MERGE_COMMIT_TITLE NullableRepository_merge_commit_title = iota + MERGE_MESSAGE_NULLABLEREPOSITORY_MERGE_COMMIT_TITLE +) + +func (i NullableRepository_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParseNullableRepository_merge_commit_title(v string) (any, error) { + result := PR_TITLE_NULLABLEREPOSITORY_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_NULLABLEREPOSITORY_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_NULLABLEREPOSITORY_MERGE_COMMIT_TITLE + default: + return nil, nil + } + return &result, nil +} +func SerializeNullableRepository_merge_commit_title(values []NullableRepository_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableRepository_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/nullable_repository_escaped_permissions.go b/pkg/github/models/nullable_repository_escaped_permissions.go new file mode 100644 index 00000000..81ce08e8 --- /dev/null +++ b/pkg/github/models/nullable_repository_escaped_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NullableRepository_permissions 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 admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewNullableRepository_permissions instantiates a new NullableRepository_permissions and sets the default values. +func NewNullableRepository_permissions()(*NullableRepository_permissions) { + m := &NullableRepository_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableRepository_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableRepository_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableRepository_permissions(), 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 *NullableRepository_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *NullableRepository_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableRepository_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *NullableRepository_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *NullableRepository_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *NullableRepository_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *NullableRepository_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *NullableRepository_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *NullableRepository_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *NullableRepository_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *NullableRepository_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *NullableRepository_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *NullableRepository_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *NullableRepository_permissions) SetTriage(value *bool)() { + m.triage = value +} +type NullableRepository_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/pkg/github/models/nullable_repository_escaped_squash_escaped_merge_escaped_commit_escaped_message.go b/pkg/github/models/nullable_repository_escaped_squash_escaped_merge_escaped_commit_escaped_message.go new file mode 100644 index 00000000..2acd6cdb --- /dev/null +++ b/pkg/github/models/nullable_repository_escaped_squash_escaped_merge_escaped_commit_escaped_message.go @@ -0,0 +1,37 @@ +package models +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type NullableRepository_squash_merge_commit_message int + +const ( + PR_BODY_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE NullableRepository_squash_merge_commit_message = iota + COMMIT_MESSAGES_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i NullableRepository_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParseNullableRepository_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + default: + return nil, nil + } + return &result, nil +} +func SerializeNullableRepository_squash_merge_commit_message(values []NullableRepository_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableRepository_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/nullable_repository_escaped_squash_escaped_merge_escaped_commit_escaped_title.go b/pkg/github/models/nullable_repository_escaped_squash_escaped_merge_escaped_commit_escaped_title.go new file mode 100644 index 00000000..cd27d7ef --- /dev/null +++ b/pkg/github/models/nullable_repository_escaped_squash_escaped_merge_escaped_commit_escaped_title.go @@ -0,0 +1,34 @@ +package models +// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type NullableRepository_squash_merge_commit_title int + +const ( + PR_TITLE_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_TITLE NullableRepository_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_TITLE +) + +func (i NullableRepository_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParseNullableRepository_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_NULLABLEREPOSITORY_SQUASH_MERGE_COMMIT_TITLE + default: + return nil, nil + } + return &result, nil +} +func SerializeNullableRepository_squash_merge_commit_title(values []NullableRepository_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableRepository_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/nullable_scoped_installation.go b/pkg/github/models/nullable_scoped_installation.go new file mode 100644 index 00000000..774a11c6 --- /dev/null +++ b/pkg/github/models/nullable_scoped_installation.go @@ -0,0 +1,261 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NullableScopedInstallation struct { + // A GitHub user. + account SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The has_multiple_single_files property + has_multiple_single_files *bool + // The permissions granted to the user access token. + permissions AppPermissionsable + // The repositories_url property + repositories_url *string + // Describe whether all repositories have been selected or there's a selection involved + repository_selection *NullableScopedInstallation_repository_selection + // The single_file_name property + single_file_name *string + // The single_file_paths property + single_file_paths []string +} +// NewNullableScopedInstallation instantiates a new NullableScopedInstallation and sets the default values. +func NewNullableScopedInstallation()(*NullableScopedInstallation) { + m := &NullableScopedInstallation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableScopedInstallationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableScopedInstallationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableScopedInstallation(), nil +} +// GetAccount gets the account property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *NullableScopedInstallation) GetAccount()(SimpleUserable) { + return m.account +} +// 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 *NullableScopedInstallation) 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 *NullableScopedInstallation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["account"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAccount(val.(SimpleUserable)) + } + return nil + } + res["has_multiple_single_files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasMultipleSingleFiles(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAppPermissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(AppPermissionsable)) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseNullableScopedInstallation_repository_selection) + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val.(*NullableScopedInstallation_repository_selection)) + } + return nil + } + res["single_file_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSingleFileName(val) + } + return nil + } + res["single_file_paths"] = 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.SetSingleFilePaths(res) + } + return nil + } + return res +} +// GetHasMultipleSingleFiles gets the has_multiple_single_files property value. The has_multiple_single_files property +// returns a *bool when successful +func (m *NullableScopedInstallation) GetHasMultipleSingleFiles()(*bool) { + return m.has_multiple_single_files +} +// GetPermissions gets the permissions property value. The permissions granted to the user access token. +// returns a AppPermissionsable when successful +func (m *NullableScopedInstallation) GetPermissions()(AppPermissionsable) { + return m.permissions +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *NullableScopedInstallation) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetRepositorySelection gets the repository_selection property value. Describe whether all repositories have been selected or there's a selection involved +// returns a *NullableScopedInstallation_repository_selection when successful +func (m *NullableScopedInstallation) GetRepositorySelection()(*NullableScopedInstallation_repository_selection) { + return m.repository_selection +} +// GetSingleFileName gets the single_file_name property value. The single_file_name property +// returns a *string when successful +func (m *NullableScopedInstallation) GetSingleFileName()(*string) { + return m.single_file_name +} +// GetSingleFilePaths gets the single_file_paths property value. The single_file_paths property +// returns a []string when successful +func (m *NullableScopedInstallation) GetSingleFilePaths()([]string) { + return m.single_file_paths +} +// Serialize serializes information the current object +func (m *NullableScopedInstallation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("account", m.GetAccount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_multiple_single_files", m.GetHasMultipleSingleFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + if m.GetRepositorySelection() != nil { + cast := (*m.GetRepositorySelection()).String() + err := writer.WriteStringValue("repository_selection", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("single_file_name", m.GetSingleFileName()) + if err != nil { + return err + } + } + if m.GetSingleFilePaths() != nil { + err := writer.WriteCollectionOfStringValues("single_file_paths", m.GetSingleFilePaths()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccount sets the account property value. A GitHub user. +func (m *NullableScopedInstallation) SetAccount(value SimpleUserable)() { + m.account = 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 *NullableScopedInstallation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHasMultipleSingleFiles sets the has_multiple_single_files property value. The has_multiple_single_files property +func (m *NullableScopedInstallation) SetHasMultipleSingleFiles(value *bool)() { + m.has_multiple_single_files = value +} +// SetPermissions sets the permissions property value. The permissions granted to the user access token. +func (m *NullableScopedInstallation) SetPermissions(value AppPermissionsable)() { + m.permissions = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *NullableScopedInstallation) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetRepositorySelection sets the repository_selection property value. Describe whether all repositories have been selected or there's a selection involved +func (m *NullableScopedInstallation) SetRepositorySelection(value *NullableScopedInstallation_repository_selection)() { + m.repository_selection = value +} +// SetSingleFileName sets the single_file_name property value. The single_file_name property +func (m *NullableScopedInstallation) SetSingleFileName(value *string)() { + m.single_file_name = value +} +// SetSingleFilePaths sets the single_file_paths property value. The single_file_paths property +func (m *NullableScopedInstallation) SetSingleFilePaths(value []string)() { + m.single_file_paths = value +} +type NullableScopedInstallationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccount()(SimpleUserable) + GetHasMultipleSingleFiles()(*bool) + GetPermissions()(AppPermissionsable) + GetRepositoriesUrl()(*string) + GetRepositorySelection()(*NullableScopedInstallation_repository_selection) + GetSingleFileName()(*string) + GetSingleFilePaths()([]string) + SetAccount(value SimpleUserable)() + SetHasMultipleSingleFiles(value *bool)() + SetPermissions(value AppPermissionsable)() + SetRepositoriesUrl(value *string)() + SetRepositorySelection(value *NullableScopedInstallation_repository_selection)() + SetSingleFileName(value *string)() + SetSingleFilePaths(value []string)() +} diff --git a/pkg/github/models/nullable_scoped_installation_escaped_repository_escaped_selection.go b/pkg/github/models/nullable_scoped_installation_escaped_repository_escaped_selection.go new file mode 100644 index 00000000..d53c3e91 --- /dev/null +++ b/pkg/github/models/nullable_scoped_installation_escaped_repository_escaped_selection.go @@ -0,0 +1,34 @@ +package models +// Describe whether all repositories have been selected or there's a selection involved +type NullableScopedInstallation_repository_selection int + +const ( + ALL_NULLABLESCOPEDINSTALLATION_REPOSITORY_SELECTION NullableScopedInstallation_repository_selection = iota + SELECTED_NULLABLESCOPEDINSTALLATION_REPOSITORY_SELECTION +) + +func (i NullableScopedInstallation_repository_selection) String() string { + return []string{"all", "selected"}[i] +} +func ParseNullableScopedInstallation_repository_selection(v string) (any, error) { + result := ALL_NULLABLESCOPEDINSTALLATION_REPOSITORY_SELECTION + switch v { + case "all": + result = ALL_NULLABLESCOPEDINSTALLATION_REPOSITORY_SELECTION + case "selected": + result = SELECTED_NULLABLESCOPEDINSTALLATION_REPOSITORY_SELECTION + default: + return nil, nil + } + return &result, nil +} +func SerializeNullableScopedInstallation_repository_selection(values []NullableScopedInstallation_repository_selection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i NullableScopedInstallation_repository_selection) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/nullable_simple_commit.go b/pkg/github/models/nullable_simple_commit.go new file mode 100644 index 00000000..0071232b --- /dev/null +++ b/pkg/github/models/nullable_simple_commit.go @@ -0,0 +1,227 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableSimpleCommit a commit. +type NullableSimpleCommit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Information about the Git author + author NullableSimpleCommit_authorable + // Information about the Git committer + committer NullableSimpleCommit_committerable + // SHA for the commit + id *string + // Message describing the purpose of the commit + message *string + // Timestamp of the commit + timestamp *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // SHA for the commit's tree + tree_id *string +} +// NewNullableSimpleCommit instantiates a new NullableSimpleCommit and sets the default values. +func NewNullableSimpleCommit()(*NullableSimpleCommit) { + m := &NullableSimpleCommit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableSimpleCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableSimpleCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableSimpleCommit(), 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 *NullableSimpleCommit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. Information about the Git author +// returns a NullableSimpleCommit_authorable when successful +func (m *NullableSimpleCommit) GetAuthor()(NullableSimpleCommit_authorable) { + return m.author +} +// GetCommitter gets the committer property value. Information about the Git committer +// returns a NullableSimpleCommit_committerable when successful +func (m *NullableSimpleCommit) GetCommitter()(NullableSimpleCommit_committerable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableSimpleCommit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleCommit_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(NullableSimpleCommit_authorable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleCommit_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(NullableSimpleCommit_committerable)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(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 + } + res["timestamp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetTimestamp(val) + } + return nil + } + res["tree_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreeId(val) + } + return nil + } + return res +} +// GetId gets the id property value. SHA for the commit +// returns a *string when successful +func (m *NullableSimpleCommit) GetId()(*string) { + return m.id +} +// GetMessage gets the message property value. Message describing the purpose of the commit +// returns a *string when successful +func (m *NullableSimpleCommit) GetMessage()(*string) { + return m.message +} +// GetTimestamp gets the timestamp property value. Timestamp of the commit +// returns a *Time when successful +func (m *NullableSimpleCommit) GetTimestamp()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.timestamp +} +// GetTreeId gets the tree_id property value. SHA for the commit's tree +// returns a *string when successful +func (m *NullableSimpleCommit) GetTreeId()(*string) { + return m.tree_id +} +// Serialize serializes information the current object +func (m *NullableSimpleCommit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("timestamp", m.GetTimestamp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tree_id", m.GetTreeId()) + 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 *NullableSimpleCommit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. Information about the Git author +func (m *NullableSimpleCommit) SetAuthor(value NullableSimpleCommit_authorable)() { + m.author = value +} +// SetCommitter sets the committer property value. Information about the Git committer +func (m *NullableSimpleCommit) SetCommitter(value NullableSimpleCommit_committerable)() { + m.committer = value +} +// SetId sets the id property value. SHA for the commit +func (m *NullableSimpleCommit) SetId(value *string)() { + m.id = value +} +// SetMessage sets the message property value. Message describing the purpose of the commit +func (m *NullableSimpleCommit) SetMessage(value *string)() { + m.message = value +} +// SetTimestamp sets the timestamp property value. Timestamp of the commit +func (m *NullableSimpleCommit) SetTimestamp(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.timestamp = value +} +// SetTreeId sets the tree_id property value. SHA for the commit's tree +func (m *NullableSimpleCommit) SetTreeId(value *string)() { + m.tree_id = value +} +type NullableSimpleCommitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(NullableSimpleCommit_authorable) + GetCommitter()(NullableSimpleCommit_committerable) + GetId()(*string) + GetMessage()(*string) + GetTimestamp()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTreeId()(*string) + SetAuthor(value NullableSimpleCommit_authorable)() + SetCommitter(value NullableSimpleCommit_committerable)() + SetId(value *string)() + SetMessage(value *string)() + SetTimestamp(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTreeId(value *string)() +} diff --git a/pkg/github/models/nullable_simple_commit_escaped_author.go b/pkg/github/models/nullable_simple_commit_escaped_author.go new file mode 100644 index 00000000..2fc6105b --- /dev/null +++ b/pkg/github/models/nullable_simple_commit_escaped_author.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableSimpleCommit_author information about the Git author +type NullableSimpleCommit_author struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Git email address of the commit's author + email *string + // Name of the commit's author + name *string +} +// NewNullableSimpleCommit_author instantiates a new NullableSimpleCommit_author and sets the default values. +func NewNullableSimpleCommit_author()(*NullableSimpleCommit_author) { + m := &NullableSimpleCommit_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableSimpleCommit_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableSimpleCommit_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableSimpleCommit_author(), 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 *NullableSimpleCommit_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. Git email address of the commit's author +// returns a *string when successful +func (m *NullableSimpleCommit_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableSimpleCommit_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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. Name of the commit's author +// returns a *string when successful +func (m *NullableSimpleCommit_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *NullableSimpleCommit_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *NullableSimpleCommit_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. Git email address of the commit's author +func (m *NullableSimpleCommit_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the commit's author +func (m *NullableSimpleCommit_author) SetName(value *string)() { + m.name = value +} +type NullableSimpleCommit_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/nullable_simple_commit_escaped_committer.go b/pkg/github/models/nullable_simple_commit_escaped_committer.go new file mode 100644 index 00000000..45c96b85 --- /dev/null +++ b/pkg/github/models/nullable_simple_commit_escaped_committer.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableSimpleCommit_committer information about the Git committer +type NullableSimpleCommit_committer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Git email address of the commit's committer + email *string + // Name of the commit's committer + name *string +} +// NewNullableSimpleCommit_committer instantiates a new NullableSimpleCommit_committer and sets the default values. +func NewNullableSimpleCommit_committer()(*NullableSimpleCommit_committer) { + m := &NullableSimpleCommit_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableSimpleCommit_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableSimpleCommit_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableSimpleCommit_committer(), 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 *NullableSimpleCommit_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. Git email address of the commit's committer +// returns a *string when successful +func (m *NullableSimpleCommit_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableSimpleCommit_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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. Name of the commit's committer +// returns a *string when successful +func (m *NullableSimpleCommit_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *NullableSimpleCommit_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *NullableSimpleCommit_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. Git email address of the commit's committer +func (m *NullableSimpleCommit_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the commit's committer +func (m *NullableSimpleCommit_committer) SetName(value *string)() { + m.name = value +} +type NullableSimpleCommit_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/nullable_simple_user.go b/pkg/github/models/nullable_simple_user.go new file mode 100644 index 00000000..2ccb4d3c --- /dev/null +++ b/pkg/github/models/nullable_simple_user.go @@ -0,0 +1,661 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableSimpleUser a GitHub user. +type NullableSimpleUser 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 avatar_url property + avatar_url *string + // The email property + email *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int64 + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_at property + starred_at *string + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewNullableSimpleUser instantiates a new NullableSimpleUser and sets the default values. +func NewNullableSimpleUser()(*NullableSimpleUser) { + m := &NullableSimpleUser{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableSimpleUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableSimpleUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableSimpleUser(), 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 *NullableSimpleUser) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *NullableSimpleUser) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *NullableSimpleUser) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredAt(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *NullableSimpleUser) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *NullableSimpleUser) GetId()(*int64) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *NullableSimpleUser) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *NullableSimpleUser) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableSimpleUser) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *NullableSimpleUser) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredAt gets the starred_at property value. The starred_at property +// returns a *string when successful +func (m *NullableSimpleUser) GetStarredAt()(*string) { + return m.starred_at +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *NullableSimpleUser) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *NullableSimpleUser) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *NullableSimpleUser) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableSimpleUser) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_at", m.GetStarredAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableSimpleUser) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *NullableSimpleUser) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEmail sets the email property value. The email property +func (m *NullableSimpleUser) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *NullableSimpleUser) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *NullableSimpleUser) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *NullableSimpleUser) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *NullableSimpleUser) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *NullableSimpleUser) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableSimpleUser) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *NullableSimpleUser) SetId(value *int64)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *NullableSimpleUser) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *NullableSimpleUser) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableSimpleUser) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *NullableSimpleUser) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *NullableSimpleUser) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *NullableSimpleUser) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *NullableSimpleUser) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredAt sets the starred_at property value. The starred_at property +func (m *NullableSimpleUser) SetStarredAt(value *string)() { + m.starred_at = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *NullableSimpleUser) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *NullableSimpleUser) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *NullableSimpleUser) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *NullableSimpleUser) SetUrl(value *string)() { + m.url = value +} +type NullableSimpleUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredAt()(*string) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredAt(value *string)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/nullable_team_simple.go b/pkg/github/models/nullable_team_simple.go new file mode 100644 index 00000000..7a4e86f5 --- /dev/null +++ b/pkg/github/models/nullable_team_simple.go @@ -0,0 +1,429 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// NullableTeamSimple groups of organization members that gives permissions on specified repositories. +type NullableTeamSimple struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Description of the team + description *string + // The html_url property + html_url *string + // Unique identifier of the team + id *int32 + // Distinguished Name (DN) that team maps to within LDAP environment + ldap_dn *string + // The members_url property + members_url *string + // Name of the team + name *string + // The node_id property + node_id *string + // The notification setting the team has set + notification_setting *string + // Permission that the team will have for its repositories + permission *string + // The level of privacy this team should have + privacy *string + // The repositories_url property + repositories_url *string + // The slug property + slug *string + // URL for the team + url *string +} +// NewNullableTeamSimple instantiates a new NullableTeamSimple and sets the default values. +func NewNullableTeamSimple()(*NullableTeamSimple) { + m := &NullableTeamSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNullableTeamSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNullableTeamSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNullableTeamSimple(), 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 *NullableTeamSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. Description of the team +// returns a *string when successful +func (m *NullableTeamSimple) 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 *NullableTeamSimple) 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["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["ldap_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLdapDn(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationSetting(val) + } + return nil + } + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["privacy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivacy(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *NullableTeamSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the team +// returns a *int32 when successful +func (m *NullableTeamSimple) GetId()(*int32) { + return m.id +} +// GetLdapDn gets the ldap_dn property value. Distinguished Name (DN) that team maps to within LDAP environment +// returns a *string when successful +func (m *NullableTeamSimple) GetLdapDn()(*string) { + return m.ldap_dn +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *NullableTeamSimple) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. Name of the team +// returns a *string when successful +func (m *NullableTeamSimple) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *NullableTeamSimple) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationSetting gets the notification_setting property value. The notification setting the team has set +// returns a *string when successful +func (m *NullableTeamSimple) GetNotificationSetting()(*string) { + return m.notification_setting +} +// GetPermission gets the permission property value. Permission that the team will have for its repositories +// returns a *string when successful +func (m *NullableTeamSimple) GetPermission()(*string) { + return m.permission +} +// GetPrivacy gets the privacy property value. The level of privacy this team should have +// returns a *string when successful +func (m *NullableTeamSimple) GetPrivacy()(*string) { + return m.privacy +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *NullableTeamSimple) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *NullableTeamSimple) GetSlug()(*string) { + return m.slug +} +// GetUrl gets the url property value. URL for the team +// returns a *string when successful +func (m *NullableTeamSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *NullableTeamSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ldap_dn", m.GetLdapDn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_setting", m.GetNotificationSetting()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("privacy", m.GetPrivacy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *NullableTeamSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. Description of the team +func (m *NullableTeamSimple) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *NullableTeamSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the team +func (m *NullableTeamSimple) SetId(value *int32)() { + m.id = value +} +// SetLdapDn sets the ldap_dn property value. Distinguished Name (DN) that team maps to within LDAP environment +func (m *NullableTeamSimple) SetLdapDn(value *string)() { + m.ldap_dn = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *NullableTeamSimple) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. Name of the team +func (m *NullableTeamSimple) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *NullableTeamSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationSetting sets the notification_setting property value. The notification setting the team has set +func (m *NullableTeamSimple) SetNotificationSetting(value *string)() { + m.notification_setting = value +} +// SetPermission sets the permission property value. Permission that the team will have for its repositories +func (m *NullableTeamSimple) SetPermission(value *string)() { + m.permission = value +} +// SetPrivacy sets the privacy property value. The level of privacy this team should have +func (m *NullableTeamSimple) SetPrivacy(value *string)() { + m.privacy = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *NullableTeamSimple) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetSlug sets the slug property value. The slug property +func (m *NullableTeamSimple) SetSlug(value *string)() { + m.slug = value +} +// SetUrl sets the url property value. URL for the team +func (m *NullableTeamSimple) SetUrl(value *string)() { + m.url = value +} +type NullableTeamSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLdapDn()(*string) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationSetting()(*string) + GetPermission()(*string) + GetPrivacy()(*string) + GetRepositoriesUrl()(*string) + GetSlug()(*string) + GetUrl()(*string) + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLdapDn(value *string)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationSetting(value *string)() + SetPermission(value *string)() + SetPrivacy(value *string)() + SetRepositoriesUrl(value *string)() + SetSlug(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/oidc_custom_sub.go b/pkg/github/models/oidc_custom_sub.go new file mode 100644 index 00000000..961b8452 --- /dev/null +++ b/pkg/github/models/oidc_custom_sub.go @@ -0,0 +1,87 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OidcCustomSub actions OIDC Subject customization +type OidcCustomSub struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. + include_claim_keys []string +} +// NewOidcCustomSub instantiates a new OidcCustomSub and sets the default values. +func NewOidcCustomSub()(*OidcCustomSub) { + m := &OidcCustomSub{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOidcCustomSubFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOidcCustomSubFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOidcCustomSub(), 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 *OidcCustomSub) 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 *OidcCustomSub) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["include_claim_keys"] = 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.SetIncludeClaimKeys(res) + } + return nil + } + return res +} +// GetIncludeClaimKeys gets the include_claim_keys property value. Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. +// returns a []string when successful +func (m *OidcCustomSub) GetIncludeClaimKeys()([]string) { + return m.include_claim_keys +} +// Serialize serializes information the current object +func (m *OidcCustomSub) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIncludeClaimKeys() != nil { + err := writer.WriteCollectionOfStringValues("include_claim_keys", m.GetIncludeClaimKeys()) + 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 *OidcCustomSub) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncludeClaimKeys sets the include_claim_keys property value. Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. +func (m *OidcCustomSub) SetIncludeClaimKeys(value []string)() { + m.include_claim_keys = value +} +type OidcCustomSubable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncludeClaimKeys()([]string) + SetIncludeClaimKeys(value []string)() +} diff --git a/pkg/github/models/oidc_custom_sub_repo.go b/pkg/github/models/oidc_custom_sub_repo.go new file mode 100644 index 00000000..69a46fe0 --- /dev/null +++ b/pkg/github/models/oidc_custom_sub_repo.go @@ -0,0 +1,116 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OidcCustomSubRepo actions OIDC subject customization for a repository +type OidcCustomSubRepo struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. + include_claim_keys []string + // Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. + use_default *bool +} +// NewOidcCustomSubRepo instantiates a new OidcCustomSubRepo and sets the default values. +func NewOidcCustomSubRepo()(*OidcCustomSubRepo) { + m := &OidcCustomSubRepo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOidcCustomSubRepoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOidcCustomSubRepoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOidcCustomSubRepo(), 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 *OidcCustomSubRepo) 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 *OidcCustomSubRepo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["include_claim_keys"] = 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.SetIncludeClaimKeys(res) + } + return nil + } + res["use_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseDefault(val) + } + return nil + } + return res +} +// GetIncludeClaimKeys gets the include_claim_keys property value. Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. +// returns a []string when successful +func (m *OidcCustomSubRepo) GetIncludeClaimKeys()([]string) { + return m.include_claim_keys +} +// GetUseDefault gets the use_default property value. Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. +// returns a *bool when successful +func (m *OidcCustomSubRepo) GetUseDefault()(*bool) { + return m.use_default +} +// Serialize serializes information the current object +func (m *OidcCustomSubRepo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIncludeClaimKeys() != nil { + err := writer.WriteCollectionOfStringValues("include_claim_keys", m.GetIncludeClaimKeys()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_default", m.GetUseDefault()) + 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 *OidcCustomSubRepo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncludeClaimKeys sets the include_claim_keys property value. Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. +func (m *OidcCustomSubRepo) SetIncludeClaimKeys(value []string)() { + m.include_claim_keys = value +} +// SetUseDefault sets the use_default property value. Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. +func (m *OidcCustomSubRepo) SetUseDefault(value *bool)() { + m.use_default = value +} +type OidcCustomSubRepoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncludeClaimKeys()([]string) + GetUseDefault()(*bool) + SetIncludeClaimKeys(value []string)() + SetUseDefault(value *bool)() +} diff --git a/pkg/github/models/org_hook.go b/pkg/github/models/org_hook.go new file mode 100644 index 00000000..3170ad55 --- /dev/null +++ b/pkg/github/models/org_hook.go @@ -0,0 +1,378 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrgHook org Hook +type OrgHook struct { + // The active property + active *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The config property + config OrgHook_configable + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The deliveries_url property + deliveries_url *string + // The events property + events []string + // The id property + id *int32 + // The name property + name *string + // The ping_url property + ping_url *string + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewOrgHook instantiates a new OrgHook and sets the default values. +func NewOrgHook()(*OrgHook) { + m := &OrgHook{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgHookFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgHookFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgHook(), nil +} +// GetActive gets the active property value. The active property +// returns a *bool when successful +func (m *OrgHook) GetActive()(*bool) { + return m.active +} +// 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 *OrgHook) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfig gets the config property value. The config property +// returns a OrgHook_configable when successful +func (m *OrgHook) GetConfig()(OrgHook_configable) { + return m.config +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *OrgHook) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDeliveriesUrl gets the deliveries_url property value. The deliveries_url property +// returns a *string when successful +func (m *OrgHook) GetDeliveriesUrl()(*string) { + return m.deliveries_url +} +// GetEvents gets the events property value. The events property +// returns a []string when successful +func (m *OrgHook) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrgHook) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrgHook_configFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(OrgHook_configable)) + } + return nil + } + 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["deliveries_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeliveriesUrl(val) + } + return nil + } + res["events"] = 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.SetEvents(res) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["ping_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPingUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *OrgHook) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *OrgHook) GetName()(*string) { + return m.name +} +// GetPingUrl gets the ping_url property value. The ping_url property +// returns a *string when successful +func (m *OrgHook) GetPingUrl()(*string) { + return m.ping_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *OrgHook) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *OrgHook) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *OrgHook) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *OrgHook) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deliveries_url", m.GetDeliveriesUrl()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ping_url", m.GetPingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. The active property +func (m *OrgHook) SetActive(value *bool)() { + m.active = 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 *OrgHook) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfig sets the config property value. The config property +func (m *OrgHook) SetConfig(value OrgHook_configable)() { + m.config = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *OrgHook) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDeliveriesUrl sets the deliveries_url property value. The deliveries_url property +func (m *OrgHook) SetDeliveriesUrl(value *string)() { + m.deliveries_url = value +} +// SetEvents sets the events property value. The events property +func (m *OrgHook) SetEvents(value []string)() { + m.events = value +} +// SetId sets the id property value. The id property +func (m *OrgHook) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *OrgHook) SetName(value *string)() { + m.name = value +} +// SetPingUrl sets the ping_url property value. The ping_url property +func (m *OrgHook) SetPingUrl(value *string)() { + m.ping_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *OrgHook) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *OrgHook) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *OrgHook) SetUrl(value *string)() { + m.url = value +} +type OrgHookable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetConfig()(OrgHook_configable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDeliveriesUrl()(*string) + GetEvents()([]string) + GetId()(*int32) + GetName()(*string) + GetPingUrl()(*string) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetActive(value *bool)() + SetConfig(value OrgHook_configable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDeliveriesUrl(value *string)() + SetEvents(value []string)() + SetId(value *int32)() + SetName(value *string)() + SetPingUrl(value *string)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/org_hook_escaped_config.go b/pkg/github/models/org_hook_escaped_config.go new file mode 100644 index 00000000..25c1768c --- /dev/null +++ b/pkg/github/models/org_hook_escaped_config.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrgHook_config 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 content_type property + content_type *string + // The insecure_ssl property + insecure_ssl *string + // The secret property + secret *string + // The url property + url *string +} +// NewOrgHook_config instantiates a new OrgHook_config and sets the default values. +func NewOrgHook_config()(*OrgHook_config) { + m := &OrgHook_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgHook_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgHook_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgHook_config(), 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 *OrgHook_config) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The content_type property +// returns a *string when successful +func (m *OrgHook_config) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrgHook_config) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a *string when successful +func (m *OrgHook_config) GetInsecureSsl()(*string) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. The secret property +// returns a *string when successful +func (m *OrgHook_config) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *OrgHook_config) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *OrgHook_config) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *OrgHook_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The content_type property +func (m *OrgHook_config) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *OrgHook_config) SetInsecureSsl(value *string)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. The secret property +func (m *OrgHook_config) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The url property +func (m *OrgHook_config) SetUrl(value *string)() { + m.url = value +} +type OrgHook_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(*string) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value *string)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/org_membership.go b/pkg/github/models/org_membership.go new file mode 100644 index 00000000..e968e928 --- /dev/null +++ b/pkg/github/models/org_membership.go @@ -0,0 +1,257 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrgMembership org Membership +type OrgMembership 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 GitHub organization. + organization OrganizationSimpleable + // The organization_url property + organization_url *string + // The permissions property + permissions OrgMembership_permissionsable + // The user's membership type in the organization. + role *OrgMembership_role + // The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. + state *OrgMembership_state + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewOrgMembership instantiates a new OrgMembership and sets the default values. +func NewOrgMembership()(*OrgMembership) { + m := &OrgMembership{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgMembershipFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgMembershipFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgMembership(), 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 *OrgMembership) 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 *OrgMembership) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(OrganizationSimpleable)) + } + return nil + } + res["organization_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationUrl(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrgMembership_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(OrgMembership_permissionsable)) + } + return nil + } + res["role"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrgMembership_role) + if err != nil { + return err + } + if val != nil { + m.SetRole(val.(*OrgMembership_role)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrgMembership_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*OrgMembership_state)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetOrganization gets the organization property value. A GitHub organization. +// returns a OrganizationSimpleable when successful +func (m *OrgMembership) GetOrganization()(OrganizationSimpleable) { + return m.organization +} +// GetOrganizationUrl gets the organization_url property value. The organization_url property +// returns a *string when successful +func (m *OrgMembership) GetOrganizationUrl()(*string) { + return m.organization_url +} +// GetPermissions gets the permissions property value. The permissions property +// returns a OrgMembership_permissionsable when successful +func (m *OrgMembership) GetPermissions()(OrgMembership_permissionsable) { + return m.permissions +} +// GetRole gets the role property value. The user's membership type in the organization. +// returns a *OrgMembership_role when successful +func (m *OrgMembership) GetRole()(*OrgMembership_role) { + return m.role +} +// GetState gets the state property value. The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. +// returns a *OrgMembership_state when successful +func (m *OrgMembership) GetState()(*OrgMembership_state) { + return m.state +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *OrgMembership) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *OrgMembership) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *OrgMembership) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_url", m.GetOrganizationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + if m.GetRole() != nil { + cast := (*m.GetRole()).String() + err := writer.WriteStringValue("role", &cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *OrgMembership) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetOrganization sets the organization property value. A GitHub organization. +func (m *OrgMembership) SetOrganization(value OrganizationSimpleable)() { + m.organization = value +} +// SetOrganizationUrl sets the organization_url property value. The organization_url property +func (m *OrgMembership) SetOrganizationUrl(value *string)() { + m.organization_url = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *OrgMembership) SetPermissions(value OrgMembership_permissionsable)() { + m.permissions = value +} +// SetRole sets the role property value. The user's membership type in the organization. +func (m *OrgMembership) SetRole(value *OrgMembership_role)() { + m.role = value +} +// SetState sets the state property value. The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. +func (m *OrgMembership) SetState(value *OrgMembership_state)() { + m.state = value +} +// SetUrl sets the url property value. The url property +func (m *OrgMembership) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *OrgMembership) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type OrgMembershipable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOrganization()(OrganizationSimpleable) + GetOrganizationUrl()(*string) + GetPermissions()(OrgMembership_permissionsable) + GetRole()(*OrgMembership_role) + GetState()(*OrgMembership_state) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetOrganization(value OrganizationSimpleable)() + SetOrganizationUrl(value *string)() + SetPermissions(value OrgMembership_permissionsable)() + SetRole(value *OrgMembership_role)() + SetState(value *OrgMembership_state)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/org_membership_escaped_permissions.go b/pkg/github/models/org_membership_escaped_permissions.go new file mode 100644 index 00000000..06dd0bd8 --- /dev/null +++ b/pkg/github/models/org_membership_escaped_permissions.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrgMembership_permissions 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 can_create_repository property + can_create_repository *bool +} +// NewOrgMembership_permissions instantiates a new OrgMembership_permissions and sets the default values. +func NewOrgMembership_permissions()(*OrgMembership_permissions) { + m := &OrgMembership_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgMembership_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgMembership_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgMembership_permissions(), 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 *OrgMembership_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCanCreateRepository gets the can_create_repository property value. The can_create_repository property +// returns a *bool when successful +func (m *OrgMembership_permissions) GetCanCreateRepository()(*bool) { + return m.can_create_repository +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrgMembership_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["can_create_repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCanCreateRepository(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *OrgMembership_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("can_create_repository", m.GetCanCreateRepository()) + 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 *OrgMembership_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCanCreateRepository sets the can_create_repository property value. The can_create_repository property +func (m *OrgMembership_permissions) SetCanCreateRepository(value *bool)() { + m.can_create_repository = value +} +type OrgMembership_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCanCreateRepository()(*bool) + SetCanCreateRepository(value *bool)() +} diff --git a/pkg/github/models/org_membership_escaped_role.go b/pkg/github/models/org_membership_escaped_role.go new file mode 100644 index 00000000..b28386fa --- /dev/null +++ b/pkg/github/models/org_membership_escaped_role.go @@ -0,0 +1,37 @@ +package models +// The user's membership type in the organization. +type OrgMembership_role int + +const ( + ADMIN_ORGMEMBERSHIP_ROLE OrgMembership_role = iota + MEMBER_ORGMEMBERSHIP_ROLE + BILLING_MANAGER_ORGMEMBERSHIP_ROLE +) + +func (i OrgMembership_role) String() string { + return []string{"admin", "member", "billing_manager"}[i] +} +func ParseOrgMembership_role(v string) (any, error) { + result := ADMIN_ORGMEMBERSHIP_ROLE + switch v { + case "admin": + result = ADMIN_ORGMEMBERSHIP_ROLE + case "member": + result = MEMBER_ORGMEMBERSHIP_ROLE + case "billing_manager": + result = BILLING_MANAGER_ORGMEMBERSHIP_ROLE + default: + return nil, nil + } + return &result, nil +} +func SerializeOrgMembership_role(values []OrgMembership_role) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrgMembership_role) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/org_membership_escaped_state.go b/pkg/github/models/org_membership_escaped_state.go new file mode 100644 index 00000000..17bd76e2 --- /dev/null +++ b/pkg/github/models/org_membership_escaped_state.go @@ -0,0 +1,34 @@ +package models +// The state of the member in the organization. The `pending` state indicates the user has not yet accepted an invitation. +type OrgMembership_state int + +const ( + ACTIVE_ORGMEMBERSHIP_STATE OrgMembership_state = iota + PENDING_ORGMEMBERSHIP_STATE +) + +func (i OrgMembership_state) String() string { + return []string{"active", "pending"}[i] +} +func ParseOrgMembership_state(v string) (any, error) { + result := ACTIVE_ORGMEMBERSHIP_STATE + switch v { + case "active": + result = ACTIVE_ORGMEMBERSHIP_STATE + case "pending": + result = PENDING_ORGMEMBERSHIP_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeOrgMembership_state(values []OrgMembership_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrgMembership_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/org_pre_receive_hook.go b/pkg/github/models/org_pre_receive_hook.go new file mode 100644 index 00000000..9ba5da3a --- /dev/null +++ b/pkg/github/models/org_pre_receive_hook.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrgPreReceiveHook 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 allow_downstream_configuration property + allow_downstream_configuration *bool + // The configuration_url property + configuration_url *string + // The enforcement property + enforcement *string + // The id property + id *int32 + // The name property + name *string +} +// NewOrgPreReceiveHook instantiates a new OrgPreReceiveHook and sets the default values. +func NewOrgPreReceiveHook()(*OrgPreReceiveHook) { + m := &OrgPreReceiveHook{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgPreReceiveHookFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgPreReceiveHookFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgPreReceiveHook(), 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 *OrgPreReceiveHook) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowDownstreamConfiguration gets the allow_downstream_configuration property value. The allow_downstream_configuration property +// returns a *bool when successful +func (m *OrgPreReceiveHook) GetAllowDownstreamConfiguration()(*bool) { + return m.allow_downstream_configuration +} +// GetConfigurationUrl gets the configuration_url property value. The configuration_url property +// returns a *string when successful +func (m *OrgPreReceiveHook) GetConfigurationUrl()(*string) { + return m.configuration_url +} +// GetEnforcement gets the enforcement property value. The enforcement property +// returns a *string when successful +func (m *OrgPreReceiveHook) GetEnforcement()(*string) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrgPreReceiveHook) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_downstream_configuration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowDownstreamConfiguration(val) + } + return nil + } + res["configuration_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetConfigurationUrl(val) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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 +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *OrgPreReceiveHook) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *OrgPreReceiveHook) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *OrgPreReceiveHook) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_downstream_configuration", m.GetAllowDownstreamConfiguration()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("configuration_url", m.GetConfigurationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("enforcement", m.GetEnforcement()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *OrgPreReceiveHook) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowDownstreamConfiguration sets the allow_downstream_configuration property value. The allow_downstream_configuration property +func (m *OrgPreReceiveHook) SetAllowDownstreamConfiguration(value *bool)() { + m.allow_downstream_configuration = value +} +// SetConfigurationUrl sets the configuration_url property value. The configuration_url property +func (m *OrgPreReceiveHook) SetConfigurationUrl(value *string)() { + m.configuration_url = value +} +// SetEnforcement sets the enforcement property value. The enforcement property +func (m *OrgPreReceiveHook) SetEnforcement(value *string)() { + m.enforcement = value +} +// SetId sets the id property value. The id property +func (m *OrgPreReceiveHook) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *OrgPreReceiveHook) SetName(value *string)() { + m.name = value +} +type OrgPreReceiveHookable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowDownstreamConfiguration()(*bool) + GetConfigurationUrl()(*string) + GetEnforcement()(*string) + GetId()(*int32) + GetName()(*string) + SetAllowDownstreamConfiguration(value *bool)() + SetConfigurationUrl(value *string)() + SetEnforcement(value *string)() + SetId(value *int32)() + SetName(value *string)() +} diff --git a/pkg/github/models/org_repo_custom_property_values.go b/pkg/github/models/org_repo_custom_property_values.go new file mode 100644 index 00000000..baef3837 --- /dev/null +++ b/pkg/github/models/org_repo_custom_property_values.go @@ -0,0 +1,180 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrgRepoCustomPropertyValues list of custom property values for a repository +type OrgRepoCustomPropertyValues struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // List of custom property names and associated values + properties []CustomPropertyValueable + // The repository_full_name property + repository_full_name *string + // The repository_id property + repository_id *int32 + // The repository_name property + repository_name *string +} +// NewOrgRepoCustomPropertyValues instantiates a new OrgRepoCustomPropertyValues and sets the default values. +func NewOrgRepoCustomPropertyValues()(*OrgRepoCustomPropertyValues) { + m := &OrgRepoCustomPropertyValues{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgRepoCustomPropertyValuesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgRepoCustomPropertyValuesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgRepoCustomPropertyValues(), 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 *OrgRepoCustomPropertyValues) 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 *OrgRepoCustomPropertyValues) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCustomPropertyValueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CustomPropertyValueable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CustomPropertyValueable) + } + } + m.SetProperties(res) + } + return nil + } + res["repository_full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryFullName(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + res["repository_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryName(val) + } + return nil + } + return res +} +// GetProperties gets the properties property value. List of custom property names and associated values +// returns a []CustomPropertyValueable when successful +func (m *OrgRepoCustomPropertyValues) GetProperties()([]CustomPropertyValueable) { + return m.properties +} +// GetRepositoryFullName gets the repository_full_name property value. The repository_full_name property +// returns a *string when successful +func (m *OrgRepoCustomPropertyValues) GetRepositoryFullName()(*string) { + return m.repository_full_name +} +// GetRepositoryId gets the repository_id property value. The repository_id property +// returns a *int32 when successful +func (m *OrgRepoCustomPropertyValues) GetRepositoryId()(*int32) { + return m.repository_id +} +// GetRepositoryName gets the repository_name property value. The repository_name property +// returns a *string when successful +func (m *OrgRepoCustomPropertyValues) GetRepositoryName()(*string) { + return m.repository_name +} +// Serialize serializes information the current object +func (m *OrgRepoCustomPropertyValues) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetProperties() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetProperties())) + for i, v := range m.GetProperties() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("properties", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_full_name", m.GetRepositoryFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_name", m.GetRepositoryName()) + 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 *OrgRepoCustomPropertyValues) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetProperties sets the properties property value. List of custom property names and associated values +func (m *OrgRepoCustomPropertyValues) SetProperties(value []CustomPropertyValueable)() { + m.properties = value +} +// SetRepositoryFullName sets the repository_full_name property value. The repository_full_name property +func (m *OrgRepoCustomPropertyValues) SetRepositoryFullName(value *string)() { + m.repository_full_name = value +} +// SetRepositoryId sets the repository_id property value. The repository_id property +func (m *OrgRepoCustomPropertyValues) SetRepositoryId(value *int32)() { + m.repository_id = value +} +// SetRepositoryName sets the repository_name property value. The repository_name property +func (m *OrgRepoCustomPropertyValues) SetRepositoryName(value *string)() { + m.repository_name = value +} +type OrgRepoCustomPropertyValuesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetProperties()([]CustomPropertyValueable) + GetRepositoryFullName()(*string) + GetRepositoryId()(*int32) + GetRepositoryName()(*string) + SetProperties(value []CustomPropertyValueable)() + SetRepositoryFullName(value *string)() + SetRepositoryId(value *int32)() + SetRepositoryName(value *string)() +} diff --git a/pkg/github/models/org_ruleset_conditions.go b/pkg/github/models/org_ruleset_conditions.go new file mode 100644 index 00000000..c51912ad --- /dev/null +++ b/pkg/github/models/org_ruleset_conditions.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrgRulesetConditions conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. +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 +} +// NewOrgRulesetConditions instantiates a new OrgRulesetConditions and sets the default values. +func NewOrgRulesetConditions()(*OrgRulesetConditions) { + m := &OrgRulesetConditions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrgRulesetConditionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrgRulesetConditionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrgRulesetConditions(), 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 *OrgRulesetConditions) 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 *OrgRulesetConditions) 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 *OrgRulesetConditions) 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 *OrgRulesetConditions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type OrgRulesetConditionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/organization_actions_secret.go b/pkg/github/models/organization_actions_secret.go new file mode 100644 index 00000000..2d290a17 --- /dev/null +++ b/pkg/github/models/organization_actions_secret.go @@ -0,0 +1,199 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationActionsSecret secrets for GitHub Actions for an organization. +type OrganizationActionsSecret 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 secret. + name *string + // The selected_repositories_url property + selected_repositories_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Visibility of a secret + visibility *OrganizationActionsSecret_visibility +} +// NewOrganizationActionsSecret instantiates a new OrganizationActionsSecret and sets the default values. +func NewOrganizationActionsSecret()(*OrganizationActionsSecret) { + m := &OrganizationActionsSecret{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationActionsSecretFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationActionsSecretFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationActionsSecret(), 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 *OrganizationActionsSecret) 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 *OrganizationActionsSecret) 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 *OrganizationActionsSecret) 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["selected_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedRepositoriesUrl(val) + } + 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["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationActionsSecret_visibility) + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val.(*OrganizationActionsSecret_visibility)) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the secret. +// returns a *string when successful +func (m *OrganizationActionsSecret) GetName()(*string) { + return m.name +} +// GetSelectedRepositoriesUrl gets the selected_repositories_url property value. The selected_repositories_url property +// returns a *string when successful +func (m *OrganizationActionsSecret) GetSelectedRepositoriesUrl()(*string) { + return m.selected_repositories_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *OrganizationActionsSecret) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetVisibility gets the visibility property value. Visibility of a secret +// returns a *OrganizationActionsSecret_visibility when successful +func (m *OrganizationActionsSecret) GetVisibility()(*OrganizationActionsSecret_visibility) { + return m.visibility +} +// Serialize serializes information the current object +func (m *OrganizationActionsSecret) 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 + } + } + { + err := writer.WriteStringValue("selected_repositories_url", m.GetSelectedRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *OrganizationActionsSecret) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *OrganizationActionsSecret) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the secret. +func (m *OrganizationActionsSecret) SetName(value *string)() { + m.name = value +} +// SetSelectedRepositoriesUrl sets the selected_repositories_url property value. The selected_repositories_url property +func (m *OrganizationActionsSecret) SetSelectedRepositoriesUrl(value *string)() { + m.selected_repositories_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *OrganizationActionsSecret) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetVisibility sets the visibility property value. Visibility of a secret +func (m *OrganizationActionsSecret) SetVisibility(value *OrganizationActionsSecret_visibility)() { + m.visibility = value +} +type OrganizationActionsSecretable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetSelectedRepositoriesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetVisibility()(*OrganizationActionsSecret_visibility) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetSelectedRepositoriesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetVisibility(value *OrganizationActionsSecret_visibility)() +} diff --git a/pkg/github/models/organization_actions_secret_escaped_visibility.go b/pkg/github/models/organization_actions_secret_escaped_visibility.go new file mode 100644 index 00000000..e31e4d76 --- /dev/null +++ b/pkg/github/models/organization_actions_secret_escaped_visibility.go @@ -0,0 +1,37 @@ +package models +// Visibility of a secret +type OrganizationActionsSecret_visibility int + +const ( + ALL_ORGANIZATIONACTIONSSECRET_VISIBILITY OrganizationActionsSecret_visibility = iota + PRIVATE_ORGANIZATIONACTIONSSECRET_VISIBILITY + SELECTED_ORGANIZATIONACTIONSSECRET_VISIBILITY +) + +func (i OrganizationActionsSecret_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseOrganizationActionsSecret_visibility(v string) (any, error) { + result := ALL_ORGANIZATIONACTIONSSECRET_VISIBILITY + switch v { + case "all": + result = ALL_ORGANIZATIONACTIONSSECRET_VISIBILITY + case "private": + result = PRIVATE_ORGANIZATIONACTIONSSECRET_VISIBILITY + case "selected": + result = SELECTED_ORGANIZATIONACTIONSSECRET_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeOrganizationActionsSecret_visibility(values []OrganizationActionsSecret_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationActionsSecret_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/organization_actions_variable.go b/pkg/github/models/organization_actions_variable.go new file mode 100644 index 00000000..e38deef0 --- /dev/null +++ b/pkg/github/models/organization_actions_variable.go @@ -0,0 +1,228 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationActionsVariable organization variable for GitHub Actions. +type OrganizationActionsVariable 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 date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the variable. + name *string + // The selected_repositories_url property + selected_repositories_url *string + // The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The value of the variable. + value *string + // Visibility of a variable + visibility *OrganizationActionsVariable_visibility +} +// NewOrganizationActionsVariable instantiates a new OrganizationActionsVariable and sets the default values. +func NewOrganizationActionsVariable()(*OrganizationActionsVariable) { + m := &OrganizationActionsVariable{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationActionsVariableFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationActionsVariableFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationActionsVariable(), 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 *OrganizationActionsVariable) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *OrganizationActionsVariable) 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 *OrganizationActionsVariable) 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["selected_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedRepositoriesUrl(val) + } + 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["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationActionsVariable_visibility) + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val.(*OrganizationActionsVariable_visibility)) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *OrganizationActionsVariable) GetName()(*string) { + return m.name +} +// GetSelectedRepositoriesUrl gets the selected_repositories_url property value. The selected_repositories_url property +// returns a *string when successful +func (m *OrganizationActionsVariable) GetSelectedRepositoriesUrl()(*string) { + return m.selected_repositories_url +} +// GetUpdatedAt gets the updated_at property value. The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +// returns a *Time when successful +func (m *OrganizationActionsVariable) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *OrganizationActionsVariable) GetValue()(*string) { + return m.value +} +// GetVisibility gets the visibility property value. Visibility of a variable +// returns a *OrganizationActionsVariable_visibility when successful +func (m *OrganizationActionsVariable) GetVisibility()(*OrganizationActionsVariable_visibility) { + return m.visibility +} +// Serialize serializes information the current object +func (m *OrganizationActionsVariable) 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 + } + } + { + err := writer.WriteStringValue("selected_repositories_url", m.GetSelectedRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + 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 *OrganizationActionsVariable) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The date and time at which the variable was created, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *OrganizationActionsVariable) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the variable. +func (m *OrganizationActionsVariable) SetName(value *string)() { + m.name = value +} +// SetSelectedRepositoriesUrl sets the selected_repositories_url property value. The selected_repositories_url property +func (m *OrganizationActionsVariable) SetSelectedRepositoriesUrl(value *string)() { + m.selected_repositories_url = value +} +// SetUpdatedAt sets the updated_at property value. The date and time at which the variable was last updated, in ISO 8601 format':' YYYY-MM-DDTHH:MM:SSZ. +func (m *OrganizationActionsVariable) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetValue sets the value property value. The value of the variable. +func (m *OrganizationActionsVariable) SetValue(value *string)() { + m.value = value +} +// SetVisibility sets the visibility property value. Visibility of a variable +func (m *OrganizationActionsVariable) SetVisibility(value *OrganizationActionsVariable_visibility)() { + m.visibility = value +} +type OrganizationActionsVariableable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetSelectedRepositoriesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetValue()(*string) + GetVisibility()(*OrganizationActionsVariable_visibility) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetSelectedRepositoriesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetValue(value *string)() + SetVisibility(value *OrganizationActionsVariable_visibility)() +} diff --git a/pkg/github/models/organization_actions_variable_escaped_visibility.go b/pkg/github/models/organization_actions_variable_escaped_visibility.go new file mode 100644 index 00000000..33fef808 --- /dev/null +++ b/pkg/github/models/organization_actions_variable_escaped_visibility.go @@ -0,0 +1,37 @@ +package models +// Visibility of a variable +type OrganizationActionsVariable_visibility int + +const ( + ALL_ORGANIZATIONACTIONSVARIABLE_VISIBILITY OrganizationActionsVariable_visibility = iota + PRIVATE_ORGANIZATIONACTIONSVARIABLE_VISIBILITY + SELECTED_ORGANIZATIONACTIONSVARIABLE_VISIBILITY +) + +func (i OrganizationActionsVariable_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseOrganizationActionsVariable_visibility(v string) (any, error) { + result := ALL_ORGANIZATIONACTIONSVARIABLE_VISIBILITY + switch v { + case "all": + result = ALL_ORGANIZATIONACTIONSVARIABLE_VISIBILITY + case "private": + result = PRIVATE_ORGANIZATIONACTIONSVARIABLE_VISIBILITY + case "selected": + result = SELECTED_ORGANIZATIONACTIONSVARIABLE_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeOrganizationActionsVariable_visibility(values []OrganizationActionsVariable_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationActionsVariable_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/organization_custom_organization_role_create_schema.go b/pkg/github/models/organization_custom_organization_role_create_schema.go new file mode 100644 index 00000000..a6ab5151 --- /dev/null +++ b/pkg/github/models/organization_custom_organization_role_create_schema.go @@ -0,0 +1,144 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationCustomOrganizationRoleCreateSchema 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 short description about the intended usage of this role or what permissions it grants. + description *string + // The name of the custom role. + name *string + // A list of additional permissions included in this role. + permissions []string +} +// NewOrganizationCustomOrganizationRoleCreateSchema instantiates a new OrganizationCustomOrganizationRoleCreateSchema and sets the default values. +func NewOrganizationCustomOrganizationRoleCreateSchema()(*OrganizationCustomOrganizationRoleCreateSchema) { + m := &OrganizationCustomOrganizationRoleCreateSchema{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationCustomOrganizationRoleCreateSchemaFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationCustomOrganizationRoleCreateSchemaFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationCustomOrganizationRoleCreateSchema(), 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 *OrganizationCustomOrganizationRoleCreateSchema) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. A short description about the intended usage of this role or what permissions it grants. +// returns a *string when successful +func (m *OrganizationCustomOrganizationRoleCreateSchema) 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 *OrganizationCustomOrganizationRoleCreateSchema) 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["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["permissions"] = 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.SetPermissions(res) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the custom role. +// returns a *string when successful +func (m *OrganizationCustomOrganizationRoleCreateSchema) GetName()(*string) { + return m.name +} +// GetPermissions gets the permissions property value. A list of additional permissions included in this role. +// returns a []string when successful +func (m *OrganizationCustomOrganizationRoleCreateSchema) GetPermissions()([]string) { + return m.permissions +} +// Serialize serializes information the current object +func (m *OrganizationCustomOrganizationRoleCreateSchema) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetPermissions() != nil { + err := writer.WriteCollectionOfStringValues("permissions", m.GetPermissions()) + 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 *OrganizationCustomOrganizationRoleCreateSchema) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. A short description about the intended usage of this role or what permissions it grants. +func (m *OrganizationCustomOrganizationRoleCreateSchema) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name of the custom role. +func (m *OrganizationCustomOrganizationRoleCreateSchema) SetName(value *string)() { + m.name = value +} +// SetPermissions sets the permissions property value. A list of additional permissions included in this role. +func (m *OrganizationCustomOrganizationRoleCreateSchema) SetPermissions(value []string)() { + m.permissions = value +} +type OrganizationCustomOrganizationRoleCreateSchemaable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetName()(*string) + GetPermissions()([]string) + SetDescription(value *string)() + SetName(value *string)() + SetPermissions(value []string)() +} diff --git a/pkg/github/models/organization_custom_organization_role_update_schema.go b/pkg/github/models/organization_custom_organization_role_update_schema.go new file mode 100644 index 00000000..23b0a92a --- /dev/null +++ b/pkg/github/models/organization_custom_organization_role_update_schema.go @@ -0,0 +1,144 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationCustomOrganizationRoleUpdateSchema 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 short description about the intended use of this role or the permissions it grants. + description *string + // The name of the custom role. + name *string + // A list of additional permissions included in this role. + permissions []string +} +// NewOrganizationCustomOrganizationRoleUpdateSchema instantiates a new OrganizationCustomOrganizationRoleUpdateSchema and sets the default values. +func NewOrganizationCustomOrganizationRoleUpdateSchema()(*OrganizationCustomOrganizationRoleUpdateSchema) { + m := &OrganizationCustomOrganizationRoleUpdateSchema{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationCustomOrganizationRoleUpdateSchemaFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationCustomOrganizationRoleUpdateSchemaFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationCustomOrganizationRoleUpdateSchema(), 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 *OrganizationCustomOrganizationRoleUpdateSchema) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. A short description about the intended use of this role or the permissions it grants. +// returns a *string when successful +func (m *OrganizationCustomOrganizationRoleUpdateSchema) 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 *OrganizationCustomOrganizationRoleUpdateSchema) 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["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["permissions"] = 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.SetPermissions(res) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the custom role. +// returns a *string when successful +func (m *OrganizationCustomOrganizationRoleUpdateSchema) GetName()(*string) { + return m.name +} +// GetPermissions gets the permissions property value. A list of additional permissions included in this role. +// returns a []string when successful +func (m *OrganizationCustomOrganizationRoleUpdateSchema) GetPermissions()([]string) { + return m.permissions +} +// Serialize serializes information the current object +func (m *OrganizationCustomOrganizationRoleUpdateSchema) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetPermissions() != nil { + err := writer.WriteCollectionOfStringValues("permissions", m.GetPermissions()) + 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 *OrganizationCustomOrganizationRoleUpdateSchema) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. A short description about the intended use of this role or the permissions it grants. +func (m *OrganizationCustomOrganizationRoleUpdateSchema) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name of the custom role. +func (m *OrganizationCustomOrganizationRoleUpdateSchema) SetName(value *string)() { + m.name = value +} +// SetPermissions sets the permissions property value. A list of additional permissions included in this role. +func (m *OrganizationCustomOrganizationRoleUpdateSchema) SetPermissions(value []string)() { + m.permissions = value +} +type OrganizationCustomOrganizationRoleUpdateSchemaable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetName()(*string) + GetPermissions()([]string) + SetDescription(value *string)() + SetName(value *string)() + SetPermissions(value []string)() +} diff --git a/pkg/github/models/organization_custom_repository_role.go b/pkg/github/models/organization_custom_repository_role.go new file mode 100644 index 00000000..eeceacba --- /dev/null +++ b/pkg/github/models/organization_custom_repository_role.go @@ -0,0 +1,292 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationCustomRepositoryRole custom repository roles created by organization owners +type OrganizationCustomRepositoryRole 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 system role from which this role inherits permissions. + base_role *OrganizationCustomRepositoryRole_base_role + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A short description about who this role is for or what permissions it grants. + description *string + // The unique identifier of the custom role. + id *int32 + // The name of the custom role. + name *string + // A GitHub user. + organization SimpleUserable + // A list of additional permissions included in this role. + permissions []string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewOrganizationCustomRepositoryRole instantiates a new OrganizationCustomRepositoryRole and sets the default values. +func NewOrganizationCustomRepositoryRole()(*OrganizationCustomRepositoryRole) { + m := &OrganizationCustomRepositoryRole{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationCustomRepositoryRoleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationCustomRepositoryRoleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationCustomRepositoryRole(), 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 *OrganizationCustomRepositoryRole) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBaseRole gets the base_role property value. The system role from which this role inherits permissions. +// returns a *OrganizationCustomRepositoryRole_base_role when successful +func (m *OrganizationCustomRepositoryRole) GetBaseRole()(*OrganizationCustomRepositoryRole_base_role) { + return m.base_role +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *OrganizationCustomRepositoryRole) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. A short description about who this role is for or what permissions it grants. +// returns a *string when successful +func (m *OrganizationCustomRepositoryRole) 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 *OrganizationCustomRepositoryRole) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base_role"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationCustomRepositoryRole_base_role) + if err != nil { + return err + } + if val != nil { + m.SetBaseRole(val.(*OrganizationCustomRepositoryRole_base_role)) + } + return nil + } + 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["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(SimpleUserable)) + } + return nil + } + res["permissions"] = 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.SetPermissions(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 + } + return res +} +// GetId gets the id property value. The unique identifier of the custom role. +// returns a *int32 when successful +func (m *OrganizationCustomRepositoryRole) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the custom role. +// returns a *string when successful +func (m *OrganizationCustomRepositoryRole) GetName()(*string) { + return m.name +} +// GetOrganization gets the organization property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *OrganizationCustomRepositoryRole) GetOrganization()(SimpleUserable) { + return m.organization +} +// GetPermissions gets the permissions property value. A list of additional permissions included in this role. +// returns a []string when successful +func (m *OrganizationCustomRepositoryRole) GetPermissions()([]string) { + return m.permissions +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *OrganizationCustomRepositoryRole) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *OrganizationCustomRepositoryRole) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBaseRole() != nil { + cast := (*m.GetBaseRole()).String() + err := writer.WriteStringValue("base_role", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + if m.GetPermissions() != nil { + err := writer.WriteCollectionOfStringValues("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *OrganizationCustomRepositoryRole) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBaseRole sets the base_role property value. The system role from which this role inherits permissions. +func (m *OrganizationCustomRepositoryRole) SetBaseRole(value *OrganizationCustomRepositoryRole_base_role)() { + m.base_role = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *OrganizationCustomRepositoryRole) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. A short description about who this role is for or what permissions it grants. +func (m *OrganizationCustomRepositoryRole) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The unique identifier of the custom role. +func (m *OrganizationCustomRepositoryRole) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the custom role. +func (m *OrganizationCustomRepositoryRole) SetName(value *string)() { + m.name = value +} +// SetOrganization sets the organization property value. A GitHub user. +func (m *OrganizationCustomRepositoryRole) SetOrganization(value SimpleUserable)() { + m.organization = value +} +// SetPermissions sets the permissions property value. A list of additional permissions included in this role. +func (m *OrganizationCustomRepositoryRole) SetPermissions(value []string)() { + m.permissions = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *OrganizationCustomRepositoryRole) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type OrganizationCustomRepositoryRoleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBaseRole()(*OrganizationCustomRepositoryRole_base_role) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetId()(*int32) + GetName()(*string) + GetOrganization()(SimpleUserable) + GetPermissions()([]string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetBaseRole(value *OrganizationCustomRepositoryRole_base_role)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetOrganization(value SimpleUserable)() + SetPermissions(value []string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/organization_custom_repository_role_create_schema.go b/pkg/github/models/organization_custom_repository_role_create_schema.go new file mode 100644 index 00000000..eb04d6ba --- /dev/null +++ b/pkg/github/models/organization_custom_repository_role_create_schema.go @@ -0,0 +1,174 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationCustomRepositoryRoleCreateSchema 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 system role from which this role inherits permissions. + base_role *OrganizationCustomRepositoryRoleCreateSchema_base_role + // A short description about who this role is for or what permissions it grants. + description *string + // The name of the custom role. + name *string + // A list of additional permissions included in this role. + permissions []string +} +// NewOrganizationCustomRepositoryRoleCreateSchema instantiates a new OrganizationCustomRepositoryRoleCreateSchema and sets the default values. +func NewOrganizationCustomRepositoryRoleCreateSchema()(*OrganizationCustomRepositoryRoleCreateSchema) { + m := &OrganizationCustomRepositoryRoleCreateSchema{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationCustomRepositoryRoleCreateSchemaFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationCustomRepositoryRoleCreateSchemaFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationCustomRepositoryRoleCreateSchema(), 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 *OrganizationCustomRepositoryRoleCreateSchema) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBaseRole gets the base_role property value. The system role from which this role inherits permissions. +// returns a *OrganizationCustomRepositoryRoleCreateSchema_base_role when successful +func (m *OrganizationCustomRepositoryRoleCreateSchema) GetBaseRole()(*OrganizationCustomRepositoryRoleCreateSchema_base_role) { + return m.base_role +} +// GetDescription gets the description property value. A short description about who this role is for or what permissions it grants. +// returns a *string when successful +func (m *OrganizationCustomRepositoryRoleCreateSchema) 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 *OrganizationCustomRepositoryRoleCreateSchema) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base_role"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationCustomRepositoryRoleCreateSchema_base_role) + if err != nil { + return err + } + if val != nil { + m.SetBaseRole(val.(*OrganizationCustomRepositoryRoleCreateSchema_base_role)) + } + 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 + } + res["permissions"] = 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.SetPermissions(res) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the custom role. +// returns a *string when successful +func (m *OrganizationCustomRepositoryRoleCreateSchema) GetName()(*string) { + return m.name +} +// GetPermissions gets the permissions property value. A list of additional permissions included in this role. +// returns a []string when successful +func (m *OrganizationCustomRepositoryRoleCreateSchema) GetPermissions()([]string) { + return m.permissions +} +// Serialize serializes information the current object +func (m *OrganizationCustomRepositoryRoleCreateSchema) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBaseRole() != nil { + cast := (*m.GetBaseRole()).String() + err := writer.WriteStringValue("base_role", &cast) + 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 + } + } + if m.GetPermissions() != nil { + err := writer.WriteCollectionOfStringValues("permissions", m.GetPermissions()) + 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 *OrganizationCustomRepositoryRoleCreateSchema) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBaseRole sets the base_role property value. The system role from which this role inherits permissions. +func (m *OrganizationCustomRepositoryRoleCreateSchema) SetBaseRole(value *OrganizationCustomRepositoryRoleCreateSchema_base_role)() { + m.base_role = value +} +// SetDescription sets the description property value. A short description about who this role is for or what permissions it grants. +func (m *OrganizationCustomRepositoryRoleCreateSchema) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name of the custom role. +func (m *OrganizationCustomRepositoryRoleCreateSchema) SetName(value *string)() { + m.name = value +} +// SetPermissions sets the permissions property value. A list of additional permissions included in this role. +func (m *OrganizationCustomRepositoryRoleCreateSchema) SetPermissions(value []string)() { + m.permissions = value +} +type OrganizationCustomRepositoryRoleCreateSchemaable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBaseRole()(*OrganizationCustomRepositoryRoleCreateSchema_base_role) + GetDescription()(*string) + GetName()(*string) + GetPermissions()([]string) + SetBaseRole(value *OrganizationCustomRepositoryRoleCreateSchema_base_role)() + SetDescription(value *string)() + SetName(value *string)() + SetPermissions(value []string)() +} diff --git a/pkg/github/models/organization_custom_repository_role_create_schema_escaped_base_escaped_role.go b/pkg/github/models/organization_custom_repository_role_create_schema_escaped_base_escaped_role.go new file mode 100644 index 00000000..9dbe5c96 --- /dev/null +++ b/pkg/github/models/organization_custom_repository_role_create_schema_escaped_base_escaped_role.go @@ -0,0 +1,40 @@ +package models +// The system role from which this role inherits permissions. +type OrganizationCustomRepositoryRoleCreateSchema_base_role int + +const ( + READ_ORGANIZATIONCUSTOMREPOSITORYROLECREATESCHEMA_BASE_ROLE OrganizationCustomRepositoryRoleCreateSchema_base_role = iota + TRIAGE_ORGANIZATIONCUSTOMREPOSITORYROLECREATESCHEMA_BASE_ROLE + WRITE_ORGANIZATIONCUSTOMREPOSITORYROLECREATESCHEMA_BASE_ROLE + MAINTAIN_ORGANIZATIONCUSTOMREPOSITORYROLECREATESCHEMA_BASE_ROLE +) + +func (i OrganizationCustomRepositoryRoleCreateSchema_base_role) String() string { + return []string{"read", "triage", "write", "maintain"}[i] +} +func ParseOrganizationCustomRepositoryRoleCreateSchema_base_role(v string) (any, error) { + result := READ_ORGANIZATIONCUSTOMREPOSITORYROLECREATESCHEMA_BASE_ROLE + switch v { + case "read": + result = READ_ORGANIZATIONCUSTOMREPOSITORYROLECREATESCHEMA_BASE_ROLE + case "triage": + result = TRIAGE_ORGANIZATIONCUSTOMREPOSITORYROLECREATESCHEMA_BASE_ROLE + case "write": + result = WRITE_ORGANIZATIONCUSTOMREPOSITORYROLECREATESCHEMA_BASE_ROLE + case "maintain": + result = MAINTAIN_ORGANIZATIONCUSTOMREPOSITORYROLECREATESCHEMA_BASE_ROLE + default: + return nil, nil + } + return &result, nil +} +func SerializeOrganizationCustomRepositoryRoleCreateSchema_base_role(values []OrganizationCustomRepositoryRoleCreateSchema_base_role) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationCustomRepositoryRoleCreateSchema_base_role) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/organization_custom_repository_role_escaped_base_escaped_role.go b/pkg/github/models/organization_custom_repository_role_escaped_base_escaped_role.go new file mode 100644 index 00000000..f3164921 --- /dev/null +++ b/pkg/github/models/organization_custom_repository_role_escaped_base_escaped_role.go @@ -0,0 +1,40 @@ +package models +// The system role from which this role inherits permissions. +type OrganizationCustomRepositoryRole_base_role int + +const ( + READ_ORGANIZATIONCUSTOMREPOSITORYROLE_BASE_ROLE OrganizationCustomRepositoryRole_base_role = iota + TRIAGE_ORGANIZATIONCUSTOMREPOSITORYROLE_BASE_ROLE + WRITE_ORGANIZATIONCUSTOMREPOSITORYROLE_BASE_ROLE + MAINTAIN_ORGANIZATIONCUSTOMREPOSITORYROLE_BASE_ROLE +) + +func (i OrganizationCustomRepositoryRole_base_role) String() string { + return []string{"read", "triage", "write", "maintain"}[i] +} +func ParseOrganizationCustomRepositoryRole_base_role(v string) (any, error) { + result := READ_ORGANIZATIONCUSTOMREPOSITORYROLE_BASE_ROLE + switch v { + case "read": + result = READ_ORGANIZATIONCUSTOMREPOSITORYROLE_BASE_ROLE + case "triage": + result = TRIAGE_ORGANIZATIONCUSTOMREPOSITORYROLE_BASE_ROLE + case "write": + result = WRITE_ORGANIZATIONCUSTOMREPOSITORYROLE_BASE_ROLE + case "maintain": + result = MAINTAIN_ORGANIZATIONCUSTOMREPOSITORYROLE_BASE_ROLE + default: + return nil, nil + } + return &result, nil +} +func SerializeOrganizationCustomRepositoryRole_base_role(values []OrganizationCustomRepositoryRole_base_role) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationCustomRepositoryRole_base_role) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/organization_custom_repository_role_update_schema.go b/pkg/github/models/organization_custom_repository_role_update_schema.go new file mode 100644 index 00000000..532c9cb9 --- /dev/null +++ b/pkg/github/models/organization_custom_repository_role_update_schema.go @@ -0,0 +1,174 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationCustomRepositoryRoleUpdateSchema 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 system role from which this role inherits permissions. + base_role *OrganizationCustomRepositoryRoleUpdateSchema_base_role + // A short description about who this role is for or what permissions it grants. + description *string + // The name of the custom role. + name *string + // A list of additional permissions included in this role. + permissions []string +} +// NewOrganizationCustomRepositoryRoleUpdateSchema instantiates a new OrganizationCustomRepositoryRoleUpdateSchema and sets the default values. +func NewOrganizationCustomRepositoryRoleUpdateSchema()(*OrganizationCustomRepositoryRoleUpdateSchema) { + m := &OrganizationCustomRepositoryRoleUpdateSchema{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationCustomRepositoryRoleUpdateSchemaFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationCustomRepositoryRoleUpdateSchemaFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationCustomRepositoryRoleUpdateSchema(), 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 *OrganizationCustomRepositoryRoleUpdateSchema) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBaseRole gets the base_role property value. The system role from which this role inherits permissions. +// returns a *OrganizationCustomRepositoryRoleUpdateSchema_base_role when successful +func (m *OrganizationCustomRepositoryRoleUpdateSchema) GetBaseRole()(*OrganizationCustomRepositoryRoleUpdateSchema_base_role) { + return m.base_role +} +// GetDescription gets the description property value. A short description about who this role is for or what permissions it grants. +// returns a *string when successful +func (m *OrganizationCustomRepositoryRoleUpdateSchema) 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 *OrganizationCustomRepositoryRoleUpdateSchema) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base_role"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationCustomRepositoryRoleUpdateSchema_base_role) + if err != nil { + return err + } + if val != nil { + m.SetBaseRole(val.(*OrganizationCustomRepositoryRoleUpdateSchema_base_role)) + } + 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 + } + res["permissions"] = 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.SetPermissions(res) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the custom role. +// returns a *string when successful +func (m *OrganizationCustomRepositoryRoleUpdateSchema) GetName()(*string) { + return m.name +} +// GetPermissions gets the permissions property value. A list of additional permissions included in this role. +// returns a []string when successful +func (m *OrganizationCustomRepositoryRoleUpdateSchema) GetPermissions()([]string) { + return m.permissions +} +// Serialize serializes information the current object +func (m *OrganizationCustomRepositoryRoleUpdateSchema) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBaseRole() != nil { + cast := (*m.GetBaseRole()).String() + err := writer.WriteStringValue("base_role", &cast) + 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 + } + } + if m.GetPermissions() != nil { + err := writer.WriteCollectionOfStringValues("permissions", m.GetPermissions()) + 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 *OrganizationCustomRepositoryRoleUpdateSchema) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBaseRole sets the base_role property value. The system role from which this role inherits permissions. +func (m *OrganizationCustomRepositoryRoleUpdateSchema) SetBaseRole(value *OrganizationCustomRepositoryRoleUpdateSchema_base_role)() { + m.base_role = value +} +// SetDescription sets the description property value. A short description about who this role is for or what permissions it grants. +func (m *OrganizationCustomRepositoryRoleUpdateSchema) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name of the custom role. +func (m *OrganizationCustomRepositoryRoleUpdateSchema) SetName(value *string)() { + m.name = value +} +// SetPermissions sets the permissions property value. A list of additional permissions included in this role. +func (m *OrganizationCustomRepositoryRoleUpdateSchema) SetPermissions(value []string)() { + m.permissions = value +} +type OrganizationCustomRepositoryRoleUpdateSchemaable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBaseRole()(*OrganizationCustomRepositoryRoleUpdateSchema_base_role) + GetDescription()(*string) + GetName()(*string) + GetPermissions()([]string) + SetBaseRole(value *OrganizationCustomRepositoryRoleUpdateSchema_base_role)() + SetDescription(value *string)() + SetName(value *string)() + SetPermissions(value []string)() +} diff --git a/pkg/github/models/organization_custom_repository_role_update_schema_escaped_base_escaped_role.go b/pkg/github/models/organization_custom_repository_role_update_schema_escaped_base_escaped_role.go new file mode 100644 index 00000000..fc074869 --- /dev/null +++ b/pkg/github/models/organization_custom_repository_role_update_schema_escaped_base_escaped_role.go @@ -0,0 +1,40 @@ +package models +// The system role from which this role inherits permissions. +type OrganizationCustomRepositoryRoleUpdateSchema_base_role int + +const ( + READ_ORGANIZATIONCUSTOMREPOSITORYROLEUPDATESCHEMA_BASE_ROLE OrganizationCustomRepositoryRoleUpdateSchema_base_role = iota + TRIAGE_ORGANIZATIONCUSTOMREPOSITORYROLEUPDATESCHEMA_BASE_ROLE + WRITE_ORGANIZATIONCUSTOMREPOSITORYROLEUPDATESCHEMA_BASE_ROLE + MAINTAIN_ORGANIZATIONCUSTOMREPOSITORYROLEUPDATESCHEMA_BASE_ROLE +) + +func (i OrganizationCustomRepositoryRoleUpdateSchema_base_role) String() string { + return []string{"read", "triage", "write", "maintain"}[i] +} +func ParseOrganizationCustomRepositoryRoleUpdateSchema_base_role(v string) (any, error) { + result := READ_ORGANIZATIONCUSTOMREPOSITORYROLEUPDATESCHEMA_BASE_ROLE + switch v { + case "read": + result = READ_ORGANIZATIONCUSTOMREPOSITORYROLEUPDATESCHEMA_BASE_ROLE + case "triage": + result = TRIAGE_ORGANIZATIONCUSTOMREPOSITORYROLEUPDATESCHEMA_BASE_ROLE + case "write": + result = WRITE_ORGANIZATIONCUSTOMREPOSITORYROLEUPDATESCHEMA_BASE_ROLE + case "maintain": + result = MAINTAIN_ORGANIZATIONCUSTOMREPOSITORYROLEUPDATESCHEMA_BASE_ROLE + default: + return nil, nil + } + return &result, nil +} +func SerializeOrganizationCustomRepositoryRoleUpdateSchema_base_role(values []OrganizationCustomRepositoryRoleUpdateSchema_base_role) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationCustomRepositoryRoleUpdateSchema_base_role) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/organization_dependabot_secret.go b/pkg/github/models/organization_dependabot_secret.go new file mode 100644 index 00000000..4cb480aa --- /dev/null +++ b/pkg/github/models/organization_dependabot_secret.go @@ -0,0 +1,199 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationDependabotSecret secrets for GitHub Dependabot for an organization. +type OrganizationDependabotSecret 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 secret. + name *string + // The selected_repositories_url property + selected_repositories_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Visibility of a secret + visibility *OrganizationDependabotSecret_visibility +} +// NewOrganizationDependabotSecret instantiates a new OrganizationDependabotSecret and sets the default values. +func NewOrganizationDependabotSecret()(*OrganizationDependabotSecret) { + m := &OrganizationDependabotSecret{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationDependabotSecretFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationDependabotSecretFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationDependabotSecret(), 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 *OrganizationDependabotSecret) 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 *OrganizationDependabotSecret) 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 *OrganizationDependabotSecret) 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["selected_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedRepositoriesUrl(val) + } + 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["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationDependabotSecret_visibility) + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val.(*OrganizationDependabotSecret_visibility)) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the secret. +// returns a *string when successful +func (m *OrganizationDependabotSecret) GetName()(*string) { + return m.name +} +// GetSelectedRepositoriesUrl gets the selected_repositories_url property value. The selected_repositories_url property +// returns a *string when successful +func (m *OrganizationDependabotSecret) GetSelectedRepositoriesUrl()(*string) { + return m.selected_repositories_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *OrganizationDependabotSecret) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetVisibility gets the visibility property value. Visibility of a secret +// returns a *OrganizationDependabotSecret_visibility when successful +func (m *OrganizationDependabotSecret) GetVisibility()(*OrganizationDependabotSecret_visibility) { + return m.visibility +} +// Serialize serializes information the current object +func (m *OrganizationDependabotSecret) 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 + } + } + { + err := writer.WriteStringValue("selected_repositories_url", m.GetSelectedRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *OrganizationDependabotSecret) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *OrganizationDependabotSecret) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetName sets the name property value. The name of the secret. +func (m *OrganizationDependabotSecret) SetName(value *string)() { + m.name = value +} +// SetSelectedRepositoriesUrl sets the selected_repositories_url property value. The selected_repositories_url property +func (m *OrganizationDependabotSecret) SetSelectedRepositoriesUrl(value *string)() { + m.selected_repositories_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *OrganizationDependabotSecret) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetVisibility sets the visibility property value. Visibility of a secret +func (m *OrganizationDependabotSecret) SetVisibility(value *OrganizationDependabotSecret_visibility)() { + m.visibility = value +} +type OrganizationDependabotSecretable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetName()(*string) + GetSelectedRepositoriesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetVisibility()(*OrganizationDependabotSecret_visibility) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetName(value *string)() + SetSelectedRepositoriesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetVisibility(value *OrganizationDependabotSecret_visibility)() +} diff --git a/pkg/github/models/organization_dependabot_secret_escaped_visibility.go b/pkg/github/models/organization_dependabot_secret_escaped_visibility.go new file mode 100644 index 00000000..aedb710e --- /dev/null +++ b/pkg/github/models/organization_dependabot_secret_escaped_visibility.go @@ -0,0 +1,37 @@ +package models +// Visibility of a secret +type OrganizationDependabotSecret_visibility int + +const ( + ALL_ORGANIZATIONDEPENDABOTSECRET_VISIBILITY OrganizationDependabotSecret_visibility = iota + PRIVATE_ORGANIZATIONDEPENDABOTSECRET_VISIBILITY + SELECTED_ORGANIZATIONDEPENDABOTSECRET_VISIBILITY +) + +func (i OrganizationDependabotSecret_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseOrganizationDependabotSecret_visibility(v string) (any, error) { + result := ALL_ORGANIZATIONDEPENDABOTSECRET_VISIBILITY + switch v { + case "all": + result = ALL_ORGANIZATIONDEPENDABOTSECRET_VISIBILITY + case "private": + result = PRIVATE_ORGANIZATIONDEPENDABOTSECRET_VISIBILITY + case "selected": + result = SELECTED_ORGANIZATIONDEPENDABOTSECRET_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeOrganizationDependabotSecret_visibility(values []OrganizationDependabotSecret_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationDependabotSecret_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/organization_fine_grained_permission.go b/pkg/github/models/organization_fine_grained_permission.go new file mode 100644 index 00000000..e7f18854 --- /dev/null +++ b/pkg/github/models/organization_fine_grained_permission.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationFineGrainedPermission a fine-grained permission that protects organization resources. +type OrganizationFineGrainedPermission 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 property + description *string + // The name property + name *string +} +// NewOrganizationFineGrainedPermission instantiates a new OrganizationFineGrainedPermission and sets the default values. +func NewOrganizationFineGrainedPermission()(*OrganizationFineGrainedPermission) { + m := &OrganizationFineGrainedPermission{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationFineGrainedPermissionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationFineGrainedPermissionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationFineGrainedPermission(), 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 *OrganizationFineGrainedPermission) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *OrganizationFineGrainedPermission) 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 *OrganizationFineGrainedPermission) 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["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 property +// returns a *string when successful +func (m *OrganizationFineGrainedPermission) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *OrganizationFineGrainedPermission) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *OrganizationFineGrainedPermission) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description property +func (m *OrganizationFineGrainedPermission) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name property +func (m *OrganizationFineGrainedPermission) SetName(value *string)() { + m.name = value +} +type OrganizationFineGrainedPermissionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetName()(*string) + SetDescription(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/organization_full.go b/pkg/github/models/organization_full.go new file mode 100644 index 00000000..26f62c77 --- /dev/null +++ b/pkg/github/models/organization_full.go @@ -0,0 +1,1724 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationFull organization Full +type OrganizationFull struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether GitHub Advanced Security is enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. + // Deprecated: + advanced_security_enabled_for_new_repositories *bool + // The archived_at property + archived_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The avatar_url property + avatar_url *string + // The billing_email property + billing_email *string + // The blog property + blog *string + // The collaborators property + collaborators *int32 + // The company property + company *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default_repository_permission property + default_repository_permission *string + // **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. + // Deprecated: + dependabot_alerts_enabled_for_new_repositories *bool + // **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. + // Deprecated: + dependabot_security_updates_enabled_for_new_repositories *bool + // **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. + // Deprecated: + dependency_graph_enabled_for_new_repositories *bool + // The description property + description *string + // The disk_usage property + disk_usage *int32 + // The email property + email *string + // The events_url property + events_url *string + // The followers property + followers *int32 + // The following property + following *int32 + // The has_organization_projects property + has_organization_projects *bool + // The has_repository_projects property + has_repository_projects *bool + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The is_verified property + is_verified *bool + // The issues_url property + issues_url *string + // The location property + location *string + // The login property + login *string + // The members_allowed_repository_creation_type property + members_allowed_repository_creation_type *string + // The members_can_create_internal_repositories property + members_can_create_internal_repositories *bool + // The members_can_create_pages property + members_can_create_pages *bool + // The members_can_create_private_pages property + members_can_create_private_pages *bool + // The members_can_create_private_repositories property + members_can_create_private_repositories *bool + // The members_can_create_public_pages property + members_can_create_public_pages *bool + // The members_can_create_public_repositories property + members_can_create_public_repositories *bool + // The members_can_create_repositories property + members_can_create_repositories *bool + // The members_can_fork_private_repositories property + members_can_fork_private_repositories *bool + // The members_url property + members_url *string + // The name property + name *string + // The node_id property + node_id *string + // The owned_private_repos property + owned_private_repos *int32 + // The plan property + plan OrganizationFull_planable + // The private_gists property + private_gists *int32 + // The public_gists property + public_gists *int32 + // The public_members_url property + public_members_url *string + // The public_repos property + public_repos *int32 + // The repos_url property + repos_url *string + // **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. + // Deprecated: + secret_scanning_enabled_for_new_repositories *bool + // An optional URL string to display to contributors who are blocked from pushing a secret. + secret_scanning_push_protection_custom_link *string + // Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. + secret_scanning_push_protection_custom_link_enabled *bool + // **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. + // Deprecated: + secret_scanning_push_protection_enabled_for_new_repositories *bool + // The total_private_repos property + total_private_repos *int32 + // The twitter_username property + twitter_username *string + // The two_factor_requirement_enabled property + two_factor_requirement_enabled *bool + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewOrganizationFull instantiates a new OrganizationFull and sets the default values. +func NewOrganizationFull()(*OrganizationFull) { + m := &OrganizationFull{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationFullFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationFullFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationFull(), 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 *OrganizationFull) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurityEnabledForNewRepositories gets the advanced_security_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether GitHub Advanced Security is enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +// Deprecated: +// returns a *bool when successful +func (m *OrganizationFull) GetAdvancedSecurityEnabledForNewRepositories()(*bool) { + return m.advanced_security_enabled_for_new_repositories +} +// GetArchivedAt gets the archived_at property value. The archived_at property +// returns a *Time when successful +func (m *OrganizationFull) GetArchivedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.archived_at +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *OrganizationFull) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetBillingEmail gets the billing_email property value. The billing_email property +// returns a *string when successful +func (m *OrganizationFull) GetBillingEmail()(*string) { + return m.billing_email +} +// GetBlog gets the blog property value. The blog property +// returns a *string when successful +func (m *OrganizationFull) GetBlog()(*string) { + return m.blog +} +// GetCollaborators gets the collaborators property value. The collaborators property +// returns a *int32 when successful +func (m *OrganizationFull) GetCollaborators()(*int32) { + return m.collaborators +} +// GetCompany gets the company property value. The company property +// returns a *string when successful +func (m *OrganizationFull) GetCompany()(*string) { + return m.company +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *OrganizationFull) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultRepositoryPermission gets the default_repository_permission property value. The default_repository_permission property +// returns a *string when successful +func (m *OrganizationFull) GetDefaultRepositoryPermission()(*string) { + return m.default_repository_permission +} +// GetDependabotAlertsEnabledForNewRepositories gets the dependabot_alerts_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +// Deprecated: +// returns a *bool when successful +func (m *OrganizationFull) GetDependabotAlertsEnabledForNewRepositories()(*bool) { + return m.dependabot_alerts_enabled_for_new_repositories +} +// GetDependabotSecurityUpdatesEnabledForNewRepositories gets the dependabot_security_updates_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +// Deprecated: +// returns a *bool when successful +func (m *OrganizationFull) GetDependabotSecurityUpdatesEnabledForNewRepositories()(*bool) { + return m.dependabot_security_updates_enabled_for_new_repositories +} +// GetDependencyGraphEnabledForNewRepositories gets the dependency_graph_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +// Deprecated: +// returns a *bool when successful +func (m *OrganizationFull) GetDependencyGraphEnabledForNewRepositories()(*bool) { + return m.dependency_graph_enabled_for_new_repositories +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *OrganizationFull) GetDescription()(*string) { + return m.description +} +// GetDiskUsage gets the disk_usage property value. The disk_usage property +// returns a *int32 when successful +func (m *OrganizationFull) GetDiskUsage()(*int32) { + return m.disk_usage +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *OrganizationFull) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *OrganizationFull) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationFull) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advanced_security_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurityEnabledForNewRepositories(val) + } + return nil + } + res["archived_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetArchivedAt(val) + } + return nil + } + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["billing_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBillingEmail(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["collaborators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCollaborators(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + 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["default_repository_permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultRepositoryPermission(val) + } + return nil + } + res["dependabot_alerts_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDependabotAlertsEnabledForNewRepositories(val) + } + return nil + } + res["dependabot_security_updates_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDependabotSecurityUpdatesEnabledForNewRepositories(val) + } + return nil + } + res["dependency_graph_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDependencyGraphEnabledForNewRepositories(val) + } + 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["disk_usage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDiskUsage(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowers(val) + } + return nil + } + res["following"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowing(val) + } + return nil + } + res["has_organization_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasOrganizationProjects(val) + } + return nil + } + res["has_repository_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasRepositoryProjects(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsVerified(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["members_allowed_repository_creation_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersAllowedRepositoryCreationType(val) + } + return nil + } + res["members_can_create_internal_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreateInternalRepositories(val) + } + return nil + } + res["members_can_create_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePages(val) + } + return nil + } + res["members_can_create_private_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePrivatePages(val) + } + return nil + } + res["members_can_create_private_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePrivateRepositories(val) + } + return nil + } + res["members_can_create_public_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePublicPages(val) + } + return nil + } + res["members_can_create_public_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePublicRepositories(val) + } + return nil + } + res["members_can_create_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreateRepositories(val) + } + return nil + } + res["members_can_fork_private_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanForkPrivateRepositories(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owned_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOwnedPrivateRepos(val) + } + return nil + } + res["plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationFull_planFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPlan(val.(OrganizationFull_planable)) + } + return nil + } + res["private_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateGists(val) + } + return nil + } + res["public_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicGists(val) + } + return nil + } + res["public_members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicMembersUrl(val) + } + return nil + } + res["public_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicRepos(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["secret_scanning_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningEnabledForNewRepositories(val) + } + return nil + } + res["secret_scanning_push_protection_custom_link"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionCustomLink(val) + } + return nil + } + res["secret_scanning_push_protection_custom_link_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionCustomLinkEnabled(val) + } + return nil + } + res["secret_scanning_push_protection_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionEnabledForNewRepositories(val) + } + return nil + } + res["total_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPrivateRepos(val) + } + return nil + } + res["twitter_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTwitterUsername(val) + } + return nil + } + res["two_factor_requirement_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTwoFactorRequirementEnabled(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFollowers gets the followers property value. The followers property +// returns a *int32 when successful +func (m *OrganizationFull) GetFollowers()(*int32) { + return m.followers +} +// GetFollowing gets the following property value. The following property +// returns a *int32 when successful +func (m *OrganizationFull) GetFollowing()(*int32) { + return m.following +} +// GetHasOrganizationProjects gets the has_organization_projects property value. The has_organization_projects property +// returns a *bool when successful +func (m *OrganizationFull) GetHasOrganizationProjects()(*bool) { + return m.has_organization_projects +} +// GetHasRepositoryProjects gets the has_repository_projects property value. The has_repository_projects property +// returns a *bool when successful +func (m *OrganizationFull) GetHasRepositoryProjects()(*bool) { + return m.has_repository_projects +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *OrganizationFull) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *OrganizationFull) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *OrganizationFull) GetId()(*int32) { + return m.id +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *OrganizationFull) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsVerified gets the is_verified property value. The is_verified property +// returns a *bool when successful +func (m *OrganizationFull) GetIsVerified()(*bool) { + return m.is_verified +} +// GetLocation gets the location property value. The location property +// returns a *string when successful +func (m *OrganizationFull) GetLocation()(*string) { + return m.location +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *OrganizationFull) GetLogin()(*string) { + return m.login +} +// GetMembersAllowedRepositoryCreationType gets the members_allowed_repository_creation_type property value. The members_allowed_repository_creation_type property +// returns a *string when successful +func (m *OrganizationFull) GetMembersAllowedRepositoryCreationType()(*string) { + return m.members_allowed_repository_creation_type +} +// GetMembersCanCreateInternalRepositories gets the members_can_create_internal_repositories property value. The members_can_create_internal_repositories property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanCreateInternalRepositories()(*bool) { + return m.members_can_create_internal_repositories +} +// GetMembersCanCreatePages gets the members_can_create_pages property value. The members_can_create_pages property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanCreatePages()(*bool) { + return m.members_can_create_pages +} +// GetMembersCanCreatePrivatePages gets the members_can_create_private_pages property value. The members_can_create_private_pages property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanCreatePrivatePages()(*bool) { + return m.members_can_create_private_pages +} +// GetMembersCanCreatePrivateRepositories gets the members_can_create_private_repositories property value. The members_can_create_private_repositories property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanCreatePrivateRepositories()(*bool) { + return m.members_can_create_private_repositories +} +// GetMembersCanCreatePublicPages gets the members_can_create_public_pages property value. The members_can_create_public_pages property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanCreatePublicPages()(*bool) { + return m.members_can_create_public_pages +} +// GetMembersCanCreatePublicRepositories gets the members_can_create_public_repositories property value. The members_can_create_public_repositories property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanCreatePublicRepositories()(*bool) { + return m.members_can_create_public_repositories +} +// GetMembersCanCreateRepositories gets the members_can_create_repositories property value. The members_can_create_repositories property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanCreateRepositories()(*bool) { + return m.members_can_create_repositories +} +// GetMembersCanForkPrivateRepositories gets the members_can_fork_private_repositories property value. The members_can_fork_private_repositories property +// returns a *bool when successful +func (m *OrganizationFull) GetMembersCanForkPrivateRepositories()(*bool) { + return m.members_can_fork_private_repositories +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *OrganizationFull) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *OrganizationFull) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *OrganizationFull) GetNodeId()(*string) { + return m.node_id +} +// GetOwnedPrivateRepos gets the owned_private_repos property value. The owned_private_repos property +// returns a *int32 when successful +func (m *OrganizationFull) GetOwnedPrivateRepos()(*int32) { + return m.owned_private_repos +} +// GetPlan gets the plan property value. The plan property +// returns a OrganizationFull_planable when successful +func (m *OrganizationFull) GetPlan()(OrganizationFull_planable) { + return m.plan +} +// GetPrivateGists gets the private_gists property value. The private_gists property +// returns a *int32 when successful +func (m *OrganizationFull) GetPrivateGists()(*int32) { + return m.private_gists +} +// GetPublicGists gets the public_gists property value. The public_gists property +// returns a *int32 when successful +func (m *OrganizationFull) GetPublicGists()(*int32) { + return m.public_gists +} +// GetPublicMembersUrl gets the public_members_url property value. The public_members_url property +// returns a *string when successful +func (m *OrganizationFull) GetPublicMembersUrl()(*string) { + return m.public_members_url +} +// GetPublicRepos gets the public_repos property value. The public_repos property +// returns a *int32 when successful +func (m *OrganizationFull) GetPublicRepos()(*int32) { + return m.public_repos +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *OrganizationFull) GetReposUrl()(*string) { + return m.repos_url +} +// GetSecretScanningEnabledForNewRepositories gets the secret_scanning_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +// Deprecated: +// returns a *bool when successful +func (m *OrganizationFull) GetSecretScanningEnabledForNewRepositories()(*bool) { + return m.secret_scanning_enabled_for_new_repositories +} +// GetSecretScanningPushProtectionCustomLink gets the secret_scanning_push_protection_custom_link property value. An optional URL string to display to contributors who are blocked from pushing a secret. +// returns a *string when successful +func (m *OrganizationFull) GetSecretScanningPushProtectionCustomLink()(*string) { + return m.secret_scanning_push_protection_custom_link +} +// GetSecretScanningPushProtectionCustomLinkEnabled gets the secret_scanning_push_protection_custom_link_enabled property value. Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. +// returns a *bool when successful +func (m *OrganizationFull) GetSecretScanningPushProtectionCustomLinkEnabled()(*bool) { + return m.secret_scanning_push_protection_custom_link_enabled +} +// GetSecretScanningPushProtectionEnabledForNewRepositories gets the secret_scanning_push_protection_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +// Deprecated: +// returns a *bool when successful +func (m *OrganizationFull) GetSecretScanningPushProtectionEnabledForNewRepositories()(*bool) { + return m.secret_scanning_push_protection_enabled_for_new_repositories +} +// GetTotalPrivateRepos gets the total_private_repos property value. The total_private_repos property +// returns a *int32 when successful +func (m *OrganizationFull) GetTotalPrivateRepos()(*int32) { + return m.total_private_repos +} +// GetTwitterUsername gets the twitter_username property value. The twitter_username property +// returns a *string when successful +func (m *OrganizationFull) GetTwitterUsername()(*string) { + return m.twitter_username +} +// GetTwoFactorRequirementEnabled gets the two_factor_requirement_enabled property value. The two_factor_requirement_enabled property +// returns a *bool when successful +func (m *OrganizationFull) GetTwoFactorRequirementEnabled()(*bool) { + return m.two_factor_requirement_enabled +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *OrganizationFull) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *OrganizationFull) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *OrganizationFull) GetUrl()(*string) { + return m.url +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *OrganizationFull) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *OrganizationFull) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("advanced_security_enabled_for_new_repositories", m.GetAdvancedSecurityEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("archived_at", m.GetArchivedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("billing_email", m.GetBillingEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("collaborators", m.GetCollaborators()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_repository_permission", m.GetDefaultRepositoryPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dependabot_alerts_enabled_for_new_repositories", m.GetDependabotAlertsEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dependabot_security_updates_enabled_for_new_repositories", m.GetDependabotSecurityUpdatesEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dependency_graph_enabled_for_new_repositories", m.GetDependencyGraphEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("disk_usage", m.GetDiskUsage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("followers", m.GetFollowers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("following", m.GetFollowing()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_organization_projects", m.GetHasOrganizationProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_repository_projects", m.GetHasRepositoryProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_verified", m.GetIsVerified()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_allowed_repository_creation_type", m.GetMembersAllowedRepositoryCreationType()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_internal_repositories", m.GetMembersCanCreateInternalRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_pages", m.GetMembersCanCreatePages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_private_pages", m.GetMembersCanCreatePrivatePages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_private_repositories", m.GetMembersCanCreatePrivateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_public_pages", m.GetMembersCanCreatePublicPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_public_repositories", m.GetMembersCanCreatePublicRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_repositories", m.GetMembersCanCreateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_fork_private_repositories", m.GetMembersCanForkPrivateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("owned_private_repos", m.GetOwnedPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("plan", m.GetPlan()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_gists", m.GetPrivateGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_gists", m.GetPublicGists()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_members_url", m.GetPublicMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_repos", m.GetPublicRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_enabled_for_new_repositories", m.GetSecretScanningEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_scanning_push_protection_custom_link", m.GetSecretScanningPushProtectionCustomLink()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_push_protection_custom_link_enabled", m.GetSecretScanningPushProtectionCustomLinkEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_push_protection_enabled_for_new_repositories", m.GetSecretScanningPushProtectionEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_private_repos", m.GetTotalPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("twitter_username", m.GetTwitterUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("two_factor_requirement_enabled", m.GetTwoFactorRequirementEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *OrganizationFull) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurityEnabledForNewRepositories sets the advanced_security_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether GitHub Advanced Security is enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +// Deprecated: +func (m *OrganizationFull) SetAdvancedSecurityEnabledForNewRepositories(value *bool)() { + m.advanced_security_enabled_for_new_repositories = value +} +// SetArchivedAt sets the archived_at property value. The archived_at property +func (m *OrganizationFull) SetArchivedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.archived_at = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *OrganizationFull) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetBillingEmail sets the billing_email property value. The billing_email property +func (m *OrganizationFull) SetBillingEmail(value *string)() { + m.billing_email = value +} +// SetBlog sets the blog property value. The blog property +func (m *OrganizationFull) SetBlog(value *string)() { + m.blog = value +} +// SetCollaborators sets the collaborators property value. The collaborators property +func (m *OrganizationFull) SetCollaborators(value *int32)() { + m.collaborators = value +} +// SetCompany sets the company property value. The company property +func (m *OrganizationFull) SetCompany(value *string)() { + m.company = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *OrganizationFull) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultRepositoryPermission sets the default_repository_permission property value. The default_repository_permission property +func (m *OrganizationFull) SetDefaultRepositoryPermission(value *string)() { + m.default_repository_permission = value +} +// SetDependabotAlertsEnabledForNewRepositories sets the dependabot_alerts_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +// Deprecated: +func (m *OrganizationFull) SetDependabotAlertsEnabledForNewRepositories(value *bool)() { + m.dependabot_alerts_enabled_for_new_repositories = value +} +// SetDependabotSecurityUpdatesEnabledForNewRepositories sets the dependabot_security_updates_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +// Deprecated: +func (m *OrganizationFull) SetDependabotSecurityUpdatesEnabledForNewRepositories(value *bool)() { + m.dependabot_security_updates_enabled_for_new_repositories = value +} +// SetDependencyGraphEnabledForNewRepositories sets the dependency_graph_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +// Deprecated: +func (m *OrganizationFull) SetDependencyGraphEnabledForNewRepositories(value *bool)() { + m.dependency_graph_enabled_for_new_repositories = value +} +// SetDescription sets the description property value. The description property +func (m *OrganizationFull) SetDescription(value *string)() { + m.description = value +} +// SetDiskUsage sets the disk_usage property value. The disk_usage property +func (m *OrganizationFull) SetDiskUsage(value *int32)() { + m.disk_usage = value +} +// SetEmail sets the email property value. The email property +func (m *OrganizationFull) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *OrganizationFull) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowers sets the followers property value. The followers property +func (m *OrganizationFull) SetFollowers(value *int32)() { + m.followers = value +} +// SetFollowing sets the following property value. The following property +func (m *OrganizationFull) SetFollowing(value *int32)() { + m.following = value +} +// SetHasOrganizationProjects sets the has_organization_projects property value. The has_organization_projects property +func (m *OrganizationFull) SetHasOrganizationProjects(value *bool)() { + m.has_organization_projects = value +} +// SetHasRepositoryProjects sets the has_repository_projects property value. The has_repository_projects property +func (m *OrganizationFull) SetHasRepositoryProjects(value *bool)() { + m.has_repository_projects = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *OrganizationFull) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *OrganizationFull) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *OrganizationFull) SetId(value *int32)() { + m.id = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *OrganizationFull) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsVerified sets the is_verified property value. The is_verified property +func (m *OrganizationFull) SetIsVerified(value *bool)() { + m.is_verified = value +} +// SetLocation sets the location property value. The location property +func (m *OrganizationFull) SetLocation(value *string)() { + m.location = value +} +// SetLogin sets the login property value. The login property +func (m *OrganizationFull) SetLogin(value *string)() { + m.login = value +} +// SetMembersAllowedRepositoryCreationType sets the members_allowed_repository_creation_type property value. The members_allowed_repository_creation_type property +func (m *OrganizationFull) SetMembersAllowedRepositoryCreationType(value *string)() { + m.members_allowed_repository_creation_type = value +} +// SetMembersCanCreateInternalRepositories sets the members_can_create_internal_repositories property value. The members_can_create_internal_repositories property +func (m *OrganizationFull) SetMembersCanCreateInternalRepositories(value *bool)() { + m.members_can_create_internal_repositories = value +} +// SetMembersCanCreatePages sets the members_can_create_pages property value. The members_can_create_pages property +func (m *OrganizationFull) SetMembersCanCreatePages(value *bool)() { + m.members_can_create_pages = value +} +// SetMembersCanCreatePrivatePages sets the members_can_create_private_pages property value. The members_can_create_private_pages property +func (m *OrganizationFull) SetMembersCanCreatePrivatePages(value *bool)() { + m.members_can_create_private_pages = value +} +// SetMembersCanCreatePrivateRepositories sets the members_can_create_private_repositories property value. The members_can_create_private_repositories property +func (m *OrganizationFull) SetMembersCanCreatePrivateRepositories(value *bool)() { + m.members_can_create_private_repositories = value +} +// SetMembersCanCreatePublicPages sets the members_can_create_public_pages property value. The members_can_create_public_pages property +func (m *OrganizationFull) SetMembersCanCreatePublicPages(value *bool)() { + m.members_can_create_public_pages = value +} +// SetMembersCanCreatePublicRepositories sets the members_can_create_public_repositories property value. The members_can_create_public_repositories property +func (m *OrganizationFull) SetMembersCanCreatePublicRepositories(value *bool)() { + m.members_can_create_public_repositories = value +} +// SetMembersCanCreateRepositories sets the members_can_create_repositories property value. The members_can_create_repositories property +func (m *OrganizationFull) SetMembersCanCreateRepositories(value *bool)() { + m.members_can_create_repositories = value +} +// SetMembersCanForkPrivateRepositories sets the members_can_fork_private_repositories property value. The members_can_fork_private_repositories property +func (m *OrganizationFull) SetMembersCanForkPrivateRepositories(value *bool)() { + m.members_can_fork_private_repositories = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *OrganizationFull) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. The name property +func (m *OrganizationFull) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *OrganizationFull) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwnedPrivateRepos sets the owned_private_repos property value. The owned_private_repos property +func (m *OrganizationFull) SetOwnedPrivateRepos(value *int32)() { + m.owned_private_repos = value +} +// SetPlan sets the plan property value. The plan property +func (m *OrganizationFull) SetPlan(value OrganizationFull_planable)() { + m.plan = value +} +// SetPrivateGists sets the private_gists property value. The private_gists property +func (m *OrganizationFull) SetPrivateGists(value *int32)() { + m.private_gists = value +} +// SetPublicGists sets the public_gists property value. The public_gists property +func (m *OrganizationFull) SetPublicGists(value *int32)() { + m.public_gists = value +} +// SetPublicMembersUrl sets the public_members_url property value. The public_members_url property +func (m *OrganizationFull) SetPublicMembersUrl(value *string)() { + m.public_members_url = value +} +// SetPublicRepos sets the public_repos property value. The public_repos property +func (m *OrganizationFull) SetPublicRepos(value *int32)() { + m.public_repos = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *OrganizationFull) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSecretScanningEnabledForNewRepositories sets the secret_scanning_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +// Deprecated: +func (m *OrganizationFull) SetSecretScanningEnabledForNewRepositories(value *bool)() { + m.secret_scanning_enabled_for_new_repositories = value +} +// SetSecretScanningPushProtectionCustomLink sets the secret_scanning_push_protection_custom_link property value. An optional URL string to display to contributors who are blocked from pushing a secret. +func (m *OrganizationFull) SetSecretScanningPushProtectionCustomLink(value *string)() { + m.secret_scanning_push_protection_custom_link = value +} +// SetSecretScanningPushProtectionCustomLinkEnabled sets the secret_scanning_push_protection_custom_link_enabled property value. Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. +func (m *OrganizationFull) SetSecretScanningPushProtectionCustomLinkEnabled(value *bool)() { + m.secret_scanning_push_protection_custom_link_enabled = value +} +// SetSecretScanningPushProtectionEnabledForNewRepositories sets the secret_scanning_push_protection_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization.This field is only visible to organization owners or members of a team with the security manager role. +// Deprecated: +func (m *OrganizationFull) SetSecretScanningPushProtectionEnabledForNewRepositories(value *bool)() { + m.secret_scanning_push_protection_enabled_for_new_repositories = value +} +// SetTotalPrivateRepos sets the total_private_repos property value. The total_private_repos property +func (m *OrganizationFull) SetTotalPrivateRepos(value *int32)() { + m.total_private_repos = value +} +// SetTwitterUsername sets the twitter_username property value. The twitter_username property +func (m *OrganizationFull) SetTwitterUsername(value *string)() { + m.twitter_username = value +} +// SetTwoFactorRequirementEnabled sets the two_factor_requirement_enabled property value. The two_factor_requirement_enabled property +func (m *OrganizationFull) SetTwoFactorRequirementEnabled(value *bool)() { + m.two_factor_requirement_enabled = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *OrganizationFull) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *OrganizationFull) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *OrganizationFull) SetUrl(value *string)() { + m.url = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *OrganizationFull) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type OrganizationFullable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurityEnabledForNewRepositories()(*bool) + GetArchivedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetAvatarUrl()(*string) + GetBillingEmail()(*string) + GetBlog()(*string) + GetCollaborators()(*int32) + GetCompany()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultRepositoryPermission()(*string) + GetDependabotAlertsEnabledForNewRepositories()(*bool) + GetDependabotSecurityUpdatesEnabledForNewRepositories()(*bool) + GetDependencyGraphEnabledForNewRepositories()(*bool) + GetDescription()(*string) + GetDiskUsage()(*int32) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowers()(*int32) + GetFollowing()(*int32) + GetHasOrganizationProjects()(*bool) + GetHasRepositoryProjects()(*bool) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssuesUrl()(*string) + GetIsVerified()(*bool) + GetLocation()(*string) + GetLogin()(*string) + GetMembersAllowedRepositoryCreationType()(*string) + GetMembersCanCreateInternalRepositories()(*bool) + GetMembersCanCreatePages()(*bool) + GetMembersCanCreatePrivatePages()(*bool) + GetMembersCanCreatePrivateRepositories()(*bool) + GetMembersCanCreatePublicPages()(*bool) + GetMembersCanCreatePublicRepositories()(*bool) + GetMembersCanCreateRepositories()(*bool) + GetMembersCanForkPrivateRepositories()(*bool) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOwnedPrivateRepos()(*int32) + GetPlan()(OrganizationFull_planable) + GetPrivateGists()(*int32) + GetPublicGists()(*int32) + GetPublicMembersUrl()(*string) + GetPublicRepos()(*int32) + GetReposUrl()(*string) + GetSecretScanningEnabledForNewRepositories()(*bool) + GetSecretScanningPushProtectionCustomLink()(*string) + GetSecretScanningPushProtectionCustomLinkEnabled()(*bool) + GetSecretScanningPushProtectionEnabledForNewRepositories()(*bool) + GetTotalPrivateRepos()(*int32) + GetTwitterUsername()(*string) + GetTwoFactorRequirementEnabled()(*bool) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetWebCommitSignoffRequired()(*bool) + SetAdvancedSecurityEnabledForNewRepositories(value *bool)() + SetArchivedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetAvatarUrl(value *string)() + SetBillingEmail(value *string)() + SetBlog(value *string)() + SetCollaborators(value *int32)() + SetCompany(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultRepositoryPermission(value *string)() + SetDependabotAlertsEnabledForNewRepositories(value *bool)() + SetDependabotSecurityUpdatesEnabledForNewRepositories(value *bool)() + SetDependencyGraphEnabledForNewRepositories(value *bool)() + SetDescription(value *string)() + SetDiskUsage(value *int32)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowers(value *int32)() + SetFollowing(value *int32)() + SetHasOrganizationProjects(value *bool)() + SetHasRepositoryProjects(value *bool)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssuesUrl(value *string)() + SetIsVerified(value *bool)() + SetLocation(value *string)() + SetLogin(value *string)() + SetMembersAllowedRepositoryCreationType(value *string)() + SetMembersCanCreateInternalRepositories(value *bool)() + SetMembersCanCreatePages(value *bool)() + SetMembersCanCreatePrivatePages(value *bool)() + SetMembersCanCreatePrivateRepositories(value *bool)() + SetMembersCanCreatePublicPages(value *bool)() + SetMembersCanCreatePublicRepositories(value *bool)() + SetMembersCanCreateRepositories(value *bool)() + SetMembersCanForkPrivateRepositories(value *bool)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOwnedPrivateRepos(value *int32)() + SetPlan(value OrganizationFull_planable)() + SetPrivateGists(value *int32)() + SetPublicGists(value *int32)() + SetPublicMembersUrl(value *string)() + SetPublicRepos(value *int32)() + SetReposUrl(value *string)() + SetSecretScanningEnabledForNewRepositories(value *bool)() + SetSecretScanningPushProtectionCustomLink(value *string)() + SetSecretScanningPushProtectionCustomLinkEnabled(value *bool)() + SetSecretScanningPushProtectionEnabledForNewRepositories(value *bool)() + SetTotalPrivateRepos(value *int32)() + SetTwitterUsername(value *string)() + SetTwoFactorRequirementEnabled(value *bool)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/pkg/github/models/organization_full_escaped_plan.go b/pkg/github/models/organization_full_escaped_plan.go new file mode 100644 index 00000000..9c81e2a1 --- /dev/null +++ b/pkg/github/models/organization_full_escaped_plan.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationFull_plan 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 filled_seats property + filled_seats *int32 + // The name property + name *string + // The private_repos property + private_repos *int32 + // The seats property + seats *int32 + // The space property + space *int32 +} +// NewOrganizationFull_plan instantiates a new OrganizationFull_plan and sets the default values. +func NewOrganizationFull_plan()(*OrganizationFull_plan) { + m := &OrganizationFull_plan{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationFull_planFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationFull_planFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationFull_plan(), 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 *OrganizationFull_plan) 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 *OrganizationFull_plan) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["filled_seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFilledSeats(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["private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateRepos(val) + } + return nil + } + res["seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSeats(val) + } + return nil + } + res["space"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSpace(val) + } + return nil + } + return res +} +// GetFilledSeats gets the filled_seats property value. The filled_seats property +// returns a *int32 when successful +func (m *OrganizationFull_plan) GetFilledSeats()(*int32) { + return m.filled_seats +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *OrganizationFull_plan) GetName()(*string) { + return m.name +} +// GetPrivateRepos gets the private_repos property value. The private_repos property +// returns a *int32 when successful +func (m *OrganizationFull_plan) GetPrivateRepos()(*int32) { + return m.private_repos +} +// GetSeats gets the seats property value. The seats property +// returns a *int32 when successful +func (m *OrganizationFull_plan) GetSeats()(*int32) { + return m.seats +} +// GetSpace gets the space property value. The space property +// returns a *int32 when successful +func (m *OrganizationFull_plan) GetSpace()(*int32) { + return m.space +} +// Serialize serializes information the current object +func (m *OrganizationFull_plan) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("filled_seats", m.GetFilledSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_repos", m.GetPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("seats", m.GetSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("space", m.GetSpace()) + 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 *OrganizationFull_plan) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFilledSeats sets the filled_seats property value. The filled_seats property +func (m *OrganizationFull_plan) SetFilledSeats(value *int32)() { + m.filled_seats = value +} +// SetName sets the name property value. The name property +func (m *OrganizationFull_plan) SetName(value *string)() { + m.name = value +} +// SetPrivateRepos sets the private_repos property value. The private_repos property +func (m *OrganizationFull_plan) SetPrivateRepos(value *int32)() { + m.private_repos = value +} +// SetSeats sets the seats property value. The seats property +func (m *OrganizationFull_plan) SetSeats(value *int32)() { + m.seats = value +} +// SetSpace sets the space property value. The space property +func (m *OrganizationFull_plan) SetSpace(value *int32)() { + m.space = value +} +type OrganizationFull_planable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFilledSeats()(*int32) + GetName()(*string) + GetPrivateRepos()(*int32) + GetSeats()(*int32) + GetSpace()(*int32) + SetFilledSeats(value *int32)() + SetName(value *string)() + SetPrivateRepos(value *int32)() + SetSeats(value *int32)() + SetSpace(value *int32)() +} diff --git a/pkg/github/models/organization_programmatic_access_grant.go b/pkg/github/models/organization_programmatic_access_grant.go new file mode 100644 index 00000000..a2da9c61 --- /dev/null +++ b/pkg/github/models/organization_programmatic_access_grant.go @@ -0,0 +1,314 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationProgrammaticAccessGrant minimal representation of an organization programmatic access grant for enumerations +type OrganizationProgrammaticAccessGrant struct { + // Date and time when the fine-grained personal access token was approved to access the organization. + access_granted_at *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Unique identifier of the fine-grained personal access token. The `pat_id` used to get details about an approved fine-grained personal access token. + id *int32 + // A GitHub user. + owner SimpleUserable + // Permissions requested, categorized by type of permission. + permissions OrganizationProgrammaticAccessGrant_permissionsable + // URL to the list of repositories the fine-grained personal access token can access. Only follow when `repository_selection` is `subset`. + repositories_url *string + // Type of repository selection requested. + repository_selection *OrganizationProgrammaticAccessGrant_repository_selection + // Whether the associated fine-grained personal access token has expired. + token_expired *bool + // Date and time when the associated fine-grained personal access token expires. + token_expires_at *string + // Date and time when the associated fine-grained personal access token was last used for authentication. + token_last_used_at *string +} +// NewOrganizationProgrammaticAccessGrant instantiates a new OrganizationProgrammaticAccessGrant and sets the default values. +func NewOrganizationProgrammaticAccessGrant()(*OrganizationProgrammaticAccessGrant) { + m := &OrganizationProgrammaticAccessGrant{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrantFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrantFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrant(), nil +} +// GetAccessGrantedAt gets the access_granted_at property value. Date and time when the fine-grained personal access token was approved to access the organization. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrant) GetAccessGrantedAt()(*string) { + return m.access_granted_at +} +// 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 *OrganizationProgrammaticAccessGrant) 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 *OrganizationProgrammaticAccessGrant) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["access_granted_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAccessGrantedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrant_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(OrganizationProgrammaticAccessGrant_permissionsable)) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationProgrammaticAccessGrant_repository_selection) + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val.(*OrganizationProgrammaticAccessGrant_repository_selection)) + } + return nil + } + res["token_expired"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenExpired(val) + } + return nil + } + res["token_expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenExpiresAt(val) + } + return nil + } + res["token_last_used_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenLastUsedAt(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the fine-grained personal access token. The `pat_id` used to get details about an approved fine-grained personal access token. +// returns a *int32 when successful +func (m *OrganizationProgrammaticAccessGrant) GetId()(*int32) { + return m.id +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *OrganizationProgrammaticAccessGrant) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. Permissions requested, categorized by type of permission. +// returns a OrganizationProgrammaticAccessGrant_permissionsable when successful +func (m *OrganizationProgrammaticAccessGrant) GetPermissions()(OrganizationProgrammaticAccessGrant_permissionsable) { + return m.permissions +} +// GetRepositoriesUrl gets the repositories_url property value. URL to the list of repositories the fine-grained personal access token can access. Only follow when `repository_selection` is `subset`. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrant) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetRepositorySelection gets the repository_selection property value. Type of repository selection requested. +// returns a *OrganizationProgrammaticAccessGrant_repository_selection when successful +func (m *OrganizationProgrammaticAccessGrant) GetRepositorySelection()(*OrganizationProgrammaticAccessGrant_repository_selection) { + return m.repository_selection +} +// GetTokenExpired gets the token_expired property value. Whether the associated fine-grained personal access token has expired. +// returns a *bool when successful +func (m *OrganizationProgrammaticAccessGrant) GetTokenExpired()(*bool) { + return m.token_expired +} +// GetTokenExpiresAt gets the token_expires_at property value. Date and time when the associated fine-grained personal access token expires. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrant) GetTokenExpiresAt()(*string) { + return m.token_expires_at +} +// GetTokenLastUsedAt gets the token_last_used_at property value. Date and time when the associated fine-grained personal access token was last used for authentication. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrant) GetTokenLastUsedAt()(*string) { + return m.token_last_used_at +} +// Serialize serializes information the current object +func (m *OrganizationProgrammaticAccessGrant) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("access_granted_at", m.GetAccessGrantedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + if m.GetRepositorySelection() != nil { + cast := (*m.GetRepositorySelection()).String() + err := writer.WriteStringValue("repository_selection", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("token_expired", m.GetTokenExpired()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token_expires_at", m.GetTokenExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token_last_used_at", m.GetTokenLastUsedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccessGrantedAt sets the access_granted_at property value. Date and time when the fine-grained personal access token was approved to access the organization. +func (m *OrganizationProgrammaticAccessGrant) SetAccessGrantedAt(value *string)() { + m.access_granted_at = 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 *OrganizationProgrammaticAccessGrant) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. Unique identifier of the fine-grained personal access token. The `pat_id` used to get details about an approved fine-grained personal access token. +func (m *OrganizationProgrammaticAccessGrant) SetId(value *int32)() { + m.id = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *OrganizationProgrammaticAccessGrant) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. Permissions requested, categorized by type of permission. +func (m *OrganizationProgrammaticAccessGrant) SetPermissions(value OrganizationProgrammaticAccessGrant_permissionsable)() { + m.permissions = value +} +// SetRepositoriesUrl sets the repositories_url property value. URL to the list of repositories the fine-grained personal access token can access. Only follow when `repository_selection` is `subset`. +func (m *OrganizationProgrammaticAccessGrant) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetRepositorySelection sets the repository_selection property value. Type of repository selection requested. +func (m *OrganizationProgrammaticAccessGrant) SetRepositorySelection(value *OrganizationProgrammaticAccessGrant_repository_selection)() { + m.repository_selection = value +} +// SetTokenExpired sets the token_expired property value. Whether the associated fine-grained personal access token has expired. +func (m *OrganizationProgrammaticAccessGrant) SetTokenExpired(value *bool)() { + m.token_expired = value +} +// SetTokenExpiresAt sets the token_expires_at property value. Date and time when the associated fine-grained personal access token expires. +func (m *OrganizationProgrammaticAccessGrant) SetTokenExpiresAt(value *string)() { + m.token_expires_at = value +} +// SetTokenLastUsedAt sets the token_last_used_at property value. Date and time when the associated fine-grained personal access token was last used for authentication. +func (m *OrganizationProgrammaticAccessGrant) SetTokenLastUsedAt(value *string)() { + m.token_last_used_at = value +} +type OrganizationProgrammaticAccessGrantable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccessGrantedAt()(*string) + GetId()(*int32) + GetOwner()(SimpleUserable) + GetPermissions()(OrganizationProgrammaticAccessGrant_permissionsable) + GetRepositoriesUrl()(*string) + GetRepositorySelection()(*OrganizationProgrammaticAccessGrant_repository_selection) + GetTokenExpired()(*bool) + GetTokenExpiresAt()(*string) + GetTokenLastUsedAt()(*string) + SetAccessGrantedAt(value *string)() + SetId(value *int32)() + SetOwner(value SimpleUserable)() + SetPermissions(value OrganizationProgrammaticAccessGrant_permissionsable)() + SetRepositoriesUrl(value *string)() + SetRepositorySelection(value *OrganizationProgrammaticAccessGrant_repository_selection)() + SetTokenExpired(value *bool)() + SetTokenExpiresAt(value *string)() + SetTokenLastUsedAt(value *string)() +} diff --git a/pkg/github/models/organization_programmatic_access_grant_escaped_permissions.go b/pkg/github/models/organization_programmatic_access_grant_escaped_permissions.go new file mode 100644 index 00000000..14b93bf8 --- /dev/null +++ b/pkg/github/models/organization_programmatic_access_grant_escaped_permissions.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationProgrammaticAccessGrant_permissions permissions requested, categorized by type of permission. +type OrganizationProgrammaticAccessGrant_permissions 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 organization property + organization OrganizationProgrammaticAccessGrant_permissions_organizationable + // The other property + other OrganizationProgrammaticAccessGrant_permissions_otherable + // The repository property + repository OrganizationProgrammaticAccessGrant_permissions_repositoryable +} +// NewOrganizationProgrammaticAccessGrant_permissions instantiates a new OrganizationProgrammaticAccessGrant_permissions and sets the default values. +func NewOrganizationProgrammaticAccessGrant_permissions()(*OrganizationProgrammaticAccessGrant_permissions) { + m := &OrganizationProgrammaticAccessGrant_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrant_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrant_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrant_permissions(), 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 *OrganizationProgrammaticAccessGrant_permissions) 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 *OrganizationProgrammaticAccessGrant_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrant_permissions_organizationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(OrganizationProgrammaticAccessGrant_permissions_organizationable)) + } + return nil + } + res["other"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrant_permissions_otherFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOther(val.(OrganizationProgrammaticAccessGrant_permissions_otherable)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrant_permissions_repositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(OrganizationProgrammaticAccessGrant_permissions_repositoryable)) + } + return nil + } + return res +} +// GetOrganization gets the organization property value. The organization property +// returns a OrganizationProgrammaticAccessGrant_permissions_organizationable when successful +func (m *OrganizationProgrammaticAccessGrant_permissions) GetOrganization()(OrganizationProgrammaticAccessGrant_permissions_organizationable) { + return m.organization +} +// GetOther gets the other property value. The other property +// returns a OrganizationProgrammaticAccessGrant_permissions_otherable when successful +func (m *OrganizationProgrammaticAccessGrant_permissions) GetOther()(OrganizationProgrammaticAccessGrant_permissions_otherable) { + return m.other +} +// GetRepository gets the repository property value. The repository property +// returns a OrganizationProgrammaticAccessGrant_permissions_repositoryable when successful +func (m *OrganizationProgrammaticAccessGrant_permissions) GetRepository()(OrganizationProgrammaticAccessGrant_permissions_repositoryable) { + return m.repository +} +// Serialize serializes information the current object +func (m *OrganizationProgrammaticAccessGrant_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("other", m.GetOther()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + 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 *OrganizationProgrammaticAccessGrant_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetOrganization sets the organization property value. The organization property +func (m *OrganizationProgrammaticAccessGrant_permissions) SetOrganization(value OrganizationProgrammaticAccessGrant_permissions_organizationable)() { + m.organization = value +} +// SetOther sets the other property value. The other property +func (m *OrganizationProgrammaticAccessGrant_permissions) SetOther(value OrganizationProgrammaticAccessGrant_permissions_otherable)() { + m.other = value +} +// SetRepository sets the repository property value. The repository property +func (m *OrganizationProgrammaticAccessGrant_permissions) SetRepository(value OrganizationProgrammaticAccessGrant_permissions_repositoryable)() { + m.repository = value +} +type OrganizationProgrammaticAccessGrant_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOrganization()(OrganizationProgrammaticAccessGrant_permissions_organizationable) + GetOther()(OrganizationProgrammaticAccessGrant_permissions_otherable) + GetRepository()(OrganizationProgrammaticAccessGrant_permissions_repositoryable) + SetOrganization(value OrganizationProgrammaticAccessGrant_permissions_organizationable)() + SetOther(value OrganizationProgrammaticAccessGrant_permissions_otherable)() + SetRepository(value OrganizationProgrammaticAccessGrant_permissions_repositoryable)() +} diff --git a/pkg/github/models/organization_programmatic_access_grant_escaped_permissions_escaped_organization.go b/pkg/github/models/organization_programmatic_access_grant_escaped_permissions_escaped_organization.go new file mode 100644 index 00000000..10594a36 --- /dev/null +++ b/pkg/github/models/organization_programmatic_access_grant_escaped_permissions_escaped_organization.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationProgrammaticAccessGrant_permissions_organization struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewOrganizationProgrammaticAccessGrant_permissions_organization instantiates a new OrganizationProgrammaticAccessGrant_permissions_organization and sets the default values. +func NewOrganizationProgrammaticAccessGrant_permissions_organization()(*OrganizationProgrammaticAccessGrant_permissions_organization) { + m := &OrganizationProgrammaticAccessGrant_permissions_organization{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrant_permissions_organizationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrant_permissions_organizationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrant_permissions_organization(), 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 *OrganizationProgrammaticAccessGrant_permissions_organization) 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 *OrganizationProgrammaticAccessGrant_permissions_organization) 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 *OrganizationProgrammaticAccessGrant_permissions_organization) 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 *OrganizationProgrammaticAccessGrant_permissions_organization) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type OrganizationProgrammaticAccessGrant_permissions_organizationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/organization_programmatic_access_grant_escaped_permissions_escaped_other.go b/pkg/github/models/organization_programmatic_access_grant_escaped_permissions_escaped_other.go new file mode 100644 index 00000000..1fad3c88 --- /dev/null +++ b/pkg/github/models/organization_programmatic_access_grant_escaped_permissions_escaped_other.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationProgrammaticAccessGrant_permissions_other struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewOrganizationProgrammaticAccessGrant_permissions_other instantiates a new OrganizationProgrammaticAccessGrant_permissions_other and sets the default values. +func NewOrganizationProgrammaticAccessGrant_permissions_other()(*OrganizationProgrammaticAccessGrant_permissions_other) { + m := &OrganizationProgrammaticAccessGrant_permissions_other{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrant_permissions_otherFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrant_permissions_otherFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrant_permissions_other(), 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 *OrganizationProgrammaticAccessGrant_permissions_other) 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 *OrganizationProgrammaticAccessGrant_permissions_other) 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 *OrganizationProgrammaticAccessGrant_permissions_other) 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 *OrganizationProgrammaticAccessGrant_permissions_other) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type OrganizationProgrammaticAccessGrant_permissions_otherable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/organization_programmatic_access_grant_escaped_permissions_escaped_repository.go b/pkg/github/models/organization_programmatic_access_grant_escaped_permissions_escaped_repository.go new file mode 100644 index 00000000..51546749 --- /dev/null +++ b/pkg/github/models/organization_programmatic_access_grant_escaped_permissions_escaped_repository.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationProgrammaticAccessGrant_permissions_repository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewOrganizationProgrammaticAccessGrant_permissions_repository instantiates a new OrganizationProgrammaticAccessGrant_permissions_repository and sets the default values. +func NewOrganizationProgrammaticAccessGrant_permissions_repository()(*OrganizationProgrammaticAccessGrant_permissions_repository) { + m := &OrganizationProgrammaticAccessGrant_permissions_repository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrant_permissions_repositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrant_permissions_repositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrant_permissions_repository(), 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 *OrganizationProgrammaticAccessGrant_permissions_repository) 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 *OrganizationProgrammaticAccessGrant_permissions_repository) 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 *OrganizationProgrammaticAccessGrant_permissions_repository) 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 *OrganizationProgrammaticAccessGrant_permissions_repository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type OrganizationProgrammaticAccessGrant_permissions_repositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/organization_programmatic_access_grant_escaped_repository_escaped_selection.go b/pkg/github/models/organization_programmatic_access_grant_escaped_repository_escaped_selection.go new file mode 100644 index 00000000..512f52a7 --- /dev/null +++ b/pkg/github/models/organization_programmatic_access_grant_escaped_repository_escaped_selection.go @@ -0,0 +1,37 @@ +package models +// Type of repository selection requested. +type OrganizationProgrammaticAccessGrant_repository_selection int + +const ( + NONE_ORGANIZATIONPROGRAMMATICACCESSGRANT_REPOSITORY_SELECTION OrganizationProgrammaticAccessGrant_repository_selection = iota + ALL_ORGANIZATIONPROGRAMMATICACCESSGRANT_REPOSITORY_SELECTION + SUBSET_ORGANIZATIONPROGRAMMATICACCESSGRANT_REPOSITORY_SELECTION +) + +func (i OrganizationProgrammaticAccessGrant_repository_selection) String() string { + return []string{"none", "all", "subset"}[i] +} +func ParseOrganizationProgrammaticAccessGrant_repository_selection(v string) (any, error) { + result := NONE_ORGANIZATIONPROGRAMMATICACCESSGRANT_REPOSITORY_SELECTION + switch v { + case "none": + result = NONE_ORGANIZATIONPROGRAMMATICACCESSGRANT_REPOSITORY_SELECTION + case "all": + result = ALL_ORGANIZATIONPROGRAMMATICACCESSGRANT_REPOSITORY_SELECTION + case "subset": + result = SUBSET_ORGANIZATIONPROGRAMMATICACCESSGRANT_REPOSITORY_SELECTION + default: + return nil, nil + } + return &result, nil +} +func SerializeOrganizationProgrammaticAccessGrant_repository_selection(values []OrganizationProgrammaticAccessGrant_repository_selection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationProgrammaticAccessGrant_repository_selection) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/organization_programmatic_access_grant_request.go b/pkg/github/models/organization_programmatic_access_grant_request.go new file mode 100644 index 00000000..c3b0e288 --- /dev/null +++ b/pkg/github/models/organization_programmatic_access_grant_request.go @@ -0,0 +1,343 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationProgrammaticAccessGrantRequest minimal representation of an organization programmatic access grant request for enumerations +type OrganizationProgrammaticAccessGrantRequest struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Date and time when the request for access was created. + created_at *string + // Unique identifier of the request for access via fine-grained personal access token. The `pat_request_id` used to review PAT requests. + id *int32 + // A GitHub user. + owner SimpleUserable + // Permissions requested, categorized by type of permission. + permissions OrganizationProgrammaticAccessGrantRequest_permissionsable + // Reason for requesting access. + reason *string + // URL to the list of repositories requested to be accessed via fine-grained personal access token. Should only be followed when `repository_selection` is `subset`. + repositories_url *string + // Type of repository selection requested. + repository_selection *OrganizationProgrammaticAccessGrantRequest_repository_selection + // Whether the associated fine-grained personal access token has expired. + token_expired *bool + // Date and time when the associated fine-grained personal access token expires. + token_expires_at *string + // Date and time when the associated fine-grained personal access token was last used for authentication. + token_last_used_at *string +} +// NewOrganizationProgrammaticAccessGrantRequest instantiates a new OrganizationProgrammaticAccessGrantRequest and sets the default values. +func NewOrganizationProgrammaticAccessGrantRequest()(*OrganizationProgrammaticAccessGrantRequest) { + m := &OrganizationProgrammaticAccessGrantRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrantRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrantRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrantRequest(), 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 *OrganizationProgrammaticAccessGrantRequest) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. Date and time when the request for access was created. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetCreatedAt()(*string) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationProgrammaticAccessGrantRequest) 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.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrantRequest_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(OrganizationProgrammaticAccessGrantRequest_permissionsable)) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationProgrammaticAccessGrantRequest_repository_selection) + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val.(*OrganizationProgrammaticAccessGrantRequest_repository_selection)) + } + return nil + } + res["token_expired"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenExpired(val) + } + return nil + } + res["token_expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenExpiresAt(val) + } + return nil + } + res["token_last_used_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTokenLastUsedAt(val) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the request for access via fine-grained personal access token. The `pat_request_id` used to review PAT requests. +// returns a *int32 when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetId()(*int32) { + return m.id +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. Permissions requested, categorized by type of permission. +// returns a OrganizationProgrammaticAccessGrantRequest_permissionsable when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetPermissions()(OrganizationProgrammaticAccessGrantRequest_permissionsable) { + return m.permissions +} +// GetReason gets the reason property value. Reason for requesting access. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetReason()(*string) { + return m.reason +} +// GetRepositoriesUrl gets the repositories_url property value. URL to the list of repositories requested to be accessed via fine-grained personal access token. Should only be followed when `repository_selection` is `subset`. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetRepositorySelection gets the repository_selection property value. Type of repository selection requested. +// returns a *OrganizationProgrammaticAccessGrantRequest_repository_selection when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetRepositorySelection()(*OrganizationProgrammaticAccessGrantRequest_repository_selection) { + return m.repository_selection +} +// GetTokenExpired gets the token_expired property value. Whether the associated fine-grained personal access token has expired. +// returns a *bool when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetTokenExpired()(*bool) { + return m.token_expired +} +// GetTokenExpiresAt gets the token_expires_at property value. Date and time when the associated fine-grained personal access token expires. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetTokenExpiresAt()(*string) { + return m.token_expires_at +} +// GetTokenLastUsedAt gets the token_last_used_at property value. Date and time when the associated fine-grained personal access token was last used for authentication. +// returns a *string when successful +func (m *OrganizationProgrammaticAccessGrantRequest) GetTokenLastUsedAt()(*string) { + return m.token_last_used_at +} +// Serialize serializes information the current object +func (m *OrganizationProgrammaticAccessGrantRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + if m.GetRepositorySelection() != nil { + cast := (*m.GetRepositorySelection()).String() + err := writer.WriteStringValue("repository_selection", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("token_expired", m.GetTokenExpired()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token_expires_at", m.GetTokenExpiresAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("token_last_used_at", m.GetTokenLastUsedAt()) + 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 *OrganizationProgrammaticAccessGrantRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. Date and time when the request for access was created. +func (m *OrganizationProgrammaticAccessGrantRequest) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetId sets the id property value. Unique identifier of the request for access via fine-grained personal access token. The `pat_request_id` used to review PAT requests. +func (m *OrganizationProgrammaticAccessGrantRequest) SetId(value *int32)() { + m.id = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *OrganizationProgrammaticAccessGrantRequest) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. Permissions requested, categorized by type of permission. +func (m *OrganizationProgrammaticAccessGrantRequest) SetPermissions(value OrganizationProgrammaticAccessGrantRequest_permissionsable)() { + m.permissions = value +} +// SetReason sets the reason property value. Reason for requesting access. +func (m *OrganizationProgrammaticAccessGrantRequest) SetReason(value *string)() { + m.reason = value +} +// SetRepositoriesUrl sets the repositories_url property value. URL to the list of repositories requested to be accessed via fine-grained personal access token. Should only be followed when `repository_selection` is `subset`. +func (m *OrganizationProgrammaticAccessGrantRequest) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetRepositorySelection sets the repository_selection property value. Type of repository selection requested. +func (m *OrganizationProgrammaticAccessGrantRequest) SetRepositorySelection(value *OrganizationProgrammaticAccessGrantRequest_repository_selection)() { + m.repository_selection = value +} +// SetTokenExpired sets the token_expired property value. Whether the associated fine-grained personal access token has expired. +func (m *OrganizationProgrammaticAccessGrantRequest) SetTokenExpired(value *bool)() { + m.token_expired = value +} +// SetTokenExpiresAt sets the token_expires_at property value. Date and time when the associated fine-grained personal access token expires. +func (m *OrganizationProgrammaticAccessGrantRequest) SetTokenExpiresAt(value *string)() { + m.token_expires_at = value +} +// SetTokenLastUsedAt sets the token_last_used_at property value. Date and time when the associated fine-grained personal access token was last used for authentication. +func (m *OrganizationProgrammaticAccessGrantRequest) SetTokenLastUsedAt(value *string)() { + m.token_last_used_at = value +} +type OrganizationProgrammaticAccessGrantRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetId()(*int32) + GetOwner()(SimpleUserable) + GetPermissions()(OrganizationProgrammaticAccessGrantRequest_permissionsable) + GetReason()(*string) + GetRepositoriesUrl()(*string) + GetRepositorySelection()(*OrganizationProgrammaticAccessGrantRequest_repository_selection) + GetTokenExpired()(*bool) + GetTokenExpiresAt()(*string) + GetTokenLastUsedAt()(*string) + SetCreatedAt(value *string)() + SetId(value *int32)() + SetOwner(value SimpleUserable)() + SetPermissions(value OrganizationProgrammaticAccessGrantRequest_permissionsable)() + SetReason(value *string)() + SetRepositoriesUrl(value *string)() + SetRepositorySelection(value *OrganizationProgrammaticAccessGrantRequest_repository_selection)() + SetTokenExpired(value *bool)() + SetTokenExpiresAt(value *string)() + SetTokenLastUsedAt(value *string)() +} diff --git a/pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions.go b/pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions.go new file mode 100644 index 00000000..25ae983d --- /dev/null +++ b/pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationProgrammaticAccessGrantRequest_permissions permissions requested, categorized by type of permission. +type OrganizationProgrammaticAccessGrantRequest_permissions 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 organization property + organization OrganizationProgrammaticAccessGrantRequest_permissions_organizationable + // The other property + other OrganizationProgrammaticAccessGrantRequest_permissions_otherable + // The repository property + repository OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable +} +// NewOrganizationProgrammaticAccessGrantRequest_permissions instantiates a new OrganizationProgrammaticAccessGrantRequest_permissions and sets the default values. +func NewOrganizationProgrammaticAccessGrantRequest_permissions()(*OrganizationProgrammaticAccessGrantRequest_permissions) { + m := &OrganizationProgrammaticAccessGrantRequest_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrantRequest_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrantRequest_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrantRequest_permissions(), 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 *OrganizationProgrammaticAccessGrantRequest_permissions) 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 *OrganizationProgrammaticAccessGrantRequest_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrantRequest_permissions_organizationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(OrganizationProgrammaticAccessGrantRequest_permissions_organizationable)) + } + return nil + } + res["other"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrantRequest_permissions_otherFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOther(val.(OrganizationProgrammaticAccessGrantRequest_permissions_otherable)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateOrganizationProgrammaticAccessGrantRequest_permissions_repositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable)) + } + return nil + } + return res +} +// GetOrganization gets the organization property value. The organization property +// returns a OrganizationProgrammaticAccessGrantRequest_permissions_organizationable when successful +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) GetOrganization()(OrganizationProgrammaticAccessGrantRequest_permissions_organizationable) { + return m.organization +} +// GetOther gets the other property value. The other property +// returns a OrganizationProgrammaticAccessGrantRequest_permissions_otherable when successful +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) GetOther()(OrganizationProgrammaticAccessGrantRequest_permissions_otherable) { + return m.other +} +// GetRepository gets the repository property value. The repository property +// returns a OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable when successful +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) GetRepository()(OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable) { + return m.repository +} +// Serialize serializes information the current object +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("other", m.GetOther()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + 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 *OrganizationProgrammaticAccessGrantRequest_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetOrganization sets the organization property value. The organization property +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) SetOrganization(value OrganizationProgrammaticAccessGrantRequest_permissions_organizationable)() { + m.organization = value +} +// SetOther sets the other property value. The other property +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) SetOther(value OrganizationProgrammaticAccessGrantRequest_permissions_otherable)() { + m.other = value +} +// SetRepository sets the repository property value. The repository property +func (m *OrganizationProgrammaticAccessGrantRequest_permissions) SetRepository(value OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable)() { + m.repository = value +} +type OrganizationProgrammaticAccessGrantRequest_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOrganization()(OrganizationProgrammaticAccessGrantRequest_permissions_organizationable) + GetOther()(OrganizationProgrammaticAccessGrantRequest_permissions_otherable) + GetRepository()(OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable) + SetOrganization(value OrganizationProgrammaticAccessGrantRequest_permissions_organizationable)() + SetOther(value OrganizationProgrammaticAccessGrantRequest_permissions_otherable)() + SetRepository(value OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable)() +} diff --git a/pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions_escaped_organization.go b/pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions_escaped_organization.go new file mode 100644 index 00000000..7cfcc16f --- /dev/null +++ b/pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions_escaped_organization.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationProgrammaticAccessGrantRequest_permissions_organization struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewOrganizationProgrammaticAccessGrantRequest_permissions_organization instantiates a new OrganizationProgrammaticAccessGrantRequest_permissions_organization and sets the default values. +func NewOrganizationProgrammaticAccessGrantRequest_permissions_organization()(*OrganizationProgrammaticAccessGrantRequest_permissions_organization) { + m := &OrganizationProgrammaticAccessGrantRequest_permissions_organization{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrantRequest_permissions_organizationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrantRequest_permissions_organizationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrantRequest_permissions_organization(), 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 *OrganizationProgrammaticAccessGrantRequest_permissions_organization) 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 *OrganizationProgrammaticAccessGrantRequest_permissions_organization) 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 *OrganizationProgrammaticAccessGrantRequest_permissions_organization) 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 *OrganizationProgrammaticAccessGrantRequest_permissions_organization) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type OrganizationProgrammaticAccessGrantRequest_permissions_organizationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions_escaped_other.go b/pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions_escaped_other.go new file mode 100644 index 00000000..69c85d92 --- /dev/null +++ b/pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions_escaped_other.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationProgrammaticAccessGrantRequest_permissions_other struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewOrganizationProgrammaticAccessGrantRequest_permissions_other instantiates a new OrganizationProgrammaticAccessGrantRequest_permissions_other and sets the default values. +func NewOrganizationProgrammaticAccessGrantRequest_permissions_other()(*OrganizationProgrammaticAccessGrantRequest_permissions_other) { + m := &OrganizationProgrammaticAccessGrantRequest_permissions_other{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrantRequest_permissions_otherFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrantRequest_permissions_otherFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrantRequest_permissions_other(), 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 *OrganizationProgrammaticAccessGrantRequest_permissions_other) 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 *OrganizationProgrammaticAccessGrantRequest_permissions_other) 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 *OrganizationProgrammaticAccessGrantRequest_permissions_other) 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 *OrganizationProgrammaticAccessGrantRequest_permissions_other) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type OrganizationProgrammaticAccessGrantRequest_permissions_otherable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions_escaped_repository.go b/pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions_escaped_repository.go new file mode 100644 index 00000000..46d78df7 --- /dev/null +++ b/pkg/github/models/organization_programmatic_access_grant_request_escaped_permissions_escaped_repository.go @@ -0,0 +1,51 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationProgrammaticAccessGrantRequest_permissions_repository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewOrganizationProgrammaticAccessGrantRequest_permissions_repository instantiates a new OrganizationProgrammaticAccessGrantRequest_permissions_repository and sets the default values. +func NewOrganizationProgrammaticAccessGrantRequest_permissions_repository()(*OrganizationProgrammaticAccessGrantRequest_permissions_repository) { + m := &OrganizationProgrammaticAccessGrantRequest_permissions_repository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationProgrammaticAccessGrantRequest_permissions_repositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationProgrammaticAccessGrantRequest_permissions_repositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationProgrammaticAccessGrantRequest_permissions_repository(), 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 *OrganizationProgrammaticAccessGrantRequest_permissions_repository) 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 *OrganizationProgrammaticAccessGrantRequest_permissions_repository) 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 *OrganizationProgrammaticAccessGrantRequest_permissions_repository) 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 *OrganizationProgrammaticAccessGrantRequest_permissions_repository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type OrganizationProgrammaticAccessGrantRequest_permissions_repositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/organization_programmatic_access_grant_request_escaped_repository_escaped_selection.go b/pkg/github/models/organization_programmatic_access_grant_request_escaped_repository_escaped_selection.go new file mode 100644 index 00000000..84c27e70 --- /dev/null +++ b/pkg/github/models/organization_programmatic_access_grant_request_escaped_repository_escaped_selection.go @@ -0,0 +1,37 @@ +package models +// Type of repository selection requested. +type OrganizationProgrammaticAccessGrantRequest_repository_selection int + +const ( + NONE_ORGANIZATIONPROGRAMMATICACCESSGRANTREQUEST_REPOSITORY_SELECTION OrganizationProgrammaticAccessGrantRequest_repository_selection = iota + ALL_ORGANIZATIONPROGRAMMATICACCESSGRANTREQUEST_REPOSITORY_SELECTION + SUBSET_ORGANIZATIONPROGRAMMATICACCESSGRANTREQUEST_REPOSITORY_SELECTION +) + +func (i OrganizationProgrammaticAccessGrantRequest_repository_selection) String() string { + return []string{"none", "all", "subset"}[i] +} +func ParseOrganizationProgrammaticAccessGrantRequest_repository_selection(v string) (any, error) { + result := NONE_ORGANIZATIONPROGRAMMATICACCESSGRANTREQUEST_REPOSITORY_SELECTION + switch v { + case "none": + result = NONE_ORGANIZATIONPROGRAMMATICACCESSGRANTREQUEST_REPOSITORY_SELECTION + case "all": + result = ALL_ORGANIZATIONPROGRAMMATICACCESSGRANTREQUEST_REPOSITORY_SELECTION + case "subset": + result = SUBSET_ORGANIZATIONPROGRAMMATICACCESSGRANTREQUEST_REPOSITORY_SELECTION + default: + return nil, nil + } + return &result, nil +} +func SerializeOrganizationProgrammaticAccessGrantRequest_repository_selection(values []OrganizationProgrammaticAccessGrantRequest_repository_selection) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationProgrammaticAccessGrantRequest_repository_selection) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/organization_role.go b/pkg/github/models/organization_role.go new file mode 100644 index 00000000..db45a281 --- /dev/null +++ b/pkg/github/models/organization_role.go @@ -0,0 +1,262 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationRole organization roles +type OrganizationRole 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 date and time the role was created. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A short description about who this role is for or what permissions it grants. + description *string + // The unique identifier of the role. + id *int64 + // The name of the role. + name *string + // A GitHub user. + organization NullableSimpleUserable + // A list of permissions included in this role. + permissions []string + // The date and time the role was last updated. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewOrganizationRole instantiates a new OrganizationRole and sets the default values. +func NewOrganizationRole()(*OrganizationRole) { + m := &OrganizationRole{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationRoleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationRoleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationRole(), 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 *OrganizationRole) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The date and time the role was created. +// returns a *Time when successful +func (m *OrganizationRole) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. A short description about who this role is for or what permissions it grants. +// returns a *string when successful +func (m *OrganizationRole) 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 *OrganizationRole) 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["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(NullableSimpleUserable)) + } + return nil + } + res["permissions"] = 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.SetPermissions(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 + } + return res +} +// GetId gets the id property value. The unique identifier of the role. +// returns a *int64 when successful +func (m *OrganizationRole) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name of the role. +// returns a *string when successful +func (m *OrganizationRole) GetName()(*string) { + return m.name +} +// GetOrganization gets the organization property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *OrganizationRole) GetOrganization()(NullableSimpleUserable) { + return m.organization +} +// GetPermissions gets the permissions property value. A list of permissions included in this role. +// returns a []string when successful +func (m *OrganizationRole) GetPermissions()([]string) { + return m.permissions +} +// GetUpdatedAt gets the updated_at property value. The date and time the role was last updated. +// returns a *Time when successful +func (m *OrganizationRole) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *OrganizationRole) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + if m.GetPermissions() != nil { + err := writer.WriteCollectionOfStringValues("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *OrganizationRole) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The date and time the role was created. +func (m *OrganizationRole) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. A short description about who this role is for or what permissions it grants. +func (m *OrganizationRole) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The unique identifier of the role. +func (m *OrganizationRole) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name of the role. +func (m *OrganizationRole) SetName(value *string)() { + m.name = value +} +// SetOrganization sets the organization property value. A GitHub user. +func (m *OrganizationRole) SetOrganization(value NullableSimpleUserable)() { + m.organization = value +} +// SetPermissions sets the permissions property value. A list of permissions included in this role. +func (m *OrganizationRole) SetPermissions(value []string)() { + m.permissions = value +} +// SetUpdatedAt sets the updated_at property value. The date and time the role was last updated. +func (m *OrganizationRole) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type OrganizationRoleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetId()(*int64) + GetName()(*string) + GetOrganization()(NullableSimpleUserable) + GetPermissions()([]string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetId(value *int64)() + SetName(value *string)() + SetOrganization(value NullableSimpleUserable)() + SetPermissions(value []string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/organization_secret_scanning_alert.go b/pkg/github/models/organization_secret_scanning_alert.go new file mode 100644 index 00000000..33bdbb80 --- /dev/null +++ b/pkg/github/models/organization_secret_scanning_alert.go @@ -0,0 +1,576 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type OrganizationSecretScanningAlert struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The GitHub URL of the alert resource. + html_url *string + // The REST API URL of the code locations for this alert. + locations_url *string + // The security alert number. + number *int32 + // 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`. + push_protection_bypassed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + push_protection_bypassed_by NullableSimpleUserable + // A GitHub repository. + repository SimpleRepositoryable + // **Required when the `state` is `resolved`.** The reason for resolving the alert. + resolution *SecretScanningAlertResolution + // The comment that was optionally added when this alert was closed + resolution_comment *string + // The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + resolved_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + resolved_by NullableSimpleUserable + // The secret that was detected. + secret *string + // The type of secret that secret scanning detected. + secret_type *string + // User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." + secret_type_display_name *string + // Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. + state *SecretScanningAlertState + // The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The REST API URL of the alert resource. + url *string + // The token status as of the latest validity check. + validity *OrganizationSecretScanningAlert_validity +} +// NewOrganizationSecretScanningAlert instantiates a new OrganizationSecretScanningAlert and sets the default values. +func NewOrganizationSecretScanningAlert()(*OrganizationSecretScanningAlert) { + m := &OrganizationSecretScanningAlert{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationSecretScanningAlertFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationSecretScanningAlertFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationSecretScanningAlert(), 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 *OrganizationSecretScanningAlert) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *OrganizationSecretScanningAlert) 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 *OrganizationSecretScanningAlert) 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["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["locations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocationsUrl(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["push_protection_bypassed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPushProtectionBypassed(val) + } + return nil + } + res["push_protection_bypassed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushProtectionBypassedAt(val) + } + return nil + } + res["push_protection_bypassed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPushProtectionBypassedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(SimpleRepositoryable)) + } + return nil + } + res["resolution"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecretScanningAlertResolution) + if err != nil { + return err + } + if val != nil { + m.SetResolution(val.(*SecretScanningAlertResolution)) + } + return nil + } + res["resolution_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResolutionComment(val) + } + return nil + } + res["resolved_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetResolvedAt(val) + } + return nil + } + res["resolved_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetResolvedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["secret_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretType(val) + } + return nil + } + res["secret_type_display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretTypeDisplayName(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecretScanningAlertState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*SecretScanningAlertState)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["validity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseOrganizationSecretScanningAlert_validity) + if err != nil { + return err + } + if val != nil { + m.SetValidity(val.(*OrganizationSecretScanningAlert_validity)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The GitHub URL of the alert resource. +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLocationsUrl gets the locations_url property value. The REST API URL of the code locations for this alert. +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetLocationsUrl()(*string) { + return m.locations_url +} +// GetNumber gets the number property value. The security alert number. +// returns a *int32 when successful +func (m *OrganizationSecretScanningAlert) GetNumber()(*int32) { + return m.number +} +// GetPushProtectionBypassed gets the push_protection_bypassed property value. Whether push protection was bypassed for the detected secret. +// returns a *bool when successful +func (m *OrganizationSecretScanningAlert) GetPushProtectionBypassed()(*bool) { + return m.push_protection_bypassed +} +// GetPushProtectionBypassedAt gets the push_protection_bypassed_at property value. The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *OrganizationSecretScanningAlert) GetPushProtectionBypassedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.push_protection_bypassed_at +} +// GetPushProtectionBypassedBy gets the push_protection_bypassed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *OrganizationSecretScanningAlert) GetPushProtectionBypassedBy()(NullableSimpleUserable) { + return m.push_protection_bypassed_by +} +// GetRepository gets the repository property value. A GitHub repository. +// returns a SimpleRepositoryable when successful +func (m *OrganizationSecretScanningAlert) GetRepository()(SimpleRepositoryable) { + return m.repository +} +// 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 *OrganizationSecretScanningAlert) GetResolution()(*SecretScanningAlertResolution) { + return m.resolution +} +// GetResolutionComment gets the resolution_comment property value. The comment that was optionally added when this alert was closed +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetResolutionComment()(*string) { + return m.resolution_comment +} +// GetResolvedAt gets the resolved_at property value. The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *OrganizationSecretScanningAlert) GetResolvedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.resolved_at +} +// GetResolvedBy gets the resolved_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *OrganizationSecretScanningAlert) GetResolvedBy()(NullableSimpleUserable) { + return m.resolved_by +} +// GetSecret gets the secret property value. The secret that was detected. +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetSecret()(*string) { + return m.secret +} +// GetSecretType gets the secret_type property value. The type of secret that secret scanning detected. +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetSecretType()(*string) { + return m.secret_type +} +// GetSecretTypeDisplayName gets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetSecretTypeDisplayName()(*string) { + return m.secret_type_display_name +} +// GetState gets the state property value. Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. +// returns a *SecretScanningAlertState when successful +func (m *OrganizationSecretScanningAlert) GetState()(*SecretScanningAlertState) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *OrganizationSecretScanningAlert) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The REST API URL of the alert resource. +// returns a *string when successful +func (m *OrganizationSecretScanningAlert) GetUrl()(*string) { + return m.url +} +// GetValidity gets the validity property value. The token status as of the latest validity check. +// returns a *OrganizationSecretScanningAlert_validity when successful +func (m *OrganizationSecretScanningAlert) GetValidity()(*OrganizationSecretScanningAlert_validity) { + return m.validity +} +// Serialize serializes information the current object +func (m *OrganizationSecretScanningAlert) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("locations_url", m.GetLocationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push_protection_bypassed", m.GetPushProtectionBypassed()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("push_protection_bypassed_at", m.GetPushProtectionBypassedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("push_protection_bypassed_by", m.GetPushProtectionBypassedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + if m.GetResolution() != nil { + cast := (*m.GetResolution()).String() + err := writer.WriteStringValue("resolution", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resolution_comment", m.GetResolutionComment()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("resolved_at", m.GetResolvedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("resolved_by", m.GetResolvedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_type", m.GetSecretType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_type_display_name", m.GetSecretTypeDisplayName()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + if m.GetValidity() != nil { + cast := (*m.GetValidity()).String() + err := writer.WriteStringValue("validity", &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 *OrganizationSecretScanningAlert) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *OrganizationSecretScanningAlert) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The GitHub URL of the alert resource. +func (m *OrganizationSecretScanningAlert) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLocationsUrl sets the locations_url property value. The REST API URL of the code locations for this alert. +func (m *OrganizationSecretScanningAlert) SetLocationsUrl(value *string)() { + m.locations_url = value +} +// SetNumber sets the number property value. The security alert number. +func (m *OrganizationSecretScanningAlert) SetNumber(value *int32)() { + m.number = value +} +// SetPushProtectionBypassed sets the push_protection_bypassed property value. Whether push protection was bypassed for the detected secret. +func (m *OrganizationSecretScanningAlert) SetPushProtectionBypassed(value *bool)() { + m.push_protection_bypassed = value +} +// SetPushProtectionBypassedAt sets the push_protection_bypassed_at property value. The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *OrganizationSecretScanningAlert) SetPushProtectionBypassedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.push_protection_bypassed_at = value +} +// SetPushProtectionBypassedBy sets the push_protection_bypassed_by property value. A GitHub user. +func (m *OrganizationSecretScanningAlert) SetPushProtectionBypassedBy(value NullableSimpleUserable)() { + m.push_protection_bypassed_by = value +} +// SetRepository sets the repository property value. A GitHub repository. +func (m *OrganizationSecretScanningAlert) SetRepository(value SimpleRepositoryable)() { + m.repository = value +} +// SetResolution sets the resolution property value. **Required when the `state` is `resolved`.** The reason for resolving the alert. +func (m *OrganizationSecretScanningAlert) SetResolution(value *SecretScanningAlertResolution)() { + m.resolution = value +} +// SetResolutionComment sets the resolution_comment property value. The comment that was optionally added when this alert was closed +func (m *OrganizationSecretScanningAlert) SetResolutionComment(value *string)() { + m.resolution_comment = value +} +// SetResolvedAt sets the resolved_at property value. The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *OrganizationSecretScanningAlert) SetResolvedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.resolved_at = value +} +// SetResolvedBy sets the resolved_by property value. A GitHub user. +func (m *OrganizationSecretScanningAlert) SetResolvedBy(value NullableSimpleUserable)() { + m.resolved_by = value +} +// SetSecret sets the secret property value. The secret that was detected. +func (m *OrganizationSecretScanningAlert) SetSecret(value *string)() { + m.secret = value +} +// SetSecretType sets the secret_type property value. The type of secret that secret scanning detected. +func (m *OrganizationSecretScanningAlert) SetSecretType(value *string)() { + m.secret_type = value +} +// SetSecretTypeDisplayName sets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." +func (m *OrganizationSecretScanningAlert) SetSecretTypeDisplayName(value *string)() { + m.secret_type_display_name = value +} +// SetState sets the state property value. Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. +func (m *OrganizationSecretScanningAlert) SetState(value *SecretScanningAlertState)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *OrganizationSecretScanningAlert) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The REST API URL of the alert resource. +func (m *OrganizationSecretScanningAlert) SetUrl(value *string)() { + m.url = value +} +// SetValidity sets the validity property value. The token status as of the latest validity check. +func (m *OrganizationSecretScanningAlert) SetValidity(value *OrganizationSecretScanningAlert_validity)() { + m.validity = value +} +type OrganizationSecretScanningAlertable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetLocationsUrl()(*string) + GetNumber()(*int32) + GetPushProtectionBypassed()(*bool) + GetPushProtectionBypassedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPushProtectionBypassedBy()(NullableSimpleUserable) + GetRepository()(SimpleRepositoryable) + GetResolution()(*SecretScanningAlertResolution) + GetResolutionComment()(*string) + GetResolvedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetResolvedBy()(NullableSimpleUserable) + GetSecret()(*string) + GetSecretType()(*string) + GetSecretTypeDisplayName()(*string) + GetState()(*SecretScanningAlertState) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetValidity()(*OrganizationSecretScanningAlert_validity) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetLocationsUrl(value *string)() + SetNumber(value *int32)() + SetPushProtectionBypassed(value *bool)() + SetPushProtectionBypassedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPushProtectionBypassedBy(value NullableSimpleUserable)() + SetRepository(value SimpleRepositoryable)() + SetResolution(value *SecretScanningAlertResolution)() + SetResolutionComment(value *string)() + SetResolvedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetResolvedBy(value NullableSimpleUserable)() + SetSecret(value *string)() + SetSecretType(value *string)() + SetSecretTypeDisplayName(value *string)() + SetState(value *SecretScanningAlertState)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetValidity(value *OrganizationSecretScanningAlert_validity)() +} diff --git a/pkg/github/models/organization_secret_scanning_alert_escaped_validity.go b/pkg/github/models/organization_secret_scanning_alert_escaped_validity.go new file mode 100644 index 00000000..037132bc --- /dev/null +++ b/pkg/github/models/organization_secret_scanning_alert_escaped_validity.go @@ -0,0 +1,37 @@ +package models +// The token status as of the latest validity check. +type OrganizationSecretScanningAlert_validity int + +const ( + ACTIVE_ORGANIZATIONSECRETSCANNINGALERT_VALIDITY OrganizationSecretScanningAlert_validity = iota + INACTIVE_ORGANIZATIONSECRETSCANNINGALERT_VALIDITY + UNKNOWN_ORGANIZATIONSECRETSCANNINGALERT_VALIDITY +) + +func (i OrganizationSecretScanningAlert_validity) String() string { + return []string{"active", "inactive", "unknown"}[i] +} +func ParseOrganizationSecretScanningAlert_validity(v string) (any, error) { + result := ACTIVE_ORGANIZATIONSECRETSCANNINGALERT_VALIDITY + switch v { + case "active": + result = ACTIVE_ORGANIZATIONSECRETSCANNINGALERT_VALIDITY + case "inactive": + result = INACTIVE_ORGANIZATIONSECRETSCANNINGALERT_VALIDITY + case "unknown": + result = UNKNOWN_ORGANIZATIONSECRETSCANNINGALERT_VALIDITY + default: + return nil, nil + } + return &result, nil +} +func SerializeOrganizationSecretScanningAlert_validity(values []OrganizationSecretScanningAlert_validity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i OrganizationSecretScanningAlert_validity) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/organization_simple.go b/pkg/github/models/organization_simple.go new file mode 100644 index 00000000..e6568d26 --- /dev/null +++ b/pkg/github/models/organization_simple.go @@ -0,0 +1,400 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// OrganizationSimple a GitHub organization. +type OrganizationSimple 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 avatar_url property + avatar_url *string + // The description property + description *string + // The events_url property + events_url *string + // The hooks_url property + hooks_url *string + // The id property + id *int32 + // The issues_url property + issues_url *string + // The login property + login *string + // The members_url property + members_url *string + // The node_id property + node_id *string + // The public_members_url property + public_members_url *string + // The repos_url property + repos_url *string + // The url property + url *string +} +// NewOrganizationSimple instantiates a new OrganizationSimple and sets the default values. +func NewOrganizationSimple()(*OrganizationSimple) { + m := &OrganizationSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateOrganizationSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateOrganizationSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewOrganizationSimple(), 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 *OrganizationSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *OrganizationSimple) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *OrganizationSimple) GetDescription()(*string) { + return m.description +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *OrganizationSimple) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *OrganizationSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + 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["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["public_members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicMembersUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *OrganizationSimple) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *OrganizationSimple) GetId()(*int32) { + return m.id +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *OrganizationSimple) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *OrganizationSimple) GetLogin()(*string) { + return m.login +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *OrganizationSimple) GetMembersUrl()(*string) { + return m.members_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *OrganizationSimple) GetNodeId()(*string) { + return m.node_id +} +// GetPublicMembersUrl gets the public_members_url property value. The public_members_url property +// returns a *string when successful +func (m *OrganizationSimple) GetPublicMembersUrl()(*string) { + return m.public_members_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *OrganizationSimple) GetReposUrl()(*string) { + return m.repos_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *OrganizationSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *OrganizationSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_members_url", m.GetPublicMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *OrganizationSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *OrganizationSimple) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetDescription sets the description property value. The description property +func (m *OrganizationSimple) SetDescription(value *string)() { + m.description = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *OrganizationSimple) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *OrganizationSimple) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetId sets the id property value. The id property +func (m *OrganizationSimple) SetId(value *int32)() { + m.id = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *OrganizationSimple) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetLogin sets the login property value. The login property +func (m *OrganizationSimple) SetLogin(value *string)() { + m.login = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *OrganizationSimple) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *OrganizationSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetPublicMembersUrl sets the public_members_url property value. The public_members_url property +func (m *OrganizationSimple) SetPublicMembersUrl(value *string)() { + m.public_members_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *OrganizationSimple) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetUrl sets the url property value. The url property +func (m *OrganizationSimple) SetUrl(value *string)() { + m.url = value +} +type OrganizationSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetDescription()(*string) + GetEventsUrl()(*string) + GetHooksUrl()(*string) + GetId()(*int32) + GetIssuesUrl()(*string) + GetLogin()(*string) + GetMembersUrl()(*string) + GetNodeId()(*string) + GetPublicMembersUrl()(*string) + GetReposUrl()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetDescription(value *string)() + SetEventsUrl(value *string)() + SetHooksUrl(value *string)() + SetId(value *int32)() + SetIssuesUrl(value *string)() + SetLogin(value *string)() + SetMembersUrl(value *string)() + SetNodeId(value *string)() + SetPublicMembersUrl(value *string)() + SetReposUrl(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/package_escaped.go b/pkg/github/models/package_escaped.go new file mode 100644 index 00000000..d32fe6a3 --- /dev/null +++ b/pkg/github/models/package_escaped.go @@ -0,0 +1,374 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PackageEscaped a software package +type PackageEscaped 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 html_url property + html_url *string + // Unique identifier of the package. + id *int32 + // The name of the package. + name *string + // A GitHub user. + owner NullableSimpleUserable + // The package_type property + package_type *Package_package_type + // Minimal Repository + repository NullableMinimalRepositoryable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The number of versions of the package. + version_count *int32 + // The visibility property + visibility *Package_visibility +} +// NewPackageEscaped instantiates a new PackageEscaped and sets the default values. +func NewPackageEscaped()(*PackageEscaped) { + m := &PackageEscaped{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePackageEscapedFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePackageEscapedFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPackageEscaped(), 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 *PackageEscaped) 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 *PackageEscaped) 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 *PackageEscaped) 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["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableSimpleUserable)) + } + return nil + } + res["package_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePackage_package_type) + if err != nil { + return err + } + if val != nil { + m.SetPackageType(val.(*Package_package_type)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(NullableMinimalRepositoryable)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["version_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetVersionCount(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePackage_visibility) + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val.(*Package_visibility)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PackageEscaped) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the package. +// returns a *int32 when successful +func (m *PackageEscaped) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the package. +// returns a *string when successful +func (m *PackageEscaped) GetName()(*string) { + return m.name +} +// GetOwner gets the owner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PackageEscaped) GetOwner()(NullableSimpleUserable) { + return m.owner +} +// GetPackageType gets the package_type property value. The package_type property +// returns a *Package_package_type when successful +func (m *PackageEscaped) GetPackageType()(*Package_package_type) { + return m.package_type +} +// GetRepository gets the repository property value. Minimal Repository +// returns a NullableMinimalRepositoryable when successful +func (m *PackageEscaped) GetRepository()(NullableMinimalRepositoryable) { + return m.repository +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PackageEscaped) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PackageEscaped) GetUrl()(*string) { + return m.url +} +// GetVersionCount gets the version_count property value. The number of versions of the package. +// returns a *int32 when successful +func (m *PackageEscaped) GetVersionCount()(*int32) { + return m.version_count +} +// GetVisibility gets the visibility property value. The visibility property +// returns a *Package_visibility when successful +func (m *PackageEscaped) GetVisibility()(*Package_visibility) { + return m.visibility +} +// Serialize serializes information the current object +func (m *PackageEscaped) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + if m.GetPackageType() != nil { + cast := (*m.GetPackageType()).String() + err := writer.WriteStringValue("package_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("version_count", m.GetVersionCount()) + 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 *PackageEscaped) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PackageEscaped) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PackageEscaped) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the package. +func (m *PackageEscaped) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the package. +func (m *PackageEscaped) SetName(value *string)() { + m.name = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *PackageEscaped) SetOwner(value NullableSimpleUserable)() { + m.owner = value +} +// SetPackageType sets the package_type property value. The package_type property +func (m *PackageEscaped) SetPackageType(value *Package_package_type)() { + m.package_type = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *PackageEscaped) SetRepository(value NullableMinimalRepositoryable)() { + m.repository = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PackageEscaped) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PackageEscaped) SetUrl(value *string)() { + m.url = value +} +// SetVersionCount sets the version_count property value. The number of versions of the package. +func (m *PackageEscaped) SetVersionCount(value *int32)() { + m.version_count = value +} +// SetVisibility sets the visibility property value. The visibility property +func (m *PackageEscaped) SetVisibility(value *Package_visibility)() { + m.visibility = value +} +type PackageEscapedable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetOwner()(NullableSimpleUserable) + GetPackageType()(*Package_package_type) + GetRepository()(NullableMinimalRepositoryable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVersionCount()(*int32) + GetVisibility()(*Package_visibility) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetOwner(value NullableSimpleUserable)() + SetPackageType(value *Package_package_type)() + SetRepository(value NullableMinimalRepositoryable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVersionCount(value *int32)() + SetVisibility(value *Package_visibility)() +} diff --git a/pkg/github/models/package_escaped_package_escaped_type.go b/pkg/github/models/package_escaped_package_escaped_type.go new file mode 100644 index 00000000..ca262d91 --- /dev/null +++ b/pkg/github/models/package_escaped_package_escaped_type.go @@ -0,0 +1,45 @@ +package models +type Package_package_type int + +const ( + NPM_PACKAGE_PACKAGE_TYPE Package_package_type = iota + MAVEN_PACKAGE_PACKAGE_TYPE + RUBYGEMS_PACKAGE_PACKAGE_TYPE + DOCKER_PACKAGE_PACKAGE_TYPE + NUGET_PACKAGE_PACKAGE_TYPE + CONTAINER_PACKAGE_PACKAGE_TYPE +) + +func (i Package_package_type) String() string { + return []string{"npm", "maven", "rubygems", "docker", "nuget", "container"}[i] +} +func ParsePackage_package_type(v string) (any, error) { + result := NPM_PACKAGE_PACKAGE_TYPE + switch v { + case "npm": + result = NPM_PACKAGE_PACKAGE_TYPE + case "maven": + result = MAVEN_PACKAGE_PACKAGE_TYPE + case "rubygems": + result = RUBYGEMS_PACKAGE_PACKAGE_TYPE + case "docker": + result = DOCKER_PACKAGE_PACKAGE_TYPE + case "nuget": + result = NUGET_PACKAGE_PACKAGE_TYPE + case "container": + result = CONTAINER_PACKAGE_PACKAGE_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializePackage_package_type(values []Package_package_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Package_package_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/package_escaped_visibility.go b/pkg/github/models/package_escaped_visibility.go new file mode 100644 index 00000000..4bf6f51b --- /dev/null +++ b/pkg/github/models/package_escaped_visibility.go @@ -0,0 +1,33 @@ +package models +type Package_visibility int + +const ( + PRIVATE_PACKAGE_VISIBILITY Package_visibility = iota + PUBLIC_PACKAGE_VISIBILITY +) + +func (i Package_visibility) String() string { + return []string{"private", "public"}[i] +} +func ParsePackage_visibility(v string) (any, error) { + result := PRIVATE_PACKAGE_VISIBILITY + switch v { + case "private": + result = PRIVATE_PACKAGE_VISIBILITY + case "public": + result = PUBLIC_PACKAGE_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializePackage_visibility(values []Package_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Package_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/package_version.go b/pkg/github/models/package_version.go new file mode 100644 index 00000000..3373e88b --- /dev/null +++ b/pkg/github/models/package_version.go @@ -0,0 +1,372 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PackageVersion a version of a software package +type PackageVersion 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 deleted_at property + deleted_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + description *string + // The html_url property + html_url *string + // Unique identifier of the package version. + id *int32 + // The license property + license *string + // The metadata property + metadata PackageVersion_metadataable + // The name of the package version. + name *string + // The package_html_url property + package_html_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewPackageVersion instantiates a new PackageVersion and sets the default values. +func NewPackageVersion()(*PackageVersion) { + m := &PackageVersion{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePackageVersionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePackageVersionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPackageVersion(), 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 *PackageVersion) 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 *PackageVersion) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDeletedAt gets the deleted_at property value. The deleted_at property +// returns a *Time when successful +func (m *PackageVersion) GetDeletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.deleted_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *PackageVersion) 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 *PackageVersion) 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["deleted_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDeletedAt(val) + } + 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["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicense(val) + } + return nil + } + res["metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePackageVersion_metadataFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMetadata(val.(PackageVersion_metadataable)) + } + 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["package_html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPackageHtmlUrl(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PackageVersion) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the package version. +// returns a *int32 when successful +func (m *PackageVersion) GetId()(*int32) { + return m.id +} +// GetLicense gets the license property value. The license property +// returns a *string when successful +func (m *PackageVersion) GetLicense()(*string) { + return m.license +} +// GetMetadata gets the metadata property value. The metadata property +// returns a PackageVersion_metadataable when successful +func (m *PackageVersion) GetMetadata()(PackageVersion_metadataable) { + return m.metadata +} +// GetName gets the name property value. The name of the package version. +// returns a *string when successful +func (m *PackageVersion) GetName()(*string) { + return m.name +} +// GetPackageHtmlUrl gets the package_html_url property value. The package_html_url property +// returns a *string when successful +func (m *PackageVersion) GetPackageHtmlUrl()(*string) { + return m.package_html_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PackageVersion) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PackageVersion) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PackageVersion) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("deleted_at", m.GetDeletedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("metadata", m.GetMetadata()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("package_html_url", m.GetPackageHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PackageVersion) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PackageVersion) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDeletedAt sets the deleted_at property value. The deleted_at property +func (m *PackageVersion) SetDeletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.deleted_at = value +} +// SetDescription sets the description property value. The description property +func (m *PackageVersion) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PackageVersion) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the package version. +func (m *PackageVersion) SetId(value *int32)() { + m.id = value +} +// SetLicense sets the license property value. The license property +func (m *PackageVersion) SetLicense(value *string)() { + m.license = value +} +// SetMetadata sets the metadata property value. The metadata property +func (m *PackageVersion) SetMetadata(value PackageVersion_metadataable)() { + m.metadata = value +} +// SetName sets the name property value. The name of the package version. +func (m *PackageVersion) SetName(value *string)() { + m.name = value +} +// SetPackageHtmlUrl sets the package_html_url property value. The package_html_url property +func (m *PackageVersion) SetPackageHtmlUrl(value *string)() { + m.package_html_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PackageVersion) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PackageVersion) SetUrl(value *string)() { + m.url = value +} +type PackageVersionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDeletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLicense()(*string) + GetMetadata()(PackageVersion_metadataable) + GetName()(*string) + GetPackageHtmlUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDeletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLicense(value *string)() + SetMetadata(value PackageVersion_metadataable)() + SetName(value *string)() + SetPackageHtmlUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/package_version_escaped_metadata.go b/pkg/github/models/package_version_escaped_metadata.go new file mode 100644 index 00000000..fe42fb0c --- /dev/null +++ b/pkg/github/models/package_version_escaped_metadata.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PackageVersion_metadata 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 container property + container PackageVersion_metadata_containerable + // The docker property + docker PackageVersion_metadata_dockerable + // The package_type property + package_type *PackageVersion_metadata_package_type +} +// NewPackageVersion_metadata instantiates a new PackageVersion_metadata and sets the default values. +func NewPackageVersion_metadata()(*PackageVersion_metadata) { + m := &PackageVersion_metadata{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePackageVersion_metadataFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePackageVersion_metadataFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPackageVersion_metadata(), 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 *PackageVersion_metadata) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContainer gets the container property value. The container property +// returns a PackageVersion_metadata_containerable when successful +func (m *PackageVersion_metadata) GetContainer()(PackageVersion_metadata_containerable) { + return m.container +} +// GetDocker gets the docker property value. The docker property +// returns a PackageVersion_metadata_dockerable when successful +func (m *PackageVersion_metadata) GetDocker()(PackageVersion_metadata_dockerable) { + return m.docker +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PackageVersion_metadata) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["container"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePackageVersion_metadata_containerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetContainer(val.(PackageVersion_metadata_containerable)) + } + return nil + } + res["docker"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePackageVersion_metadata_dockerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDocker(val.(PackageVersion_metadata_dockerable)) + } + return nil + } + res["package_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePackageVersion_metadata_package_type) + if err != nil { + return err + } + if val != nil { + m.SetPackageType(val.(*PackageVersion_metadata_package_type)) + } + return nil + } + return res +} +// GetPackageType gets the package_type property value. The package_type property +// returns a *PackageVersion_metadata_package_type when successful +func (m *PackageVersion_metadata) GetPackageType()(*PackageVersion_metadata_package_type) { + return m.package_type +} +// Serialize serializes information the current object +func (m *PackageVersion_metadata) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("container", m.GetContainer()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("docker", m.GetDocker()) + if err != nil { + return err + } + } + if m.GetPackageType() != nil { + cast := (*m.GetPackageType()).String() + err := writer.WriteStringValue("package_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 *PackageVersion_metadata) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContainer sets the container property value. The container property +func (m *PackageVersion_metadata) SetContainer(value PackageVersion_metadata_containerable)() { + m.container = value +} +// SetDocker sets the docker property value. The docker property +func (m *PackageVersion_metadata) SetDocker(value PackageVersion_metadata_dockerable)() { + m.docker = value +} +// SetPackageType sets the package_type property value. The package_type property +func (m *PackageVersion_metadata) SetPackageType(value *PackageVersion_metadata_package_type)() { + m.package_type = value +} +type PackageVersion_metadataable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContainer()(PackageVersion_metadata_containerable) + GetDocker()(PackageVersion_metadata_dockerable) + GetPackageType()(*PackageVersion_metadata_package_type) + SetContainer(value PackageVersion_metadata_containerable)() + SetDocker(value PackageVersion_metadata_dockerable)() + SetPackageType(value *PackageVersion_metadata_package_type)() +} diff --git a/pkg/github/models/package_version_escaped_metadata_escaped_container.go b/pkg/github/models/package_version_escaped_metadata_escaped_container.go new file mode 100644 index 00000000..8271a071 --- /dev/null +++ b/pkg/github/models/package_version_escaped_metadata_escaped_container.go @@ -0,0 +1,86 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PackageVersion_metadata_container 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 tags property + tags []string +} +// NewPackageVersion_metadata_container instantiates a new PackageVersion_metadata_container and sets the default values. +func NewPackageVersion_metadata_container()(*PackageVersion_metadata_container) { + m := &PackageVersion_metadata_container{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePackageVersion_metadata_containerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePackageVersion_metadata_containerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPackageVersion_metadata_container(), 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 *PackageVersion_metadata_container) 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 *PackageVersion_metadata_container) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["tags"] = 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.SetTags(res) + } + return nil + } + return res +} +// GetTags gets the tags property value. The tags property +// returns a []string when successful +func (m *PackageVersion_metadata_container) GetTags()([]string) { + return m.tags +} +// Serialize serializes information the current object +func (m *PackageVersion_metadata_container) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTags() != nil { + err := writer.WriteCollectionOfStringValues("tags", m.GetTags()) + 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 *PackageVersion_metadata_container) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTags sets the tags property value. The tags property +func (m *PackageVersion_metadata_container) SetTags(value []string)() { + m.tags = value +} +type PackageVersion_metadata_containerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTags()([]string) + SetTags(value []string)() +} diff --git a/pkg/github/models/package_version_escaped_metadata_escaped_docker.go b/pkg/github/models/package_version_escaped_metadata_escaped_docker.go new file mode 100644 index 00000000..e380dcd5 --- /dev/null +++ b/pkg/github/models/package_version_escaped_metadata_escaped_docker.go @@ -0,0 +1,86 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PackageVersion_metadata_docker 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 tag property + tag []string +} +// NewPackageVersion_metadata_docker instantiates a new PackageVersion_metadata_docker and sets the default values. +func NewPackageVersion_metadata_docker()(*PackageVersion_metadata_docker) { + m := &PackageVersion_metadata_docker{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePackageVersion_metadata_dockerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePackageVersion_metadata_dockerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPackageVersion_metadata_docker(), 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 *PackageVersion_metadata_docker) 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 *PackageVersion_metadata_docker) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["tag"] = 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.SetTag(res) + } + return nil + } + return res +} +// GetTag gets the tag property value. The tag property +// returns a []string when successful +func (m *PackageVersion_metadata_docker) GetTag()([]string) { + return m.tag +} +// Serialize serializes information the current object +func (m *PackageVersion_metadata_docker) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTag() != nil { + err := writer.WriteCollectionOfStringValues("tag", m.GetTag()) + 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 *PackageVersion_metadata_docker) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTag sets the tag property value. The tag property +func (m *PackageVersion_metadata_docker) SetTag(value []string)() { + m.tag = value +} +type PackageVersion_metadata_dockerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTag()([]string) + SetTag(value []string)() +} diff --git a/pkg/github/models/package_version_escaped_metadata_escaped_package_escaped_type.go b/pkg/github/models/package_version_escaped_metadata_escaped_package_escaped_type.go new file mode 100644 index 00000000..e9567f86 --- /dev/null +++ b/pkg/github/models/package_version_escaped_metadata_escaped_package_escaped_type.go @@ -0,0 +1,45 @@ +package models +type PackageVersion_metadata_package_type int + +const ( + NPM_PACKAGEVERSION_METADATA_PACKAGE_TYPE PackageVersion_metadata_package_type = iota + MAVEN_PACKAGEVERSION_METADATA_PACKAGE_TYPE + RUBYGEMS_PACKAGEVERSION_METADATA_PACKAGE_TYPE + DOCKER_PACKAGEVERSION_METADATA_PACKAGE_TYPE + NUGET_PACKAGEVERSION_METADATA_PACKAGE_TYPE + CONTAINER_PACKAGEVERSION_METADATA_PACKAGE_TYPE +) + +func (i PackageVersion_metadata_package_type) String() string { + return []string{"npm", "maven", "rubygems", "docker", "nuget", "container"}[i] +} +func ParsePackageVersion_metadata_package_type(v string) (any, error) { + result := NPM_PACKAGEVERSION_METADATA_PACKAGE_TYPE + switch v { + case "npm": + result = NPM_PACKAGEVERSION_METADATA_PACKAGE_TYPE + case "maven": + result = MAVEN_PACKAGEVERSION_METADATA_PACKAGE_TYPE + case "rubygems": + result = RUBYGEMS_PACKAGEVERSION_METADATA_PACKAGE_TYPE + case "docker": + result = DOCKER_PACKAGEVERSION_METADATA_PACKAGE_TYPE + case "nuget": + result = NUGET_PACKAGEVERSION_METADATA_PACKAGE_TYPE + case "container": + result = CONTAINER_PACKAGEVERSION_METADATA_PACKAGE_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializePackageVersion_metadata_package_type(values []PackageVersion_metadata_package_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PackageVersion_metadata_package_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/page.go b/pkg/github/models/page.go new file mode 100644 index 00000000..62c997ab --- /dev/null +++ b/pkg/github/models/page.go @@ -0,0 +1,404 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Page the configuration for GitHub Pages for a repository. +type Page 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 process in which the Page will be built. + build_type *Page_build_type + // The Pages site's custom domain + cname *string + // Whether the Page has a custom 404 page. + custom_404 *bool + // The web address the Page can be accessed from. + html_url *string + // The https_certificate property + https_certificate PagesHttpsCertificateable + // Whether https is enabled on the domain + https_enforced *bool + // The timestamp when a pending domain becomes unverified. + pending_domain_unverified_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The state if the domain is verified + protected_domain_state *Page_protected_domain_state + // Whether the GitHub Pages site is publicly visible. If set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site. + public *bool + // The source property + source PagesSourceHashable + // The status of the most recent build of the Page. + status *Page_status + // The API address for accessing this Page resource. + url *string +} +// NewPage instantiates a new Page and sets the default values. +func NewPage()(*Page) { + m := &Page{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPage(), 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 *Page) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBuildType gets the build_type property value. The process in which the Page will be built. +// returns a *Page_build_type when successful +func (m *Page) GetBuildType()(*Page_build_type) { + return m.build_type +} +// GetCname gets the cname property value. The Pages site's custom domain +// returns a *string when successful +func (m *Page) GetCname()(*string) { + return m.cname +} +// GetCustom404 gets the custom_404 property value. Whether the Page has a custom 404 page. +// returns a *bool when successful +func (m *Page) GetCustom404()(*bool) { + return m.custom_404 +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Page) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["build_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePage_build_type) + if err != nil { + return err + } + if val != nil { + m.SetBuildType(val.(*Page_build_type)) + } + return nil + } + res["cname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCname(val) + } + return nil + } + res["custom_404"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCustom404(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["https_certificate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePagesHttpsCertificateFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHttpsCertificate(val.(PagesHttpsCertificateable)) + } + return nil + } + res["https_enforced"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHttpsEnforced(val) + } + return nil + } + res["pending_domain_unverified_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPendingDomainUnverifiedAt(val) + } + return nil + } + res["protected_domain_state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePage_protected_domain_state) + if err != nil { + return err + } + if val != nil { + m.SetProtectedDomainState(val.(*Page_protected_domain_state)) + } + return nil + } + res["public"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPublic(val) + } + return nil + } + res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePagesSourceHashFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSource(val.(PagesSourceHashable)) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePage_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*Page_status)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The web address the Page can be accessed from. +// returns a *string when successful +func (m *Page) GetHtmlUrl()(*string) { + return m.html_url +} +// GetHttpsCertificate gets the https_certificate property value. The https_certificate property +// returns a PagesHttpsCertificateable when successful +func (m *Page) GetHttpsCertificate()(PagesHttpsCertificateable) { + return m.https_certificate +} +// GetHttpsEnforced gets the https_enforced property value. Whether https is enabled on the domain +// returns a *bool when successful +func (m *Page) GetHttpsEnforced()(*bool) { + return m.https_enforced +} +// GetPendingDomainUnverifiedAt gets the pending_domain_unverified_at property value. The timestamp when a pending domain becomes unverified. +// returns a *Time when successful +func (m *Page) GetPendingDomainUnverifiedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pending_domain_unverified_at +} +// GetProtectedDomainState gets the protected_domain_state property value. The state if the domain is verified +// returns a *Page_protected_domain_state when successful +func (m *Page) GetProtectedDomainState()(*Page_protected_domain_state) { + return m.protected_domain_state +} +// GetPublic gets the public property value. Whether the GitHub Pages site is publicly visible. If set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site. +// returns a *bool when successful +func (m *Page) GetPublic()(*bool) { + return m.public +} +// GetSource gets the source property value. The source property +// returns a PagesSourceHashable when successful +func (m *Page) GetSource()(PagesSourceHashable) { + return m.source +} +// GetStatus gets the status property value. The status of the most recent build of the Page. +// returns a *Page_status when successful +func (m *Page) GetStatus()(*Page_status) { + return m.status +} +// GetUrl gets the url property value. The API address for accessing this Page resource. +// returns a *string when successful +func (m *Page) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Page) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBuildType() != nil { + cast := (*m.GetBuildType()).String() + err := writer.WriteStringValue("build_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("cname", m.GetCname()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("custom_404", m.GetCustom404()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("https_certificate", m.GetHttpsCertificate()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("https_enforced", m.GetHttpsEnforced()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pending_domain_unverified_at", m.GetPendingDomainUnverifiedAt()) + if err != nil { + return err + } + } + if m.GetProtectedDomainState() != nil { + cast := (*m.GetProtectedDomainState()).String() + err := writer.WriteStringValue("protected_domain_state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("public", m.GetPublic()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("source", m.GetSource()) + 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.WriteStringValue("url", m.GetUrl()) + 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 *Page) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBuildType sets the build_type property value. The process in which the Page will be built. +func (m *Page) SetBuildType(value *Page_build_type)() { + m.build_type = value +} +// SetCname sets the cname property value. The Pages site's custom domain +func (m *Page) SetCname(value *string)() { + m.cname = value +} +// SetCustom404 sets the custom_404 property value. Whether the Page has a custom 404 page. +func (m *Page) SetCustom404(value *bool)() { + m.custom_404 = value +} +// SetHtmlUrl sets the html_url property value. The web address the Page can be accessed from. +func (m *Page) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetHttpsCertificate sets the https_certificate property value. The https_certificate property +func (m *Page) SetHttpsCertificate(value PagesHttpsCertificateable)() { + m.https_certificate = value +} +// SetHttpsEnforced sets the https_enforced property value. Whether https is enabled on the domain +func (m *Page) SetHttpsEnforced(value *bool)() { + m.https_enforced = value +} +// SetPendingDomainUnverifiedAt sets the pending_domain_unverified_at property value. The timestamp when a pending domain becomes unverified. +func (m *Page) SetPendingDomainUnverifiedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pending_domain_unverified_at = value +} +// SetProtectedDomainState sets the protected_domain_state property value. The state if the domain is verified +func (m *Page) SetProtectedDomainState(value *Page_protected_domain_state)() { + m.protected_domain_state = value +} +// SetPublic sets the public property value. Whether the GitHub Pages site is publicly visible. If set to `true`, the site is accessible to anyone on the internet. If set to `false`, the site will only be accessible to users who have at least `read` access to the repository that published the site. +func (m *Page) SetPublic(value *bool)() { + m.public = value +} +// SetSource sets the source property value. The source property +func (m *Page) SetSource(value PagesSourceHashable)() { + m.source = value +} +// SetStatus sets the status property value. The status of the most recent build of the Page. +func (m *Page) SetStatus(value *Page_status)() { + m.status = value +} +// SetUrl sets the url property value. The API address for accessing this Page resource. +func (m *Page) SetUrl(value *string)() { + m.url = value +} +type Pageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBuildType()(*Page_build_type) + GetCname()(*string) + GetCustom404()(*bool) + GetHtmlUrl()(*string) + GetHttpsCertificate()(PagesHttpsCertificateable) + GetHttpsEnforced()(*bool) + GetPendingDomainUnverifiedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetProtectedDomainState()(*Page_protected_domain_state) + GetPublic()(*bool) + GetSource()(PagesSourceHashable) + GetStatus()(*Page_status) + GetUrl()(*string) + SetBuildType(value *Page_build_type)() + SetCname(value *string)() + SetCustom404(value *bool)() + SetHtmlUrl(value *string)() + SetHttpsCertificate(value PagesHttpsCertificateable)() + SetHttpsEnforced(value *bool)() + SetPendingDomainUnverifiedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetProtectedDomainState(value *Page_protected_domain_state)() + SetPublic(value *bool)() + SetSource(value PagesSourceHashable)() + SetStatus(value *Page_status)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/page_build.go b/pkg/github/models/page_build.go new file mode 100644 index 00000000..d56a5967 --- /dev/null +++ b/pkg/github/models/page_build.go @@ -0,0 +1,285 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PageBuild page Build +type PageBuild 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 commit property + commit *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The duration property + duration *int32 + // The error property + error PageBuild_errorable + // A GitHub user. + pusher NullableSimpleUserable + // The status property + status *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewPageBuild instantiates a new PageBuild and sets the default values. +func NewPageBuild()(*PageBuild) { + m := &PageBuild{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePageBuildFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePageBuildFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPageBuild(), 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 *PageBuild) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommit gets the commit property value. The commit property +// returns a *string when successful +func (m *PageBuild) GetCommit()(*string) { + return m.commit +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PageBuild) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDuration gets the duration property value. The duration property +// returns a *int32 when successful +func (m *PageBuild) GetDuration()(*int32) { + return m.duration +} +// GetError gets the error property value. The error property +// returns a PageBuild_errorable when successful +func (m *PageBuild) GetError()(PageBuild_errorable) { + return m.error +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PageBuild) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommit(val) + } + return nil + } + 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["duration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDuration(val) + } + return nil + } + res["error"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePageBuild_errorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetError(val.(PageBuild_errorable)) + } + return nil + } + res["pusher"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPusher(val.(NullableSimpleUserable)) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetPusher gets the pusher property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PageBuild) GetPusher()(NullableSimpleUserable) { + return m.pusher +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *PageBuild) GetStatus()(*string) { + return m.status +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PageBuild) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PageBuild) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PageBuild) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("duration", m.GetDuration()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("error", m.GetError()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pusher", m.GetPusher()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PageBuild) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommit sets the commit property value. The commit property +func (m *PageBuild) SetCommit(value *string)() { + m.commit = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PageBuild) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDuration sets the duration property value. The duration property +func (m *PageBuild) SetDuration(value *int32)() { + m.duration = value +} +// SetError sets the error property value. The error property +func (m *PageBuild) SetError(value PageBuild_errorable)() { + m.error = value +} +// SetPusher sets the pusher property value. A GitHub user. +func (m *PageBuild) SetPusher(value NullableSimpleUserable)() { + m.pusher = value +} +// SetStatus sets the status property value. The status property +func (m *PageBuild) SetStatus(value *string)() { + m.status = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PageBuild) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PageBuild) SetUrl(value *string)() { + m.url = value +} +type PageBuildable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommit()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDuration()(*int32) + GetError()(PageBuild_errorable) + GetPusher()(NullableSimpleUserable) + GetStatus()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCommit(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDuration(value *int32)() + SetError(value PageBuild_errorable)() + SetPusher(value NullableSimpleUserable)() + SetStatus(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/page_build_escaped_error.go b/pkg/github/models/page_build_escaped_error.go new file mode 100644 index 00000000..243336d8 --- /dev/null +++ b/pkg/github/models/page_build_escaped_error.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PageBuild_error 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 message property + message *string +} +// NewPageBuild_error instantiates a new PageBuild_error and sets the default values. +func NewPageBuild_error()(*PageBuild_error) { + m := &PageBuild_error{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePageBuild_errorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePageBuild_errorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPageBuild_error(), 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 *PageBuild_error) 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 *PageBuild_error) 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 + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *PageBuild_error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *PageBuild_error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *PageBuild_error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The message property +func (m *PageBuild_error) SetMessage(value *string)() { + m.message = value +} +type PageBuild_errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + SetMessage(value *string)() +} diff --git a/pkg/github/models/page_build_status.go b/pkg/github/models/page_build_status.go new file mode 100644 index 00000000..103d32ab --- /dev/null +++ b/pkg/github/models/page_build_status.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PageBuildStatus page Build Status +type PageBuildStatus 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 status property + status *string + // The url property + url *string +} +// NewPageBuildStatus instantiates a new PageBuildStatus and sets the default values. +func NewPageBuildStatus()(*PageBuildStatus) { + m := &PageBuildStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePageBuildStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePageBuildStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPageBuildStatus(), 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 *PageBuildStatus) 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 *PageBuildStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *PageBuildStatus) GetStatus()(*string) { + return m.status +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PageBuildStatus) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PageBuildStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PageBuildStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The status property +func (m *PageBuildStatus) SetStatus(value *string)() { + m.status = value +} +// SetUrl sets the url property value. The url property +func (m *PageBuildStatus) SetUrl(value *string)() { + m.url = value +} +type PageBuildStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + GetUrl()(*string) + SetStatus(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/page_deployment.go b/pkg/github/models/page_deployment.go new file mode 100644 index 00000000..6fc5d249 --- /dev/null +++ b/pkg/github/models/page_deployment.go @@ -0,0 +1,262 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PageDeployment the GitHub Pages deployment status. +type PageDeployment struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ID of the GitHub Pages deployment. This is the Git SHA of the deployed commit. + id PageDeployment_PageDeployment_idable + // The URI to the deployed GitHub Pages. + page_url *string + // The URI to the deployed GitHub Pages preview. + preview_url *string + // The URI to monitor GitHub Pages deployment status. + status_url *string +} +// PageDeployment_PageDeployment_id composed type wrapper for classes int32, string +type PageDeployment_PageDeployment_id struct { + // Composed type representation for type int32 + integer *int32 + // Composed type representation for type string + string *string +} +// NewPageDeployment_PageDeployment_id instantiates a new PageDeployment_PageDeployment_id and sets the default values. +func NewPageDeployment_PageDeployment_id()(*PageDeployment_PageDeployment_id) { + m := &PageDeployment_PageDeployment_id{ + } + return m +} +// CreatePageDeployment_PageDeployment_idFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePageDeployment_PageDeployment_idFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewPageDeployment_PageDeployment_id() + 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.GetInt32Value(); val != nil { + if err != nil { + return nil, err + } + result.SetInteger(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PageDeployment_PageDeployment_id) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetInteger gets the integer property value. Composed type representation for type int32 +// returns a *int32 when successful +func (m *PageDeployment_PageDeployment_id) GetInteger()(*int32) { + return m.integer +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *PageDeployment_PageDeployment_id) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *PageDeployment_PageDeployment_id) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *PageDeployment_PageDeployment_id) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInteger() != nil { + err := writer.WriteInt32Value("", m.GetInteger()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetInteger sets the integer property value. Composed type representation for type int32 +func (m *PageDeployment_PageDeployment_id) SetInteger(value *int32)() { + m.integer = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *PageDeployment_PageDeployment_id) SetString(value *string)() { + m.string = value +} +type PageDeployment_PageDeployment_idable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInteger()(*int32) + GetString()(*string) + SetInteger(value *int32)() + SetString(value *string)() +} +// NewPageDeployment instantiates a new PageDeployment and sets the default values. +func NewPageDeployment()(*PageDeployment) { + m := &PageDeployment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePageDeploymentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePageDeploymentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPageDeployment(), 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 *PageDeployment) 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 *PageDeployment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePageDeployment_PageDeployment_idFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetId(val.(PageDeployment_PageDeployment_idable)) + } + return nil + } + res["page_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPageUrl(val) + } + return nil + } + res["preview_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviewUrl(val) + } + return nil + } + res["status_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The ID of the GitHub Pages deployment. This is the Git SHA of the deployed commit. +// returns a PageDeployment_PageDeployment_idable when successful +func (m *PageDeployment) GetId()(PageDeployment_PageDeployment_idable) { + return m.id +} +// GetPageUrl gets the page_url property value. The URI to the deployed GitHub Pages. +// returns a *string when successful +func (m *PageDeployment) GetPageUrl()(*string) { + return m.page_url +} +// GetPreviewUrl gets the preview_url property value. The URI to the deployed GitHub Pages preview. +// returns a *string when successful +func (m *PageDeployment) GetPreviewUrl()(*string) { + return m.preview_url +} +// GetStatusUrl gets the status_url property value. The URI to monitor GitHub Pages deployment status. +// returns a *string when successful +func (m *PageDeployment) GetStatusUrl()(*string) { + return m.status_url +} +// Serialize serializes information the current object +func (m *PageDeployment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("page_url", m.GetPageUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("preview_url", m.GetPreviewUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status_url", m.GetStatusUrl()) + 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 *PageDeployment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The ID of the GitHub Pages deployment. This is the Git SHA of the deployed commit. +func (m *PageDeployment) SetId(value PageDeployment_PageDeployment_idable)() { + m.id = value +} +// SetPageUrl sets the page_url property value. The URI to the deployed GitHub Pages. +func (m *PageDeployment) SetPageUrl(value *string)() { + m.page_url = value +} +// SetPreviewUrl sets the preview_url property value. The URI to the deployed GitHub Pages preview. +func (m *PageDeployment) SetPreviewUrl(value *string)() { + m.preview_url = value +} +// SetStatusUrl sets the status_url property value. The URI to monitor GitHub Pages deployment status. +func (m *PageDeployment) SetStatusUrl(value *string)() { + m.status_url = value +} +type PageDeploymentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(PageDeployment_PageDeployment_idable) + GetPageUrl()(*string) + GetPreviewUrl()(*string) + GetStatusUrl()(*string) + SetId(value PageDeployment_PageDeployment_idable)() + SetPageUrl(value *string)() + SetPreviewUrl(value *string)() + SetStatusUrl(value *string)() +} diff --git a/pkg/github/models/page_escaped_build_escaped_type.go b/pkg/github/models/page_escaped_build_escaped_type.go new file mode 100644 index 00000000..59d215a5 --- /dev/null +++ b/pkg/github/models/page_escaped_build_escaped_type.go @@ -0,0 +1,34 @@ +package models +// The process in which the Page will be built. +type Page_build_type int + +const ( + LEGACY_PAGE_BUILD_TYPE Page_build_type = iota + WORKFLOW_PAGE_BUILD_TYPE +) + +func (i Page_build_type) String() string { + return []string{"legacy", "workflow"}[i] +} +func ParsePage_build_type(v string) (any, error) { + result := LEGACY_PAGE_BUILD_TYPE + switch v { + case "legacy": + result = LEGACY_PAGE_BUILD_TYPE + case "workflow": + result = WORKFLOW_PAGE_BUILD_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializePage_build_type(values []Page_build_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Page_build_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/page_escaped_protected_escaped_domain_escaped_state.go b/pkg/github/models/page_escaped_protected_escaped_domain_escaped_state.go new file mode 100644 index 00000000..6d952ffe --- /dev/null +++ b/pkg/github/models/page_escaped_protected_escaped_domain_escaped_state.go @@ -0,0 +1,37 @@ +package models +// The state if the domain is verified +type Page_protected_domain_state int + +const ( + PENDING_PAGE_PROTECTED_DOMAIN_STATE Page_protected_domain_state = iota + VERIFIED_PAGE_PROTECTED_DOMAIN_STATE + UNVERIFIED_PAGE_PROTECTED_DOMAIN_STATE +) + +func (i Page_protected_domain_state) String() string { + return []string{"pending", "verified", "unverified"}[i] +} +func ParsePage_protected_domain_state(v string) (any, error) { + result := PENDING_PAGE_PROTECTED_DOMAIN_STATE + switch v { + case "pending": + result = PENDING_PAGE_PROTECTED_DOMAIN_STATE + case "verified": + result = VERIFIED_PAGE_PROTECTED_DOMAIN_STATE + case "unverified": + result = UNVERIFIED_PAGE_PROTECTED_DOMAIN_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializePage_protected_domain_state(values []Page_protected_domain_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Page_protected_domain_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/page_escaped_status.go b/pkg/github/models/page_escaped_status.go new file mode 100644 index 00000000..6a56aa17 --- /dev/null +++ b/pkg/github/models/page_escaped_status.go @@ -0,0 +1,37 @@ +package models +// The status of the most recent build of the Page. +type Page_status int + +const ( + BUILT_PAGE_STATUS Page_status = iota + BUILDING_PAGE_STATUS + ERRORED_PAGE_STATUS +) + +func (i Page_status) String() string { + return []string{"built", "building", "errored"}[i] +} +func ParsePage_status(v string) (any, error) { + result := BUILT_PAGE_STATUS + switch v { + case "built": + result = BUILT_PAGE_STATUS + case "building": + result = BUILDING_PAGE_STATUS + case "errored": + result = ERRORED_PAGE_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializePage_status(values []Page_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Page_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/pages_deployment_status.go b/pkg/github/models/pages_deployment_status.go new file mode 100644 index 00000000..c039c5e2 --- /dev/null +++ b/pkg/github/models/pages_deployment_status.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PagesDeploymentStatus 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 current status of the deployment. + status *PagesDeploymentStatus_status +} +// NewPagesDeploymentStatus instantiates a new PagesDeploymentStatus and sets the default values. +func NewPagesDeploymentStatus()(*PagesDeploymentStatus) { + m := &PagesDeploymentStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePagesDeploymentStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePagesDeploymentStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPagesDeploymentStatus(), 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 *PagesDeploymentStatus) 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 *PagesDeploymentStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePagesDeploymentStatus_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*PagesDeploymentStatus_status)) + } + return nil + } + return res +} +// GetStatus gets the status property value. The current status of the deployment. +// returns a *PagesDeploymentStatus_status when successful +func (m *PagesDeploymentStatus) GetStatus()(*PagesDeploymentStatus_status) { + return m.status +} +// Serialize serializes information the current object +func (m *PagesDeploymentStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + 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 *PagesDeploymentStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The current status of the deployment. +func (m *PagesDeploymentStatus) SetStatus(value *PagesDeploymentStatus_status)() { + m.status = value +} +type PagesDeploymentStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*PagesDeploymentStatus_status) + SetStatus(value *PagesDeploymentStatus_status)() +} diff --git a/pkg/github/models/pages_deployment_status_escaped_status.go b/pkg/github/models/pages_deployment_status_escaped_status.go new file mode 100644 index 00000000..63a5a978 --- /dev/null +++ b/pkg/github/models/pages_deployment_status_escaped_status.go @@ -0,0 +1,61 @@ +package models +// The current status of the deployment. +type PagesDeploymentStatus_status int + +const ( + DEPLOYMENT_IN_PROGRESS_PAGESDEPLOYMENTSTATUS_STATUS PagesDeploymentStatus_status = iota + SYNCING_FILES_PAGESDEPLOYMENTSTATUS_STATUS + FINISHED_FILE_SYNC_PAGESDEPLOYMENTSTATUS_STATUS + UPDATING_PAGES_PAGESDEPLOYMENTSTATUS_STATUS + PURGING_CDN_PAGESDEPLOYMENTSTATUS_STATUS + DEPLOYMENT_CANCELLED_PAGESDEPLOYMENTSTATUS_STATUS + DEPLOYMENT_FAILED_PAGESDEPLOYMENTSTATUS_STATUS + DEPLOYMENT_CONTENT_FAILED_PAGESDEPLOYMENTSTATUS_STATUS + DEPLOYMENT_ATTEMPT_ERROR_PAGESDEPLOYMENTSTATUS_STATUS + DEPLOYMENT_LOST_PAGESDEPLOYMENTSTATUS_STATUS + SUCCEED_PAGESDEPLOYMENTSTATUS_STATUS +) + +func (i PagesDeploymentStatus_status) String() string { + return []string{"deployment_in_progress", "syncing_files", "finished_file_sync", "updating_pages", "purging_cdn", "deployment_cancelled", "deployment_failed", "deployment_content_failed", "deployment_attempt_error", "deployment_lost", "succeed"}[i] +} +func ParsePagesDeploymentStatus_status(v string) (any, error) { + result := DEPLOYMENT_IN_PROGRESS_PAGESDEPLOYMENTSTATUS_STATUS + switch v { + case "deployment_in_progress": + result = DEPLOYMENT_IN_PROGRESS_PAGESDEPLOYMENTSTATUS_STATUS + case "syncing_files": + result = SYNCING_FILES_PAGESDEPLOYMENTSTATUS_STATUS + case "finished_file_sync": + result = FINISHED_FILE_SYNC_PAGESDEPLOYMENTSTATUS_STATUS + case "updating_pages": + result = UPDATING_PAGES_PAGESDEPLOYMENTSTATUS_STATUS + case "purging_cdn": + result = PURGING_CDN_PAGESDEPLOYMENTSTATUS_STATUS + case "deployment_cancelled": + result = DEPLOYMENT_CANCELLED_PAGESDEPLOYMENTSTATUS_STATUS + case "deployment_failed": + result = DEPLOYMENT_FAILED_PAGESDEPLOYMENTSTATUS_STATUS + case "deployment_content_failed": + result = DEPLOYMENT_CONTENT_FAILED_PAGESDEPLOYMENTSTATUS_STATUS + case "deployment_attempt_error": + result = DEPLOYMENT_ATTEMPT_ERROR_PAGESDEPLOYMENTSTATUS_STATUS + case "deployment_lost": + result = DEPLOYMENT_LOST_PAGESDEPLOYMENTSTATUS_STATUS + case "succeed": + result = SUCCEED_PAGESDEPLOYMENTSTATUS_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializePagesDeploymentStatus_status(values []PagesDeploymentStatus_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PagesDeploymentStatus_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/pages_https_certificate.go b/pkg/github/models/pages_https_certificate.go new file mode 100644 index 00000000..78473414 --- /dev/null +++ b/pkg/github/models/pages_https_certificate.go @@ -0,0 +1,174 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PagesHttpsCertificate 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 property + description *string + // Array of the domain set and its alternate name (if it is configured) + domains []string + // The expires_at property + expires_at *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly + // The state property + state *PagesHttpsCertificate_state +} +// NewPagesHttpsCertificate instantiates a new PagesHttpsCertificate and sets the default values. +func NewPagesHttpsCertificate()(*PagesHttpsCertificate) { + m := &PagesHttpsCertificate{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePagesHttpsCertificateFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePagesHttpsCertificateFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPagesHttpsCertificate(), 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 *PagesHttpsCertificate) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *PagesHttpsCertificate) GetDescription()(*string) { + return m.description +} +// GetDomains gets the domains property value. Array of the domain set and its alternate name (if it is configured) +// returns a []string when successful +func (m *PagesHttpsCertificate) GetDomains()([]string) { + return m.domains +} +// GetExpiresAt gets the expires_at property value. The expires_at property +// returns a *DateOnly when successful +func (m *PagesHttpsCertificate) GetExpiresAt()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly) { + return m.expires_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PagesHttpsCertificate) 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["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.SetDomains(res) + } + return nil + } + res["expires_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetDateOnlyValue() + if err != nil { + return err + } + if val != nil { + m.SetExpiresAt(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePagesHttpsCertificate_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*PagesHttpsCertificate_state)) + } + return nil + } + return res +} +// GetState gets the state property value. The state property +// returns a *PagesHttpsCertificate_state when successful +func (m *PagesHttpsCertificate) GetState()(*PagesHttpsCertificate_state) { + return m.state +} +// Serialize serializes information the current object +func (m *PagesHttpsCertificate) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + if m.GetDomains() != nil { + err := writer.WriteCollectionOfStringValues("domains", m.GetDomains()) + if err != nil { + return err + } + } + { + err := writer.WriteDateOnlyValue("expires_at", m.GetExpiresAt()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &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 *PagesHttpsCertificate) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description property +func (m *PagesHttpsCertificate) SetDescription(value *string)() { + m.description = value +} +// SetDomains sets the domains property value. Array of the domain set and its alternate name (if it is configured) +func (m *PagesHttpsCertificate) SetDomains(value []string)() { + m.domains = value +} +// SetExpiresAt sets the expires_at property value. The expires_at property +func (m *PagesHttpsCertificate) SetExpiresAt(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)() { + m.expires_at = value +} +// SetState sets the state property value. The state property +func (m *PagesHttpsCertificate) SetState(value *PagesHttpsCertificate_state)() { + m.state = value +} +type PagesHttpsCertificateable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetDomains()([]string) + GetExpiresAt()(*i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly) + GetState()(*PagesHttpsCertificate_state) + SetDescription(value *string)() + SetDomains(value []string)() + SetExpiresAt(value *i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.DateOnly)() + SetState(value *PagesHttpsCertificate_state)() +} diff --git a/pkg/github/models/pages_https_certificate_escaped_state.go b/pkg/github/models/pages_https_certificate_escaped_state.go new file mode 100644 index 00000000..294e4543 --- /dev/null +++ b/pkg/github/models/pages_https_certificate_escaped_state.go @@ -0,0 +1,63 @@ +package models +type PagesHttpsCertificate_state int + +const ( + NEW_PAGESHTTPSCERTIFICATE_STATE PagesHttpsCertificate_state = iota + AUTHORIZATION_CREATED_PAGESHTTPSCERTIFICATE_STATE + AUTHORIZATION_PENDING_PAGESHTTPSCERTIFICATE_STATE + AUTHORIZED_PAGESHTTPSCERTIFICATE_STATE + AUTHORIZATION_REVOKED_PAGESHTTPSCERTIFICATE_STATE + ISSUED_PAGESHTTPSCERTIFICATE_STATE + UPLOADED_PAGESHTTPSCERTIFICATE_STATE + APPROVED_PAGESHTTPSCERTIFICATE_STATE + ERRORED_PAGESHTTPSCERTIFICATE_STATE + BAD_AUTHZ_PAGESHTTPSCERTIFICATE_STATE + DESTROY_PENDING_PAGESHTTPSCERTIFICATE_STATE + DNS_CHANGED_PAGESHTTPSCERTIFICATE_STATE +) + +func (i PagesHttpsCertificate_state) String() string { + return []string{"new", "authorization_created", "authorization_pending", "authorized", "authorization_revoked", "issued", "uploaded", "approved", "errored", "bad_authz", "destroy_pending", "dns_changed"}[i] +} +func ParsePagesHttpsCertificate_state(v string) (any, error) { + result := NEW_PAGESHTTPSCERTIFICATE_STATE + switch v { + case "new": + result = NEW_PAGESHTTPSCERTIFICATE_STATE + case "authorization_created": + result = AUTHORIZATION_CREATED_PAGESHTTPSCERTIFICATE_STATE + case "authorization_pending": + result = AUTHORIZATION_PENDING_PAGESHTTPSCERTIFICATE_STATE + case "authorized": + result = AUTHORIZED_PAGESHTTPSCERTIFICATE_STATE + case "authorization_revoked": + result = AUTHORIZATION_REVOKED_PAGESHTTPSCERTIFICATE_STATE + case "issued": + result = ISSUED_PAGESHTTPSCERTIFICATE_STATE + case "uploaded": + result = UPLOADED_PAGESHTTPSCERTIFICATE_STATE + case "approved": + result = APPROVED_PAGESHTTPSCERTIFICATE_STATE + case "errored": + result = ERRORED_PAGESHTTPSCERTIFICATE_STATE + case "bad_authz": + result = BAD_AUTHZ_PAGESHTTPSCERTIFICATE_STATE + case "destroy_pending": + result = DESTROY_PENDING_PAGESHTTPSCERTIFICATE_STATE + case "dns_changed": + result = DNS_CHANGED_PAGESHTTPSCERTIFICATE_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializePagesHttpsCertificate_state(values []PagesHttpsCertificate_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PagesHttpsCertificate_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/pages_source_hash.go b/pkg/github/models/pages_source_hash.go new file mode 100644 index 00000000..6cdc5baf --- /dev/null +++ b/pkg/github/models/pages_source_hash.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PagesSourceHash 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 branch property + branch *string + // The path property + path *string +} +// NewPagesSourceHash instantiates a new PagesSourceHash and sets the default values. +func NewPagesSourceHash()(*PagesSourceHash) { + m := &PagesSourceHash{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePagesSourceHashFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePagesSourceHashFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPagesSourceHash(), 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 *PagesSourceHash) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBranch gets the branch property value. The branch property +// returns a *string when successful +func (m *PagesSourceHash) GetBranch()(*string) { + return m.branch +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PagesSourceHash) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranch(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + return res +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *PagesSourceHash) GetPath()(*string) { + return m.path +} +// Serialize serializes information the current object +func (m *PagesSourceHash) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("branch", m.GetBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + 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 *PagesSourceHash) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBranch sets the branch property value. The branch property +func (m *PagesSourceHash) SetBranch(value *string)() { + m.branch = value +} +// SetPath sets the path property value. The path property +func (m *PagesSourceHash) SetPath(value *string)() { + m.path = value +} +type PagesSourceHashable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBranch()(*string) + GetPath()(*string) + SetBranch(value *string)() + SetPath(value *string)() +} diff --git a/pkg/github/models/participation_stats.go b/pkg/github/models/participation_stats.go new file mode 100644 index 00000000..1461c7bd --- /dev/null +++ b/pkg/github/models/participation_stats.go @@ -0,0 +1,121 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ParticipationStats 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 all property + all []int32 + // The owner property + owner []int32 +} +// NewParticipationStats instantiates a new ParticipationStats and sets the default values. +func NewParticipationStats()(*ParticipationStats) { + m := &ParticipationStats{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateParticipationStatsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateParticipationStatsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewParticipationStats(), 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 *ParticipationStats) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAll gets the all property value. The all property +// returns a []int32 when successful +func (m *ParticipationStats) GetAll()([]int32) { + return m.all +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ParticipationStats) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["all"] = 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.SetAll(res) + } + return nil + } + res["owner"] = 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.SetOwner(res) + } + return nil + } + return res +} +// GetOwner gets the owner property value. The owner property +// returns a []int32 when successful +func (m *ParticipationStats) GetOwner()([]int32) { + return m.owner +} +// Serialize serializes information the current object +func (m *ParticipationStats) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAll() != nil { + err := writer.WriteCollectionOfInt32Values("all", m.GetAll()) + if err != nil { + return err + } + } + if m.GetOwner() != nil { + err := writer.WriteCollectionOfInt32Values("owner", m.GetOwner()) + 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 *ParticipationStats) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAll sets the all property value. The all property +func (m *ParticipationStats) SetAll(value []int32)() { + m.all = value +} +// SetOwner sets the owner property value. The owner property +func (m *ParticipationStats) SetOwner(value []int32)() { + m.owner = value +} +type ParticipationStatsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAll()([]int32) + GetOwner()([]int32) + SetAll(value []int32)() + SetOwner(value []int32)() +} diff --git a/pkg/github/models/patch_schema.go b/pkg/github/models/patch_schema.go new file mode 100644 index 00000000..487c7993 --- /dev/null +++ b/pkg/github/models/patch_schema.go @@ -0,0 +1,127 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PatchSchema struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // patch operations list + operations []PatchSchema_Operationsable + // The schemas property + schemas []PatchSchema_schemas +} +// NewPatchSchema instantiates a new PatchSchema and sets the default values. +func NewPatchSchema()(*PatchSchema) { + m := &PatchSchema{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePatchSchemaFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePatchSchemaFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPatchSchema(), 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 *PatchSchema) 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 *PatchSchema) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["Operations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePatchSchema_OperationsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PatchSchema_Operationsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PatchSchema_Operationsable) + } + } + m.SetOperations(res) + } + return nil + } + res["schemas"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParsePatchSchema_schemas) + if err != nil { + return err + } + if val != nil { + res := make([]PatchSchema_schemas, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*PatchSchema_schemas)) + } + } + m.SetSchemas(res) + } + return nil + } + return res +} +// GetOperations gets the Operations property value. patch operations list +// returns a []PatchSchema_Operationsable when successful +func (m *PatchSchema) GetOperations()([]PatchSchema_Operationsable) { + return m.operations +} +// GetSchemas gets the schemas property value. The schemas property +// returns a []PatchSchema_schemas when successful +func (m *PatchSchema) GetSchemas()([]PatchSchema_schemas) { + return m.schemas +} +// Serialize serializes information the current object +func (m *PatchSchema) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetOperations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetOperations())) + for i, v := range m.GetOperations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("Operations", cast) + if err != nil { + return err + } + } + if m.GetSchemas() != nil { + err := writer.WriteCollectionOfStringValues("schemas", SerializePatchSchema_schemas(m.GetSchemas())) + 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 *PatchSchema) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetOperations sets the Operations property value. patch operations list +func (m *PatchSchema) SetOperations(value []PatchSchema_Operationsable)() { + m.operations = value +} +// SetSchemas sets the schemas property value. The schemas property +func (m *PatchSchema) SetSchemas(value []PatchSchema_schemas)() { + m.schemas = value +} +type PatchSchemaable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOperations()([]PatchSchema_Operationsable) + GetSchemas()([]PatchSchema_schemas) + SetOperations(value []PatchSchema_Operationsable)() + SetSchemas(value []PatchSchema_schemas)() +} diff --git a/pkg/github/models/patch_schema_escaped_operations.go b/pkg/github/models/patch_schema_escaped_operations.go new file mode 100644 index 00000000..f937dd1e --- /dev/null +++ b/pkg/github/models/patch_schema_escaped_operations.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PatchSchema_Operations 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 op property + op *PatchSchema_Operations_op + // The path property + path *string + // Corresponding 'value' of that field specified by 'path' + value *string +} +// NewPatchSchema_Operations instantiates a new PatchSchema_Operations and sets the default values. +func NewPatchSchema_Operations()(*PatchSchema_Operations) { + m := &PatchSchema_Operations{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePatchSchema_OperationsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePatchSchema_OperationsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPatchSchema_Operations(), 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 *PatchSchema_Operations) 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 *PatchSchema_Operations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["op"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePatchSchema_Operations_op) + if err != nil { + return err + } + if val != nil { + m.SetOp(val.(*PatchSchema_Operations_op)) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetOp gets the op property value. The op property +// returns a *PatchSchema_Operations_op when successful +func (m *PatchSchema_Operations) GetOp()(*PatchSchema_Operations_op) { + return m.op +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *PatchSchema_Operations) GetPath()(*string) { + return m.path +} +// GetValue gets the value property value. Corresponding 'value' of that field specified by 'path' +// returns a *string when successful +func (m *PatchSchema_Operations) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *PatchSchema_Operations) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetOp() != nil { + cast := (*m.GetOp()).String() + err := writer.WriteStringValue("op", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + 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 *PatchSchema_Operations) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetOp sets the op property value. The op property +func (m *PatchSchema_Operations) SetOp(value *PatchSchema_Operations_op)() { + m.op = value +} +// SetPath sets the path property value. The path property +func (m *PatchSchema_Operations) SetPath(value *string)() { + m.path = value +} +// SetValue sets the value property value. Corresponding 'value' of that field specified by 'path' +func (m *PatchSchema_Operations) SetValue(value *string)() { + m.value = value +} +type PatchSchema_Operationsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOp()(*PatchSchema_Operations_op) + GetPath()(*string) + GetValue()(*string) + SetOp(value *PatchSchema_Operations_op)() + SetPath(value *string)() + SetValue(value *string)() +} diff --git a/pkg/github/models/patch_schema_escaped_operations_escaped_op.go b/pkg/github/models/patch_schema_escaped_operations_escaped_op.go new file mode 100644 index 00000000..fcdd412e --- /dev/null +++ b/pkg/github/models/patch_schema_escaped_operations_escaped_op.go @@ -0,0 +1,36 @@ +package models +type PatchSchema_Operations_op int + +const ( + ADD_PATCHSCHEMA_OPERATIONS_OP PatchSchema_Operations_op = iota + REPLACE_PATCHSCHEMA_OPERATIONS_OP + REMOVE_PATCHSCHEMA_OPERATIONS_OP +) + +func (i PatchSchema_Operations_op) String() string { + return []string{"add", "replace", "remove"}[i] +} +func ParsePatchSchema_Operations_op(v string) (any, error) { + result := ADD_PATCHSCHEMA_OPERATIONS_OP + switch v { + case "add": + result = ADD_PATCHSCHEMA_OPERATIONS_OP + case "replace": + result = REPLACE_PATCHSCHEMA_OPERATIONS_OP + case "remove": + result = REMOVE_PATCHSCHEMA_OPERATIONS_OP + default: + return nil, nil + } + return &result, nil +} +func SerializePatchSchema_Operations_op(values []PatchSchema_Operations_op) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PatchSchema_Operations_op) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/patch_schema_escaped_schemas.go b/pkg/github/models/patch_schema_escaped_schemas.go new file mode 100644 index 00000000..6d83a325 --- /dev/null +++ b/pkg/github/models/patch_schema_escaped_schemas.go @@ -0,0 +1,30 @@ +package models +type PatchSchema_schemas int + +const ( + URNIETFPARAMSSCIMAPIMESSAGES20PATCHOP_PATCHSCHEMA_SCHEMAS PatchSchema_schemas = iota +) + +func (i PatchSchema_schemas) String() string { + return []string{"urn:ietf:params:scim:api:messages:2.0:PatchOp"}[i] +} +func ParsePatchSchema_schemas(v string) (any, error) { + result := URNIETFPARAMSSCIMAPIMESSAGES20PATCHOP_PATCHSCHEMA_SCHEMAS + switch v { + case "urn:ietf:params:scim:api:messages:2.0:PatchOp": + result = URNIETFPARAMSSCIMAPIMESSAGES20PATCHOP_PATCHSCHEMA_SCHEMAS + default: + return nil, nil + } + return &result, nil +} +func SerializePatchSchema_schemas(values []PatchSchema_schemas) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PatchSchema_schemas) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/pending_deployment.go b/pkg/github/models/pending_deployment.go new file mode 100644 index 00000000..c63faabb --- /dev/null +++ b/pkg/github/models/pending_deployment.go @@ -0,0 +1,210 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PendingDeployment details of a deployment that is waiting for protection rules to pass +type PendingDeployment 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 the currently authenticated user can approve the deployment + current_user_can_approve *bool + // The environment property + environment PendingDeployment_environmentable + // The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. + reviewers []PendingDeployment_reviewersable + // The set duration of the wait timer + wait_timer *int32 + // The time that the wait timer began. + wait_timer_started_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewPendingDeployment instantiates a new PendingDeployment and sets the default values. +func NewPendingDeployment()(*PendingDeployment) { + m := &PendingDeployment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePendingDeploymentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePendingDeploymentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPendingDeployment(), 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 *PendingDeployment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCurrentUserCanApprove gets the current_user_can_approve property value. Whether the currently authenticated user can approve the deployment +// returns a *bool when successful +func (m *PendingDeployment) GetCurrentUserCanApprove()(*bool) { + return m.current_user_can_approve +} +// GetEnvironment gets the environment property value. The environment property +// returns a PendingDeployment_environmentable when successful +func (m *PendingDeployment) GetEnvironment()(PendingDeployment_environmentable) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PendingDeployment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["current_user_can_approve"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserCanApprove(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePendingDeployment_environmentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val.(PendingDeployment_environmentable)) + } + return nil + } + res["reviewers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePendingDeployment_reviewersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PendingDeployment_reviewersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PendingDeployment_reviewersable) + } + } + m.SetReviewers(res) + } + return nil + } + res["wait_timer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWaitTimer(val) + } + return nil + } + res["wait_timer_started_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetWaitTimerStartedAt(val) + } + return nil + } + return res +} +// GetReviewers gets the reviewers property value. The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. +// returns a []PendingDeployment_reviewersable when successful +func (m *PendingDeployment) GetReviewers()([]PendingDeployment_reviewersable) { + return m.reviewers +} +// GetWaitTimer gets the wait_timer property value. The set duration of the wait timer +// returns a *int32 when successful +func (m *PendingDeployment) GetWaitTimer()(*int32) { + return m.wait_timer +} +// GetWaitTimerStartedAt gets the wait_timer_started_at property value. The time that the wait timer began. +// returns a *Time when successful +func (m *PendingDeployment) GetWaitTimerStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.wait_timer_started_at +} +// Serialize serializes information the current object +func (m *PendingDeployment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("current_user_can_approve", m.GetCurrentUserCanApprove()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + if m.GetReviewers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetReviewers())) + for i, v := range m.GetReviewers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("reviewers", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("wait_timer", m.GetWaitTimer()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("wait_timer_started_at", m.GetWaitTimerStartedAt()) + 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 *PendingDeployment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCurrentUserCanApprove sets the current_user_can_approve property value. Whether the currently authenticated user can approve the deployment +func (m *PendingDeployment) SetCurrentUserCanApprove(value *bool)() { + m.current_user_can_approve = value +} +// SetEnvironment sets the environment property value. The environment property +func (m *PendingDeployment) SetEnvironment(value PendingDeployment_environmentable)() { + m.environment = value +} +// SetReviewers sets the reviewers property value. The people or teams that may approve jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. +func (m *PendingDeployment) SetReviewers(value []PendingDeployment_reviewersable)() { + m.reviewers = value +} +// SetWaitTimer sets the wait_timer property value. The set duration of the wait timer +func (m *PendingDeployment) SetWaitTimer(value *int32)() { + m.wait_timer = value +} +// SetWaitTimerStartedAt sets the wait_timer_started_at property value. The time that the wait timer began. +func (m *PendingDeployment) SetWaitTimerStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.wait_timer_started_at = value +} +type PendingDeploymentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCurrentUserCanApprove()(*bool) + GetEnvironment()(PendingDeployment_environmentable) + GetReviewers()([]PendingDeployment_reviewersable) + GetWaitTimer()(*int32) + GetWaitTimerStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetCurrentUserCanApprove(value *bool)() + SetEnvironment(value PendingDeployment_environmentable)() + SetReviewers(value []PendingDeployment_reviewersable)() + SetWaitTimer(value *int32)() + SetWaitTimerStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/pending_deployment_escaped_environment.go b/pkg/github/models/pending_deployment_escaped_environment.go new file mode 100644 index 00000000..2c386d4e --- /dev/null +++ b/pkg/github/models/pending_deployment_escaped_environment.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PendingDeployment_environment 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 html_url property + html_url *string + // The id of the environment. + id *int64 + // The name of the environment. + name *string + // The node_id property + node_id *string + // The url property + url *string +} +// NewPendingDeployment_environment instantiates a new PendingDeployment_environment and sets the default values. +func NewPendingDeployment_environment()(*PendingDeployment_environment) { + m := &PendingDeployment_environment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePendingDeployment_environmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePendingDeployment_environmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPendingDeployment_environment(), 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 *PendingDeployment_environment) 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 *PendingDeployment_environment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PendingDeployment_environment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id of the environment. +// returns a *int64 when successful +func (m *PendingDeployment_environment) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name of the environment. +// returns a *string when successful +func (m *PendingDeployment_environment) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PendingDeployment_environment) GetNodeId()(*string) { + return m.node_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PendingDeployment_environment) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PendingDeployment_environment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PendingDeployment_environment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PendingDeployment_environment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id of the environment. +func (m *PendingDeployment_environment) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name of the environment. +func (m *PendingDeployment_environment) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PendingDeployment_environment) SetNodeId(value *string)() { + m.node_id = value +} +// SetUrl sets the url property value. The url property +func (m *PendingDeployment_environment) SetUrl(value *string)() { + m.url = value +} +type PendingDeployment_environmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetId()(*int64) + GetName()(*string) + GetNodeId()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetName(value *string)() + SetNodeId(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pending_deployment_escaped_reviewers.go b/pkg/github/models/pending_deployment_escaped_reviewers.go new file mode 100644 index 00000000..09051812 --- /dev/null +++ b/pkg/github/models/pending_deployment_escaped_reviewers.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PendingDeployment_reviewers 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 reviewer property + reviewer PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable + // The type of reviewer. + typeEscaped *DeploymentReviewerType +} +// PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer composed type wrapper for classes SimpleUserable, Teamable +type PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer struct { + // Composed type representation for type SimpleUserable + simpleUser SimpleUserable + // Composed type representation for type Teamable + team Teamable +} +// NewPendingDeployment_reviewers_PendingDeployment_reviewers_reviewer instantiates a new PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer and sets the default values. +func NewPendingDeployment_reviewers_PendingDeployment_reviewers_reviewer()(*PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) { + m := &PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer{ + } + return m +} +// CreatePendingDeployment_reviewers_PendingDeployment_reviewers_reviewerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePendingDeployment_reviewers_PendingDeployment_reviewers_reviewerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewPendingDeployment_reviewers_PendingDeployment_reviewers_reviewer() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateSimpleUserFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(SimpleUserable); ok { + result.SetSimpleUser(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTeamFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(Teamable); ok { + result.SetTeam(cast) + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) 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 *PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) GetIsComposedType()(bool) { + return true +} +// GetSimpleUser gets the simpleUser property value. Composed type representation for type SimpleUserable +// returns a SimpleUserable when successful +func (m *PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) GetSimpleUser()(SimpleUserable) { + return m.simpleUser +} +// GetTeam gets the team property value. Composed type representation for type Teamable +// returns a Teamable when successful +func (m *PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) GetTeam()(Teamable) { + return m.team +} +// Serialize serializes information the current object +func (m *PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSimpleUser() != nil { + err := writer.WriteObjectValue("", m.GetSimpleUser()) + if err != nil { + return err + } + } else if m.GetTeam() != nil { + err := writer.WriteObjectValue("", m.GetTeam()) + if err != nil { + return err + } + } + return nil +} +// SetSimpleUser sets the simpleUser property value. Composed type representation for type SimpleUserable +func (m *PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) SetSimpleUser(value SimpleUserable)() { + m.simpleUser = value +} +// SetTeam sets the team property value. Composed type representation for type Teamable +func (m *PendingDeployment_reviewers_PendingDeployment_reviewers_reviewer) SetTeam(value Teamable)() { + m.team = value +} +type PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSimpleUser()(SimpleUserable) + GetTeam()(Teamable) + SetSimpleUser(value SimpleUserable)() + SetTeam(value Teamable)() +} +// NewPendingDeployment_reviewers instantiates a new PendingDeployment_reviewers and sets the default values. +func NewPendingDeployment_reviewers()(*PendingDeployment_reviewers) { + m := &PendingDeployment_reviewers{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePendingDeployment_reviewersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePendingDeployment_reviewersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPendingDeployment_reviewers(), 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 *PendingDeployment_reviewers) 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 *PendingDeployment_reviewers) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["reviewer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePendingDeployment_reviewers_PendingDeployment_reviewers_reviewerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewer(val.(PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseDeploymentReviewerType) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*DeploymentReviewerType)) + } + return nil + } + return res +} +// GetReviewer gets the reviewer property value. The reviewer property +// returns a PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable when successful +func (m *PendingDeployment_reviewers) GetReviewer()(PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable) { + return m.reviewer +} +// GetTypeEscaped gets the type property value. The type of reviewer. +// returns a *DeploymentReviewerType when successful +func (m *PendingDeployment_reviewers) GetTypeEscaped()(*DeploymentReviewerType) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *PendingDeployment_reviewers) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("reviewer", m.GetReviewer()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *PendingDeployment_reviewers) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetReviewer sets the reviewer property value. The reviewer property +func (m *PendingDeployment_reviewers) SetReviewer(value PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable)() { + m.reviewer = value +} +// SetTypeEscaped sets the type property value. The type of reviewer. +func (m *PendingDeployment_reviewers) SetTypeEscaped(value *DeploymentReviewerType)() { + m.typeEscaped = value +} +type PendingDeployment_reviewersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetReviewer()(PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable) + GetTypeEscaped()(*DeploymentReviewerType) + SetReviewer(value PendingDeployment_reviewers_PendingDeployment_reviewers_reviewerable)() + SetTypeEscaped(value *DeploymentReviewerType)() +} diff --git a/pkg/github/models/pre_receive_environment.go b/pkg/github/models/pre_receive_environment.go new file mode 100644 index 00000000..f8f2aa09 --- /dev/null +++ b/pkg/github/models/pre_receive_environment.go @@ -0,0 +1,312 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveEnvironment 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 *string + // The default_environment property + default_environment *bool + // The download property + download PreReceiveEnvironment_downloadable + // The hooks_count property + hooks_count *int32 + // The html_url property + html_url *string + // The id property + id *int64 + // The image_url property + image_url *string + // The name property + name *string + // The url property + url *string +} +// NewPreReceiveEnvironment instantiates a new PreReceiveEnvironment and sets the default values. +func NewPreReceiveEnvironment()(*PreReceiveEnvironment) { + m := &PreReceiveEnvironment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveEnvironmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveEnvironmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveEnvironment(), 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 *PreReceiveEnvironment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *PreReceiveEnvironment) GetCreatedAt()(*string) { + return m.created_at +} +// GetDefaultEnvironment gets the default_environment property value. The default_environment property +// returns a *bool when successful +func (m *PreReceiveEnvironment) GetDefaultEnvironment()(*bool) { + return m.default_environment +} +// GetDownload gets the download property value. The download property +// returns a PreReceiveEnvironment_downloadable when successful +func (m *PreReceiveEnvironment) GetDownload()(PreReceiveEnvironment_downloadable) { + return m.download +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PreReceiveEnvironment) 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.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["default_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultEnvironment(val) + } + return nil + } + res["download"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePreReceiveEnvironment_downloadFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDownload(val.(PreReceiveEnvironment_downloadable)) + } + return nil + } + res["hooks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetHooksCount(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["image_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetImageUrl(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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHooksCount gets the hooks_count property value. The hooks_count property +// returns a *int32 when successful +func (m *PreReceiveEnvironment) GetHooksCount()(*int32) { + return m.hooks_count +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PreReceiveEnvironment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PreReceiveEnvironment) GetId()(*int64) { + return m.id +} +// GetImageUrl gets the image_url property value. The image_url property +// returns a *string when successful +func (m *PreReceiveEnvironment) GetImageUrl()(*string) { + return m.image_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PreReceiveEnvironment) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PreReceiveEnvironment) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PreReceiveEnvironment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("default_environment", m.GetDefaultEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("download", m.GetDownload()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("hooks_count", m.GetHooksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("image_url", m.GetImageUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PreReceiveEnvironment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PreReceiveEnvironment) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetDefaultEnvironment sets the default_environment property value. The default_environment property +func (m *PreReceiveEnvironment) SetDefaultEnvironment(value *bool)() { + m.default_environment = value +} +// SetDownload sets the download property value. The download property +func (m *PreReceiveEnvironment) SetDownload(value PreReceiveEnvironment_downloadable)() { + m.download = value +} +// SetHooksCount sets the hooks_count property value. The hooks_count property +func (m *PreReceiveEnvironment) SetHooksCount(value *int32)() { + m.hooks_count = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PreReceiveEnvironment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PreReceiveEnvironment) SetId(value *int64)() { + m.id = value +} +// SetImageUrl sets the image_url property value. The image_url property +func (m *PreReceiveEnvironment) SetImageUrl(value *string)() { + m.image_url = value +} +// SetName sets the name property value. The name property +func (m *PreReceiveEnvironment) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *PreReceiveEnvironment) SetUrl(value *string)() { + m.url = value +} +type PreReceiveEnvironmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetDefaultEnvironment()(*bool) + GetDownload()(PreReceiveEnvironment_downloadable) + GetHooksCount()(*int32) + GetHtmlUrl()(*string) + GetId()(*int64) + GetImageUrl()(*string) + GetName()(*string) + GetUrl()(*string) + SetCreatedAt(value *string)() + SetDefaultEnvironment(value *bool)() + SetDownload(value PreReceiveEnvironment_downloadable)() + SetHooksCount(value *int32)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetImageUrl(value *string)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pre_receive_environment_download_status.go b/pkg/github/models/pre_receive_environment_download_status.go new file mode 100644 index 00000000..f93d85a8 --- /dev/null +++ b/pkg/github/models/pre_receive_environment_download_status.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveEnvironmentDownloadStatus 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 downloaded_at property + downloaded_at *string + // The message property + message *string + // The state property + state *string + // The url property + url *string +} +// NewPreReceiveEnvironmentDownloadStatus instantiates a new PreReceiveEnvironmentDownloadStatus and sets the default values. +func NewPreReceiveEnvironmentDownloadStatus()(*PreReceiveEnvironmentDownloadStatus) { + m := &PreReceiveEnvironmentDownloadStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveEnvironmentDownloadStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveEnvironmentDownloadStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveEnvironmentDownloadStatus(), 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 *PreReceiveEnvironmentDownloadStatus) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDownloadedAt gets the downloaded_at property value. The downloaded_at property +// returns a *string when successful +func (m *PreReceiveEnvironmentDownloadStatus) GetDownloadedAt()(*string) { + return m.downloaded_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PreReceiveEnvironmentDownloadStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["downloaded_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadedAt(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 + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *PreReceiveEnvironmentDownloadStatus) GetMessage()(*string) { + return m.message +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *PreReceiveEnvironmentDownloadStatus) GetState()(*string) { + return m.state +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PreReceiveEnvironmentDownloadStatus) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PreReceiveEnvironmentDownloadStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("downloaded_at", m.GetDownloadedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PreReceiveEnvironmentDownloadStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDownloadedAt sets the downloaded_at property value. The downloaded_at property +func (m *PreReceiveEnvironmentDownloadStatus) SetDownloadedAt(value *string)() { + m.downloaded_at = value +} +// SetMessage sets the message property value. The message property +func (m *PreReceiveEnvironmentDownloadStatus) SetMessage(value *string)() { + m.message = value +} +// SetState sets the state property value. The state property +func (m *PreReceiveEnvironmentDownloadStatus) SetState(value *string)() { + m.state = value +} +// SetUrl sets the url property value. The url property +func (m *PreReceiveEnvironmentDownloadStatus) SetUrl(value *string)() { + m.url = value +} +type PreReceiveEnvironmentDownloadStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDownloadedAt()(*string) + GetMessage()(*string) + GetState()(*string) + GetUrl()(*string) + SetDownloadedAt(value *string)() + SetMessage(value *string)() + SetState(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pre_receive_environment_escaped_download.go b/pkg/github/models/pre_receive_environment_escaped_download.go new file mode 100644 index 00000000..a9aff802 --- /dev/null +++ b/pkg/github/models/pre_receive_environment_escaped_download.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveEnvironment_download 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 downloaded_at property + downloaded_at *string + // The message property + message *string + // The state property + state *string + // The url property + url *string +} +// NewPreReceiveEnvironment_download instantiates a new PreReceiveEnvironment_download and sets the default values. +func NewPreReceiveEnvironment_download()(*PreReceiveEnvironment_download) { + m := &PreReceiveEnvironment_download{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveEnvironment_downloadFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveEnvironment_downloadFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveEnvironment_download(), 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 *PreReceiveEnvironment_download) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDownloadedAt gets the downloaded_at property value. The downloaded_at property +// returns a *string when successful +func (m *PreReceiveEnvironment_download) GetDownloadedAt()(*string) { + return m.downloaded_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PreReceiveEnvironment_download) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["downloaded_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadedAt(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 + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *PreReceiveEnvironment_download) GetMessage()(*string) { + return m.message +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *PreReceiveEnvironment_download) GetState()(*string) { + return m.state +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PreReceiveEnvironment_download) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PreReceiveEnvironment_download) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("downloaded_at", m.GetDownloadedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PreReceiveEnvironment_download) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDownloadedAt sets the downloaded_at property value. The downloaded_at property +func (m *PreReceiveEnvironment_download) SetDownloadedAt(value *string)() { + m.downloaded_at = value +} +// SetMessage sets the message property value. The message property +func (m *PreReceiveEnvironment_download) SetMessage(value *string)() { + m.message = value +} +// SetState sets the state property value. The state property +func (m *PreReceiveEnvironment_download) SetState(value *string)() { + m.state = value +} +// SetUrl sets the url property value. The url property +func (m *PreReceiveEnvironment_download) SetUrl(value *string)() { + m.url = value +} +type PreReceiveEnvironment_downloadable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDownloadedAt()(*string) + GetMessage()(*string) + GetState()(*string) + GetUrl()(*string) + SetDownloadedAt(value *string)() + SetMessage(value *string)() + SetState(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pre_receive_hook.go b/pkg/github/models/pre_receive_hook.go new file mode 100644 index 00000000..aba645e3 --- /dev/null +++ b/pkg/github/models/pre_receive_hook.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveHook 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 allow_downstream_configuration property + allow_downstream_configuration *bool + // The enforcement property + enforcement *string + // The environment property + environment PreReceiveHook_environmentable + // The id property + id *int32 + // The name property + name *string + // The script property + script *string + // The script_repository property + script_repository PreReceiveHook_script_repositoryable +} +// NewPreReceiveHook instantiates a new PreReceiveHook and sets the default values. +func NewPreReceiveHook()(*PreReceiveHook) { + m := &PreReceiveHook{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveHookFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveHookFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveHook(), 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 *PreReceiveHook) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowDownstreamConfiguration gets the allow_downstream_configuration property value. The allow_downstream_configuration property +// returns a *bool when successful +func (m *PreReceiveHook) GetAllowDownstreamConfiguration()(*bool) { + return m.allow_downstream_configuration +} +// GetEnforcement gets the enforcement property value. The enforcement property +// returns a *string when successful +func (m *PreReceiveHook) GetEnforcement()(*string) { + return m.enforcement +} +// GetEnvironment gets the environment property value. The environment property +// returns a PreReceiveHook_environmentable when successful +func (m *PreReceiveHook) GetEnvironment()(PreReceiveHook_environmentable) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PreReceiveHook) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_downstream_configuration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowDownstreamConfiguration(val) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePreReceiveHook_environmentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val.(PreReceiveHook_environmentable)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["script"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetScript(val) + } + return nil + } + res["script_repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePreReceiveHook_script_repositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetScriptRepository(val.(PreReceiveHook_script_repositoryable)) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *PreReceiveHook) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PreReceiveHook) GetName()(*string) { + return m.name +} +// GetScript gets the script property value. The script property +// returns a *string when successful +func (m *PreReceiveHook) GetScript()(*string) { + return m.script +} +// GetScriptRepository gets the script_repository property value. The script_repository property +// returns a PreReceiveHook_script_repositoryable when successful +func (m *PreReceiveHook) GetScriptRepository()(PreReceiveHook_script_repositoryable) { + return m.script_repository +} +// Serialize serializes information the current object +func (m *PreReceiveHook) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_downstream_configuration", m.GetAllowDownstreamConfiguration()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("enforcement", m.GetEnforcement()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("script", m.GetScript()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("script_repository", m.GetScriptRepository()) + 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 *PreReceiveHook) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowDownstreamConfiguration sets the allow_downstream_configuration property value. The allow_downstream_configuration property +func (m *PreReceiveHook) SetAllowDownstreamConfiguration(value *bool)() { + m.allow_downstream_configuration = value +} +// SetEnforcement sets the enforcement property value. The enforcement property +func (m *PreReceiveHook) SetEnforcement(value *string)() { + m.enforcement = value +} +// SetEnvironment sets the environment property value. The environment property +func (m *PreReceiveHook) SetEnvironment(value PreReceiveHook_environmentable)() { + m.environment = value +} +// SetId sets the id property value. The id property +func (m *PreReceiveHook) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *PreReceiveHook) SetName(value *string)() { + m.name = value +} +// SetScript sets the script property value. The script property +func (m *PreReceiveHook) SetScript(value *string)() { + m.script = value +} +// SetScriptRepository sets the script_repository property value. The script_repository property +func (m *PreReceiveHook) SetScriptRepository(value PreReceiveHook_script_repositoryable)() { + m.script_repository = value +} +type PreReceiveHookable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowDownstreamConfiguration()(*bool) + GetEnforcement()(*string) + GetEnvironment()(PreReceiveHook_environmentable) + GetId()(*int32) + GetName()(*string) + GetScript()(*string) + GetScriptRepository()(PreReceiveHook_script_repositoryable) + SetAllowDownstreamConfiguration(value *bool)() + SetEnforcement(value *string)() + SetEnvironment(value PreReceiveHook_environmentable)() + SetId(value *int32)() + SetName(value *string)() + SetScript(value *string)() + SetScriptRepository(value PreReceiveHook_script_repositoryable)() +} diff --git a/pkg/github/models/pre_receive_hook_escaped_environment.go b/pkg/github/models/pre_receive_hook_escaped_environment.go new file mode 100644 index 00000000..30c2e4a2 --- /dev/null +++ b/pkg/github/models/pre_receive_hook_escaped_environment.go @@ -0,0 +1,312 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveHook_environment 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 *string + // The default_environment property + default_environment *bool + // The download property + download PreReceiveHook_environment_downloadable + // The hooks_count property + hooks_count *int32 + // The html_url property + html_url *string + // The id property + id *int64 + // The image_url property + image_url *string + // The name property + name *string + // The url property + url *string +} +// NewPreReceiveHook_environment instantiates a new PreReceiveHook_environment and sets the default values. +func NewPreReceiveHook_environment()(*PreReceiveHook_environment) { + m := &PreReceiveHook_environment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveHook_environmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveHook_environmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveHook_environment(), 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 *PreReceiveHook_environment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *PreReceiveHook_environment) GetCreatedAt()(*string) { + return m.created_at +} +// GetDefaultEnvironment gets the default_environment property value. The default_environment property +// returns a *bool when successful +func (m *PreReceiveHook_environment) GetDefaultEnvironment()(*bool) { + return m.default_environment +} +// GetDownload gets the download property value. The download property +// returns a PreReceiveHook_environment_downloadable when successful +func (m *PreReceiveHook_environment) GetDownload()(PreReceiveHook_environment_downloadable) { + return m.download +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PreReceiveHook_environment) 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.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["default_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultEnvironment(val) + } + return nil + } + res["download"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePreReceiveHook_environment_downloadFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDownload(val.(PreReceiveHook_environment_downloadable)) + } + return nil + } + res["hooks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetHooksCount(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["image_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetImageUrl(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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHooksCount gets the hooks_count property value. The hooks_count property +// returns a *int32 when successful +func (m *PreReceiveHook_environment) GetHooksCount()(*int32) { + return m.hooks_count +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PreReceiveHook_environment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PreReceiveHook_environment) GetId()(*int64) { + return m.id +} +// GetImageUrl gets the image_url property value. The image_url property +// returns a *string when successful +func (m *PreReceiveHook_environment) GetImageUrl()(*string) { + return m.image_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PreReceiveHook_environment) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PreReceiveHook_environment) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PreReceiveHook_environment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("default_environment", m.GetDefaultEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("download", m.GetDownload()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("hooks_count", m.GetHooksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("image_url", m.GetImageUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PreReceiveHook_environment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PreReceiveHook_environment) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetDefaultEnvironment sets the default_environment property value. The default_environment property +func (m *PreReceiveHook_environment) SetDefaultEnvironment(value *bool)() { + m.default_environment = value +} +// SetDownload sets the download property value. The download property +func (m *PreReceiveHook_environment) SetDownload(value PreReceiveHook_environment_downloadable)() { + m.download = value +} +// SetHooksCount sets the hooks_count property value. The hooks_count property +func (m *PreReceiveHook_environment) SetHooksCount(value *int32)() { + m.hooks_count = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PreReceiveHook_environment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PreReceiveHook_environment) SetId(value *int64)() { + m.id = value +} +// SetImageUrl sets the image_url property value. The image_url property +func (m *PreReceiveHook_environment) SetImageUrl(value *string)() { + m.image_url = value +} +// SetName sets the name property value. The name property +func (m *PreReceiveHook_environment) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *PreReceiveHook_environment) SetUrl(value *string)() { + m.url = value +} +type PreReceiveHook_environmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetDefaultEnvironment()(*bool) + GetDownload()(PreReceiveHook_environment_downloadable) + GetHooksCount()(*int32) + GetHtmlUrl()(*string) + GetId()(*int64) + GetImageUrl()(*string) + GetName()(*string) + GetUrl()(*string) + SetCreatedAt(value *string)() + SetDefaultEnvironment(value *bool)() + SetDownload(value PreReceiveHook_environment_downloadable)() + SetHooksCount(value *int32)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetImageUrl(value *string)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pre_receive_hook_escaped_environment_escaped_download.go b/pkg/github/models/pre_receive_hook_escaped_environment_escaped_download.go new file mode 100644 index 00000000..15a332d5 --- /dev/null +++ b/pkg/github/models/pre_receive_hook_escaped_environment_escaped_download.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveHook_environment_download 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 downloaded_at property + downloaded_at *string + // The message property + message *string + // The state property + state *string + // The url property + url *string +} +// NewPreReceiveHook_environment_download instantiates a new PreReceiveHook_environment_download and sets the default values. +func NewPreReceiveHook_environment_download()(*PreReceiveHook_environment_download) { + m := &PreReceiveHook_environment_download{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveHook_environment_downloadFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveHook_environment_downloadFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveHook_environment_download(), 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 *PreReceiveHook_environment_download) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDownloadedAt gets the downloaded_at property value. The downloaded_at property +// returns a *string when successful +func (m *PreReceiveHook_environment_download) GetDownloadedAt()(*string) { + return m.downloaded_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PreReceiveHook_environment_download) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["downloaded_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadedAt(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 + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *PreReceiveHook_environment_download) GetMessage()(*string) { + return m.message +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *PreReceiveHook_environment_download) GetState()(*string) { + return m.state +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PreReceiveHook_environment_download) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PreReceiveHook_environment_download) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("downloaded_at", m.GetDownloadedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PreReceiveHook_environment_download) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDownloadedAt sets the downloaded_at property value. The downloaded_at property +func (m *PreReceiveHook_environment_download) SetDownloadedAt(value *string)() { + m.downloaded_at = value +} +// SetMessage sets the message property value. The message property +func (m *PreReceiveHook_environment_download) SetMessage(value *string)() { + m.message = value +} +// SetState sets the state property value. The state property +func (m *PreReceiveHook_environment_download) SetState(value *string)() { + m.state = value +} +// SetUrl sets the url property value. The url property +func (m *PreReceiveHook_environment_download) SetUrl(value *string)() { + m.url = value +} +type PreReceiveHook_environment_downloadable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDownloadedAt()(*string) + GetMessage()(*string) + GetState()(*string) + GetUrl()(*string) + SetDownloadedAt(value *string)() + SetMessage(value *string)() + SetState(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pre_receive_hook_escaped_script_escaped_repository.go b/pkg/github/models/pre_receive_hook_escaped_script_escaped_repository.go new file mode 100644 index 00000000..bb088751 --- /dev/null +++ b/pkg/github/models/pre_receive_hook_escaped_script_escaped_repository.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PreReceiveHook_script_repository 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_name property + full_name *string + // The html_url property + html_url *string + // The id property + id *int32 + // The url property + url *string +} +// NewPreReceiveHook_script_repository instantiates a new PreReceiveHook_script_repository and sets the default values. +func NewPreReceiveHook_script_repository()(*PreReceiveHook_script_repository) { + m := &PreReceiveHook_script_repository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePreReceiveHook_script_repositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePreReceiveHook_script_repositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPreReceiveHook_script_repository(), 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 *PreReceiveHook_script_repository) 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 *PreReceiveHook_script_repository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *PreReceiveHook_script_repository) GetFullName()(*string) { + return m.full_name +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PreReceiveHook_script_repository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *PreReceiveHook_script_repository) GetId()(*int32) { + return m.id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PreReceiveHook_script_repository) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PreReceiveHook_script_repository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PreReceiveHook_script_repository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *PreReceiveHook_script_repository) SetFullName(value *string)() { + m.full_name = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PreReceiveHook_script_repository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PreReceiveHook_script_repository) SetId(value *int32)() { + m.id = value +} +// SetUrl sets the url property value. The url property +func (m *PreReceiveHook_script_repository) SetUrl(value *string)() { + m.url = value +} +type PreReceiveHook_script_repositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFullName()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetUrl()(*string) + SetFullName(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/private_user.go b/pkg/github/models/private_user.go new file mode 100644 index 00000000..80946649 --- /dev/null +++ b/pkg/github/models/private_user.go @@ -0,0 +1,1300 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PrivateUser private User +type PrivateUser 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 avatar_url property + avatar_url *string + // The bio property + bio *string + // The blog property + blog *string + // The business_plus property + business_plus *bool + // The collaborators property + collaborators *int32 + // The company property + company *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The disk_usage property + disk_usage *int32 + // The email property + email *string + // The events_url property + events_url *string + // The followers property + followers *int32 + // The followers_url property + followers_url *string + // The following property + following *int32 + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The hireable property + hireable *bool + // The html_url property + html_url *string + // The id property + id *int64 + // The ldap_dn property + ldap_dn *string + // The location property + location *string + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The notification_email property + notification_email *string + // The organizations_url property + organizations_url *string + // The owned_private_repos property + owned_private_repos *int32 + // The plan property + plan PrivateUser_planable + // The private_gists property + private_gists *int32 + // The public_gists property + public_gists *int32 + // The public_repos property + public_repos *int32 + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The suspended_at property + suspended_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The total_private_repos property + total_private_repos *int32 + // The twitter_username property + twitter_username *string + // The two_factor_authentication property + two_factor_authentication *bool + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewPrivateUser instantiates a new PrivateUser and sets the default values. +func NewPrivateUser()(*PrivateUser) { + m := &PrivateUser{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePrivateUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePrivateUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPrivateUser(), 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 *PrivateUser) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *PrivateUser) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetBio gets the bio property value. The bio property +// returns a *string when successful +func (m *PrivateUser) GetBio()(*string) { + return m.bio +} +// GetBlog gets the blog property value. The blog property +// returns a *string when successful +func (m *PrivateUser) GetBlog()(*string) { + return m.blog +} +// GetBusinessPlus gets the business_plus property value. The business_plus property +// returns a *bool when successful +func (m *PrivateUser) GetBusinessPlus()(*bool) { + return m.business_plus +} +// GetCollaborators gets the collaborators property value. The collaborators property +// returns a *int32 when successful +func (m *PrivateUser) GetCollaborators()(*int32) { + return m.collaborators +} +// GetCompany gets the company property value. The company property +// returns a *string when successful +func (m *PrivateUser) GetCompany()(*string) { + return m.company +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PrivateUser) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDiskUsage gets the disk_usage property value. The disk_usage property +// returns a *int32 when successful +func (m *PrivateUser) GetDiskUsage()(*int32) { + return m.disk_usage +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *PrivateUser) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PrivateUser) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PrivateUser) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["bio"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBio(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["business_plus"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetBusinessPlus(val) + } + return nil + } + res["collaborators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCollaborators(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + 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["disk_usage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDiskUsage(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowers(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowing(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["hireable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHireable(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["ldap_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLdapDn(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationEmail(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["owned_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOwnedPrivateRepos(val) + } + return nil + } + res["plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePrivateUser_planFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPlan(val.(PrivateUser_planable)) + } + return nil + } + res["private_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateGists(val) + } + return nil + } + res["public_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicGists(val) + } + return nil + } + res["public_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicRepos(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["suspended_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetSuspendedAt(val) + } + return nil + } + res["total_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPrivateRepos(val) + } + return nil + } + res["twitter_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTwitterUsername(val) + } + return nil + } + res["two_factor_authentication"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTwoFactorAuthentication(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowers gets the followers property value. The followers property +// returns a *int32 when successful +func (m *PrivateUser) GetFollowers()(*int32) { + return m.followers +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *PrivateUser) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowing gets the following property value. The following property +// returns a *int32 when successful +func (m *PrivateUser) GetFollowing()(*int32) { + return m.following +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *PrivateUser) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *PrivateUser) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *PrivateUser) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHireable gets the hireable property value. The hireable property +// returns a *bool when successful +func (m *PrivateUser) GetHireable()(*bool) { + return m.hireable +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PrivateUser) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PrivateUser) GetId()(*int64) { + return m.id +} +// GetLdapDn gets the ldap_dn property value. The ldap_dn property +// returns a *string when successful +func (m *PrivateUser) GetLdapDn()(*string) { + return m.ldap_dn +} +// GetLocation gets the location property value. The location property +// returns a *string when successful +func (m *PrivateUser) GetLocation()(*string) { + return m.location +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *PrivateUser) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PrivateUser) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PrivateUser) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationEmail gets the notification_email property value. The notification_email property +// returns a *string when successful +func (m *PrivateUser) GetNotificationEmail()(*string) { + return m.notification_email +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *PrivateUser) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetOwnedPrivateRepos gets the owned_private_repos property value. The owned_private_repos property +// returns a *int32 when successful +func (m *PrivateUser) GetOwnedPrivateRepos()(*int32) { + return m.owned_private_repos +} +// GetPlan gets the plan property value. The plan property +// returns a PrivateUser_planable when successful +func (m *PrivateUser) GetPlan()(PrivateUser_planable) { + return m.plan +} +// GetPrivateGists gets the private_gists property value. The private_gists property +// returns a *int32 when successful +func (m *PrivateUser) GetPrivateGists()(*int32) { + return m.private_gists +} +// GetPublicGists gets the public_gists property value. The public_gists property +// returns a *int32 when successful +func (m *PrivateUser) GetPublicGists()(*int32) { + return m.public_gists +} +// GetPublicRepos gets the public_repos property value. The public_repos property +// returns a *int32 when successful +func (m *PrivateUser) GetPublicRepos()(*int32) { + return m.public_repos +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *PrivateUser) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *PrivateUser) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *PrivateUser) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *PrivateUser) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *PrivateUser) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetSuspendedAt gets the suspended_at property value. The suspended_at property +// returns a *Time when successful +func (m *PrivateUser) GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.suspended_at +} +// GetTotalPrivateRepos gets the total_private_repos property value. The total_private_repos property +// returns a *int32 when successful +func (m *PrivateUser) GetTotalPrivateRepos()(*int32) { + return m.total_private_repos +} +// GetTwitterUsername gets the twitter_username property value. The twitter_username property +// returns a *string when successful +func (m *PrivateUser) GetTwitterUsername()(*string) { + return m.twitter_username +} +// GetTwoFactorAuthentication gets the two_factor_authentication property value. The two_factor_authentication property +// returns a *bool when successful +func (m *PrivateUser) GetTwoFactorAuthentication()(*bool) { + return m.two_factor_authentication +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *PrivateUser) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PrivateUser) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PrivateUser) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PrivateUser) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("bio", m.GetBio()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("business_plus", m.GetBusinessPlus()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("collaborators", m.GetCollaborators()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("disk_usage", m.GetDiskUsage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("followers", m.GetFollowers()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("following", m.GetFollowing()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("hireable", m.GetHireable()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ldap_dn", m.GetLdapDn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_email", m.GetNotificationEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("owned_private_repos", m.GetOwnedPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("plan", m.GetPlan()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_gists", m.GetPrivateGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_gists", m.GetPublicGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_repos", m.GetPublicRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("suspended_at", m.GetSuspendedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_private_repos", m.GetTotalPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("twitter_username", m.GetTwitterUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("two_factor_authentication", m.GetTwoFactorAuthentication()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PrivateUser) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *PrivateUser) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetBio sets the bio property value. The bio property +func (m *PrivateUser) SetBio(value *string)() { + m.bio = value +} +// SetBlog sets the blog property value. The blog property +func (m *PrivateUser) SetBlog(value *string)() { + m.blog = value +} +// SetBusinessPlus sets the business_plus property value. The business_plus property +func (m *PrivateUser) SetBusinessPlus(value *bool)() { + m.business_plus = value +} +// SetCollaborators sets the collaborators property value. The collaborators property +func (m *PrivateUser) SetCollaborators(value *int32)() { + m.collaborators = value +} +// SetCompany sets the company property value. The company property +func (m *PrivateUser) SetCompany(value *string)() { + m.company = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PrivateUser) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDiskUsage sets the disk_usage property value. The disk_usage property +func (m *PrivateUser) SetDiskUsage(value *int32)() { + m.disk_usage = value +} +// SetEmail sets the email property value. The email property +func (m *PrivateUser) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PrivateUser) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowers sets the followers property value. The followers property +func (m *PrivateUser) SetFollowers(value *int32)() { + m.followers = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *PrivateUser) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowing sets the following property value. The following property +func (m *PrivateUser) SetFollowing(value *int32)() { + m.following = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *PrivateUser) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *PrivateUser) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *PrivateUser) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHireable sets the hireable property value. The hireable property +func (m *PrivateUser) SetHireable(value *bool)() { + m.hireable = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PrivateUser) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PrivateUser) SetId(value *int64)() { + m.id = value +} +// SetLdapDn sets the ldap_dn property value. The ldap_dn property +func (m *PrivateUser) SetLdapDn(value *string)() { + m.ldap_dn = value +} +// SetLocation sets the location property value. The location property +func (m *PrivateUser) SetLocation(value *string)() { + m.location = value +} +// SetLogin sets the login property value. The login property +func (m *PrivateUser) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *PrivateUser) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PrivateUser) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationEmail sets the notification_email property value. The notification_email property +func (m *PrivateUser) SetNotificationEmail(value *string)() { + m.notification_email = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *PrivateUser) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetOwnedPrivateRepos sets the owned_private_repos property value. The owned_private_repos property +func (m *PrivateUser) SetOwnedPrivateRepos(value *int32)() { + m.owned_private_repos = value +} +// SetPlan sets the plan property value. The plan property +func (m *PrivateUser) SetPlan(value PrivateUser_planable)() { + m.plan = value +} +// SetPrivateGists sets the private_gists property value. The private_gists property +func (m *PrivateUser) SetPrivateGists(value *int32)() { + m.private_gists = value +} +// SetPublicGists sets the public_gists property value. The public_gists property +func (m *PrivateUser) SetPublicGists(value *int32)() { + m.public_gists = value +} +// SetPublicRepos sets the public_repos property value. The public_repos property +func (m *PrivateUser) SetPublicRepos(value *int32)() { + m.public_repos = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *PrivateUser) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *PrivateUser) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *PrivateUser) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *PrivateUser) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *PrivateUser) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetSuspendedAt sets the suspended_at property value. The suspended_at property +func (m *PrivateUser) SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.suspended_at = value +} +// SetTotalPrivateRepos sets the total_private_repos property value. The total_private_repos property +func (m *PrivateUser) SetTotalPrivateRepos(value *int32)() { + m.total_private_repos = value +} +// SetTwitterUsername sets the twitter_username property value. The twitter_username property +func (m *PrivateUser) SetTwitterUsername(value *string)() { + m.twitter_username = value +} +// SetTwoFactorAuthentication sets the two_factor_authentication property value. The two_factor_authentication property +func (m *PrivateUser) SetTwoFactorAuthentication(value *bool)() { + m.two_factor_authentication = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *PrivateUser) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PrivateUser) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PrivateUser) SetUrl(value *string)() { + m.url = value +} +type PrivateUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetBio()(*string) + GetBlog()(*string) + GetBusinessPlus()(*bool) + GetCollaborators()(*int32) + GetCompany()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDiskUsage()(*int32) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowers()(*int32) + GetFollowersUrl()(*string) + GetFollowing()(*int32) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHireable()(*bool) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLdapDn()(*string) + GetLocation()(*string) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationEmail()(*string) + GetOrganizationsUrl()(*string) + GetOwnedPrivateRepos()(*int32) + GetPlan()(PrivateUser_planable) + GetPrivateGists()(*int32) + GetPublicGists()(*int32) + GetPublicRepos()(*int32) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTotalPrivateRepos()(*int32) + GetTwitterUsername()(*string) + GetTwoFactorAuthentication()(*bool) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetBio(value *string)() + SetBlog(value *string)() + SetBusinessPlus(value *bool)() + SetCollaborators(value *int32)() + SetCompany(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDiskUsage(value *int32)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowers(value *int32)() + SetFollowersUrl(value *string)() + SetFollowing(value *int32)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHireable(value *bool)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLdapDn(value *string)() + SetLocation(value *string)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationEmail(value *string)() + SetOrganizationsUrl(value *string)() + SetOwnedPrivateRepos(value *int32)() + SetPlan(value PrivateUser_planable)() + SetPrivateGists(value *int32)() + SetPublicGists(value *int32)() + SetPublicRepos(value *int32)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTotalPrivateRepos(value *int32)() + SetTwitterUsername(value *string)() + SetTwoFactorAuthentication(value *bool)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/private_user_escaped_plan.go b/pkg/github/models/private_user_escaped_plan.go new file mode 100644 index 00000000..0ab80ac6 --- /dev/null +++ b/pkg/github/models/private_user_escaped_plan.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PrivateUser_plan 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 collaborators property + collaborators *int32 + // The name property + name *string + // The private_repos property + private_repos *int32 + // The space property + space *int32 +} +// NewPrivateUser_plan instantiates a new PrivateUser_plan and sets the default values. +func NewPrivateUser_plan()(*PrivateUser_plan) { + m := &PrivateUser_plan{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePrivateUser_planFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePrivateUser_planFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPrivateUser_plan(), 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 *PrivateUser_plan) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCollaborators gets the collaborators property value. The collaborators property +// returns a *int32 when successful +func (m *PrivateUser_plan) GetCollaborators()(*int32) { + return m.collaborators +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PrivateUser_plan) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["collaborators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCollaborators(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["private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateRepos(val) + } + return nil + } + res["space"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSpace(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PrivateUser_plan) GetName()(*string) { + return m.name +} +// GetPrivateRepos gets the private_repos property value. The private_repos property +// returns a *int32 when successful +func (m *PrivateUser_plan) GetPrivateRepos()(*int32) { + return m.private_repos +} +// GetSpace gets the space property value. The space property +// returns a *int32 when successful +func (m *PrivateUser_plan) GetSpace()(*int32) { + return m.space +} +// Serialize serializes information the current object +func (m *PrivateUser_plan) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("collaborators", m.GetCollaborators()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_repos", m.GetPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("space", m.GetSpace()) + 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 *PrivateUser_plan) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCollaborators sets the collaborators property value. The collaborators property +func (m *PrivateUser_plan) SetCollaborators(value *int32)() { + m.collaborators = value +} +// SetName sets the name property value. The name property +func (m *PrivateUser_plan) SetName(value *string)() { + m.name = value +} +// SetPrivateRepos sets the private_repos property value. The private_repos property +func (m *PrivateUser_plan) SetPrivateRepos(value *int32)() { + m.private_repos = value +} +// SetSpace sets the space property value. The space property +func (m *PrivateUser_plan) SetSpace(value *int32)() { + m.space = value +} +type PrivateUser_planable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCollaborators()(*int32) + GetName()(*string) + GetPrivateRepos()(*int32) + GetSpace()(*int32) + SetCollaborators(value *int32)() + SetName(value *string)() + SetPrivateRepos(value *int32)() + SetSpace(value *int32)() +} diff --git a/pkg/github/models/project.go b/pkg/github/models/project.go new file mode 100644 index 00000000..431310d5 --- /dev/null +++ b/pkg/github/models/project.go @@ -0,0 +1,489 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Project projects are a way to organize columns and cards of work. +type Project struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Body of the project + body *string + // The columns_url property + columns_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + creator NullableSimpleUserable + // The html_url property + html_url *string + // The id property + id *int32 + // Name of the project + name *string + // The node_id property + node_id *string + // The number property + number *int32 + // The baseline permission that all organization members have on this project. Only present if owner is an organization. + organization_permission *Project_organization_permission + // The owner_url property + owner_url *string + // Whether or not this project can be seen by everyone. Only present if owner is an organization. + private *bool + // State of the project; either 'open' or 'closed' + state *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewProject instantiates a new Project and sets the default values. +func NewProject()(*Project) { + m := &Project{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProjectFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProjectFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProject(), 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 *Project) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. Body of the project +// returns a *string when successful +func (m *Project) GetBody()(*string) { + return m.body +} +// GetColumnsUrl gets the columns_url property value. The columns_url property +// returns a *string when successful +func (m *Project) GetColumnsUrl()(*string) { + return m.columns_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Project) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Project) GetCreator()(NullableSimpleUserable) { + return m.creator +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Project) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["columns_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnsUrl(val) + } + return nil + } + 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["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(NullableSimpleUserable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["organization_permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseProject_organization_permission) + if err != nil { + return err + } + if val != nil { + m.SetOrganizationPermission(val.(*Project_organization_permission)) + } + return nil + } + res["owner_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOwnerUrl(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Project) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Project) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. Name of the project +// returns a *string when successful +func (m *Project) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Project) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *Project) GetNumber()(*int32) { + return m.number +} +// GetOrganizationPermission gets the organization_permission property value. The baseline permission that all organization members have on this project. Only present if owner is an organization. +// returns a *Project_organization_permission when successful +func (m *Project) GetOrganizationPermission()(*Project_organization_permission) { + return m.organization_permission +} +// GetOwnerUrl gets the owner_url property value. The owner_url property +// returns a *string when successful +func (m *Project) GetOwnerUrl()(*string) { + return m.owner_url +} +// GetPrivate gets the private property value. Whether or not this project can be seen by everyone. Only present if owner is an organization. +// returns a *bool when successful +func (m *Project) GetPrivate()(*bool) { + return m.private +} +// GetState gets the state property value. State of the project; either 'open' or 'closed' +// returns a *string when successful +func (m *Project) GetState()(*string) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Project) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Project) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Project) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("columns_url", m.GetColumnsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + if m.GetOrganizationPermission() != nil { + cast := (*m.GetOrganizationPermission()).String() + err := writer.WriteStringValue("organization_permission", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("owner_url", m.GetOwnerUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Project) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. Body of the project +func (m *Project) SetBody(value *string)() { + m.body = value +} +// SetColumnsUrl sets the columns_url property value. The columns_url property +func (m *Project) SetColumnsUrl(value *string)() { + m.columns_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Project) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *Project) SetCreator(value NullableSimpleUserable)() { + m.creator = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Project) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Project) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. Name of the project +func (m *Project) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Project) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The number property +func (m *Project) SetNumber(value *int32)() { + m.number = value +} +// SetOrganizationPermission sets the organization_permission property value. The baseline permission that all organization members have on this project. Only present if owner is an organization. +func (m *Project) SetOrganizationPermission(value *Project_organization_permission)() { + m.organization_permission = value +} +// SetOwnerUrl sets the owner_url property value. The owner_url property +func (m *Project) SetOwnerUrl(value *string)() { + m.owner_url = value +} +// SetPrivate sets the private property value. Whether or not this project can be seen by everyone. Only present if owner is an organization. +func (m *Project) SetPrivate(value *bool)() { + m.private = value +} +// SetState sets the state property value. State of the project; either 'open' or 'closed' +func (m *Project) SetState(value *string)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Project) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Project) SetUrl(value *string)() { + m.url = value +} +type Projectable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetColumnsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreator()(NullableSimpleUserable) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetNumber()(*int32) + GetOrganizationPermission()(*Project_organization_permission) + GetOwnerUrl()(*string) + GetPrivate()(*bool) + GetState()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetBody(value *string)() + SetColumnsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreator(value NullableSimpleUserable)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetOrganizationPermission(value *Project_organization_permission)() + SetOwnerUrl(value *string)() + SetPrivate(value *bool)() + SetState(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/project_card.go b/pkg/github/models/project_card.go new file mode 100644 index 00000000..16288b5c --- /dev/null +++ b/pkg/github/models/project_card.go @@ -0,0 +1,430 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProjectCard project cards represent a scope of work. +type ProjectCard 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 or not the card is archived + archived *bool + // The column_name property + column_name *string + // The column_url property + column_url *string + // The content_url property + content_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + creator NullableSimpleUserable + // The project card's ID + id *int64 + // The node_id property + node_id *string + // The note property + note *string + // The project_id property + project_id *string + // The project_url property + project_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewProjectCard instantiates a new ProjectCard and sets the default values. +func NewProjectCard()(*ProjectCard) { + m := &ProjectCard{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProjectCardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProjectCardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProjectCard(), 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 *ProjectCard) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchived gets the archived property value. Whether or not the card is archived +// returns a *bool when successful +func (m *ProjectCard) GetArchived()(*bool) { + return m.archived +} +// GetColumnName gets the column_name property value. The column_name property +// returns a *string when successful +func (m *ProjectCard) GetColumnName()(*string) { + return m.column_name +} +// GetColumnUrl gets the column_url property value. The column_url property +// returns a *string when successful +func (m *ProjectCard) GetColumnUrl()(*string) { + return m.column_url +} +// GetContentUrl gets the content_url property value. The content_url property +// returns a *string when successful +func (m *ProjectCard) GetContentUrl()(*string) { + return m.content_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *ProjectCard) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *ProjectCard) GetCreator()(NullableSimpleUserable) { + return m.creator +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProjectCard) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnName(val) + } + return nil + } + res["column_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnUrl(val) + } + return nil + } + res["content_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentUrl(val) + } + return nil + } + 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["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(NullableSimpleUserable)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["note"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNote(val) + } + return nil + } + res["project_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectId(val) + } + return nil + } + res["project_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectUrl(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The project card's ID +// returns a *int64 when successful +func (m *ProjectCard) GetId()(*int64) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ProjectCard) GetNodeId()(*string) { + return m.node_id +} +// GetNote gets the note property value. The note property +// returns a *string when successful +func (m *ProjectCard) GetNote()(*string) { + return m.note +} +// GetProjectId gets the project_id property value. The project_id property +// returns a *string when successful +func (m *ProjectCard) GetProjectId()(*string) { + return m.project_id +} +// GetProjectUrl gets the project_url property value. The project_url property +// returns a *string when successful +func (m *ProjectCard) GetProjectUrl()(*string) { + return m.project_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *ProjectCard) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProjectCard) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProjectCard) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("column_name", m.GetColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("column_url", m.GetColumnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("content_url", m.GetContentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note", m.GetNote()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_id", m.GetProjectId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_url", m.GetProjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProjectCard) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchived sets the archived property value. Whether or not the card is archived +func (m *ProjectCard) SetArchived(value *bool)() { + m.archived = value +} +// SetColumnName sets the column_name property value. The column_name property +func (m *ProjectCard) SetColumnName(value *string)() { + m.column_name = value +} +// SetColumnUrl sets the column_url property value. The column_url property +func (m *ProjectCard) SetColumnUrl(value *string)() { + m.column_url = value +} +// SetContentUrl sets the content_url property value. The content_url property +func (m *ProjectCard) SetContentUrl(value *string)() { + m.content_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ProjectCard) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *ProjectCard) SetCreator(value NullableSimpleUserable)() { + m.creator = value +} +// SetId sets the id property value. The project card's ID +func (m *ProjectCard) SetId(value *int64)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ProjectCard) SetNodeId(value *string)() { + m.node_id = value +} +// SetNote sets the note property value. The note property +func (m *ProjectCard) SetNote(value *string)() { + m.note = value +} +// SetProjectId sets the project_id property value. The project_id property +func (m *ProjectCard) SetProjectId(value *string)() { + m.project_id = value +} +// SetProjectUrl sets the project_url property value. The project_url property +func (m *ProjectCard) SetProjectUrl(value *string)() { + m.project_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *ProjectCard) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *ProjectCard) SetUrl(value *string)() { + m.url = value +} +type ProjectCardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchived()(*bool) + GetColumnName()(*string) + GetColumnUrl()(*string) + GetContentUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreator()(NullableSimpleUserable) + GetId()(*int64) + GetNodeId()(*string) + GetNote()(*string) + GetProjectId()(*string) + GetProjectUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetArchived(value *bool)() + SetColumnName(value *string)() + SetColumnUrl(value *string)() + SetContentUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreator(value NullableSimpleUserable)() + SetId(value *int64)() + SetNodeId(value *string)() + SetNote(value *string)() + SetProjectId(value *string)() + SetProjectUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/project_collaborator_permission.go b/pkg/github/models/project_collaborator_permission.go new file mode 100644 index 00000000..d78be0ff --- /dev/null +++ b/pkg/github/models/project_collaborator_permission.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProjectCollaboratorPermission project Collaborator Permission +type ProjectCollaboratorPermission 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 permission property + permission *string + // A GitHub user. + user NullableSimpleUserable +} +// NewProjectCollaboratorPermission instantiates a new ProjectCollaboratorPermission and sets the default values. +func NewProjectCollaboratorPermission()(*ProjectCollaboratorPermission) { + m := &ProjectCollaboratorPermission{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProjectCollaboratorPermissionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProjectCollaboratorPermissionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProjectCollaboratorPermission(), 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 *ProjectCollaboratorPermission) 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 *ProjectCollaboratorPermission) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetPermission gets the permission property value. The permission property +// returns a *string when successful +func (m *ProjectCollaboratorPermission) GetPermission()(*string) { + return m.permission +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *ProjectCollaboratorPermission) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *ProjectCollaboratorPermission) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *ProjectCollaboratorPermission) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPermission sets the permission property value. The permission property +func (m *ProjectCollaboratorPermission) SetPermission(value *string)() { + m.permission = value +} +// SetUser sets the user property value. A GitHub user. +func (m *ProjectCollaboratorPermission) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type ProjectCollaboratorPermissionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPermission()(*string) + GetUser()(NullableSimpleUserable) + SetPermission(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/project_column.go b/pkg/github/models/project_column.go new file mode 100644 index 00000000..27059199 --- /dev/null +++ b/pkg/github/models/project_column.go @@ -0,0 +1,285 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProjectColumn project columns contain cards of work. +type ProjectColumn 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 cards_url property + cards_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The unique identifier of the project column + id *int32 + // Name of the project column + name *string + // The node_id property + node_id *string + // The project_url property + project_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewProjectColumn instantiates a new ProjectColumn and sets the default values. +func NewProjectColumn()(*ProjectColumn) { + m := &ProjectColumn{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProjectColumnFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProjectColumnFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProjectColumn(), 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 *ProjectColumn) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCardsUrl gets the cards_url property value. The cards_url property +// returns a *string when successful +func (m *ProjectColumn) GetCardsUrl()(*string) { + return m.cards_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *ProjectColumn) 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 *ProjectColumn) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cards_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCardsUrl(val) + } + return nil + } + 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["project_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectUrl(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The unique identifier of the project column +// returns a *int32 when successful +func (m *ProjectColumn) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. Name of the project column +// returns a *string when successful +func (m *ProjectColumn) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ProjectColumn) GetNodeId()(*string) { + return m.node_id +} +// GetProjectUrl gets the project_url property value. The project_url property +// returns a *string when successful +func (m *ProjectColumn) GetProjectUrl()(*string) { + return m.project_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *ProjectColumn) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProjectColumn) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProjectColumn) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("cards_url", m.GetCardsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_url", m.GetProjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProjectColumn) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCardsUrl sets the cards_url property value. The cards_url property +func (m *ProjectColumn) SetCardsUrl(value *string)() { + m.cards_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ProjectColumn) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The unique identifier of the project column +func (m *ProjectColumn) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. Name of the project column +func (m *ProjectColumn) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ProjectColumn) SetNodeId(value *string)() { + m.node_id = value +} +// SetProjectUrl sets the project_url property value. The project_url property +func (m *ProjectColumn) SetProjectUrl(value *string)() { + m.project_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *ProjectColumn) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *ProjectColumn) SetUrl(value *string)() { + m.url = value +} +type ProjectColumnable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCardsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetProjectUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCardsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetProjectUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/project_escaped_organization_escaped_permission.go b/pkg/github/models/project_escaped_organization_escaped_permission.go new file mode 100644 index 00000000..3dea708e --- /dev/null +++ b/pkg/github/models/project_escaped_organization_escaped_permission.go @@ -0,0 +1,40 @@ +package models +// The baseline permission that all organization members have on this project. Only present if owner is an organization. +type Project_organization_permission int + +const ( + READ_PROJECT_ORGANIZATION_PERMISSION Project_organization_permission = iota + WRITE_PROJECT_ORGANIZATION_PERMISSION + ADMIN_PROJECT_ORGANIZATION_PERMISSION + NONE_PROJECT_ORGANIZATION_PERMISSION +) + +func (i Project_organization_permission) String() string { + return []string{"read", "write", "admin", "none"}[i] +} +func ParseProject_organization_permission(v string) (any, error) { + result := READ_PROJECT_ORGANIZATION_PERMISSION + switch v { + case "read": + result = READ_PROJECT_ORGANIZATION_PERMISSION + case "write": + result = WRITE_PROJECT_ORGANIZATION_PERMISSION + case "admin": + result = ADMIN_PROJECT_ORGANIZATION_PERMISSION + case "none": + result = NONE_PROJECT_ORGANIZATION_PERMISSION + default: + return nil, nil + } + return &result, nil +} +func SerializeProject_organization_permission(values []Project_organization_permission) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Project_organization_permission) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/protected_branch.go b/pkg/github/models/protected_branch.go new file mode 100644 index 00000000..370d5b6e --- /dev/null +++ b/pkg/github/models/protected_branch.go @@ -0,0 +1,429 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProtectedBranch branch protections protect branches +type ProtectedBranch 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 allow_deletions property + allow_deletions ProtectedBranch_allow_deletionsable + // The allow_force_pushes property + allow_force_pushes ProtectedBranch_allow_force_pushesable + // Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. + allow_fork_syncing ProtectedBranch_allow_fork_syncingable + // The block_creations property + block_creations ProtectedBranch_block_creationsable + // The enforce_admins property + enforce_admins ProtectedBranch_enforce_adminsable + // Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. + lock_branch ProtectedBranch_lock_branchable + // The required_conversation_resolution property + required_conversation_resolution ProtectedBranch_required_conversation_resolutionable + // The required_linear_history property + required_linear_history ProtectedBranch_required_linear_historyable + // The required_pull_request_reviews property + required_pull_request_reviews ProtectedBranch_required_pull_request_reviewsable + // The required_signatures property + required_signatures ProtectedBranch_required_signaturesable + // Status Check Policy + required_status_checks StatusCheckPolicyable + // Branch Restriction Policy + restrictions BranchRestrictionPolicyable + // The url property + url *string +} +// NewProtectedBranch instantiates a new ProtectedBranch and sets the default values. +func NewProtectedBranch()(*ProtectedBranch) { + m := &ProtectedBranch{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranchFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranchFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch(), 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 *ProtectedBranch) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowDeletions gets the allow_deletions property value. The allow_deletions property +// returns a ProtectedBranch_allow_deletionsable when successful +func (m *ProtectedBranch) GetAllowDeletions()(ProtectedBranch_allow_deletionsable) { + return m.allow_deletions +} +// GetAllowForcePushes gets the allow_force_pushes property value. The allow_force_pushes property +// returns a ProtectedBranch_allow_force_pushesable when successful +func (m *ProtectedBranch) GetAllowForcePushes()(ProtectedBranch_allow_force_pushesable) { + return m.allow_force_pushes +} +// GetAllowForkSyncing gets the allow_fork_syncing property value. Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. +// returns a ProtectedBranch_allow_fork_syncingable when successful +func (m *ProtectedBranch) GetAllowForkSyncing()(ProtectedBranch_allow_fork_syncingable) { + return m.allow_fork_syncing +} +// GetBlockCreations gets the block_creations property value. The block_creations property +// returns a ProtectedBranch_block_creationsable when successful +func (m *ProtectedBranch) GetBlockCreations()(ProtectedBranch_block_creationsable) { + return m.block_creations +} +// GetEnforceAdmins gets the enforce_admins property value. The enforce_admins property +// returns a ProtectedBranch_enforce_adminsable when successful +func (m *ProtectedBranch) GetEnforceAdmins()(ProtectedBranch_enforce_adminsable) { + return m.enforce_admins +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_allow_deletionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAllowDeletions(val.(ProtectedBranch_allow_deletionsable)) + } + return nil + } + res["allow_force_pushes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_allow_force_pushesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAllowForcePushes(val.(ProtectedBranch_allow_force_pushesable)) + } + return nil + } + res["allow_fork_syncing"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_allow_fork_syncingFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAllowForkSyncing(val.(ProtectedBranch_allow_fork_syncingable)) + } + return nil + } + res["block_creations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_block_creationsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBlockCreations(val.(ProtectedBranch_block_creationsable)) + } + return nil + } + res["enforce_admins"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_enforce_adminsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetEnforceAdmins(val.(ProtectedBranch_enforce_adminsable)) + } + return nil + } + res["lock_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_lock_branchFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLockBranch(val.(ProtectedBranch_lock_branchable)) + } + return nil + } + res["required_conversation_resolution"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_required_conversation_resolutionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredConversationResolution(val.(ProtectedBranch_required_conversation_resolutionable)) + } + return nil + } + res["required_linear_history"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_required_linear_historyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredLinearHistory(val.(ProtectedBranch_required_linear_historyable)) + } + return nil + } + res["required_pull_request_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_required_pull_request_reviewsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredPullRequestReviews(val.(ProtectedBranch_required_pull_request_reviewsable)) + } + return nil + } + res["required_signatures"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_required_signaturesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredSignatures(val.(ProtectedBranch_required_signaturesable)) + } + return nil + } + res["required_status_checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateStatusCheckPolicyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredStatusChecks(val.(StatusCheckPolicyable)) + } + return nil + } + res["restrictions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchRestrictionPolicyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRestrictions(val.(BranchRestrictionPolicyable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetLockBranch gets the lock_branch property value. Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. +// returns a ProtectedBranch_lock_branchable when successful +func (m *ProtectedBranch) GetLockBranch()(ProtectedBranch_lock_branchable) { + return m.lock_branch +} +// GetRequiredConversationResolution gets the required_conversation_resolution property value. The required_conversation_resolution property +// returns a ProtectedBranch_required_conversation_resolutionable when successful +func (m *ProtectedBranch) GetRequiredConversationResolution()(ProtectedBranch_required_conversation_resolutionable) { + return m.required_conversation_resolution +} +// GetRequiredLinearHistory gets the required_linear_history property value. The required_linear_history property +// returns a ProtectedBranch_required_linear_historyable when successful +func (m *ProtectedBranch) GetRequiredLinearHistory()(ProtectedBranch_required_linear_historyable) { + return m.required_linear_history +} +// GetRequiredPullRequestReviews gets the required_pull_request_reviews property value. The required_pull_request_reviews property +// returns a ProtectedBranch_required_pull_request_reviewsable when successful +func (m *ProtectedBranch) GetRequiredPullRequestReviews()(ProtectedBranch_required_pull_request_reviewsable) { + return m.required_pull_request_reviews +} +// GetRequiredSignatures gets the required_signatures property value. The required_signatures property +// returns a ProtectedBranch_required_signaturesable when successful +func (m *ProtectedBranch) GetRequiredSignatures()(ProtectedBranch_required_signaturesable) { + return m.required_signatures +} +// GetRequiredStatusChecks gets the required_status_checks property value. Status Check Policy +// returns a StatusCheckPolicyable when successful +func (m *ProtectedBranch) GetRequiredStatusChecks()(StatusCheckPolicyable) { + return m.required_status_checks +} +// GetRestrictions gets the restrictions property value. Branch Restriction Policy +// returns a BranchRestrictionPolicyable when successful +func (m *ProtectedBranch) GetRestrictions()(BranchRestrictionPolicyable) { + return m.restrictions +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranch) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProtectedBranch) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("allow_deletions", m.GetAllowDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("allow_force_pushes", m.GetAllowForcePushes()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("allow_fork_syncing", m.GetAllowForkSyncing()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("block_creations", m.GetBlockCreations()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("enforce_admins", m.GetEnforceAdmins()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("lock_branch", m.GetLockBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_conversation_resolution", m.GetRequiredConversationResolution()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_linear_history", m.GetRequiredLinearHistory()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_pull_request_reviews", m.GetRequiredPullRequestReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_signatures", m.GetRequiredSignatures()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_status_checks", m.GetRequiredStatusChecks()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("restrictions", m.GetRestrictions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProtectedBranch) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowDeletions sets the allow_deletions property value. The allow_deletions property +func (m *ProtectedBranch) SetAllowDeletions(value ProtectedBranch_allow_deletionsable)() { + m.allow_deletions = value +} +// SetAllowForcePushes sets the allow_force_pushes property value. The allow_force_pushes property +func (m *ProtectedBranch) SetAllowForcePushes(value ProtectedBranch_allow_force_pushesable)() { + m.allow_force_pushes = value +} +// SetAllowForkSyncing sets the allow_fork_syncing property value. Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. +func (m *ProtectedBranch) SetAllowForkSyncing(value ProtectedBranch_allow_fork_syncingable)() { + m.allow_fork_syncing = value +} +// SetBlockCreations sets the block_creations property value. The block_creations property +func (m *ProtectedBranch) SetBlockCreations(value ProtectedBranch_block_creationsable)() { + m.block_creations = value +} +// SetEnforceAdmins sets the enforce_admins property value. The enforce_admins property +func (m *ProtectedBranch) SetEnforceAdmins(value ProtectedBranch_enforce_adminsable)() { + m.enforce_admins = value +} +// SetLockBranch sets the lock_branch property value. Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. +func (m *ProtectedBranch) SetLockBranch(value ProtectedBranch_lock_branchable)() { + m.lock_branch = value +} +// SetRequiredConversationResolution sets the required_conversation_resolution property value. The required_conversation_resolution property +func (m *ProtectedBranch) SetRequiredConversationResolution(value ProtectedBranch_required_conversation_resolutionable)() { + m.required_conversation_resolution = value +} +// SetRequiredLinearHistory sets the required_linear_history property value. The required_linear_history property +func (m *ProtectedBranch) SetRequiredLinearHistory(value ProtectedBranch_required_linear_historyable)() { + m.required_linear_history = value +} +// SetRequiredPullRequestReviews sets the required_pull_request_reviews property value. The required_pull_request_reviews property +func (m *ProtectedBranch) SetRequiredPullRequestReviews(value ProtectedBranch_required_pull_request_reviewsable)() { + m.required_pull_request_reviews = value +} +// SetRequiredSignatures sets the required_signatures property value. The required_signatures property +func (m *ProtectedBranch) SetRequiredSignatures(value ProtectedBranch_required_signaturesable)() { + m.required_signatures = value +} +// SetRequiredStatusChecks sets the required_status_checks property value. Status Check Policy +func (m *ProtectedBranch) SetRequiredStatusChecks(value StatusCheckPolicyable)() { + m.required_status_checks = value +} +// SetRestrictions sets the restrictions property value. Branch Restriction Policy +func (m *ProtectedBranch) SetRestrictions(value BranchRestrictionPolicyable)() { + m.restrictions = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranch) SetUrl(value *string)() { + m.url = value +} +type ProtectedBranchable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowDeletions()(ProtectedBranch_allow_deletionsable) + GetAllowForcePushes()(ProtectedBranch_allow_force_pushesable) + GetAllowForkSyncing()(ProtectedBranch_allow_fork_syncingable) + GetBlockCreations()(ProtectedBranch_block_creationsable) + GetEnforceAdmins()(ProtectedBranch_enforce_adminsable) + GetLockBranch()(ProtectedBranch_lock_branchable) + GetRequiredConversationResolution()(ProtectedBranch_required_conversation_resolutionable) + GetRequiredLinearHistory()(ProtectedBranch_required_linear_historyable) + GetRequiredPullRequestReviews()(ProtectedBranch_required_pull_request_reviewsable) + GetRequiredSignatures()(ProtectedBranch_required_signaturesable) + GetRequiredStatusChecks()(StatusCheckPolicyable) + GetRestrictions()(BranchRestrictionPolicyable) + GetUrl()(*string) + SetAllowDeletions(value ProtectedBranch_allow_deletionsable)() + SetAllowForcePushes(value ProtectedBranch_allow_force_pushesable)() + SetAllowForkSyncing(value ProtectedBranch_allow_fork_syncingable)() + SetBlockCreations(value ProtectedBranch_block_creationsable)() + SetEnforceAdmins(value ProtectedBranch_enforce_adminsable)() + SetLockBranch(value ProtectedBranch_lock_branchable)() + SetRequiredConversationResolution(value ProtectedBranch_required_conversation_resolutionable)() + SetRequiredLinearHistory(value ProtectedBranch_required_linear_historyable)() + SetRequiredPullRequestReviews(value ProtectedBranch_required_pull_request_reviewsable)() + SetRequiredSignatures(value ProtectedBranch_required_signaturesable)() + SetRequiredStatusChecks(value StatusCheckPolicyable)() + SetRestrictions(value BranchRestrictionPolicyable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/protected_branch_admin_enforced.go b/pkg/github/models/protected_branch_admin_enforced.go new file mode 100644 index 00000000..589a4a8c --- /dev/null +++ b/pkg/github/models/protected_branch_admin_enforced.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProtectedBranchAdminEnforced protected Branch Admin Enforced +type ProtectedBranchAdminEnforced 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 enabled property + enabled *bool + // The url property + url *string +} +// NewProtectedBranchAdminEnforced instantiates a new ProtectedBranchAdminEnforced and sets the default values. +func NewProtectedBranchAdminEnforced()(*ProtectedBranchAdminEnforced) { + m := &ProtectedBranchAdminEnforced{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranchAdminEnforcedFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranchAdminEnforcedFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranchAdminEnforced(), 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 *ProtectedBranchAdminEnforced) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranchAdminEnforced) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranchAdminEnforced) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranchAdminEnforced) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProtectedBranchAdminEnforced) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProtectedBranchAdminEnforced) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranchAdminEnforced) SetEnabled(value *bool)() { + m.enabled = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranchAdminEnforced) SetUrl(value *string)() { + m.url = value +} +type ProtectedBranchAdminEnforcedable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetUrl()(*string) + SetEnabled(value *bool)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/protected_branch_escaped_allow_escaped_deletions.go b/pkg/github/models/protected_branch_escaped_allow_escaped_deletions.go new file mode 100644 index 00000000..48469742 --- /dev/null +++ b/pkg/github/models/protected_branch_escaped_allow_escaped_deletions.go @@ -0,0 +1,61 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_allow_deletions struct { + // The enabled property + enabled *bool +} +// NewProtectedBranch_allow_deletions instantiates a new ProtectedBranch_allow_deletions and sets the default values. +func NewProtectedBranch_allow_deletions()(*ProtectedBranch_allow_deletions) { + m := &ProtectedBranch_allow_deletions{ + } + return m +} +// CreateProtectedBranch_allow_deletionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_allow_deletionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_allow_deletions(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_allow_deletions) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_allow_deletions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranch_allow_deletions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_allow_deletions) SetEnabled(value *bool)() { + m.enabled = value +} +type ProtectedBranch_allow_deletionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/protected_branch_escaped_allow_escaped_force_escaped_pushes.go b/pkg/github/models/protected_branch_escaped_allow_escaped_force_escaped_pushes.go new file mode 100644 index 00000000..b047ac9e --- /dev/null +++ b/pkg/github/models/protected_branch_escaped_allow_escaped_force_escaped_pushes.go @@ -0,0 +1,61 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_allow_force_pushes struct { + // The enabled property + enabled *bool +} +// NewProtectedBranch_allow_force_pushes instantiates a new ProtectedBranch_allow_force_pushes and sets the default values. +func NewProtectedBranch_allow_force_pushes()(*ProtectedBranch_allow_force_pushes) { + m := &ProtectedBranch_allow_force_pushes{ + } + return m +} +// CreateProtectedBranch_allow_force_pushesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_allow_force_pushesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_allow_force_pushes(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_allow_force_pushes) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_allow_force_pushes) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranch_allow_force_pushes) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_allow_force_pushes) SetEnabled(value *bool)() { + m.enabled = value +} +type ProtectedBranch_allow_force_pushesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/protected_branch_escaped_allow_escaped_fork_escaped_syncing.go b/pkg/github/models/protected_branch_escaped_allow_escaped_fork_escaped_syncing.go new file mode 100644 index 00000000..9cb77625 --- /dev/null +++ b/pkg/github/models/protected_branch_escaped_allow_escaped_fork_escaped_syncing.go @@ -0,0 +1,62 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProtectedBranch_allow_fork_syncing whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. +type ProtectedBranch_allow_fork_syncing struct { + // The enabled property + enabled *bool +} +// NewProtectedBranch_allow_fork_syncing instantiates a new ProtectedBranch_allow_fork_syncing and sets the default values. +func NewProtectedBranch_allow_fork_syncing()(*ProtectedBranch_allow_fork_syncing) { + m := &ProtectedBranch_allow_fork_syncing{ + } + return m +} +// CreateProtectedBranch_allow_fork_syncingFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_allow_fork_syncingFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_allow_fork_syncing(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_allow_fork_syncing) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_allow_fork_syncing) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranch_allow_fork_syncing) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_allow_fork_syncing) SetEnabled(value *bool)() { + m.enabled = value +} +type ProtectedBranch_allow_fork_syncingable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/protected_branch_escaped_block_escaped_creations.go b/pkg/github/models/protected_branch_escaped_block_escaped_creations.go new file mode 100644 index 00000000..584d8f04 --- /dev/null +++ b/pkg/github/models/protected_branch_escaped_block_escaped_creations.go @@ -0,0 +1,61 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_block_creations struct { + // The enabled property + enabled *bool +} +// NewProtectedBranch_block_creations instantiates a new ProtectedBranch_block_creations and sets the default values. +func NewProtectedBranch_block_creations()(*ProtectedBranch_block_creations) { + m := &ProtectedBranch_block_creations{ + } + return m +} +// CreateProtectedBranch_block_creationsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_block_creationsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_block_creations(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_block_creations) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_block_creations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranch_block_creations) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_block_creations) SetEnabled(value *bool)() { + m.enabled = value +} +type ProtectedBranch_block_creationsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/protected_branch_escaped_enforce_escaped_admins.go b/pkg/github/models/protected_branch_escaped_enforce_escaped_admins.go new file mode 100644 index 00000000..82f42d3d --- /dev/null +++ b/pkg/github/models/protected_branch_escaped_enforce_escaped_admins.go @@ -0,0 +1,90 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_enforce_admins struct { + // The enabled property + enabled *bool + // The url property + url *string +} +// NewProtectedBranch_enforce_admins instantiates a new ProtectedBranch_enforce_admins and sets the default values. +func NewProtectedBranch_enforce_admins()(*ProtectedBranch_enforce_admins) { + m := &ProtectedBranch_enforce_admins{ + } + return m +} +// CreateProtectedBranch_enforce_adminsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_enforce_adminsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_enforce_admins(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_enforce_admins) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_enforce_admins) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranch_enforce_admins) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProtectedBranch_enforce_admins) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_enforce_admins) SetEnabled(value *bool)() { + m.enabled = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranch_enforce_admins) SetUrl(value *string)() { + m.url = value +} +type ProtectedBranch_enforce_adminsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetUrl()(*string) + SetEnabled(value *bool)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/protected_branch_escaped_lock_escaped_branch.go b/pkg/github/models/protected_branch_escaped_lock_escaped_branch.go new file mode 100644 index 00000000..4dc414f0 --- /dev/null +++ b/pkg/github/models/protected_branch_escaped_lock_escaped_branch.go @@ -0,0 +1,62 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProtectedBranch_lock_branch whether to set the branch as read-only. If this is true, users will not be able to push to the branch. +type ProtectedBranch_lock_branch struct { + // The enabled property + enabled *bool +} +// NewProtectedBranch_lock_branch instantiates a new ProtectedBranch_lock_branch and sets the default values. +func NewProtectedBranch_lock_branch()(*ProtectedBranch_lock_branch) { + m := &ProtectedBranch_lock_branch{ + } + return m +} +// CreateProtectedBranch_lock_branchFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_lock_branchFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_lock_branch(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_lock_branch) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_lock_branch) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranch_lock_branch) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_lock_branch) SetEnabled(value *bool)() { + m.enabled = value +} +type ProtectedBranch_lock_branchable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/protected_branch_escaped_required_escaped_conversation_escaped_resolution.go b/pkg/github/models/protected_branch_escaped_required_escaped_conversation_escaped_resolution.go new file mode 100644 index 00000000..9501e4cb --- /dev/null +++ b/pkg/github/models/protected_branch_escaped_required_escaped_conversation_escaped_resolution.go @@ -0,0 +1,61 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_required_conversation_resolution struct { + // The enabled property + enabled *bool +} +// NewProtectedBranch_required_conversation_resolution instantiates a new ProtectedBranch_required_conversation_resolution and sets the default values. +func NewProtectedBranch_required_conversation_resolution()(*ProtectedBranch_required_conversation_resolution) { + m := &ProtectedBranch_required_conversation_resolution{ + } + return m +} +// CreateProtectedBranch_required_conversation_resolutionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_required_conversation_resolutionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_required_conversation_resolution(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_required_conversation_resolution) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_required_conversation_resolution) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranch_required_conversation_resolution) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_required_conversation_resolution) SetEnabled(value *bool)() { + m.enabled = value +} +type ProtectedBranch_required_conversation_resolutionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/protected_branch_escaped_required_escaped_linear_escaped_history.go b/pkg/github/models/protected_branch_escaped_required_escaped_linear_escaped_history.go new file mode 100644 index 00000000..eebaf842 --- /dev/null +++ b/pkg/github/models/protected_branch_escaped_required_escaped_linear_escaped_history.go @@ -0,0 +1,61 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_required_linear_history struct { + // The enabled property + enabled *bool +} +// NewProtectedBranch_required_linear_history instantiates a new ProtectedBranch_required_linear_history and sets the default values. +func NewProtectedBranch_required_linear_history()(*ProtectedBranch_required_linear_history) { + m := &ProtectedBranch_required_linear_history{ + } + return m +} +// CreateProtectedBranch_required_linear_historyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_required_linear_historyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_required_linear_history(), nil +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_required_linear_history) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_required_linear_history) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranch_required_linear_history) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + return nil +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_required_linear_history) SetEnabled(value *bool)() { + m.enabled = value +} +type ProtectedBranch_required_linear_historyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + SetEnabled(value *bool)() +} diff --git a/pkg/github/models/protected_branch_escaped_required_escaped_pull_escaped_request_escaped_reviews.go b/pkg/github/models/protected_branch_escaped_required_escaped_pull_escaped_request_escaped_reviews.go new file mode 100644 index 00000000..acc2ee23 --- /dev/null +++ b/pkg/github/models/protected_branch_escaped_required_escaped_pull_escaped_request_escaped_reviews.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_required_pull_request_reviews 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 bypass_pull_request_allowances property + bypass_pull_request_allowances ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable + // The dismiss_stale_reviews property + dismiss_stale_reviews *bool + // The dismissal_restrictions property + dismissal_restrictions ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable + // The require_code_owner_reviews property + require_code_owner_reviews *bool + // Whether the most recent push must be approved by someone other than the person who pushed it. + require_last_push_approval *bool + // The required_approving_review_count property + required_approving_review_count *int32 + // The url property + url *string +} +// NewProtectedBranch_required_pull_request_reviews instantiates a new ProtectedBranch_required_pull_request_reviews and sets the default values. +func NewProtectedBranch_required_pull_request_reviews()(*ProtectedBranch_required_pull_request_reviews) { + m := &ProtectedBranch_required_pull_request_reviews{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranch_required_pull_request_reviewsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_required_pull_request_reviewsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_required_pull_request_reviews(), 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 *ProtectedBranch_required_pull_request_reviews) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassPullRequestAllowances gets the bypass_pull_request_allowances property value. The bypass_pull_request_allowances property +// returns a ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetBypassPullRequestAllowances()(ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable) { + return m.bypass_pull_request_allowances +} +// GetDismissalRestrictions gets the dismissal_restrictions property value. The dismissal_restrictions property +// returns a ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetDismissalRestrictions()(ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable) { + return m.dismissal_restrictions +} +// GetDismissStaleReviews gets the dismiss_stale_reviews property value. The dismiss_stale_reviews property +// returns a *bool when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetDismissStaleReviews()(*bool) { + return m.dismiss_stale_reviews +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_pull_request_allowances"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBypassPullRequestAllowances(val.(ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable)) + } + return nil + } + res["dismiss_stale_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissStaleReviews(val) + } + return nil + } + res["dismissal_restrictions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranch_required_pull_request_reviews_dismissal_restrictionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissalRestrictions(val.(ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable)) + } + return nil + } + res["require_code_owner_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireCodeOwnerReviews(val) + } + return nil + } + res["require_last_push_approval"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireLastPushApproval(val) + } + return nil + } + res["required_approving_review_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRequiredApprovingReviewCount(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetRequireCodeOwnerReviews gets the require_code_owner_reviews property value. The require_code_owner_reviews property +// returns a *bool when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetRequireCodeOwnerReviews()(*bool) { + return m.require_code_owner_reviews +} +// GetRequiredApprovingReviewCount gets the required_approving_review_count property value. The required_approving_review_count property +// returns a *int32 when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetRequiredApprovingReviewCount()(*int32) { + return m.required_approving_review_count +} +// GetRequireLastPushApproval gets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. +// returns a *bool when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetRequireLastPushApproval()(*bool) { + return m.require_last_push_approval +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranch_required_pull_request_reviews) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProtectedBranch_required_pull_request_reviews) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("bypass_pull_request_allowances", m.GetBypassPullRequestAllowances()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dismissal_restrictions", m.GetDismissalRestrictions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dismiss_stale_reviews", m.GetDismissStaleReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("required_approving_review_count", m.GetRequiredApprovingReviewCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_code_owner_reviews", m.GetRequireCodeOwnerReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_last_push_approval", m.GetRequireLastPushApproval()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProtectedBranch_required_pull_request_reviews) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassPullRequestAllowances sets the bypass_pull_request_allowances property value. The bypass_pull_request_allowances property +func (m *ProtectedBranch_required_pull_request_reviews) SetBypassPullRequestAllowances(value ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable)() { + m.bypass_pull_request_allowances = value +} +// SetDismissalRestrictions sets the dismissal_restrictions property value. The dismissal_restrictions property +func (m *ProtectedBranch_required_pull_request_reviews) SetDismissalRestrictions(value ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable)() { + m.dismissal_restrictions = value +} +// SetDismissStaleReviews sets the dismiss_stale_reviews property value. The dismiss_stale_reviews property +func (m *ProtectedBranch_required_pull_request_reviews) SetDismissStaleReviews(value *bool)() { + m.dismiss_stale_reviews = value +} +// SetRequireCodeOwnerReviews sets the require_code_owner_reviews property value. The require_code_owner_reviews property +func (m *ProtectedBranch_required_pull_request_reviews) SetRequireCodeOwnerReviews(value *bool)() { + m.require_code_owner_reviews = value +} +// SetRequiredApprovingReviewCount sets the required_approving_review_count property value. The required_approving_review_count property +func (m *ProtectedBranch_required_pull_request_reviews) SetRequiredApprovingReviewCount(value *int32)() { + m.required_approving_review_count = value +} +// SetRequireLastPushApproval sets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. +func (m *ProtectedBranch_required_pull_request_reviews) SetRequireLastPushApproval(value *bool)() { + m.require_last_push_approval = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranch_required_pull_request_reviews) SetUrl(value *string)() { + m.url = value +} +type ProtectedBranch_required_pull_request_reviewsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassPullRequestAllowances()(ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable) + GetDismissalRestrictions()(ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable) + GetDismissStaleReviews()(*bool) + GetRequireCodeOwnerReviews()(*bool) + GetRequiredApprovingReviewCount()(*int32) + GetRequireLastPushApproval()(*bool) + GetUrl()(*string) + SetBypassPullRequestAllowances(value ProtectedBranch_required_pull_request_reviews_bypass_pull_request_allowancesable)() + SetDismissalRestrictions(value ProtectedBranch_required_pull_request_reviews_dismissal_restrictionsable)() + SetDismissStaleReviews(value *bool)() + SetRequireCodeOwnerReviews(value *bool)() + SetRequiredApprovingReviewCount(value *int32)() + SetRequireLastPushApproval(value *bool)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/protected_branch_escaped_required_escaped_signatures.go b/pkg/github/models/protected_branch_escaped_required_escaped_signatures.go new file mode 100644 index 00000000..67d7575e --- /dev/null +++ b/pkg/github/models/protected_branch_escaped_required_escaped_signatures.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranch_required_signatures 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 enabled property + enabled *bool + // The url property + url *string +} +// NewProtectedBranch_required_signatures instantiates a new ProtectedBranch_required_signatures and sets the default values. +func NewProtectedBranch_required_signatures()(*ProtectedBranch_required_signatures) { + m := &ProtectedBranch_required_signatures{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranch_required_signaturesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranch_required_signaturesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranch_required_signatures(), 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 *ProtectedBranch_required_signatures) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *ProtectedBranch_required_signatures) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranch_required_signatures) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranch_required_signatures) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProtectedBranch_required_signatures) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProtectedBranch_required_signatures) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *ProtectedBranch_required_signatures) SetEnabled(value *bool)() { + m.enabled = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranch_required_signatures) SetUrl(value *string)() { + m.url = value +} +type ProtectedBranch_required_signaturesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnabled()(*bool) + GetUrl()(*string) + SetEnabled(value *bool)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/protected_branch_pull_request_review.go b/pkg/github/models/protected_branch_pull_request_review.go new file mode 100644 index 00000000..0fd40a63 --- /dev/null +++ b/pkg/github/models/protected_branch_pull_request_review.go @@ -0,0 +1,255 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProtectedBranchPullRequestReview protected Branch Pull Request Review +type ProtectedBranchPullRequestReview struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Allow specific users, teams, or apps to bypass pull request requirements. + bypass_pull_request_allowances ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable + // The dismiss_stale_reviews property + dismiss_stale_reviews *bool + // The dismissal_restrictions property + dismissal_restrictions ProtectedBranchPullRequestReview_dismissal_restrictionsable + // The require_code_owner_reviews property + require_code_owner_reviews *bool + // Whether the most recent push must be approved by someone other than the person who pushed it. + require_last_push_approval *bool + // The required_approving_review_count property + required_approving_review_count *int32 + // The url property + url *string +} +// NewProtectedBranchPullRequestReview instantiates a new ProtectedBranchPullRequestReview and sets the default values. +func NewProtectedBranchPullRequestReview()(*ProtectedBranchPullRequestReview) { + m := &ProtectedBranchPullRequestReview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranchPullRequestReviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranchPullRequestReviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranchPullRequestReview(), 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 *ProtectedBranchPullRequestReview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassPullRequestAllowances gets the bypass_pull_request_allowances property value. Allow specific users, teams, or apps to bypass pull request requirements. +// returns a ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable when successful +func (m *ProtectedBranchPullRequestReview) GetBypassPullRequestAllowances()(ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable) { + return m.bypass_pull_request_allowances +} +// GetDismissalRestrictions gets the dismissal_restrictions property value. The dismissal_restrictions property +// returns a ProtectedBranchPullRequestReview_dismissal_restrictionsable when successful +func (m *ProtectedBranchPullRequestReview) GetDismissalRestrictions()(ProtectedBranchPullRequestReview_dismissal_restrictionsable) { + return m.dismissal_restrictions +} +// GetDismissStaleReviews gets the dismiss_stale_reviews property value. The dismiss_stale_reviews property +// returns a *bool when successful +func (m *ProtectedBranchPullRequestReview) GetDismissStaleReviews()(*bool) { + return m.dismiss_stale_reviews +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranchPullRequestReview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_pull_request_allowances"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranchPullRequestReview_bypass_pull_request_allowancesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBypassPullRequestAllowances(val.(ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable)) + } + return nil + } + res["dismiss_stale_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissStaleReviews(val) + } + return nil + } + res["dismissal_restrictions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateProtectedBranchPullRequestReview_dismissal_restrictionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissalRestrictions(val.(ProtectedBranchPullRequestReview_dismissal_restrictionsable)) + } + return nil + } + res["require_code_owner_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireCodeOwnerReviews(val) + } + return nil + } + res["require_last_push_approval"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireLastPushApproval(val) + } + return nil + } + res["required_approving_review_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRequiredApprovingReviewCount(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetRequireCodeOwnerReviews gets the require_code_owner_reviews property value. The require_code_owner_reviews property +// returns a *bool when successful +func (m *ProtectedBranchPullRequestReview) GetRequireCodeOwnerReviews()(*bool) { + return m.require_code_owner_reviews +} +// GetRequiredApprovingReviewCount gets the required_approving_review_count property value. The required_approving_review_count property +// returns a *int32 when successful +func (m *ProtectedBranchPullRequestReview) GetRequiredApprovingReviewCount()(*int32) { + return m.required_approving_review_count +} +// GetRequireLastPushApproval gets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. +// returns a *bool when successful +func (m *ProtectedBranchPullRequestReview) GetRequireLastPushApproval()(*bool) { + return m.require_last_push_approval +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranchPullRequestReview) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProtectedBranchPullRequestReview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("bypass_pull_request_allowances", m.GetBypassPullRequestAllowances()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dismissal_restrictions", m.GetDismissalRestrictions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dismiss_stale_reviews", m.GetDismissStaleReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("required_approving_review_count", m.GetRequiredApprovingReviewCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_code_owner_reviews", m.GetRequireCodeOwnerReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_last_push_approval", m.GetRequireLastPushApproval()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProtectedBranchPullRequestReview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassPullRequestAllowances sets the bypass_pull_request_allowances property value. Allow specific users, teams, or apps to bypass pull request requirements. +func (m *ProtectedBranchPullRequestReview) SetBypassPullRequestAllowances(value ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable)() { + m.bypass_pull_request_allowances = value +} +// SetDismissalRestrictions sets the dismissal_restrictions property value. The dismissal_restrictions property +func (m *ProtectedBranchPullRequestReview) SetDismissalRestrictions(value ProtectedBranchPullRequestReview_dismissal_restrictionsable)() { + m.dismissal_restrictions = value +} +// SetDismissStaleReviews sets the dismiss_stale_reviews property value. The dismiss_stale_reviews property +func (m *ProtectedBranchPullRequestReview) SetDismissStaleReviews(value *bool)() { + m.dismiss_stale_reviews = value +} +// SetRequireCodeOwnerReviews sets the require_code_owner_reviews property value. The require_code_owner_reviews property +func (m *ProtectedBranchPullRequestReview) SetRequireCodeOwnerReviews(value *bool)() { + m.require_code_owner_reviews = value +} +// SetRequiredApprovingReviewCount sets the required_approving_review_count property value. The required_approving_review_count property +func (m *ProtectedBranchPullRequestReview) SetRequiredApprovingReviewCount(value *int32)() { + m.required_approving_review_count = value +} +// SetRequireLastPushApproval sets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. +func (m *ProtectedBranchPullRequestReview) SetRequireLastPushApproval(value *bool)() { + m.require_last_push_approval = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranchPullRequestReview) SetUrl(value *string)() { + m.url = value +} +type ProtectedBranchPullRequestReviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassPullRequestAllowances()(ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable) + GetDismissalRestrictions()(ProtectedBranchPullRequestReview_dismissal_restrictionsable) + GetDismissStaleReviews()(*bool) + GetRequireCodeOwnerReviews()(*bool) + GetRequiredApprovingReviewCount()(*int32) + GetRequireLastPushApproval()(*bool) + GetUrl()(*string) + SetBypassPullRequestAllowances(value ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable)() + SetDismissalRestrictions(value ProtectedBranchPullRequestReview_dismissal_restrictionsable)() + SetDismissStaleReviews(value *bool)() + SetRequireCodeOwnerReviews(value *bool)() + SetRequiredApprovingReviewCount(value *int32)() + SetRequireLastPushApproval(value *bool)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/protected_branch_pull_request_review_escaped_bypass_escaped_pull_escaped_request_escaped_allowances.go b/pkg/github/models/protected_branch_pull_request_review_escaped_bypass_escaped_pull_escaped_request_escaped_allowances.go new file mode 100644 index 00000000..9d82acd4 --- /dev/null +++ b/pkg/github/models/protected_branch_pull_request_review_escaped_bypass_escaped_pull_escaped_request_escaped_allowances.go @@ -0,0 +1,175 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProtectedBranchPullRequestReview_bypass_pull_request_allowances allow specific users, teams, or apps to bypass pull request requirements. +type ProtectedBranchPullRequestReview_bypass_pull_request_allowances 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 list of apps allowed to bypass pull request requirements. + apps []Integrationable + // The list of teams allowed to bypass pull request requirements. + teams []Teamable + // The list of users allowed to bypass pull request requirements. + users []SimpleUserable +} +// NewProtectedBranchPullRequestReview_bypass_pull_request_allowances instantiates a new ProtectedBranchPullRequestReview_bypass_pull_request_allowances and sets the default values. +func NewProtectedBranchPullRequestReview_bypass_pull_request_allowances()(*ProtectedBranchPullRequestReview_bypass_pull_request_allowances) { + m := &ProtectedBranchPullRequestReview_bypass_pull_request_allowances{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranchPullRequestReview_bypass_pull_request_allowancesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranchPullRequestReview_bypass_pull_request_allowancesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranchPullRequestReview_bypass_pull_request_allowances(), 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 *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The list of apps allowed to bypass pull request requirements. +// returns a []Integrationable when successful +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) GetApps()([]Integrationable) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Integrationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Integrationable) + } + } + m.SetApps(res) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Teamable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Teamable) + } + } + m.SetTeams(res) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The list of teams allowed to bypass pull request requirements. +// returns a []Teamable when successful +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) GetTeams()([]Teamable) { + return m.teams +} +// GetUsers gets the users property value. The list of users allowed to bypass pull request requirements. +// returns a []SimpleUserable when successful +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) GetUsers()([]SimpleUserable) { + return m.users +} +// Serialize serializes information the current object +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetApps())) + for i, v := range m.GetApps() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("apps", cast) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTeams())) + for i, v := range m.GetTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("teams", cast) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUsers())) + for i, v := range m.GetUsers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("users", 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 *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The list of apps allowed to bypass pull request requirements. +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) SetApps(value []Integrationable)() { + m.apps = value +} +// SetTeams sets the teams property value. The list of teams allowed to bypass pull request requirements. +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) SetTeams(value []Teamable)() { + m.teams = value +} +// SetUsers sets the users property value. The list of users allowed to bypass pull request requirements. +func (m *ProtectedBranchPullRequestReview_bypass_pull_request_allowances) SetUsers(value []SimpleUserable)() { + m.users = value +} +type ProtectedBranchPullRequestReview_bypass_pull_request_allowancesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]Integrationable) + GetTeams()([]Teamable) + GetUsers()([]SimpleUserable) + SetApps(value []Integrationable)() + SetTeams(value []Teamable)() + SetUsers(value []SimpleUserable)() +} diff --git a/pkg/github/models/protected_branch_pull_request_review_escaped_dismissal_escaped_restrictions.go b/pkg/github/models/protected_branch_pull_request_review_escaped_dismissal_escaped_restrictions.go new file mode 100644 index 00000000..349f9a07 --- /dev/null +++ b/pkg/github/models/protected_branch_pull_request_review_escaped_dismissal_escaped_restrictions.go @@ -0,0 +1,261 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranchPullRequestReview_dismissal_restrictions 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 list of apps with review dismissal access. + apps []Integrationable + // The list of teams with review dismissal access. + teams []Teamable + // The teams_url property + teams_url *string + // The url property + url *string + // The list of users with review dismissal access. + users []SimpleUserable + // The users_url property + users_url *string +} +// NewProtectedBranchPullRequestReview_dismissal_restrictions instantiates a new ProtectedBranchPullRequestReview_dismissal_restrictions and sets the default values. +func NewProtectedBranchPullRequestReview_dismissal_restrictions()(*ProtectedBranchPullRequestReview_dismissal_restrictions) { + m := &ProtectedBranchPullRequestReview_dismissal_restrictions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranchPullRequestReview_dismissal_restrictionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranchPullRequestReview_dismissal_restrictionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranchPullRequestReview_dismissal_restrictions(), 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 *ProtectedBranchPullRequestReview_dismissal_restrictions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The list of apps with review dismissal access. +// returns a []Integrationable when successful +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) GetApps()([]Integrationable) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Integrationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Integrationable) + } + } + m.SetApps(res) + } + return nil + } + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Teamable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Teamable) + } + } + m.SetTeams(res) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetUsers(res) + } + return nil + } + res["users_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUsersUrl(val) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The list of teams with review dismissal access. +// returns a []Teamable when successful +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) GetTeams()([]Teamable) { + return m.teams +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) GetUrl()(*string) { + return m.url +} +// GetUsers gets the users property value. The list of users with review dismissal access. +// returns a []SimpleUserable when successful +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) GetUsers()([]SimpleUserable) { + return m.users +} +// GetUsersUrl gets the users_url property value. The users_url property +// returns a *string when successful +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) GetUsersUrl()(*string) { + return m.users_url +} +// Serialize serializes information the current object +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetApps())) + for i, v := range m.GetApps() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("apps", cast) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTeams())) + for i, v := range m.GetTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("teams", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUsers())) + for i, v := range m.GetUsers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("users", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("users_url", m.GetUsersUrl()) + 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 *ProtectedBranchPullRequestReview_dismissal_restrictions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The list of apps with review dismissal access. +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) SetApps(value []Integrationable)() { + m.apps = value +} +// SetTeams sets the teams property value. The list of teams with review dismissal access. +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) SetTeams(value []Teamable)() { + m.teams = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) SetUrl(value *string)() { + m.url = value +} +// SetUsers sets the users property value. The list of users with review dismissal access. +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) SetUsers(value []SimpleUserable)() { + m.users = value +} +// SetUsersUrl sets the users_url property value. The users_url property +func (m *ProtectedBranchPullRequestReview_dismissal_restrictions) SetUsersUrl(value *string)() { + m.users_url = value +} +type ProtectedBranchPullRequestReview_dismissal_restrictionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]Integrationable) + GetTeams()([]Teamable) + GetTeamsUrl()(*string) + GetUrl()(*string) + GetUsers()([]SimpleUserable) + GetUsersUrl()(*string) + SetApps(value []Integrationable)() + SetTeams(value []Teamable)() + SetTeamsUrl(value *string)() + SetUrl(value *string)() + SetUsers(value []SimpleUserable)() + SetUsersUrl(value *string)() +} diff --git a/pkg/github/models/protected_branch_required_status_check.go b/pkg/github/models/protected_branch_required_status_check.go new file mode 100644 index 00000000..c76b7509 --- /dev/null +++ b/pkg/github/models/protected_branch_required_status_check.go @@ -0,0 +1,244 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ProtectedBranchRequiredStatusCheck protected Branch Required Status Check +type ProtectedBranchRequiredStatusCheck 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 checks property + checks []ProtectedBranchRequiredStatusCheck_checksable + // The contexts property + contexts []string + // The contexts_url property + contexts_url *string + // The enforcement_level property + enforcement_level *string + // The strict property + strict *bool + // The url property + url *string +} +// NewProtectedBranchRequiredStatusCheck instantiates a new ProtectedBranchRequiredStatusCheck and sets the default values. +func NewProtectedBranchRequiredStatusCheck()(*ProtectedBranchRequiredStatusCheck) { + m := &ProtectedBranchRequiredStatusCheck{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranchRequiredStatusCheckFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranchRequiredStatusCheckFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranchRequiredStatusCheck(), 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 *ProtectedBranchRequiredStatusCheck) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChecks gets the checks property value. The checks property +// returns a []ProtectedBranchRequiredStatusCheck_checksable when successful +func (m *ProtectedBranchRequiredStatusCheck) GetChecks()([]ProtectedBranchRequiredStatusCheck_checksable) { + return m.checks +} +// GetContexts gets the contexts property value. The contexts property +// returns a []string when successful +func (m *ProtectedBranchRequiredStatusCheck) GetContexts()([]string) { + return m.contexts +} +// GetContextsUrl gets the contexts_url property value. The contexts_url property +// returns a *string when successful +func (m *ProtectedBranchRequiredStatusCheck) GetContextsUrl()(*string) { + return m.contexts_url +} +// GetEnforcementLevel gets the enforcement_level property value. The enforcement_level property +// returns a *string when successful +func (m *ProtectedBranchRequiredStatusCheck) GetEnforcementLevel()(*string) { + return m.enforcement_level +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranchRequiredStatusCheck) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateProtectedBranchRequiredStatusCheck_checksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ProtectedBranchRequiredStatusCheck_checksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ProtectedBranchRequiredStatusCheck_checksable) + } + } + m.SetChecks(res) + } + return nil + } + res["contexts"] = 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.SetContexts(res) + } + return nil + } + res["contexts_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContextsUrl(val) + } + return nil + } + res["enforcement_level"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnforcementLevel(val) + } + return nil + } + res["strict"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetStrict(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetStrict gets the strict property value. The strict property +// returns a *bool when successful +func (m *ProtectedBranchRequiredStatusCheck) GetStrict()(*bool) { + return m.strict +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ProtectedBranchRequiredStatusCheck) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ProtectedBranchRequiredStatusCheck) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetChecks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetChecks())) + for i, v := range m.GetChecks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("checks", cast) + if err != nil { + return err + } + } + if m.GetContexts() != nil { + err := writer.WriteCollectionOfStringValues("contexts", m.GetContexts()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contexts_url", m.GetContextsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("enforcement_level", m.GetEnforcementLevel()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("strict", m.GetStrict()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ProtectedBranchRequiredStatusCheck) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChecks sets the checks property value. The checks property +func (m *ProtectedBranchRequiredStatusCheck) SetChecks(value []ProtectedBranchRequiredStatusCheck_checksable)() { + m.checks = value +} +// SetContexts sets the contexts property value. The contexts property +func (m *ProtectedBranchRequiredStatusCheck) SetContexts(value []string)() { + m.contexts = value +} +// SetContextsUrl sets the contexts_url property value. The contexts_url property +func (m *ProtectedBranchRequiredStatusCheck) SetContextsUrl(value *string)() { + m.contexts_url = value +} +// SetEnforcementLevel sets the enforcement_level property value. The enforcement_level property +func (m *ProtectedBranchRequiredStatusCheck) SetEnforcementLevel(value *string)() { + m.enforcement_level = value +} +// SetStrict sets the strict property value. The strict property +func (m *ProtectedBranchRequiredStatusCheck) SetStrict(value *bool)() { + m.strict = value +} +// SetUrl sets the url property value. The url property +func (m *ProtectedBranchRequiredStatusCheck) SetUrl(value *string)() { + m.url = value +} +type ProtectedBranchRequiredStatusCheckable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChecks()([]ProtectedBranchRequiredStatusCheck_checksable) + GetContexts()([]string) + GetContextsUrl()(*string) + GetEnforcementLevel()(*string) + GetStrict()(*bool) + GetUrl()(*string) + SetChecks(value []ProtectedBranchRequiredStatusCheck_checksable)() + SetContexts(value []string)() + SetContextsUrl(value *string)() + SetEnforcementLevel(value *string)() + SetStrict(value *bool)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/protected_branch_required_status_check_escaped_checks.go b/pkg/github/models/protected_branch_required_status_check_escaped_checks.go new file mode 100644 index 00000000..3903ef2c --- /dev/null +++ b/pkg/github/models/protected_branch_required_status_check_escaped_checks.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProtectedBranchRequiredStatusCheck_checks 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 app_id property + app_id *int32 + // The context property + context *string +} +// NewProtectedBranchRequiredStatusCheck_checks instantiates a new ProtectedBranchRequiredStatusCheck_checks and sets the default values. +func NewProtectedBranchRequiredStatusCheck_checks()(*ProtectedBranchRequiredStatusCheck_checks) { + m := &ProtectedBranchRequiredStatusCheck_checks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProtectedBranchRequiredStatusCheck_checksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProtectedBranchRequiredStatusCheck_checksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProtectedBranchRequiredStatusCheck_checks(), 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 *ProtectedBranchRequiredStatusCheck_checks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAppId gets the app_id property value. The app_id property +// returns a *int32 when successful +func (m *ProtectedBranchRequiredStatusCheck_checks) GetAppId()(*int32) { + return m.app_id +} +// GetContext gets the context property value. The context property +// returns a *string when successful +func (m *ProtectedBranchRequiredStatusCheck_checks) GetContext()(*string) { + return m.context +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProtectedBranchRequiredStatusCheck_checks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ProtectedBranchRequiredStatusCheck_checks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("app_id", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("context", m.GetContext()) + 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 *ProtectedBranchRequiredStatusCheck_checks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAppId sets the app_id property value. The app_id property +func (m *ProtectedBranchRequiredStatusCheck_checks) SetAppId(value *int32)() { + m.app_id = value +} +// SetContext sets the context property value. The context property +func (m *ProtectedBranchRequiredStatusCheck_checks) SetContext(value *string)() { + m.context = value +} +type ProtectedBranchRequiredStatusCheck_checksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId()(*int32) + GetContext()(*string) + SetAppId(value *int32)() + SetContext(value *string)() +} diff --git a/pkg/github/models/public_key_full.go b/pkg/github/models/public_key_full.go new file mode 100644 index 00000000..5685f8b1 --- /dev/null +++ b/pkg/github/models/public_key_full.go @@ -0,0 +1,371 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PublicKeyFull struct { + // The added_by property + added_by *string + // 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 id property + id *int64 + // The key property + key *string + // The last_used property + last_used *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The read_only property + read_only *bool + // The repository_id property + repository_id *int64 + // The title property + title *string + // The url property + url *string + // The user_id property + user_id *int32 + // The verified property + verified *bool +} +// NewPublicKeyFull instantiates a new PublicKeyFull and sets the default values. +func NewPublicKeyFull()(*PublicKeyFull) { + m := &PublicKeyFull{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePublicKeyFullFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePublicKeyFullFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPublicKeyFull(), nil +} +// GetAddedBy gets the added_by property value. The added_by property +// returns a *string when successful +func (m *PublicKeyFull) GetAddedBy()(*string) { + return m.added_by +} +// 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 *PublicKeyFull) 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 *PublicKeyFull) 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 *PublicKeyFull) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["added_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAddedBy(val) + } + return nil + } + 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + 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["last_used"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastUsed(val) + } + return nil + } + res["read_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetReadOnly(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUserId(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PublicKeyFull) GetId()(*int64) { + return m.id +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *PublicKeyFull) GetKey()(*string) { + return m.key +} +// GetLastUsed gets the last_used property value. The last_used property +// returns a *Time when successful +func (m *PublicKeyFull) GetLastUsed()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_used +} +// GetReadOnly gets the read_only property value. The read_only property +// returns a *bool when successful +func (m *PublicKeyFull) GetReadOnly()(*bool) { + return m.read_only +} +// GetRepositoryId gets the repository_id property value. The repository_id property +// returns a *int64 when successful +func (m *PublicKeyFull) GetRepositoryId()(*int64) { + return m.repository_id +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *PublicKeyFull) GetTitle()(*string) { + return m.title +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PublicKeyFull) GetUrl()(*string) { + return m.url +} +// GetUserId gets the user_id property value. The user_id property +// returns a *int32 when successful +func (m *PublicKeyFull) GetUserId()(*int32) { + return m.user_id +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *PublicKeyFull) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *PublicKeyFull) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("added_by", m.GetAddedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("last_used", m.GetLastUsed()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("read_only", m.GetReadOnly()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("repository_id", m.GetRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("user_id", m.GetUserId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAddedBy sets the added_by property value. The added_by property +func (m *PublicKeyFull) SetAddedBy(value *string)() { + m.added_by = 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 *PublicKeyFull) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PublicKeyFull) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *PublicKeyFull) SetId(value *int64)() { + m.id = value +} +// SetKey sets the key property value. The key property +func (m *PublicKeyFull) SetKey(value *string)() { + m.key = value +} +// SetLastUsed sets the last_used property value. The last_used property +func (m *PublicKeyFull) SetLastUsed(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_used = value +} +// SetReadOnly sets the read_only property value. The read_only property +func (m *PublicKeyFull) SetReadOnly(value *bool)() { + m.read_only = value +} +// SetRepositoryId sets the repository_id property value. The repository_id property +func (m *PublicKeyFull) SetRepositoryId(value *int64)() { + m.repository_id = value +} +// SetTitle sets the title property value. The title property +func (m *PublicKeyFull) SetTitle(value *string)() { + m.title = value +} +// SetUrl sets the url property value. The url property +func (m *PublicKeyFull) SetUrl(value *string)() { + m.url = value +} +// SetUserId sets the user_id property value. The user_id property +func (m *PublicKeyFull) SetUserId(value *int32)() { + m.user_id = value +} +// SetVerified sets the verified property value. The verified property +func (m *PublicKeyFull) SetVerified(value *bool)() { + m.verified = value +} +type PublicKeyFullable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAddedBy()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int64) + GetKey()(*string) + GetLastUsed()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReadOnly()(*bool) + GetRepositoryId()(*int64) + GetTitle()(*string) + GetUrl()(*string) + GetUserId()(*int32) + GetVerified()(*bool) + SetAddedBy(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int64)() + SetKey(value *string)() + SetLastUsed(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReadOnly(value *bool)() + SetRepositoryId(value *int64)() + SetTitle(value *string)() + SetUrl(value *string)() + SetUserId(value *int32)() + SetVerified(value *bool)() +} diff --git a/pkg/github/models/public_user.go b/pkg/github/models/public_user.go new file mode 100644 index 00000000..34064bf7 --- /dev/null +++ b/pkg/github/models/public_user.go @@ -0,0 +1,1194 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PublicUser public User +type PublicUser struct { + // The avatar_url property + avatar_url *string + // The bio property + bio *string + // The blog property + blog *string + // The collaborators property + collaborators *int32 + // The company property + company *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The disk_usage property + disk_usage *int32 + // The email property + email *string + // The events_url property + events_url *string + // The followers property + followers *int32 + // The followers_url property + followers_url *string + // The following property + following *int32 + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The hireable property + hireable *bool + // The html_url property + html_url *string + // The id property + id *int64 + // The location property + location *string + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The notification_email property + notification_email *string + // The organizations_url property + organizations_url *string + // The owned_private_repos property + owned_private_repos *int32 + // The plan property + plan PublicUser_planable + // The private_gists property + private_gists *int32 + // The public_gists property + public_gists *int32 + // The public_repos property + public_repos *int32 + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The suspended_at property + suspended_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The total_private_repos property + total_private_repos *int32 + // The twitter_username property + twitter_username *string + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewPublicUser instantiates a new PublicUser and sets the default values. +func NewPublicUser()(*PublicUser) { + m := &PublicUser{ + } + return m +} +// CreatePublicUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePublicUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPublicUser(), nil +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *PublicUser) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetBio gets the bio property value. The bio property +// returns a *string when successful +func (m *PublicUser) GetBio()(*string) { + return m.bio +} +// GetBlog gets the blog property value. The blog property +// returns a *string when successful +func (m *PublicUser) GetBlog()(*string) { + return m.blog +} +// GetCollaborators gets the collaborators property value. The collaborators property +// returns a *int32 when successful +func (m *PublicUser) GetCollaborators()(*int32) { + return m.collaborators +} +// GetCompany gets the company property value. The company property +// returns a *string when successful +func (m *PublicUser) GetCompany()(*string) { + return m.company +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PublicUser) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDiskUsage gets the disk_usage property value. The disk_usage property +// returns a *int32 when successful +func (m *PublicUser) GetDiskUsage()(*int32) { + return m.disk_usage +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *PublicUser) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PublicUser) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PublicUser) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["bio"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBio(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["collaborators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCollaborators(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + 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["disk_usage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDiskUsage(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowers(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowing(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["hireable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHireable(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationEmail(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["owned_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOwnedPrivateRepos(val) + } + return nil + } + res["plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePublicUser_planFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPlan(val.(PublicUser_planable)) + } + return nil + } + res["private_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateGists(val) + } + return nil + } + res["public_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicGists(val) + } + return nil + } + res["public_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicRepos(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["suspended_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetSuspendedAt(val) + } + return nil + } + res["total_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPrivateRepos(val) + } + return nil + } + res["twitter_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTwitterUsername(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowers gets the followers property value. The followers property +// returns a *int32 when successful +func (m *PublicUser) GetFollowers()(*int32) { + return m.followers +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *PublicUser) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowing gets the following property value. The following property +// returns a *int32 when successful +func (m *PublicUser) GetFollowing()(*int32) { + return m.following +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *PublicUser) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *PublicUser) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *PublicUser) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHireable gets the hireable property value. The hireable property +// returns a *bool when successful +func (m *PublicUser) GetHireable()(*bool) { + return m.hireable +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PublicUser) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PublicUser) GetId()(*int64) { + return m.id +} +// GetLocation gets the location property value. The location property +// returns a *string when successful +func (m *PublicUser) GetLocation()(*string) { + return m.location +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *PublicUser) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PublicUser) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PublicUser) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationEmail gets the notification_email property value. The notification_email property +// returns a *string when successful +func (m *PublicUser) GetNotificationEmail()(*string) { + return m.notification_email +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *PublicUser) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetOwnedPrivateRepos gets the owned_private_repos property value. The owned_private_repos property +// returns a *int32 when successful +func (m *PublicUser) GetOwnedPrivateRepos()(*int32) { + return m.owned_private_repos +} +// GetPlan gets the plan property value. The plan property +// returns a PublicUser_planable when successful +func (m *PublicUser) GetPlan()(PublicUser_planable) { + return m.plan +} +// GetPrivateGists gets the private_gists property value. The private_gists property +// returns a *int32 when successful +func (m *PublicUser) GetPrivateGists()(*int32) { + return m.private_gists +} +// GetPublicGists gets the public_gists property value. The public_gists property +// returns a *int32 when successful +func (m *PublicUser) GetPublicGists()(*int32) { + return m.public_gists +} +// GetPublicRepos gets the public_repos property value. The public_repos property +// returns a *int32 when successful +func (m *PublicUser) GetPublicRepos()(*int32) { + return m.public_repos +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *PublicUser) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *PublicUser) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *PublicUser) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *PublicUser) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *PublicUser) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetSuspendedAt gets the suspended_at property value. The suspended_at property +// returns a *Time when successful +func (m *PublicUser) GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.suspended_at +} +// GetTotalPrivateRepos gets the total_private_repos property value. The total_private_repos property +// returns a *int32 when successful +func (m *PublicUser) GetTotalPrivateRepos()(*int32) { + return m.total_private_repos +} +// GetTwitterUsername gets the twitter_username property value. The twitter_username property +// returns a *string when successful +func (m *PublicUser) GetTwitterUsername()(*string) { + return m.twitter_username +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *PublicUser) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PublicUser) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PublicUser) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PublicUser) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("bio", m.GetBio()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("collaborators", m.GetCollaborators()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("disk_usage", m.GetDiskUsage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("followers", m.GetFollowers()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("following", m.GetFollowing()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("hireable", m.GetHireable()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_email", m.GetNotificationEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("owned_private_repos", m.GetOwnedPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("plan", m.GetPlan()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_gists", m.GetPrivateGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_gists", m.GetPublicGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_repos", m.GetPublicRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("suspended_at", m.GetSuspendedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_private_repos", m.GetTotalPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("twitter_username", m.GetTwitterUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + return nil +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *PublicUser) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetBio sets the bio property value. The bio property +func (m *PublicUser) SetBio(value *string)() { + m.bio = value +} +// SetBlog sets the blog property value. The blog property +func (m *PublicUser) SetBlog(value *string)() { + m.blog = value +} +// SetCollaborators sets the collaborators property value. The collaborators property +func (m *PublicUser) SetCollaborators(value *int32)() { + m.collaborators = value +} +// SetCompany sets the company property value. The company property +func (m *PublicUser) SetCompany(value *string)() { + m.company = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PublicUser) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDiskUsage sets the disk_usage property value. The disk_usage property +func (m *PublicUser) SetDiskUsage(value *int32)() { + m.disk_usage = value +} +// SetEmail sets the email property value. The email property +func (m *PublicUser) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PublicUser) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowers sets the followers property value. The followers property +func (m *PublicUser) SetFollowers(value *int32)() { + m.followers = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *PublicUser) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowing sets the following property value. The following property +func (m *PublicUser) SetFollowing(value *int32)() { + m.following = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *PublicUser) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *PublicUser) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *PublicUser) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHireable sets the hireable property value. The hireable property +func (m *PublicUser) SetHireable(value *bool)() { + m.hireable = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PublicUser) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PublicUser) SetId(value *int64)() { + m.id = value +} +// SetLocation sets the location property value. The location property +func (m *PublicUser) SetLocation(value *string)() { + m.location = value +} +// SetLogin sets the login property value. The login property +func (m *PublicUser) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *PublicUser) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PublicUser) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationEmail sets the notification_email property value. The notification_email property +func (m *PublicUser) SetNotificationEmail(value *string)() { + m.notification_email = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *PublicUser) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetOwnedPrivateRepos sets the owned_private_repos property value. The owned_private_repos property +func (m *PublicUser) SetOwnedPrivateRepos(value *int32)() { + m.owned_private_repos = value +} +// SetPlan sets the plan property value. The plan property +func (m *PublicUser) SetPlan(value PublicUser_planable)() { + m.plan = value +} +// SetPrivateGists sets the private_gists property value. The private_gists property +func (m *PublicUser) SetPrivateGists(value *int32)() { + m.private_gists = value +} +// SetPublicGists sets the public_gists property value. The public_gists property +func (m *PublicUser) SetPublicGists(value *int32)() { + m.public_gists = value +} +// SetPublicRepos sets the public_repos property value. The public_repos property +func (m *PublicUser) SetPublicRepos(value *int32)() { + m.public_repos = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *PublicUser) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *PublicUser) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *PublicUser) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *PublicUser) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *PublicUser) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetSuspendedAt sets the suspended_at property value. The suspended_at property +func (m *PublicUser) SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.suspended_at = value +} +// SetTotalPrivateRepos sets the total_private_repos property value. The total_private_repos property +func (m *PublicUser) SetTotalPrivateRepos(value *int32)() { + m.total_private_repos = value +} +// SetTwitterUsername sets the twitter_username property value. The twitter_username property +func (m *PublicUser) SetTwitterUsername(value *string)() { + m.twitter_username = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *PublicUser) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PublicUser) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PublicUser) SetUrl(value *string)() { + m.url = value +} +type PublicUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetBio()(*string) + GetBlog()(*string) + GetCollaborators()(*int32) + GetCompany()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDiskUsage()(*int32) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowers()(*int32) + GetFollowersUrl()(*string) + GetFollowing()(*int32) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHireable()(*bool) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLocation()(*string) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationEmail()(*string) + GetOrganizationsUrl()(*string) + GetOwnedPrivateRepos()(*int32) + GetPlan()(PublicUser_planable) + GetPrivateGists()(*int32) + GetPublicGists()(*int32) + GetPublicRepos()(*int32) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTotalPrivateRepos()(*int32) + GetTwitterUsername()(*string) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetBio(value *string)() + SetBlog(value *string)() + SetCollaborators(value *int32)() + SetCompany(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDiskUsage(value *int32)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowers(value *int32)() + SetFollowersUrl(value *string)() + SetFollowing(value *int32)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHireable(value *bool)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLocation(value *string)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationEmail(value *string)() + SetOrganizationsUrl(value *string)() + SetOwnedPrivateRepos(value *int32)() + SetPlan(value PublicUser_planable)() + SetPrivateGists(value *int32)() + SetPublicGists(value *int32)() + SetPublicRepos(value *int32)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTotalPrivateRepos(value *int32)() + SetTwitterUsername(value *string)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/public_user_escaped_plan.go b/pkg/github/models/public_user_escaped_plan.go new file mode 100644 index 00000000..4bec18ac --- /dev/null +++ b/pkg/github/models/public_user_escaped_plan.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PublicUser_plan 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 collaborators property + collaborators *int32 + // The name property + name *string + // The private_repos property + private_repos *int32 + // The space property + space *int32 +} +// NewPublicUser_plan instantiates a new PublicUser_plan and sets the default values. +func NewPublicUser_plan()(*PublicUser_plan) { + m := &PublicUser_plan{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePublicUser_planFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePublicUser_planFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPublicUser_plan(), 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 *PublicUser_plan) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCollaborators gets the collaborators property value. The collaborators property +// returns a *int32 when successful +func (m *PublicUser_plan) GetCollaborators()(*int32) { + return m.collaborators +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PublicUser_plan) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["collaborators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCollaborators(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["private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateRepos(val) + } + return nil + } + res["space"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSpace(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PublicUser_plan) GetName()(*string) { + return m.name +} +// GetPrivateRepos gets the private_repos property value. The private_repos property +// returns a *int32 when successful +func (m *PublicUser_plan) GetPrivateRepos()(*int32) { + return m.private_repos +} +// GetSpace gets the space property value. The space property +// returns a *int32 when successful +func (m *PublicUser_plan) GetSpace()(*int32) { + return m.space +} +// Serialize serializes information the current object +func (m *PublicUser_plan) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("collaborators", m.GetCollaborators()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_repos", m.GetPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("space", m.GetSpace()) + 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 *PublicUser_plan) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCollaborators sets the collaborators property value. The collaborators property +func (m *PublicUser_plan) SetCollaborators(value *int32)() { + m.collaborators = value +} +// SetName sets the name property value. The name property +func (m *PublicUser_plan) SetName(value *string)() { + m.name = value +} +// SetPrivateRepos sets the private_repos property value. The private_repos property +func (m *PublicUser_plan) SetPrivateRepos(value *int32)() { + m.private_repos = value +} +// SetSpace sets the space property value. The space property +func (m *PublicUser_plan) SetSpace(value *int32)() { + m.space = value +} +type PublicUser_planable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCollaborators()(*int32) + GetName()(*string) + GetPrivateRepos()(*int32) + GetSpace()(*int32) + SetCollaborators(value *int32)() + SetName(value *string)() + SetPrivateRepos(value *int32)() + SetSpace(value *int32)() +} diff --git a/pkg/github/models/pull_request.go b/pkg/github/models/pull_request.go new file mode 100644 index 00000000..f1d5c807 --- /dev/null +++ b/pkg/github/models/pull_request.go @@ -0,0 +1,1495 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PullRequest pull requests let you tell others about changes you've pushed to a repository on GitHub. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary. +type PullRequest struct { + // The _links property + _links PullRequest__linksable + // The active_lock_reason property + active_lock_reason *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The additions property + additions *int32 + // A GitHub user. + assignee NullableSimpleUserable + // The assignees property + assignees []SimpleUserable + // How the author is associated with the repository. + author_association *AuthorAssociation + // The status of auto merging a pull request. + auto_merge AutoMergeable + // The base property + base PullRequest_baseable + // The body property + body *string + // The changed_files property + changed_files *int32 + // The closed_at property + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The comments property + comments *int32 + // The comments_url property + comments_url *string + // The commits property + commits *int32 + // The commits_url property + commits_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The deletions property + deletions *int32 + // The diff_url property + diff_url *string + // Indicates whether or not the pull request is a draft. + draft *bool + // The head property + head PullRequest_headable + // The html_url property + html_url *string + // The id property + id *int64 + // The issue_url property + issue_url *string + // The labels property + labels []PullRequest_labelsable + // The locked property + locked *bool + // Indicates whether maintainers can modify the pull request. + maintainer_can_modify *bool + // The merge_commit_sha property + merge_commit_sha *string + // The mergeable property + mergeable *bool + // The mergeable_state property + mergeable_state *string + // The merged property + merged *bool + // The merged_at property + merged_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + merged_by NullableSimpleUserable + // A collection of related issues and pull requests. + milestone NullableMilestoneable + // The node_id property + node_id *string + // Number uniquely identifying the pull request within its repository. + number *int32 + // The patch_url property + patch_url *string + // The rebaseable property + rebaseable *bool + // The requested_reviewers property + requested_reviewers []SimpleUserable + // The requested_teams property + requested_teams []TeamSimpleable + // The review_comment_url property + review_comment_url *string + // The review_comments property + review_comments *int32 + // The review_comments_url property + review_comments_url *string + // State of this Pull Request. Either `open` or `closed`. + state *PullRequest_state + // The statuses_url property + statuses_url *string + // The title of the pull request. + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user SimpleUserable +} +// NewPullRequest instantiates a new PullRequest and sets the default values. +func NewPullRequest()(*PullRequest) { + m := &PullRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest(), nil +} +// GetActiveLockReason gets the active_lock_reason property value. The active_lock_reason property +// returns a *string when successful +func (m *PullRequest) GetActiveLockReason()(*string) { + return m.active_lock_reason +} +// 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 *PullRequest) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdditions gets the additions property value. The additions property +// returns a *int32 when successful +func (m *PullRequest) GetAdditions()(*int32) { + return m.additions +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PullRequest) GetAssignee()(NullableSimpleUserable) { + return m.assignee +} +// GetAssignees gets the assignees property value. The assignees property +// returns a []SimpleUserable when successful +func (m *PullRequest) GetAssignees()([]SimpleUserable) { + return m.assignees +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *PullRequest) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetAutoMerge gets the auto_merge property value. The status of auto merging a pull request. +// returns a AutoMergeable when successful +func (m *PullRequest) GetAutoMerge()(AutoMergeable) { + return m.auto_merge +} +// GetBase gets the base property value. The base property +// returns a PullRequest_baseable when successful +func (m *PullRequest) GetBase()(PullRequest_baseable) { + return m.base +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *PullRequest) GetBody()(*string) { + return m.body +} +// GetChangedFiles gets the changed_files property value. The changed_files property +// returns a *int32 when successful +func (m *PullRequest) GetChangedFiles()(*int32) { + return m.changed_files +} +// GetClosedAt gets the closed_at property value. The closed_at property +// returns a *Time when successful +func (m *PullRequest) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetComments gets the comments property value. The comments property +// returns a *int32 when successful +func (m *PullRequest) GetComments()(*int32) { + return m.comments +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *PullRequest) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommits gets the commits property value. The commits property +// returns a *int32 when successful +func (m *PullRequest) GetCommits()(*int32) { + return m.commits +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *PullRequest) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PullRequest) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDeletions gets the deletions property value. The deletions property +// returns a *int32 when successful +func (m *PullRequest) GetDeletions()(*int32) { + return m.deletions +} +// GetDiffUrl gets the diff_url property value. The diff_url property +// returns a *string when successful +func (m *PullRequest) GetDiffUrl()(*string) { + return m.diff_url +} +// GetDraft gets the draft property value. Indicates whether or not the pull request is a draft. +// returns a *bool when successful +func (m *PullRequest) GetDraft()(*bool) { + return m.draft +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(PullRequest__linksable)) + } + return nil + } + res["active_lock_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActiveLockReason(val) + } + return nil + } + res["additions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAdditions(val) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(NullableSimpleUserable)) + } + return nil + } + res["assignees"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetAssignees(res) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAutoMergeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAutoMerge(val.(AutoMergeable)) + } + return nil + } + res["base"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_baseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBase(val.(PullRequest_baseable)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["changed_files"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetChangedFiles(val) + } + return nil + } + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetComments(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCommits(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + 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["deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDeletions(val) + } + return nil + } + res["diff_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffUrl(val) + } + return nil + } + res["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["head"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_headFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHead(val.(PullRequest_headable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issue_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueUrl(val) + } + return nil + } + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePullRequest_labelsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PullRequest_labelsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PullRequest_labelsable) + } + } + m.SetLabels(res) + } + return nil + } + res["locked"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLocked(val) + } + return nil + } + res["maintainer_can_modify"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintainerCanModify(val) + } + return nil + } + res["merge_commit_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitSha(val) + } + return nil + } + res["mergeable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMergeable(val) + } + return nil + } + res["mergeable_state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergeableState(val) + } + return nil + } + res["merged"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMerged(val) + } + return nil + } + res["merged_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetMergedAt(val) + } + return nil + } + res["merged_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMergedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMilestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(NullableMilestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["patch_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchUrl(val) + } + return nil + } + res["rebaseable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRebaseable(val) + } + return nil + } + res["requested_reviewers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetRequestedReviewers(res) + } + return nil + } + res["requested_teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]TeamSimpleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(TeamSimpleable) + } + } + m.SetRequestedTeams(res) + } + return nil + } + res["review_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReviewCommentUrl(val) + } + return nil + } + res["review_comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetReviewComments(val) + } + return nil + } + res["review_comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReviewCommentsUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequest_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*PullRequest_state)) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetHead gets the head property value. The head property +// returns a PullRequest_headable when successful +func (m *PullRequest) GetHead()(PullRequest_headable) { + return m.head +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequest) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequest) GetId()(*int64) { + return m.id +} +// GetIssueUrl gets the issue_url property value. The issue_url property +// returns a *string when successful +func (m *PullRequest) GetIssueUrl()(*string) { + return m.issue_url +} +// GetLabels gets the labels property value. The labels property +// returns a []PullRequest_labelsable when successful +func (m *PullRequest) GetLabels()([]PullRequest_labelsable) { + return m.labels +} +// GetLinks gets the _links property value. The _links property +// returns a PullRequest__linksable when successful +func (m *PullRequest) GetLinks()(PullRequest__linksable) { + return m._links +} +// GetLocked gets the locked property value. The locked property +// returns a *bool when successful +func (m *PullRequest) GetLocked()(*bool) { + return m.locked +} +// GetMaintainerCanModify gets the maintainer_can_modify property value. Indicates whether maintainers can modify the pull request. +// returns a *bool when successful +func (m *PullRequest) GetMaintainerCanModify()(*bool) { + return m.maintainer_can_modify +} +// GetMergeable gets the mergeable property value. The mergeable property +// returns a *bool when successful +func (m *PullRequest) GetMergeable()(*bool) { + return m.mergeable +} +// GetMergeableState gets the mergeable_state property value. The mergeable_state property +// returns a *string when successful +func (m *PullRequest) GetMergeableState()(*string) { + return m.mergeable_state +} +// GetMergeCommitSha gets the merge_commit_sha property value. The merge_commit_sha property +// returns a *string when successful +func (m *PullRequest) GetMergeCommitSha()(*string) { + return m.merge_commit_sha +} +// GetMerged gets the merged property value. The merged property +// returns a *bool when successful +func (m *PullRequest) GetMerged()(*bool) { + return m.merged +} +// GetMergedAt gets the merged_at property value. The merged_at property +// returns a *Time when successful +func (m *PullRequest) GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.merged_at +} +// GetMergedBy gets the merged_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PullRequest) GetMergedBy()(NullableSimpleUserable) { + return m.merged_by +} +// GetMilestone gets the milestone property value. A collection of related issues and pull requests. +// returns a NullableMilestoneable when successful +func (m *PullRequest) GetMilestone()(NullableMilestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. Number uniquely identifying the pull request within its repository. +// returns a *int32 when successful +func (m *PullRequest) GetNumber()(*int32) { + return m.number +} +// GetPatchUrl gets the patch_url property value. The patch_url property +// returns a *string when successful +func (m *PullRequest) GetPatchUrl()(*string) { + return m.patch_url +} +// GetRebaseable gets the rebaseable property value. The rebaseable property +// returns a *bool when successful +func (m *PullRequest) GetRebaseable()(*bool) { + return m.rebaseable +} +// GetRequestedReviewers gets the requested_reviewers property value. The requested_reviewers property +// returns a []SimpleUserable when successful +func (m *PullRequest) GetRequestedReviewers()([]SimpleUserable) { + return m.requested_reviewers +} +// GetRequestedTeams gets the requested_teams property value. The requested_teams property +// returns a []TeamSimpleable when successful +func (m *PullRequest) GetRequestedTeams()([]TeamSimpleable) { + return m.requested_teams +} +// GetReviewComments gets the review_comments property value. The review_comments property +// returns a *int32 when successful +func (m *PullRequest) GetReviewComments()(*int32) { + return m.review_comments +} +// GetReviewCommentsUrl gets the review_comments_url property value. The review_comments_url property +// returns a *string when successful +func (m *PullRequest) GetReviewCommentsUrl()(*string) { + return m.review_comments_url +} +// GetReviewCommentUrl gets the review_comment_url property value. The review_comment_url property +// returns a *string when successful +func (m *PullRequest) GetReviewCommentUrl()(*string) { + return m.review_comment_url +} +// GetState gets the state property value. State of this Pull Request. Either `open` or `closed`. +// returns a *PullRequest_state when successful +func (m *PullRequest) GetState()(*PullRequest_state) { + return m.state +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *PullRequest) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetTitle gets the title property value. The title of the pull request. +// returns a *string when successful +func (m *PullRequest) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PullRequest) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *PullRequest) GetUser()(SimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("active_lock_reason", m.GetActiveLockReason()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("additions", m.GetAdditions()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + if m.GetAssignees() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssignees())) + for i, v := range m.GetAssignees() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("assignees", cast) + if err != nil { + return err + } + } + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("auto_merge", m.GetAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("base", m.GetBase()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("changed_files", m.GetChangedFiles()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("closed_at", m.GetClosedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("commits", m.GetCommits()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("deletions", m.GetDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("diff_url", m.GetDiffUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("head", m.GetHead()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_url", m.GetIssueUrl()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("locked", m.GetLocked()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintainer_can_modify", m.GetMaintainerCanModify()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("mergeable", m.GetMergeable()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mergeable_state", m.GetMergeableState()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("merged", m.GetMerged()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("merged_at", m.GetMergedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("merged_by", m.GetMergedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merge_commit_sha", m.GetMergeCommitSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patch_url", m.GetPatchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("rebaseable", m.GetRebaseable()) + if err != nil { + return err + } + } + if m.GetRequestedReviewers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRequestedReviewers())) + for i, v := range m.GetRequestedReviewers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("requested_reviewers", cast) + if err != nil { + return err + } + } + if m.GetRequestedTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRequestedTeams())) + for i, v := range m.GetRequestedTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("requested_teams", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("review_comments", m.GetReviewComments()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("review_comments_url", m.GetReviewCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("review_comment_url", m.GetReviewCommentUrl()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveLockReason sets the active_lock_reason property value. The active_lock_reason property +func (m *PullRequest) SetActiveLockReason(value *string)() { + m.active_lock_reason = 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 *PullRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdditions sets the additions property value. The additions property +func (m *PullRequest) SetAdditions(value *int32)() { + m.additions = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *PullRequest) SetAssignee(value NullableSimpleUserable)() { + m.assignee = value +} +// SetAssignees sets the assignees property value. The assignees property +func (m *PullRequest) SetAssignees(value []SimpleUserable)() { + m.assignees = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *PullRequest) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetAutoMerge sets the auto_merge property value. The status of auto merging a pull request. +func (m *PullRequest) SetAutoMerge(value AutoMergeable)() { + m.auto_merge = value +} +// SetBase sets the base property value. The base property +func (m *PullRequest) SetBase(value PullRequest_baseable)() { + m.base = value +} +// SetBody sets the body property value. The body property +func (m *PullRequest) SetBody(value *string)() { + m.body = value +} +// SetChangedFiles sets the changed_files property value. The changed_files property +func (m *PullRequest) SetChangedFiles(value *int32)() { + m.changed_files = value +} +// SetClosedAt sets the closed_at property value. The closed_at property +func (m *PullRequest) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetComments sets the comments property value. The comments property +func (m *PullRequest) SetComments(value *int32)() { + m.comments = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *PullRequest) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommits sets the commits property value. The commits property +func (m *PullRequest) SetCommits(value *int32)() { + m.commits = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *PullRequest) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PullRequest) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDeletions sets the deletions property value. The deletions property +func (m *PullRequest) SetDeletions(value *int32)() { + m.deletions = value +} +// SetDiffUrl sets the diff_url property value. The diff_url property +func (m *PullRequest) SetDiffUrl(value *string)() { + m.diff_url = value +} +// SetDraft sets the draft property value. Indicates whether or not the pull request is a draft. +func (m *PullRequest) SetDraft(value *bool)() { + m.draft = value +} +// SetHead sets the head property value. The head property +func (m *PullRequest) SetHead(value PullRequest_headable)() { + m.head = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequest) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequest) SetId(value *int64)() { + m.id = value +} +// SetIssueUrl sets the issue_url property value. The issue_url property +func (m *PullRequest) SetIssueUrl(value *string)() { + m.issue_url = value +} +// SetLabels sets the labels property value. The labels property +func (m *PullRequest) SetLabels(value []PullRequest_labelsable)() { + m.labels = value +} +// SetLinks sets the _links property value. The _links property +func (m *PullRequest) SetLinks(value PullRequest__linksable)() { + m._links = value +} +// SetLocked sets the locked property value. The locked property +func (m *PullRequest) SetLocked(value *bool)() { + m.locked = value +} +// SetMaintainerCanModify sets the maintainer_can_modify property value. Indicates whether maintainers can modify the pull request. +func (m *PullRequest) SetMaintainerCanModify(value *bool)() { + m.maintainer_can_modify = value +} +// SetMergeable sets the mergeable property value. The mergeable property +func (m *PullRequest) SetMergeable(value *bool)() { + m.mergeable = value +} +// SetMergeableState sets the mergeable_state property value. The mergeable_state property +func (m *PullRequest) SetMergeableState(value *string)() { + m.mergeable_state = value +} +// SetMergeCommitSha sets the merge_commit_sha property value. The merge_commit_sha property +func (m *PullRequest) SetMergeCommitSha(value *string)() { + m.merge_commit_sha = value +} +// SetMerged sets the merged property value. The merged property +func (m *PullRequest) SetMerged(value *bool)() { + m.merged = value +} +// SetMergedAt sets the merged_at property value. The merged_at property +func (m *PullRequest) SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.merged_at = value +} +// SetMergedBy sets the merged_by property value. A GitHub user. +func (m *PullRequest) SetMergedBy(value NullableSimpleUserable)() { + m.merged_by = value +} +// SetMilestone sets the milestone property value. A collection of related issues and pull requests. +func (m *PullRequest) SetMilestone(value NullableMilestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. Number uniquely identifying the pull request within its repository. +func (m *PullRequest) SetNumber(value *int32)() { + m.number = value +} +// SetPatchUrl sets the patch_url property value. The patch_url property +func (m *PullRequest) SetPatchUrl(value *string)() { + m.patch_url = value +} +// SetRebaseable sets the rebaseable property value. The rebaseable property +func (m *PullRequest) SetRebaseable(value *bool)() { + m.rebaseable = value +} +// SetRequestedReviewers sets the requested_reviewers property value. The requested_reviewers property +func (m *PullRequest) SetRequestedReviewers(value []SimpleUserable)() { + m.requested_reviewers = value +} +// SetRequestedTeams sets the requested_teams property value. The requested_teams property +func (m *PullRequest) SetRequestedTeams(value []TeamSimpleable)() { + m.requested_teams = value +} +// SetReviewComments sets the review_comments property value. The review_comments property +func (m *PullRequest) SetReviewComments(value *int32)() { + m.review_comments = value +} +// SetReviewCommentsUrl sets the review_comments_url property value. The review_comments_url property +func (m *PullRequest) SetReviewCommentsUrl(value *string)() { + m.review_comments_url = value +} +// SetReviewCommentUrl sets the review_comment_url property value. The review_comment_url property +func (m *PullRequest) SetReviewCommentUrl(value *string)() { + m.review_comment_url = value +} +// SetState sets the state property value. State of this Pull Request. Either `open` or `closed`. +func (m *PullRequest) SetState(value *PullRequest_state)() { + m.state = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *PullRequest) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetTitle sets the title property value. The title of the pull request. +func (m *PullRequest) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PullRequest) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *PullRequest) SetUser(value SimpleUserable)() { + m.user = value +} +type PullRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveLockReason()(*string) + GetAdditions()(*int32) + GetAssignee()(NullableSimpleUserable) + GetAssignees()([]SimpleUserable) + GetAuthorAssociation()(*AuthorAssociation) + GetAutoMerge()(AutoMergeable) + GetBase()(PullRequest_baseable) + GetBody()(*string) + GetChangedFiles()(*int32) + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetComments()(*int32) + GetCommentsUrl()(*string) + GetCommits()(*int32) + GetCommitsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDeletions()(*int32) + GetDiffUrl()(*string) + GetDraft()(*bool) + GetHead()(PullRequest_headable) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueUrl()(*string) + GetLabels()([]PullRequest_labelsable) + GetLinks()(PullRequest__linksable) + GetLocked()(*bool) + GetMaintainerCanModify()(*bool) + GetMergeable()(*bool) + GetMergeableState()(*string) + GetMergeCommitSha()(*string) + GetMerged()(*bool) + GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetMergedBy()(NullableSimpleUserable) + GetMilestone()(NullableMilestoneable) + GetNodeId()(*string) + GetNumber()(*int32) + GetPatchUrl()(*string) + GetRebaseable()(*bool) + GetRequestedReviewers()([]SimpleUserable) + GetRequestedTeams()([]TeamSimpleable) + GetReviewComments()(*int32) + GetReviewCommentsUrl()(*string) + GetReviewCommentUrl()(*string) + GetState()(*PullRequest_state) + GetStatusesUrl()(*string) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(SimpleUserable) + SetActiveLockReason(value *string)() + SetAdditions(value *int32)() + SetAssignee(value NullableSimpleUserable)() + SetAssignees(value []SimpleUserable)() + SetAuthorAssociation(value *AuthorAssociation)() + SetAutoMerge(value AutoMergeable)() + SetBase(value PullRequest_baseable)() + SetBody(value *string)() + SetChangedFiles(value *int32)() + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetComments(value *int32)() + SetCommentsUrl(value *string)() + SetCommits(value *int32)() + SetCommitsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDeletions(value *int32)() + SetDiffUrl(value *string)() + SetDraft(value *bool)() + SetHead(value PullRequest_headable)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueUrl(value *string)() + SetLabels(value []PullRequest_labelsable)() + SetLinks(value PullRequest__linksable)() + SetLocked(value *bool)() + SetMaintainerCanModify(value *bool)() + SetMergeable(value *bool)() + SetMergeableState(value *string)() + SetMergeCommitSha(value *string)() + SetMerged(value *bool)() + SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetMergedBy(value NullableSimpleUserable)() + SetMilestone(value NullableMilestoneable)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetPatchUrl(value *string)() + SetRebaseable(value *bool)() + SetRequestedReviewers(value []SimpleUserable)() + SetRequestedTeams(value []TeamSimpleable)() + SetReviewComments(value *int32)() + SetReviewCommentsUrl(value *string)() + SetReviewCommentUrl(value *string)() + SetState(value *PullRequest_state)() + SetStatusesUrl(value *string)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value SimpleUserable)() +} diff --git a/pkg/github/models/pull_request503_error.go b/pkg/github/models/pull_request503_error.go new file mode 100644 index 00000000..ed9cd413 --- /dev/null +++ b/pkg/github/models/pull_request503_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 PullRequest503Error 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 +} +// NewPullRequest503Error instantiates a new PullRequest503Error and sets the default values. +func NewPullRequest503Error()(*PullRequest503Error) { + m := &PullRequest503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *PullRequest503Error) 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 *PullRequest503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *PullRequest503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *PullRequest503Error) 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 *PullRequest503Error) 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 *PullRequest503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *PullRequest503Error) 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 *PullRequest503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *PullRequest503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *PullRequest503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *PullRequest503Error) SetMessage(value *string)() { + m.message = value +} +type PullRequest503Errorable 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/pull_request_escaped__escaped_links.go b/pkg/github/models/pull_request_escaped__escaped_links.go new file mode 100644 index 00000000..f0050982 --- /dev/null +++ b/pkg/github/models/pull_request_escaped__escaped_links.go @@ -0,0 +1,283 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Hypermedia Link + comments Linkable + // Hypermedia Link + commits Linkable + // Hypermedia Link + html Linkable + // Hypermedia Link + issue Linkable + // Hypermedia Link + review_comment Linkable + // Hypermedia Link + review_comments Linkable + // Hypermedia Link + self Linkable + // Hypermedia Link + statuses Linkable +} +// NewPullRequest__links instantiates a new PullRequest__links and sets the default values. +func NewPullRequest__links()(*PullRequest__links) { + m := &PullRequest__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest__links(), 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 *PullRequest__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetComments()(Linkable) { + return m.comments +} +// GetCommits gets the commits property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetCommits()(Linkable) { + return m.commits +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetComments(val.(Linkable)) + } + return nil + } + res["commits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommits(val.(Linkable)) + } + return nil + } + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHtml(val.(Linkable)) + } + return nil + } + res["issue"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIssue(val.(Linkable)) + } + return nil + } + res["review_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewComment(val.(Linkable)) + } + return nil + } + res["review_comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewComments(val.(Linkable)) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSelf(val.(Linkable)) + } + return nil + } + res["statuses"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetStatuses(val.(Linkable)) + } + return nil + } + return res +} +// GetHtml gets the html property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetHtml()(Linkable) { + return m.html +} +// GetIssue gets the issue property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetIssue()(Linkable) { + return m.issue +} +// GetReviewComment gets the review_comment property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetReviewComment()(Linkable) { + return m.review_comment +} +// GetReviewComments gets the review_comments property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetReviewComments()(Linkable) { + return m.review_comments +} +// GetSelf gets the self property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetSelf()(Linkable) { + return m.self +} +// GetStatuses gets the statuses property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequest__links) GetStatuses()(Linkable) { + return m.statuses +} +// Serialize serializes information the current object +func (m *PullRequest__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("commits", m.GetCommits()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("issue", m.GetIssue()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("review_comment", m.GetReviewComment()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("review_comments", m.GetReviewComments()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("self", m.GetSelf()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("statuses", m.GetStatuses()) + 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 *PullRequest__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. Hypermedia Link +func (m *PullRequest__links) SetComments(value Linkable)() { + m.comments = value +} +// SetCommits sets the commits property value. Hypermedia Link +func (m *PullRequest__links) SetCommits(value Linkable)() { + m.commits = value +} +// SetHtml sets the html property value. Hypermedia Link +func (m *PullRequest__links) SetHtml(value Linkable)() { + m.html = value +} +// SetIssue sets the issue property value. Hypermedia Link +func (m *PullRequest__links) SetIssue(value Linkable)() { + m.issue = value +} +// SetReviewComment sets the review_comment property value. Hypermedia Link +func (m *PullRequest__links) SetReviewComment(value Linkable)() { + m.review_comment = value +} +// SetReviewComments sets the review_comments property value. Hypermedia Link +func (m *PullRequest__links) SetReviewComments(value Linkable)() { + m.review_comments = value +} +// SetSelf sets the self property value. Hypermedia Link +func (m *PullRequest__links) SetSelf(value Linkable)() { + m.self = value +} +// SetStatuses sets the statuses property value. Hypermedia Link +func (m *PullRequest__links) SetStatuses(value Linkable)() { + m.statuses = value +} +type PullRequest__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()(Linkable) + GetCommits()(Linkable) + GetHtml()(Linkable) + GetIssue()(Linkable) + GetReviewComment()(Linkable) + GetReviewComments()(Linkable) + GetSelf()(Linkable) + GetStatuses()(Linkable) + SetComments(value Linkable)() + SetCommits(value Linkable)() + SetHtml(value Linkable)() + SetIssue(value Linkable)() + SetReviewComment(value Linkable)() + SetReviewComments(value Linkable)() + SetSelf(value Linkable)() + SetStatuses(value Linkable)() +} diff --git a/pkg/github/models/pull_request_escaped_base.go b/pkg/github/models/pull_request_escaped_base.go new file mode 100644 index 00000000..141ccdc6 --- /dev/null +++ b/pkg/github/models/pull_request_escaped_base.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_base 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 label property + label *string + // The ref property + ref *string + // The repo property + repo PullRequest_base_repoable + // The sha property + sha *string + // The user property + user PullRequest_base_userable +} +// NewPullRequest_base instantiates a new PullRequest_base and sets the default values. +func NewPullRequest_base()(*PullRequest_base) { + m := &PullRequest_base{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_baseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_baseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_base(), 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 *PullRequest_base) 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 *PullRequest_base) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabel(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_base_repoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepo(val.(PullRequest_base_repoable)) + } + return nil + } + 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["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_base_userFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(PullRequest_base_userable)) + } + return nil + } + return res +} +// GetLabel gets the label property value. The label property +// returns a *string when successful +func (m *PullRequest_base) GetLabel()(*string) { + return m.label +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *PullRequest_base) GetRef()(*string) { + return m.ref +} +// GetRepo gets the repo property value. The repo property +// returns a PullRequest_base_repoable when successful +func (m *PullRequest_base) GetRepo()(PullRequest_base_repoable) { + return m.repo +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *PullRequest_base) GetSha()(*string) { + return m.sha +} +// GetUser gets the user property value. The user property +// returns a PullRequest_base_userable when successful +func (m *PullRequest_base) GetUser()(PullRequest_base_userable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequest_base) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *PullRequest_base) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabel sets the label property value. The label property +func (m *PullRequest_base) SetLabel(value *string)() { + m.label = value +} +// SetRef sets the ref property value. The ref property +func (m *PullRequest_base) SetRef(value *string)() { + m.ref = value +} +// SetRepo sets the repo property value. The repo property +func (m *PullRequest_base) SetRepo(value PullRequest_base_repoable)() { + m.repo = value +} +// SetSha sets the sha property value. The sha property +func (m *PullRequest_base) SetSha(value *string)() { + m.sha = value +} +// SetUser sets the user property value. The user property +func (m *PullRequest_base) SetUser(value PullRequest_base_userable)() { + m.user = value +} +type PullRequest_baseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabel()(*string) + GetRef()(*string) + GetRepo()(PullRequest_base_repoable) + GetSha()(*string) + GetUser()(PullRequest_base_userable) + SetLabel(value *string)() + SetRef(value *string)() + SetRepo(value PullRequest_base_repoable)() + SetSha(value *string)() + SetUser(value PullRequest_base_userable)() +} diff --git a/pkg/github/models/pull_request_escaped_base_escaped_repo.go b/pkg/github/models/pull_request_escaped_base_escaped_repo.go new file mode 100644 index 00000000..8a586046 --- /dev/null +++ b/pkg/github/models/pull_request_escaped_base_escaped_repo.go @@ -0,0 +1,2523 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_base_repo 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 allow_forking property + allow_forking *bool + // The allow_merge_commit property + allow_merge_commit *bool + // The allow_rebase_merge property + allow_rebase_merge *bool + // The allow_squash_merge property + allow_squash_merge *bool + // The archive_url property + archive_url *string + // The archived property + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default_branch property + default_branch *string + // The deployments_url property + deployments_url *string + // The description property + description *string + // The disabled property + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // The has_discussions property + has_discussions *bool + // The has_downloads property + has_downloads *bool + // The has_issues property + has_issues *bool + // The has_pages property + has_pages *bool + // The has_projects property + has_projects *bool + // The has_wiki property + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The is_template property + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // License Simple + license NullableLicenseSimpleable + // The master_branch property + master_branch *string + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name property + name *string + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // The owner property + owner PullRequest_base_repo_ownerable + // The permissions property + permissions PullRequest_base_repo_permissionsable + // The private property + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The size property + size *int32 + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The repository visibility: public, private, or internal. + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewPullRequest_base_repo instantiates a new PullRequest_base_repo and sets the default values. +func NewPullRequest_base_repo()(*PullRequest_base_repo) { + m := &PullRequest_base_repo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_base_repoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_base_repoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_base_repo(), 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 *PullRequest_base_repo) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowForking gets the allow_forking property value. The allow_forking property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. The allow_merge_commit property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. The allow_rebase_merge property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. The allow_squash_merge property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetArchived gets the archived property value. The archived property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PullRequest_base_repo) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default_branch property +// returns a *string when successful +func (m *PullRequest_base_repo) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *PullRequest_base_repo) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. The disabled property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_base_repo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + 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["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + 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["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + return nil + } + res["master_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMasterBranch(val) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_base_repo_ownerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(PullRequest_base_repo_ownerable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_base_repo_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(PullRequest_base_repo_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = 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.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *PullRequest_base_repo) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. The has_discussions property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. The has_downloads property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. The has_issues property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. The has_projects property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. The has_wiki property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *PullRequest_base_repo) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetId()(*int32) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. The is_template property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *PullRequest_base_repo) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *PullRequest_base_repo) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetMasterBranch gets the master_branch property value. The master_branch property +// returns a *string when successful +func (m *PullRequest_base_repo) GetMasterBranch()(*string) { + return m.master_branch +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PullRequest_base_repo) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_base_repo) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. The owner property +// returns a PullRequest_base_repo_ownerable when successful +func (m *PullRequest_base_repo) GetOwner()(PullRequest_base_repo_ownerable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a PullRequest_base_repo_permissionsable when successful +func (m *PullRequest_base_repo) GetPermissions()(PullRequest_base_repo_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. The private property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *PullRequest_base_repo) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetSize()(*int32) { + return m.size +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *PullRequest_base_repo) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *PullRequest_base_repo) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PullRequest_base_repo) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_base_repo) GetUrl()(*string) { + return m.url +} +// GetVisibility gets the visibility property value. The repository visibility: public, private, or internal. +// returns a *string when successful +func (m *PullRequest_base_repo) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *PullRequest_base_repo) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *PullRequest_base_repo) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *PullRequest_base_repo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("master_branch", m.GetMasterBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *PullRequest_base_repo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowForking sets the allow_forking property value. The allow_forking property +func (m *PullRequest_base_repo) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. The allow_merge_commit property +func (m *PullRequest_base_repo) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. The allow_rebase_merge property +func (m *PullRequest_base_repo) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. The allow_squash_merge property +func (m *PullRequest_base_repo) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetArchived sets the archived property value. The archived property +func (m *PullRequest_base_repo) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *PullRequest_base_repo) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *PullRequest_base_repo) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *PullRequest_base_repo) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *PullRequest_base_repo) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *PullRequest_base_repo) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *PullRequest_base_repo) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *PullRequest_base_repo) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *PullRequest_base_repo) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *PullRequest_base_repo) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *PullRequest_base_repo) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *PullRequest_base_repo) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PullRequest_base_repo) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default_branch property +func (m *PullRequest_base_repo) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *PullRequest_base_repo) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *PullRequest_base_repo) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. The disabled property +func (m *PullRequest_base_repo) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *PullRequest_base_repo) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PullRequest_base_repo) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *PullRequest_base_repo) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *PullRequest_base_repo) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *PullRequest_base_repo) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *PullRequest_base_repo) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *PullRequest_base_repo) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *PullRequest_base_repo) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *PullRequest_base_repo) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *PullRequest_base_repo) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *PullRequest_base_repo) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. The has_discussions property +func (m *PullRequest_base_repo) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. The has_downloads property +func (m *PullRequest_base_repo) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. The has_issues property +func (m *PullRequest_base_repo) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *PullRequest_base_repo) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. The has_projects property +func (m *PullRequest_base_repo) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. The has_wiki property +func (m *PullRequest_base_repo) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *PullRequest_base_repo) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *PullRequest_base_repo) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequest_base_repo) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequest_base_repo) SetId(value *int32)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *PullRequest_base_repo) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *PullRequest_base_repo) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *PullRequest_base_repo) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. The is_template property +func (m *PullRequest_base_repo) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *PullRequest_base_repo) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *PullRequest_base_repo) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *PullRequest_base_repo) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *PullRequest_base_repo) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. License Simple +func (m *PullRequest_base_repo) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetMasterBranch sets the master_branch property value. The master_branch property +func (m *PullRequest_base_repo) SetMasterBranch(value *string)() { + m.master_branch = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *PullRequest_base_repo) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *PullRequest_base_repo) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *PullRequest_base_repo) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name property +func (m *PullRequest_base_repo) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_base_repo) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *PullRequest_base_repo) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *PullRequest_base_repo) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *PullRequest_base_repo) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. The owner property +func (m *PullRequest_base_repo) SetOwner(value PullRequest_base_repo_ownerable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *PullRequest_base_repo) SetPermissions(value PullRequest_base_repo_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. The private property +func (m *PullRequest_base_repo) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *PullRequest_base_repo) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *PullRequest_base_repo) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *PullRequest_base_repo) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetSize sets the size property value. The size property +func (m *PullRequest_base_repo) SetSize(value *int32)() { + m.size = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *PullRequest_base_repo) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *PullRequest_base_repo) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *PullRequest_base_repo) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *PullRequest_base_repo) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *PullRequest_base_repo) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *PullRequest_base_repo) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *PullRequest_base_repo) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *PullRequest_base_repo) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *PullRequest_base_repo) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *PullRequest_base_repo) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *PullRequest_base_repo) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *PullRequest_base_repo) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PullRequest_base_repo) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_base_repo) SetUrl(value *string)() { + m.url = value +} +// SetVisibility sets the visibility property value. The repository visibility: public, private, or internal. +func (m *PullRequest_base_repo) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *PullRequest_base_repo) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *PullRequest_base_repo) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *PullRequest_base_repo) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type PullRequest_base_repoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(NullableLicenseSimpleable) + GetMasterBranch()(*string) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(PullRequest_base_repo_ownerable) + GetPermissions()(PullRequest_base_repo_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetSize()(*int32) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value NullableLicenseSimpleable)() + SetMasterBranch(value *string)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value PullRequest_base_repo_ownerable)() + SetPermissions(value PullRequest_base_repo_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetSize(value *int32)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/pkg/github/models/pull_request_escaped_base_escaped_repo_escaped_owner.go b/pkg/github/models/pull_request_escaped_base_escaped_repo_escaped_owner.go new file mode 100644 index 00000000..80915d11 --- /dev/null +++ b/pkg/github/models/pull_request_escaped_base_escaped_repo_escaped_owner.go @@ -0,0 +1,573 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_base_repo_owner 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 avatar_url property + avatar_url *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int32 + // The login property + login *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewPullRequest_base_repo_owner instantiates a new PullRequest_base_repo_owner and sets the default values. +func NewPullRequest_base_repo_owner()(*PullRequest_base_repo_owner) { + m := &PullRequest_base_repo_owner{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_base_repo_ownerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_base_repo_ownerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_base_repo_owner(), 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 *PullRequest_base_repo_owner) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_base_repo_owner) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *PullRequest_base_repo_owner) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetLogin()(*string) { + return m.login +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *PullRequest_base_repo_owner) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_base_repo_owner) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequest_base_repo_owner) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequest_base_repo_owner) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *PullRequest_base_repo_owner) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PullRequest_base_repo_owner) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *PullRequest_base_repo_owner) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *PullRequest_base_repo_owner) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *PullRequest_base_repo_owner) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *PullRequest_base_repo_owner) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequest_base_repo_owner) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequest_base_repo_owner) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *PullRequest_base_repo_owner) SetLogin(value *string)() { + m.login = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_base_repo_owner) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *PullRequest_base_repo_owner) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *PullRequest_base_repo_owner) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *PullRequest_base_repo_owner) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *PullRequest_base_repo_owner) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *PullRequest_base_repo_owner) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *PullRequest_base_repo_owner) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *PullRequest_base_repo_owner) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_base_repo_owner) SetUrl(value *string)() { + m.url = value +} +type PullRequest_base_repo_ownerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLogin()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pull_request_escaped_base_escaped_repo_escaped_permissions.go b/pkg/github/models/pull_request_escaped_base_escaped_repo_escaped_permissions.go new file mode 100644 index 00000000..65df8f05 --- /dev/null +++ b/pkg/github/models/pull_request_escaped_base_escaped_repo_escaped_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_base_repo_permissions 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 admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewPullRequest_base_repo_permissions instantiates a new PullRequest_base_repo_permissions and sets the default values. +func NewPullRequest_base_repo_permissions()(*PullRequest_base_repo_permissions) { + m := &PullRequest_base_repo_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_base_repo_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_base_repo_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_base_repo_permissions(), 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 *PullRequest_base_repo_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *PullRequest_base_repo_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_base_repo_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *PullRequest_base_repo_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *PullRequest_base_repo_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *PullRequest_base_repo_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *PullRequest_base_repo_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *PullRequest_base_repo_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *PullRequest_base_repo_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *PullRequest_base_repo_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *PullRequest_base_repo_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *PullRequest_base_repo_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *PullRequest_base_repo_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *PullRequest_base_repo_permissions) SetTriage(value *bool)() { + m.triage = value +} +type PullRequest_base_repo_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/pkg/github/models/pull_request_escaped_base_escaped_user.go b/pkg/github/models/pull_request_escaped_base_escaped_user.go new file mode 100644 index 00000000..dfc31c56 --- /dev/null +++ b/pkg/github/models/pull_request_escaped_base_escaped_user.go @@ -0,0 +1,573 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_base_user 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 avatar_url property + avatar_url *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int64 + // The login property + login *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewPullRequest_base_user instantiates a new PullRequest_base_user and sets the default values. +func NewPullRequest_base_user()(*PullRequest_base_user) { + m := &PullRequest_base_user{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_base_userFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_base_userFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_base_user(), 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 *PullRequest_base_user) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_base_user) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *PullRequest_base_user) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequest_base_user) GetId()(*int64) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *PullRequest_base_user) GetLogin()(*string) { + return m.login +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_base_user) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *PullRequest_base_user) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *PullRequest_base_user) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *PullRequest_base_user) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_base_user) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequest_base_user) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequest_base_user) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *PullRequest_base_user) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PullRequest_base_user) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *PullRequest_base_user) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *PullRequest_base_user) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *PullRequest_base_user) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *PullRequest_base_user) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequest_base_user) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequest_base_user) SetId(value *int64)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *PullRequest_base_user) SetLogin(value *string)() { + m.login = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_base_user) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *PullRequest_base_user) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *PullRequest_base_user) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *PullRequest_base_user) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *PullRequest_base_user) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *PullRequest_base_user) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *PullRequest_base_user) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *PullRequest_base_user) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_base_user) SetUrl(value *string)() { + m.url = value +} +type PullRequest_base_userable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLogin()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLogin(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pull_request_escaped_head.go b/pkg/github/models/pull_request_escaped_head.go new file mode 100644 index 00000000..b5a049bd --- /dev/null +++ b/pkg/github/models/pull_request_escaped_head.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_head 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 label property + label *string + // The ref property + ref *string + // The repo property + repo PullRequest_head_repoable + // The sha property + sha *string + // The user property + user PullRequest_head_userable +} +// NewPullRequest_head instantiates a new PullRequest_head and sets the default values. +func NewPullRequest_head()(*PullRequest_head) { + m := &PullRequest_head{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_headFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_headFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_head(), 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 *PullRequest_head) 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 *PullRequest_head) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabel(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_head_repoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepo(val.(PullRequest_head_repoable)) + } + return nil + } + 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["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_head_userFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(PullRequest_head_userable)) + } + return nil + } + return res +} +// GetLabel gets the label property value. The label property +// returns a *string when successful +func (m *PullRequest_head) GetLabel()(*string) { + return m.label +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *PullRequest_head) GetRef()(*string) { + return m.ref +} +// GetRepo gets the repo property value. The repo property +// returns a PullRequest_head_repoable when successful +func (m *PullRequest_head) GetRepo()(PullRequest_head_repoable) { + return m.repo +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *PullRequest_head) GetSha()(*string) { + return m.sha +} +// GetUser gets the user property value. The user property +// returns a PullRequest_head_userable when successful +func (m *PullRequest_head) GetUser()(PullRequest_head_userable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequest_head) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *PullRequest_head) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabel sets the label property value. The label property +func (m *PullRequest_head) SetLabel(value *string)() { + m.label = value +} +// SetRef sets the ref property value. The ref property +func (m *PullRequest_head) SetRef(value *string)() { + m.ref = value +} +// SetRepo sets the repo property value. The repo property +func (m *PullRequest_head) SetRepo(value PullRequest_head_repoable)() { + m.repo = value +} +// SetSha sets the sha property value. The sha property +func (m *PullRequest_head) SetSha(value *string)() { + m.sha = value +} +// SetUser sets the user property value. The user property +func (m *PullRequest_head) SetUser(value PullRequest_head_userable)() { + m.user = value +} +type PullRequest_headable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabel()(*string) + GetRef()(*string) + GetRepo()(PullRequest_head_repoable) + GetSha()(*string) + GetUser()(PullRequest_head_userable) + SetLabel(value *string)() + SetRef(value *string)() + SetRepo(value PullRequest_head_repoable)() + SetSha(value *string)() + SetUser(value PullRequest_head_userable)() +} diff --git a/pkg/github/models/pull_request_escaped_head_escaped_repo.go b/pkg/github/models/pull_request_escaped_head_escaped_repo.go new file mode 100644 index 00000000..6a6fe9ad --- /dev/null +++ b/pkg/github/models/pull_request_escaped_head_escaped_repo.go @@ -0,0 +1,2523 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_head_repo 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 allow_forking property + allow_forking *bool + // The allow_merge_commit property + allow_merge_commit *bool + // The allow_rebase_merge property + allow_rebase_merge *bool + // The allow_squash_merge property + allow_squash_merge *bool + // The archive_url property + archive_url *string + // The archived property + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default_branch property + default_branch *string + // The deployments_url property + deployments_url *string + // The description property + description *string + // The disabled property + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // The has_discussions property + has_discussions *bool + // The has_downloads property + has_downloads *bool + // The has_issues property + has_issues *bool + // The has_pages property + has_pages *bool + // The has_projects property + has_projects *bool + // The has_wiki property + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The is_template property + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // The license property + license PullRequest_head_repo_licenseable + // The master_branch property + master_branch *string + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name property + name *string + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // The owner property + owner PullRequest_head_repo_ownerable + // The permissions property + permissions PullRequest_head_repo_permissionsable + // The private property + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The size property + size *int32 + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The repository visibility: public, private, or internal. + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewPullRequest_head_repo instantiates a new PullRequest_head_repo and sets the default values. +func NewPullRequest_head_repo()(*PullRequest_head_repo) { + m := &PullRequest_head_repo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_head_repoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_head_repoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_head_repo(), 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 *PullRequest_head_repo) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowForking gets the allow_forking property value. The allow_forking property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. The allow_merge_commit property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. The allow_rebase_merge property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. The allow_squash_merge property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetArchived gets the archived property value. The archived property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PullRequest_head_repo) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default_branch property +// returns a *string when successful +func (m *PullRequest_head_repo) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *PullRequest_head_repo) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. The disabled property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_head_repo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + 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["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + 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["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_head_repo_licenseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(PullRequest_head_repo_licenseable)) + } + return nil + } + res["master_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMasterBranch(val) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_head_repo_ownerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(PullRequest_head_repo_ownerable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequest_head_repo_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(PullRequest_head_repo_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = 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.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *PullRequest_head_repo) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. The has_discussions property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. The has_downloads property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. The has_issues property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. The has_projects property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. The has_wiki property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *PullRequest_head_repo) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetId()(*int32) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. The is_template property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *PullRequest_head_repo) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. The license property +// returns a PullRequest_head_repo_licenseable when successful +func (m *PullRequest_head_repo) GetLicense()(PullRequest_head_repo_licenseable) { + return m.license +} +// GetMasterBranch gets the master_branch property value. The master_branch property +// returns a *string when successful +func (m *PullRequest_head_repo) GetMasterBranch()(*string) { + return m.master_branch +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PullRequest_head_repo) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_head_repo) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. The owner property +// returns a PullRequest_head_repo_ownerable when successful +func (m *PullRequest_head_repo) GetOwner()(PullRequest_head_repo_ownerable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a PullRequest_head_repo_permissionsable when successful +func (m *PullRequest_head_repo) GetPermissions()(PullRequest_head_repo_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. The private property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *PullRequest_head_repo) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetSize()(*int32) { + return m.size +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *PullRequest_head_repo) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *PullRequest_head_repo) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PullRequest_head_repo) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_head_repo) GetUrl()(*string) { + return m.url +} +// GetVisibility gets the visibility property value. The repository visibility: public, private, or internal. +// returns a *string when successful +func (m *PullRequest_head_repo) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *PullRequest_head_repo) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *PullRequest_head_repo) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *PullRequest_head_repo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("master_branch", m.GetMasterBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *PullRequest_head_repo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowForking sets the allow_forking property value. The allow_forking property +func (m *PullRequest_head_repo) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. The allow_merge_commit property +func (m *PullRequest_head_repo) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. The allow_rebase_merge property +func (m *PullRequest_head_repo) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. The allow_squash_merge property +func (m *PullRequest_head_repo) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetArchived sets the archived property value. The archived property +func (m *PullRequest_head_repo) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *PullRequest_head_repo) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *PullRequest_head_repo) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *PullRequest_head_repo) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *PullRequest_head_repo) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *PullRequest_head_repo) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *PullRequest_head_repo) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *PullRequest_head_repo) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *PullRequest_head_repo) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *PullRequest_head_repo) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *PullRequest_head_repo) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *PullRequest_head_repo) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PullRequest_head_repo) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default_branch property +func (m *PullRequest_head_repo) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *PullRequest_head_repo) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *PullRequest_head_repo) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. The disabled property +func (m *PullRequest_head_repo) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *PullRequest_head_repo) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PullRequest_head_repo) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *PullRequest_head_repo) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *PullRequest_head_repo) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *PullRequest_head_repo) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *PullRequest_head_repo) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *PullRequest_head_repo) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *PullRequest_head_repo) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *PullRequest_head_repo) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *PullRequest_head_repo) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *PullRequest_head_repo) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. The has_discussions property +func (m *PullRequest_head_repo) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. The has_downloads property +func (m *PullRequest_head_repo) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. The has_issues property +func (m *PullRequest_head_repo) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *PullRequest_head_repo) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. The has_projects property +func (m *PullRequest_head_repo) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. The has_wiki property +func (m *PullRequest_head_repo) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *PullRequest_head_repo) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *PullRequest_head_repo) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequest_head_repo) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequest_head_repo) SetId(value *int32)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *PullRequest_head_repo) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *PullRequest_head_repo) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *PullRequest_head_repo) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. The is_template property +func (m *PullRequest_head_repo) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *PullRequest_head_repo) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *PullRequest_head_repo) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *PullRequest_head_repo) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *PullRequest_head_repo) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. The license property +func (m *PullRequest_head_repo) SetLicense(value PullRequest_head_repo_licenseable)() { + m.license = value +} +// SetMasterBranch sets the master_branch property value. The master_branch property +func (m *PullRequest_head_repo) SetMasterBranch(value *string)() { + m.master_branch = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *PullRequest_head_repo) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *PullRequest_head_repo) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *PullRequest_head_repo) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name property +func (m *PullRequest_head_repo) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_head_repo) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *PullRequest_head_repo) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *PullRequest_head_repo) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *PullRequest_head_repo) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. The owner property +func (m *PullRequest_head_repo) SetOwner(value PullRequest_head_repo_ownerable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *PullRequest_head_repo) SetPermissions(value PullRequest_head_repo_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. The private property +func (m *PullRequest_head_repo) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *PullRequest_head_repo) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *PullRequest_head_repo) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *PullRequest_head_repo) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetSize sets the size property value. The size property +func (m *PullRequest_head_repo) SetSize(value *int32)() { + m.size = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *PullRequest_head_repo) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *PullRequest_head_repo) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *PullRequest_head_repo) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *PullRequest_head_repo) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *PullRequest_head_repo) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *PullRequest_head_repo) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *PullRequest_head_repo) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *PullRequest_head_repo) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *PullRequest_head_repo) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *PullRequest_head_repo) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *PullRequest_head_repo) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *PullRequest_head_repo) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PullRequest_head_repo) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_head_repo) SetUrl(value *string)() { + m.url = value +} +// SetVisibility sets the visibility property value. The repository visibility: public, private, or internal. +func (m *PullRequest_head_repo) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *PullRequest_head_repo) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *PullRequest_head_repo) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *PullRequest_head_repo) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type PullRequest_head_repoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(PullRequest_head_repo_licenseable) + GetMasterBranch()(*string) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(PullRequest_head_repo_ownerable) + GetPermissions()(PullRequest_head_repo_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetSize()(*int32) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value PullRequest_head_repo_licenseable)() + SetMasterBranch(value *string)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value PullRequest_head_repo_ownerable)() + SetPermissions(value PullRequest_head_repo_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetSize(value *int32)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/pkg/github/models/pull_request_escaped_head_escaped_repo_escaped_license.go b/pkg/github/models/pull_request_escaped_head_escaped_repo_escaped_license.go new file mode 100644 index 00000000..fa29afcc --- /dev/null +++ b/pkg/github/models/pull_request_escaped_head_escaped_repo_escaped_license.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_head_repo_license 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 key property + key *string + // The name property + name *string + // The node_id property + node_id *string + // The spdx_id property + spdx_id *string + // The url property + url *string +} +// NewPullRequest_head_repo_license instantiates a new PullRequest_head_repo_license and sets the default values. +func NewPullRequest_head_repo_license()(*PullRequest_head_repo_license) { + m := &PullRequest_head_repo_license{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_head_repo_licenseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_head_repo_licenseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_head_repo_license(), 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 *PullRequest_head_repo_license) 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 *PullRequest_head_repo_license) 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["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["spdx_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSpdxId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *PullRequest_head_repo_license) GetKey()(*string) { + return m.key +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PullRequest_head_repo_license) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_head_repo_license) GetNodeId()(*string) { + return m.node_id +} +// GetSpdxId gets the spdx_id property value. The spdx_id property +// returns a *string when successful +func (m *PullRequest_head_repo_license) GetSpdxId()(*string) { + return m.spdx_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_head_repo_license) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequest_head_repo_license) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("spdx_id", m.GetSpdxId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequest_head_repo_license) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The key property +func (m *PullRequest_head_repo_license) SetKey(value *string)() { + m.key = value +} +// SetName sets the name property value. The name property +func (m *PullRequest_head_repo_license) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_head_repo_license) SetNodeId(value *string)() { + m.node_id = value +} +// SetSpdxId sets the spdx_id property value. The spdx_id property +func (m *PullRequest_head_repo_license) SetSpdxId(value *string)() { + m.spdx_id = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_head_repo_license) SetUrl(value *string)() { + m.url = value +} +type PullRequest_head_repo_licenseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetName()(*string) + GetNodeId()(*string) + GetSpdxId()(*string) + GetUrl()(*string) + SetKey(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetSpdxId(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pull_request_escaped_head_escaped_repo_escaped_owner.go b/pkg/github/models/pull_request_escaped_head_escaped_repo_escaped_owner.go new file mode 100644 index 00000000..fc90b908 --- /dev/null +++ b/pkg/github/models/pull_request_escaped_head_escaped_repo_escaped_owner.go @@ -0,0 +1,573 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_head_repo_owner 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 avatar_url property + avatar_url *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int32 + // The login property + login *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewPullRequest_head_repo_owner instantiates a new PullRequest_head_repo_owner and sets the default values. +func NewPullRequest_head_repo_owner()(*PullRequest_head_repo_owner) { + m := &PullRequest_head_repo_owner{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_head_repo_ownerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_head_repo_ownerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_head_repo_owner(), 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 *PullRequest_head_repo_owner) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_head_repo_owner) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *PullRequest_head_repo_owner) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetLogin()(*string) { + return m.login +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *PullRequest_head_repo_owner) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_head_repo_owner) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequest_head_repo_owner) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequest_head_repo_owner) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *PullRequest_head_repo_owner) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PullRequest_head_repo_owner) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *PullRequest_head_repo_owner) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *PullRequest_head_repo_owner) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *PullRequest_head_repo_owner) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *PullRequest_head_repo_owner) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequest_head_repo_owner) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequest_head_repo_owner) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *PullRequest_head_repo_owner) SetLogin(value *string)() { + m.login = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_head_repo_owner) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *PullRequest_head_repo_owner) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *PullRequest_head_repo_owner) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *PullRequest_head_repo_owner) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *PullRequest_head_repo_owner) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *PullRequest_head_repo_owner) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *PullRequest_head_repo_owner) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *PullRequest_head_repo_owner) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_head_repo_owner) SetUrl(value *string)() { + m.url = value +} +type PullRequest_head_repo_ownerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLogin()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pull_request_escaped_head_escaped_repo_escaped_permissions.go b/pkg/github/models/pull_request_escaped_head_escaped_repo_escaped_permissions.go new file mode 100644 index 00000000..fa9bee53 --- /dev/null +++ b/pkg/github/models/pull_request_escaped_head_escaped_repo_escaped_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_head_repo_permissions 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 admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewPullRequest_head_repo_permissions instantiates a new PullRequest_head_repo_permissions and sets the default values. +func NewPullRequest_head_repo_permissions()(*PullRequest_head_repo_permissions) { + m := &PullRequest_head_repo_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_head_repo_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_head_repo_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_head_repo_permissions(), 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 *PullRequest_head_repo_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *PullRequest_head_repo_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_head_repo_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *PullRequest_head_repo_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *PullRequest_head_repo_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *PullRequest_head_repo_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *PullRequest_head_repo_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *PullRequest_head_repo_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *PullRequest_head_repo_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *PullRequest_head_repo_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *PullRequest_head_repo_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *PullRequest_head_repo_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *PullRequest_head_repo_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *PullRequest_head_repo_permissions) SetTriage(value *bool)() { + m.triage = value +} +type PullRequest_head_repo_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/pkg/github/models/pull_request_escaped_head_escaped_user.go b/pkg/github/models/pull_request_escaped_head_escaped_user.go new file mode 100644 index 00000000..9dc93398 --- /dev/null +++ b/pkg/github/models/pull_request_escaped_head_escaped_user.go @@ -0,0 +1,573 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_head_user 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 avatar_url property + avatar_url *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int64 + // The login property + login *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewPullRequest_head_user instantiates a new PullRequest_head_user and sets the default values. +func NewPullRequest_head_user()(*PullRequest_head_user) { + m := &PullRequest_head_user{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_head_userFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_head_userFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_head_user(), 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 *PullRequest_head_user) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequest_head_user) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *PullRequest_head_user) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequest_head_user) GetId()(*int64) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *PullRequest_head_user) GetLogin()(*string) { + return m.login +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_head_user) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *PullRequest_head_user) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *PullRequest_head_user) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *PullRequest_head_user) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_head_user) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequest_head_user) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequest_head_user) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *PullRequest_head_user) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *PullRequest_head_user) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *PullRequest_head_user) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *PullRequest_head_user) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *PullRequest_head_user) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *PullRequest_head_user) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequest_head_user) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequest_head_user) SetId(value *int64)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *PullRequest_head_user) SetLogin(value *string)() { + m.login = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_head_user) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *PullRequest_head_user) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *PullRequest_head_user) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *PullRequest_head_user) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *PullRequest_head_user) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *PullRequest_head_user) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *PullRequest_head_user) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *PullRequest_head_user) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_head_user) SetUrl(value *string)() { + m.url = value +} +type PullRequest_head_userable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLogin()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLogin(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pull_request_escaped_labels.go b/pkg/github/models/pull_request_escaped_labels.go new file mode 100644 index 00000000..c1f0e286 --- /dev/null +++ b/pkg/github/models/pull_request_escaped_labels.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequest_labels 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 color property + color *string + // The default property + defaultEscaped *bool + // The description property + description *string + // The id property + id *int64 + // The name property + name *string + // The node_id property + node_id *string + // The url property + url *string +} +// NewPullRequest_labels instantiates a new PullRequest_labels and sets the default values. +func NewPullRequest_labels()(*PullRequest_labels) { + m := &PullRequest_labels{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequest_labelsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequest_labelsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequest_labels(), 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 *PullRequest_labels) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The color property +// returns a *string when successful +func (m *PullRequest_labels) GetColor()(*string) { + return m.color +} +// GetDefaultEscaped gets the default property value. The default property +// returns a *bool when successful +func (m *PullRequest_labels) GetDefaultEscaped()(*bool) { + return m.defaultEscaped +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *PullRequest_labels) 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 *PullRequest_labels) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultEscaped(val) + } + 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequest_labels) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PullRequest_labels) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequest_labels) GetNodeId()(*string) { + return m.node_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequest_labels) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequest_labels) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("default", m.GetDefaultEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequest_labels) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The color property +func (m *PullRequest_labels) SetColor(value *string)() { + m.color = value +} +// SetDefaultEscaped sets the default property value. The default property +func (m *PullRequest_labels) SetDefaultEscaped(value *bool)() { + m.defaultEscaped = value +} +// SetDescription sets the description property value. The description property +func (m *PullRequest_labels) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The id property +func (m *PullRequest_labels) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *PullRequest_labels) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequest_labels) SetNodeId(value *string)() { + m.node_id = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequest_labels) SetUrl(value *string)() { + m.url = value +} +type PullRequest_labelsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetDefaultEscaped()(*bool) + GetDescription()(*string) + GetId()(*int64) + GetName()(*string) + GetNodeId()(*string) + GetUrl()(*string) + SetColor(value *string)() + SetDefaultEscaped(value *bool)() + SetDescription(value *string)() + SetId(value *int64)() + SetName(value *string)() + SetNodeId(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pull_request_escaped_state.go b/pkg/github/models/pull_request_escaped_state.go new file mode 100644 index 00000000..73d6b034 --- /dev/null +++ b/pkg/github/models/pull_request_escaped_state.go @@ -0,0 +1,34 @@ +package models +// State of this Pull Request. Either `open` or `closed`. +type PullRequest_state int + +const ( + OPEN_PULLREQUEST_STATE PullRequest_state = iota + CLOSED_PULLREQUEST_STATE +) + +func (i PullRequest_state) String() string { + return []string{"open", "closed"}[i] +} +func ParsePullRequest_state(v string) (any, error) { + result := OPEN_PULLREQUEST_STATE + switch v { + case "open": + result = OPEN_PULLREQUEST_STATE + case "closed": + result = CLOSED_PULLREQUEST_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializePullRequest_state(values []PullRequest_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequest_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/pull_request_merge_result.go b/pkg/github/models/pull_request_merge_result.go new file mode 100644 index 00000000..69c858f2 --- /dev/null +++ b/pkg/github/models/pull_request_merge_result.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PullRequestMergeResult pull Request Merge Result +type PullRequestMergeResult 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 merged property + merged *bool + // The message property + message *string + // The sha property + sha *string +} +// NewPullRequestMergeResult instantiates a new PullRequestMergeResult and sets the default values. +func NewPullRequestMergeResult()(*PullRequestMergeResult) { + m := &PullRequestMergeResult{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestMergeResultFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestMergeResultFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestMergeResult(), 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 *PullRequestMergeResult) 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 *PullRequestMergeResult) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["merged"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMerged(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 + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetMerged gets the merged property value. The merged property +// returns a *bool when successful +func (m *PullRequestMergeResult) GetMerged()(*bool) { + return m.merged +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *PullRequestMergeResult) GetMessage()(*string) { + return m.message +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *PullRequestMergeResult) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *PullRequestMergeResult) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("merged", m.GetMerged()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *PullRequestMergeResult) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMerged sets the merged property value. The merged property +func (m *PullRequestMergeResult) SetMerged(value *bool)() { + m.merged = value +} +// SetMessage sets the message property value. The message property +func (m *PullRequestMergeResult) SetMessage(value *string)() { + m.message = value +} +// SetSha sets the sha property value. The sha property +func (m *PullRequestMergeResult) SetSha(value *string)() { + m.sha = value +} +type PullRequestMergeResultable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMerged()(*bool) + GetMessage()(*string) + GetSha()(*string) + SetMerged(value *bool)() + SetMessage(value *string)() + SetSha(value *string)() +} diff --git a/pkg/github/models/pull_request_minimal.go b/pkg/github/models/pull_request_minimal.go new file mode 100644 index 00000000..d7c372cd --- /dev/null +++ b/pkg/github/models/pull_request_minimal.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestMinimal 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 base property + base PullRequestMinimal_baseable + // The head property + head PullRequestMinimal_headable + // The id property + id *int64 + // The number property + number *int32 + // The url property + url *string +} +// NewPullRequestMinimal instantiates a new PullRequestMinimal and sets the default values. +func NewPullRequestMinimal()(*PullRequestMinimal) { + m := &PullRequestMinimal{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestMinimalFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestMinimalFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestMinimal(), 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 *PullRequestMinimal) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBase gets the base property value. The base property +// returns a PullRequestMinimal_baseable when successful +func (m *PullRequestMinimal) GetBase()(PullRequestMinimal_baseable) { + return m.base +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestMinimal) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestMinimal_baseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBase(val.(PullRequestMinimal_baseable)) + } + return nil + } + res["head"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestMinimal_headFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHead(val.(PullRequestMinimal_headable)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHead gets the head property value. The head property +// returns a PullRequestMinimal_headable when successful +func (m *PullRequestMinimal) GetHead()(PullRequestMinimal_headable) { + return m.head +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequestMinimal) GetId()(*int64) { + return m.id +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *PullRequestMinimal) GetNumber()(*int32) { + return m.number +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequestMinimal) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequestMinimal) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("base", m.GetBase()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("head", m.GetHead()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequestMinimal) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBase sets the base property value. The base property +func (m *PullRequestMinimal) SetBase(value PullRequestMinimal_baseable)() { + m.base = value +} +// SetHead sets the head property value. The head property +func (m *PullRequestMinimal) SetHead(value PullRequestMinimal_headable)() { + m.head = value +} +// SetId sets the id property value. The id property +func (m *PullRequestMinimal) SetId(value *int64)() { + m.id = value +} +// SetNumber sets the number property value. The number property +func (m *PullRequestMinimal) SetNumber(value *int32)() { + m.number = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequestMinimal) SetUrl(value *string)() { + m.url = value +} +type PullRequestMinimalable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBase()(PullRequestMinimal_baseable) + GetHead()(PullRequestMinimal_headable) + GetId()(*int64) + GetNumber()(*int32) + GetUrl()(*string) + SetBase(value PullRequestMinimal_baseable)() + SetHead(value PullRequestMinimal_headable)() + SetId(value *int64)() + SetNumber(value *int32)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pull_request_minimal_escaped_base.go b/pkg/github/models/pull_request_minimal_escaped_base.go new file mode 100644 index 00000000..c2475b8f --- /dev/null +++ b/pkg/github/models/pull_request_minimal_escaped_base.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestMinimal_base 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 ref property + ref *string + // The repo property + repo PullRequestMinimal_base_repoable + // The sha property + sha *string +} +// NewPullRequestMinimal_base instantiates a new PullRequestMinimal_base and sets the default values. +func NewPullRequestMinimal_base()(*PullRequestMinimal_base) { + m := &PullRequestMinimal_base{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestMinimal_baseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestMinimal_baseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestMinimal_base(), 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 *PullRequestMinimal_base) 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 *PullRequestMinimal_base) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestMinimal_base_repoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepo(val.(PullRequestMinimal_base_repoable)) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *PullRequestMinimal_base) GetRef()(*string) { + return m.ref +} +// GetRepo gets the repo property value. The repo property +// returns a PullRequestMinimal_base_repoable when successful +func (m *PullRequestMinimal_base) GetRepo()(PullRequestMinimal_base_repoable) { + return m.repo +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *PullRequestMinimal_base) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *PullRequestMinimal_base) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *PullRequestMinimal_base) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRef sets the ref property value. The ref property +func (m *PullRequestMinimal_base) SetRef(value *string)() { + m.ref = value +} +// SetRepo sets the repo property value. The repo property +func (m *PullRequestMinimal_base) SetRepo(value PullRequestMinimal_base_repoable)() { + m.repo = value +} +// SetSha sets the sha property value. The sha property +func (m *PullRequestMinimal_base) SetSha(value *string)() { + m.sha = value +} +type PullRequestMinimal_baseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRef()(*string) + GetRepo()(PullRequestMinimal_base_repoable) + GetSha()(*string) + SetRef(value *string)() + SetRepo(value PullRequestMinimal_base_repoable)() + SetSha(value *string)() +} diff --git a/pkg/github/models/pull_request_minimal_escaped_base_escaped_repo.go b/pkg/github/models/pull_request_minimal_escaped_base_escaped_repo.go new file mode 100644 index 00000000..3651138f --- /dev/null +++ b/pkg/github/models/pull_request_minimal_escaped_base_escaped_repo.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestMinimal_base_repo struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int64 + // The name property + name *string + // The url property + url *string +} +// NewPullRequestMinimal_base_repo instantiates a new PullRequestMinimal_base_repo and sets the default values. +func NewPullRequestMinimal_base_repo()(*PullRequestMinimal_base_repo) { + m := &PullRequestMinimal_base_repo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestMinimal_base_repoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestMinimal_base_repoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestMinimal_base_repo(), 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 *PullRequestMinimal_base_repo) 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 *PullRequestMinimal_base_repo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequestMinimal_base_repo) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PullRequestMinimal_base_repo) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequestMinimal_base_repo) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequestMinimal_base_repo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequestMinimal_base_repo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *PullRequestMinimal_base_repo) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *PullRequestMinimal_base_repo) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequestMinimal_base_repo) SetUrl(value *string)() { + m.url = value +} +type PullRequestMinimal_base_repoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int64) + GetName()(*string) + GetUrl()(*string) + SetId(value *int64)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pull_request_minimal_escaped_head.go b/pkg/github/models/pull_request_minimal_escaped_head.go new file mode 100644 index 00000000..c8368738 --- /dev/null +++ b/pkg/github/models/pull_request_minimal_escaped_head.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestMinimal_head 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 ref property + ref *string + // The repo property + repo PullRequestMinimal_head_repoable + // The sha property + sha *string +} +// NewPullRequestMinimal_head instantiates a new PullRequestMinimal_head and sets the default values. +func NewPullRequestMinimal_head()(*PullRequestMinimal_head) { + m := &PullRequestMinimal_head{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestMinimal_headFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestMinimal_headFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestMinimal_head(), 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 *PullRequestMinimal_head) 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 *PullRequestMinimal_head) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestMinimal_head_repoFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepo(val.(PullRequestMinimal_head_repoable)) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *PullRequestMinimal_head) GetRef()(*string) { + return m.ref +} +// GetRepo gets the repo property value. The repo property +// returns a PullRequestMinimal_head_repoable when successful +func (m *PullRequestMinimal_head) GetRepo()(PullRequestMinimal_head_repoable) { + return m.repo +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *PullRequestMinimal_head) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *PullRequestMinimal_head) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *PullRequestMinimal_head) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRef sets the ref property value. The ref property +func (m *PullRequestMinimal_head) SetRef(value *string)() { + m.ref = value +} +// SetRepo sets the repo property value. The repo property +func (m *PullRequestMinimal_head) SetRepo(value PullRequestMinimal_head_repoable)() { + m.repo = value +} +// SetSha sets the sha property value. The sha property +func (m *PullRequestMinimal_head) SetSha(value *string)() { + m.sha = value +} +type PullRequestMinimal_headable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRef()(*string) + GetRepo()(PullRequestMinimal_head_repoable) + GetSha()(*string) + SetRef(value *string)() + SetRepo(value PullRequestMinimal_head_repoable)() + SetSha(value *string)() +} diff --git a/pkg/github/models/pull_request_minimal_escaped_head_escaped_repo.go b/pkg/github/models/pull_request_minimal_escaped_head_escaped_repo.go new file mode 100644 index 00000000..8851842c --- /dev/null +++ b/pkg/github/models/pull_request_minimal_escaped_head_escaped_repo.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestMinimal_head_repo struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int64 + // The name property + name *string + // The url property + url *string +} +// NewPullRequestMinimal_head_repo instantiates a new PullRequestMinimal_head_repo and sets the default values. +func NewPullRequestMinimal_head_repo()(*PullRequestMinimal_head_repo) { + m := &PullRequestMinimal_head_repo{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestMinimal_head_repoFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestMinimal_head_repoFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestMinimal_head_repo(), 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 *PullRequestMinimal_head_repo) 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 *PullRequestMinimal_head_repo) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequestMinimal_head_repo) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PullRequestMinimal_head_repo) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequestMinimal_head_repo) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequestMinimal_head_repo) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequestMinimal_head_repo) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *PullRequestMinimal_head_repo) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *PullRequestMinimal_head_repo) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequestMinimal_head_repo) SetUrl(value *string)() { + m.url = value +} +type PullRequestMinimal_head_repoable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int64) + GetName()(*string) + GetUrl()(*string) + SetId(value *int64)() + SetName(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pull_request_review.go b/pkg/github/models/pull_request_review.go new file mode 100644 index 00000000..159a3191 --- /dev/null +++ b/pkg/github/models/pull_request_review.go @@ -0,0 +1,431 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PullRequestReview pull Request Reviews are reviews on pull requests. +type PullRequestReview struct { + // The _links property + _links PullRequestReview__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // The text of the review. + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // A commit SHA for the review. If the commit object was garbage collected or forcibly deleted, then it no longer exists in Git and this value will be `null`. + commit_id *string + // The html_url property + html_url *string + // Unique identifier of the review + id *int64 + // The node_id property + node_id *string + // The pull_request_url property + pull_request_url *string + // The state property + state *string + // The submitted_at property + submitted_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + user NullableSimpleUserable +} +// NewPullRequestReview instantiates a new PullRequestReview and sets the default values. +func NewPullRequestReview()(*PullRequestReview) { + m := &PullRequestReview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReview(), 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 *PullRequestReview) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *PullRequestReview) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. The text of the review. +// returns a *string when successful +func (m *PullRequestReview) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *PullRequestReview) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *PullRequestReview) GetBodyText()(*string) { + return m.body_text +} +// GetCommitId gets the commit_id property value. A commit SHA for the review. If the commit object was garbage collected or forcibly deleted, then it no longer exists in Git and this value will be `null`. +// returns a *string when successful +func (m *PullRequestReview) GetCommitId()(*string) { + return m.commit_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestReview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestReview__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(PullRequestReview__linksable)) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["pull_request_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["submitted_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetSubmittedAt(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequestReview) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the review +// returns a *int64 when successful +func (m *PullRequestReview) GetId()(*int64) { + return m.id +} +// GetLinks gets the _links property value. The _links property +// returns a PullRequestReview__linksable when successful +func (m *PullRequestReview) GetLinks()(PullRequestReview__linksable) { + return m._links +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequestReview) GetNodeId()(*string) { + return m.node_id +} +// GetPullRequestUrl gets the pull_request_url property value. The pull_request_url property +// returns a *string when successful +func (m *PullRequestReview) GetPullRequestUrl()(*string) { + return m.pull_request_url +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *PullRequestReview) GetState()(*string) { + return m.state +} +// GetSubmittedAt gets the submitted_at property value. The submitted_at property +// returns a *Time when successful +func (m *PullRequestReview) GetSubmittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.submitted_at +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PullRequestReview) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequestReview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pull_request_url", m.GetPullRequestUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("submitted_at", m.GetSubmittedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *PullRequestReview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *PullRequestReview) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. The text of the review. +func (m *PullRequestReview) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *PullRequestReview) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *PullRequestReview) SetBodyText(value *string)() { + m.body_text = value +} +// SetCommitId sets the commit_id property value. A commit SHA for the review. If the commit object was garbage collected or forcibly deleted, then it no longer exists in Git and this value will be `null`. +func (m *PullRequestReview) SetCommitId(value *string)() { + m.commit_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequestReview) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the review +func (m *PullRequestReview) SetId(value *int64)() { + m.id = value +} +// SetLinks sets the _links property value. The _links property +func (m *PullRequestReview) SetLinks(value PullRequestReview__linksable)() { + m._links = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequestReview) SetNodeId(value *string)() { + m.node_id = value +} +// SetPullRequestUrl sets the pull_request_url property value. The pull_request_url property +func (m *PullRequestReview) SetPullRequestUrl(value *string)() { + m.pull_request_url = value +} +// SetState sets the state property value. The state property +func (m *PullRequestReview) SetState(value *string)() { + m.state = value +} +// SetSubmittedAt sets the submitted_at property value. The submitted_at property +func (m *PullRequestReview) SetSubmittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.submitted_at = value +} +// SetUser sets the user property value. A GitHub user. +func (m *PullRequestReview) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type PullRequestReviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetCommitId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLinks()(PullRequestReview__linksable) + GetNodeId()(*string) + GetPullRequestUrl()(*string) + GetState()(*string) + GetSubmittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUser()(NullableSimpleUserable) + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetCommitId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLinks(value PullRequestReview__linksable)() + SetNodeId(value *string)() + SetPullRequestUrl(value *string)() + SetState(value *string)() + SetSubmittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/pull_request_review_comment.go b/pkg/github/models/pull_request_review_comment.go new file mode 100644 index 00000000..fcbc299d --- /dev/null +++ b/pkg/github/models/pull_request_review_comment.go @@ -0,0 +1,902 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PullRequestReviewComment pull Request Review Comments are comments on a portion of the Pull Request's diff. +type PullRequestReviewComment struct { + // The _links property + _links PullRequestReviewComment__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // The text of the comment. + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The SHA of the commit to which the comment applies. + commit_id *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The diff of the line that the comment refers to. + diff_hunk *string + // HTML URL for the pull request review comment. + html_url *string + // The ID of the pull request review comment. + id *int64 + // The comment ID to reply to. + in_reply_to_id *int32 + // The line of the blob to which the comment applies. The last line of the range for a multi-line comment + line *int32 + // The node ID of the pull request review comment. + node_id *string + // The SHA of the original commit to which the comment applies. + original_commit_id *string + // The line of the blob to which the comment applies. The last line of the range for a multi-line comment + original_line *int32 + // The index of the original line in the diff to which the comment applies. This field is deprecated; use `original_line` instead. + original_position *int32 + // The first line of the range for a multi-line comment. + original_start_line *int32 + // The relative path of the file to which the comment applies. + path *string + // The line index in the diff to which the comment applies. This field is deprecated; use `line` instead. + position *int32 + // The ID of the pull request review to which the comment belongs. + pull_request_review_id *int64 + // URL for the pull request that the review comment belongs to. + pull_request_url *string + // The reactions property + reactions ReactionRollupable + // The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment + side *PullRequestReviewComment_side + // The first line of the range for a multi-line comment. + start_line *int32 + // The side of the first line of the range for a multi-line comment. + start_side *PullRequestReviewComment_start_side + // The level at which the comment is targeted, can be a diff line or a file. + subject_type *PullRequestReviewComment_subject_type + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // URL for the pull request review comment + url *string + // A GitHub user. + user SimpleUserable +} +// NewPullRequestReviewComment instantiates a new PullRequestReviewComment and sets the default values. +func NewPullRequestReviewComment()(*PullRequestReviewComment) { + m := &PullRequestReviewComment{ + } + m.SetAdditionalData(make(map[string]any)) + sideValue := RIGHT_PULLREQUESTREVIEWCOMMENT_SIDE + m.SetSide(&sideValue) + start_sideValue := RIGHT_PULLREQUESTREVIEWCOMMENT_START_SIDE + m.SetStartSide(&start_sideValue) + return m +} +// CreatePullRequestReviewCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReviewCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReviewComment(), 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 *PullRequestReviewComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *PullRequestReviewComment) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. The text of the comment. +// returns a *string when successful +func (m *PullRequestReviewComment) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *PullRequestReviewComment) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *PullRequestReviewComment) GetBodyText()(*string) { + return m.body_text +} +// GetCommitId gets the commit_id property value. The SHA of the commit to which the comment applies. +// returns a *string when successful +func (m *PullRequestReviewComment) GetCommitId()(*string) { + return m.commit_id +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PullRequestReviewComment) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDiffHunk gets the diff_hunk property value. The diff of the line that the comment refers to. +// returns a *string when successful +func (m *PullRequestReviewComment) GetDiffHunk()(*string) { + return m.diff_hunk +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestReviewComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestReviewComment__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(PullRequestReviewComment__linksable)) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + 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["diff_hunk"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffHunk(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["in_reply_to_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInReplyToId(val) + } + return nil + } + res["line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLine(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["original_commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOriginalCommitId(val) + } + return nil + } + res["original_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOriginalLine(val) + } + return nil + } + res["original_position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOriginalPosition(val) + } + return nil + } + res["original_start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOriginalStartLine(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + res["pull_request_review_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestReviewId(val) + } + return nil + } + res["pull_request_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestUrl(val) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["side"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequestReviewComment_side) + if err != nil { + return err + } + if val != nil { + m.SetSide(val.(*PullRequestReviewComment_side)) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + res["start_side"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequestReviewComment_start_side) + if err != nil { + return err + } + if val != nil { + m.SetStartSide(val.(*PullRequestReviewComment_start_side)) + } + return nil + } + res["subject_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequestReviewComment_subject_type) + if err != nil { + return err + } + if val != nil { + m.SetSubjectType(val.(*PullRequestReviewComment_subject_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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. HTML URL for the pull request review comment. +// returns a *string when successful +func (m *PullRequestReviewComment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The ID of the pull request review comment. +// returns a *int64 when successful +func (m *PullRequestReviewComment) GetId()(*int64) { + return m.id +} +// GetInReplyToId gets the in_reply_to_id property value. The comment ID to reply to. +// returns a *int32 when successful +func (m *PullRequestReviewComment) GetInReplyToId()(*int32) { + return m.in_reply_to_id +} +// GetLine gets the line property value. The line of the blob to which the comment applies. The last line of the range for a multi-line comment +// returns a *int32 when successful +func (m *PullRequestReviewComment) GetLine()(*int32) { + return m.line +} +// GetLinks gets the _links property value. The _links property +// returns a PullRequestReviewComment__linksable when successful +func (m *PullRequestReviewComment) GetLinks()(PullRequestReviewComment__linksable) { + return m._links +} +// GetNodeId gets the node_id property value. The node ID of the pull request review comment. +// returns a *string when successful +func (m *PullRequestReviewComment) GetNodeId()(*string) { + return m.node_id +} +// GetOriginalCommitId gets the original_commit_id property value. The SHA of the original commit to which the comment applies. +// returns a *string when successful +func (m *PullRequestReviewComment) GetOriginalCommitId()(*string) { + return m.original_commit_id +} +// GetOriginalLine gets the original_line property value. The line of the blob to which the comment applies. The last line of the range for a multi-line comment +// returns a *int32 when successful +func (m *PullRequestReviewComment) GetOriginalLine()(*int32) { + return m.original_line +} +// GetOriginalPosition gets the original_position property value. The index of the original line in the diff to which the comment applies. This field is deprecated; use `original_line` instead. +// returns a *int32 when successful +func (m *PullRequestReviewComment) GetOriginalPosition()(*int32) { + return m.original_position +} +// GetOriginalStartLine gets the original_start_line property value. The first line of the range for a multi-line comment. +// returns a *int32 when successful +func (m *PullRequestReviewComment) GetOriginalStartLine()(*int32) { + return m.original_start_line +} +// GetPath gets the path property value. The relative path of the file to which the comment applies. +// returns a *string when successful +func (m *PullRequestReviewComment) GetPath()(*string) { + return m.path +} +// GetPosition gets the position property value. The line index in the diff to which the comment applies. This field is deprecated; use `line` instead. +// returns a *int32 when successful +func (m *PullRequestReviewComment) GetPosition()(*int32) { + return m.position +} +// GetPullRequestReviewId gets the pull_request_review_id property value. The ID of the pull request review to which the comment belongs. +// returns a *int64 when successful +func (m *PullRequestReviewComment) GetPullRequestReviewId()(*int64) { + return m.pull_request_review_id +} +// GetPullRequestUrl gets the pull_request_url property value. URL for the pull request that the review comment belongs to. +// returns a *string when successful +func (m *PullRequestReviewComment) GetPullRequestUrl()(*string) { + return m.pull_request_url +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *PullRequestReviewComment) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetSide gets the side property value. The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment +// returns a *PullRequestReviewComment_side when successful +func (m *PullRequestReviewComment) GetSide()(*PullRequestReviewComment_side) { + return m.side +} +// GetStartLine gets the start_line property value. The first line of the range for a multi-line comment. +// returns a *int32 when successful +func (m *PullRequestReviewComment) GetStartLine()(*int32) { + return m.start_line +} +// GetStartSide gets the start_side property value. The side of the first line of the range for a multi-line comment. +// returns a *PullRequestReviewComment_start_side when successful +func (m *PullRequestReviewComment) GetStartSide()(*PullRequestReviewComment_start_side) { + return m.start_side +} +// GetSubjectType gets the subject_type property value. The level at which the comment is targeted, can be a diff line or a file. +// returns a *PullRequestReviewComment_subject_type when successful +func (m *PullRequestReviewComment) GetSubjectType()(*PullRequestReviewComment_subject_type) { + return m.subject_type +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PullRequestReviewComment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. URL for the pull request review comment +// returns a *string when successful +func (m *PullRequestReviewComment) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *PullRequestReviewComment) GetUser()(SimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequestReviewComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("diff_hunk", m.GetDiffHunk()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("in_reply_to_id", m.GetInReplyToId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("line", m.GetLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("original_commit_id", m.GetOriginalCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("original_line", m.GetOriginalLine()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("original_position", m.GetOriginalPosition()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("original_start_line", m.GetOriginalStartLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("position", m.GetPosition()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("pull_request_review_id", m.GetPullRequestReviewId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pull_request_url", m.GetPullRequestUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + if m.GetSide() != nil { + cast := (*m.GetSide()).String() + err := writer.WriteStringValue("side", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("start_line", m.GetStartLine()) + if err != nil { + return err + } + } + if m.GetStartSide() != nil { + cast := (*m.GetStartSide()).String() + err := writer.WriteStringValue("start_side", &cast) + if err != nil { + return err + } + } + if m.GetSubjectType() != nil { + cast := (*m.GetSubjectType()).String() + err := writer.WriteStringValue("subject_type", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *PullRequestReviewComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *PullRequestReviewComment) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. The text of the comment. +func (m *PullRequestReviewComment) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *PullRequestReviewComment) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *PullRequestReviewComment) SetBodyText(value *string)() { + m.body_text = value +} +// SetCommitId sets the commit_id property value. The SHA of the commit to which the comment applies. +func (m *PullRequestReviewComment) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PullRequestReviewComment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDiffHunk sets the diff_hunk property value. The diff of the line that the comment refers to. +func (m *PullRequestReviewComment) SetDiffHunk(value *string)() { + m.diff_hunk = value +} +// SetHtmlUrl sets the html_url property value. HTML URL for the pull request review comment. +func (m *PullRequestReviewComment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The ID of the pull request review comment. +func (m *PullRequestReviewComment) SetId(value *int64)() { + m.id = value +} +// SetInReplyToId sets the in_reply_to_id property value. The comment ID to reply to. +func (m *PullRequestReviewComment) SetInReplyToId(value *int32)() { + m.in_reply_to_id = value +} +// SetLine sets the line property value. The line of the blob to which the comment applies. The last line of the range for a multi-line comment +func (m *PullRequestReviewComment) SetLine(value *int32)() { + m.line = value +} +// SetLinks sets the _links property value. The _links property +func (m *PullRequestReviewComment) SetLinks(value PullRequestReviewComment__linksable)() { + m._links = value +} +// SetNodeId sets the node_id property value. The node ID of the pull request review comment. +func (m *PullRequestReviewComment) SetNodeId(value *string)() { + m.node_id = value +} +// SetOriginalCommitId sets the original_commit_id property value. The SHA of the original commit to which the comment applies. +func (m *PullRequestReviewComment) SetOriginalCommitId(value *string)() { + m.original_commit_id = value +} +// SetOriginalLine sets the original_line property value. The line of the blob to which the comment applies. The last line of the range for a multi-line comment +func (m *PullRequestReviewComment) SetOriginalLine(value *int32)() { + m.original_line = value +} +// SetOriginalPosition sets the original_position property value. The index of the original line in the diff to which the comment applies. This field is deprecated; use `original_line` instead. +func (m *PullRequestReviewComment) SetOriginalPosition(value *int32)() { + m.original_position = value +} +// SetOriginalStartLine sets the original_start_line property value. The first line of the range for a multi-line comment. +func (m *PullRequestReviewComment) SetOriginalStartLine(value *int32)() { + m.original_start_line = value +} +// SetPath sets the path property value. The relative path of the file to which the comment applies. +func (m *PullRequestReviewComment) SetPath(value *string)() { + m.path = value +} +// SetPosition sets the position property value. The line index in the diff to which the comment applies. This field is deprecated; use `line` instead. +func (m *PullRequestReviewComment) SetPosition(value *int32)() { + m.position = value +} +// SetPullRequestReviewId sets the pull_request_review_id property value. The ID of the pull request review to which the comment belongs. +func (m *PullRequestReviewComment) SetPullRequestReviewId(value *int64)() { + m.pull_request_review_id = value +} +// SetPullRequestUrl sets the pull_request_url property value. URL for the pull request that the review comment belongs to. +func (m *PullRequestReviewComment) SetPullRequestUrl(value *string)() { + m.pull_request_url = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *PullRequestReviewComment) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetSide sets the side property value. The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment +func (m *PullRequestReviewComment) SetSide(value *PullRequestReviewComment_side)() { + m.side = value +} +// SetStartLine sets the start_line property value. The first line of the range for a multi-line comment. +func (m *PullRequestReviewComment) SetStartLine(value *int32)() { + m.start_line = value +} +// SetStartSide sets the start_side property value. The side of the first line of the range for a multi-line comment. +func (m *PullRequestReviewComment) SetStartSide(value *PullRequestReviewComment_start_side)() { + m.start_side = value +} +// SetSubjectType sets the subject_type property value. The level at which the comment is targeted, can be a diff line or a file. +func (m *PullRequestReviewComment) SetSubjectType(value *PullRequestReviewComment_subject_type)() { + m.subject_type = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PullRequestReviewComment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. URL for the pull request review comment +func (m *PullRequestReviewComment) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *PullRequestReviewComment) SetUser(value SimpleUserable)() { + m.user = value +} +type PullRequestReviewCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetCommitId()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDiffHunk()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetInReplyToId()(*int32) + GetLine()(*int32) + GetLinks()(PullRequestReviewComment__linksable) + GetNodeId()(*string) + GetOriginalCommitId()(*string) + GetOriginalLine()(*int32) + GetOriginalPosition()(*int32) + GetOriginalStartLine()(*int32) + GetPath()(*string) + GetPosition()(*int32) + GetPullRequestReviewId()(*int64) + GetPullRequestUrl()(*string) + GetReactions()(ReactionRollupable) + GetSide()(*PullRequestReviewComment_side) + GetStartLine()(*int32) + GetStartSide()(*PullRequestReviewComment_start_side) + GetSubjectType()(*PullRequestReviewComment_subject_type) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(SimpleUserable) + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetCommitId(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDiffHunk(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetInReplyToId(value *int32)() + SetLine(value *int32)() + SetLinks(value PullRequestReviewComment__linksable)() + SetNodeId(value *string)() + SetOriginalCommitId(value *string)() + SetOriginalLine(value *int32)() + SetOriginalPosition(value *int32)() + SetOriginalStartLine(value *int32)() + SetPath(value *string)() + SetPosition(value *int32)() + SetPullRequestReviewId(value *int64)() + SetPullRequestUrl(value *string)() + SetReactions(value ReactionRollupable)() + SetSide(value *PullRequestReviewComment_side)() + SetStartLine(value *int32)() + SetStartSide(value *PullRequestReviewComment_start_side)() + SetSubjectType(value *PullRequestReviewComment_subject_type)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value SimpleUserable)() +} diff --git a/pkg/github/models/pull_request_review_comment_escaped__escaped_links.go b/pkg/github/models/pull_request_review_comment_escaped__escaped_links.go new file mode 100644 index 00000000..c5d7a9c7 --- /dev/null +++ b/pkg/github/models/pull_request_review_comment_escaped__escaped_links.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestReviewComment__links 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 html property + html PullRequestReviewComment__links_htmlable + // The pull_request property + pull_request PullRequestReviewComment__links_pull_requestable + // The self property + self PullRequestReviewComment__links_selfable +} +// NewPullRequestReviewComment__links instantiates a new PullRequestReviewComment__links and sets the default values. +func NewPullRequestReviewComment__links()(*PullRequestReviewComment__links) { + m := &PullRequestReviewComment__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReviewComment__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReviewComment__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReviewComment__links(), 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 *PullRequestReviewComment__links) 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 *PullRequestReviewComment__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestReviewComment__links_htmlFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHtml(val.(PullRequestReviewComment__links_htmlable)) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestReviewComment__links_pull_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(PullRequestReviewComment__links_pull_requestable)) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestReviewComment__links_selfFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSelf(val.(PullRequestReviewComment__links_selfable)) + } + return nil + } + return res +} +// GetHtml gets the html property value. The html property +// returns a PullRequestReviewComment__links_htmlable when successful +func (m *PullRequestReviewComment__links) GetHtml()(PullRequestReviewComment__links_htmlable) { + return m.html +} +// GetPullRequest gets the pull_request property value. The pull_request property +// returns a PullRequestReviewComment__links_pull_requestable when successful +func (m *PullRequestReviewComment__links) GetPullRequest()(PullRequestReviewComment__links_pull_requestable) { + return m.pull_request +} +// GetSelf gets the self property value. The self property +// returns a PullRequestReviewComment__links_selfable when successful +func (m *PullRequestReviewComment__links) GetSelf()(PullRequestReviewComment__links_selfable) { + return m.self +} +// Serialize serializes information the current object +func (m *PullRequestReviewComment__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("self", m.GetSelf()) + 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 *PullRequestReviewComment__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtml sets the html property value. The html property +func (m *PullRequestReviewComment__links) SetHtml(value PullRequestReviewComment__links_htmlable)() { + m.html = value +} +// SetPullRequest sets the pull_request property value. The pull_request property +func (m *PullRequestReviewComment__links) SetPullRequest(value PullRequestReviewComment__links_pull_requestable)() { + m.pull_request = value +} +// SetSelf sets the self property value. The self property +func (m *PullRequestReviewComment__links) SetSelf(value PullRequestReviewComment__links_selfable)() { + m.self = value +} +type PullRequestReviewComment__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtml()(PullRequestReviewComment__links_htmlable) + GetPullRequest()(PullRequestReviewComment__links_pull_requestable) + GetSelf()(PullRequestReviewComment__links_selfable) + SetHtml(value PullRequestReviewComment__links_htmlable)() + SetPullRequest(value PullRequestReviewComment__links_pull_requestable)() + SetSelf(value PullRequestReviewComment__links_selfable)() +} diff --git a/pkg/github/models/pull_request_review_comment_escaped__escaped_links_escaped_html.go b/pkg/github/models/pull_request_review_comment_escaped__escaped_links_escaped_html.go new file mode 100644 index 00000000..d2942613 --- /dev/null +++ b/pkg/github/models/pull_request_review_comment_escaped__escaped_links_escaped_html.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestReviewComment__links_html 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 href property + href *string +} +// NewPullRequestReviewComment__links_html instantiates a new PullRequestReviewComment__links_html and sets the default values. +func NewPullRequestReviewComment__links_html()(*PullRequestReviewComment__links_html) { + m := &PullRequestReviewComment__links_html{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReviewComment__links_htmlFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReviewComment__links_htmlFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReviewComment__links_html(), 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 *PullRequestReviewComment__links_html) 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 *PullRequestReviewComment__links_html) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *PullRequestReviewComment__links_html) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *PullRequestReviewComment__links_html) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *PullRequestReviewComment__links_html) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *PullRequestReviewComment__links_html) SetHref(value *string)() { + m.href = value +} +type PullRequestReviewComment__links_htmlable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/pkg/github/models/pull_request_review_comment_escaped__escaped_links_escaped_pull_escaped_request.go b/pkg/github/models/pull_request_review_comment_escaped__escaped_links_escaped_pull_escaped_request.go new file mode 100644 index 00000000..b7d904cb --- /dev/null +++ b/pkg/github/models/pull_request_review_comment_escaped__escaped_links_escaped_pull_escaped_request.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestReviewComment__links_pull_request 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 href property + href *string +} +// NewPullRequestReviewComment__links_pull_request instantiates a new PullRequestReviewComment__links_pull_request and sets the default values. +func NewPullRequestReviewComment__links_pull_request()(*PullRequestReviewComment__links_pull_request) { + m := &PullRequestReviewComment__links_pull_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReviewComment__links_pull_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReviewComment__links_pull_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReviewComment__links_pull_request(), 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 *PullRequestReviewComment__links_pull_request) 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 *PullRequestReviewComment__links_pull_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *PullRequestReviewComment__links_pull_request) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *PullRequestReviewComment__links_pull_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *PullRequestReviewComment__links_pull_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *PullRequestReviewComment__links_pull_request) SetHref(value *string)() { + m.href = value +} +type PullRequestReviewComment__links_pull_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/pkg/github/models/pull_request_review_comment_escaped__escaped_links_escaped_self.go b/pkg/github/models/pull_request_review_comment_escaped__escaped_links_escaped_self.go new file mode 100644 index 00000000..ae145723 --- /dev/null +++ b/pkg/github/models/pull_request_review_comment_escaped__escaped_links_escaped_self.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestReviewComment__links_self 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 href property + href *string +} +// NewPullRequestReviewComment__links_self instantiates a new PullRequestReviewComment__links_self and sets the default values. +func NewPullRequestReviewComment__links_self()(*PullRequestReviewComment__links_self) { + m := &PullRequestReviewComment__links_self{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReviewComment__links_selfFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReviewComment__links_selfFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReviewComment__links_self(), 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 *PullRequestReviewComment__links_self) 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 *PullRequestReviewComment__links_self) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *PullRequestReviewComment__links_self) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *PullRequestReviewComment__links_self) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *PullRequestReviewComment__links_self) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *PullRequestReviewComment__links_self) SetHref(value *string)() { + m.href = value +} +type PullRequestReviewComment__links_selfable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/pkg/github/models/pull_request_review_comment_escaped_side.go b/pkg/github/models/pull_request_review_comment_escaped_side.go new file mode 100644 index 00000000..1f0602a5 --- /dev/null +++ b/pkg/github/models/pull_request_review_comment_escaped_side.go @@ -0,0 +1,34 @@ +package models +// The side of the diff to which the comment applies. The side of the last line of the range for a multi-line comment +type PullRequestReviewComment_side int + +const ( + LEFT_PULLREQUESTREVIEWCOMMENT_SIDE PullRequestReviewComment_side = iota + RIGHT_PULLREQUESTREVIEWCOMMENT_SIDE +) + +func (i PullRequestReviewComment_side) String() string { + return []string{"LEFT", "RIGHT"}[i] +} +func ParsePullRequestReviewComment_side(v string) (any, error) { + result := LEFT_PULLREQUESTREVIEWCOMMENT_SIDE + switch v { + case "LEFT": + result = LEFT_PULLREQUESTREVIEWCOMMENT_SIDE + case "RIGHT": + result = RIGHT_PULLREQUESTREVIEWCOMMENT_SIDE + default: + return nil, nil + } + return &result, nil +} +func SerializePullRequestReviewComment_side(values []PullRequestReviewComment_side) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequestReviewComment_side) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/pull_request_review_comment_escaped_start_escaped_side.go b/pkg/github/models/pull_request_review_comment_escaped_start_escaped_side.go new file mode 100644 index 00000000..a644d4a5 --- /dev/null +++ b/pkg/github/models/pull_request_review_comment_escaped_start_escaped_side.go @@ -0,0 +1,34 @@ +package models +// The side of the first line of the range for a multi-line comment. +type PullRequestReviewComment_start_side int + +const ( + LEFT_PULLREQUESTREVIEWCOMMENT_START_SIDE PullRequestReviewComment_start_side = iota + RIGHT_PULLREQUESTREVIEWCOMMENT_START_SIDE +) + +func (i PullRequestReviewComment_start_side) String() string { + return []string{"LEFT", "RIGHT"}[i] +} +func ParsePullRequestReviewComment_start_side(v string) (any, error) { + result := LEFT_PULLREQUESTREVIEWCOMMENT_START_SIDE + switch v { + case "LEFT": + result = LEFT_PULLREQUESTREVIEWCOMMENT_START_SIDE + case "RIGHT": + result = RIGHT_PULLREQUESTREVIEWCOMMENT_START_SIDE + default: + return nil, nil + } + return &result, nil +} +func SerializePullRequestReviewComment_start_side(values []PullRequestReviewComment_start_side) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequestReviewComment_start_side) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/pull_request_review_comment_escaped_subject_escaped_type.go b/pkg/github/models/pull_request_review_comment_escaped_subject_escaped_type.go new file mode 100644 index 00000000..bb660791 --- /dev/null +++ b/pkg/github/models/pull_request_review_comment_escaped_subject_escaped_type.go @@ -0,0 +1,34 @@ +package models +// The level at which the comment is targeted, can be a diff line or a file. +type PullRequestReviewComment_subject_type int + +const ( + LINE_PULLREQUESTREVIEWCOMMENT_SUBJECT_TYPE PullRequestReviewComment_subject_type = iota + FILE_PULLREQUESTREVIEWCOMMENT_SUBJECT_TYPE +) + +func (i PullRequestReviewComment_subject_type) String() string { + return []string{"line", "file"}[i] +} +func ParsePullRequestReviewComment_subject_type(v string) (any, error) { + result := LINE_PULLREQUESTREVIEWCOMMENT_SUBJECT_TYPE + switch v { + case "line": + result = LINE_PULLREQUESTREVIEWCOMMENT_SUBJECT_TYPE + case "file": + result = FILE_PULLREQUESTREVIEWCOMMENT_SUBJECT_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializePullRequestReviewComment_subject_type(values []PullRequestReviewComment_subject_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequestReviewComment_subject_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/pull_request_review_escaped__escaped_links.go b/pkg/github/models/pull_request_review_escaped__escaped_links.go new file mode 100644 index 00000000..bf661f43 --- /dev/null +++ b/pkg/github/models/pull_request_review_escaped__escaped_links.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestReview__links 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 html property + html PullRequestReview__links_htmlable + // The pull_request property + pull_request PullRequestReview__links_pull_requestable +} +// NewPullRequestReview__links instantiates a new PullRequestReview__links and sets the default values. +func NewPullRequestReview__links()(*PullRequestReview__links) { + m := &PullRequestReview__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReview__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReview__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReview__links(), 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 *PullRequestReview__links) 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 *PullRequestReview__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestReview__links_htmlFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHtml(val.(PullRequestReview__links_htmlable)) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestReview__links_pull_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(PullRequestReview__links_pull_requestable)) + } + return nil + } + return res +} +// GetHtml gets the html property value. The html property +// returns a PullRequestReview__links_htmlable when successful +func (m *PullRequestReview__links) GetHtml()(PullRequestReview__links_htmlable) { + return m.html +} +// GetPullRequest gets the pull_request property value. The pull_request property +// returns a PullRequestReview__links_pull_requestable when successful +func (m *PullRequestReview__links) GetPullRequest()(PullRequestReview__links_pull_requestable) { + return m.pull_request +} +// Serialize serializes information the current object +func (m *PullRequestReview__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + 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 *PullRequestReview__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtml sets the html property value. The html property +func (m *PullRequestReview__links) SetHtml(value PullRequestReview__links_htmlable)() { + m.html = value +} +// SetPullRequest sets the pull_request property value. The pull_request property +func (m *PullRequestReview__links) SetPullRequest(value PullRequestReview__links_pull_requestable)() { + m.pull_request = value +} +type PullRequestReview__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtml()(PullRequestReview__links_htmlable) + GetPullRequest()(PullRequestReview__links_pull_requestable) + SetHtml(value PullRequestReview__links_htmlable)() + SetPullRequest(value PullRequestReview__links_pull_requestable)() +} diff --git a/pkg/github/models/pull_request_review_escaped__escaped_links_escaped_html.go b/pkg/github/models/pull_request_review_escaped__escaped_links_escaped_html.go new file mode 100644 index 00000000..4dd6ceea --- /dev/null +++ b/pkg/github/models/pull_request_review_escaped__escaped_links_escaped_html.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestReview__links_html 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 href property + href *string +} +// NewPullRequestReview__links_html instantiates a new PullRequestReview__links_html and sets the default values. +func NewPullRequestReview__links_html()(*PullRequestReview__links_html) { + m := &PullRequestReview__links_html{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReview__links_htmlFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReview__links_htmlFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReview__links_html(), 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 *PullRequestReview__links_html) 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 *PullRequestReview__links_html) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *PullRequestReview__links_html) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *PullRequestReview__links_html) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *PullRequestReview__links_html) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *PullRequestReview__links_html) SetHref(value *string)() { + m.href = value +} +type PullRequestReview__links_htmlable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/pkg/github/models/pull_request_review_escaped__escaped_links_escaped_pull_escaped_request.go b/pkg/github/models/pull_request_review_escaped__escaped_links_escaped_pull_escaped_request.go new file mode 100644 index 00000000..3d58c690 --- /dev/null +++ b/pkg/github/models/pull_request_review_escaped__escaped_links_escaped_pull_escaped_request.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestReview__links_pull_request 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 href property + href *string +} +// NewPullRequestReview__links_pull_request instantiates a new PullRequestReview__links_pull_request and sets the default values. +func NewPullRequestReview__links_pull_request()(*PullRequestReview__links_pull_request) { + m := &PullRequestReview__links_pull_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReview__links_pull_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReview__links_pull_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReview__links_pull_request(), 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 *PullRequestReview__links_pull_request) 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 *PullRequestReview__links_pull_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *PullRequestReview__links_pull_request) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *PullRequestReview__links_pull_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *PullRequestReview__links_pull_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *PullRequestReview__links_pull_request) SetHref(value *string)() { + m.href = value +} +type PullRequestReview__links_pull_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/pkg/github/models/pull_request_review_request.go b/pkg/github/models/pull_request_review_request.go new file mode 100644 index 00000000..3b52ba38 --- /dev/null +++ b/pkg/github/models/pull_request_review_request.go @@ -0,0 +1,134 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PullRequestReviewRequest pull Request Review Request +type PullRequestReviewRequest 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 teams property + teams []Teamable + // The users property + users []SimpleUserable +} +// NewPullRequestReviewRequest instantiates a new PullRequestReviewRequest and sets the default values. +func NewPullRequestReviewRequest()(*PullRequestReviewRequest) { + m := &PullRequestReviewRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestReviewRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestReviewRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestReviewRequest(), 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 *PullRequestReviewRequest) 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 *PullRequestReviewRequest) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Teamable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Teamable) + } + } + m.SetTeams(res) + } + return nil + } + res["users"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The teams property +// returns a []Teamable when successful +func (m *PullRequestReviewRequest) GetTeams()([]Teamable) { + return m.teams +} +// GetUsers gets the users property value. The users property +// returns a []SimpleUserable when successful +func (m *PullRequestReviewRequest) GetUsers()([]SimpleUserable) { + return m.users +} +// Serialize serializes information the current object +func (m *PullRequestReviewRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTeams())) + for i, v := range m.GetTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("teams", cast) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetUsers())) + for i, v := range m.GetUsers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("users", 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 *PullRequestReviewRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTeams sets the teams property value. The teams property +func (m *PullRequestReviewRequest) SetTeams(value []Teamable)() { + m.teams = value +} +// SetUsers sets the users property value. The users property +func (m *PullRequestReviewRequest) SetUsers(value []SimpleUserable)() { + m.users = value +} +type PullRequestReviewRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTeams()([]Teamable) + GetUsers()([]SimpleUserable) + SetTeams(value []Teamable)() + SetUsers(value []SimpleUserable)() +} diff --git a/pkg/github/models/pull_request_simple.go b/pkg/github/models/pull_request_simple.go new file mode 100644 index 00000000..eea89938 --- /dev/null +++ b/pkg/github/models/pull_request_simple.go @@ -0,0 +1,1146 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// PullRequestSimple pull Request Simple +type PullRequestSimple struct { + // The _links property + _links PullRequestSimple__linksable + // The active_lock_reason property + active_lock_reason *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee NullableSimpleUserable + // The assignees property + assignees []SimpleUserable + // How the author is associated with the repository. + author_association *AuthorAssociation + // The status of auto merging a pull request. + auto_merge AutoMergeable + // The base property + base PullRequestSimple_baseable + // The body property + body *string + // The closed_at property + closed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The diff_url property + diff_url *string + // Indicates whether or not the pull request is a draft. + draft *bool + // The head property + head PullRequestSimple_headable + // The html_url property + html_url *string + // The id property + id *int64 + // The issue_url property + issue_url *string + // The labels property + labels []PullRequestSimple_labelsable + // The locked property + locked *bool + // The merge_commit_sha property + merge_commit_sha *string + // The merged_at property + merged_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A collection of related issues and pull requests. + milestone NullableMilestoneable + // The node_id property + node_id *string + // The number property + number *int32 + // The patch_url property + patch_url *string + // The requested_reviewers property + requested_reviewers []SimpleUserable + // The requested_teams property + requested_teams []Teamable + // The review_comment_url property + review_comment_url *string + // The review_comments_url property + review_comments_url *string + // The state property + state *string + // The statuses_url property + statuses_url *string + // The title property + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewPullRequestSimple instantiates a new PullRequestSimple and sets the default values. +func NewPullRequestSimple()(*PullRequestSimple) { + m := &PullRequestSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestSimple(), nil +} +// GetActiveLockReason gets the active_lock_reason property value. The active_lock_reason property +// returns a *string when successful +func (m *PullRequestSimple) GetActiveLockReason()(*string) { + return m.active_lock_reason +} +// 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 *PullRequestSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PullRequestSimple) GetAssignee()(NullableSimpleUserable) { + return m.assignee +} +// GetAssignees gets the assignees property value. The assignees property +// returns a []SimpleUserable when successful +func (m *PullRequestSimple) GetAssignees()([]SimpleUserable) { + return m.assignees +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *PullRequestSimple) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetAutoMerge gets the auto_merge property value. The status of auto merging a pull request. +// returns a AutoMergeable when successful +func (m *PullRequestSimple) GetAutoMerge()(AutoMergeable) { + return m.auto_merge +} +// GetBase gets the base property value. The base property +// returns a PullRequestSimple_baseable when successful +func (m *PullRequestSimple) GetBase()(PullRequestSimple_baseable) { + return m.base +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *PullRequestSimple) GetBody()(*string) { + return m.body +} +// GetClosedAt gets the closed_at property value. The closed_at property +// returns a *Time when successful +func (m *PullRequestSimple) GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.closed_at +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *PullRequestSimple) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *PullRequestSimple) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *PullRequestSimple) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDiffUrl gets the diff_url property value. The diff_url property +// returns a *string when successful +func (m *PullRequestSimple) GetDiffUrl()(*string) { + return m.diff_url +} +// GetDraft gets the draft property value. Indicates whether or not the pull request is a draft. +// returns a *bool when successful +func (m *PullRequestSimple) GetDraft()(*bool) { + return m.draft +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestSimple__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(PullRequestSimple__linksable)) + } + return nil + } + res["active_lock_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActiveLockReason(val) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(NullableSimpleUserable)) + } + return nil + } + res["assignees"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetAssignees(res) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateAutoMergeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAutoMerge(val.(AutoMergeable)) + } + return nil + } + res["base"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestSimple_baseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBase(val.(PullRequestSimple_baseable)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["closed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetClosedAt(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + 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["diff_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffUrl(val) + } + return nil + } + res["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["head"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreatePullRequestSimple_headFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHead(val.(PullRequestSimple_headable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issue_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueUrl(val) + } + return nil + } + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePullRequestSimple_labelsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PullRequestSimple_labelsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PullRequestSimple_labelsable) + } + } + m.SetLabels(res) + } + return nil + } + res["locked"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLocked(val) + } + return nil + } + res["merge_commit_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitSha(val) + } + return nil + } + res["merged_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetMergedAt(val) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableMilestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(NullableMilestoneable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["patch_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPatchUrl(val) + } + return nil + } + res["requested_reviewers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]SimpleUserable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(SimpleUserable) + } + } + m.SetRequestedReviewers(res) + } + return nil + } + res["requested_teams"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Teamable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Teamable) + } + } + m.SetRequestedTeams(res) + } + return nil + } + res["review_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReviewCommentUrl(val) + } + return nil + } + res["review_comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReviewCommentsUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHead gets the head property value. The head property +// returns a PullRequestSimple_headable when successful +func (m *PullRequestSimple) GetHead()(PullRequestSimple_headable) { + return m.head +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *PullRequestSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequestSimple) GetId()(*int64) { + return m.id +} +// GetIssueUrl gets the issue_url property value. The issue_url property +// returns a *string when successful +func (m *PullRequestSimple) GetIssueUrl()(*string) { + return m.issue_url +} +// GetLabels gets the labels property value. The labels property +// returns a []PullRequestSimple_labelsable when successful +func (m *PullRequestSimple) GetLabels()([]PullRequestSimple_labelsable) { + return m.labels +} +// GetLinks gets the _links property value. The _links property +// returns a PullRequestSimple__linksable when successful +func (m *PullRequestSimple) GetLinks()(PullRequestSimple__linksable) { + return m._links +} +// GetLocked gets the locked property value. The locked property +// returns a *bool when successful +func (m *PullRequestSimple) GetLocked()(*bool) { + return m.locked +} +// GetMergeCommitSha gets the merge_commit_sha property value. The merge_commit_sha property +// returns a *string when successful +func (m *PullRequestSimple) GetMergeCommitSha()(*string) { + return m.merge_commit_sha +} +// GetMergedAt gets the merged_at property value. The merged_at property +// returns a *Time when successful +func (m *PullRequestSimple) GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.merged_at +} +// GetMilestone gets the milestone property value. A collection of related issues and pull requests. +// returns a NullableMilestoneable when successful +func (m *PullRequestSimple) GetMilestone()(NullableMilestoneable) { + return m.milestone +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequestSimple) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *PullRequestSimple) GetNumber()(*int32) { + return m.number +} +// GetPatchUrl gets the patch_url property value. The patch_url property +// returns a *string when successful +func (m *PullRequestSimple) GetPatchUrl()(*string) { + return m.patch_url +} +// GetRequestedReviewers gets the requested_reviewers property value. The requested_reviewers property +// returns a []SimpleUserable when successful +func (m *PullRequestSimple) GetRequestedReviewers()([]SimpleUserable) { + return m.requested_reviewers +} +// GetRequestedTeams gets the requested_teams property value. The requested_teams property +// returns a []Teamable when successful +func (m *PullRequestSimple) GetRequestedTeams()([]Teamable) { + return m.requested_teams +} +// GetReviewCommentsUrl gets the review_comments_url property value. The review_comments_url property +// returns a *string when successful +func (m *PullRequestSimple) GetReviewCommentsUrl()(*string) { + return m.review_comments_url +} +// GetReviewCommentUrl gets the review_comment_url property value. The review_comment_url property +// returns a *string when successful +func (m *PullRequestSimple) GetReviewCommentUrl()(*string) { + return m.review_comment_url +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *PullRequestSimple) GetState()(*string) { + return m.state +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *PullRequestSimple) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *PullRequestSimple) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *PullRequestSimple) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequestSimple) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PullRequestSimple) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequestSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("active_lock_reason", m.GetActiveLockReason()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + if m.GetAssignees() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssignees())) + for i, v := range m.GetAssignees() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("assignees", cast) + if err != nil { + return err + } + } + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("auto_merge", m.GetAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("base", m.GetBase()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("closed_at", m.GetClosedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("diff_url", m.GetDiffUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("head", m.GetHead()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_url", m.GetIssueUrl()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("locked", m.GetLocked()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("merged_at", m.GetMergedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merge_commit_sha", m.GetMergeCommitSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("patch_url", m.GetPatchUrl()) + if err != nil { + return err + } + } + if m.GetRequestedReviewers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRequestedReviewers())) + for i, v := range m.GetRequestedReviewers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("requested_reviewers", cast) + if err != nil { + return err + } + } + if m.GetRequestedTeams() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRequestedTeams())) + for i, v := range m.GetRequestedTeams() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("requested_teams", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("review_comments_url", m.GetReviewCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("review_comment_url", m.GetReviewCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActiveLockReason sets the active_lock_reason property value. The active_lock_reason property +func (m *PullRequestSimple) SetActiveLockReason(value *string)() { + m.active_lock_reason = 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 *PullRequestSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *PullRequestSimple) SetAssignee(value NullableSimpleUserable)() { + m.assignee = value +} +// SetAssignees sets the assignees property value. The assignees property +func (m *PullRequestSimple) SetAssignees(value []SimpleUserable)() { + m.assignees = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *PullRequestSimple) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetAutoMerge sets the auto_merge property value. The status of auto merging a pull request. +func (m *PullRequestSimple) SetAutoMerge(value AutoMergeable)() { + m.auto_merge = value +} +// SetBase sets the base property value. The base property +func (m *PullRequestSimple) SetBase(value PullRequestSimple_baseable)() { + m.base = value +} +// SetBody sets the body property value. The body property +func (m *PullRequestSimple) SetBody(value *string)() { + m.body = value +} +// SetClosedAt sets the closed_at property value. The closed_at property +func (m *PullRequestSimple) SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.closed_at = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *PullRequestSimple) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *PullRequestSimple) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *PullRequestSimple) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDiffUrl sets the diff_url property value. The diff_url property +func (m *PullRequestSimple) SetDiffUrl(value *string)() { + m.diff_url = value +} +// SetDraft sets the draft property value. Indicates whether or not the pull request is a draft. +func (m *PullRequestSimple) SetDraft(value *bool)() { + m.draft = value +} +// SetHead sets the head property value. The head property +func (m *PullRequestSimple) SetHead(value PullRequestSimple_headable)() { + m.head = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *PullRequestSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *PullRequestSimple) SetId(value *int64)() { + m.id = value +} +// SetIssueUrl sets the issue_url property value. The issue_url property +func (m *PullRequestSimple) SetIssueUrl(value *string)() { + m.issue_url = value +} +// SetLabels sets the labels property value. The labels property +func (m *PullRequestSimple) SetLabels(value []PullRequestSimple_labelsable)() { + m.labels = value +} +// SetLinks sets the _links property value. The _links property +func (m *PullRequestSimple) SetLinks(value PullRequestSimple__linksable)() { + m._links = value +} +// SetLocked sets the locked property value. The locked property +func (m *PullRequestSimple) SetLocked(value *bool)() { + m.locked = value +} +// SetMergeCommitSha sets the merge_commit_sha property value. The merge_commit_sha property +func (m *PullRequestSimple) SetMergeCommitSha(value *string)() { + m.merge_commit_sha = value +} +// SetMergedAt sets the merged_at property value. The merged_at property +func (m *PullRequestSimple) SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.merged_at = value +} +// SetMilestone sets the milestone property value. A collection of related issues and pull requests. +func (m *PullRequestSimple) SetMilestone(value NullableMilestoneable)() { + m.milestone = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequestSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The number property +func (m *PullRequestSimple) SetNumber(value *int32)() { + m.number = value +} +// SetPatchUrl sets the patch_url property value. The patch_url property +func (m *PullRequestSimple) SetPatchUrl(value *string)() { + m.patch_url = value +} +// SetRequestedReviewers sets the requested_reviewers property value. The requested_reviewers property +func (m *PullRequestSimple) SetRequestedReviewers(value []SimpleUserable)() { + m.requested_reviewers = value +} +// SetRequestedTeams sets the requested_teams property value. The requested_teams property +func (m *PullRequestSimple) SetRequestedTeams(value []Teamable)() { + m.requested_teams = value +} +// SetReviewCommentsUrl sets the review_comments_url property value. The review_comments_url property +func (m *PullRequestSimple) SetReviewCommentsUrl(value *string)() { + m.review_comments_url = value +} +// SetReviewCommentUrl sets the review_comment_url property value. The review_comment_url property +func (m *PullRequestSimple) SetReviewCommentUrl(value *string)() { + m.review_comment_url = value +} +// SetState sets the state property value. The state property +func (m *PullRequestSimple) SetState(value *string)() { + m.state = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *PullRequestSimple) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetTitle sets the title property value. The title property +func (m *PullRequestSimple) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *PullRequestSimple) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequestSimple) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *PullRequestSimple) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type PullRequestSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActiveLockReason()(*string) + GetAssignee()(NullableSimpleUserable) + GetAssignees()([]SimpleUserable) + GetAuthorAssociation()(*AuthorAssociation) + GetAutoMerge()(AutoMergeable) + GetBase()(PullRequestSimple_baseable) + GetBody()(*string) + GetClosedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDiffUrl()(*string) + GetDraft()(*bool) + GetHead()(PullRequestSimple_headable) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueUrl()(*string) + GetLabels()([]PullRequestSimple_labelsable) + GetLinks()(PullRequestSimple__linksable) + GetLocked()(*bool) + GetMergeCommitSha()(*string) + GetMergedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetMilestone()(NullableMilestoneable) + GetNodeId()(*string) + GetNumber()(*int32) + GetPatchUrl()(*string) + GetRequestedReviewers()([]SimpleUserable) + GetRequestedTeams()([]Teamable) + GetReviewCommentsUrl()(*string) + GetReviewCommentUrl()(*string) + GetState()(*string) + GetStatusesUrl()(*string) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetActiveLockReason(value *string)() + SetAssignee(value NullableSimpleUserable)() + SetAssignees(value []SimpleUserable)() + SetAuthorAssociation(value *AuthorAssociation)() + SetAutoMerge(value AutoMergeable)() + SetBase(value PullRequestSimple_baseable)() + SetBody(value *string)() + SetClosedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDiffUrl(value *string)() + SetDraft(value *bool)() + SetHead(value PullRequestSimple_headable)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueUrl(value *string)() + SetLabels(value []PullRequestSimple_labelsable)() + SetLinks(value PullRequestSimple__linksable)() + SetLocked(value *bool)() + SetMergeCommitSha(value *string)() + SetMergedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetMilestone(value NullableMilestoneable)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetPatchUrl(value *string)() + SetRequestedReviewers(value []SimpleUserable)() + SetRequestedTeams(value []Teamable)() + SetReviewCommentsUrl(value *string)() + SetReviewCommentUrl(value *string)() + SetState(value *string)() + SetStatusesUrl(value *string)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/pull_request_simple_escaped__escaped_links.go b/pkg/github/models/pull_request_simple_escaped__escaped_links.go new file mode 100644 index 00000000..f964ceb4 --- /dev/null +++ b/pkg/github/models/pull_request_simple_escaped__escaped_links.go @@ -0,0 +1,283 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestSimple__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Hypermedia Link + comments Linkable + // Hypermedia Link + commits Linkable + // Hypermedia Link + html Linkable + // Hypermedia Link + issue Linkable + // Hypermedia Link + review_comment Linkable + // Hypermedia Link + review_comments Linkable + // Hypermedia Link + self Linkable + // Hypermedia Link + statuses Linkable +} +// NewPullRequestSimple__links instantiates a new PullRequestSimple__links and sets the default values. +func NewPullRequestSimple__links()(*PullRequestSimple__links) { + m := &PullRequestSimple__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestSimple__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestSimple__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestSimple__links(), 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 *PullRequestSimple__links) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetComments()(Linkable) { + return m.comments +} +// GetCommits gets the commits property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetCommits()(Linkable) { + return m.commits +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestSimple__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetComments(val.(Linkable)) + } + return nil + } + res["commits"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommits(val.(Linkable)) + } + return nil + } + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHtml(val.(Linkable)) + } + return nil + } + res["issue"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIssue(val.(Linkable)) + } + return nil + } + res["review_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewComment(val.(Linkable)) + } + return nil + } + res["review_comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewComments(val.(Linkable)) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSelf(val.(Linkable)) + } + return nil + } + res["statuses"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetStatuses(val.(Linkable)) + } + return nil + } + return res +} +// GetHtml gets the html property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetHtml()(Linkable) { + return m.html +} +// GetIssue gets the issue property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetIssue()(Linkable) { + return m.issue +} +// GetReviewComment gets the review_comment property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetReviewComment()(Linkable) { + return m.review_comment +} +// GetReviewComments gets the review_comments property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetReviewComments()(Linkable) { + return m.review_comments +} +// GetSelf gets the self property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetSelf()(Linkable) { + return m.self +} +// GetStatuses gets the statuses property value. Hypermedia Link +// returns a Linkable when successful +func (m *PullRequestSimple__links) GetStatuses()(Linkable) { + return m.statuses +} +// Serialize serializes information the current object +func (m *PullRequestSimple__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("comments", m.GetComments()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("commits", m.GetCommits()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("issue", m.GetIssue()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("review_comment", m.GetReviewComment()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("review_comments", m.GetReviewComments()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("self", m.GetSelf()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("statuses", m.GetStatuses()) + 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 *PullRequestSimple__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. Hypermedia Link +func (m *PullRequestSimple__links) SetComments(value Linkable)() { + m.comments = value +} +// SetCommits sets the commits property value. Hypermedia Link +func (m *PullRequestSimple__links) SetCommits(value Linkable)() { + m.commits = value +} +// SetHtml sets the html property value. Hypermedia Link +func (m *PullRequestSimple__links) SetHtml(value Linkable)() { + m.html = value +} +// SetIssue sets the issue property value. Hypermedia Link +func (m *PullRequestSimple__links) SetIssue(value Linkable)() { + m.issue = value +} +// SetReviewComment sets the review_comment property value. Hypermedia Link +func (m *PullRequestSimple__links) SetReviewComment(value Linkable)() { + m.review_comment = value +} +// SetReviewComments sets the review_comments property value. Hypermedia Link +func (m *PullRequestSimple__links) SetReviewComments(value Linkable)() { + m.review_comments = value +} +// SetSelf sets the self property value. Hypermedia Link +func (m *PullRequestSimple__links) SetSelf(value Linkable)() { + m.self = value +} +// SetStatuses sets the statuses property value. Hypermedia Link +func (m *PullRequestSimple__links) SetStatuses(value Linkable)() { + m.statuses = value +} +type PullRequestSimple__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()(Linkable) + GetCommits()(Linkable) + GetHtml()(Linkable) + GetIssue()(Linkable) + GetReviewComment()(Linkable) + GetReviewComments()(Linkable) + GetSelf()(Linkable) + GetStatuses()(Linkable) + SetComments(value Linkable)() + SetCommits(value Linkable)() + SetHtml(value Linkable)() + SetIssue(value Linkable)() + SetReviewComment(value Linkable)() + SetReviewComments(value Linkable)() + SetSelf(value Linkable)() + SetStatuses(value Linkable)() +} diff --git a/pkg/github/models/pull_request_simple_escaped_base.go b/pkg/github/models/pull_request_simple_escaped_base.go new file mode 100644 index 00000000..4c67fa0c --- /dev/null +++ b/pkg/github/models/pull_request_simple_escaped_base.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestSimple_base 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 label property + label *string + // The ref property + ref *string + // A repository on GitHub. + repo Repositoryable + // The sha property + sha *string + // A GitHub user. + user NullableSimpleUserable +} +// NewPullRequestSimple_base instantiates a new PullRequestSimple_base and sets the default values. +func NewPullRequestSimple_base()(*PullRequestSimple_base) { + m := &PullRequestSimple_base{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestSimple_baseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestSimple_baseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestSimple_base(), 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 *PullRequestSimple_base) 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 *PullRequestSimple_base) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabel(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepo(val.(Repositoryable)) + } + return nil + } + 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["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetLabel gets the label property value. The label property +// returns a *string when successful +func (m *PullRequestSimple_base) GetLabel()(*string) { + return m.label +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *PullRequestSimple_base) GetRef()(*string) { + return m.ref +} +// GetRepo gets the repo property value. A repository on GitHub. +// returns a Repositoryable when successful +func (m *PullRequestSimple_base) GetRepo()(Repositoryable) { + return m.repo +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *PullRequestSimple_base) GetSha()(*string) { + return m.sha +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PullRequestSimple_base) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequestSimple_base) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *PullRequestSimple_base) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabel sets the label property value. The label property +func (m *PullRequestSimple_base) SetLabel(value *string)() { + m.label = value +} +// SetRef sets the ref property value. The ref property +func (m *PullRequestSimple_base) SetRef(value *string)() { + m.ref = value +} +// SetRepo sets the repo property value. A repository on GitHub. +func (m *PullRequestSimple_base) SetRepo(value Repositoryable)() { + m.repo = value +} +// SetSha sets the sha property value. The sha property +func (m *PullRequestSimple_base) SetSha(value *string)() { + m.sha = value +} +// SetUser sets the user property value. A GitHub user. +func (m *PullRequestSimple_base) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type PullRequestSimple_baseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabel()(*string) + GetRef()(*string) + GetRepo()(Repositoryable) + GetSha()(*string) + GetUser()(NullableSimpleUserable) + SetLabel(value *string)() + SetRef(value *string)() + SetRepo(value Repositoryable)() + SetSha(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/pull_request_simple_escaped_head.go b/pkg/github/models/pull_request_simple_escaped_head.go new file mode 100644 index 00000000..53ffb320 --- /dev/null +++ b/pkg/github/models/pull_request_simple_escaped_head.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestSimple_head 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 label property + label *string + // The ref property + ref *string + // A repository on GitHub. + repo Repositoryable + // The sha property + sha *string + // A GitHub user. + user NullableSimpleUserable +} +// NewPullRequestSimple_head instantiates a new PullRequestSimple_head and sets the default values. +func NewPullRequestSimple_head()(*PullRequestSimple_head) { + m := &PullRequestSimple_head{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestSimple_headFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestSimple_headFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestSimple_head(), 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 *PullRequestSimple_head) 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 *PullRequestSimple_head) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabel(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepo(val.(Repositoryable)) + } + return nil + } + 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["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetLabel gets the label property value. The label property +// returns a *string when successful +func (m *PullRequestSimple_head) GetLabel()(*string) { + return m.label +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *PullRequestSimple_head) GetRef()(*string) { + return m.ref +} +// GetRepo gets the repo property value. A repository on GitHub. +// returns a Repositoryable when successful +func (m *PullRequestSimple_head) GetRepo()(Repositoryable) { + return m.repo +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *PullRequestSimple_head) GetSha()(*string) { + return m.sha +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *PullRequestSimple_head) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *PullRequestSimple_head) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repo", m.GetRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *PullRequestSimple_head) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabel sets the label property value. The label property +func (m *PullRequestSimple_head) SetLabel(value *string)() { + m.label = value +} +// SetRef sets the ref property value. The ref property +func (m *PullRequestSimple_head) SetRef(value *string)() { + m.ref = value +} +// SetRepo sets the repo property value. A repository on GitHub. +func (m *PullRequestSimple_head) SetRepo(value Repositoryable)() { + m.repo = value +} +// SetSha sets the sha property value. The sha property +func (m *PullRequestSimple_head) SetSha(value *string)() { + m.sha = value +} +// SetUser sets the user property value. A GitHub user. +func (m *PullRequestSimple_head) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type PullRequestSimple_headable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabel()(*string) + GetRef()(*string) + GetRepo()(Repositoryable) + GetSha()(*string) + GetUser()(NullableSimpleUserable) + SetLabel(value *string)() + SetRef(value *string)() + SetRepo(value Repositoryable)() + SetSha(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/pull_request_simple_escaped_labels.go b/pkg/github/models/pull_request_simple_escaped_labels.go new file mode 100644 index 00000000..93cd37ea --- /dev/null +++ b/pkg/github/models/pull_request_simple_escaped_labels.go @@ -0,0 +1,254 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestSimple_labels 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 color property + color *string + // The default property + defaultEscaped *bool + // The description property + description *string + // The id property + id *int64 + // The name property + name *string + // The node_id property + node_id *string + // The url property + url *string +} +// NewPullRequestSimple_labels instantiates a new PullRequestSimple_labels and sets the default values. +func NewPullRequestSimple_labels()(*PullRequestSimple_labels) { + m := &PullRequestSimple_labels{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreatePullRequestSimple_labelsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestSimple_labelsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestSimple_labels(), 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 *PullRequestSimple_labels) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The color property +// returns a *string when successful +func (m *PullRequestSimple_labels) GetColor()(*string) { + return m.color +} +// GetDefaultEscaped gets the default property value. The default property +// returns a *bool when successful +func (m *PullRequestSimple_labels) GetDefaultEscaped()(*bool) { + return m.defaultEscaped +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *PullRequestSimple_labels) 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 *PullRequestSimple_labels) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + return nil + } + res["default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultEscaped(val) + } + 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *PullRequestSimple_labels) GetId()(*int64) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *PullRequestSimple_labels) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *PullRequestSimple_labels) GetNodeId()(*string) { + return m.node_id +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *PullRequestSimple_labels) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *PullRequestSimple_labels) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("default", m.GetDefaultEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *PullRequestSimple_labels) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The color property +func (m *PullRequestSimple_labels) SetColor(value *string)() { + m.color = value +} +// SetDefaultEscaped sets the default property value. The default property +func (m *PullRequestSimple_labels) SetDefaultEscaped(value *bool)() { + m.defaultEscaped = value +} +// SetDescription sets the description property value. The description property +func (m *PullRequestSimple_labels) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The id property +func (m *PullRequestSimple_labels) SetId(value *int64)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *PullRequestSimple_labels) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *PullRequestSimple_labels) SetNodeId(value *string)() { + m.node_id = value +} +// SetUrl sets the url property value. The url property +func (m *PullRequestSimple_labels) SetUrl(value *string)() { + m.url = value +} +type PullRequestSimple_labelsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetDefaultEscaped()(*bool) + GetDescription()(*string) + GetId()(*int64) + GetName()(*string) + GetNodeId()(*string) + GetUrl()(*string) + SetColor(value *string)() + SetDefaultEscaped(value *bool)() + SetDescription(value *string)() + SetId(value *int64)() + SetName(value *string)() + SetNodeId(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/pull_request_webhook.go b/pkg/github/models/pull_request_webhook.go new file mode 100644 index 00000000..15965dd4 --- /dev/null +++ b/pkg/github/models/pull_request_webhook.go @@ -0,0 +1,275 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type PullRequestWebhook struct { + PullRequest + // Whether to allow auto-merge for pull requests. + allow_auto_merge *bool + // Whether to allow updating the pull request's branch. + allow_update_branch *bool + // Whether to delete head branches when pull requests are merged. + delete_branch_on_merge *bool + // The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. + merge_commit_message *PullRequestWebhook_merge_commit_message + // The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., "Merge pull request #123 from branch-name"). + merge_commit_title *PullRequestWebhook_merge_commit_title + // The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. + squash_merge_commit_message *PullRequestWebhook_squash_merge_commit_message + // The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + squash_merge_commit_title *PullRequestWebhook_squash_merge_commit_title + // Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead.** + use_squash_pr_title_as_default *bool +} +// NewPullRequestWebhook instantiates a new PullRequestWebhook and sets the default values. +func NewPullRequestWebhook()(*PullRequestWebhook) { + m := &PullRequestWebhook{ + PullRequest: *NewPullRequest(), + } + return m +} +// CreatePullRequestWebhookFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreatePullRequestWebhookFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewPullRequestWebhook(), nil +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Whether to allow auto-merge for pull requests. +// returns a *bool when successful +func (m *PullRequestWebhook) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowUpdateBranch gets the allow_update_branch property value. Whether to allow updating the pull request's branch. +// returns a *bool when successful +func (m *PullRequestWebhook) GetAllowUpdateBranch()(*bool) { + return m.allow_update_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged. +// returns a *bool when successful +func (m *PullRequestWebhook) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *PullRequestWebhook) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := m.PullRequest.GetFieldDeserializers() + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_update_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowUpdateBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequestWebhook_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitMessage(val.(*PullRequestWebhook_merge_commit_message)) + } + return nil + } + res["merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequestWebhook_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitTitle(val.(*PullRequestWebhook_merge_commit_title)) + } + return nil + } + res["squash_merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequestWebhook_squash_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitMessage(val.(*PullRequestWebhook_squash_merge_commit_message)) + } + return nil + } + res["squash_merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParsePullRequestWebhook_squash_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitTitle(val.(*PullRequestWebhook_squash_merge_commit_title)) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + return res +} +// GetMergeCommitMessage gets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +// returns a *PullRequestWebhook_merge_commit_message when successful +func (m *PullRequestWebhook) GetMergeCommitMessage()(*PullRequestWebhook_merge_commit_message) { + return m.merge_commit_message +} +// GetMergeCommitTitle gets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., "Merge pull request #123 from branch-name"). +// returns a *PullRequestWebhook_merge_commit_title when successful +func (m *PullRequestWebhook) GetMergeCommitTitle()(*PullRequestWebhook_merge_commit_title) { + return m.merge_commit_title +} +// GetSquashMergeCommitMessage gets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +// returns a *PullRequestWebhook_squash_merge_commit_message when successful +func (m *PullRequestWebhook) GetSquashMergeCommitMessage()(*PullRequestWebhook_squash_merge_commit_message) { + return m.squash_merge_commit_message +} +// GetSquashMergeCommitTitle gets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +// returns a *PullRequestWebhook_squash_merge_commit_title when successful +func (m *PullRequestWebhook) GetSquashMergeCommitTitle()(*PullRequestWebhook_squash_merge_commit_title) { + return m.squash_merge_commit_title +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead.** +// returns a *bool when successful +func (m *PullRequestWebhook) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// Serialize serializes information the current object +func (m *PullRequestWebhook) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + err := m.PullRequest.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err = writer.WriteBoolValue("allow_update_branch", m.GetAllowUpdateBranch()) + if err != nil { + return err + } + } + { + err = writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + if m.GetMergeCommitMessage() != nil { + cast := (*m.GetMergeCommitMessage()).String() + err = writer.WriteStringValue("merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetMergeCommitTitle() != nil { + cast := (*m.GetMergeCommitTitle()).String() + err = writer.WriteStringValue("merge_commit_title", &cast) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitMessage() != nil { + cast := (*m.GetSquashMergeCommitMessage()).String() + err = writer.WriteStringValue("squash_merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitTitle() != nil { + cast := (*m.GetSquashMergeCommitTitle()).String() + err = writer.WriteStringValue("squash_merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err = writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + if err != nil { + return err + } + } + return nil +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Whether to allow auto-merge for pull requests. +func (m *PullRequestWebhook) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowUpdateBranch sets the allow_update_branch property value. Whether to allow updating the pull request's branch. +func (m *PullRequestWebhook) SetAllowUpdateBranch(value *bool)() { + m.allow_update_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged. +func (m *PullRequestWebhook) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetMergeCommitMessage sets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +func (m *PullRequestWebhook) SetMergeCommitMessage(value *PullRequestWebhook_merge_commit_message)() { + m.merge_commit_message = value +} +// SetMergeCommitTitle sets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., "Merge pull request #123 from branch-name"). +func (m *PullRequestWebhook) SetMergeCommitTitle(value *PullRequestWebhook_merge_commit_title)() { + m.merge_commit_title = value +} +// SetSquashMergeCommitMessage sets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +func (m *PullRequestWebhook) SetSquashMergeCommitMessage(value *PullRequestWebhook_squash_merge_commit_message)() { + m.squash_merge_commit_message = value +} +// SetSquashMergeCommitTitle sets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +func (m *PullRequestWebhook) SetSquashMergeCommitTitle(value *PullRequestWebhook_squash_merge_commit_title)() { + m.squash_merge_commit_title = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead.** +func (m *PullRequestWebhook) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +type PullRequestWebhookable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + PullRequestable + GetAllowAutoMerge()(*bool) + GetAllowUpdateBranch()(*bool) + GetDeleteBranchOnMerge()(*bool) + GetMergeCommitMessage()(*PullRequestWebhook_merge_commit_message) + GetMergeCommitTitle()(*PullRequestWebhook_merge_commit_title) + GetSquashMergeCommitMessage()(*PullRequestWebhook_squash_merge_commit_message) + GetSquashMergeCommitTitle()(*PullRequestWebhook_squash_merge_commit_title) + GetUseSquashPrTitleAsDefault()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowUpdateBranch(value *bool)() + SetDeleteBranchOnMerge(value *bool)() + SetMergeCommitMessage(value *PullRequestWebhook_merge_commit_message)() + SetMergeCommitTitle(value *PullRequestWebhook_merge_commit_title)() + SetSquashMergeCommitMessage(value *PullRequestWebhook_squash_merge_commit_message)() + SetSquashMergeCommitTitle(value *PullRequestWebhook_squash_merge_commit_title)() + SetUseSquashPrTitleAsDefault(value *bool)() +} diff --git a/pkg/github/models/pull_request_webhook_escaped_merge_escaped_commit_escaped_message.go b/pkg/github/models/pull_request_webhook_escaped_merge_escaped_commit_escaped_message.go new file mode 100644 index 00000000..02e80125 --- /dev/null +++ b/pkg/github/models/pull_request_webhook_escaped_merge_escaped_commit_escaped_message.go @@ -0,0 +1,37 @@ +package models +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type PullRequestWebhook_merge_commit_message int + +const ( + PR_BODY_PULLREQUESTWEBHOOK_MERGE_COMMIT_MESSAGE PullRequestWebhook_merge_commit_message = iota + PR_TITLE_PULLREQUESTWEBHOOK_MERGE_COMMIT_MESSAGE + BLANK_PULLREQUESTWEBHOOK_MERGE_COMMIT_MESSAGE +) + +func (i PullRequestWebhook_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParsePullRequestWebhook_merge_commit_message(v string) (any, error) { + result := PR_BODY_PULLREQUESTWEBHOOK_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_PULLREQUESTWEBHOOK_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_PULLREQUESTWEBHOOK_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_PULLREQUESTWEBHOOK_MERGE_COMMIT_MESSAGE + default: + return nil, nil + } + return &result, nil +} +func SerializePullRequestWebhook_merge_commit_message(values []PullRequestWebhook_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequestWebhook_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/pull_request_webhook_escaped_merge_escaped_commit_escaped_title.go b/pkg/github/models/pull_request_webhook_escaped_merge_escaped_commit_escaped_title.go new file mode 100644 index 00000000..ea459685 --- /dev/null +++ b/pkg/github/models/pull_request_webhook_escaped_merge_escaped_commit_escaped_title.go @@ -0,0 +1,34 @@ +package models +// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., "Merge pull request #123 from branch-name"). +type PullRequestWebhook_merge_commit_title int + +const ( + PR_TITLE_PULLREQUESTWEBHOOK_MERGE_COMMIT_TITLE PullRequestWebhook_merge_commit_title = iota + MERGE_MESSAGE_PULLREQUESTWEBHOOK_MERGE_COMMIT_TITLE +) + +func (i PullRequestWebhook_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParsePullRequestWebhook_merge_commit_title(v string) (any, error) { + result := PR_TITLE_PULLREQUESTWEBHOOK_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_PULLREQUESTWEBHOOK_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_PULLREQUESTWEBHOOK_MERGE_COMMIT_TITLE + default: + return nil, nil + } + return &result, nil +} +func SerializePullRequestWebhook_merge_commit_title(values []PullRequestWebhook_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequestWebhook_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/pull_request_webhook_escaped_squash_escaped_merge_escaped_commit_escaped_message.go b/pkg/github/models/pull_request_webhook_escaped_squash_escaped_merge_escaped_commit_escaped_message.go new file mode 100644 index 00000000..7281b3f9 --- /dev/null +++ b/pkg/github/models/pull_request_webhook_escaped_squash_escaped_merge_escaped_commit_escaped_message.go @@ -0,0 +1,37 @@ +package models +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type PullRequestWebhook_squash_merge_commit_message int + +const ( + PR_BODY_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_MESSAGE PullRequestWebhook_squash_merge_commit_message = iota + COMMIT_MESSAGES_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i PullRequestWebhook_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParsePullRequestWebhook_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_MESSAGE + default: + return nil, nil + } + return &result, nil +} +func SerializePullRequestWebhook_squash_merge_commit_message(values []PullRequestWebhook_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequestWebhook_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/pull_request_webhook_escaped_squash_escaped_merge_escaped_commit_escaped_title.go b/pkg/github/models/pull_request_webhook_escaped_squash_escaped_merge_escaped_commit_escaped_title.go new file mode 100644 index 00000000..f4dd75f0 --- /dev/null +++ b/pkg/github/models/pull_request_webhook_escaped_squash_escaped_merge_escaped_commit_escaped_title.go @@ -0,0 +1,34 @@ +package models +// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type PullRequestWebhook_squash_merge_commit_title int + +const ( + PR_TITLE_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_TITLE PullRequestWebhook_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_TITLE +) + +func (i PullRequestWebhook_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParsePullRequestWebhook_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_PULLREQUESTWEBHOOK_SQUASH_MERGE_COMMIT_TITLE + default: + return nil, nil + } + return &result, nil +} +func SerializePullRequestWebhook_squash_merge_commit_title(values []PullRequestWebhook_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PullRequestWebhook_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/rate_limit.go b/pkg/github/models/rate_limit.go new file mode 100644 index 00000000..36cbe712 --- /dev/null +++ b/pkg/github/models/rate_limit.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RateLimit 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 limit property + limit *int32 + // The remaining property + remaining *int32 + // The reset property + reset *int32 + // The used property + used *int32 +} +// NewRateLimit instantiates a new RateLimit and sets the default values. +func NewRateLimit()(*RateLimit) { + m := &RateLimit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRateLimitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRateLimitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRateLimit(), 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 *RateLimit) 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 *RateLimit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["limit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLimit(val) + } + return nil + } + res["remaining"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRemaining(val) + } + return nil + } + res["reset"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetReset(val) + } + return nil + } + res["used"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetUsed(val) + } + return nil + } + return res +} +// GetLimit gets the limit property value. The limit property +// returns a *int32 when successful +func (m *RateLimit) GetLimit()(*int32) { + return m.limit +} +// GetRemaining gets the remaining property value. The remaining property +// returns a *int32 when successful +func (m *RateLimit) GetRemaining()(*int32) { + return m.remaining +} +// GetReset gets the reset property value. The reset property +// returns a *int32 when successful +func (m *RateLimit) GetReset()(*int32) { + return m.reset +} +// GetUsed gets the used property value. The used property +// returns a *int32 when successful +func (m *RateLimit) GetUsed()(*int32) { + return m.used +} +// Serialize serializes information the current object +func (m *RateLimit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("limit", m.GetLimit()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("remaining", m.GetRemaining()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("reset", m.GetReset()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("used", m.GetUsed()) + 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 *RateLimit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLimit sets the limit property value. The limit property +func (m *RateLimit) SetLimit(value *int32)() { + m.limit = value +} +// SetRemaining sets the remaining property value. The remaining property +func (m *RateLimit) SetRemaining(value *int32)() { + m.remaining = value +} +// SetReset sets the reset property value. The reset property +func (m *RateLimit) SetReset(value *int32)() { + m.reset = value +} +// SetUsed sets the used property value. The used property +func (m *RateLimit) SetUsed(value *int32)() { + m.used = value +} +type RateLimitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLimit()(*int32) + GetRemaining()(*int32) + GetReset()(*int32) + GetUsed()(*int32) + SetLimit(value *int32)() + SetRemaining(value *int32)() + SetReset(value *int32)() + SetUsed(value *int32)() +} diff --git a/pkg/github/models/rate_limit_overview.go b/pkg/github/models/rate_limit_overview.go new file mode 100644 index 00000000..edb978cf --- /dev/null +++ b/pkg/github/models/rate_limit_overview.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RateLimitOverview rate Limit Overview +type RateLimitOverview 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 rate property + rate RateLimitable + // The resources property + resources RateLimitOverview_resourcesable +} +// NewRateLimitOverview instantiates a new RateLimitOverview and sets the default values. +func NewRateLimitOverview()(*RateLimitOverview) { + m := &RateLimitOverview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRateLimitOverviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRateLimitOverviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRateLimitOverview(), 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 *RateLimitOverview) 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 *RateLimitOverview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["rate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRate(val.(RateLimitable)) + } + return nil + } + res["resources"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitOverview_resourcesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetResources(val.(RateLimitOverview_resourcesable)) + } + return nil + } + return res +} +// GetRate gets the rate property value. The rate property +// returns a RateLimitable when successful +func (m *RateLimitOverview) GetRate()(RateLimitable) { + return m.rate +} +// GetResources gets the resources property value. The resources property +// returns a RateLimitOverview_resourcesable when successful +func (m *RateLimitOverview) GetResources()(RateLimitOverview_resourcesable) { + return m.resources +} +// Serialize serializes information the current object +func (m *RateLimitOverview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("rate", m.GetRate()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("resources", m.GetResources()) + 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 *RateLimitOverview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRate sets the rate property value. The rate property +func (m *RateLimitOverview) SetRate(value RateLimitable)() { + m.rate = value +} +// SetResources sets the resources property value. The resources property +func (m *RateLimitOverview) SetResources(value RateLimitOverview_resourcesable)() { + m.resources = value +} +type RateLimitOverviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRate()(RateLimitable) + GetResources()(RateLimitOverview_resourcesable) + SetRate(value RateLimitable)() + SetResources(value RateLimitOverview_resourcesable)() +} diff --git a/pkg/github/models/rate_limit_overview_escaped_resources.go b/pkg/github/models/rate_limit_overview_escaped_resources.go new file mode 100644 index 00000000..d0c58239 --- /dev/null +++ b/pkg/github/models/rate_limit_overview_escaped_resources.go @@ -0,0 +1,312 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RateLimitOverview_resources struct { + // The actions_runner_registration property + 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_upload property + code_scanning_upload RateLimitable + // The code_search property + code_search RateLimitable + // The core property + core RateLimitable + // The graphql property + graphql RateLimitable + // The integration_manifest property + integration_manifest RateLimitable + // The scim property + scim RateLimitable + // The search property + search RateLimitable + // The source_import property + source_import RateLimitable +} +// NewRateLimitOverview_resources instantiates a new RateLimitOverview_resources and sets the default values. +func NewRateLimitOverview_resources()(*RateLimitOverview_resources) { + m := &RateLimitOverview_resources{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRateLimitOverview_resourcesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRateLimitOverview_resourcesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRateLimitOverview_resources(), nil +} +// GetActionsRunnerRegistration gets the actions_runner_registration property value. The actions_runner_registration property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetActionsRunnerRegistration()(RateLimitable) { + return m.actions_runner_registration +} +// 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 *RateLimitOverview_resources) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCodeScanningUpload gets the code_scanning_upload property value. The code_scanning_upload property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetCodeScanningUpload()(RateLimitable) { + return m.code_scanning_upload +} +// GetCodeSearch gets the code_search property value. The code_search property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetCodeSearch()(RateLimitable) { + return m.code_search +} +// GetCore gets the core property value. The core property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetCore()(RateLimitable) { + return m.core +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RateLimitOverview_resources) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actions_runner_registration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActionsRunnerRegistration(val.(RateLimitable)) + } + return nil + } + res["code_scanning_upload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeScanningUpload(val.(RateLimitable)) + } + return nil + } + res["code_search"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCodeSearch(val.(RateLimitable)) + } + return nil + } + res["core"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCore(val.(RateLimitable)) + } + return nil + } + res["graphql"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetGraphql(val.(RateLimitable)) + } + return nil + } + res["integration_manifest"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIntegrationManifest(val.(RateLimitable)) + } + return nil + } + res["scim"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetScim(val.(RateLimitable)) + } + return nil + } + res["search"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSearch(val.(RateLimitable)) + } + return nil + } + res["source_import"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRateLimitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSourceImport(val.(RateLimitable)) + } + return nil + } + return res +} +// GetGraphql gets the graphql property value. The graphql property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetGraphql()(RateLimitable) { + return m.graphql +} +// GetIntegrationManifest gets the integration_manifest property value. The integration_manifest property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetIntegrationManifest()(RateLimitable) { + return m.integration_manifest +} +// GetScim gets the scim property value. The scim property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetScim()(RateLimitable) { + return m.scim +} +// GetSearch gets the search property value. The search property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetSearch()(RateLimitable) { + return m.search +} +// GetSourceImport gets the source_import property value. The source_import property +// returns a RateLimitable when successful +func (m *RateLimitOverview_resources) GetSourceImport()(RateLimitable) { + return m.source_import +} +// Serialize serializes information the current object +func (m *RateLimitOverview_resources) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actions_runner_registration", m.GetActionsRunnerRegistration()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("code_scanning_upload", m.GetCodeScanningUpload()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("code_search", m.GetCodeSearch()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("core", m.GetCore()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("graphql", m.GetGraphql()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("integration_manifest", m.GetIntegrationManifest()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("scim", m.GetScim()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("search", m.GetSearch()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("source_import", m.GetSourceImport()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActionsRunnerRegistration sets the actions_runner_registration property value. The actions_runner_registration property +func (m *RateLimitOverview_resources) SetActionsRunnerRegistration(value RateLimitable)() { + m.actions_runner_registration = 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 *RateLimitOverview_resources) SetAdditionalData(value map[string]any)() { + m.additionalData = 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 +} +// SetCodeSearch sets the code_search property value. The code_search property +func (m *RateLimitOverview_resources) SetCodeSearch(value RateLimitable)() { + m.code_search = value +} +// SetCore sets the core property value. The core property +func (m *RateLimitOverview_resources) SetCore(value RateLimitable)() { + m.core = value +} +// SetGraphql sets the graphql property value. The graphql property +func (m *RateLimitOverview_resources) SetGraphql(value RateLimitable)() { + m.graphql = value +} +// SetIntegrationManifest sets the integration_manifest property value. The integration_manifest property +func (m *RateLimitOverview_resources) SetIntegrationManifest(value RateLimitable)() { + m.integration_manifest = value +} +// SetScim sets the scim property value. The scim property +func (m *RateLimitOverview_resources) SetScim(value RateLimitable)() { + m.scim = value +} +// SetSearch sets the search property value. The search property +func (m *RateLimitOverview_resources) SetSearch(value RateLimitable)() { + m.search = value +} +// SetSourceImport sets the source_import property value. The source_import property +func (m *RateLimitOverview_resources) SetSourceImport(value RateLimitable)() { + m.source_import = value +} +type RateLimitOverview_resourcesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActionsRunnerRegistration()(RateLimitable) + GetCodeScanningUpload()(RateLimitable) + GetCodeSearch()(RateLimitable) + GetCore()(RateLimitable) + GetGraphql()(RateLimitable) + GetIntegrationManifest()(RateLimitable) + GetScim()(RateLimitable) + GetSearch()(RateLimitable) + GetSourceImport()(RateLimitable) + SetActionsRunnerRegistration(value RateLimitable)() + SetCodeScanningUpload(value RateLimitable)() + SetCodeSearch(value RateLimitable)() + SetCore(value RateLimitable)() + SetGraphql(value RateLimitable)() + SetIntegrationManifest(value RateLimitable)() + SetScim(value RateLimitable)() + SetSearch(value RateLimitable)() + SetSourceImport(value RateLimitable)() +} diff --git a/pkg/github/models/reaction.go b/pkg/github/models/reaction.go new file mode 100644 index 00000000..058d4383 --- /dev/null +++ b/pkg/github/models/reaction.go @@ -0,0 +1,199 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Reaction reactions to conversations provide a way to help people express their feelings more simply and effectively. +type Reaction 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 reaction to use + content *Reaction_content + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The id property + id *int32 + // The node_id property + node_id *string + // A GitHub user. + user NullableSimpleUserable +} +// NewReaction instantiates a new Reaction and sets the default values. +func NewReaction()(*Reaction) { + m := &Reaction{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReactionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReactionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReaction(), 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 *Reaction) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContent gets the content property value. The reaction to use +// returns a *Reaction_content when successful +func (m *Reaction) GetContent()(*Reaction_content) { + return m.content +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Reaction) 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 *Reaction) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseReaction_content) + if err != nil { + return err + } + if val != nil { + m.SetContent(val.(*Reaction_content)) + } + return nil + } + 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Reaction) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Reaction) GetNodeId()(*string) { + return m.node_id +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Reaction) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *Reaction) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContent() != nil { + cast := (*m.GetContent()).String() + err := writer.WriteStringValue("content", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *Reaction) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContent sets the content property value. The reaction to use +func (m *Reaction) SetContent(value *Reaction_content)() { + m.content = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Reaction) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *Reaction) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Reaction) SetNodeId(value *string)() { + m.node_id = value +} +// SetUser sets the user property value. A GitHub user. +func (m *Reaction) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type Reactionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContent()(*Reaction_content) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetNodeId()(*string) + GetUser()(NullableSimpleUserable) + SetContent(value *Reaction_content)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetNodeId(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/reaction_escaped_content.go b/pkg/github/models/reaction_escaped_content.go new file mode 100644 index 00000000..92557557 --- /dev/null +++ b/pkg/github/models/reaction_escaped_content.go @@ -0,0 +1,52 @@ +package models +// The reaction to use +type Reaction_content int + +const ( + PLUS_1_REACTION_CONTENT Reaction_content = iota + MINUS_1_REACTION_CONTENT + LAUGH_REACTION_CONTENT + CONFUSED_REACTION_CONTENT + HEART_REACTION_CONTENT + HOORAY_REACTION_CONTENT + ROCKET_REACTION_CONTENT + EYES_REACTION_CONTENT +) + +func (i Reaction_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReaction_content(v string) (any, error) { + result := PLUS_1_REACTION_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTION_CONTENT + case "-1": + result = MINUS_1_REACTION_CONTENT + case "laugh": + result = LAUGH_REACTION_CONTENT + case "confused": + result = CONFUSED_REACTION_CONTENT + case "heart": + result = HEART_REACTION_CONTENT + case "hooray": + result = HOORAY_REACTION_CONTENT + case "rocket": + result = ROCKET_REACTION_CONTENT + case "eyes": + result = EYES_REACTION_CONTENT + default: + return nil, nil + } + return &result, nil +} +func SerializeReaction_content(values []Reaction_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Reaction_content) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/reaction_rollup.go b/pkg/github/models/reaction_rollup.go new file mode 100644 index 00000000..9b51070e --- /dev/null +++ b/pkg/github/models/reaction_rollup.go @@ -0,0 +1,341 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ReactionRollup 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 confused property + confused *int32 + // The eyes property + eyes *int32 + // The heart property + heart *int32 + // The hooray property + hooray *int32 + // The laugh property + laugh *int32 + // The minus_1 property + minus_1 *int32 + // The plus_1 property + plus_1 *int32 + // The rocket property + rocket *int32 + // The total_count property + total_count *int32 + // The url property + url *string +} +// NewReactionRollup instantiates a new ReactionRollup and sets the default values. +func NewReactionRollup()(*ReactionRollup) { + m := &ReactionRollup{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReactionRollupFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReactionRollupFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReactionRollup(), 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 *ReactionRollup) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfused gets the confused property value. The confused property +// returns a *int32 when successful +func (m *ReactionRollup) GetConfused()(*int32) { + return m.confused +} +// GetEyes gets the eyes property value. The eyes property +// returns a *int32 when successful +func (m *ReactionRollup) GetEyes()(*int32) { + return m.eyes +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReactionRollup) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["confused"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetConfused(val) + } + return nil + } + res["eyes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetEyes(val) + } + return nil + } + res["heart"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetHeart(val) + } + return nil + } + res["hooray"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetHooray(val) + } + return nil + } + res["laugh"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLaugh(val) + } + return nil + } + res["-1"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMinus1(val) + } + return nil + } + res["+1"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPlus1(val) + } + return nil + } + res["rocket"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRocket(val) + } + 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 + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHeart gets the heart property value. The heart property +// returns a *int32 when successful +func (m *ReactionRollup) GetHeart()(*int32) { + return m.heart +} +// GetHooray gets the hooray property value. The hooray property +// returns a *int32 when successful +func (m *ReactionRollup) GetHooray()(*int32) { + return m.hooray +} +// GetLaugh gets the laugh property value. The laugh property +// returns a *int32 when successful +func (m *ReactionRollup) GetLaugh()(*int32) { + return m.laugh +} +// GetMinus1 gets the -1 property value. The minus_1 property +// returns a *int32 when successful +func (m *ReactionRollup) GetMinus1()(*int32) { + return m.minus_1 +} +// GetPlus1 gets the +1 property value. The plus_1 property +// returns a *int32 when successful +func (m *ReactionRollup) GetPlus1()(*int32) { + return m.plus_1 +} +// GetRocket gets the rocket property value. The rocket property +// returns a *int32 when successful +func (m *ReactionRollup) GetRocket()(*int32) { + return m.rocket +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ReactionRollup) GetTotalCount()(*int32) { + return m.total_count +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ReactionRollup) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ReactionRollup) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("confused", m.GetConfused()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("eyes", m.GetEyes()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("heart", m.GetHeart()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("hooray", m.GetHooray()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("laugh", m.GetLaugh()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("-1", m.GetMinus1()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("+1", m.GetPlus1()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("rocket", m.GetRocket()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ReactionRollup) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfused sets the confused property value. The confused property +func (m *ReactionRollup) SetConfused(value *int32)() { + m.confused = value +} +// SetEyes sets the eyes property value. The eyes property +func (m *ReactionRollup) SetEyes(value *int32)() { + m.eyes = value +} +// SetHeart sets the heart property value. The heart property +func (m *ReactionRollup) SetHeart(value *int32)() { + m.heart = value +} +// SetHooray sets the hooray property value. The hooray property +func (m *ReactionRollup) SetHooray(value *int32)() { + m.hooray = value +} +// SetLaugh sets the laugh property value. The laugh property +func (m *ReactionRollup) SetLaugh(value *int32)() { + m.laugh = value +} +// SetMinus1 sets the -1 property value. The minus_1 property +func (m *ReactionRollup) SetMinus1(value *int32)() { + m.minus_1 = value +} +// SetPlus1 sets the +1 property value. The plus_1 property +func (m *ReactionRollup) SetPlus1(value *int32)() { + m.plus_1 = value +} +// SetRocket sets the rocket property value. The rocket property +func (m *ReactionRollup) SetRocket(value *int32)() { + m.rocket = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ReactionRollup) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetUrl sets the url property value. The url property +func (m *ReactionRollup) SetUrl(value *string)() { + m.url = value +} +type ReactionRollupable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConfused()(*int32) + GetEyes()(*int32) + GetHeart()(*int32) + GetHooray()(*int32) + GetLaugh()(*int32) + GetMinus1()(*int32) + GetPlus1()(*int32) + GetRocket()(*int32) + GetTotalCount()(*int32) + GetUrl()(*string) + SetConfused(value *int32)() + SetEyes(value *int32)() + SetHeart(value *int32)() + SetHooray(value *int32)() + SetLaugh(value *int32)() + SetMinus1(value *int32)() + SetPlus1(value *int32)() + SetRocket(value *int32)() + SetTotalCount(value *int32)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/referenced_workflow.go b/pkg/github/models/referenced_workflow.go new file mode 100644 index 00000000..7b758338 --- /dev/null +++ b/pkg/github/models/referenced_workflow.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReferencedWorkflow a workflow referenced/reused by the initial caller workflow +type ReferencedWorkflow 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 path property + path *string + // The ref property + ref *string + // The sha property + sha *string +} +// NewReferencedWorkflow instantiates a new ReferencedWorkflow and sets the default values. +func NewReferencedWorkflow()(*ReferencedWorkflow) { + m := &ReferencedWorkflow{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReferencedWorkflowFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReferencedWorkflowFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReferencedWorkflow(), 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 *ReferencedWorkflow) 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 *ReferencedWorkflow) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *ReferencedWorkflow) GetPath()(*string) { + return m.path +} +// GetRef gets the ref property value. The ref property +// returns a *string when successful +func (m *ReferencedWorkflow) GetRef()(*string) { + return m.ref +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *ReferencedWorkflow) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *ReferencedWorkflow) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *ReferencedWorkflow) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPath sets the path property value. The path property +func (m *ReferencedWorkflow) SetPath(value *string)() { + m.path = value +} +// SetRef sets the ref property value. The ref property +func (m *ReferencedWorkflow) SetRef(value *string)() { + m.ref = value +} +// SetSha sets the sha property value. The sha property +func (m *ReferencedWorkflow) SetSha(value *string)() { + m.sha = value +} +type ReferencedWorkflowable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPath()(*string) + GetRef()(*string) + GetSha()(*string) + SetPath(value *string)() + SetRef(value *string)() + SetSha(value *string)() +} diff --git a/pkg/github/models/release.go b/pkg/github/models/release.go new file mode 100644 index 00000000..bbce5920 --- /dev/null +++ b/pkg/github/models/release.go @@ -0,0 +1,703 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Release a release. +type Release 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 assets property + assets []ReleaseAssetable + // The assets_url property + assets_url *string + // A GitHub user. + author SimpleUserable + // The body property + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // true to create a draft (unpublished) release, false to create a published one. + draft *bool + // The html_url property + html_url *string + // The id property + id *int32 + // The mentions_count property + mentions_count *int32 + // The name property + name *string + // The node_id property + node_id *string + // Whether to identify the release as a prerelease or a full release. + prerelease *bool + // The published_at property + published_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The reactions property + reactions ReactionRollupable + // The name of the tag. + tag_name *string + // The tarball_url property + tarball_url *string + // Specifies the commitish value that determines where the Git tag is created from. + target_commitish *string + // The upload_url property + upload_url *string + // The url property + url *string + // The zipball_url property + zipball_url *string +} +// NewRelease instantiates a new Release and sets the default values. +func NewRelease()(*Release) { + m := &Release{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReleaseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReleaseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRelease(), 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 *Release) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssets gets the assets property value. The assets property +// returns a []ReleaseAssetable when successful +func (m *Release) GetAssets()([]ReleaseAssetable) { + return m.assets +} +// GetAssetsUrl gets the assets_url property value. The assets_url property +// returns a *string when successful +func (m *Release) GetAssetsUrl()(*string) { + return m.assets_url +} +// GetAuthor gets the author property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *Release) GetAuthor()(SimpleUserable) { + return m.author +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *Release) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *Release) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *Release) GetBodyText()(*string) { + return m.body_text +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Release) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDraft gets the draft property value. true to create a draft (unpublished) release, false to create a published one. +// returns a *bool when successful +func (m *Release) GetDraft()(*bool) { + return m.draft +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Release) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["assets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateReleaseAssetFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ReleaseAssetable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ReleaseAssetable) + } + } + m.SetAssets(res) + } + return nil + } + res["assets_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssetsUrl(val) + } + return nil + } + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(SimpleUserable)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + 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["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["mentions_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMentionsCount(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["prerelease"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrerelease(val) + } + return nil + } + res["published_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPublishedAt(val) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["tag_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagName(val) + } + return nil + } + res["tarball_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTarballUrl(val) + } + return nil + } + res["target_commitish"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetCommitish(val) + } + return nil + } + res["upload_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUploadUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["zipball_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetZipballUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Release) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Release) GetId()(*int32) { + return m.id +} +// GetMentionsCount gets the mentions_count property value. The mentions_count property +// returns a *int32 when successful +func (m *Release) GetMentionsCount()(*int32) { + return m.mentions_count +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Release) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Release) GetNodeId()(*string) { + return m.node_id +} +// GetPrerelease gets the prerelease property value. Whether to identify the release as a prerelease or a full release. +// returns a *bool when successful +func (m *Release) GetPrerelease()(*bool) { + return m.prerelease +} +// GetPublishedAt gets the published_at property value. The published_at property +// returns a *Time when successful +func (m *Release) GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.published_at +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *Release) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetTagName gets the tag_name property value. The name of the tag. +// returns a *string when successful +func (m *Release) GetTagName()(*string) { + return m.tag_name +} +// GetTarballUrl gets the tarball_url property value. The tarball_url property +// returns a *string when successful +func (m *Release) GetTarballUrl()(*string) { + return m.tarball_url +} +// GetTargetCommitish gets the target_commitish property value. Specifies the commitish value that determines where the Git tag is created from. +// returns a *string when successful +func (m *Release) GetTargetCommitish()(*string) { + return m.target_commitish +} +// GetUploadUrl gets the upload_url property value. The upload_url property +// returns a *string when successful +func (m *Release) GetUploadUrl()(*string) { + return m.upload_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Release) GetUrl()(*string) { + return m.url +} +// GetZipballUrl gets the zipball_url property value. The zipball_url property +// returns a *string when successful +func (m *Release) GetZipballUrl()(*string) { + return m.zipball_url +} +// Serialize serializes information the current object +func (m *Release) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAssets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAssets())) + for i, v := range m.GetAssets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("assets", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assets_url", m.GetAssetsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("mentions_count", m.GetMentionsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("prerelease", m.GetPrerelease()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("published_at", m.GetPublishedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tag_name", m.GetTagName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tarball_url", m.GetTarballUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_commitish", m.GetTargetCommitish()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("upload_url", m.GetUploadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("zipball_url", m.GetZipballUrl()) + 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 *Release) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssets sets the assets property value. The assets property +func (m *Release) SetAssets(value []ReleaseAssetable)() { + m.assets = value +} +// SetAssetsUrl sets the assets_url property value. The assets_url property +func (m *Release) SetAssetsUrl(value *string)() { + m.assets_url = value +} +// SetAuthor sets the author property value. A GitHub user. +func (m *Release) SetAuthor(value SimpleUserable)() { + m.author = value +} +// SetBody sets the body property value. The body property +func (m *Release) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *Release) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *Release) SetBodyText(value *string)() { + m.body_text = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Release) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDraft sets the draft property value. true to create a draft (unpublished) release, false to create a published one. +func (m *Release) SetDraft(value *bool)() { + m.draft = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Release) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Release) SetId(value *int32)() { + m.id = value +} +// SetMentionsCount sets the mentions_count property value. The mentions_count property +func (m *Release) SetMentionsCount(value *int32)() { + m.mentions_count = value +} +// SetName sets the name property value. The name property +func (m *Release) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Release) SetNodeId(value *string)() { + m.node_id = value +} +// SetPrerelease sets the prerelease property value. Whether to identify the release as a prerelease or a full release. +func (m *Release) SetPrerelease(value *bool)() { + m.prerelease = value +} +// SetPublishedAt sets the published_at property value. The published_at property +func (m *Release) SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.published_at = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *Release) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetTagName sets the tag_name property value. The name of the tag. +func (m *Release) SetTagName(value *string)() { + m.tag_name = value +} +// SetTarballUrl sets the tarball_url property value. The tarball_url property +func (m *Release) SetTarballUrl(value *string)() { + m.tarball_url = value +} +// SetTargetCommitish sets the target_commitish property value. Specifies the commitish value that determines where the Git tag is created from. +func (m *Release) SetTargetCommitish(value *string)() { + m.target_commitish = value +} +// SetUploadUrl sets the upload_url property value. The upload_url property +func (m *Release) SetUploadUrl(value *string)() { + m.upload_url = value +} +// SetUrl sets the url property value. The url property +func (m *Release) SetUrl(value *string)() { + m.url = value +} +// SetZipballUrl sets the zipball_url property value. The zipball_url property +func (m *Release) SetZipballUrl(value *string)() { + m.zipball_url = value +} +type Releaseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssets()([]ReleaseAssetable) + GetAssetsUrl()(*string) + GetAuthor()(SimpleUserable) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDraft()(*bool) + GetHtmlUrl()(*string) + GetId()(*int32) + GetMentionsCount()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetPrerelease()(*bool) + GetPublishedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReactions()(ReactionRollupable) + GetTagName()(*string) + GetTarballUrl()(*string) + GetTargetCommitish()(*string) + GetUploadUrl()(*string) + GetUrl()(*string) + GetZipballUrl()(*string) + SetAssets(value []ReleaseAssetable)() + SetAssetsUrl(value *string)() + SetAuthor(value SimpleUserable)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDraft(value *bool)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetMentionsCount(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetPrerelease(value *bool)() + SetPublishedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReactions(value ReactionRollupable)() + SetTagName(value *string)() + SetTarballUrl(value *string)() + SetTargetCommitish(value *string)() + SetUploadUrl(value *string)() + SetUrl(value *string)() + SetZipballUrl(value *string)() +} diff --git a/pkg/github/models/release_asset.go b/pkg/github/models/release_asset.go new file mode 100644 index 00000000..019e884e --- /dev/null +++ b/pkg/github/models/release_asset.go @@ -0,0 +1,431 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReleaseAsset data related to a release. +type ReleaseAsset 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 browser_download_url property + browser_download_url *string + // The content_type property + content_type *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The download_count property + download_count *int32 + // The id property + id *int32 + // The label property + label *string + // The file name of the asset. + name *string + // The node_id property + node_id *string + // The size property + size *int32 + // State of the release asset. + state *ReleaseAsset_state + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + uploader NullableSimpleUserable + // The url property + url *string +} +// NewReleaseAsset instantiates a new ReleaseAsset and sets the default values. +func NewReleaseAsset()(*ReleaseAsset) { + m := &ReleaseAsset{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReleaseAssetFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReleaseAssetFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReleaseAsset(), 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 *ReleaseAsset) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBrowserDownloadUrl gets the browser_download_url property value. The browser_download_url property +// returns a *string when successful +func (m *ReleaseAsset) GetBrowserDownloadUrl()(*string) { + return m.browser_download_url +} +// GetContentType gets the content_type property value. The content_type property +// returns a *string when successful +func (m *ReleaseAsset) GetContentType()(*string) { + return m.content_type +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *ReleaseAsset) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDownloadCount gets the download_count property value. The download_count property +// returns a *int32 when successful +func (m *ReleaseAsset) GetDownloadCount()(*int32) { + return m.download_count +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReleaseAsset) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["browser_download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBrowserDownloadUrl(val) + } + return nil + } + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + 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["download_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDownloadCount(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabel(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseReleaseAsset_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*ReleaseAsset_state)) + } + 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["uploader"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUploader(val.(NullableSimpleUserable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ReleaseAsset) GetId()(*int32) { + return m.id +} +// GetLabel gets the label property value. The label property +// returns a *string when successful +func (m *ReleaseAsset) GetLabel()(*string) { + return m.label +} +// GetName gets the name property value. The file name of the asset. +// returns a *string when successful +func (m *ReleaseAsset) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ReleaseAsset) GetNodeId()(*string) { + return m.node_id +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *ReleaseAsset) GetSize()(*int32) { + return m.size +} +// GetState gets the state property value. State of the release asset. +// returns a *ReleaseAsset_state when successful +func (m *ReleaseAsset) GetState()(*ReleaseAsset_state) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *ReleaseAsset) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUploader gets the uploader property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *ReleaseAsset) GetUploader()(NullableSimpleUserable) { + return m.uploader +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ReleaseAsset) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ReleaseAsset) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("browser_download_url", m.GetBrowserDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("download_count", m.GetDownloadCount()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("uploader", m.GetUploader()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ReleaseAsset) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBrowserDownloadUrl sets the browser_download_url property value. The browser_download_url property +func (m *ReleaseAsset) SetBrowserDownloadUrl(value *string)() { + m.browser_download_url = value +} +// SetContentType sets the content_type property value. The content_type property +func (m *ReleaseAsset) SetContentType(value *string)() { + m.content_type = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ReleaseAsset) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDownloadCount sets the download_count property value. The download_count property +func (m *ReleaseAsset) SetDownloadCount(value *int32)() { + m.download_count = value +} +// SetId sets the id property value. The id property +func (m *ReleaseAsset) SetId(value *int32)() { + m.id = value +} +// SetLabel sets the label property value. The label property +func (m *ReleaseAsset) SetLabel(value *string)() { + m.label = value +} +// SetName sets the name property value. The file name of the asset. +func (m *ReleaseAsset) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ReleaseAsset) SetNodeId(value *string)() { + m.node_id = value +} +// SetSize sets the size property value. The size property +func (m *ReleaseAsset) SetSize(value *int32)() { + m.size = value +} +// SetState sets the state property value. State of the release asset. +func (m *ReleaseAsset) SetState(value *ReleaseAsset_state)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *ReleaseAsset) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUploader sets the uploader property value. A GitHub user. +func (m *ReleaseAsset) SetUploader(value NullableSimpleUserable)() { + m.uploader = value +} +// SetUrl sets the url property value. The url property +func (m *ReleaseAsset) SetUrl(value *string)() { + m.url = value +} +type ReleaseAssetable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBrowserDownloadUrl()(*string) + GetContentType()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDownloadCount()(*int32) + GetId()(*int32) + GetLabel()(*string) + GetName()(*string) + GetNodeId()(*string) + GetSize()(*int32) + GetState()(*ReleaseAsset_state) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUploader()(NullableSimpleUserable) + GetUrl()(*string) + SetBrowserDownloadUrl(value *string)() + SetContentType(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDownloadCount(value *int32)() + SetId(value *int32)() + SetLabel(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetSize(value *int32)() + SetState(value *ReleaseAsset_state)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUploader(value NullableSimpleUserable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/release_asset_escaped_state.go b/pkg/github/models/release_asset_escaped_state.go new file mode 100644 index 00000000..5e1f5f16 --- /dev/null +++ b/pkg/github/models/release_asset_escaped_state.go @@ -0,0 +1,34 @@ +package models +// State of the release asset. +type ReleaseAsset_state int + +const ( + UPLOADED_RELEASEASSET_STATE ReleaseAsset_state = iota + OPEN_RELEASEASSET_STATE +) + +func (i ReleaseAsset_state) String() string { + return []string{"uploaded", "open"}[i] +} +func ParseReleaseAsset_state(v string) (any, error) { + result := UPLOADED_RELEASEASSET_STATE + switch v { + case "uploaded": + result = UPLOADED_RELEASEASSET_STATE + case "open": + result = OPEN_RELEASEASSET_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeReleaseAsset_state(values []ReleaseAsset_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReleaseAsset_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/release_notes_content.go b/pkg/github/models/release_notes_content.go new file mode 100644 index 00000000..30f4b092 --- /dev/null +++ b/pkg/github/models/release_notes_content.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReleaseNotesContent generated name and body describing a release +type ReleaseNotesContent 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 generated body describing the contents of the release supporting markdown formatting + body *string + // The generated name of the release + name *string +} +// NewReleaseNotesContent instantiates a new ReleaseNotesContent and sets the default values. +func NewReleaseNotesContent()(*ReleaseNotesContent) { + m := &ReleaseNotesContent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReleaseNotesContentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReleaseNotesContentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReleaseNotesContent(), 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 *ReleaseNotesContent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The generated body describing the contents of the release supporting markdown formatting +// returns a *string when successful +func (m *ReleaseNotesContent) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReleaseNotesContent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(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 generated name of the release +// returns a *string when successful +func (m *ReleaseNotesContent) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ReleaseNotesContent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ReleaseNotesContent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The generated body describing the contents of the release supporting markdown formatting +func (m *ReleaseNotesContent) SetBody(value *string)() { + m.body = value +} +// SetName sets the name property value. The generated name of the release +func (m *ReleaseNotesContent) SetName(value *string)() { + m.name = value +} +type ReleaseNotesContentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetName()(*string) + SetBody(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/removed_from_project_issue_event.go b/pkg/github/models/removed_from_project_issue_event.go new file mode 100644 index 00000000..a88a6240 --- /dev/null +++ b/pkg/github/models/removed_from_project_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RemovedFromProjectIssueEvent removed from Project Issue Event +type RemovedFromProjectIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The project_card property + project_card RemovedFromProjectIssueEvent_project_cardable + // The url property + url *string +} +// NewRemovedFromProjectIssueEvent instantiates a new RemovedFromProjectIssueEvent and sets the default values. +func NewRemovedFromProjectIssueEvent()(*RemovedFromProjectIssueEvent) { + m := &RemovedFromProjectIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRemovedFromProjectIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRemovedFromProjectIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRemovedFromProjectIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *RemovedFromProjectIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *RemovedFromProjectIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RemovedFromProjectIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["project_card"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRemovedFromProjectIssueEvent_project_cardFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProjectCard(val.(RemovedFromProjectIssueEvent_project_cardable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *RemovedFromProjectIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *RemovedFromProjectIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetProjectCard gets the project_card property value. The project_card property +// returns a RemovedFromProjectIssueEvent_project_cardable when successful +func (m *RemovedFromProjectIssueEvent) GetProjectCard()(RemovedFromProjectIssueEvent_project_cardable) { + return m.project_card +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *RemovedFromProjectIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("project_card", m.GetProjectCard()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *RemovedFromProjectIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *RemovedFromProjectIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *RemovedFromProjectIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *RemovedFromProjectIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *RemovedFromProjectIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *RemovedFromProjectIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *RemovedFromProjectIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *RemovedFromProjectIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *RemovedFromProjectIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetProjectCard sets the project_card property value. The project_card property +func (m *RemovedFromProjectIssueEvent) SetProjectCard(value RemovedFromProjectIssueEvent_project_cardable)() { + m.project_card = value +} +// SetUrl sets the url property value. The url property +func (m *RemovedFromProjectIssueEvent) SetUrl(value *string)() { + m.url = value +} +type RemovedFromProjectIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetProjectCard()(RemovedFromProjectIssueEvent_project_cardable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetProjectCard(value RemovedFromProjectIssueEvent_project_cardable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/removed_from_project_issue_event_escaped_project_escaped_card.go b/pkg/github/models/removed_from_project_issue_event_escaped_project_escaped_card.go new file mode 100644 index 00000000..23745ae1 --- /dev/null +++ b/pkg/github/models/removed_from_project_issue_event_escaped_project_escaped_card.go @@ -0,0 +1,225 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RemovedFromProjectIssueEvent_project_card 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 column_name property + column_name *string + // The id property + id *int32 + // The previous_column_name property + previous_column_name *string + // The project_id property + project_id *int32 + // The project_url property + project_url *string + // The url property + url *string +} +// NewRemovedFromProjectIssueEvent_project_card instantiates a new RemovedFromProjectIssueEvent_project_card and sets the default values. +func NewRemovedFromProjectIssueEvent_project_card()(*RemovedFromProjectIssueEvent_project_card) { + m := &RemovedFromProjectIssueEvent_project_card{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRemovedFromProjectIssueEvent_project_cardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRemovedFromProjectIssueEvent_project_cardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRemovedFromProjectIssueEvent_project_card(), 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 *RemovedFromProjectIssueEvent_project_card) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColumnName gets the column_name property value. The column_name property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent_project_card) GetColumnName()(*string) { + return m.column_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RemovedFromProjectIssueEvent_project_card) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnName(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["previous_column_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousColumnName(val) + } + return nil + } + res["project_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetProjectId(val) + } + return nil + } + res["project_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProjectUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *RemovedFromProjectIssueEvent_project_card) GetId()(*int32) { + return m.id +} +// GetPreviousColumnName gets the previous_column_name property value. The previous_column_name property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent_project_card) GetPreviousColumnName()(*string) { + return m.previous_column_name +} +// GetProjectId gets the project_id property value. The project_id property +// returns a *int32 when successful +func (m *RemovedFromProjectIssueEvent_project_card) GetProjectId()(*int32) { + return m.project_id +} +// GetProjectUrl gets the project_url property value. The project_url property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent_project_card) GetProjectUrl()(*string) { + return m.project_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *RemovedFromProjectIssueEvent_project_card) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *RemovedFromProjectIssueEvent_project_card) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("column_name", m.GetColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_column_name", m.GetPreviousColumnName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("project_id", m.GetProjectId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("project_url", m.GetProjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *RemovedFromProjectIssueEvent_project_card) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColumnName sets the column_name property value. The column_name property +func (m *RemovedFromProjectIssueEvent_project_card) SetColumnName(value *string)() { + m.column_name = value +} +// SetId sets the id property value. The id property +func (m *RemovedFromProjectIssueEvent_project_card) SetId(value *int32)() { + m.id = value +} +// SetPreviousColumnName sets the previous_column_name property value. The previous_column_name property +func (m *RemovedFromProjectIssueEvent_project_card) SetPreviousColumnName(value *string)() { + m.previous_column_name = value +} +// SetProjectId sets the project_id property value. The project_id property +func (m *RemovedFromProjectIssueEvent_project_card) SetProjectId(value *int32)() { + m.project_id = value +} +// SetProjectUrl sets the project_url property value. The project_url property +func (m *RemovedFromProjectIssueEvent_project_card) SetProjectUrl(value *string)() { + m.project_url = value +} +// SetUrl sets the url property value. The url property +func (m *RemovedFromProjectIssueEvent_project_card) SetUrl(value *string)() { + m.url = value +} +type RemovedFromProjectIssueEvent_project_cardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumnName()(*string) + GetId()(*int32) + GetPreviousColumnName()(*string) + GetProjectId()(*int32) + GetProjectUrl()(*string) + GetUrl()(*string) + SetColumnName(value *string)() + SetId(value *int32)() + SetPreviousColumnName(value *string)() + SetProjectId(value *int32)() + SetProjectUrl(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/renamed_issue_event.go b/pkg/github/models/renamed_issue_event.go new file mode 100644 index 00000000..fe0c701c --- /dev/null +++ b/pkg/github/models/renamed_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RenamedIssueEvent renamed Issue Event +type RenamedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The rename property + rename RenamedIssueEvent_renameable + // The url property + url *string +} +// NewRenamedIssueEvent instantiates a new RenamedIssueEvent and sets the default values. +func NewRenamedIssueEvent()(*RenamedIssueEvent) { + m := &RenamedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRenamedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRenamedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRenamedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *RenamedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *RenamedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *RenamedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *RenamedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *RenamedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *RenamedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RenamedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["rename"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRenamedIssueEvent_renameFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRename(val.(RenamedIssueEvent_renameable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *RenamedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *RenamedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *RenamedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetRename gets the rename property value. The rename property +// returns a RenamedIssueEvent_renameable when successful +func (m *RenamedIssueEvent) GetRename()(RenamedIssueEvent_renameable) { + return m.rename +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *RenamedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *RenamedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("rename", m.GetRename()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *RenamedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *RenamedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *RenamedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *RenamedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *RenamedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *RenamedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *RenamedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *RenamedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *RenamedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetRename sets the rename property value. The rename property +func (m *RenamedIssueEvent) SetRename(value RenamedIssueEvent_renameable)() { + m.rename = value +} +// SetUrl sets the url property value. The url property +func (m *RenamedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type RenamedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetRename()(RenamedIssueEvent_renameable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetRename(value RenamedIssueEvent_renameable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/renamed_issue_event_escaped_rename.go b/pkg/github/models/renamed_issue_event_escaped_rename.go new file mode 100644 index 00000000..8eee09cd --- /dev/null +++ b/pkg/github/models/renamed_issue_event_escaped_rename.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RenamedIssueEvent_rename 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 from property + from *string + // The to property + to *string +} +// NewRenamedIssueEvent_rename instantiates a new RenamedIssueEvent_rename and sets the default values. +func NewRenamedIssueEvent_rename()(*RenamedIssueEvent_rename) { + m := &RenamedIssueEvent_rename{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRenamedIssueEvent_renameFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRenamedIssueEvent_renameFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRenamedIssueEvent_rename(), 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 *RenamedIssueEvent_rename) 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 *RenamedIssueEvent_rename) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["from"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFrom(val) + } + return nil + } + res["to"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTo(val) + } + return nil + } + return res +} +// GetFrom gets the from property value. The from property +// returns a *string when successful +func (m *RenamedIssueEvent_rename) GetFrom()(*string) { + return m.from +} +// GetTo gets the to property value. The to property +// returns a *string when successful +func (m *RenamedIssueEvent_rename) GetTo()(*string) { + return m.to +} +// Serialize serializes information the current object +func (m *RenamedIssueEvent_rename) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("from", m.GetFrom()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("to", m.GetTo()) + 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 *RenamedIssueEvent_rename) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFrom sets the from property value. The from property +func (m *RenamedIssueEvent_rename) SetFrom(value *string)() { + m.from = value +} +// SetTo sets the to property value. The to property +func (m *RenamedIssueEvent_rename) SetTo(value *string)() { + m.to = value +} +type RenamedIssueEvent_renameable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFrom()(*string) + GetTo()(*string) + SetFrom(value *string)() + SetTo(value *string)() +} diff --git a/pkg/github/models/repo_search_result_item.go b/pkg/github/models/repo_search_result_item.go new file mode 100644 index 00000000..60765901 --- /dev/null +++ b/pkg/github/models/repo_search_result_item.go @@ -0,0 +1,2652 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepoSearchResultItem repo Search Result Item +type RepoSearchResultItem 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 allow_auto_merge property + allow_auto_merge *bool + // The allow_forking property + allow_forking *bool + // The allow_merge_commit property + allow_merge_commit *bool + // The allow_rebase_merge property + allow_rebase_merge *bool + // The allow_squash_merge property + allow_squash_merge *bool + // The archive_url property + archive_url *string + // The archived property + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default_branch property + default_branch *string + // The delete_branch_on_merge property + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // Returns whether or not this repository disabled. + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // The has_discussions property + has_discussions *bool + // The has_downloads property + has_downloads *bool + // The has_issues property + has_issues *bool + // The has_pages property + has_pages *bool + // The has_projects property + has_projects *bool + // The has_wiki property + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The is_template property + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // License Simple + license NullableLicenseSimpleable + // The master_branch property + master_branch *string + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name property + name *string + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // A GitHub user. + owner NullableSimpleUserable + // The permissions property + permissions RepoSearchResultItem_permissionsable + // The private property + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The score property + score *float64 + // The size property + size *int32 + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The text_matches property + text_matches []Repositoriesable + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The repository visibility: public, private, or internal. + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewRepoSearchResultItem instantiates a new RepoSearchResultItem and sets the default values. +func NewRepoSearchResultItem()(*RepoSearchResultItem) { + m := &RepoSearchResultItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepoSearchResultItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepoSearchResultItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepoSearchResultItem(), 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 *RepoSearchResultItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. The allow_auto_merge property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowForking gets the allow_forking property value. The allow_forking property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. The allow_merge_commit property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. The allow_rebase_merge property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. The allow_squash_merge property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetArchived gets the archived property value. The archived property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *RepoSearchResultItem) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default_branch property +// returns a *string when successful +func (m *RepoSearchResultItem) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. The delete_branch_on_merge property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *RepoSearchResultItem) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. Returns whether or not this repository disabled. +// returns a *bool when successful +func (m *RepoSearchResultItem) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepoSearchResultItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + 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["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + 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["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + return nil + } + res["master_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMasterBranch(val) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableSimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepoSearchResultItem_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(RepoSearchResultItem_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["text_matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoriesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Repositoriesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Repositoriesable) + } + } + m.SetTextMatches(res) + } + return nil + } + res["topics"] = 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.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *RepoSearchResultItem) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. The has_discussions property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. The has_downloads property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. The has_issues property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. The has_projects property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. The has_wiki property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *RepoSearchResultItem) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetId()(*int32) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. The is_template property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *RepoSearchResultItem) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *RepoSearchResultItem) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetMasterBranch gets the master_branch property value. The master_branch property +// returns a *string when successful +func (m *RepoSearchResultItem) GetMasterBranch()(*string) { + return m.master_branch +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *RepoSearchResultItem) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *RepoSearchResultItem) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *RepoSearchResultItem) GetOwner()(NullableSimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a RepoSearchResultItem_permissionsable when successful +func (m *RepoSearchResultItem) GetPermissions()(RepoSearchResultItem_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. The private property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *RepoSearchResultItem) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetScore gets the score property value. The score property +// returns a *float64 when successful +func (m *RepoSearchResultItem) GetScore()(*float64) { + return m.score +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetSize()(*int32) { + return m.size +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *RepoSearchResultItem) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTextMatches gets the text_matches property value. The text_matches property +// returns a []Repositoriesable when successful +func (m *RepoSearchResultItem) GetTextMatches()([]Repositoriesable) { + return m.text_matches +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *RepoSearchResultItem) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *RepoSearchResultItem) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *RepoSearchResultItem) GetUrl()(*string) { + return m.url +} +// GetVisibility gets the visibility property value. The repository visibility: public, private, or internal. +// returns a *string when successful +func (m *RepoSearchResultItem) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *RepoSearchResultItem) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *RepoSearchResultItem) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *RepoSearchResultItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("master_branch", m.GetMasterBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("score", m.GetScore()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTextMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTextMatches())) + for i, v := range m.GetTextMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("text_matches", cast) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *RepoSearchResultItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. The allow_auto_merge property +func (m *RepoSearchResultItem) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowForking sets the allow_forking property value. The allow_forking property +func (m *RepoSearchResultItem) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. The allow_merge_commit property +func (m *RepoSearchResultItem) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. The allow_rebase_merge property +func (m *RepoSearchResultItem) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. The allow_squash_merge property +func (m *RepoSearchResultItem) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetArchived sets the archived property value. The archived property +func (m *RepoSearchResultItem) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *RepoSearchResultItem) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *RepoSearchResultItem) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *RepoSearchResultItem) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *RepoSearchResultItem) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *RepoSearchResultItem) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *RepoSearchResultItem) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *RepoSearchResultItem) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *RepoSearchResultItem) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *RepoSearchResultItem) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *RepoSearchResultItem) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *RepoSearchResultItem) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *RepoSearchResultItem) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default_branch property +func (m *RepoSearchResultItem) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. The delete_branch_on_merge property +func (m *RepoSearchResultItem) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *RepoSearchResultItem) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *RepoSearchResultItem) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. Returns whether or not this repository disabled. +func (m *RepoSearchResultItem) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *RepoSearchResultItem) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *RepoSearchResultItem) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *RepoSearchResultItem) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *RepoSearchResultItem) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *RepoSearchResultItem) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *RepoSearchResultItem) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *RepoSearchResultItem) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *RepoSearchResultItem) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *RepoSearchResultItem) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *RepoSearchResultItem) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *RepoSearchResultItem) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. The has_discussions property +func (m *RepoSearchResultItem) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. The has_downloads property +func (m *RepoSearchResultItem) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. The has_issues property +func (m *RepoSearchResultItem) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *RepoSearchResultItem) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. The has_projects property +func (m *RepoSearchResultItem) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. The has_wiki property +func (m *RepoSearchResultItem) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *RepoSearchResultItem) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *RepoSearchResultItem) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *RepoSearchResultItem) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *RepoSearchResultItem) SetId(value *int32)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *RepoSearchResultItem) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *RepoSearchResultItem) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *RepoSearchResultItem) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. The is_template property +func (m *RepoSearchResultItem) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *RepoSearchResultItem) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *RepoSearchResultItem) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *RepoSearchResultItem) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *RepoSearchResultItem) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. License Simple +func (m *RepoSearchResultItem) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetMasterBranch sets the master_branch property value. The master_branch property +func (m *RepoSearchResultItem) SetMasterBranch(value *string)() { + m.master_branch = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *RepoSearchResultItem) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *RepoSearchResultItem) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *RepoSearchResultItem) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name property +func (m *RepoSearchResultItem) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *RepoSearchResultItem) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *RepoSearchResultItem) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *RepoSearchResultItem) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *RepoSearchResultItem) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *RepoSearchResultItem) SetOwner(value NullableSimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *RepoSearchResultItem) SetPermissions(value RepoSearchResultItem_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. The private property +func (m *RepoSearchResultItem) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *RepoSearchResultItem) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *RepoSearchResultItem) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *RepoSearchResultItem) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetScore sets the score property value. The score property +func (m *RepoSearchResultItem) SetScore(value *float64)() { + m.score = value +} +// SetSize sets the size property value. The size property +func (m *RepoSearchResultItem) SetSize(value *int32)() { + m.size = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *RepoSearchResultItem) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *RepoSearchResultItem) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *RepoSearchResultItem) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *RepoSearchResultItem) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *RepoSearchResultItem) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *RepoSearchResultItem) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *RepoSearchResultItem) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *RepoSearchResultItem) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *RepoSearchResultItem) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *RepoSearchResultItem) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTextMatches sets the text_matches property value. The text_matches property +func (m *RepoSearchResultItem) SetTextMatches(value []Repositoriesable)() { + m.text_matches = value +} +// SetTopics sets the topics property value. The topics property +func (m *RepoSearchResultItem) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *RepoSearchResultItem) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *RepoSearchResultItem) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *RepoSearchResultItem) SetUrl(value *string)() { + m.url = value +} +// SetVisibility sets the visibility property value. The repository visibility: public, private, or internal. +func (m *RepoSearchResultItem) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *RepoSearchResultItem) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *RepoSearchResultItem) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *RepoSearchResultItem) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type RepoSearchResultItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(NullableLicenseSimpleable) + GetMasterBranch()(*string) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(NullableSimpleUserable) + GetPermissions()(RepoSearchResultItem_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetScore()(*float64) + GetSize()(*int32) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTextMatches()([]Repositoriesable) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value NullableLicenseSimpleable)() + SetMasterBranch(value *string)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value NullableSimpleUserable)() + SetPermissions(value RepoSearchResultItem_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetScore(value *float64)() + SetSize(value *int32)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTextMatches(value []Repositoriesable)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/pkg/github/models/repo_search_result_item_escaped_permissions.go b/pkg/github/models/repo_search_result_item_escaped_permissions.go new file mode 100644 index 00000000..100580e1 --- /dev/null +++ b/pkg/github/models/repo_search_result_item_escaped_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepoSearchResultItem_permissions 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 admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewRepoSearchResultItem_permissions instantiates a new RepoSearchResultItem_permissions and sets the default values. +func NewRepoSearchResultItem_permissions()(*RepoSearchResultItem_permissions) { + m := &RepoSearchResultItem_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepoSearchResultItem_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepoSearchResultItem_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepoSearchResultItem_permissions(), 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 *RepoSearchResultItem_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *RepoSearchResultItem_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepoSearchResultItem_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *RepoSearchResultItem_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *RepoSearchResultItem_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *RepoSearchResultItem_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *RepoSearchResultItem_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *RepoSearchResultItem_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *RepoSearchResultItem_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *RepoSearchResultItem_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *RepoSearchResultItem_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *RepoSearchResultItem_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *RepoSearchResultItem_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *RepoSearchResultItem_permissions) SetTriage(value *bool)() { + m.triage = value +} +type RepoSearchResultItem_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/pkg/github/models/repositories.go b/pkg/github/models/repositories.go new file mode 100644 index 00000000..74af2a42 --- /dev/null +++ b/pkg/github/models/repositories.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Repositories struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The fragment property + fragment *string + // The matches property + matches []Repositories_matchesable + // The object_type property + object_type *string + // The object_url property + object_url *string + // The property property + property *string +} +// NewRepositories instantiates a new Repositories and sets the default values. +func NewRepositories()(*Repositories) { + m := &Repositories{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoriesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoriesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositories(), 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 *Repositories) 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 *Repositories) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fragment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFragment(val) + } + return nil + } + res["matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositories_matchesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Repositories_matchesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Repositories_matchesable) + } + } + m.SetMatches(res) + } + return nil + } + res["object_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectType(val) + } + return nil + } + res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectUrl(val) + } + return nil + } + res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProperty(val) + } + return nil + } + return res +} +// GetFragment gets the fragment property value. The fragment property +// returns a *string when successful +func (m *Repositories) GetFragment()(*string) { + return m.fragment +} +// GetMatches gets the matches property value. The matches property +// returns a []Repositories_matchesable when successful +func (m *Repositories) GetMatches()([]Repositories_matchesable) { + return m.matches +} +// GetObjectType gets the object_type property value. The object_type property +// returns a *string when successful +func (m *Repositories) GetObjectType()(*string) { + return m.object_type +} +// GetObjectUrl gets the object_url property value. The object_url property +// returns a *string when successful +func (m *Repositories) GetObjectUrl()(*string) { + return m.object_url +} +// GetProperty gets the property property value. The property property +// returns a *string when successful +func (m *Repositories) GetProperty()(*string) { + return m.property +} +// Serialize serializes information the current object +func (m *Repositories) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("fragment", m.GetFragment()) + if err != nil { + return err + } + } + if m.GetMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMatches())) + for i, v := range m.GetMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_type", m.GetObjectType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_url", m.GetObjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("property", m.GetProperty()) + 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 *Repositories) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFragment sets the fragment property value. The fragment property +func (m *Repositories) SetFragment(value *string)() { + m.fragment = value +} +// SetMatches sets the matches property value. The matches property +func (m *Repositories) SetMatches(value []Repositories_matchesable)() { + m.matches = value +} +// SetObjectType sets the object_type property value. The object_type property +func (m *Repositories) SetObjectType(value *string)() { + m.object_type = value +} +// SetObjectUrl sets the object_url property value. The object_url property +func (m *Repositories) SetObjectUrl(value *string)() { + m.object_url = value +} +// SetProperty sets the property property value. The property property +func (m *Repositories) SetProperty(value *string)() { + m.property = value +} +type Repositoriesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFragment()(*string) + GetMatches()([]Repositories_matchesable) + GetObjectType()(*string) + GetObjectUrl()(*string) + GetProperty()(*string) + SetFragment(value *string)() + SetMatches(value []Repositories_matchesable)() + SetObjectType(value *string)() + SetObjectUrl(value *string)() + SetProperty(value *string)() +} diff --git a/pkg/github/models/repositories503_error.go b/pkg/github/models/repositories503_error.go new file mode 100644 index 00000000..20d33b20 --- /dev/null +++ b/pkg/github/models/repositories503_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 Repositories503Error 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 +} +// NewRepositories503Error instantiates a new Repositories503Error and sets the default values. +func NewRepositories503Error()(*Repositories503Error) { + m := &Repositories503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositories503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositories503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositories503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Repositories503Error) 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 *Repositories503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Repositories503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Repositories503Error) 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 *Repositories503Error) 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 *Repositories503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Repositories503Error) 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 *Repositories503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Repositories503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Repositories503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Repositories503Error) SetMessage(value *string)() { + m.message = value +} +type Repositories503Errorable 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/repositories_escaped_matches.go b/pkg/github/models/repositories_escaped_matches.go new file mode 100644 index 00000000..edcfdb17 --- /dev/null +++ b/pkg/github/models/repositories_escaped_matches.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Repositories_matches struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The indices property + indices []int32 + // The text property + text *string +} +// NewRepositories_matches instantiates a new Repositories_matches and sets the default values. +func NewRepositories_matches()(*Repositories_matches) { + m := &Repositories_matches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositories_matchesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositories_matchesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositories_matches(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Repositories_matches) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Repositories_matches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["indices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetIndices(res) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetIndices gets the indices property value. The indices property +// returns a []int32 when successful +func (m *Repositories_matches) GetIndices()([]int32) { + return m.indices +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *Repositories_matches) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *Repositories_matches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIndices() != nil { + err := writer.WriteCollectionOfInt32Values("indices", m.GetIndices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *Repositories_matches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIndices sets the indices property value. The indices property +func (m *Repositories_matches) SetIndices(value []int32)() { + m.indices = value +} +// SetText sets the text property value. The text property +func (m *Repositories_matches) SetText(value *string)() { + m.text = value +} +type Repositories_matchesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIndices()([]int32) + GetText()(*string) + SetIndices(value []int32)() + SetText(value *string)() +} diff --git a/pkg/github/models/repository.go b/pkg/github/models/repository.go new file mode 100644 index 00000000..2f854ab7 --- /dev/null +++ b/pkg/github/models/repository.go @@ -0,0 +1,2826 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Repository a repository on GitHub. +type Repository 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 allow Auto-merge to be used on pull requests. + allow_auto_merge *bool + // Whether to allow forking this repo + allow_forking *bool + // Whether to allow merge commits for pull requests. + allow_merge_commit *bool + // Whether to allow rebase merges for pull requests. + allow_rebase_merge *bool + // Whether to allow squash merges for pull requests. + allow_squash_merge *bool + // Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. + allow_update_branch *bool + // Whether anonymous git access is enabled for this repository + anonymous_access_enabled *bool + // The archive_url property + archive_url *string + // Whether the repository is archived. + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default branch of the repository. + default_branch *string + // Whether to delete head branches when pull requests are merged + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // Returns whether or not this repository disabled. + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // Whether discussions are enabled. + has_discussions *bool + // Whether downloads are enabled. + // Deprecated: + has_downloads *bool + // Whether issues are enabled. + has_issues *bool + // The has_pages property + has_pages *bool + // Whether projects are enabled. + has_projects *bool + // Whether the wiki is enabled. + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // Unique identifier of the repository + id *int64 + // Whether this repository acts as a template that can be used to generate new repositories. + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // License Simple + license NullableLicenseSimpleable + // The master_branch property + master_branch *string + // The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. + merge_commit_message *Repository_merge_commit_message + // The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). + merge_commit_title *Repository_merge_commit_title + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name of the repository. + name *string + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // A GitHub user. + owner SimpleUserable + // The permissions property + permissions Repository_permissionsable + // Whether the repository is private or public. + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. + size *int32 + // The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. + squash_merge_commit_message *Repository_squash_merge_commit_message + // The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). + squash_merge_commit_title *Repository_squash_merge_commit_title + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The starred_at property + starred_at *string + // The statuses_url property + statuses_url *string + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + // Deprecated: + use_squash_pr_title_as_default *bool + // The repository visibility: public, private, or internal. + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // Whether to require contributors to sign off on web-based commits + web_commit_signoff_required *bool +} +// NewRepository instantiates a new Repository and sets the default values. +func NewRepository()(*Repository) { + m := &Repository{ + } + m.SetAdditionalData(make(map[string]any)) + visibilityValue := "public" + m.SetVisibility(&visibilityValue) + return m +} +// CreateRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepository(), 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 *Repository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +// returns a *bool when successful +func (m *Repository) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowForking gets the allow_forking property value. Whether to allow forking this repo +// returns a *bool when successful +func (m *Repository) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +// returns a *bool when successful +func (m *Repository) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +// returns a *bool when successful +func (m *Repository) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +// returns a *bool when successful +func (m *Repository) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAllowUpdateBranch gets the allow_update_branch property value. Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. +// returns a *bool when successful +func (m *Repository) GetAllowUpdateBranch()(*bool) { + return m.allow_update_branch +} +// GetAnonymousAccessEnabled gets the anonymous_access_enabled property value. Whether anonymous git access is enabled for this repository +// returns a *bool when successful +func (m *Repository) GetAnonymousAccessEnabled()(*bool) { + return m.anonymous_access_enabled +} +// GetArchived gets the archived property value. Whether the repository is archived. +// returns a *bool when successful +func (m *Repository) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *Repository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *Repository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *Repository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *Repository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *Repository) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *Repository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *Repository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *Repository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *Repository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *Repository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *Repository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Repository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default branch of the repository. +// returns a *string when successful +func (m *Repository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +// returns a *bool when successful +func (m *Repository) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *Repository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *Repository) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. Returns whether or not this repository disabled. +// returns a *bool when successful +func (m *Repository) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *Repository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *Repository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Repository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["allow_update_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowUpdateBranch(val) + } + return nil + } + res["anonymous_access_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAnonymousAccessEnabled(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + 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["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + 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["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + return nil + } + res["master_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMasterBranch(val) + } + return nil + } + res["merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepository_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitMessage(val.(*Repository_merge_commit_message)) + } + return nil + } + res["merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepository_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetMergeCommitTitle(val.(*Repository_merge_commit_title)) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepository_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(Repository_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["squash_merge_commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepository_squash_merge_commit_message) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitMessage(val.(*Repository_squash_merge_commit_message)) + } + return nil + } + res["squash_merge_commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepository_squash_merge_commit_title) + if err != nil { + return err + } + if val != nil { + m.SetSquashMergeCommitTitle(val.(*Repository_squash_merge_commit_title)) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["starred_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredAt(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = 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.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *Repository) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *Repository) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *Repository) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *Repository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *Repository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *Repository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *Repository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *Repository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *Repository) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDiscussions gets the has_discussions property value. Whether discussions are enabled. +// returns a *bool when successful +func (m *Repository) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. Whether downloads are enabled. +// Deprecated: +// returns a *bool when successful +func (m *Repository) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. Whether issues are enabled. +// returns a *bool when successful +func (m *Repository) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *Repository) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. Whether projects are enabled. +// returns a *bool when successful +func (m *Repository) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. Whether the wiki is enabled. +// returns a *bool when successful +func (m *Repository) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *Repository) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *Repository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Repository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the repository +// returns a *int64 when successful +func (m *Repository) GetId()(*int64) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *Repository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *Repository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *Repository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +// returns a *bool when successful +func (m *Repository) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *Repository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *Repository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *Repository) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *Repository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *Repository) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetMasterBranch gets the master_branch property value. The master_branch property +// returns a *string when successful +func (m *Repository) GetMasterBranch()(*string) { + return m.master_branch +} +// GetMergeCommitMessage gets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +// returns a *Repository_merge_commit_message when successful +func (m *Repository) GetMergeCommitMessage()(*Repository_merge_commit_message) { + return m.merge_commit_message +} +// GetMergeCommitTitle gets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +// returns a *Repository_merge_commit_title when successful +func (m *Repository) GetMergeCommitTitle()(*Repository_merge_commit_title) { + return m.merge_commit_title +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *Repository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *Repository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *Repository) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *Repository) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Repository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *Repository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *Repository) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *Repository) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *Repository) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a Repository_permissionsable when successful +func (m *Repository) GetPermissions()(Repository_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. Whether the repository is private or public. +// returns a *bool when successful +func (m *Repository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *Repository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *Repository) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *Repository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetSize gets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +// returns a *int32 when successful +func (m *Repository) GetSize()(*int32) { + return m.size +} +// GetSquashMergeCommitMessage gets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +// returns a *Repository_squash_merge_commit_message when successful +func (m *Repository) GetSquashMergeCommitMessage()(*Repository_squash_merge_commit_message) { + return m.squash_merge_commit_message +} +// GetSquashMergeCommitTitle gets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +// returns a *Repository_squash_merge_commit_title when successful +func (m *Repository) GetSquashMergeCommitTitle()(*Repository_squash_merge_commit_title) { + return m.squash_merge_commit_title +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *Repository) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *Repository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *Repository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStarredAt gets the starred_at property value. The starred_at property +// returns a *string when successful +func (m *Repository) GetStarredAt()(*string) { + return m.starred_at +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *Repository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *Repository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *Repository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *Repository) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *Repository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *Repository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *Repository) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *Repository) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *Repository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Repository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Repository) GetUrl()(*string) { + return m.url +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +// returns a *bool when successful +func (m *Repository) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// GetVisibility gets the visibility property value. The repository visibility: public, private, or internal. +// returns a *string when successful +func (m *Repository) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *Repository) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *Repository) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. Whether to require contributors to sign off on web-based commits +// returns a *bool when successful +func (m *Repository) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *Repository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_update_branch", m.GetAllowUpdateBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("anonymous_access_enabled", m.GetAnonymousAccessEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("master_branch", m.GetMasterBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + if m.GetMergeCommitMessage() != nil { + cast := (*m.GetMergeCommitMessage()).String() + err := writer.WriteStringValue("merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetMergeCommitTitle() != nil { + cast := (*m.GetMergeCommitTitle()).String() + err := writer.WriteStringValue("merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitMessage() != nil { + cast := (*m.GetSquashMergeCommitMessage()).String() + err := writer.WriteStringValue("squash_merge_commit_message", &cast) + if err != nil { + return err + } + } + if m.GetSquashMergeCommitTitle() != nil { + cast := (*m.GetSquashMergeCommitTitle()).String() + err := writer.WriteStringValue("squash_merge_commit_title", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_at", m.GetStarredAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *Repository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +func (m *Repository) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowForking sets the allow_forking property value. Whether to allow forking this repo +func (m *Repository) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +func (m *Repository) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +func (m *Repository) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +func (m *Repository) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAllowUpdateBranch sets the allow_update_branch property value. Whether or not a pull request head branch that is behind its base branch can always be updated even if it is not required to be up to date before merging. +func (m *Repository) SetAllowUpdateBranch(value *bool)() { + m.allow_update_branch = value +} +// SetAnonymousAccessEnabled sets the anonymous_access_enabled property value. Whether anonymous git access is enabled for this repository +func (m *Repository) SetAnonymousAccessEnabled(value *bool)() { + m.anonymous_access_enabled = value +} +// SetArchived sets the archived property value. Whether the repository is archived. +func (m *Repository) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *Repository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *Repository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *Repository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *Repository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *Repository) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *Repository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *Repository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *Repository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *Repository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *Repository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *Repository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Repository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default branch of the repository. +func (m *Repository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +func (m *Repository) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *Repository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *Repository) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. Returns whether or not this repository disabled. +func (m *Repository) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *Repository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *Repository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *Repository) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *Repository) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *Repository) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *Repository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *Repository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *Repository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *Repository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *Repository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *Repository) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDiscussions sets the has_discussions property value. Whether discussions are enabled. +func (m *Repository) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. Whether downloads are enabled. +// Deprecated: +func (m *Repository) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. Whether issues are enabled. +func (m *Repository) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *Repository) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. Whether projects are enabled. +func (m *Repository) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. Whether the wiki is enabled. +func (m *Repository) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *Repository) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *Repository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Repository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the repository +func (m *Repository) SetId(value *int64)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *Repository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *Repository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *Repository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +func (m *Repository) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *Repository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *Repository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *Repository) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *Repository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. License Simple +func (m *Repository) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetMasterBranch sets the master_branch property value. The master_branch property +func (m *Repository) SetMasterBranch(value *string)() { + m.master_branch = value +} +// SetMergeCommitMessage sets the merge_commit_message property value. The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +func (m *Repository) SetMergeCommitMessage(value *Repository_merge_commit_message)() { + m.merge_commit_message = value +} +// SetMergeCommitTitle sets the merge_commit_title property value. The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +func (m *Repository) SetMergeCommitTitle(value *Repository_merge_commit_title)() { + m.merge_commit_title = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *Repository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *Repository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *Repository) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name of the repository. +func (m *Repository) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Repository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *Repository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *Repository) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *Repository) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *Repository) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *Repository) SetPermissions(value Repository_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. Whether the repository is private or public. +func (m *Repository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *Repository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *Repository) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *Repository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetSize sets the size property value. The size of the repository, in kilobytes. Size is calculated hourly. When a repository is initially created, the size is 0. +func (m *Repository) SetSize(value *int32)() { + m.size = value +} +// SetSquashMergeCommitMessage sets the squash_merge_commit_message property value. The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +func (m *Repository) SetSquashMergeCommitMessage(value *Repository_squash_merge_commit_message)() { + m.squash_merge_commit_message = value +} +// SetSquashMergeCommitTitle sets the squash_merge_commit_title property value. The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +func (m *Repository) SetSquashMergeCommitTitle(value *Repository_squash_merge_commit_title)() { + m.squash_merge_commit_title = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *Repository) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *Repository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *Repository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStarredAt sets the starred_at property value. The starred_at property +func (m *Repository) SetStarredAt(value *string)() { + m.starred_at = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *Repository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *Repository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *Repository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *Repository) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *Repository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *Repository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *Repository) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *Repository) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *Repository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Repository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Repository) SetUrl(value *string)() { + m.url = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. Whether a squash merge commit can use the pull request title as default. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +func (m *Repository) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +// SetVisibility sets the visibility property value. The repository visibility: public, private, or internal. +func (m *Repository) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *Repository) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *Repository) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. Whether to require contributors to sign off on web-based commits +func (m *Repository) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type Repositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAllowUpdateBranch()(*bool) + GetAnonymousAccessEnabled()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(NullableLicenseSimpleable) + GetMasterBranch()(*string) + GetMergeCommitMessage()(*Repository_merge_commit_message) + GetMergeCommitTitle()(*Repository_merge_commit_title) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(SimpleUserable) + GetPermissions()(Repository_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetSize()(*int32) + GetSquashMergeCommitMessage()(*Repository_squash_merge_commit_message) + GetSquashMergeCommitTitle()(*Repository_squash_merge_commit_title) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStarredAt()(*string) + GetStatusesUrl()(*string) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUseSquashPrTitleAsDefault()(*bool) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAllowUpdateBranch(value *bool)() + SetAnonymousAccessEnabled(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value NullableLicenseSimpleable)() + SetMasterBranch(value *string)() + SetMergeCommitMessage(value *Repository_merge_commit_message)() + SetMergeCommitTitle(value *Repository_merge_commit_title)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value SimpleUserable)() + SetPermissions(value Repository_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetSize(value *int32)() + SetSquashMergeCommitMessage(value *Repository_squash_merge_commit_message)() + SetSquashMergeCommitTitle(value *Repository_squash_merge_commit_title)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStarredAt(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUseSquashPrTitleAsDefault(value *bool)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/pkg/github/models/repository_collaborator_permission.go b/pkg/github/models/repository_collaborator_permission.go new file mode 100644 index 00000000..59df3081 --- /dev/null +++ b/pkg/github/models/repository_collaborator_permission.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryCollaboratorPermission repository Collaborator Permission +type RepositoryCollaboratorPermission 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 permission property + permission *string + // The role_name property + role_name *string + // Collaborator + user NullableCollaboratorable +} +// NewRepositoryCollaboratorPermission instantiates a new RepositoryCollaboratorPermission and sets the default values. +func NewRepositoryCollaboratorPermission()(*RepositoryCollaboratorPermission) { + m := &RepositoryCollaboratorPermission{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryCollaboratorPermissionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryCollaboratorPermissionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryCollaboratorPermission(), 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 *RepositoryCollaboratorPermission) 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 *RepositoryCollaboratorPermission) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["role_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRoleName(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableCollaboratorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableCollaboratorable)) + } + return nil + } + return res +} +// GetPermission gets the permission property value. The permission property +// returns a *string when successful +func (m *RepositoryCollaboratorPermission) GetPermission()(*string) { + return m.permission +} +// GetRoleName gets the role_name property value. The role_name property +// returns a *string when successful +func (m *RepositoryCollaboratorPermission) GetRoleName()(*string) { + return m.role_name +} +// GetUser gets the user property value. Collaborator +// returns a NullableCollaboratorable when successful +func (m *RepositoryCollaboratorPermission) GetUser()(NullableCollaboratorable) { + return m.user +} +// Serialize serializes information the current object +func (m *RepositoryCollaboratorPermission) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("role_name", m.GetRoleName()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + 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 *RepositoryCollaboratorPermission) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPermission sets the permission property value. The permission property +func (m *RepositoryCollaboratorPermission) SetPermission(value *string)() { + m.permission = value +} +// SetRoleName sets the role_name property value. The role_name property +func (m *RepositoryCollaboratorPermission) SetRoleName(value *string)() { + m.role_name = value +} +// SetUser sets the user property value. Collaborator +func (m *RepositoryCollaboratorPermission) SetUser(value NullableCollaboratorable)() { + m.user = value +} +type RepositoryCollaboratorPermissionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPermission()(*string) + GetRoleName()(*string) + GetUser()(NullableCollaboratorable) + SetPermission(value *string)() + SetRoleName(value *string)() + SetUser(value NullableCollaboratorable)() +} diff --git a/pkg/github/models/repository_escaped_merge_escaped_commit_escaped_message.go b/pkg/github/models/repository_escaped_merge_escaped_commit_escaped_message.go new file mode 100644 index 00000000..39c8840a --- /dev/null +++ b/pkg/github/models/repository_escaped_merge_escaped_commit_escaped_message.go @@ -0,0 +1,37 @@ +package models +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type Repository_merge_commit_message int + +const ( + PR_BODY_REPOSITORY_MERGE_COMMIT_MESSAGE Repository_merge_commit_message = iota + PR_TITLE_REPOSITORY_MERGE_COMMIT_MESSAGE + BLANK_REPOSITORY_MERGE_COMMIT_MESSAGE +) + +func (i Repository_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParseRepository_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOSITORY_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOSITORY_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_REPOSITORY_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOSITORY_MERGE_COMMIT_MESSAGE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepository_merge_commit_message(values []Repository_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Repository_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_escaped_merge_escaped_commit_escaped_title.go b/pkg/github/models/repository_escaped_merge_escaped_commit_escaped_title.go new file mode 100644 index 00000000..7e7aa618 --- /dev/null +++ b/pkg/github/models/repository_escaped_merge_escaped_commit_escaped_title.go @@ -0,0 +1,34 @@ +package models +// The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +type Repository_merge_commit_title int + +const ( + PR_TITLE_REPOSITORY_MERGE_COMMIT_TITLE Repository_merge_commit_title = iota + MERGE_MESSAGE_REPOSITORY_MERGE_COMMIT_TITLE +) + +func (i Repository_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParseRepository_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOSITORY_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOSITORY_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_REPOSITORY_MERGE_COMMIT_TITLE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepository_merge_commit_title(values []Repository_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Repository_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_escaped_permissions.go b/pkg/github/models/repository_escaped_permissions.go new file mode 100644 index 00000000..453eab61 --- /dev/null +++ b/pkg/github/models/repository_escaped_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Repository_permissions 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 admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewRepository_permissions instantiates a new Repository_permissions and sets the default values. +func NewRepository_permissions()(*Repository_permissions) { + m := &Repository_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepository_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepository_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepository_permissions(), 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 *Repository_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *Repository_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Repository_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *Repository_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *Repository_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *Repository_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *Repository_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *Repository_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *Repository_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *Repository_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *Repository_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *Repository_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *Repository_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *Repository_permissions) SetTriage(value *bool)() { + m.triage = value +} +type Repository_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/pkg/github/models/repository_escaped_squash_escaped_merge_escaped_commit_escaped_message.go b/pkg/github/models/repository_escaped_squash_escaped_merge_escaped_commit_escaped_message.go new file mode 100644 index 00000000..7d7099ce --- /dev/null +++ b/pkg/github/models/repository_escaped_squash_escaped_merge_escaped_commit_escaped_message.go @@ -0,0 +1,37 @@ +package models +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type Repository_squash_merge_commit_message int + +const ( + PR_BODY_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE Repository_squash_merge_commit_message = iota + COMMIT_MESSAGES_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i Repository_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParseRepository_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOSITORY_SQUASH_MERGE_COMMIT_MESSAGE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepository_squash_merge_commit_message(values []Repository_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Repository_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_escaped_squash_escaped_merge_escaped_commit_escaped_title.go b/pkg/github/models/repository_escaped_squash_escaped_merge_escaped_commit_escaped_title.go new file mode 100644 index 00000000..f012f267 --- /dev/null +++ b/pkg/github/models/repository_escaped_squash_escaped_merge_escaped_commit_escaped_title.go @@ -0,0 +1,34 @@ +package models +// The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type Repository_squash_merge_commit_title int + +const ( + PR_TITLE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE Repository_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE +) + +func (i Repository_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParseRepository_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_REPOSITORY_SQUASH_MERGE_COMMIT_TITLE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepository_squash_merge_commit_title(values []Repository_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Repository_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_fine_grained_permission.go b/pkg/github/models/repository_fine_grained_permission.go new file mode 100644 index 00000000..e4201176 --- /dev/null +++ b/pkg/github/models/repository_fine_grained_permission.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryFineGrainedPermission a fine-grained permission that protects repository resources. +type RepositoryFineGrainedPermission 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 property + description *string + // The name property + name *string +} +// NewRepositoryFineGrainedPermission instantiates a new RepositoryFineGrainedPermission and sets the default values. +func NewRepositoryFineGrainedPermission()(*RepositoryFineGrainedPermission) { + m := &RepositoryFineGrainedPermission{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryFineGrainedPermissionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryFineGrainedPermissionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryFineGrainedPermission(), 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 *RepositoryFineGrainedPermission) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *RepositoryFineGrainedPermission) 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 *RepositoryFineGrainedPermission) 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["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 property +// returns a *string when successful +func (m *RepositoryFineGrainedPermission) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *RepositoryFineGrainedPermission) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *RepositoryFineGrainedPermission) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description property +func (m *RepositoryFineGrainedPermission) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name property +func (m *RepositoryFineGrainedPermission) SetName(value *string)() { + m.name = value +} +type RepositoryFineGrainedPermissionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetName()(*string) + SetDescription(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/repository_invitation.go b/pkg/github/models/repository_invitation.go new file mode 100644 index 00000000..e286ea8c --- /dev/null +++ b/pkg/github/models/repository_invitation.go @@ -0,0 +1,344 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryInvitation repository invitations let you manage who you collaborate with. +type RepositoryInvitation 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 + // Whether or not the invitation has expired + expired *bool + // The html_url property + html_url *string + // Unique identifier of the repository invitation. + id *int64 + // A GitHub user. + invitee NullableSimpleUserable + // A GitHub user. + inviter NullableSimpleUserable + // The node_id property + node_id *string + // The permission associated with the invitation. + permissions *RepositoryInvitation_permissions + // Minimal Repository + repository MinimalRepositoryable + // URL for the repository invitation + url *string +} +// NewRepositoryInvitation instantiates a new RepositoryInvitation and sets the default values. +func NewRepositoryInvitation()(*RepositoryInvitation) { + m := &RepositoryInvitation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryInvitationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryInvitationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryInvitation(), 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 *RepositoryInvitation) 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 *RepositoryInvitation) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetExpired gets the expired property value. Whether or not the invitation has expired +// returns a *bool when successful +func (m *RepositoryInvitation) GetExpired()(*bool) { + return m.expired +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryInvitation) 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["expired"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExpired(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["invitee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInvitee(val.(NullableSimpleUserable)) + } + return nil + } + res["inviter"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInviter(val.(NullableSimpleUserable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryInvitation_permissions) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(*RepositoryInvitation_permissions)) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *RepositoryInvitation) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the repository invitation. +// returns a *int64 when successful +func (m *RepositoryInvitation) GetId()(*int64) { + return m.id +} +// GetInvitee gets the invitee property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *RepositoryInvitation) GetInvitee()(NullableSimpleUserable) { + return m.invitee +} +// GetInviter gets the inviter property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *RepositoryInvitation) GetInviter()(NullableSimpleUserable) { + return m.inviter +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *RepositoryInvitation) GetNodeId()(*string) { + return m.node_id +} +// GetPermissions gets the permissions property value. The permission associated with the invitation. +// returns a *RepositoryInvitation_permissions when successful +func (m *RepositoryInvitation) GetPermissions()(*RepositoryInvitation_permissions) { + return m.permissions +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *RepositoryInvitation) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetUrl gets the url property value. URL for the repository invitation +// returns a *string when successful +func (m *RepositoryInvitation) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *RepositoryInvitation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("expired", m.GetExpired()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("invitee", m.GetInvitee()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("inviter", m.GetInviter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetPermissions() != nil { + cast := (*m.GetPermissions()).String() + err := writer.WriteStringValue("permissions", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *RepositoryInvitation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *RepositoryInvitation) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetExpired sets the expired property value. Whether or not the invitation has expired +func (m *RepositoryInvitation) SetExpired(value *bool)() { + m.expired = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *RepositoryInvitation) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the repository invitation. +func (m *RepositoryInvitation) SetId(value *int64)() { + m.id = value +} +// SetInvitee sets the invitee property value. A GitHub user. +func (m *RepositoryInvitation) SetInvitee(value NullableSimpleUserable)() { + m.invitee = value +} +// SetInviter sets the inviter property value. A GitHub user. +func (m *RepositoryInvitation) SetInviter(value NullableSimpleUserable)() { + m.inviter = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *RepositoryInvitation) SetNodeId(value *string)() { + m.node_id = value +} +// SetPermissions sets the permissions property value. The permission associated with the invitation. +func (m *RepositoryInvitation) SetPermissions(value *RepositoryInvitation_permissions)() { + m.permissions = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *RepositoryInvitation) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetUrl sets the url property value. URL for the repository invitation +func (m *RepositoryInvitation) SetUrl(value *string)() { + m.url = value +} +type RepositoryInvitationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetExpired()(*bool) + GetHtmlUrl()(*string) + GetId()(*int64) + GetInvitee()(NullableSimpleUserable) + GetInviter()(NullableSimpleUserable) + GetNodeId()(*string) + GetPermissions()(*RepositoryInvitation_permissions) + GetRepository()(MinimalRepositoryable) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetExpired(value *bool)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetInvitee(value NullableSimpleUserable)() + SetInviter(value NullableSimpleUserable)() + SetNodeId(value *string)() + SetPermissions(value *RepositoryInvitation_permissions)() + SetRepository(value MinimalRepositoryable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/repository_invitation_escaped_permissions.go b/pkg/github/models/repository_invitation_escaped_permissions.go new file mode 100644 index 00000000..e407003d --- /dev/null +++ b/pkg/github/models/repository_invitation_escaped_permissions.go @@ -0,0 +1,43 @@ +package models +// The permission associated with the invitation. +type RepositoryInvitation_permissions int + +const ( + READ_REPOSITORYINVITATION_PERMISSIONS RepositoryInvitation_permissions = iota + WRITE_REPOSITORYINVITATION_PERMISSIONS + ADMIN_REPOSITORYINVITATION_PERMISSIONS + TRIAGE_REPOSITORYINVITATION_PERMISSIONS + MAINTAIN_REPOSITORYINVITATION_PERMISSIONS +) + +func (i RepositoryInvitation_permissions) String() string { + return []string{"read", "write", "admin", "triage", "maintain"}[i] +} +func ParseRepositoryInvitation_permissions(v string) (any, error) { + result := READ_REPOSITORYINVITATION_PERMISSIONS + switch v { + case "read": + result = READ_REPOSITORYINVITATION_PERMISSIONS + case "write": + result = WRITE_REPOSITORYINVITATION_PERMISSIONS + case "admin": + result = ADMIN_REPOSITORYINVITATION_PERMISSIONS + case "triage": + result = TRIAGE_REPOSITORYINVITATION_PERMISSIONS + case "maintain": + result = MAINTAIN_REPOSITORYINVITATION_PERMISSIONS + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryInvitation_permissions(values []RepositoryInvitation_permissions) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryInvitation_permissions) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_pre_receive_hook.go b/pkg/github/models/repository_pre_receive_hook.go new file mode 100644 index 00000000..58725a30 --- /dev/null +++ b/pkg/github/models/repository_pre_receive_hook.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryPreReceiveHook 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 configuration_url property + configuration_url *string + // The enforcement property + enforcement *string + // The id property + id *int32 + // The name property + name *string +} +// NewRepositoryPreReceiveHook instantiates a new RepositoryPreReceiveHook and sets the default values. +func NewRepositoryPreReceiveHook()(*RepositoryPreReceiveHook) { + m := &RepositoryPreReceiveHook{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryPreReceiveHookFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryPreReceiveHookFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryPreReceiveHook(), 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 *RepositoryPreReceiveHook) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfigurationUrl gets the configuration_url property value. The configuration_url property +// returns a *string when successful +func (m *RepositoryPreReceiveHook) GetConfigurationUrl()(*string) { + return m.configuration_url +} +// GetEnforcement gets the enforcement property value. The enforcement property +// returns a *string when successful +func (m *RepositoryPreReceiveHook) GetEnforcement()(*string) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryPreReceiveHook) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["configuration_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetConfigurationUrl(val) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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 +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *RepositoryPreReceiveHook) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *RepositoryPreReceiveHook) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *RepositoryPreReceiveHook) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("configuration_url", m.GetConfigurationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("enforcement", m.GetEnforcement()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *RepositoryPreReceiveHook) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfigurationUrl sets the configuration_url property value. The configuration_url property +func (m *RepositoryPreReceiveHook) SetConfigurationUrl(value *string)() { + m.configuration_url = value +} +// SetEnforcement sets the enforcement property value. The enforcement property +func (m *RepositoryPreReceiveHook) SetEnforcement(value *string)() { + m.enforcement = value +} +// SetId sets the id property value. The id property +func (m *RepositoryPreReceiveHook) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *RepositoryPreReceiveHook) SetName(value *string)() { + m.name = value +} +type RepositoryPreReceiveHookable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConfigurationUrl()(*string) + GetEnforcement()(*string) + GetId()(*int32) + GetName()(*string) + SetConfigurationUrl(value *string)() + SetEnforcement(value *string)() + SetId(value *int32)() + SetName(value *string)() +} diff --git a/pkg/github/models/repository_rule.go b/pkg/github/models/repository_rule.go new file mode 100644 index 00000000..e67ece80 --- /dev/null +++ b/pkg/github/models/repository_rule.go @@ -0,0 +1,1493 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRule composed type wrapper for classes RepositoryRuleBranchNamePatternable, RepositoryRuleCodeScanningable, RepositoryRuleCommitAuthorEmailPatternable, RepositoryRuleCommitMessagePatternable, RepositoryRuleCommitterEmailPatternable, RepositoryRuleCreationable, RepositoryRuleDeletionable, RepositoryRuleNonFastForwardable, RepositoryRulePullRequestable, RepositoryRuleRequiredDeploymentsable, RepositoryRuleRequiredLinearHistoryable, RepositoryRuleRequiredSignaturesable, RepositoryRuleRequiredStatusChecksable, RepositoryRuleTagNamePatternable, RepositoryRuleUpdateable, RepositoryRuleWorkflowsable +type RepositoryRule struct { + // Composed type representation for type RepositoryRuleBranchNamePatternable + repositoryRuleBranchNamePattern RepositoryRuleBranchNamePatternable + // Composed type representation for type RepositoryRuleCodeScanningable + repositoryRuleCodeScanning RepositoryRuleCodeScanningable + // Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable + repositoryRuleCommitAuthorEmailPattern RepositoryRuleCommitAuthorEmailPatternable + // Composed type representation for type RepositoryRuleCommitMessagePatternable + repositoryRuleCommitMessagePattern RepositoryRuleCommitMessagePatternable + // Composed type representation for type RepositoryRuleCommitterEmailPatternable + repositoryRuleCommitterEmailPattern RepositoryRuleCommitterEmailPatternable + // Composed type representation for type RepositoryRuleCreationable + repositoryRuleCreation RepositoryRuleCreationable + // Composed type representation for type RepositoryRuleDeletionable + repositoryRuleDeletion RepositoryRuleDeletionable + // Composed type representation for type RepositoryRuleNonFastForwardable + repositoryRuleNonFastForward RepositoryRuleNonFastForwardable + // Composed type representation for type RepositoryRulePullRequestable + repositoryRulePullRequest RepositoryRulePullRequestable + // Composed type representation for type RepositoryRuleBranchNamePatternable + repositoryRuleRepositoryRuleBranchNamePattern RepositoryRuleBranchNamePatternable + // Composed type representation for type RepositoryRuleBranchNamePatternable + repositoryRuleRepositoryRuleBranchNamePattern0 RepositoryRuleBranchNamePatternable + // Composed type representation for type RepositoryRuleBranchNamePatternable + repositoryRuleRepositoryRuleBranchNamePattern1 RepositoryRuleBranchNamePatternable + // Composed type representation for type RepositoryRuleBranchNamePatternable + repositoryRuleRepositoryRuleBranchNamePattern2 RepositoryRuleBranchNamePatternable + // Composed type representation for type RepositoryRuleCodeScanningable + repositoryRuleRepositoryRuleCodeScanning RepositoryRuleCodeScanningable + // Composed type representation for type RepositoryRuleCodeScanningable + repositoryRuleRepositoryRuleCodeScanning0 RepositoryRuleCodeScanningable + // Composed type representation for type RepositoryRuleCodeScanningable + repositoryRuleRepositoryRuleCodeScanning1 RepositoryRuleCodeScanningable + // Composed type representation for type RepositoryRuleCodeScanningable + repositoryRuleRepositoryRuleCodeScanning2 RepositoryRuleCodeScanningable + // Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable + repositoryRuleRepositoryRuleCommitAuthorEmailPattern RepositoryRuleCommitAuthorEmailPatternable + // Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable + repositoryRuleRepositoryRuleCommitAuthorEmailPattern0 RepositoryRuleCommitAuthorEmailPatternable + // Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable + repositoryRuleRepositoryRuleCommitAuthorEmailPattern1 RepositoryRuleCommitAuthorEmailPatternable + // Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable + repositoryRuleRepositoryRuleCommitAuthorEmailPattern2 RepositoryRuleCommitAuthorEmailPatternable + // Composed type representation for type RepositoryRuleCommitMessagePatternable + repositoryRuleRepositoryRuleCommitMessagePattern RepositoryRuleCommitMessagePatternable + // Composed type representation for type RepositoryRuleCommitMessagePatternable + repositoryRuleRepositoryRuleCommitMessagePattern0 RepositoryRuleCommitMessagePatternable + // Composed type representation for type RepositoryRuleCommitMessagePatternable + repositoryRuleRepositoryRuleCommitMessagePattern1 RepositoryRuleCommitMessagePatternable + // Composed type representation for type RepositoryRuleCommitMessagePatternable + repositoryRuleRepositoryRuleCommitMessagePattern2 RepositoryRuleCommitMessagePatternable + // Composed type representation for type RepositoryRuleCommitterEmailPatternable + repositoryRuleRepositoryRuleCommitterEmailPattern RepositoryRuleCommitterEmailPatternable + // Composed type representation for type RepositoryRuleCommitterEmailPatternable + repositoryRuleRepositoryRuleCommitterEmailPattern0 RepositoryRuleCommitterEmailPatternable + // Composed type representation for type RepositoryRuleCommitterEmailPatternable + repositoryRuleRepositoryRuleCommitterEmailPattern1 RepositoryRuleCommitterEmailPatternable + // Composed type representation for type RepositoryRuleCommitterEmailPatternable + repositoryRuleRepositoryRuleCommitterEmailPattern2 RepositoryRuleCommitterEmailPatternable + // Composed type representation for type RepositoryRuleCreationable + repositoryRuleRepositoryRuleCreation RepositoryRuleCreationable + // Composed type representation for type RepositoryRuleCreationable + repositoryRuleRepositoryRuleCreation0 RepositoryRuleCreationable + // Composed type representation for type RepositoryRuleCreationable + repositoryRuleRepositoryRuleCreation1 RepositoryRuleCreationable + // Composed type representation for type RepositoryRuleCreationable + repositoryRuleRepositoryRuleCreation2 RepositoryRuleCreationable + // Composed type representation for type RepositoryRuleDeletionable + repositoryRuleRepositoryRuleDeletion RepositoryRuleDeletionable + // Composed type representation for type RepositoryRuleDeletionable + repositoryRuleRepositoryRuleDeletion0 RepositoryRuleDeletionable + // Composed type representation for type RepositoryRuleDeletionable + repositoryRuleRepositoryRuleDeletion1 RepositoryRuleDeletionable + // Composed type representation for type RepositoryRuleDeletionable + repositoryRuleRepositoryRuleDeletion2 RepositoryRuleDeletionable + // Composed type representation for type RepositoryRuleNonFastForwardable + repositoryRuleRepositoryRuleNonFastForward RepositoryRuleNonFastForwardable + // Composed type representation for type RepositoryRuleNonFastForwardable + repositoryRuleRepositoryRuleNonFastForward0 RepositoryRuleNonFastForwardable + // Composed type representation for type RepositoryRuleNonFastForwardable + repositoryRuleRepositoryRuleNonFastForward1 RepositoryRuleNonFastForwardable + // Composed type representation for type RepositoryRuleNonFastForwardable + repositoryRuleRepositoryRuleNonFastForward2 RepositoryRuleNonFastForwardable + // Composed type representation for type RepositoryRulePullRequestable + repositoryRuleRepositoryRulePullRequest RepositoryRulePullRequestable + // Composed type representation for type RepositoryRulePullRequestable + repositoryRuleRepositoryRulePullRequest0 RepositoryRulePullRequestable + // Composed type representation for type RepositoryRulePullRequestable + repositoryRuleRepositoryRulePullRequest1 RepositoryRulePullRequestable + // Composed type representation for type RepositoryRulePullRequestable + repositoryRuleRepositoryRulePullRequest2 RepositoryRulePullRequestable + // Composed type representation for type RepositoryRuleRequiredDeploymentsable + repositoryRuleRepositoryRuleRequiredDeployments RepositoryRuleRequiredDeploymentsable + // Composed type representation for type RepositoryRuleRequiredDeploymentsable + repositoryRuleRepositoryRuleRequiredDeployments0 RepositoryRuleRequiredDeploymentsable + // Composed type representation for type RepositoryRuleRequiredDeploymentsable + repositoryRuleRepositoryRuleRequiredDeployments1 RepositoryRuleRequiredDeploymentsable + // Composed type representation for type RepositoryRuleRequiredDeploymentsable + repositoryRuleRepositoryRuleRequiredDeployments2 RepositoryRuleRequiredDeploymentsable + // Composed type representation for type RepositoryRuleRequiredLinearHistoryable + repositoryRuleRepositoryRuleRequiredLinearHistory RepositoryRuleRequiredLinearHistoryable + // Composed type representation for type RepositoryRuleRequiredLinearHistoryable + repositoryRuleRepositoryRuleRequiredLinearHistory0 RepositoryRuleRequiredLinearHistoryable + // Composed type representation for type RepositoryRuleRequiredLinearHistoryable + repositoryRuleRepositoryRuleRequiredLinearHistory1 RepositoryRuleRequiredLinearHistoryable + // Composed type representation for type RepositoryRuleRequiredLinearHistoryable + repositoryRuleRepositoryRuleRequiredLinearHistory2 RepositoryRuleRequiredLinearHistoryable + // Composed type representation for type RepositoryRuleRequiredSignaturesable + repositoryRuleRepositoryRuleRequiredSignatures RepositoryRuleRequiredSignaturesable + // Composed type representation for type RepositoryRuleRequiredSignaturesable + repositoryRuleRepositoryRuleRequiredSignatures0 RepositoryRuleRequiredSignaturesable + // Composed type representation for type RepositoryRuleRequiredSignaturesable + repositoryRuleRepositoryRuleRequiredSignatures1 RepositoryRuleRequiredSignaturesable + // Composed type representation for type RepositoryRuleRequiredSignaturesable + repositoryRuleRepositoryRuleRequiredSignatures2 RepositoryRuleRequiredSignaturesable + // Composed type representation for type RepositoryRuleRequiredStatusChecksable + repositoryRuleRepositoryRuleRequiredStatusChecks RepositoryRuleRequiredStatusChecksable + // Composed type representation for type RepositoryRuleRequiredStatusChecksable + repositoryRuleRepositoryRuleRequiredStatusChecks0 RepositoryRuleRequiredStatusChecksable + // Composed type representation for type RepositoryRuleRequiredStatusChecksable + repositoryRuleRepositoryRuleRequiredStatusChecks1 RepositoryRuleRequiredStatusChecksable + // Composed type representation for type RepositoryRuleRequiredStatusChecksable + repositoryRuleRepositoryRuleRequiredStatusChecks2 RepositoryRuleRequiredStatusChecksable + // Composed type representation for type RepositoryRuleTagNamePatternable + repositoryRuleRepositoryRuleTagNamePattern RepositoryRuleTagNamePatternable + // Composed type representation for type RepositoryRuleTagNamePatternable + repositoryRuleRepositoryRuleTagNamePattern0 RepositoryRuleTagNamePatternable + // Composed type representation for type RepositoryRuleTagNamePatternable + repositoryRuleRepositoryRuleTagNamePattern1 RepositoryRuleTagNamePatternable + // Composed type representation for type RepositoryRuleTagNamePatternable + repositoryRuleRepositoryRuleTagNamePattern2 RepositoryRuleTagNamePatternable + // Composed type representation for type RepositoryRuleUpdateable + repositoryRuleRepositoryRuleUpdate RepositoryRuleUpdateable + // Composed type representation for type RepositoryRuleUpdateable + repositoryRuleRepositoryRuleUpdate0 RepositoryRuleUpdateable + // Composed type representation for type RepositoryRuleUpdateable + repositoryRuleRepositoryRuleUpdate1 RepositoryRuleUpdateable + // Composed type representation for type RepositoryRuleUpdateable + repositoryRuleRepositoryRuleUpdate2 RepositoryRuleUpdateable + // Composed type representation for type RepositoryRuleWorkflowsable + repositoryRuleRepositoryRuleWorkflows RepositoryRuleWorkflowsable + // Composed type representation for type RepositoryRuleWorkflowsable + repositoryRuleRepositoryRuleWorkflows0 RepositoryRuleWorkflowsable + // Composed type representation for type RepositoryRuleWorkflowsable + repositoryRuleRepositoryRuleWorkflows1 RepositoryRuleWorkflowsable + // Composed type representation for type RepositoryRuleWorkflowsable + repositoryRuleRepositoryRuleWorkflows2 RepositoryRuleWorkflowsable + // Composed type representation for type RepositoryRuleRequiredDeploymentsable + repositoryRuleRequiredDeployments RepositoryRuleRequiredDeploymentsable + // Composed type representation for type RepositoryRuleRequiredLinearHistoryable + repositoryRuleRequiredLinearHistory RepositoryRuleRequiredLinearHistoryable + // Composed type representation for type RepositoryRuleRequiredSignaturesable + repositoryRuleRequiredSignatures RepositoryRuleRequiredSignaturesable + // Composed type representation for type RepositoryRuleRequiredStatusChecksable + repositoryRuleRequiredStatusChecks RepositoryRuleRequiredStatusChecksable + // Composed type representation for type RepositoryRuleTagNamePatternable + repositoryRuleTagNamePattern RepositoryRuleTagNamePatternable + // Composed type representation for type RepositoryRuleUpdateable + repositoryRuleUpdate RepositoryRuleUpdateable + // Composed type representation for type RepositoryRuleWorkflowsable + repositoryRuleWorkflows RepositoryRuleWorkflowsable +} +// NewRepositoryRule instantiates a new RepositoryRule and sets the default values. +func NewRepositoryRule()(*RepositoryRule) { + m := &RepositoryRule{ + } + return m +} +// CreateRepositoryRuleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewRepositoryRule() + 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 { + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRule) 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 *RepositoryRule) GetIsComposedType()(bool) { + return true +} +// GetRepositoryRuleBranchNamePattern gets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +// returns a RepositoryRuleBranchNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleBranchNamePattern()(RepositoryRuleBranchNamePatternable) { + return m.repositoryRuleBranchNamePattern +} +// GetRepositoryRuleCodeScanning gets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +// returns a RepositoryRuleCodeScanningable when successful +func (m *RepositoryRule) GetRepositoryRuleCodeScanning()(RepositoryRuleCodeScanningable) { + return m.repositoryRuleCodeScanning +} +// GetRepositoryRuleCommitAuthorEmailPattern gets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +// returns a RepositoryRuleCommitAuthorEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleCommitAuthorEmailPattern()(RepositoryRuleCommitAuthorEmailPatternable) { + return m.repositoryRuleCommitAuthorEmailPattern +} +// GetRepositoryRuleCommitMessagePattern gets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +// returns a RepositoryRuleCommitMessagePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleCommitMessagePattern()(RepositoryRuleCommitMessagePatternable) { + return m.repositoryRuleCommitMessagePattern +} +// GetRepositoryRuleCommitterEmailPattern gets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +// returns a RepositoryRuleCommitterEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleCommitterEmailPattern()(RepositoryRuleCommitterEmailPatternable) { + return m.repositoryRuleCommitterEmailPattern +} +// GetRepositoryRuleCreation gets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +// returns a RepositoryRuleCreationable when successful +func (m *RepositoryRule) GetRepositoryRuleCreation()(RepositoryRuleCreationable) { + return m.repositoryRuleCreation +} +// GetRepositoryRuleDeletion gets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +// returns a RepositoryRuleDeletionable when successful +func (m *RepositoryRule) GetRepositoryRuleDeletion()(RepositoryRuleDeletionable) { + return m.repositoryRuleDeletion +} +// GetRepositoryRuleNonFastForward gets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +// returns a RepositoryRuleNonFastForwardable when successful +func (m *RepositoryRule) GetRepositoryRuleNonFastForward()(RepositoryRuleNonFastForwardable) { + return m.repositoryRuleNonFastForward +} +// GetRepositoryRulePullRequest gets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +// returns a RepositoryRulePullRequestable when successful +func (m *RepositoryRule) GetRepositoryRulePullRequest()(RepositoryRulePullRequestable) { + return m.repositoryRulePullRequest +} +// GetRepositoryRuleRepositoryRuleBranchNamePattern gets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +// returns a RepositoryRuleBranchNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleBranchNamePattern()(RepositoryRuleBranchNamePatternable) { + return m.repositoryRuleRepositoryRuleBranchNamePattern +} +// GetRepositoryRuleRepositoryRuleBranchNamePattern0 gets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +// returns a RepositoryRuleBranchNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleBranchNamePattern0()(RepositoryRuleBranchNamePatternable) { + return m.repositoryRuleRepositoryRuleBranchNamePattern0 +} +// GetRepositoryRuleRepositoryRuleBranchNamePattern1 gets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +// returns a RepositoryRuleBranchNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleBranchNamePattern1()(RepositoryRuleBranchNamePatternable) { + return m.repositoryRuleRepositoryRuleBranchNamePattern1 +} +// GetRepositoryRuleRepositoryRuleBranchNamePattern2 gets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +// returns a RepositoryRuleBranchNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleBranchNamePattern2()(RepositoryRuleBranchNamePatternable) { + return m.repositoryRuleRepositoryRuleBranchNamePattern2 +} +// GetRepositoryRuleRepositoryRuleCodeScanning gets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +// returns a RepositoryRuleCodeScanningable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCodeScanning()(RepositoryRuleCodeScanningable) { + return m.repositoryRuleRepositoryRuleCodeScanning +} +// GetRepositoryRuleRepositoryRuleCodeScanning0 gets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +// returns a RepositoryRuleCodeScanningable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCodeScanning0()(RepositoryRuleCodeScanningable) { + return m.repositoryRuleRepositoryRuleCodeScanning0 +} +// GetRepositoryRuleRepositoryRuleCodeScanning1 gets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +// returns a RepositoryRuleCodeScanningable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCodeScanning1()(RepositoryRuleCodeScanningable) { + return m.repositoryRuleRepositoryRuleCodeScanning1 +} +// GetRepositoryRuleRepositoryRuleCodeScanning2 gets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +// returns a RepositoryRuleCodeScanningable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCodeScanning2()(RepositoryRuleCodeScanningable) { + return m.repositoryRuleRepositoryRuleCodeScanning2 +} +// GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern gets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +// returns a RepositoryRuleCommitAuthorEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern()(RepositoryRuleCommitAuthorEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern +} +// GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0 gets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +// returns a RepositoryRuleCommitAuthorEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0()(RepositoryRuleCommitAuthorEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern0 +} +// GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1 gets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +// returns a RepositoryRuleCommitAuthorEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1()(RepositoryRuleCommitAuthorEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern1 +} +// GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2 gets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +// returns a RepositoryRuleCommitAuthorEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2()(RepositoryRuleCommitAuthorEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern2 +} +// GetRepositoryRuleRepositoryRuleCommitMessagePattern gets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +// returns a RepositoryRuleCommitMessagePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitMessagePattern()(RepositoryRuleCommitMessagePatternable) { + return m.repositoryRuleRepositoryRuleCommitMessagePattern +} +// GetRepositoryRuleRepositoryRuleCommitMessagePattern0 gets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +// returns a RepositoryRuleCommitMessagePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitMessagePattern0()(RepositoryRuleCommitMessagePatternable) { + return m.repositoryRuleRepositoryRuleCommitMessagePattern0 +} +// GetRepositoryRuleRepositoryRuleCommitMessagePattern1 gets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +// returns a RepositoryRuleCommitMessagePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitMessagePattern1()(RepositoryRuleCommitMessagePatternable) { + return m.repositoryRuleRepositoryRuleCommitMessagePattern1 +} +// GetRepositoryRuleRepositoryRuleCommitMessagePattern2 gets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +// returns a RepositoryRuleCommitMessagePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitMessagePattern2()(RepositoryRuleCommitMessagePatternable) { + return m.repositoryRuleRepositoryRuleCommitMessagePattern2 +} +// GetRepositoryRuleRepositoryRuleCommitterEmailPattern gets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +// returns a RepositoryRuleCommitterEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitterEmailPattern()(RepositoryRuleCommitterEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitterEmailPattern +} +// GetRepositoryRuleRepositoryRuleCommitterEmailPattern0 gets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +// returns a RepositoryRuleCommitterEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitterEmailPattern0()(RepositoryRuleCommitterEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitterEmailPattern0 +} +// GetRepositoryRuleRepositoryRuleCommitterEmailPattern1 gets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +// returns a RepositoryRuleCommitterEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitterEmailPattern1()(RepositoryRuleCommitterEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitterEmailPattern1 +} +// GetRepositoryRuleRepositoryRuleCommitterEmailPattern2 gets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +// returns a RepositoryRuleCommitterEmailPatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCommitterEmailPattern2()(RepositoryRuleCommitterEmailPatternable) { + return m.repositoryRuleRepositoryRuleCommitterEmailPattern2 +} +// GetRepositoryRuleRepositoryRuleCreation gets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +// returns a RepositoryRuleCreationable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCreation()(RepositoryRuleCreationable) { + return m.repositoryRuleRepositoryRuleCreation +} +// GetRepositoryRuleRepositoryRuleCreation0 gets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +// returns a RepositoryRuleCreationable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCreation0()(RepositoryRuleCreationable) { + return m.repositoryRuleRepositoryRuleCreation0 +} +// GetRepositoryRuleRepositoryRuleCreation1 gets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +// returns a RepositoryRuleCreationable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCreation1()(RepositoryRuleCreationable) { + return m.repositoryRuleRepositoryRuleCreation1 +} +// GetRepositoryRuleRepositoryRuleCreation2 gets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +// returns a RepositoryRuleCreationable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleCreation2()(RepositoryRuleCreationable) { + return m.repositoryRuleRepositoryRuleCreation2 +} +// GetRepositoryRuleRepositoryRuleDeletion gets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +// returns a RepositoryRuleDeletionable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleDeletion()(RepositoryRuleDeletionable) { + return m.repositoryRuleRepositoryRuleDeletion +} +// GetRepositoryRuleRepositoryRuleDeletion0 gets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +// returns a RepositoryRuleDeletionable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleDeletion0()(RepositoryRuleDeletionable) { + return m.repositoryRuleRepositoryRuleDeletion0 +} +// GetRepositoryRuleRepositoryRuleDeletion1 gets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +// returns a RepositoryRuleDeletionable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleDeletion1()(RepositoryRuleDeletionable) { + return m.repositoryRuleRepositoryRuleDeletion1 +} +// GetRepositoryRuleRepositoryRuleDeletion2 gets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +// returns a RepositoryRuleDeletionable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleDeletion2()(RepositoryRuleDeletionable) { + return m.repositoryRuleRepositoryRuleDeletion2 +} +// GetRepositoryRuleRepositoryRuleNonFastForward gets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +// returns a RepositoryRuleNonFastForwardable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleNonFastForward()(RepositoryRuleNonFastForwardable) { + return m.repositoryRuleRepositoryRuleNonFastForward +} +// GetRepositoryRuleRepositoryRuleNonFastForward0 gets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +// returns a RepositoryRuleNonFastForwardable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleNonFastForward0()(RepositoryRuleNonFastForwardable) { + return m.repositoryRuleRepositoryRuleNonFastForward0 +} +// GetRepositoryRuleRepositoryRuleNonFastForward1 gets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +// returns a RepositoryRuleNonFastForwardable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleNonFastForward1()(RepositoryRuleNonFastForwardable) { + return m.repositoryRuleRepositoryRuleNonFastForward1 +} +// GetRepositoryRuleRepositoryRuleNonFastForward2 gets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +// returns a RepositoryRuleNonFastForwardable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleNonFastForward2()(RepositoryRuleNonFastForwardable) { + return m.repositoryRuleRepositoryRuleNonFastForward2 +} +// GetRepositoryRuleRepositoryRulePullRequest gets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +// returns a RepositoryRulePullRequestable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRulePullRequest()(RepositoryRulePullRequestable) { + return m.repositoryRuleRepositoryRulePullRequest +} +// GetRepositoryRuleRepositoryRulePullRequest0 gets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +// returns a RepositoryRulePullRequestable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRulePullRequest0()(RepositoryRulePullRequestable) { + return m.repositoryRuleRepositoryRulePullRequest0 +} +// GetRepositoryRuleRepositoryRulePullRequest1 gets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +// returns a RepositoryRulePullRequestable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRulePullRequest1()(RepositoryRulePullRequestable) { + return m.repositoryRuleRepositoryRulePullRequest1 +} +// GetRepositoryRuleRepositoryRulePullRequest2 gets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +// returns a RepositoryRulePullRequestable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRulePullRequest2()(RepositoryRulePullRequestable) { + return m.repositoryRuleRepositoryRulePullRequest2 +} +// GetRepositoryRuleRepositoryRuleRequiredDeployments gets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +// returns a RepositoryRuleRequiredDeploymentsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredDeployments()(RepositoryRuleRequiredDeploymentsable) { + return m.repositoryRuleRepositoryRuleRequiredDeployments +} +// GetRepositoryRuleRepositoryRuleRequiredDeployments0 gets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +// returns a RepositoryRuleRequiredDeploymentsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredDeployments0()(RepositoryRuleRequiredDeploymentsable) { + return m.repositoryRuleRepositoryRuleRequiredDeployments0 +} +// GetRepositoryRuleRepositoryRuleRequiredDeployments1 gets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +// returns a RepositoryRuleRequiredDeploymentsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredDeployments1()(RepositoryRuleRequiredDeploymentsable) { + return m.repositoryRuleRepositoryRuleRequiredDeployments1 +} +// GetRepositoryRuleRepositoryRuleRequiredDeployments2 gets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +// returns a RepositoryRuleRequiredDeploymentsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredDeployments2()(RepositoryRuleRequiredDeploymentsable) { + return m.repositoryRuleRepositoryRuleRequiredDeployments2 +} +// GetRepositoryRuleRepositoryRuleRequiredLinearHistory gets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +// returns a RepositoryRuleRequiredLinearHistoryable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredLinearHistory()(RepositoryRuleRequiredLinearHistoryable) { + return m.repositoryRuleRepositoryRuleRequiredLinearHistory +} +// GetRepositoryRuleRepositoryRuleRequiredLinearHistory0 gets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +// returns a RepositoryRuleRequiredLinearHistoryable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredLinearHistory0()(RepositoryRuleRequiredLinearHistoryable) { + return m.repositoryRuleRepositoryRuleRequiredLinearHistory0 +} +// GetRepositoryRuleRepositoryRuleRequiredLinearHistory1 gets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +// returns a RepositoryRuleRequiredLinearHistoryable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredLinearHistory1()(RepositoryRuleRequiredLinearHistoryable) { + return m.repositoryRuleRepositoryRuleRequiredLinearHistory1 +} +// GetRepositoryRuleRepositoryRuleRequiredLinearHistory2 gets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +// returns a RepositoryRuleRequiredLinearHistoryable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredLinearHistory2()(RepositoryRuleRequiredLinearHistoryable) { + return m.repositoryRuleRepositoryRuleRequiredLinearHistory2 +} +// GetRepositoryRuleRepositoryRuleRequiredSignatures gets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +// returns a RepositoryRuleRequiredSignaturesable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredSignatures()(RepositoryRuleRequiredSignaturesable) { + return m.repositoryRuleRepositoryRuleRequiredSignatures +} +// GetRepositoryRuleRepositoryRuleRequiredSignatures0 gets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +// returns a RepositoryRuleRequiredSignaturesable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredSignatures0()(RepositoryRuleRequiredSignaturesable) { + return m.repositoryRuleRepositoryRuleRequiredSignatures0 +} +// GetRepositoryRuleRepositoryRuleRequiredSignatures1 gets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +// returns a RepositoryRuleRequiredSignaturesable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredSignatures1()(RepositoryRuleRequiredSignaturesable) { + return m.repositoryRuleRepositoryRuleRequiredSignatures1 +} +// GetRepositoryRuleRepositoryRuleRequiredSignatures2 gets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +// returns a RepositoryRuleRequiredSignaturesable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredSignatures2()(RepositoryRuleRequiredSignaturesable) { + return m.repositoryRuleRepositoryRuleRequiredSignatures2 +} +// GetRepositoryRuleRepositoryRuleRequiredStatusChecks gets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +// returns a RepositoryRuleRequiredStatusChecksable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredStatusChecks()(RepositoryRuleRequiredStatusChecksable) { + return m.repositoryRuleRepositoryRuleRequiredStatusChecks +} +// GetRepositoryRuleRepositoryRuleRequiredStatusChecks0 gets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +// returns a RepositoryRuleRequiredStatusChecksable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredStatusChecks0()(RepositoryRuleRequiredStatusChecksable) { + return m.repositoryRuleRepositoryRuleRequiredStatusChecks0 +} +// GetRepositoryRuleRepositoryRuleRequiredStatusChecks1 gets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +// returns a RepositoryRuleRequiredStatusChecksable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredStatusChecks1()(RepositoryRuleRequiredStatusChecksable) { + return m.repositoryRuleRepositoryRuleRequiredStatusChecks1 +} +// GetRepositoryRuleRepositoryRuleRequiredStatusChecks2 gets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +// returns a RepositoryRuleRequiredStatusChecksable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleRequiredStatusChecks2()(RepositoryRuleRequiredStatusChecksable) { + return m.repositoryRuleRepositoryRuleRequiredStatusChecks2 +} +// GetRepositoryRuleRepositoryRuleTagNamePattern gets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +// returns a RepositoryRuleTagNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleTagNamePattern()(RepositoryRuleTagNamePatternable) { + return m.repositoryRuleRepositoryRuleTagNamePattern +} +// GetRepositoryRuleRepositoryRuleTagNamePattern0 gets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +// returns a RepositoryRuleTagNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleTagNamePattern0()(RepositoryRuleTagNamePatternable) { + return m.repositoryRuleRepositoryRuleTagNamePattern0 +} +// GetRepositoryRuleRepositoryRuleTagNamePattern1 gets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +// returns a RepositoryRuleTagNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleTagNamePattern1()(RepositoryRuleTagNamePatternable) { + return m.repositoryRuleRepositoryRuleTagNamePattern1 +} +// GetRepositoryRuleRepositoryRuleTagNamePattern2 gets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +// returns a RepositoryRuleTagNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleTagNamePattern2()(RepositoryRuleTagNamePatternable) { + return m.repositoryRuleRepositoryRuleTagNamePattern2 +} +// GetRepositoryRuleRepositoryRuleUpdate gets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +// returns a RepositoryRuleUpdateable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleUpdate()(RepositoryRuleUpdateable) { + return m.repositoryRuleRepositoryRuleUpdate +} +// GetRepositoryRuleRepositoryRuleUpdate0 gets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +// returns a RepositoryRuleUpdateable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleUpdate0()(RepositoryRuleUpdateable) { + return m.repositoryRuleRepositoryRuleUpdate0 +} +// GetRepositoryRuleRepositoryRuleUpdate1 gets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +// returns a RepositoryRuleUpdateable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleUpdate1()(RepositoryRuleUpdateable) { + return m.repositoryRuleRepositoryRuleUpdate1 +} +// GetRepositoryRuleRepositoryRuleUpdate2 gets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +// returns a RepositoryRuleUpdateable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleUpdate2()(RepositoryRuleUpdateable) { + return m.repositoryRuleRepositoryRuleUpdate2 +} +// GetRepositoryRuleRepositoryRuleWorkflows gets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +// returns a RepositoryRuleWorkflowsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleWorkflows()(RepositoryRuleWorkflowsable) { + return m.repositoryRuleRepositoryRuleWorkflows +} +// GetRepositoryRuleRepositoryRuleWorkflows0 gets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +// returns a RepositoryRuleWorkflowsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleWorkflows0()(RepositoryRuleWorkflowsable) { + return m.repositoryRuleRepositoryRuleWorkflows0 +} +// GetRepositoryRuleRepositoryRuleWorkflows1 gets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +// returns a RepositoryRuleWorkflowsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleWorkflows1()(RepositoryRuleWorkflowsable) { + return m.repositoryRuleRepositoryRuleWorkflows1 +} +// GetRepositoryRuleRepositoryRuleWorkflows2 gets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +// returns a RepositoryRuleWorkflowsable when successful +func (m *RepositoryRule) GetRepositoryRuleRepositoryRuleWorkflows2()(RepositoryRuleWorkflowsable) { + return m.repositoryRuleRepositoryRuleWorkflows2 +} +// GetRepositoryRuleRequiredDeployments gets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +// returns a RepositoryRuleRequiredDeploymentsable when successful +func (m *RepositoryRule) GetRepositoryRuleRequiredDeployments()(RepositoryRuleRequiredDeploymentsable) { + return m.repositoryRuleRequiredDeployments +} +// GetRepositoryRuleRequiredLinearHistory gets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +// returns a RepositoryRuleRequiredLinearHistoryable when successful +func (m *RepositoryRule) GetRepositoryRuleRequiredLinearHistory()(RepositoryRuleRequiredLinearHistoryable) { + return m.repositoryRuleRequiredLinearHistory +} +// GetRepositoryRuleRequiredSignatures gets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +// returns a RepositoryRuleRequiredSignaturesable when successful +func (m *RepositoryRule) GetRepositoryRuleRequiredSignatures()(RepositoryRuleRequiredSignaturesable) { + return m.repositoryRuleRequiredSignatures +} +// GetRepositoryRuleRequiredStatusChecks gets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +// returns a RepositoryRuleRequiredStatusChecksable when successful +func (m *RepositoryRule) GetRepositoryRuleRequiredStatusChecks()(RepositoryRuleRequiredStatusChecksable) { + return m.repositoryRuleRequiredStatusChecks +} +// GetRepositoryRuleTagNamePattern gets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +// returns a RepositoryRuleTagNamePatternable when successful +func (m *RepositoryRule) GetRepositoryRuleTagNamePattern()(RepositoryRuleTagNamePatternable) { + return m.repositoryRuleTagNamePattern +} +// GetRepositoryRuleUpdate gets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +// returns a RepositoryRuleUpdateable when successful +func (m *RepositoryRule) GetRepositoryRuleUpdate()(RepositoryRuleUpdateable) { + return m.repositoryRuleUpdate +} +// GetRepositoryRuleWorkflows gets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +// returns a RepositoryRuleWorkflowsable when successful +func (m *RepositoryRule) GetRepositoryRuleWorkflows()(RepositoryRuleWorkflowsable) { + return m.repositoryRuleWorkflows +} +// Serialize serializes information the current object +func (m *RepositoryRule) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositoryRuleBranchNamePattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleBranchNamePattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleCodeScanning() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleCodeScanning()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleCommitAuthorEmailPattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleCommitAuthorEmailPattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleCommitMessagePattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleCommitMessagePattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleCommitterEmailPattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleCommitterEmailPattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleCreation() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleCreation()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleDeletion() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleDeletion()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleNonFastForward() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleNonFastForward()) + if err != nil { + return err + } + } else if m.GetRepositoryRulePullRequest() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRulePullRequest()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleBranchNamePattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleBranchNamePattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleBranchNamePattern0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleBranchNamePattern0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleBranchNamePattern1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleBranchNamePattern1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleBranchNamePattern2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleBranchNamePattern2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCodeScanning() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCodeScanning()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCodeScanning0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCodeScanning0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCodeScanning1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCodeScanning1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCodeScanning2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCodeScanning2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitMessagePattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitMessagePattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitMessagePattern0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitMessagePattern0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitMessagePattern1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitMessagePattern1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitMessagePattern2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitMessagePattern2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCommitterEmailPattern2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCreation() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCreation()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCreation0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCreation0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCreation1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCreation1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleCreation2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleCreation2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleDeletion() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleDeletion()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleDeletion0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleDeletion0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleDeletion1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleDeletion1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleDeletion2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleDeletion2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleNonFastForward() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleNonFastForward()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleNonFastForward0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleNonFastForward0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleNonFastForward1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleNonFastForward1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleNonFastForward2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleNonFastForward2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRulePullRequest() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRulePullRequest()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRulePullRequest0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRulePullRequest0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRulePullRequest1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRulePullRequest1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRulePullRequest2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRulePullRequest2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredDeployments() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredDeployments()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredDeployments0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredDeployments0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredDeployments1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredDeployments1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredDeployments2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredDeployments2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredLinearHistory2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredSignatures() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredSignatures()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredSignatures0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredSignatures0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredSignatures1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredSignatures1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredSignatures2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredSignatures2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleRequiredStatusChecks2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleTagNamePattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleTagNamePattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleTagNamePattern0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleTagNamePattern0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleTagNamePattern1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleTagNamePattern1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleTagNamePattern2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleTagNamePattern2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleUpdate() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleUpdate()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleUpdate0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleUpdate0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleUpdate1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleUpdate1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleUpdate2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleUpdate2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleWorkflows() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleWorkflows()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleWorkflows0() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleWorkflows0()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleWorkflows1() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleWorkflows1()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRepositoryRuleWorkflows2() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRepositoryRuleWorkflows2()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRequiredDeployments() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRequiredDeployments()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRequiredLinearHistory() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRequiredLinearHistory()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRequiredSignatures() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRequiredSignatures()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleRequiredStatusChecks() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleRequiredStatusChecks()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleTagNamePattern() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleTagNamePattern()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleUpdate() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleUpdate()) + if err != nil { + return err + } + } else if m.GetRepositoryRuleWorkflows() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRuleWorkflows()) + if err != nil { + return err + } + } + return nil +} +// SetRepositoryRuleBranchNamePattern sets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +func (m *RepositoryRule) SetRepositoryRuleBranchNamePattern(value RepositoryRuleBranchNamePatternable)() { + m.repositoryRuleBranchNamePattern = value +} +// SetRepositoryRuleCodeScanning sets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +func (m *RepositoryRule) SetRepositoryRuleCodeScanning(value RepositoryRuleCodeScanningable)() { + m.repositoryRuleCodeScanning = value +} +// SetRepositoryRuleCommitAuthorEmailPattern sets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleCommitAuthorEmailPattern(value RepositoryRuleCommitAuthorEmailPatternable)() { + m.repositoryRuleCommitAuthorEmailPattern = value +} +// SetRepositoryRuleCommitMessagePattern sets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +func (m *RepositoryRule) SetRepositoryRuleCommitMessagePattern(value RepositoryRuleCommitMessagePatternable)() { + m.repositoryRuleCommitMessagePattern = value +} +// SetRepositoryRuleCommitterEmailPattern sets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleCommitterEmailPattern(value RepositoryRuleCommitterEmailPatternable)() { + m.repositoryRuleCommitterEmailPattern = value +} +// SetRepositoryRuleCreation sets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +func (m *RepositoryRule) SetRepositoryRuleCreation(value RepositoryRuleCreationable)() { + m.repositoryRuleCreation = value +} +// SetRepositoryRuleDeletion sets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +func (m *RepositoryRule) SetRepositoryRuleDeletion(value RepositoryRuleDeletionable)() { + m.repositoryRuleDeletion = value +} +// SetRepositoryRuleNonFastForward sets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +func (m *RepositoryRule) SetRepositoryRuleNonFastForward(value RepositoryRuleNonFastForwardable)() { + m.repositoryRuleNonFastForward = value +} +// SetRepositoryRulePullRequest sets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +func (m *RepositoryRule) SetRepositoryRulePullRequest(value RepositoryRulePullRequestable)() { + m.repositoryRulePullRequest = value +} +// SetRepositoryRuleRepositoryRuleBranchNamePattern sets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleBranchNamePattern(value RepositoryRuleBranchNamePatternable)() { + m.repositoryRuleRepositoryRuleBranchNamePattern = value +} +// SetRepositoryRuleRepositoryRuleBranchNamePattern0 sets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleBranchNamePattern0(value RepositoryRuleBranchNamePatternable)() { + m.repositoryRuleRepositoryRuleBranchNamePattern0 = value +} +// SetRepositoryRuleRepositoryRuleBranchNamePattern1 sets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleBranchNamePattern1(value RepositoryRuleBranchNamePatternable)() { + m.repositoryRuleRepositoryRuleBranchNamePattern1 = value +} +// SetRepositoryRuleRepositoryRuleBranchNamePattern2 sets the repositoryRuleBranchNamePattern property value. Composed type representation for type RepositoryRuleBranchNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleBranchNamePattern2(value RepositoryRuleBranchNamePatternable)() { + m.repositoryRuleRepositoryRuleBranchNamePattern2 = value +} +// SetRepositoryRuleRepositoryRuleCodeScanning sets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCodeScanning(value RepositoryRuleCodeScanningable)() { + m.repositoryRuleRepositoryRuleCodeScanning = value +} +// SetRepositoryRuleRepositoryRuleCodeScanning0 sets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCodeScanning0(value RepositoryRuleCodeScanningable)() { + m.repositoryRuleRepositoryRuleCodeScanning0 = value +} +// SetRepositoryRuleRepositoryRuleCodeScanning1 sets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCodeScanning1(value RepositoryRuleCodeScanningable)() { + m.repositoryRuleRepositoryRuleCodeScanning1 = value +} +// SetRepositoryRuleRepositoryRuleCodeScanning2 sets the repositoryRuleCodeScanning property value. Composed type representation for type RepositoryRuleCodeScanningable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCodeScanning2(value RepositoryRuleCodeScanningable)() { + m.repositoryRuleRepositoryRuleCodeScanning2 = value +} +// SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern sets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern(value RepositoryRuleCommitAuthorEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern = value +} +// SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0 sets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0(value RepositoryRuleCommitAuthorEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern0 = value +} +// SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1 sets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1(value RepositoryRuleCommitAuthorEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern1 = value +} +// SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2 sets the repositoryRuleCommitAuthorEmailPattern property value. Composed type representation for type RepositoryRuleCommitAuthorEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2(value RepositoryRuleCommitAuthorEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitAuthorEmailPattern2 = value +} +// SetRepositoryRuleRepositoryRuleCommitMessagePattern sets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitMessagePattern(value RepositoryRuleCommitMessagePatternable)() { + m.repositoryRuleRepositoryRuleCommitMessagePattern = value +} +// SetRepositoryRuleRepositoryRuleCommitMessagePattern0 sets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitMessagePattern0(value RepositoryRuleCommitMessagePatternable)() { + m.repositoryRuleRepositoryRuleCommitMessagePattern0 = value +} +// SetRepositoryRuleRepositoryRuleCommitMessagePattern1 sets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitMessagePattern1(value RepositoryRuleCommitMessagePatternable)() { + m.repositoryRuleRepositoryRuleCommitMessagePattern1 = value +} +// SetRepositoryRuleRepositoryRuleCommitMessagePattern2 sets the repositoryRuleCommitMessagePattern property value. Composed type representation for type RepositoryRuleCommitMessagePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitMessagePattern2(value RepositoryRuleCommitMessagePatternable)() { + m.repositoryRuleRepositoryRuleCommitMessagePattern2 = value +} +// SetRepositoryRuleRepositoryRuleCommitterEmailPattern sets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitterEmailPattern(value RepositoryRuleCommitterEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitterEmailPattern = value +} +// SetRepositoryRuleRepositoryRuleCommitterEmailPattern0 sets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitterEmailPattern0(value RepositoryRuleCommitterEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitterEmailPattern0 = value +} +// SetRepositoryRuleRepositoryRuleCommitterEmailPattern1 sets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitterEmailPattern1(value RepositoryRuleCommitterEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitterEmailPattern1 = value +} +// SetRepositoryRuleRepositoryRuleCommitterEmailPattern2 sets the repositoryRuleCommitterEmailPattern property value. Composed type representation for type RepositoryRuleCommitterEmailPatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCommitterEmailPattern2(value RepositoryRuleCommitterEmailPatternable)() { + m.repositoryRuleRepositoryRuleCommitterEmailPattern2 = value +} +// SetRepositoryRuleRepositoryRuleCreation sets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCreation(value RepositoryRuleCreationable)() { + m.repositoryRuleRepositoryRuleCreation = value +} +// SetRepositoryRuleRepositoryRuleCreation0 sets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCreation0(value RepositoryRuleCreationable)() { + m.repositoryRuleRepositoryRuleCreation0 = value +} +// SetRepositoryRuleRepositoryRuleCreation1 sets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCreation1(value RepositoryRuleCreationable)() { + m.repositoryRuleRepositoryRuleCreation1 = value +} +// SetRepositoryRuleRepositoryRuleCreation2 sets the repositoryRuleCreation property value. Composed type representation for type RepositoryRuleCreationable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleCreation2(value RepositoryRuleCreationable)() { + m.repositoryRuleRepositoryRuleCreation2 = value +} +// SetRepositoryRuleRepositoryRuleDeletion sets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleDeletion(value RepositoryRuleDeletionable)() { + m.repositoryRuleRepositoryRuleDeletion = value +} +// SetRepositoryRuleRepositoryRuleDeletion0 sets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleDeletion0(value RepositoryRuleDeletionable)() { + m.repositoryRuleRepositoryRuleDeletion0 = value +} +// SetRepositoryRuleRepositoryRuleDeletion1 sets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleDeletion1(value RepositoryRuleDeletionable)() { + m.repositoryRuleRepositoryRuleDeletion1 = value +} +// SetRepositoryRuleRepositoryRuleDeletion2 sets the repositoryRuleDeletion property value. Composed type representation for type RepositoryRuleDeletionable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleDeletion2(value RepositoryRuleDeletionable)() { + m.repositoryRuleRepositoryRuleDeletion2 = value +} +// SetRepositoryRuleRepositoryRuleNonFastForward sets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleNonFastForward(value RepositoryRuleNonFastForwardable)() { + m.repositoryRuleRepositoryRuleNonFastForward = value +} +// SetRepositoryRuleRepositoryRuleNonFastForward0 sets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleNonFastForward0(value RepositoryRuleNonFastForwardable)() { + m.repositoryRuleRepositoryRuleNonFastForward0 = value +} +// SetRepositoryRuleRepositoryRuleNonFastForward1 sets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleNonFastForward1(value RepositoryRuleNonFastForwardable)() { + m.repositoryRuleRepositoryRuleNonFastForward1 = value +} +// SetRepositoryRuleRepositoryRuleNonFastForward2 sets the repositoryRuleNonFastForward property value. Composed type representation for type RepositoryRuleNonFastForwardable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleNonFastForward2(value RepositoryRuleNonFastForwardable)() { + m.repositoryRuleRepositoryRuleNonFastForward2 = value +} +// SetRepositoryRuleRepositoryRulePullRequest sets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRulePullRequest(value RepositoryRulePullRequestable)() { + m.repositoryRuleRepositoryRulePullRequest = value +} +// SetRepositoryRuleRepositoryRulePullRequest0 sets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRulePullRequest0(value RepositoryRulePullRequestable)() { + m.repositoryRuleRepositoryRulePullRequest0 = value +} +// SetRepositoryRuleRepositoryRulePullRequest1 sets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRulePullRequest1(value RepositoryRulePullRequestable)() { + m.repositoryRuleRepositoryRulePullRequest1 = value +} +// SetRepositoryRuleRepositoryRulePullRequest2 sets the repositoryRulePullRequest property value. Composed type representation for type RepositoryRulePullRequestable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRulePullRequest2(value RepositoryRulePullRequestable)() { + m.repositoryRuleRepositoryRulePullRequest2 = value +} +// SetRepositoryRuleRepositoryRuleRequiredDeployments sets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredDeployments(value RepositoryRuleRequiredDeploymentsable)() { + m.repositoryRuleRepositoryRuleRequiredDeployments = value +} +// SetRepositoryRuleRepositoryRuleRequiredDeployments0 sets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredDeployments0(value RepositoryRuleRequiredDeploymentsable)() { + m.repositoryRuleRepositoryRuleRequiredDeployments0 = value +} +// SetRepositoryRuleRepositoryRuleRequiredDeployments1 sets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredDeployments1(value RepositoryRuleRequiredDeploymentsable)() { + m.repositoryRuleRepositoryRuleRequiredDeployments1 = value +} +// SetRepositoryRuleRepositoryRuleRequiredDeployments2 sets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredDeployments2(value RepositoryRuleRequiredDeploymentsable)() { + m.repositoryRuleRepositoryRuleRequiredDeployments2 = value +} +// SetRepositoryRuleRepositoryRuleRequiredLinearHistory sets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredLinearHistory(value RepositoryRuleRequiredLinearHistoryable)() { + m.repositoryRuleRepositoryRuleRequiredLinearHistory = value +} +// SetRepositoryRuleRepositoryRuleRequiredLinearHistory0 sets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredLinearHistory0(value RepositoryRuleRequiredLinearHistoryable)() { + m.repositoryRuleRepositoryRuleRequiredLinearHistory0 = value +} +// SetRepositoryRuleRepositoryRuleRequiredLinearHistory1 sets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredLinearHistory1(value RepositoryRuleRequiredLinearHistoryable)() { + m.repositoryRuleRepositoryRuleRequiredLinearHistory1 = value +} +// SetRepositoryRuleRepositoryRuleRequiredLinearHistory2 sets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredLinearHistory2(value RepositoryRuleRequiredLinearHistoryable)() { + m.repositoryRuleRepositoryRuleRequiredLinearHistory2 = value +} +// SetRepositoryRuleRepositoryRuleRequiredSignatures sets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredSignatures(value RepositoryRuleRequiredSignaturesable)() { + m.repositoryRuleRepositoryRuleRequiredSignatures = value +} +// SetRepositoryRuleRepositoryRuleRequiredSignatures0 sets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredSignatures0(value RepositoryRuleRequiredSignaturesable)() { + m.repositoryRuleRepositoryRuleRequiredSignatures0 = value +} +// SetRepositoryRuleRepositoryRuleRequiredSignatures1 sets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredSignatures1(value RepositoryRuleRequiredSignaturesable)() { + m.repositoryRuleRepositoryRuleRequiredSignatures1 = value +} +// SetRepositoryRuleRepositoryRuleRequiredSignatures2 sets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredSignatures2(value RepositoryRuleRequiredSignaturesable)() { + m.repositoryRuleRepositoryRuleRequiredSignatures2 = value +} +// SetRepositoryRuleRepositoryRuleRequiredStatusChecks sets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredStatusChecks(value RepositoryRuleRequiredStatusChecksable)() { + m.repositoryRuleRepositoryRuleRequiredStatusChecks = value +} +// SetRepositoryRuleRepositoryRuleRequiredStatusChecks0 sets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredStatusChecks0(value RepositoryRuleRequiredStatusChecksable)() { + m.repositoryRuleRepositoryRuleRequiredStatusChecks0 = value +} +// SetRepositoryRuleRepositoryRuleRequiredStatusChecks1 sets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredStatusChecks1(value RepositoryRuleRequiredStatusChecksable)() { + m.repositoryRuleRepositoryRuleRequiredStatusChecks1 = value +} +// SetRepositoryRuleRepositoryRuleRequiredStatusChecks2 sets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleRequiredStatusChecks2(value RepositoryRuleRequiredStatusChecksable)() { + m.repositoryRuleRepositoryRuleRequiredStatusChecks2 = value +} +// SetRepositoryRuleRepositoryRuleTagNamePattern sets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleTagNamePattern(value RepositoryRuleTagNamePatternable)() { + m.repositoryRuleRepositoryRuleTagNamePattern = value +} +// SetRepositoryRuleRepositoryRuleTagNamePattern0 sets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleTagNamePattern0(value RepositoryRuleTagNamePatternable)() { + m.repositoryRuleRepositoryRuleTagNamePattern0 = value +} +// SetRepositoryRuleRepositoryRuleTagNamePattern1 sets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleTagNamePattern1(value RepositoryRuleTagNamePatternable)() { + m.repositoryRuleRepositoryRuleTagNamePattern1 = value +} +// SetRepositoryRuleRepositoryRuleTagNamePattern2 sets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleTagNamePattern2(value RepositoryRuleTagNamePatternable)() { + m.repositoryRuleRepositoryRuleTagNamePattern2 = value +} +// SetRepositoryRuleRepositoryRuleUpdate sets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleUpdate(value RepositoryRuleUpdateable)() { + m.repositoryRuleRepositoryRuleUpdate = value +} +// SetRepositoryRuleRepositoryRuleUpdate0 sets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleUpdate0(value RepositoryRuleUpdateable)() { + m.repositoryRuleRepositoryRuleUpdate0 = value +} +// SetRepositoryRuleRepositoryRuleUpdate1 sets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleUpdate1(value RepositoryRuleUpdateable)() { + m.repositoryRuleRepositoryRuleUpdate1 = value +} +// SetRepositoryRuleRepositoryRuleUpdate2 sets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleUpdate2(value RepositoryRuleUpdateable)() { + m.repositoryRuleRepositoryRuleUpdate2 = value +} +// SetRepositoryRuleRepositoryRuleWorkflows sets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleWorkflows(value RepositoryRuleWorkflowsable)() { + m.repositoryRuleRepositoryRuleWorkflows = value +} +// SetRepositoryRuleRepositoryRuleWorkflows0 sets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleWorkflows0(value RepositoryRuleWorkflowsable)() { + m.repositoryRuleRepositoryRuleWorkflows0 = value +} +// SetRepositoryRuleRepositoryRuleWorkflows1 sets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleWorkflows1(value RepositoryRuleWorkflowsable)() { + m.repositoryRuleRepositoryRuleWorkflows1 = value +} +// SetRepositoryRuleRepositoryRuleWorkflows2 sets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +func (m *RepositoryRule) SetRepositoryRuleRepositoryRuleWorkflows2(value RepositoryRuleWorkflowsable)() { + m.repositoryRuleRepositoryRuleWorkflows2 = value +} +// SetRepositoryRuleRequiredDeployments sets the repositoryRuleRequiredDeployments property value. Composed type representation for type RepositoryRuleRequiredDeploymentsable +func (m *RepositoryRule) SetRepositoryRuleRequiredDeployments(value RepositoryRuleRequiredDeploymentsable)() { + m.repositoryRuleRequiredDeployments = value +} +// SetRepositoryRuleRequiredLinearHistory sets the repositoryRuleRequiredLinearHistory property value. Composed type representation for type RepositoryRuleRequiredLinearHistoryable +func (m *RepositoryRule) SetRepositoryRuleRequiredLinearHistory(value RepositoryRuleRequiredLinearHistoryable)() { + m.repositoryRuleRequiredLinearHistory = value +} +// SetRepositoryRuleRequiredSignatures sets the repositoryRuleRequiredSignatures property value. Composed type representation for type RepositoryRuleRequiredSignaturesable +func (m *RepositoryRule) SetRepositoryRuleRequiredSignatures(value RepositoryRuleRequiredSignaturesable)() { + m.repositoryRuleRequiredSignatures = value +} +// SetRepositoryRuleRequiredStatusChecks sets the repositoryRuleRequiredStatusChecks property value. Composed type representation for type RepositoryRuleRequiredStatusChecksable +func (m *RepositoryRule) SetRepositoryRuleRequiredStatusChecks(value RepositoryRuleRequiredStatusChecksable)() { + m.repositoryRuleRequiredStatusChecks = value +} +// SetRepositoryRuleTagNamePattern sets the repositoryRuleTagNamePattern property value. Composed type representation for type RepositoryRuleTagNamePatternable +func (m *RepositoryRule) SetRepositoryRuleTagNamePattern(value RepositoryRuleTagNamePatternable)() { + m.repositoryRuleTagNamePattern = value +} +// SetRepositoryRuleUpdate sets the repositoryRuleUpdate property value. Composed type representation for type RepositoryRuleUpdateable +func (m *RepositoryRule) SetRepositoryRuleUpdate(value RepositoryRuleUpdateable)() { + m.repositoryRuleUpdate = value +} +// SetRepositoryRuleWorkflows sets the repositoryRuleWorkflows property value. Composed type representation for type RepositoryRuleWorkflowsable +func (m *RepositoryRule) SetRepositoryRuleWorkflows(value RepositoryRuleWorkflowsable)() { + m.repositoryRuleWorkflows = value +} +type RepositoryRuleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositoryRuleBranchNamePattern()(RepositoryRuleBranchNamePatternable) + GetRepositoryRuleCodeScanning()(RepositoryRuleCodeScanningable) + GetRepositoryRuleCommitAuthorEmailPattern()(RepositoryRuleCommitAuthorEmailPatternable) + GetRepositoryRuleCommitMessagePattern()(RepositoryRuleCommitMessagePatternable) + GetRepositoryRuleCommitterEmailPattern()(RepositoryRuleCommitterEmailPatternable) + GetRepositoryRuleCreation()(RepositoryRuleCreationable) + GetRepositoryRuleDeletion()(RepositoryRuleDeletionable) + GetRepositoryRuleNonFastForward()(RepositoryRuleNonFastForwardable) + GetRepositoryRulePullRequest()(RepositoryRulePullRequestable) + GetRepositoryRuleRepositoryRuleBranchNamePattern()(RepositoryRuleBranchNamePatternable) + GetRepositoryRuleRepositoryRuleBranchNamePattern0()(RepositoryRuleBranchNamePatternable) + GetRepositoryRuleRepositoryRuleBranchNamePattern1()(RepositoryRuleBranchNamePatternable) + GetRepositoryRuleRepositoryRuleBranchNamePattern2()(RepositoryRuleBranchNamePatternable) + GetRepositoryRuleRepositoryRuleCodeScanning()(RepositoryRuleCodeScanningable) + GetRepositoryRuleRepositoryRuleCodeScanning0()(RepositoryRuleCodeScanningable) + GetRepositoryRuleRepositoryRuleCodeScanning1()(RepositoryRuleCodeScanningable) + GetRepositoryRuleRepositoryRuleCodeScanning2()(RepositoryRuleCodeScanningable) + GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern()(RepositoryRuleCommitAuthorEmailPatternable) + GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0()(RepositoryRuleCommitAuthorEmailPatternable) + GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1()(RepositoryRuleCommitAuthorEmailPatternable) + GetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2()(RepositoryRuleCommitAuthorEmailPatternable) + GetRepositoryRuleRepositoryRuleCommitMessagePattern()(RepositoryRuleCommitMessagePatternable) + GetRepositoryRuleRepositoryRuleCommitMessagePattern0()(RepositoryRuleCommitMessagePatternable) + GetRepositoryRuleRepositoryRuleCommitMessagePattern1()(RepositoryRuleCommitMessagePatternable) + GetRepositoryRuleRepositoryRuleCommitMessagePattern2()(RepositoryRuleCommitMessagePatternable) + GetRepositoryRuleRepositoryRuleCommitterEmailPattern()(RepositoryRuleCommitterEmailPatternable) + GetRepositoryRuleRepositoryRuleCommitterEmailPattern0()(RepositoryRuleCommitterEmailPatternable) + GetRepositoryRuleRepositoryRuleCommitterEmailPattern1()(RepositoryRuleCommitterEmailPatternable) + GetRepositoryRuleRepositoryRuleCommitterEmailPattern2()(RepositoryRuleCommitterEmailPatternable) + GetRepositoryRuleRepositoryRuleCreation()(RepositoryRuleCreationable) + GetRepositoryRuleRepositoryRuleCreation0()(RepositoryRuleCreationable) + GetRepositoryRuleRepositoryRuleCreation1()(RepositoryRuleCreationable) + GetRepositoryRuleRepositoryRuleCreation2()(RepositoryRuleCreationable) + GetRepositoryRuleRepositoryRuleDeletion()(RepositoryRuleDeletionable) + GetRepositoryRuleRepositoryRuleDeletion0()(RepositoryRuleDeletionable) + GetRepositoryRuleRepositoryRuleDeletion1()(RepositoryRuleDeletionable) + GetRepositoryRuleRepositoryRuleDeletion2()(RepositoryRuleDeletionable) + GetRepositoryRuleRepositoryRuleNonFastForward()(RepositoryRuleNonFastForwardable) + GetRepositoryRuleRepositoryRuleNonFastForward0()(RepositoryRuleNonFastForwardable) + GetRepositoryRuleRepositoryRuleNonFastForward1()(RepositoryRuleNonFastForwardable) + GetRepositoryRuleRepositoryRuleNonFastForward2()(RepositoryRuleNonFastForwardable) + GetRepositoryRuleRepositoryRulePullRequest()(RepositoryRulePullRequestable) + GetRepositoryRuleRepositoryRulePullRequest0()(RepositoryRulePullRequestable) + GetRepositoryRuleRepositoryRulePullRequest1()(RepositoryRulePullRequestable) + GetRepositoryRuleRepositoryRulePullRequest2()(RepositoryRulePullRequestable) + GetRepositoryRuleRepositoryRuleRequiredDeployments()(RepositoryRuleRequiredDeploymentsable) + GetRepositoryRuleRepositoryRuleRequiredDeployments0()(RepositoryRuleRequiredDeploymentsable) + GetRepositoryRuleRepositoryRuleRequiredDeployments1()(RepositoryRuleRequiredDeploymentsable) + GetRepositoryRuleRepositoryRuleRequiredDeployments2()(RepositoryRuleRequiredDeploymentsable) + GetRepositoryRuleRepositoryRuleRequiredLinearHistory()(RepositoryRuleRequiredLinearHistoryable) + GetRepositoryRuleRepositoryRuleRequiredLinearHistory0()(RepositoryRuleRequiredLinearHistoryable) + GetRepositoryRuleRepositoryRuleRequiredLinearHistory1()(RepositoryRuleRequiredLinearHistoryable) + GetRepositoryRuleRepositoryRuleRequiredLinearHistory2()(RepositoryRuleRequiredLinearHistoryable) + GetRepositoryRuleRepositoryRuleRequiredSignatures()(RepositoryRuleRequiredSignaturesable) + GetRepositoryRuleRepositoryRuleRequiredSignatures0()(RepositoryRuleRequiredSignaturesable) + GetRepositoryRuleRepositoryRuleRequiredSignatures1()(RepositoryRuleRequiredSignaturesable) + GetRepositoryRuleRepositoryRuleRequiredSignatures2()(RepositoryRuleRequiredSignaturesable) + GetRepositoryRuleRepositoryRuleRequiredStatusChecks()(RepositoryRuleRequiredStatusChecksable) + GetRepositoryRuleRepositoryRuleRequiredStatusChecks0()(RepositoryRuleRequiredStatusChecksable) + GetRepositoryRuleRepositoryRuleRequiredStatusChecks1()(RepositoryRuleRequiredStatusChecksable) + GetRepositoryRuleRepositoryRuleRequiredStatusChecks2()(RepositoryRuleRequiredStatusChecksable) + GetRepositoryRuleRepositoryRuleTagNamePattern()(RepositoryRuleTagNamePatternable) + GetRepositoryRuleRepositoryRuleTagNamePattern0()(RepositoryRuleTagNamePatternable) + GetRepositoryRuleRepositoryRuleTagNamePattern1()(RepositoryRuleTagNamePatternable) + GetRepositoryRuleRepositoryRuleTagNamePattern2()(RepositoryRuleTagNamePatternable) + GetRepositoryRuleRepositoryRuleUpdate()(RepositoryRuleUpdateable) + GetRepositoryRuleRepositoryRuleUpdate0()(RepositoryRuleUpdateable) + GetRepositoryRuleRepositoryRuleUpdate1()(RepositoryRuleUpdateable) + GetRepositoryRuleRepositoryRuleUpdate2()(RepositoryRuleUpdateable) + GetRepositoryRuleRepositoryRuleWorkflows()(RepositoryRuleWorkflowsable) + GetRepositoryRuleRepositoryRuleWorkflows0()(RepositoryRuleWorkflowsable) + GetRepositoryRuleRepositoryRuleWorkflows1()(RepositoryRuleWorkflowsable) + GetRepositoryRuleRepositoryRuleWorkflows2()(RepositoryRuleWorkflowsable) + GetRepositoryRuleRequiredDeployments()(RepositoryRuleRequiredDeploymentsable) + GetRepositoryRuleRequiredLinearHistory()(RepositoryRuleRequiredLinearHistoryable) + GetRepositoryRuleRequiredSignatures()(RepositoryRuleRequiredSignaturesable) + GetRepositoryRuleRequiredStatusChecks()(RepositoryRuleRequiredStatusChecksable) + GetRepositoryRuleTagNamePattern()(RepositoryRuleTagNamePatternable) + GetRepositoryRuleUpdate()(RepositoryRuleUpdateable) + GetRepositoryRuleWorkflows()(RepositoryRuleWorkflowsable) + SetRepositoryRuleBranchNamePattern(value RepositoryRuleBranchNamePatternable)() + SetRepositoryRuleCodeScanning(value RepositoryRuleCodeScanningable)() + SetRepositoryRuleCommitAuthorEmailPattern(value RepositoryRuleCommitAuthorEmailPatternable)() + SetRepositoryRuleCommitMessagePattern(value RepositoryRuleCommitMessagePatternable)() + SetRepositoryRuleCommitterEmailPattern(value RepositoryRuleCommitterEmailPatternable)() + SetRepositoryRuleCreation(value RepositoryRuleCreationable)() + SetRepositoryRuleDeletion(value RepositoryRuleDeletionable)() + SetRepositoryRuleNonFastForward(value RepositoryRuleNonFastForwardable)() + SetRepositoryRulePullRequest(value RepositoryRulePullRequestable)() + SetRepositoryRuleRepositoryRuleBranchNamePattern(value RepositoryRuleBranchNamePatternable)() + SetRepositoryRuleRepositoryRuleBranchNamePattern0(value RepositoryRuleBranchNamePatternable)() + SetRepositoryRuleRepositoryRuleBranchNamePattern1(value RepositoryRuleBranchNamePatternable)() + SetRepositoryRuleRepositoryRuleBranchNamePattern2(value RepositoryRuleBranchNamePatternable)() + SetRepositoryRuleRepositoryRuleCodeScanning(value RepositoryRuleCodeScanningable)() + SetRepositoryRuleRepositoryRuleCodeScanning0(value RepositoryRuleCodeScanningable)() + SetRepositoryRuleRepositoryRuleCodeScanning1(value RepositoryRuleCodeScanningable)() + SetRepositoryRuleRepositoryRuleCodeScanning2(value RepositoryRuleCodeScanningable)() + SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern(value RepositoryRuleCommitAuthorEmailPatternable)() + SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern0(value RepositoryRuleCommitAuthorEmailPatternable)() + SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern1(value RepositoryRuleCommitAuthorEmailPatternable)() + SetRepositoryRuleRepositoryRuleCommitAuthorEmailPattern2(value RepositoryRuleCommitAuthorEmailPatternable)() + SetRepositoryRuleRepositoryRuleCommitMessagePattern(value RepositoryRuleCommitMessagePatternable)() + SetRepositoryRuleRepositoryRuleCommitMessagePattern0(value RepositoryRuleCommitMessagePatternable)() + SetRepositoryRuleRepositoryRuleCommitMessagePattern1(value RepositoryRuleCommitMessagePatternable)() + SetRepositoryRuleRepositoryRuleCommitMessagePattern2(value RepositoryRuleCommitMessagePatternable)() + SetRepositoryRuleRepositoryRuleCommitterEmailPattern(value RepositoryRuleCommitterEmailPatternable)() + SetRepositoryRuleRepositoryRuleCommitterEmailPattern0(value RepositoryRuleCommitterEmailPatternable)() + SetRepositoryRuleRepositoryRuleCommitterEmailPattern1(value RepositoryRuleCommitterEmailPatternable)() + SetRepositoryRuleRepositoryRuleCommitterEmailPattern2(value RepositoryRuleCommitterEmailPatternable)() + SetRepositoryRuleRepositoryRuleCreation(value RepositoryRuleCreationable)() + SetRepositoryRuleRepositoryRuleCreation0(value RepositoryRuleCreationable)() + SetRepositoryRuleRepositoryRuleCreation1(value RepositoryRuleCreationable)() + SetRepositoryRuleRepositoryRuleCreation2(value RepositoryRuleCreationable)() + SetRepositoryRuleRepositoryRuleDeletion(value RepositoryRuleDeletionable)() + SetRepositoryRuleRepositoryRuleDeletion0(value RepositoryRuleDeletionable)() + SetRepositoryRuleRepositoryRuleDeletion1(value RepositoryRuleDeletionable)() + SetRepositoryRuleRepositoryRuleDeletion2(value RepositoryRuleDeletionable)() + SetRepositoryRuleRepositoryRuleNonFastForward(value RepositoryRuleNonFastForwardable)() + SetRepositoryRuleRepositoryRuleNonFastForward0(value RepositoryRuleNonFastForwardable)() + SetRepositoryRuleRepositoryRuleNonFastForward1(value RepositoryRuleNonFastForwardable)() + SetRepositoryRuleRepositoryRuleNonFastForward2(value RepositoryRuleNonFastForwardable)() + SetRepositoryRuleRepositoryRulePullRequest(value RepositoryRulePullRequestable)() + SetRepositoryRuleRepositoryRulePullRequest0(value RepositoryRulePullRequestable)() + SetRepositoryRuleRepositoryRulePullRequest1(value RepositoryRulePullRequestable)() + SetRepositoryRuleRepositoryRulePullRequest2(value RepositoryRulePullRequestable)() + SetRepositoryRuleRepositoryRuleRequiredDeployments(value RepositoryRuleRequiredDeploymentsable)() + SetRepositoryRuleRepositoryRuleRequiredDeployments0(value RepositoryRuleRequiredDeploymentsable)() + SetRepositoryRuleRepositoryRuleRequiredDeployments1(value RepositoryRuleRequiredDeploymentsable)() + SetRepositoryRuleRepositoryRuleRequiredDeployments2(value RepositoryRuleRequiredDeploymentsable)() + SetRepositoryRuleRepositoryRuleRequiredLinearHistory(value RepositoryRuleRequiredLinearHistoryable)() + SetRepositoryRuleRepositoryRuleRequiredLinearHistory0(value RepositoryRuleRequiredLinearHistoryable)() + SetRepositoryRuleRepositoryRuleRequiredLinearHistory1(value RepositoryRuleRequiredLinearHistoryable)() + SetRepositoryRuleRepositoryRuleRequiredLinearHistory2(value RepositoryRuleRequiredLinearHistoryable)() + SetRepositoryRuleRepositoryRuleRequiredSignatures(value RepositoryRuleRequiredSignaturesable)() + SetRepositoryRuleRepositoryRuleRequiredSignatures0(value RepositoryRuleRequiredSignaturesable)() + SetRepositoryRuleRepositoryRuleRequiredSignatures1(value RepositoryRuleRequiredSignaturesable)() + SetRepositoryRuleRepositoryRuleRequiredSignatures2(value RepositoryRuleRequiredSignaturesable)() + SetRepositoryRuleRepositoryRuleRequiredStatusChecks(value RepositoryRuleRequiredStatusChecksable)() + SetRepositoryRuleRepositoryRuleRequiredStatusChecks0(value RepositoryRuleRequiredStatusChecksable)() + SetRepositoryRuleRepositoryRuleRequiredStatusChecks1(value RepositoryRuleRequiredStatusChecksable)() + SetRepositoryRuleRepositoryRuleRequiredStatusChecks2(value RepositoryRuleRequiredStatusChecksable)() + SetRepositoryRuleRepositoryRuleTagNamePattern(value RepositoryRuleTagNamePatternable)() + SetRepositoryRuleRepositoryRuleTagNamePattern0(value RepositoryRuleTagNamePatternable)() + SetRepositoryRuleRepositoryRuleTagNamePattern1(value RepositoryRuleTagNamePatternable)() + SetRepositoryRuleRepositoryRuleTagNamePattern2(value RepositoryRuleTagNamePatternable)() + SetRepositoryRuleRepositoryRuleUpdate(value RepositoryRuleUpdateable)() + SetRepositoryRuleRepositoryRuleUpdate0(value RepositoryRuleUpdateable)() + SetRepositoryRuleRepositoryRuleUpdate1(value RepositoryRuleUpdateable)() + SetRepositoryRuleRepositoryRuleUpdate2(value RepositoryRuleUpdateable)() + SetRepositoryRuleRepositoryRuleWorkflows(value RepositoryRuleWorkflowsable)() + SetRepositoryRuleRepositoryRuleWorkflows0(value RepositoryRuleWorkflowsable)() + SetRepositoryRuleRepositoryRuleWorkflows1(value RepositoryRuleWorkflowsable)() + SetRepositoryRuleRepositoryRuleWorkflows2(value RepositoryRuleWorkflowsable)() + SetRepositoryRuleRequiredDeployments(value RepositoryRuleRequiredDeploymentsable)() + SetRepositoryRuleRequiredLinearHistory(value RepositoryRuleRequiredLinearHistoryable)() + SetRepositoryRuleRequiredSignatures(value RepositoryRuleRequiredSignaturesable)() + SetRepositoryRuleRequiredStatusChecks(value RepositoryRuleRequiredStatusChecksable)() + SetRepositoryRuleTagNamePattern(value RepositoryRuleTagNamePatternable)() + SetRepositoryRuleUpdate(value RepositoryRuleUpdateable)() + SetRepositoryRuleWorkflows(value RepositoryRuleWorkflowsable)() +} diff --git a/pkg/github/models/repository_rule_branch_name_pattern.go b/pkg/github/models/repository_rule_branch_name_pattern.go new file mode 100644 index 00000000..20ca9fa5 --- /dev/null +++ b/pkg/github/models/repository_rule_branch_name_pattern.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleBranchNamePattern parameters to be used for the branch_name_pattern rule +type RepositoryRuleBranchNamePattern 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 parameters property + parameters RepositoryRuleBranchNamePattern_parametersable + // The type property + typeEscaped *RepositoryRuleBranchNamePattern_type +} +// NewRepositoryRuleBranchNamePattern instantiates a new RepositoryRuleBranchNamePattern and sets the default values. +func NewRepositoryRuleBranchNamePattern()(*RepositoryRuleBranchNamePattern) { + m := &RepositoryRuleBranchNamePattern{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleBranchNamePatternFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleBranchNamePatternFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleBranchNamePattern(), 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 *RepositoryRuleBranchNamePattern) 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 *RepositoryRuleBranchNamePattern) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleBranchNamePattern_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleBranchNamePattern_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleBranchNamePattern_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleBranchNamePattern_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleBranchNamePattern_parametersable when successful +func (m *RepositoryRuleBranchNamePattern) GetParameters()(RepositoryRuleBranchNamePattern_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleBranchNamePattern_type when successful +func (m *RepositoryRuleBranchNamePattern) GetTypeEscaped()(*RepositoryRuleBranchNamePattern_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleBranchNamePattern) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleBranchNamePattern) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleBranchNamePattern) SetParameters(value RepositoryRuleBranchNamePattern_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleBranchNamePattern) SetTypeEscaped(value *RepositoryRuleBranchNamePattern_type)() { + m.typeEscaped = value +} +type RepositoryRuleBranchNamePatternable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleBranchNamePattern_parametersable) + GetTypeEscaped()(*RepositoryRuleBranchNamePattern_type) + SetParameters(value RepositoryRuleBranchNamePattern_parametersable)() + SetTypeEscaped(value *RepositoryRuleBranchNamePattern_type)() +} diff --git a/pkg/github/models/repository_rule_branch_name_pattern_escaped_parameters.go b/pkg/github/models/repository_rule_branch_name_pattern_escaped_parameters.go new file mode 100644 index 00000000..498b7fec --- /dev/null +++ b/pkg/github/models/repository_rule_branch_name_pattern_escaped_parameters.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleBranchNamePattern_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 + // How this rule will appear to users. + name *string + // If true, the rule will fail if the pattern matches. + negate *bool + // The operator to use for matching. + operator *RepositoryRuleBranchNamePattern_parameters_operator + // The pattern to match with. + pattern *string +} +// NewRepositoryRuleBranchNamePattern_parameters instantiates a new RepositoryRuleBranchNamePattern_parameters and sets the default values. +func NewRepositoryRuleBranchNamePattern_parameters()(*RepositoryRuleBranchNamePattern_parameters) { + m := &RepositoryRuleBranchNamePattern_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleBranchNamePattern_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleBranchNamePattern_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleBranchNamePattern_parameters(), 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 *RepositoryRuleBranchNamePattern_parameters) 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 *RepositoryRuleBranchNamePattern_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["negate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetNegate(val) + } + return nil + } + res["operator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleBranchNamePattern_parameters_operator) + if err != nil { + return err + } + if val != nil { + m.SetOperator(val.(*RepositoryRuleBranchNamePattern_parameters_operator)) + } + return nil + } + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + return res +} +// GetName gets the name property value. How this rule will appear to users. +// returns a *string when successful +func (m *RepositoryRuleBranchNamePattern_parameters) GetName()(*string) { + return m.name +} +// GetNegate gets the negate property value. If true, the rule will fail if the pattern matches. +// returns a *bool when successful +func (m *RepositoryRuleBranchNamePattern_parameters) GetNegate()(*bool) { + return m.negate +} +// GetOperator gets the operator property value. The operator to use for matching. +// returns a *RepositoryRuleBranchNamePattern_parameters_operator when successful +func (m *RepositoryRuleBranchNamePattern_parameters) GetOperator()(*RepositoryRuleBranchNamePattern_parameters_operator) { + return m.operator +} +// GetPattern gets the pattern property value. The pattern to match with. +// returns a *string when successful +func (m *RepositoryRuleBranchNamePattern_parameters) GetPattern()(*string) { + return m.pattern +} +// Serialize serializes information the current object +func (m *RepositoryRuleBranchNamePattern_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("negate", m.GetNegate()) + if err != nil { + return err + } + } + if m.GetOperator() != nil { + cast := (*m.GetOperator()).String() + err := writer.WriteStringValue("operator", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + 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 *RepositoryRuleBranchNamePattern_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. How this rule will appear to users. +func (m *RepositoryRuleBranchNamePattern_parameters) SetName(value *string)() { + m.name = value +} +// SetNegate sets the negate property value. If true, the rule will fail if the pattern matches. +func (m *RepositoryRuleBranchNamePattern_parameters) SetNegate(value *bool)() { + m.negate = value +} +// SetOperator sets the operator property value. The operator to use for matching. +func (m *RepositoryRuleBranchNamePattern_parameters) SetOperator(value *RepositoryRuleBranchNamePattern_parameters_operator)() { + m.operator = value +} +// SetPattern sets the pattern property value. The pattern to match with. +func (m *RepositoryRuleBranchNamePattern_parameters) SetPattern(value *string)() { + m.pattern = value +} +type RepositoryRuleBranchNamePattern_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetNegate()(*bool) + GetOperator()(*RepositoryRuleBranchNamePattern_parameters_operator) + GetPattern()(*string) + SetName(value *string)() + SetNegate(value *bool)() + SetOperator(value *RepositoryRuleBranchNamePattern_parameters_operator)() + SetPattern(value *string)() +} diff --git a/pkg/github/models/repository_rule_branch_name_pattern_escaped_parameters_escaped_operator.go b/pkg/github/models/repository_rule_branch_name_pattern_escaped_parameters_escaped_operator.go new file mode 100644 index 00000000..e4706d19 --- /dev/null +++ b/pkg/github/models/repository_rule_branch_name_pattern_escaped_parameters_escaped_operator.go @@ -0,0 +1,40 @@ +package models +// The operator to use for matching. +type RepositoryRuleBranchNamePattern_parameters_operator int + +const ( + STARTS_WITH_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR RepositoryRuleBranchNamePattern_parameters_operator = iota + ENDS_WITH_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR + CONTAINS_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR + REGEX_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR +) + +func (i RepositoryRuleBranchNamePattern_parameters_operator) String() string { + return []string{"starts_with", "ends_with", "contains", "regex"}[i] +} +func ParseRepositoryRuleBranchNamePattern_parameters_operator(v string) (any, error) { + result := STARTS_WITH_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR + switch v { + case "starts_with": + result = STARTS_WITH_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR + case "ends_with": + result = ENDS_WITH_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR + case "contains": + result = CONTAINS_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR + case "regex": + result = REGEX_REPOSITORYRULEBRANCHNAMEPATTERN_PARAMETERS_OPERATOR + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleBranchNamePattern_parameters_operator(values []RepositoryRuleBranchNamePattern_parameters_operator) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleBranchNamePattern_parameters_operator) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_branch_name_pattern_escaped_type.go b/pkg/github/models/repository_rule_branch_name_pattern_escaped_type.go new file mode 100644 index 00000000..77546287 --- /dev/null +++ b/pkg/github/models/repository_rule_branch_name_pattern_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleBranchNamePattern_type int + +const ( + BRANCH_NAME_PATTERN_REPOSITORYRULEBRANCHNAMEPATTERN_TYPE RepositoryRuleBranchNamePattern_type = iota +) + +func (i RepositoryRuleBranchNamePattern_type) String() string { + return []string{"branch_name_pattern"}[i] +} +func ParseRepositoryRuleBranchNamePattern_type(v string) (any, error) { + result := BRANCH_NAME_PATTERN_REPOSITORYRULEBRANCHNAMEPATTERN_TYPE + switch v { + case "branch_name_pattern": + result = BRANCH_NAME_PATTERN_REPOSITORYRULEBRANCHNAMEPATTERN_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleBranchNamePattern_type(values []RepositoryRuleBranchNamePattern_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleBranchNamePattern_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_code_scanning.go b/pkg/github/models/repository_rule_code_scanning.go new file mode 100644 index 00000000..c2bce2d4 --- /dev/null +++ b/pkg/github/models/repository_rule_code_scanning.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleCodeScanning choose which tools must provide code scanning results before the reference is updated. When configured, code scanning must be enabled and have results for both the commit and the reference being updated. +type RepositoryRuleCodeScanning 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 parameters property + parameters RepositoryRuleCodeScanning_parametersable + // The type property + typeEscaped *RepositoryRuleCodeScanning_type +} +// NewRepositoryRuleCodeScanning instantiates a new RepositoryRuleCodeScanning and sets the default values. +func NewRepositoryRuleCodeScanning()(*RepositoryRuleCodeScanning) { + m := &RepositoryRuleCodeScanning{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCodeScanningFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCodeScanningFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCodeScanning(), 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 *RepositoryRuleCodeScanning) 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 *RepositoryRuleCodeScanning) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleCodeScanning_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleCodeScanning_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCodeScanning_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleCodeScanning_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleCodeScanning_parametersable when successful +func (m *RepositoryRuleCodeScanning) GetParameters()(RepositoryRuleCodeScanning_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleCodeScanning_type when successful +func (m *RepositoryRuleCodeScanning) GetTypeEscaped()(*RepositoryRuleCodeScanning_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleCodeScanning) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleCodeScanning) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleCodeScanning) SetParameters(value RepositoryRuleCodeScanning_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleCodeScanning) SetTypeEscaped(value *RepositoryRuleCodeScanning_type)() { + m.typeEscaped = value +} +type RepositoryRuleCodeScanningable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleCodeScanning_parametersable) + GetTypeEscaped()(*RepositoryRuleCodeScanning_type) + SetParameters(value RepositoryRuleCodeScanning_parametersable)() + SetTypeEscaped(value *RepositoryRuleCodeScanning_type)() +} diff --git a/pkg/github/models/repository_rule_code_scanning_escaped_parameters.go b/pkg/github/models/repository_rule_code_scanning_escaped_parameters.go new file mode 100644 index 00000000..f43a8765 --- /dev/null +++ b/pkg/github/models/repository_rule_code_scanning_escaped_parameters.go @@ -0,0 +1,92 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleCodeScanning_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 + // Tools that must provide code scanning results for this rule to pass. + code_scanning_tools []RepositoryRuleParamsCodeScanningToolable +} +// NewRepositoryRuleCodeScanning_parameters instantiates a new RepositoryRuleCodeScanning_parameters and sets the default values. +func NewRepositoryRuleCodeScanning_parameters()(*RepositoryRuleCodeScanning_parameters) { + m := &RepositoryRuleCodeScanning_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCodeScanning_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCodeScanning_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCodeScanning_parameters(), 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 *RepositoryRuleCodeScanning_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCodeScanningTools gets the code_scanning_tools property value. Tools that must provide code scanning results for this rule to pass. +// returns a []RepositoryRuleParamsCodeScanningToolable when successful +func (m *RepositoryRuleCodeScanning_parameters) GetCodeScanningTools()([]RepositoryRuleParamsCodeScanningToolable) { + return m.code_scanning_tools +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleCodeScanning_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["code_scanning_tools"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryRuleParamsCodeScanningToolFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryRuleParamsCodeScanningToolable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryRuleParamsCodeScanningToolable) + } + } + m.SetCodeScanningTools(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *RepositoryRuleCodeScanning_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCodeScanningTools() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCodeScanningTools())) + for i, v := range m.GetCodeScanningTools() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("code_scanning_tools", 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 *RepositoryRuleCodeScanning_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCodeScanningTools sets the code_scanning_tools property value. Tools that must provide code scanning results for this rule to pass. +func (m *RepositoryRuleCodeScanning_parameters) SetCodeScanningTools(value []RepositoryRuleParamsCodeScanningToolable)() { + m.code_scanning_tools = value +} +type RepositoryRuleCodeScanning_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCodeScanningTools()([]RepositoryRuleParamsCodeScanningToolable) + SetCodeScanningTools(value []RepositoryRuleParamsCodeScanningToolable)() +} diff --git a/pkg/github/models/repository_rule_code_scanning_escaped_type.go b/pkg/github/models/repository_rule_code_scanning_escaped_type.go new file mode 100644 index 00000000..dc5b7cf5 --- /dev/null +++ b/pkg/github/models/repository_rule_code_scanning_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleCodeScanning_type int + +const ( + CODE_SCANNING_REPOSITORYRULECODESCANNING_TYPE RepositoryRuleCodeScanning_type = iota +) + +func (i RepositoryRuleCodeScanning_type) String() string { + return []string{"code_scanning"}[i] +} +func ParseRepositoryRuleCodeScanning_type(v string) (any, error) { + result := CODE_SCANNING_REPOSITORYRULECODESCANNING_TYPE + switch v { + case "code_scanning": + result = CODE_SCANNING_REPOSITORYRULECODESCANNING_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleCodeScanning_type(values []RepositoryRuleCodeScanning_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCodeScanning_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_commit_author_email_pattern.go b/pkg/github/models/repository_rule_commit_author_email_pattern.go new file mode 100644 index 00000000..5d0729e9 --- /dev/null +++ b/pkg/github/models/repository_rule_commit_author_email_pattern.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleCommitAuthorEmailPattern parameters to be used for the commit_author_email_pattern rule +type RepositoryRuleCommitAuthorEmailPattern 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 parameters property + parameters RepositoryRuleCommitAuthorEmailPattern_parametersable + // The type property + typeEscaped *RepositoryRuleCommitAuthorEmailPattern_type +} +// NewRepositoryRuleCommitAuthorEmailPattern instantiates a new RepositoryRuleCommitAuthorEmailPattern and sets the default values. +func NewRepositoryRuleCommitAuthorEmailPattern()(*RepositoryRuleCommitAuthorEmailPattern) { + m := &RepositoryRuleCommitAuthorEmailPattern{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCommitAuthorEmailPatternFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCommitAuthorEmailPatternFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCommitAuthorEmailPattern(), 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 *RepositoryRuleCommitAuthorEmailPattern) 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 *RepositoryRuleCommitAuthorEmailPattern) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleCommitAuthorEmailPattern_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleCommitAuthorEmailPattern_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCommitAuthorEmailPattern_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleCommitAuthorEmailPattern_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleCommitAuthorEmailPattern_parametersable when successful +func (m *RepositoryRuleCommitAuthorEmailPattern) GetParameters()(RepositoryRuleCommitAuthorEmailPattern_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleCommitAuthorEmailPattern_type when successful +func (m *RepositoryRuleCommitAuthorEmailPattern) GetTypeEscaped()(*RepositoryRuleCommitAuthorEmailPattern_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleCommitAuthorEmailPattern) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleCommitAuthorEmailPattern) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleCommitAuthorEmailPattern) SetParameters(value RepositoryRuleCommitAuthorEmailPattern_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleCommitAuthorEmailPattern) SetTypeEscaped(value *RepositoryRuleCommitAuthorEmailPattern_type)() { + m.typeEscaped = value +} +type RepositoryRuleCommitAuthorEmailPatternable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleCommitAuthorEmailPattern_parametersable) + GetTypeEscaped()(*RepositoryRuleCommitAuthorEmailPattern_type) + SetParameters(value RepositoryRuleCommitAuthorEmailPattern_parametersable)() + SetTypeEscaped(value *RepositoryRuleCommitAuthorEmailPattern_type)() +} diff --git a/pkg/github/models/repository_rule_commit_author_email_pattern_escaped_parameters.go b/pkg/github/models/repository_rule_commit_author_email_pattern_escaped_parameters.go new file mode 100644 index 00000000..5787db7b --- /dev/null +++ b/pkg/github/models/repository_rule_commit_author_email_pattern_escaped_parameters.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleCommitAuthorEmailPattern_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 + // How this rule will appear to users. + name *string + // If true, the rule will fail if the pattern matches. + negate *bool + // The operator to use for matching. + operator *RepositoryRuleCommitAuthorEmailPattern_parameters_operator + // The pattern to match with. + pattern *string +} +// NewRepositoryRuleCommitAuthorEmailPattern_parameters instantiates a new RepositoryRuleCommitAuthorEmailPattern_parameters and sets the default values. +func NewRepositoryRuleCommitAuthorEmailPattern_parameters()(*RepositoryRuleCommitAuthorEmailPattern_parameters) { + m := &RepositoryRuleCommitAuthorEmailPattern_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCommitAuthorEmailPattern_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCommitAuthorEmailPattern_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCommitAuthorEmailPattern_parameters(), 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 *RepositoryRuleCommitAuthorEmailPattern_parameters) 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 *RepositoryRuleCommitAuthorEmailPattern_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["negate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetNegate(val) + } + return nil + } + res["operator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCommitAuthorEmailPattern_parameters_operator) + if err != nil { + return err + } + if val != nil { + m.SetOperator(val.(*RepositoryRuleCommitAuthorEmailPattern_parameters_operator)) + } + return nil + } + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + return res +} +// GetName gets the name property value. How this rule will appear to users. +// returns a *string when successful +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) GetName()(*string) { + return m.name +} +// GetNegate gets the negate property value. If true, the rule will fail if the pattern matches. +// returns a *bool when successful +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) GetNegate()(*bool) { + return m.negate +} +// GetOperator gets the operator property value. The operator to use for matching. +// returns a *RepositoryRuleCommitAuthorEmailPattern_parameters_operator when successful +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) GetOperator()(*RepositoryRuleCommitAuthorEmailPattern_parameters_operator) { + return m.operator +} +// GetPattern gets the pattern property value. The pattern to match with. +// returns a *string when successful +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) GetPattern()(*string) { + return m.pattern +} +// Serialize serializes information the current object +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("negate", m.GetNegate()) + if err != nil { + return err + } + } + if m.GetOperator() != nil { + cast := (*m.GetOperator()).String() + err := writer.WriteStringValue("operator", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + 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 *RepositoryRuleCommitAuthorEmailPattern_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. How this rule will appear to users. +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) SetName(value *string)() { + m.name = value +} +// SetNegate sets the negate property value. If true, the rule will fail if the pattern matches. +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) SetNegate(value *bool)() { + m.negate = value +} +// SetOperator sets the operator property value. The operator to use for matching. +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) SetOperator(value *RepositoryRuleCommitAuthorEmailPattern_parameters_operator)() { + m.operator = value +} +// SetPattern sets the pattern property value. The pattern to match with. +func (m *RepositoryRuleCommitAuthorEmailPattern_parameters) SetPattern(value *string)() { + m.pattern = value +} +type RepositoryRuleCommitAuthorEmailPattern_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetNegate()(*bool) + GetOperator()(*RepositoryRuleCommitAuthorEmailPattern_parameters_operator) + GetPattern()(*string) + SetName(value *string)() + SetNegate(value *bool)() + SetOperator(value *RepositoryRuleCommitAuthorEmailPattern_parameters_operator)() + SetPattern(value *string)() +} diff --git a/pkg/github/models/repository_rule_commit_author_email_pattern_escaped_parameters_escaped_operator.go b/pkg/github/models/repository_rule_commit_author_email_pattern_escaped_parameters_escaped_operator.go new file mode 100644 index 00000000..ca107f96 --- /dev/null +++ b/pkg/github/models/repository_rule_commit_author_email_pattern_escaped_parameters_escaped_operator.go @@ -0,0 +1,40 @@ +package models +// The operator to use for matching. +type RepositoryRuleCommitAuthorEmailPattern_parameters_operator int + +const ( + STARTS_WITH_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR RepositoryRuleCommitAuthorEmailPattern_parameters_operator = iota + ENDS_WITH_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR + CONTAINS_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR + REGEX_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR +) + +func (i RepositoryRuleCommitAuthorEmailPattern_parameters_operator) String() string { + return []string{"starts_with", "ends_with", "contains", "regex"}[i] +} +func ParseRepositoryRuleCommitAuthorEmailPattern_parameters_operator(v string) (any, error) { + result := STARTS_WITH_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR + switch v { + case "starts_with": + result = STARTS_WITH_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR + case "ends_with": + result = ENDS_WITH_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR + case "contains": + result = CONTAINS_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR + case "regex": + result = REGEX_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_PARAMETERS_OPERATOR + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleCommitAuthorEmailPattern_parameters_operator(values []RepositoryRuleCommitAuthorEmailPattern_parameters_operator) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCommitAuthorEmailPattern_parameters_operator) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_commit_author_email_pattern_escaped_type.go b/pkg/github/models/repository_rule_commit_author_email_pattern_escaped_type.go new file mode 100644 index 00000000..17da5735 --- /dev/null +++ b/pkg/github/models/repository_rule_commit_author_email_pattern_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleCommitAuthorEmailPattern_type int + +const ( + COMMIT_AUTHOR_EMAIL_PATTERN_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_TYPE RepositoryRuleCommitAuthorEmailPattern_type = iota +) + +func (i RepositoryRuleCommitAuthorEmailPattern_type) String() string { + return []string{"commit_author_email_pattern"}[i] +} +func ParseRepositoryRuleCommitAuthorEmailPattern_type(v string) (any, error) { + result := COMMIT_AUTHOR_EMAIL_PATTERN_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_TYPE + switch v { + case "commit_author_email_pattern": + result = COMMIT_AUTHOR_EMAIL_PATTERN_REPOSITORYRULECOMMITAUTHOREMAILPATTERN_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleCommitAuthorEmailPattern_type(values []RepositoryRuleCommitAuthorEmailPattern_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCommitAuthorEmailPattern_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_commit_message_pattern.go b/pkg/github/models/repository_rule_commit_message_pattern.go new file mode 100644 index 00000000..da8d458b --- /dev/null +++ b/pkg/github/models/repository_rule_commit_message_pattern.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleCommitMessagePattern parameters to be used for the commit_message_pattern rule +type RepositoryRuleCommitMessagePattern 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 parameters property + parameters RepositoryRuleCommitMessagePattern_parametersable + // The type property + typeEscaped *RepositoryRuleCommitMessagePattern_type +} +// NewRepositoryRuleCommitMessagePattern instantiates a new RepositoryRuleCommitMessagePattern and sets the default values. +func NewRepositoryRuleCommitMessagePattern()(*RepositoryRuleCommitMessagePattern) { + m := &RepositoryRuleCommitMessagePattern{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCommitMessagePatternFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCommitMessagePatternFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCommitMessagePattern(), 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 *RepositoryRuleCommitMessagePattern) 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 *RepositoryRuleCommitMessagePattern) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleCommitMessagePattern_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleCommitMessagePattern_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCommitMessagePattern_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleCommitMessagePattern_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleCommitMessagePattern_parametersable when successful +func (m *RepositoryRuleCommitMessagePattern) GetParameters()(RepositoryRuleCommitMessagePattern_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleCommitMessagePattern_type when successful +func (m *RepositoryRuleCommitMessagePattern) GetTypeEscaped()(*RepositoryRuleCommitMessagePattern_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleCommitMessagePattern) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleCommitMessagePattern) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleCommitMessagePattern) SetParameters(value RepositoryRuleCommitMessagePattern_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleCommitMessagePattern) SetTypeEscaped(value *RepositoryRuleCommitMessagePattern_type)() { + m.typeEscaped = value +} +type RepositoryRuleCommitMessagePatternable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleCommitMessagePattern_parametersable) + GetTypeEscaped()(*RepositoryRuleCommitMessagePattern_type) + SetParameters(value RepositoryRuleCommitMessagePattern_parametersable)() + SetTypeEscaped(value *RepositoryRuleCommitMessagePattern_type)() +} diff --git a/pkg/github/models/repository_rule_commit_message_pattern_escaped_parameters.go b/pkg/github/models/repository_rule_commit_message_pattern_escaped_parameters.go new file mode 100644 index 00000000..5dfeb80f --- /dev/null +++ b/pkg/github/models/repository_rule_commit_message_pattern_escaped_parameters.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleCommitMessagePattern_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 + // How this rule will appear to users. + name *string + // If true, the rule will fail if the pattern matches. + negate *bool + // The operator to use for matching. + operator *RepositoryRuleCommitMessagePattern_parameters_operator + // The pattern to match with. + pattern *string +} +// NewRepositoryRuleCommitMessagePattern_parameters instantiates a new RepositoryRuleCommitMessagePattern_parameters and sets the default values. +func NewRepositoryRuleCommitMessagePattern_parameters()(*RepositoryRuleCommitMessagePattern_parameters) { + m := &RepositoryRuleCommitMessagePattern_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCommitMessagePattern_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCommitMessagePattern_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCommitMessagePattern_parameters(), 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 *RepositoryRuleCommitMessagePattern_parameters) 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 *RepositoryRuleCommitMessagePattern_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["negate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetNegate(val) + } + return nil + } + res["operator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCommitMessagePattern_parameters_operator) + if err != nil { + return err + } + if val != nil { + m.SetOperator(val.(*RepositoryRuleCommitMessagePattern_parameters_operator)) + } + return nil + } + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + return res +} +// GetName gets the name property value. How this rule will appear to users. +// returns a *string when successful +func (m *RepositoryRuleCommitMessagePattern_parameters) GetName()(*string) { + return m.name +} +// GetNegate gets the negate property value. If true, the rule will fail if the pattern matches. +// returns a *bool when successful +func (m *RepositoryRuleCommitMessagePattern_parameters) GetNegate()(*bool) { + return m.negate +} +// GetOperator gets the operator property value. The operator to use for matching. +// returns a *RepositoryRuleCommitMessagePattern_parameters_operator when successful +func (m *RepositoryRuleCommitMessagePattern_parameters) GetOperator()(*RepositoryRuleCommitMessagePattern_parameters_operator) { + return m.operator +} +// GetPattern gets the pattern property value. The pattern to match with. +// returns a *string when successful +func (m *RepositoryRuleCommitMessagePattern_parameters) GetPattern()(*string) { + return m.pattern +} +// Serialize serializes information the current object +func (m *RepositoryRuleCommitMessagePattern_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("negate", m.GetNegate()) + if err != nil { + return err + } + } + if m.GetOperator() != nil { + cast := (*m.GetOperator()).String() + err := writer.WriteStringValue("operator", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + 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 *RepositoryRuleCommitMessagePattern_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. How this rule will appear to users. +func (m *RepositoryRuleCommitMessagePattern_parameters) SetName(value *string)() { + m.name = value +} +// SetNegate sets the negate property value. If true, the rule will fail if the pattern matches. +func (m *RepositoryRuleCommitMessagePattern_parameters) SetNegate(value *bool)() { + m.negate = value +} +// SetOperator sets the operator property value. The operator to use for matching. +func (m *RepositoryRuleCommitMessagePattern_parameters) SetOperator(value *RepositoryRuleCommitMessagePattern_parameters_operator)() { + m.operator = value +} +// SetPattern sets the pattern property value. The pattern to match with. +func (m *RepositoryRuleCommitMessagePattern_parameters) SetPattern(value *string)() { + m.pattern = value +} +type RepositoryRuleCommitMessagePattern_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetNegate()(*bool) + GetOperator()(*RepositoryRuleCommitMessagePattern_parameters_operator) + GetPattern()(*string) + SetName(value *string)() + SetNegate(value *bool)() + SetOperator(value *RepositoryRuleCommitMessagePattern_parameters_operator)() + SetPattern(value *string)() +} diff --git a/pkg/github/models/repository_rule_commit_message_pattern_escaped_parameters_escaped_operator.go b/pkg/github/models/repository_rule_commit_message_pattern_escaped_parameters_escaped_operator.go new file mode 100644 index 00000000..54c8690f --- /dev/null +++ b/pkg/github/models/repository_rule_commit_message_pattern_escaped_parameters_escaped_operator.go @@ -0,0 +1,40 @@ +package models +// The operator to use for matching. +type RepositoryRuleCommitMessagePattern_parameters_operator int + +const ( + STARTS_WITH_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR RepositoryRuleCommitMessagePattern_parameters_operator = iota + ENDS_WITH_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR + CONTAINS_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR + REGEX_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR +) + +func (i RepositoryRuleCommitMessagePattern_parameters_operator) String() string { + return []string{"starts_with", "ends_with", "contains", "regex"}[i] +} +func ParseRepositoryRuleCommitMessagePattern_parameters_operator(v string) (any, error) { + result := STARTS_WITH_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR + switch v { + case "starts_with": + result = STARTS_WITH_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR + case "ends_with": + result = ENDS_WITH_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR + case "contains": + result = CONTAINS_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR + case "regex": + result = REGEX_REPOSITORYRULECOMMITMESSAGEPATTERN_PARAMETERS_OPERATOR + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleCommitMessagePattern_parameters_operator(values []RepositoryRuleCommitMessagePattern_parameters_operator) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCommitMessagePattern_parameters_operator) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_commit_message_pattern_escaped_type.go b/pkg/github/models/repository_rule_commit_message_pattern_escaped_type.go new file mode 100644 index 00000000..d9f33fc9 --- /dev/null +++ b/pkg/github/models/repository_rule_commit_message_pattern_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleCommitMessagePattern_type int + +const ( + COMMIT_MESSAGE_PATTERN_REPOSITORYRULECOMMITMESSAGEPATTERN_TYPE RepositoryRuleCommitMessagePattern_type = iota +) + +func (i RepositoryRuleCommitMessagePattern_type) String() string { + return []string{"commit_message_pattern"}[i] +} +func ParseRepositoryRuleCommitMessagePattern_type(v string) (any, error) { + result := COMMIT_MESSAGE_PATTERN_REPOSITORYRULECOMMITMESSAGEPATTERN_TYPE + switch v { + case "commit_message_pattern": + result = COMMIT_MESSAGE_PATTERN_REPOSITORYRULECOMMITMESSAGEPATTERN_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleCommitMessagePattern_type(values []RepositoryRuleCommitMessagePattern_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCommitMessagePattern_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_committer_email_pattern.go b/pkg/github/models/repository_rule_committer_email_pattern.go new file mode 100644 index 00000000..940cda69 --- /dev/null +++ b/pkg/github/models/repository_rule_committer_email_pattern.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleCommitterEmailPattern parameters to be used for the committer_email_pattern rule +type RepositoryRuleCommitterEmailPattern 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 parameters property + parameters RepositoryRuleCommitterEmailPattern_parametersable + // The type property + typeEscaped *RepositoryRuleCommitterEmailPattern_type +} +// NewRepositoryRuleCommitterEmailPattern instantiates a new RepositoryRuleCommitterEmailPattern and sets the default values. +func NewRepositoryRuleCommitterEmailPattern()(*RepositoryRuleCommitterEmailPattern) { + m := &RepositoryRuleCommitterEmailPattern{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCommitterEmailPatternFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCommitterEmailPatternFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCommitterEmailPattern(), 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 *RepositoryRuleCommitterEmailPattern) 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 *RepositoryRuleCommitterEmailPattern) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleCommitterEmailPattern_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleCommitterEmailPattern_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCommitterEmailPattern_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleCommitterEmailPattern_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleCommitterEmailPattern_parametersable when successful +func (m *RepositoryRuleCommitterEmailPattern) GetParameters()(RepositoryRuleCommitterEmailPattern_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleCommitterEmailPattern_type when successful +func (m *RepositoryRuleCommitterEmailPattern) GetTypeEscaped()(*RepositoryRuleCommitterEmailPattern_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleCommitterEmailPattern) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleCommitterEmailPattern) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleCommitterEmailPattern) SetParameters(value RepositoryRuleCommitterEmailPattern_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleCommitterEmailPattern) SetTypeEscaped(value *RepositoryRuleCommitterEmailPattern_type)() { + m.typeEscaped = value +} +type RepositoryRuleCommitterEmailPatternable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleCommitterEmailPattern_parametersable) + GetTypeEscaped()(*RepositoryRuleCommitterEmailPattern_type) + SetParameters(value RepositoryRuleCommitterEmailPattern_parametersable)() + SetTypeEscaped(value *RepositoryRuleCommitterEmailPattern_type)() +} diff --git a/pkg/github/models/repository_rule_committer_email_pattern_escaped_parameters.go b/pkg/github/models/repository_rule_committer_email_pattern_escaped_parameters.go new file mode 100644 index 00000000..59befb88 --- /dev/null +++ b/pkg/github/models/repository_rule_committer_email_pattern_escaped_parameters.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleCommitterEmailPattern_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 + // How this rule will appear to users. + name *string + // If true, the rule will fail if the pattern matches. + negate *bool + // The operator to use for matching. + operator *RepositoryRuleCommitterEmailPattern_parameters_operator + // The pattern to match with. + pattern *string +} +// NewRepositoryRuleCommitterEmailPattern_parameters instantiates a new RepositoryRuleCommitterEmailPattern_parameters and sets the default values. +func NewRepositoryRuleCommitterEmailPattern_parameters()(*RepositoryRuleCommitterEmailPattern_parameters) { + m := &RepositoryRuleCommitterEmailPattern_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCommitterEmailPattern_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCommitterEmailPattern_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCommitterEmailPattern_parameters(), 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 *RepositoryRuleCommitterEmailPattern_parameters) 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 *RepositoryRuleCommitterEmailPattern_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["negate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetNegate(val) + } + return nil + } + res["operator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCommitterEmailPattern_parameters_operator) + if err != nil { + return err + } + if val != nil { + m.SetOperator(val.(*RepositoryRuleCommitterEmailPattern_parameters_operator)) + } + return nil + } + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + return res +} +// GetName gets the name property value. How this rule will appear to users. +// returns a *string when successful +func (m *RepositoryRuleCommitterEmailPattern_parameters) GetName()(*string) { + return m.name +} +// GetNegate gets the negate property value. If true, the rule will fail if the pattern matches. +// returns a *bool when successful +func (m *RepositoryRuleCommitterEmailPattern_parameters) GetNegate()(*bool) { + return m.negate +} +// GetOperator gets the operator property value. The operator to use for matching. +// returns a *RepositoryRuleCommitterEmailPattern_parameters_operator when successful +func (m *RepositoryRuleCommitterEmailPattern_parameters) GetOperator()(*RepositoryRuleCommitterEmailPattern_parameters_operator) { + return m.operator +} +// GetPattern gets the pattern property value. The pattern to match with. +// returns a *string when successful +func (m *RepositoryRuleCommitterEmailPattern_parameters) GetPattern()(*string) { + return m.pattern +} +// Serialize serializes information the current object +func (m *RepositoryRuleCommitterEmailPattern_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("negate", m.GetNegate()) + if err != nil { + return err + } + } + if m.GetOperator() != nil { + cast := (*m.GetOperator()).String() + err := writer.WriteStringValue("operator", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + 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 *RepositoryRuleCommitterEmailPattern_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. How this rule will appear to users. +func (m *RepositoryRuleCommitterEmailPattern_parameters) SetName(value *string)() { + m.name = value +} +// SetNegate sets the negate property value. If true, the rule will fail if the pattern matches. +func (m *RepositoryRuleCommitterEmailPattern_parameters) SetNegate(value *bool)() { + m.negate = value +} +// SetOperator sets the operator property value. The operator to use for matching. +func (m *RepositoryRuleCommitterEmailPattern_parameters) SetOperator(value *RepositoryRuleCommitterEmailPattern_parameters_operator)() { + m.operator = value +} +// SetPattern sets the pattern property value. The pattern to match with. +func (m *RepositoryRuleCommitterEmailPattern_parameters) SetPattern(value *string)() { + m.pattern = value +} +type RepositoryRuleCommitterEmailPattern_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetNegate()(*bool) + GetOperator()(*RepositoryRuleCommitterEmailPattern_parameters_operator) + GetPattern()(*string) + SetName(value *string)() + SetNegate(value *bool)() + SetOperator(value *RepositoryRuleCommitterEmailPattern_parameters_operator)() + SetPattern(value *string)() +} diff --git a/pkg/github/models/repository_rule_committer_email_pattern_escaped_parameters_escaped_operator.go b/pkg/github/models/repository_rule_committer_email_pattern_escaped_parameters_escaped_operator.go new file mode 100644 index 00000000..c7f94eb6 --- /dev/null +++ b/pkg/github/models/repository_rule_committer_email_pattern_escaped_parameters_escaped_operator.go @@ -0,0 +1,40 @@ +package models +// The operator to use for matching. +type RepositoryRuleCommitterEmailPattern_parameters_operator int + +const ( + STARTS_WITH_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR RepositoryRuleCommitterEmailPattern_parameters_operator = iota + ENDS_WITH_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR + CONTAINS_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR + REGEX_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR +) + +func (i RepositoryRuleCommitterEmailPattern_parameters_operator) String() string { + return []string{"starts_with", "ends_with", "contains", "regex"}[i] +} +func ParseRepositoryRuleCommitterEmailPattern_parameters_operator(v string) (any, error) { + result := STARTS_WITH_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR + switch v { + case "starts_with": + result = STARTS_WITH_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR + case "ends_with": + result = ENDS_WITH_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR + case "contains": + result = CONTAINS_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR + case "regex": + result = REGEX_REPOSITORYRULECOMMITTEREMAILPATTERN_PARAMETERS_OPERATOR + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleCommitterEmailPattern_parameters_operator(values []RepositoryRuleCommitterEmailPattern_parameters_operator) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCommitterEmailPattern_parameters_operator) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_committer_email_pattern_escaped_type.go b/pkg/github/models/repository_rule_committer_email_pattern_escaped_type.go new file mode 100644 index 00000000..c341e17f --- /dev/null +++ b/pkg/github/models/repository_rule_committer_email_pattern_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleCommitterEmailPattern_type int + +const ( + COMMITTER_EMAIL_PATTERN_REPOSITORYRULECOMMITTEREMAILPATTERN_TYPE RepositoryRuleCommitterEmailPattern_type = iota +) + +func (i RepositoryRuleCommitterEmailPattern_type) String() string { + return []string{"committer_email_pattern"}[i] +} +func ParseRepositoryRuleCommitterEmailPattern_type(v string) (any, error) { + result := COMMITTER_EMAIL_PATTERN_REPOSITORYRULECOMMITTEREMAILPATTERN_TYPE + switch v { + case "committer_email_pattern": + result = COMMITTER_EMAIL_PATTERN_REPOSITORYRULECOMMITTEREMAILPATTERN_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleCommitterEmailPattern_type(values []RepositoryRuleCommitterEmailPattern_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCommitterEmailPattern_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_creation.go b/pkg/github/models/repository_rule_creation.go new file mode 100644 index 00000000..04939015 --- /dev/null +++ b/pkg/github/models/repository_rule_creation.go @@ -0,0 +1,82 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleCreation only allow users with bypass permission to create matching refs. +type RepositoryRuleCreation 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 type property + typeEscaped *RepositoryRuleCreation_type +} +// NewRepositoryRuleCreation instantiates a new RepositoryRuleCreation and sets the default values. +func NewRepositoryRuleCreation()(*RepositoryRuleCreation) { + m := &RepositoryRuleCreation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleCreationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleCreationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleCreation(), 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 *RepositoryRuleCreation) 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 *RepositoryRuleCreation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleCreation_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleCreation_type)) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleCreation_type when successful +func (m *RepositoryRuleCreation) GetTypeEscaped()(*RepositoryRuleCreation_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleCreation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleCreation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleCreation) SetTypeEscaped(value *RepositoryRuleCreation_type)() { + m.typeEscaped = value +} +type RepositoryRuleCreationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*RepositoryRuleCreation_type) + SetTypeEscaped(value *RepositoryRuleCreation_type)() +} diff --git a/pkg/github/models/repository_rule_creation_escaped_type.go b/pkg/github/models/repository_rule_creation_escaped_type.go new file mode 100644 index 00000000..67c4bec9 --- /dev/null +++ b/pkg/github/models/repository_rule_creation_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleCreation_type int + +const ( + CREATION_REPOSITORYRULECREATION_TYPE RepositoryRuleCreation_type = iota +) + +func (i RepositoryRuleCreation_type) String() string { + return []string{"creation"}[i] +} +func ParseRepositoryRuleCreation_type(v string) (any, error) { + result := CREATION_REPOSITORYRULECREATION_TYPE + switch v { + case "creation": + result = CREATION_REPOSITORYRULECREATION_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleCreation_type(values []RepositoryRuleCreation_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleCreation_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_deletion.go b/pkg/github/models/repository_rule_deletion.go new file mode 100644 index 00000000..2fcc1e64 --- /dev/null +++ b/pkg/github/models/repository_rule_deletion.go @@ -0,0 +1,82 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleDeletion only allow users with bypass permissions to delete matching refs. +type RepositoryRuleDeletion 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 type property + typeEscaped *RepositoryRuleDeletion_type +} +// NewRepositoryRuleDeletion instantiates a new RepositoryRuleDeletion and sets the default values. +func NewRepositoryRuleDeletion()(*RepositoryRuleDeletion) { + m := &RepositoryRuleDeletion{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleDeletionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleDeletionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleDeletion(), 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 *RepositoryRuleDeletion) 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 *RepositoryRuleDeletion) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleDeletion_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleDeletion_type)) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleDeletion_type when successful +func (m *RepositoryRuleDeletion) GetTypeEscaped()(*RepositoryRuleDeletion_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleDeletion) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleDeletion) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleDeletion) SetTypeEscaped(value *RepositoryRuleDeletion_type)() { + m.typeEscaped = value +} +type RepositoryRuleDeletionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*RepositoryRuleDeletion_type) + SetTypeEscaped(value *RepositoryRuleDeletion_type)() +} diff --git a/pkg/github/models/repository_rule_deletion_escaped_type.go b/pkg/github/models/repository_rule_deletion_escaped_type.go new file mode 100644 index 00000000..541bd6d2 --- /dev/null +++ b/pkg/github/models/repository_rule_deletion_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleDeletion_type int + +const ( + DELETION_REPOSITORYRULEDELETION_TYPE RepositoryRuleDeletion_type = iota +) + +func (i RepositoryRuleDeletion_type) String() string { + return []string{"deletion"}[i] +} +func ParseRepositoryRuleDeletion_type(v string) (any, error) { + result := DELETION_REPOSITORYRULEDELETION_TYPE + switch v { + case "deletion": + result = DELETION_REPOSITORYRULEDELETION_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleDeletion_type(values []RepositoryRuleDeletion_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleDeletion_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_detailed.go b/pkg/github/models/repository_rule_detailed.go new file mode 100644 index 00000000..30252c32 --- /dev/null +++ b/pkg/github/models/repository_rule_detailed.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleDetailed a repository rule with ruleset details. +type RepositoryRuleDetailed struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewRepositoryRuleDetailed instantiates a new RepositoryRuleDetailed and sets the default values. +func NewRepositoryRuleDetailed()(*RepositoryRuleDetailed) { + m := &RepositoryRuleDetailed{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleDetailedFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleDetailedFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleDetailed(), 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 *RepositoryRuleDetailed) 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 *RepositoryRuleDetailed) 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 *RepositoryRuleDetailed) 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 *RepositoryRuleDetailed) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type RepositoryRuleDetailedable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/repository_rule_enforcement.go b/pkg/github/models/repository_rule_enforcement.go new file mode 100644 index 00000000..49cddd7b --- /dev/null +++ b/pkg/github/models/repository_rule_enforcement.go @@ -0,0 +1,37 @@ +package models +// The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page. +type RepositoryRuleEnforcement int + +const ( + DISABLED_REPOSITORYRULEENFORCEMENT RepositoryRuleEnforcement = iota + ACTIVE_REPOSITORYRULEENFORCEMENT + EVALUATE_REPOSITORYRULEENFORCEMENT +) + +func (i RepositoryRuleEnforcement) String() string { + return []string{"disabled", "active", "evaluate"}[i] +} +func ParseRepositoryRuleEnforcement(v string) (any, error) { + result := DISABLED_REPOSITORYRULEENFORCEMENT + switch v { + case "disabled": + result = DISABLED_REPOSITORYRULEENFORCEMENT + case "active": + result = ACTIVE_REPOSITORYRULEENFORCEMENT + case "evaluate": + result = EVALUATE_REPOSITORYRULEENFORCEMENT + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleEnforcement(values []RepositoryRuleEnforcement) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleEnforcement) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_non_fast_forward.go b/pkg/github/models/repository_rule_non_fast_forward.go new file mode 100644 index 00000000..ca1a992c --- /dev/null +++ b/pkg/github/models/repository_rule_non_fast_forward.go @@ -0,0 +1,82 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleNonFastForward prevent users with push access from force pushing to refs. +type RepositoryRuleNonFastForward 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 type property + typeEscaped *RepositoryRuleNonFastForward_type +} +// NewRepositoryRuleNonFastForward instantiates a new RepositoryRuleNonFastForward and sets the default values. +func NewRepositoryRuleNonFastForward()(*RepositoryRuleNonFastForward) { + m := &RepositoryRuleNonFastForward{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleNonFastForwardFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleNonFastForwardFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleNonFastForward(), 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 *RepositoryRuleNonFastForward) 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 *RepositoryRuleNonFastForward) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleNonFastForward_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleNonFastForward_type)) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleNonFastForward_type when successful +func (m *RepositoryRuleNonFastForward) GetTypeEscaped()(*RepositoryRuleNonFastForward_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleNonFastForward) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleNonFastForward) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleNonFastForward) SetTypeEscaped(value *RepositoryRuleNonFastForward_type)() { + m.typeEscaped = value +} +type RepositoryRuleNonFastForwardable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*RepositoryRuleNonFastForward_type) + SetTypeEscaped(value *RepositoryRuleNonFastForward_type)() +} diff --git a/pkg/github/models/repository_rule_non_fast_forward_escaped_type.go b/pkg/github/models/repository_rule_non_fast_forward_escaped_type.go new file mode 100644 index 00000000..122196eb --- /dev/null +++ b/pkg/github/models/repository_rule_non_fast_forward_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleNonFastForward_type int + +const ( + NON_FAST_FORWARD_REPOSITORYRULENONFASTFORWARD_TYPE RepositoryRuleNonFastForward_type = iota +) + +func (i RepositoryRuleNonFastForward_type) String() string { + return []string{"non_fast_forward"}[i] +} +func ParseRepositoryRuleNonFastForward_type(v string) (any, error) { + result := NON_FAST_FORWARD_REPOSITORYRULENONFASTFORWARD_TYPE + switch v { + case "non_fast_forward": + result = NON_FAST_FORWARD_REPOSITORYRULENONFASTFORWARD_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleNonFastForward_type(values []RepositoryRuleNonFastForward_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleNonFastForward_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_params_code_scanning_tool.go b/pkg/github/models/repository_rule_params_code_scanning_tool.go new file mode 100644 index 00000000..ae23494a --- /dev/null +++ b/pkg/github/models/repository_rule_params_code_scanning_tool.go @@ -0,0 +1,141 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleParamsCodeScanningTool a tool that must provide code scanning results for this rule to pass. +type RepositoryRuleParamsCodeScanningTool 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 severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/enterprise-server@3.14/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + alerts_threshold *RepositoryRuleParamsCodeScanningTool_alerts_threshold + // The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/enterprise-server@3.14/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." + security_alerts_threshold *RepositoryRuleParamsCodeScanningTool_security_alerts_threshold + // The name of a code scanning tool + tool *string +} +// NewRepositoryRuleParamsCodeScanningTool instantiates a new RepositoryRuleParamsCodeScanningTool and sets the default values. +func NewRepositoryRuleParamsCodeScanningTool()(*RepositoryRuleParamsCodeScanningTool) { + m := &RepositoryRuleParamsCodeScanningTool{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleParamsCodeScanningToolFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleParamsCodeScanningToolFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleParamsCodeScanningTool(), 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 *RepositoryRuleParamsCodeScanningTool) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAlertsThreshold gets the alerts_threshold property value. The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/enterprise-server@3.14/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." +// returns a *RepositoryRuleParamsCodeScanningTool_alerts_threshold when successful +func (m *RepositoryRuleParamsCodeScanningTool) GetAlertsThreshold()(*RepositoryRuleParamsCodeScanningTool_alerts_threshold) { + return m.alerts_threshold +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleParamsCodeScanningTool) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["alerts_threshold"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleParamsCodeScanningTool_alerts_threshold) + if err != nil { + return err + } + if val != nil { + m.SetAlertsThreshold(val.(*RepositoryRuleParamsCodeScanningTool_alerts_threshold)) + } + return nil + } + res["security_alerts_threshold"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleParamsCodeScanningTool_security_alerts_threshold) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAlertsThreshold(val.(*RepositoryRuleParamsCodeScanningTool_security_alerts_threshold)) + } + return nil + } + res["tool"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTool(val) + } + return nil + } + return res +} +// GetSecurityAlertsThreshold gets the security_alerts_threshold property value. The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/enterprise-server@3.14/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." +// returns a *RepositoryRuleParamsCodeScanningTool_security_alerts_threshold when successful +func (m *RepositoryRuleParamsCodeScanningTool) GetSecurityAlertsThreshold()(*RepositoryRuleParamsCodeScanningTool_security_alerts_threshold) { + return m.security_alerts_threshold +} +// GetTool gets the tool property value. The name of a code scanning tool +// returns a *string when successful +func (m *RepositoryRuleParamsCodeScanningTool) GetTool()(*string) { + return m.tool +} +// Serialize serializes information the current object +func (m *RepositoryRuleParamsCodeScanningTool) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAlertsThreshold() != nil { + cast := (*m.GetAlertsThreshold()).String() + err := writer.WriteStringValue("alerts_threshold", &cast) + if err != nil { + return err + } + } + if m.GetSecurityAlertsThreshold() != nil { + cast := (*m.GetSecurityAlertsThreshold()).String() + err := writer.WriteStringValue("security_alerts_threshold", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tool", m.GetTool()) + 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 *RepositoryRuleParamsCodeScanningTool) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAlertsThreshold sets the alerts_threshold property value. The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/enterprise-server@3.14/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." +func (m *RepositoryRuleParamsCodeScanningTool) SetAlertsThreshold(value *RepositoryRuleParamsCodeScanningTool_alerts_threshold)() { + m.alerts_threshold = value +} +// SetSecurityAlertsThreshold sets the security_alerts_threshold property value. The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/enterprise-server@3.14/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." +func (m *RepositoryRuleParamsCodeScanningTool) SetSecurityAlertsThreshold(value *RepositoryRuleParamsCodeScanningTool_security_alerts_threshold)() { + m.security_alerts_threshold = value +} +// SetTool sets the tool property value. The name of a code scanning tool +func (m *RepositoryRuleParamsCodeScanningTool) SetTool(value *string)() { + m.tool = value +} +type RepositoryRuleParamsCodeScanningToolable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAlertsThreshold()(*RepositoryRuleParamsCodeScanningTool_alerts_threshold) + GetSecurityAlertsThreshold()(*RepositoryRuleParamsCodeScanningTool_security_alerts_threshold) + GetTool()(*string) + SetAlertsThreshold(value *RepositoryRuleParamsCodeScanningTool_alerts_threshold)() + SetSecurityAlertsThreshold(value *RepositoryRuleParamsCodeScanningTool_security_alerts_threshold)() + SetTool(value *string)() +} diff --git a/pkg/github/models/repository_rule_params_code_scanning_tool_escaped_alerts_escaped_threshold.go b/pkg/github/models/repository_rule_params_code_scanning_tool_escaped_alerts_escaped_threshold.go new file mode 100644 index 00000000..4deaa1e6 --- /dev/null +++ b/pkg/github/models/repository_rule_params_code_scanning_tool_escaped_alerts_escaped_threshold.go @@ -0,0 +1,40 @@ +package models +// The severity level at which code scanning results that raise alerts block a reference update. For more information on alert severity levels, see "[About code scanning alerts](https://docs.github.com/enterprise-server@3.14/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." +type RepositoryRuleParamsCodeScanningTool_alerts_threshold int + +const ( + NONE_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD RepositoryRuleParamsCodeScanningTool_alerts_threshold = iota + ERRORS_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD + ERRORS_AND_WARNINGS_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD + ALL_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD +) + +func (i RepositoryRuleParamsCodeScanningTool_alerts_threshold) String() string { + return []string{"none", "errors", "errors_and_warnings", "all"}[i] +} +func ParseRepositoryRuleParamsCodeScanningTool_alerts_threshold(v string) (any, error) { + result := NONE_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD + switch v { + case "none": + result = NONE_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD + case "errors": + result = ERRORS_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD + case "errors_and_warnings": + result = ERRORS_AND_WARNINGS_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD + case "all": + result = ALL_REPOSITORYRULEPARAMSCODESCANNINGTOOL_ALERTS_THRESHOLD + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleParamsCodeScanningTool_alerts_threshold(values []RepositoryRuleParamsCodeScanningTool_alerts_threshold) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleParamsCodeScanningTool_alerts_threshold) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_params_code_scanning_tool_escaped_security_escaped_alerts_escaped_threshold.go b/pkg/github/models/repository_rule_params_code_scanning_tool_escaped_security_escaped_alerts_escaped_threshold.go new file mode 100644 index 00000000..412628b5 --- /dev/null +++ b/pkg/github/models/repository_rule_params_code_scanning_tool_escaped_security_escaped_alerts_escaped_threshold.go @@ -0,0 +1,43 @@ +package models +// The severity level at which code scanning results that raise security alerts block a reference update. For more information on security severity levels, see "[About code scanning alerts](https://docs.github.com/enterprise-server@3.14/code-security/code-scanning/managing-code-scanning-alerts/about-code-scanning-alerts#about-alert-severity-and-security-severity-levels)." +type RepositoryRuleParamsCodeScanningTool_security_alerts_threshold int + +const ( + NONE_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD RepositoryRuleParamsCodeScanningTool_security_alerts_threshold = iota + CRITICAL_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + HIGH_OR_HIGHER_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + MEDIUM_OR_HIGHER_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + ALL_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD +) + +func (i RepositoryRuleParamsCodeScanningTool_security_alerts_threshold) String() string { + return []string{"none", "critical", "high_or_higher", "medium_or_higher", "all"}[i] +} +func ParseRepositoryRuleParamsCodeScanningTool_security_alerts_threshold(v string) (any, error) { + result := NONE_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + switch v { + case "none": + result = NONE_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + case "critical": + result = CRITICAL_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + case "high_or_higher": + result = HIGH_OR_HIGHER_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + case "medium_or_higher": + result = MEDIUM_OR_HIGHER_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + case "all": + result = ALL_REPOSITORYRULEPARAMSCODESCANNINGTOOL_SECURITY_ALERTS_THRESHOLD + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleParamsCodeScanningTool_security_alerts_threshold(values []RepositoryRuleParamsCodeScanningTool_security_alerts_threshold) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleParamsCodeScanningTool_security_alerts_threshold) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_params_status_check_configuration.go b/pkg/github/models/repository_rule_params_status_check_configuration.go new file mode 100644 index 00000000..06a851d5 --- /dev/null +++ b/pkg/github/models/repository_rule_params_status_check_configuration.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleParamsStatusCheckConfiguration required status check +type RepositoryRuleParamsStatusCheckConfiguration 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 status check context name that must be present on the commit. + context *string + // The optional integration ID that this status check must originate from. + integration_id *int32 +} +// NewRepositoryRuleParamsStatusCheckConfiguration instantiates a new RepositoryRuleParamsStatusCheckConfiguration and sets the default values. +func NewRepositoryRuleParamsStatusCheckConfiguration()(*RepositoryRuleParamsStatusCheckConfiguration) { + m := &RepositoryRuleParamsStatusCheckConfiguration{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleParamsStatusCheckConfigurationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleParamsStatusCheckConfigurationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleParamsStatusCheckConfiguration(), 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 *RepositoryRuleParamsStatusCheckConfiguration) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContext gets the context property value. The status check context name that must be present on the commit. +// returns a *string when successful +func (m *RepositoryRuleParamsStatusCheckConfiguration) GetContext()(*string) { + return m.context +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleParamsStatusCheckConfiguration) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + res["integration_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetIntegrationId(val) + } + return nil + } + return res +} +// GetIntegrationId gets the integration_id property value. The optional integration ID that this status check must originate from. +// returns a *int32 when successful +func (m *RepositoryRuleParamsStatusCheckConfiguration) GetIntegrationId()(*int32) { + return m.integration_id +} +// Serialize serializes information the current object +func (m *RepositoryRuleParamsStatusCheckConfiguration) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("context", m.GetContext()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("integration_id", m.GetIntegrationId()) + 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 *RepositoryRuleParamsStatusCheckConfiguration) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContext sets the context property value. The status check context name that must be present on the commit. +func (m *RepositoryRuleParamsStatusCheckConfiguration) SetContext(value *string)() { + m.context = value +} +// SetIntegrationId sets the integration_id property value. The optional integration ID that this status check must originate from. +func (m *RepositoryRuleParamsStatusCheckConfiguration) SetIntegrationId(value *int32)() { + m.integration_id = value +} +type RepositoryRuleParamsStatusCheckConfigurationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContext()(*string) + GetIntegrationId()(*int32) + SetContext(value *string)() + SetIntegrationId(value *int32)() +} diff --git a/pkg/github/models/repository_rule_params_workflow_file_reference.go b/pkg/github/models/repository_rule_params_workflow_file_reference.go new file mode 100644 index 00000000..860f40ee --- /dev/null +++ b/pkg/github/models/repository_rule_params_workflow_file_reference.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleParamsWorkflowFileReference a workflow that must run for this rule to pass +type RepositoryRuleParamsWorkflowFileReference 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 path to the workflow file + path *string + // The ref (branch or tag) of the workflow file to use + ref *string + // The ID of the repository where the workflow is defined + repository_id *int32 + // The commit SHA of the workflow file to use + sha *string +} +// NewRepositoryRuleParamsWorkflowFileReference instantiates a new RepositoryRuleParamsWorkflowFileReference and sets the default values. +func NewRepositoryRuleParamsWorkflowFileReference()(*RepositoryRuleParamsWorkflowFileReference) { + m := &RepositoryRuleParamsWorkflowFileReference{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleParamsWorkflowFileReferenceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleParamsWorkflowFileReferenceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleParamsWorkflowFileReference(), 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 *RepositoryRuleParamsWorkflowFileReference) 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 *RepositoryRuleParamsWorkflowFileReference) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetPath gets the path property value. The path to the workflow file +// returns a *string when successful +func (m *RepositoryRuleParamsWorkflowFileReference) GetPath()(*string) { + return m.path +} +// GetRef gets the ref property value. The ref (branch or tag) of the workflow file to use +// returns a *string when successful +func (m *RepositoryRuleParamsWorkflowFileReference) GetRef()(*string) { + return m.ref +} +// GetRepositoryId gets the repository_id property value. The ID of the repository where the workflow is defined +// returns a *int32 when successful +func (m *RepositoryRuleParamsWorkflowFileReference) GetRepositoryId()(*int32) { + return m.repository_id +} +// GetSha gets the sha property value. The commit SHA of the workflow file to use +// returns a *string when successful +func (m *RepositoryRuleParamsWorkflowFileReference) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *RepositoryRuleParamsWorkflowFileReference) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *RepositoryRuleParamsWorkflowFileReference) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPath sets the path property value. The path to the workflow file +func (m *RepositoryRuleParamsWorkflowFileReference) SetPath(value *string)() { + m.path = value +} +// SetRef sets the ref property value. The ref (branch or tag) of the workflow file to use +func (m *RepositoryRuleParamsWorkflowFileReference) SetRef(value *string)() { + m.ref = value +} +// SetRepositoryId sets the repository_id property value. The ID of the repository where the workflow is defined +func (m *RepositoryRuleParamsWorkflowFileReference) SetRepositoryId(value *int32)() { + m.repository_id = value +} +// SetSha sets the sha property value. The commit SHA of the workflow file to use +func (m *RepositoryRuleParamsWorkflowFileReference) SetSha(value *string)() { + m.sha = value +} +type RepositoryRuleParamsWorkflowFileReferenceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPath()(*string) + GetRef()(*string) + GetRepositoryId()(*int32) + GetSha()(*string) + SetPath(value *string)() + SetRef(value *string)() + SetRepositoryId(value *int32)() + SetSha(value *string)() +} diff --git a/pkg/github/models/repository_rule_pull_request.go b/pkg/github/models/repository_rule_pull_request.go new file mode 100644 index 00000000..9c202974 --- /dev/null +++ b/pkg/github/models/repository_rule_pull_request.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRulePullRequest require all commits be made to a non-target branch and submitted via a pull request before they can be merged. +type RepositoryRulePullRequest 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 parameters property + parameters RepositoryRulePullRequest_parametersable + // The type property + typeEscaped *RepositoryRulePullRequest_type +} +// NewRepositoryRulePullRequest instantiates a new RepositoryRulePullRequest and sets the default values. +func NewRepositoryRulePullRequest()(*RepositoryRulePullRequest) { + m := &RepositoryRulePullRequest{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRulePullRequestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRulePullRequestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRulePullRequest(), 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 *RepositoryRulePullRequest) 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 *RepositoryRulePullRequest) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRulePullRequest_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRulePullRequest_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRulePullRequest_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRulePullRequest_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRulePullRequest_parametersable when successful +func (m *RepositoryRulePullRequest) GetParameters()(RepositoryRulePullRequest_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRulePullRequest_type when successful +func (m *RepositoryRulePullRequest) GetTypeEscaped()(*RepositoryRulePullRequest_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRulePullRequest) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRulePullRequest) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRulePullRequest) SetParameters(value RepositoryRulePullRequest_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRulePullRequest) SetTypeEscaped(value *RepositoryRulePullRequest_type)() { + m.typeEscaped = value +} +type RepositoryRulePullRequestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRulePullRequest_parametersable) + GetTypeEscaped()(*RepositoryRulePullRequest_type) + SetParameters(value RepositoryRulePullRequest_parametersable)() + SetTypeEscaped(value *RepositoryRulePullRequest_type)() +} diff --git a/pkg/github/models/repository_rule_pull_request_escaped_parameters.go b/pkg/github/models/repository_rule_pull_request_escaped_parameters.go new file mode 100644 index 00000000..97253253 --- /dev/null +++ b/pkg/github/models/repository_rule_pull_request_escaped_parameters.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +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 + // 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. + require_code_owner_review *bool + // Whether the most recent reviewable push must be approved by someone other than the person who pushed it. + require_last_push_approval *bool + // The number of approving reviews that are required before a pull request can be merged. + required_approving_review_count *int32 + // All conversations on code must be resolved before a pull request can be merged. + required_review_thread_resolution *bool +} +// NewRepositoryRulePullRequest_parameters instantiates a new RepositoryRulePullRequest_parameters and sets the default values. +func NewRepositoryRulePullRequest_parameters()(*RepositoryRulePullRequest_parameters) { + m := &RepositoryRulePullRequest_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRulePullRequest_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRulePullRequest_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRulePullRequest_parameters(), 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 *RepositoryRulePullRequest_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// 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) { + return m.dismiss_stale_reviews_on_push +} +// GetFieldDeserializers the deserialization information for the current model +// 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["dismiss_stale_reviews_on_push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissStaleReviewsOnPush(val) + } + return nil + } + res["require_code_owner_review"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireCodeOwnerReview(val) + } + return nil + } + res["require_last_push_approval"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireLastPushApproval(val) + } + return nil + } + res["required_approving_review_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRequiredApprovingReviewCount(val) + } + return nil + } + res["required_review_thread_resolution"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequiredReviewThreadResolution(val) + } + return nil + } + return res +} +// GetRequireCodeOwnerReview gets the require_code_owner_review property value. Require an approving review in pull requests that modify files that have a designated code owner. +// returns a *bool when successful +func (m *RepositoryRulePullRequest_parameters) GetRequireCodeOwnerReview()(*bool) { + return m.require_code_owner_review +} +// GetRequiredApprovingReviewCount gets the required_approving_review_count property value. The number of approving reviews that are required before a pull request can be merged. +// returns a *int32 when successful +func (m *RepositoryRulePullRequest_parameters) GetRequiredApprovingReviewCount()(*int32) { + return m.required_approving_review_count +} +// GetRequiredReviewThreadResolution gets the required_review_thread_resolution property value. All conversations on code must be resolved before a pull request can be merged. +// returns a *bool when successful +func (m *RepositoryRulePullRequest_parameters) GetRequiredReviewThreadResolution()(*bool) { + return m.required_review_thread_resolution +} +// GetRequireLastPushApproval gets the require_last_push_approval property value. Whether the most recent reviewable push must be approved by someone other than the person who pushed it. +// returns a *bool when successful +func (m *RepositoryRulePullRequest_parameters) GetRequireLastPushApproval()(*bool) { + return m.require_last_push_approval +} +// Serialize serializes information the current object +func (m *RepositoryRulePullRequest_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("dismiss_stale_reviews_on_push", m.GetDismissStaleReviewsOnPush()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("required_approving_review_count", m.GetRequiredApprovingReviewCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("required_review_thread_resolution", m.GetRequiredReviewThreadResolution()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_code_owner_review", m.GetRequireCodeOwnerReview()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_last_push_approval", m.GetRequireLastPushApproval()) + 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 *RepositoryRulePullRequest_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = 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 +} +// SetRequireCodeOwnerReview sets the require_code_owner_review property value. Require an approving review in pull requests that modify files that have a designated code owner. +func (m *RepositoryRulePullRequest_parameters) SetRequireCodeOwnerReview(value *bool)() { + m.require_code_owner_review = value +} +// SetRequiredApprovingReviewCount sets the required_approving_review_count property value. The number of approving reviews that are required before a pull request can be merged. +func (m *RepositoryRulePullRequest_parameters) SetRequiredApprovingReviewCount(value *int32)() { + m.required_approving_review_count = value +} +// SetRequiredReviewThreadResolution sets the required_review_thread_resolution property value. All conversations on code must be resolved before a pull request can be merged. +func (m *RepositoryRulePullRequest_parameters) SetRequiredReviewThreadResolution(value *bool)() { + m.required_review_thread_resolution = value +} +// SetRequireLastPushApproval sets the require_last_push_approval property value. Whether the most recent reviewable push must be approved by someone other than the person who pushed it. +func (m *RepositoryRulePullRequest_parameters) SetRequireLastPushApproval(value *bool)() { + m.require_last_push_approval = value +} +type RepositoryRulePullRequest_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDismissStaleReviewsOnPush()(*bool) + GetRequireCodeOwnerReview()(*bool) + GetRequiredApprovingReviewCount()(*int32) + GetRequiredReviewThreadResolution()(*bool) + GetRequireLastPushApproval()(*bool) + SetDismissStaleReviewsOnPush(value *bool)() + SetRequireCodeOwnerReview(value *bool)() + SetRequiredApprovingReviewCount(value *int32)() + SetRequiredReviewThreadResolution(value *bool)() + SetRequireLastPushApproval(value *bool)() +} diff --git a/pkg/github/models/repository_rule_pull_request_escaped_type.go b/pkg/github/models/repository_rule_pull_request_escaped_type.go new file mode 100644 index 00000000..6fa59d2b --- /dev/null +++ b/pkg/github/models/repository_rule_pull_request_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRulePullRequest_type int + +const ( + PULL_REQUEST_REPOSITORYRULEPULLREQUEST_TYPE RepositoryRulePullRequest_type = iota +) + +func (i RepositoryRulePullRequest_type) String() string { + return []string{"pull_request"}[i] +} +func ParseRepositoryRulePullRequest_type(v string) (any, error) { + result := PULL_REQUEST_REPOSITORYRULEPULLREQUEST_TYPE + switch v { + case "pull_request": + result = PULL_REQUEST_REPOSITORYRULEPULLREQUEST_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRulePullRequest_type(values []RepositoryRulePullRequest_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRulePullRequest_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_required_deployments.go b/pkg/github/models/repository_rule_required_deployments.go new file mode 100644 index 00000000..63d62d96 --- /dev/null +++ b/pkg/github/models/repository_rule_required_deployments.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleRequiredDeployments choose which environments must be successfully deployed to before refs can be pushed into a ref that matches this rule. +type RepositoryRuleRequiredDeployments 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 parameters property + parameters RepositoryRuleRequiredDeployments_parametersable + // The type property + typeEscaped *RepositoryRuleRequiredDeployments_type +} +// NewRepositoryRuleRequiredDeployments instantiates a new RepositoryRuleRequiredDeployments and sets the default values. +func NewRepositoryRuleRequiredDeployments()(*RepositoryRuleRequiredDeployments) { + m := &RepositoryRuleRequiredDeployments{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleRequiredDeploymentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleRequiredDeploymentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleRequiredDeployments(), 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 *RepositoryRuleRequiredDeployments) 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 *RepositoryRuleRequiredDeployments) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleRequiredDeployments_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleRequiredDeployments_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleRequiredDeployments_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleRequiredDeployments_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleRequiredDeployments_parametersable when successful +func (m *RepositoryRuleRequiredDeployments) GetParameters()(RepositoryRuleRequiredDeployments_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleRequiredDeployments_type when successful +func (m *RepositoryRuleRequiredDeployments) GetTypeEscaped()(*RepositoryRuleRequiredDeployments_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleRequiredDeployments) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleRequiredDeployments) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleRequiredDeployments) SetParameters(value RepositoryRuleRequiredDeployments_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleRequiredDeployments) SetTypeEscaped(value *RepositoryRuleRequiredDeployments_type)() { + m.typeEscaped = value +} +type RepositoryRuleRequiredDeploymentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleRequiredDeployments_parametersable) + GetTypeEscaped()(*RepositoryRuleRequiredDeployments_type) + SetParameters(value RepositoryRuleRequiredDeployments_parametersable)() + SetTypeEscaped(value *RepositoryRuleRequiredDeployments_type)() +} diff --git a/pkg/github/models/repository_rule_required_deployments_escaped_parameters.go b/pkg/github/models/repository_rule_required_deployments_escaped_parameters.go new file mode 100644 index 00000000..956dd9a1 --- /dev/null +++ b/pkg/github/models/repository_rule_required_deployments_escaped_parameters.go @@ -0,0 +1,86 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleRequiredDeployments_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 + // The environments that must be successfully deployed to before branches can be merged. + required_deployment_environments []string +} +// NewRepositoryRuleRequiredDeployments_parameters instantiates a new RepositoryRuleRequiredDeployments_parameters and sets the default values. +func NewRepositoryRuleRequiredDeployments_parameters()(*RepositoryRuleRequiredDeployments_parameters) { + m := &RepositoryRuleRequiredDeployments_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleRequiredDeployments_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleRequiredDeployments_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleRequiredDeployments_parameters(), 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 *RepositoryRuleRequiredDeployments_parameters) 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 *RepositoryRuleRequiredDeployments_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["required_deployment_environments"] = 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.SetRequiredDeploymentEnvironments(res) + } + return nil + } + return res +} +// GetRequiredDeploymentEnvironments gets the required_deployment_environments property value. The environments that must be successfully deployed to before branches can be merged. +// returns a []string when successful +func (m *RepositoryRuleRequiredDeployments_parameters) GetRequiredDeploymentEnvironments()([]string) { + return m.required_deployment_environments +} +// Serialize serializes information the current object +func (m *RepositoryRuleRequiredDeployments_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRequiredDeploymentEnvironments() != nil { + err := writer.WriteCollectionOfStringValues("required_deployment_environments", m.GetRequiredDeploymentEnvironments()) + 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 *RepositoryRuleRequiredDeployments_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRequiredDeploymentEnvironments sets the required_deployment_environments property value. The environments that must be successfully deployed to before branches can be merged. +func (m *RepositoryRuleRequiredDeployments_parameters) SetRequiredDeploymentEnvironments(value []string)() { + m.required_deployment_environments = value +} +type RepositoryRuleRequiredDeployments_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRequiredDeploymentEnvironments()([]string) + SetRequiredDeploymentEnvironments(value []string)() +} diff --git a/pkg/github/models/repository_rule_required_deployments_escaped_type.go b/pkg/github/models/repository_rule_required_deployments_escaped_type.go new file mode 100644 index 00000000..53c69317 --- /dev/null +++ b/pkg/github/models/repository_rule_required_deployments_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleRequiredDeployments_type int + +const ( + REQUIRED_DEPLOYMENTS_REPOSITORYRULEREQUIREDDEPLOYMENTS_TYPE RepositoryRuleRequiredDeployments_type = iota +) + +func (i RepositoryRuleRequiredDeployments_type) String() string { + return []string{"required_deployments"}[i] +} +func ParseRepositoryRuleRequiredDeployments_type(v string) (any, error) { + result := REQUIRED_DEPLOYMENTS_REPOSITORYRULEREQUIREDDEPLOYMENTS_TYPE + switch v { + case "required_deployments": + result = REQUIRED_DEPLOYMENTS_REPOSITORYRULEREQUIREDDEPLOYMENTS_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleRequiredDeployments_type(values []RepositoryRuleRequiredDeployments_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleRequiredDeployments_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_required_linear_history.go b/pkg/github/models/repository_rule_required_linear_history.go new file mode 100644 index 00000000..1e6334ad --- /dev/null +++ b/pkg/github/models/repository_rule_required_linear_history.go @@ -0,0 +1,82 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleRequiredLinearHistory prevent merge commits from being pushed to matching refs. +type RepositoryRuleRequiredLinearHistory 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 type property + typeEscaped *RepositoryRuleRequiredLinearHistory_type +} +// NewRepositoryRuleRequiredLinearHistory instantiates a new RepositoryRuleRequiredLinearHistory and sets the default values. +func NewRepositoryRuleRequiredLinearHistory()(*RepositoryRuleRequiredLinearHistory) { + m := &RepositoryRuleRequiredLinearHistory{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleRequiredLinearHistoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleRequiredLinearHistoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleRequiredLinearHistory(), 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 *RepositoryRuleRequiredLinearHistory) 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 *RepositoryRuleRequiredLinearHistory) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleRequiredLinearHistory_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleRequiredLinearHistory_type)) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleRequiredLinearHistory_type when successful +func (m *RepositoryRuleRequiredLinearHistory) GetTypeEscaped()(*RepositoryRuleRequiredLinearHistory_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleRequiredLinearHistory) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleRequiredLinearHistory) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleRequiredLinearHistory) SetTypeEscaped(value *RepositoryRuleRequiredLinearHistory_type)() { + m.typeEscaped = value +} +type RepositoryRuleRequiredLinearHistoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*RepositoryRuleRequiredLinearHistory_type) + SetTypeEscaped(value *RepositoryRuleRequiredLinearHistory_type)() +} diff --git a/pkg/github/models/repository_rule_required_linear_history_escaped_type.go b/pkg/github/models/repository_rule_required_linear_history_escaped_type.go new file mode 100644 index 00000000..b8f49b17 --- /dev/null +++ b/pkg/github/models/repository_rule_required_linear_history_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleRequiredLinearHistory_type int + +const ( + REQUIRED_LINEAR_HISTORY_REPOSITORYRULEREQUIREDLINEARHISTORY_TYPE RepositoryRuleRequiredLinearHistory_type = iota +) + +func (i RepositoryRuleRequiredLinearHistory_type) String() string { + return []string{"required_linear_history"}[i] +} +func ParseRepositoryRuleRequiredLinearHistory_type(v string) (any, error) { + result := REQUIRED_LINEAR_HISTORY_REPOSITORYRULEREQUIREDLINEARHISTORY_TYPE + switch v { + case "required_linear_history": + result = REQUIRED_LINEAR_HISTORY_REPOSITORYRULEREQUIREDLINEARHISTORY_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleRequiredLinearHistory_type(values []RepositoryRuleRequiredLinearHistory_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleRequiredLinearHistory_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_required_signatures.go b/pkg/github/models/repository_rule_required_signatures.go new file mode 100644 index 00000000..3d050482 --- /dev/null +++ b/pkg/github/models/repository_rule_required_signatures.go @@ -0,0 +1,82 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleRequiredSignatures commits pushed to matching refs must have verified signatures. +type RepositoryRuleRequiredSignatures 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 type property + typeEscaped *RepositoryRuleRequiredSignatures_type +} +// NewRepositoryRuleRequiredSignatures instantiates a new RepositoryRuleRequiredSignatures and sets the default values. +func NewRepositoryRuleRequiredSignatures()(*RepositoryRuleRequiredSignatures) { + m := &RepositoryRuleRequiredSignatures{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleRequiredSignaturesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleRequiredSignaturesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleRequiredSignatures(), 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 *RepositoryRuleRequiredSignatures) 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 *RepositoryRuleRequiredSignatures) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleRequiredSignatures_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleRequiredSignatures_type)) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleRequiredSignatures_type when successful +func (m *RepositoryRuleRequiredSignatures) GetTypeEscaped()(*RepositoryRuleRequiredSignatures_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleRequiredSignatures) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleRequiredSignatures) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleRequiredSignatures) SetTypeEscaped(value *RepositoryRuleRequiredSignatures_type)() { + m.typeEscaped = value +} +type RepositoryRuleRequiredSignaturesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTypeEscaped()(*RepositoryRuleRequiredSignatures_type) + SetTypeEscaped(value *RepositoryRuleRequiredSignatures_type)() +} diff --git a/pkg/github/models/repository_rule_required_signatures_escaped_type.go b/pkg/github/models/repository_rule_required_signatures_escaped_type.go new file mode 100644 index 00000000..4ef148cd --- /dev/null +++ b/pkg/github/models/repository_rule_required_signatures_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleRequiredSignatures_type int + +const ( + REQUIRED_SIGNATURES_REPOSITORYRULEREQUIREDSIGNATURES_TYPE RepositoryRuleRequiredSignatures_type = iota +) + +func (i RepositoryRuleRequiredSignatures_type) String() string { + return []string{"required_signatures"}[i] +} +func ParseRepositoryRuleRequiredSignatures_type(v string) (any, error) { + result := REQUIRED_SIGNATURES_REPOSITORYRULEREQUIREDSIGNATURES_TYPE + switch v { + case "required_signatures": + result = REQUIRED_SIGNATURES_REPOSITORYRULEREQUIREDSIGNATURES_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleRequiredSignatures_type(values []RepositoryRuleRequiredSignatures_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleRequiredSignatures_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_required_status_checks.go b/pkg/github/models/repository_rule_required_status_checks.go new file mode 100644 index 00000000..ab4cfe70 --- /dev/null +++ b/pkg/github/models/repository_rule_required_status_checks.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleRequiredStatusChecks choose which status checks must pass before the ref is updated. When enabled, commits must first be pushed to another ref where the checks pass. +type RepositoryRuleRequiredStatusChecks 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 parameters property + parameters RepositoryRuleRequiredStatusChecks_parametersable + // The type property + typeEscaped *RepositoryRuleRequiredStatusChecks_type +} +// NewRepositoryRuleRequiredStatusChecks instantiates a new RepositoryRuleRequiredStatusChecks and sets the default values. +func NewRepositoryRuleRequiredStatusChecks()(*RepositoryRuleRequiredStatusChecks) { + m := &RepositoryRuleRequiredStatusChecks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleRequiredStatusChecksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleRequiredStatusChecksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleRequiredStatusChecks(), 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 *RepositoryRuleRequiredStatusChecks) 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 *RepositoryRuleRequiredStatusChecks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleRequiredStatusChecks_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleRequiredStatusChecks_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleRequiredStatusChecks_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleRequiredStatusChecks_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleRequiredStatusChecks_parametersable when successful +func (m *RepositoryRuleRequiredStatusChecks) GetParameters()(RepositoryRuleRequiredStatusChecks_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleRequiredStatusChecks_type when successful +func (m *RepositoryRuleRequiredStatusChecks) GetTypeEscaped()(*RepositoryRuleRequiredStatusChecks_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleRequiredStatusChecks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleRequiredStatusChecks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleRequiredStatusChecks) SetParameters(value RepositoryRuleRequiredStatusChecks_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleRequiredStatusChecks) SetTypeEscaped(value *RepositoryRuleRequiredStatusChecks_type)() { + m.typeEscaped = value +} +type RepositoryRuleRequiredStatusChecksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleRequiredStatusChecks_parametersable) + GetTypeEscaped()(*RepositoryRuleRequiredStatusChecks_type) + SetParameters(value RepositoryRuleRequiredStatusChecks_parametersable)() + SetTypeEscaped(value *RepositoryRuleRequiredStatusChecks_type)() +} diff --git a/pkg/github/models/repository_rule_required_status_checks_escaped_parameters.go b/pkg/github/models/repository_rule_required_status_checks_escaped_parameters.go new file mode 100644 index 00000000..d0772451 --- /dev/null +++ b/pkg/github/models/repository_rule_required_status_checks_escaped_parameters.go @@ -0,0 +1,150 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleRequiredStatusChecks_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 + // Allow repositories and branches to be created if a check would otherwise prohibit it. + do_not_enforce_on_create *bool + // Status checks that are required. + required_status_checks []RepositoryRuleParamsStatusCheckConfigurationable + // Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled. + strict_required_status_checks_policy *bool +} +// NewRepositoryRuleRequiredStatusChecks_parameters instantiates a new RepositoryRuleRequiredStatusChecks_parameters and sets the default values. +func NewRepositoryRuleRequiredStatusChecks_parameters()(*RepositoryRuleRequiredStatusChecks_parameters) { + m := &RepositoryRuleRequiredStatusChecks_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleRequiredStatusChecks_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleRequiredStatusChecks_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleRequiredStatusChecks_parameters(), 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 *RepositoryRuleRequiredStatusChecks_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDoNotEnforceOnCreate gets the do_not_enforce_on_create property value. Allow repositories and branches to be created if a check would otherwise prohibit it. +// returns a *bool when successful +func (m *RepositoryRuleRequiredStatusChecks_parameters) GetDoNotEnforceOnCreate()(*bool) { + return m.do_not_enforce_on_create +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleRequiredStatusChecks_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["do_not_enforce_on_create"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDoNotEnforceOnCreate(val) + } + return nil + } + res["required_status_checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryRuleParamsStatusCheckConfigurationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryRuleParamsStatusCheckConfigurationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryRuleParamsStatusCheckConfigurationable) + } + } + m.SetRequiredStatusChecks(res) + } + return nil + } + res["strict_required_status_checks_policy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetStrictRequiredStatusChecksPolicy(val) + } + return nil + } + return res +} +// GetRequiredStatusChecks gets the required_status_checks property value. Status checks that are required. +// returns a []RepositoryRuleParamsStatusCheckConfigurationable when successful +func (m *RepositoryRuleRequiredStatusChecks_parameters) GetRequiredStatusChecks()([]RepositoryRuleParamsStatusCheckConfigurationable) { + return m.required_status_checks +} +// GetStrictRequiredStatusChecksPolicy gets the strict_required_status_checks_policy property value. Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled. +// returns a *bool when successful +func (m *RepositoryRuleRequiredStatusChecks_parameters) GetStrictRequiredStatusChecksPolicy()(*bool) { + return m.strict_required_status_checks_policy +} +// Serialize serializes information the current object +func (m *RepositoryRuleRequiredStatusChecks_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("do_not_enforce_on_create", m.GetDoNotEnforceOnCreate()) + if err != nil { + return err + } + } + if m.GetRequiredStatusChecks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRequiredStatusChecks())) + for i, v := range m.GetRequiredStatusChecks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("required_status_checks", cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("strict_required_status_checks_policy", m.GetStrictRequiredStatusChecksPolicy()) + 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 *RepositoryRuleRequiredStatusChecks_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDoNotEnforceOnCreate sets the do_not_enforce_on_create property value. Allow repositories and branches to be created if a check would otherwise prohibit it. +func (m *RepositoryRuleRequiredStatusChecks_parameters) SetDoNotEnforceOnCreate(value *bool)() { + m.do_not_enforce_on_create = value +} +// SetRequiredStatusChecks sets the required_status_checks property value. Status checks that are required. +func (m *RepositoryRuleRequiredStatusChecks_parameters) SetRequiredStatusChecks(value []RepositoryRuleParamsStatusCheckConfigurationable)() { + m.required_status_checks = value +} +// SetStrictRequiredStatusChecksPolicy sets the strict_required_status_checks_policy property value. Whether pull requests targeting a matching branch must be tested with the latest code. This setting will not take effect unless at least one status check is enabled. +func (m *RepositoryRuleRequiredStatusChecks_parameters) SetStrictRequiredStatusChecksPolicy(value *bool)() { + m.strict_required_status_checks_policy = value +} +type RepositoryRuleRequiredStatusChecks_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDoNotEnforceOnCreate()(*bool) + GetRequiredStatusChecks()([]RepositoryRuleParamsStatusCheckConfigurationable) + GetStrictRequiredStatusChecksPolicy()(*bool) + SetDoNotEnforceOnCreate(value *bool)() + SetRequiredStatusChecks(value []RepositoryRuleParamsStatusCheckConfigurationable)() + SetStrictRequiredStatusChecksPolicy(value *bool)() +} diff --git a/pkg/github/models/repository_rule_required_status_checks_escaped_type.go b/pkg/github/models/repository_rule_required_status_checks_escaped_type.go new file mode 100644 index 00000000..0e36cef7 --- /dev/null +++ b/pkg/github/models/repository_rule_required_status_checks_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleRequiredStatusChecks_type int + +const ( + REQUIRED_STATUS_CHECKS_REPOSITORYRULEREQUIREDSTATUSCHECKS_TYPE RepositoryRuleRequiredStatusChecks_type = iota +) + +func (i RepositoryRuleRequiredStatusChecks_type) String() string { + return []string{"required_status_checks"}[i] +} +func ParseRepositoryRuleRequiredStatusChecks_type(v string) (any, error) { + result := REQUIRED_STATUS_CHECKS_REPOSITORYRULEREQUIREDSTATUSCHECKS_TYPE + switch v { + case "required_status_checks": + result = REQUIRED_STATUS_CHECKS_REPOSITORYRULEREQUIREDSTATUSCHECKS_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleRequiredStatusChecks_type(values []RepositoryRuleRequiredStatusChecks_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleRequiredStatusChecks_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_tag_name_pattern.go b/pkg/github/models/repository_rule_tag_name_pattern.go new file mode 100644 index 00000000..da8d71e1 --- /dev/null +++ b/pkg/github/models/repository_rule_tag_name_pattern.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleTagNamePattern parameters to be used for the tag_name_pattern rule +type RepositoryRuleTagNamePattern 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 parameters property + parameters RepositoryRuleTagNamePattern_parametersable + // The type property + typeEscaped *RepositoryRuleTagNamePattern_type +} +// NewRepositoryRuleTagNamePattern instantiates a new RepositoryRuleTagNamePattern and sets the default values. +func NewRepositoryRuleTagNamePattern()(*RepositoryRuleTagNamePattern) { + m := &RepositoryRuleTagNamePattern{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleTagNamePatternFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleTagNamePatternFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleTagNamePattern(), 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 *RepositoryRuleTagNamePattern) 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 *RepositoryRuleTagNamePattern) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleTagNamePattern_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleTagNamePattern_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleTagNamePattern_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleTagNamePattern_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleTagNamePattern_parametersable when successful +func (m *RepositoryRuleTagNamePattern) GetParameters()(RepositoryRuleTagNamePattern_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleTagNamePattern_type when successful +func (m *RepositoryRuleTagNamePattern) GetTypeEscaped()(*RepositoryRuleTagNamePattern_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleTagNamePattern) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleTagNamePattern) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleTagNamePattern) SetParameters(value RepositoryRuleTagNamePattern_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleTagNamePattern) SetTypeEscaped(value *RepositoryRuleTagNamePattern_type)() { + m.typeEscaped = value +} +type RepositoryRuleTagNamePatternable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleTagNamePattern_parametersable) + GetTypeEscaped()(*RepositoryRuleTagNamePattern_type) + SetParameters(value RepositoryRuleTagNamePattern_parametersable)() + SetTypeEscaped(value *RepositoryRuleTagNamePattern_type)() +} diff --git a/pkg/github/models/repository_rule_tag_name_pattern_escaped_parameters.go b/pkg/github/models/repository_rule_tag_name_pattern_escaped_parameters.go new file mode 100644 index 00000000..4420e9ca --- /dev/null +++ b/pkg/github/models/repository_rule_tag_name_pattern_escaped_parameters.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleTagNamePattern_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 + // How this rule will appear to users. + name *string + // If true, the rule will fail if the pattern matches. + negate *bool + // The operator to use for matching. + operator *RepositoryRuleTagNamePattern_parameters_operator + // The pattern to match with. + pattern *string +} +// NewRepositoryRuleTagNamePattern_parameters instantiates a new RepositoryRuleTagNamePattern_parameters and sets the default values. +func NewRepositoryRuleTagNamePattern_parameters()(*RepositoryRuleTagNamePattern_parameters) { + m := &RepositoryRuleTagNamePattern_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleTagNamePattern_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleTagNamePattern_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleTagNamePattern_parameters(), 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 *RepositoryRuleTagNamePattern_parameters) 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 *RepositoryRuleTagNamePattern_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["negate"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetNegate(val) + } + return nil + } + res["operator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleTagNamePattern_parameters_operator) + if err != nil { + return err + } + if val != nil { + m.SetOperator(val.(*RepositoryRuleTagNamePattern_parameters_operator)) + } + return nil + } + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + return res +} +// GetName gets the name property value. How this rule will appear to users. +// returns a *string when successful +func (m *RepositoryRuleTagNamePattern_parameters) GetName()(*string) { + return m.name +} +// GetNegate gets the negate property value. If true, the rule will fail if the pattern matches. +// returns a *bool when successful +func (m *RepositoryRuleTagNamePattern_parameters) GetNegate()(*bool) { + return m.negate +} +// GetOperator gets the operator property value. The operator to use for matching. +// returns a *RepositoryRuleTagNamePattern_parameters_operator when successful +func (m *RepositoryRuleTagNamePattern_parameters) GetOperator()(*RepositoryRuleTagNamePattern_parameters_operator) { + return m.operator +} +// GetPattern gets the pattern property value. The pattern to match with. +// returns a *string when successful +func (m *RepositoryRuleTagNamePattern_parameters) GetPattern()(*string) { + return m.pattern +} +// Serialize serializes information the current object +func (m *RepositoryRuleTagNamePattern_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("negate", m.GetNegate()) + if err != nil { + return err + } + } + if m.GetOperator() != nil { + cast := (*m.GetOperator()).String() + err := writer.WriteStringValue("operator", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + 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 *RepositoryRuleTagNamePattern_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. How this rule will appear to users. +func (m *RepositoryRuleTagNamePattern_parameters) SetName(value *string)() { + m.name = value +} +// SetNegate sets the negate property value. If true, the rule will fail if the pattern matches. +func (m *RepositoryRuleTagNamePattern_parameters) SetNegate(value *bool)() { + m.negate = value +} +// SetOperator sets the operator property value. The operator to use for matching. +func (m *RepositoryRuleTagNamePattern_parameters) SetOperator(value *RepositoryRuleTagNamePattern_parameters_operator)() { + m.operator = value +} +// SetPattern sets the pattern property value. The pattern to match with. +func (m *RepositoryRuleTagNamePattern_parameters) SetPattern(value *string)() { + m.pattern = value +} +type RepositoryRuleTagNamePattern_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetNegate()(*bool) + GetOperator()(*RepositoryRuleTagNamePattern_parameters_operator) + GetPattern()(*string) + SetName(value *string)() + SetNegate(value *bool)() + SetOperator(value *RepositoryRuleTagNamePattern_parameters_operator)() + SetPattern(value *string)() +} diff --git a/pkg/github/models/repository_rule_tag_name_pattern_escaped_parameters_escaped_operator.go b/pkg/github/models/repository_rule_tag_name_pattern_escaped_parameters_escaped_operator.go new file mode 100644 index 00000000..559c9eed --- /dev/null +++ b/pkg/github/models/repository_rule_tag_name_pattern_escaped_parameters_escaped_operator.go @@ -0,0 +1,40 @@ +package models +// The operator to use for matching. +type RepositoryRuleTagNamePattern_parameters_operator int + +const ( + STARTS_WITH_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR RepositoryRuleTagNamePattern_parameters_operator = iota + ENDS_WITH_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR + CONTAINS_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR + REGEX_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR +) + +func (i RepositoryRuleTagNamePattern_parameters_operator) String() string { + return []string{"starts_with", "ends_with", "contains", "regex"}[i] +} +func ParseRepositoryRuleTagNamePattern_parameters_operator(v string) (any, error) { + result := STARTS_WITH_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR + switch v { + case "starts_with": + result = STARTS_WITH_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR + case "ends_with": + result = ENDS_WITH_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR + case "contains": + result = CONTAINS_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR + case "regex": + result = REGEX_REPOSITORYRULETAGNAMEPATTERN_PARAMETERS_OPERATOR + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleTagNamePattern_parameters_operator(values []RepositoryRuleTagNamePattern_parameters_operator) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleTagNamePattern_parameters_operator) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_tag_name_pattern_escaped_type.go b/pkg/github/models/repository_rule_tag_name_pattern_escaped_type.go new file mode 100644 index 00000000..6a094daa --- /dev/null +++ b/pkg/github/models/repository_rule_tag_name_pattern_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleTagNamePattern_type int + +const ( + TAG_NAME_PATTERN_REPOSITORYRULETAGNAMEPATTERN_TYPE RepositoryRuleTagNamePattern_type = iota +) + +func (i RepositoryRuleTagNamePattern_type) String() string { + return []string{"tag_name_pattern"}[i] +} +func ParseRepositoryRuleTagNamePattern_type(v string) (any, error) { + result := TAG_NAME_PATTERN_REPOSITORYRULETAGNAMEPATTERN_TYPE + switch v { + case "tag_name_pattern": + result = TAG_NAME_PATTERN_REPOSITORYRULETAGNAMEPATTERN_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleTagNamePattern_type(values []RepositoryRuleTagNamePattern_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleTagNamePattern_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_update.go b/pkg/github/models/repository_rule_update.go new file mode 100644 index 00000000..f23ced23 --- /dev/null +++ b/pkg/github/models/repository_rule_update.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleUpdate only allow users with bypass permission to update matching refs. +type RepositoryRuleUpdate 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 parameters property + parameters RepositoryRuleUpdate_parametersable + // The type property + typeEscaped *RepositoryRuleUpdate_type +} +// NewRepositoryRuleUpdate instantiates a new RepositoryRuleUpdate and sets the default values. +func NewRepositoryRuleUpdate()(*RepositoryRuleUpdate) { + m := &RepositoryRuleUpdate{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleUpdateFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleUpdateFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleUpdate(), 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 *RepositoryRuleUpdate) 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 *RepositoryRuleUpdate) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleUpdate_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleUpdate_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleUpdate_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleUpdate_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleUpdate_parametersable when successful +func (m *RepositoryRuleUpdate) GetParameters()(RepositoryRuleUpdate_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleUpdate_type when successful +func (m *RepositoryRuleUpdate) GetTypeEscaped()(*RepositoryRuleUpdate_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleUpdate) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleUpdate) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleUpdate) SetParameters(value RepositoryRuleUpdate_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleUpdate) SetTypeEscaped(value *RepositoryRuleUpdate_type)() { + m.typeEscaped = value +} +type RepositoryRuleUpdateable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleUpdate_parametersable) + GetTypeEscaped()(*RepositoryRuleUpdate_type) + SetParameters(value RepositoryRuleUpdate_parametersable)() + SetTypeEscaped(value *RepositoryRuleUpdate_type)() +} diff --git a/pkg/github/models/repository_rule_update_escaped_parameters.go b/pkg/github/models/repository_rule_update_escaped_parameters.go new file mode 100644 index 00000000..b6ef2d1d --- /dev/null +++ b/pkg/github/models/repository_rule_update_escaped_parameters.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleUpdate_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 + // Branch can pull changes from its upstream repository + update_allows_fetch_and_merge *bool +} +// NewRepositoryRuleUpdate_parameters instantiates a new RepositoryRuleUpdate_parameters and sets the default values. +func NewRepositoryRuleUpdate_parameters()(*RepositoryRuleUpdate_parameters) { + m := &RepositoryRuleUpdate_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleUpdate_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleUpdate_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleUpdate_parameters(), 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 *RepositoryRuleUpdate_parameters) 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 *RepositoryRuleUpdate_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["update_allows_fetch_and_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdateAllowsFetchAndMerge(val) + } + return nil + } + return res +} +// GetUpdateAllowsFetchAndMerge gets the update_allows_fetch_and_merge property value. Branch can pull changes from its upstream repository +// returns a *bool when successful +func (m *RepositoryRuleUpdate_parameters) GetUpdateAllowsFetchAndMerge()(*bool) { + return m.update_allows_fetch_and_merge +} +// Serialize serializes information the current object +func (m *RepositoryRuleUpdate_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("update_allows_fetch_and_merge", m.GetUpdateAllowsFetchAndMerge()) + 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 *RepositoryRuleUpdate_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetUpdateAllowsFetchAndMerge sets the update_allows_fetch_and_merge property value. Branch can pull changes from its upstream repository +func (m *RepositoryRuleUpdate_parameters) SetUpdateAllowsFetchAndMerge(value *bool)() { + m.update_allows_fetch_and_merge = value +} +type RepositoryRuleUpdate_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetUpdateAllowsFetchAndMerge()(*bool) + SetUpdateAllowsFetchAndMerge(value *bool)() +} diff --git a/pkg/github/models/repository_rule_update_escaped_type.go b/pkg/github/models/repository_rule_update_escaped_type.go new file mode 100644 index 00000000..a6733470 --- /dev/null +++ b/pkg/github/models/repository_rule_update_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleUpdate_type int + +const ( + UPDATE_REPOSITORYRULEUPDATE_TYPE RepositoryRuleUpdate_type = iota +) + +func (i RepositoryRuleUpdate_type) String() string { + return []string{"update"}[i] +} +func ParseRepositoryRuleUpdate_type(v string) (any, error) { + result := UPDATE_REPOSITORYRULEUPDATE_TYPE + switch v { + case "update": + result = UPDATE_REPOSITORYRULEUPDATE_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleUpdate_type(values []RepositoryRuleUpdate_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleUpdate_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_rule_workflows.go b/pkg/github/models/repository_rule_workflows.go new file mode 100644 index 00000000..eee7ba64 --- /dev/null +++ b/pkg/github/models/repository_rule_workflows.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleWorkflows require all changes made to a targeted branch to pass the specified workflows before they can be merged. +type RepositoryRuleWorkflows 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 parameters property + parameters RepositoryRuleWorkflows_parametersable + // The type property + typeEscaped *RepositoryRuleWorkflows_type +} +// NewRepositoryRuleWorkflows instantiates a new RepositoryRuleWorkflows and sets the default values. +func NewRepositoryRuleWorkflows()(*RepositoryRuleWorkflows) { + m := &RepositoryRuleWorkflows{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleWorkflowsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleWorkflowsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleWorkflows(), 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 *RepositoryRuleWorkflows) 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 *RepositoryRuleWorkflows) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["parameters"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleWorkflows_parametersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParameters(val.(RepositoryRuleWorkflows_parametersable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleWorkflows_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RepositoryRuleWorkflows_type)) + } + return nil + } + return res +} +// GetParameters gets the parameters property value. The parameters property +// returns a RepositoryRuleWorkflows_parametersable when successful +func (m *RepositoryRuleWorkflows) GetParameters()(RepositoryRuleWorkflows_parametersable) { + return m.parameters +} +// GetTypeEscaped gets the type property value. The type property +// returns a *RepositoryRuleWorkflows_type when successful +func (m *RepositoryRuleWorkflows) GetTypeEscaped()(*RepositoryRuleWorkflows_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RepositoryRuleWorkflows) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("parameters", m.GetParameters()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RepositoryRuleWorkflows) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetParameters sets the parameters property value. The parameters property +func (m *RepositoryRuleWorkflows) SetParameters(value RepositoryRuleWorkflows_parametersable)() { + m.parameters = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *RepositoryRuleWorkflows) SetTypeEscaped(value *RepositoryRuleWorkflows_type)() { + m.typeEscaped = value +} +type RepositoryRuleWorkflowsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetParameters()(RepositoryRuleWorkflows_parametersable) + GetTypeEscaped()(*RepositoryRuleWorkflows_type) + SetParameters(value RepositoryRuleWorkflows_parametersable)() + SetTypeEscaped(value *RepositoryRuleWorkflows_type)() +} diff --git a/pkg/github/models/repository_rule_workflows_escaped_parameters.go b/pkg/github/models/repository_rule_workflows_escaped_parameters.go new file mode 100644 index 00000000..47cefd91 --- /dev/null +++ b/pkg/github/models/repository_rule_workflows_escaped_parameters.go @@ -0,0 +1,121 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleWorkflows_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 + // Allow repositories and branches to be created if a check would otherwise prohibit it. + do_not_enforce_on_create *bool + // Workflows that must pass for this rule to pass. + workflows []RepositoryRuleParamsWorkflowFileReferenceable +} +// NewRepositoryRuleWorkflows_parameters instantiates a new RepositoryRuleWorkflows_parameters and sets the default values. +func NewRepositoryRuleWorkflows_parameters()(*RepositoryRuleWorkflows_parameters) { + m := &RepositoryRuleWorkflows_parameters{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleWorkflows_parametersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleWorkflows_parametersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleWorkflows_parameters(), 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 *RepositoryRuleWorkflows_parameters) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDoNotEnforceOnCreate gets the do_not_enforce_on_create property value. Allow repositories and branches to be created if a check would otherwise prohibit it. +// returns a *bool when successful +func (m *RepositoryRuleWorkflows_parameters) GetDoNotEnforceOnCreate()(*bool) { + return m.do_not_enforce_on_create +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleWorkflows_parameters) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["do_not_enforce_on_create"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDoNotEnforceOnCreate(val) + } + return nil + } + res["workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryRuleParamsWorkflowFileReferenceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryRuleParamsWorkflowFileReferenceable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryRuleParamsWorkflowFileReferenceable) + } + } + m.SetWorkflows(res) + } + return nil + } + return res +} +// GetWorkflows gets the workflows property value. Workflows that must pass for this rule to pass. +// returns a []RepositoryRuleParamsWorkflowFileReferenceable when successful +func (m *RepositoryRuleWorkflows_parameters) GetWorkflows()([]RepositoryRuleParamsWorkflowFileReferenceable) { + return m.workflows +} +// Serialize serializes information the current object +func (m *RepositoryRuleWorkflows_parameters) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("do_not_enforce_on_create", m.GetDoNotEnforceOnCreate()) + if err != nil { + return err + } + } + if m.GetWorkflows() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWorkflows())) + for i, v := range m.GetWorkflows() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("workflows", 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 *RepositoryRuleWorkflows_parameters) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDoNotEnforceOnCreate sets the do_not_enforce_on_create property value. Allow repositories and branches to be created if a check would otherwise prohibit it. +func (m *RepositoryRuleWorkflows_parameters) SetDoNotEnforceOnCreate(value *bool)() { + m.do_not_enforce_on_create = value +} +// SetWorkflows sets the workflows property value. Workflows that must pass for this rule to pass. +func (m *RepositoryRuleWorkflows_parameters) SetWorkflows(value []RepositoryRuleParamsWorkflowFileReferenceable)() { + m.workflows = value +} +type RepositoryRuleWorkflows_parametersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDoNotEnforceOnCreate()(*bool) + GetWorkflows()([]RepositoryRuleParamsWorkflowFileReferenceable) + SetDoNotEnforceOnCreate(value *bool)() + SetWorkflows(value []RepositoryRuleParamsWorkflowFileReferenceable)() +} diff --git a/pkg/github/models/repository_rule_workflows_escaped_type.go b/pkg/github/models/repository_rule_workflows_escaped_type.go new file mode 100644 index 00000000..978cbd7c --- /dev/null +++ b/pkg/github/models/repository_rule_workflows_escaped_type.go @@ -0,0 +1,30 @@ +package models +type RepositoryRuleWorkflows_type int + +const ( + WORKFLOWS_REPOSITORYRULEWORKFLOWS_TYPE RepositoryRuleWorkflows_type = iota +) + +func (i RepositoryRuleWorkflows_type) String() string { + return []string{"workflows"}[i] +} +func ParseRepositoryRuleWorkflows_type(v string) (any, error) { + result := WORKFLOWS_REPOSITORYRULEWORKFLOWS_TYPE + switch v { + case "workflows": + result = WORKFLOWS_REPOSITORYRULEWORKFLOWS_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleWorkflows_type(values []RepositoryRuleWorkflows_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleWorkflows_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_ruleset.go b/pkg/github/models/repository_ruleset.go new file mode 100644 index 00000000..e117fd6b --- /dev/null +++ b/pkg/github/models/repository_ruleset.go @@ -0,0 +1,573 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRuleset a set of rules to apply when specified conditions are met. +type RepositoryRuleset struct { + // The _links property + _links RepositoryRuleset__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The actors that can bypass the rules in this ruleset + bypass_actors []RepositoryRulesetBypassActorable + // The conditions property + conditions RepositoryRuleset_RepositoryRuleset_conditionsable + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The bypass type of the user making the API request for this ruleset. This field is only returned whenquerying the repository-level endpoint. + current_user_can_bypass *RepositoryRuleset_current_user_can_bypass + // The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page. + enforcement *RepositoryRuleEnforcement + // The ID of the ruleset + id *int32 + // The name of the ruleset + name *string + // The node_id property + node_id *string + // The rules property + rules []RepositoryRuleable + // The name of the source + source *string + // The type of the source of the ruleset + source_type *RepositoryRuleset_source_type + // The target of the ruleset + target *RepositoryRuleset_target + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// RepositoryRuleset_RepositoryRuleset_conditions composed type wrapper for classes OrgRulesetConditionsable, RepositoryRulesetConditionsable +type RepositoryRuleset_RepositoryRuleset_conditions struct { + // Composed type representation for type OrgRulesetConditionsable + orgRulesetConditions OrgRulesetConditionsable + // Composed type representation for type RepositoryRulesetConditionsable + repositoryRulesetConditions RepositoryRulesetConditionsable +} +// NewRepositoryRuleset_RepositoryRuleset_conditions instantiates a new RepositoryRuleset_RepositoryRuleset_conditions and sets the default values. +func NewRepositoryRuleset_RepositoryRuleset_conditions()(*RepositoryRuleset_RepositoryRuleset_conditions) { + m := &RepositoryRuleset_RepositoryRuleset_conditions{ + } + return m +} +// CreateRepositoryRuleset_RepositoryRuleset_conditionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleset_RepositoryRuleset_conditionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewRepositoryRuleset_RepositoryRuleset_conditions() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateOrgRulesetConditionsFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(OrgRulesetConditionsable); ok { + result.SetOrgRulesetConditions(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateRepositoryRulesetConditionsFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(RepositoryRulesetConditionsable); ok { + result.SetRepositoryRulesetConditions(cast) + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleset_RepositoryRuleset_conditions) 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 *RepositoryRuleset_RepositoryRuleset_conditions) GetIsComposedType()(bool) { + return true +} +// GetOrgRulesetConditions gets the orgRulesetConditions property value. Composed type representation for type OrgRulesetConditionsable +// returns a OrgRulesetConditionsable when successful +func (m *RepositoryRuleset_RepositoryRuleset_conditions) GetOrgRulesetConditions()(OrgRulesetConditionsable) { + return m.orgRulesetConditions +} +// GetRepositoryRulesetConditions gets the repositoryRulesetConditions property value. Composed type representation for type RepositoryRulesetConditionsable +// returns a RepositoryRulesetConditionsable when successful +func (m *RepositoryRuleset_RepositoryRuleset_conditions) GetRepositoryRulesetConditions()(RepositoryRulesetConditionsable) { + return m.repositoryRulesetConditions +} +// Serialize serializes information the current object +func (m *RepositoryRuleset_RepositoryRuleset_conditions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetOrgRulesetConditions() != nil { + err := writer.WriteObjectValue("", m.GetOrgRulesetConditions()) + if err != nil { + return err + } + } else if m.GetRepositoryRulesetConditions() != nil { + err := writer.WriteObjectValue("", m.GetRepositoryRulesetConditions()) + if err != nil { + return err + } + } + return nil +} +// SetOrgRulesetConditions sets the orgRulesetConditions property value. Composed type representation for type OrgRulesetConditionsable +func (m *RepositoryRuleset_RepositoryRuleset_conditions) SetOrgRulesetConditions(value OrgRulesetConditionsable)() { + m.orgRulesetConditions = value +} +// SetRepositoryRulesetConditions sets the repositoryRulesetConditions property value. Composed type representation for type RepositoryRulesetConditionsable +func (m *RepositoryRuleset_RepositoryRuleset_conditions) SetRepositoryRulesetConditions(value RepositoryRulesetConditionsable)() { + m.repositoryRulesetConditions = value +} +type RepositoryRuleset_RepositoryRuleset_conditionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetOrgRulesetConditions()(OrgRulesetConditionsable) + GetRepositoryRulesetConditions()(RepositoryRulesetConditionsable) + SetOrgRulesetConditions(value OrgRulesetConditionsable)() + SetRepositoryRulesetConditions(value RepositoryRulesetConditionsable)() +} +// NewRepositoryRuleset instantiates a new RepositoryRuleset and sets the default values. +func NewRepositoryRuleset()(*RepositoryRuleset) { + m := &RepositoryRuleset{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRulesetFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRulesetFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleset(), 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 *RepositoryRuleset) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassActors gets the bypass_actors property value. The actors that can bypass the rules in this ruleset +// returns a []RepositoryRulesetBypassActorable when successful +func (m *RepositoryRuleset) GetBypassActors()([]RepositoryRulesetBypassActorable) { + return m.bypass_actors +} +// GetConditions gets the conditions property value. The conditions property +// returns a RepositoryRuleset_RepositoryRuleset_conditionsable when successful +func (m *RepositoryRuleset) GetConditions()(RepositoryRuleset_RepositoryRuleset_conditionsable) { + return m.conditions +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *RepositoryRuleset) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCurrentUserCanBypass gets the current_user_can_bypass property value. The bypass type of the user making the API request for this ruleset. This field is only returned whenquerying the repository-level endpoint. +// returns a *RepositoryRuleset_current_user_can_bypass when successful +func (m *RepositoryRuleset) GetCurrentUserCanBypass()(*RepositoryRuleset_current_user_can_bypass) { + return m.current_user_can_bypass +} +// GetEnforcement gets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page. +// returns a *RepositoryRuleEnforcement when successful +func (m *RepositoryRuleset) GetEnforcement()(*RepositoryRuleEnforcement) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRuleset) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleset__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(RepositoryRuleset__linksable)) + } + return nil + } + res["bypass_actors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryRulesetBypassActorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryRulesetBypassActorable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryRulesetBypassActorable) + } + } + m.SetBypassActors(res) + } + return nil + } + res["conditions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleset_RepositoryRuleset_conditionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConditions(val.(RepositoryRuleset_RepositoryRuleset_conditionsable)) + } + return nil + } + 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["current_user_can_bypass"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleset_current_user_can_bypass) + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserCanBypass(val.(*RepositoryRuleset_current_user_can_bypass)) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleEnforcement) + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val.(*RepositoryRuleEnforcement)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["rules"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRepositoryRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RepositoryRuleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RepositoryRuleable) + } + } + m.SetRules(res) + } + return nil + } + res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSource(val) + } + return nil + } + res["source_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleset_source_type) + if err != nil { + return err + } + if val != nil { + m.SetSourceType(val.(*RepositoryRuleset_source_type)) + } + return nil + } + res["target"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRuleset_target) + if err != nil { + return err + } + if val != nil { + m.SetTarget(val.(*RepositoryRuleset_target)) + } + 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 + } + return res +} +// GetId gets the id property value. The ID of the ruleset +// returns a *int32 when successful +func (m *RepositoryRuleset) GetId()(*int32) { + return m.id +} +// GetLinks gets the _links property value. The _links property +// returns a RepositoryRuleset__linksable when successful +func (m *RepositoryRuleset) GetLinks()(RepositoryRuleset__linksable) { + return m._links +} +// GetName gets the name property value. The name of the ruleset +// returns a *string when successful +func (m *RepositoryRuleset) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *RepositoryRuleset) GetNodeId()(*string) { + return m.node_id +} +// GetRules gets the rules property value. The rules property +// returns a []RepositoryRuleable when successful +func (m *RepositoryRuleset) GetRules()([]RepositoryRuleable) { + return m.rules +} +// GetSource gets the source property value. The name of the source +// returns a *string when successful +func (m *RepositoryRuleset) GetSource()(*string) { + return m.source +} +// GetSourceType gets the source_type property value. The type of the source of the ruleset +// returns a *RepositoryRuleset_source_type when successful +func (m *RepositoryRuleset) GetSourceType()(*RepositoryRuleset_source_type) { + return m.source_type +} +// GetTarget gets the target property value. The target of the ruleset +// returns a *RepositoryRuleset_target when successful +func (m *RepositoryRuleset) GetTarget()(*RepositoryRuleset_target) { + return m.target +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *RepositoryRuleset) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *RepositoryRuleset) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBypassActors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetBypassActors())) + for i, v := range m.GetBypassActors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("bypass_actors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("conditions", m.GetConditions()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + if m.GetCurrentUserCanBypass() != nil { + cast := (*m.GetCurrentUserCanBypass()).String() + err := writer.WriteStringValue("current_user_can_bypass", &cast) + if err != nil { + return err + } + } + if m.GetEnforcement() != nil { + cast := (*m.GetEnforcement()).String() + err := writer.WriteStringValue("enforcement", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetRules() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRules())) + for i, v := range m.GetRules() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("rules", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("source", m.GetSource()) + if err != nil { + return err + } + } + if m.GetSourceType() != nil { + cast := (*m.GetSourceType()).String() + err := writer.WriteStringValue("source_type", &cast) + if err != nil { + return err + } + } + if m.GetTarget() != nil { + cast := (*m.GetTarget()).String() + err := writer.WriteStringValue("target", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *RepositoryRuleset) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassActors sets the bypass_actors property value. The actors that can bypass the rules in this ruleset +func (m *RepositoryRuleset) SetBypassActors(value []RepositoryRulesetBypassActorable)() { + m.bypass_actors = value +} +// SetConditions sets the conditions property value. The conditions property +func (m *RepositoryRuleset) SetConditions(value RepositoryRuleset_RepositoryRuleset_conditionsable)() { + m.conditions = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *RepositoryRuleset) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCurrentUserCanBypass sets the current_user_can_bypass property value. The bypass type of the user making the API request for this ruleset. This field is only returned whenquerying the repository-level endpoint. +func (m *RepositoryRuleset) SetCurrentUserCanBypass(value *RepositoryRuleset_current_user_can_bypass)() { + m.current_user_can_bypass = value +} +// SetEnforcement sets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page. +func (m *RepositoryRuleset) SetEnforcement(value *RepositoryRuleEnforcement)() { + m.enforcement = value +} +// SetId sets the id property value. The ID of the ruleset +func (m *RepositoryRuleset) SetId(value *int32)() { + m.id = value +} +// SetLinks sets the _links property value. The _links property +func (m *RepositoryRuleset) SetLinks(value RepositoryRuleset__linksable)() { + m._links = value +} +// SetName sets the name property value. The name of the ruleset +func (m *RepositoryRuleset) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *RepositoryRuleset) SetNodeId(value *string)() { + m.node_id = value +} +// SetRules sets the rules property value. The rules property +func (m *RepositoryRuleset) SetRules(value []RepositoryRuleable)() { + m.rules = value +} +// SetSource sets the source property value. The name of the source +func (m *RepositoryRuleset) SetSource(value *string)() { + m.source = value +} +// SetSourceType sets the source_type property value. The type of the source of the ruleset +func (m *RepositoryRuleset) SetSourceType(value *RepositoryRuleset_source_type)() { + m.source_type = value +} +// SetTarget sets the target property value. The target of the ruleset +func (m *RepositoryRuleset) SetTarget(value *RepositoryRuleset_target)() { + m.target = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *RepositoryRuleset) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type RepositoryRulesetable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassActors()([]RepositoryRulesetBypassActorable) + GetConditions()(RepositoryRuleset_RepositoryRuleset_conditionsable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCurrentUserCanBypass()(*RepositoryRuleset_current_user_can_bypass) + GetEnforcement()(*RepositoryRuleEnforcement) + GetId()(*int32) + GetLinks()(RepositoryRuleset__linksable) + GetName()(*string) + GetNodeId()(*string) + GetRules()([]RepositoryRuleable) + GetSource()(*string) + GetSourceType()(*RepositoryRuleset_source_type) + GetTarget()(*RepositoryRuleset_target) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetBypassActors(value []RepositoryRulesetBypassActorable)() + SetConditions(value RepositoryRuleset_RepositoryRuleset_conditionsable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCurrentUserCanBypass(value *RepositoryRuleset_current_user_can_bypass)() + SetEnforcement(value *RepositoryRuleEnforcement)() + SetId(value *int32)() + SetLinks(value RepositoryRuleset__linksable)() + SetName(value *string)() + SetNodeId(value *string)() + SetRules(value []RepositoryRuleable)() + SetSource(value *string)() + SetSourceType(value *RepositoryRuleset_source_type)() + SetTarget(value *RepositoryRuleset_target)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/repository_ruleset_bypass_actor.go b/pkg/github/models/repository_ruleset_bypass_actor.go new file mode 100644 index 00000000..9f383c46 --- /dev/null +++ b/pkg/github/models/repository_ruleset_bypass_actor.go @@ -0,0 +1,141 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRulesetBypassActor an actor that can bypass rules in a ruleset +type RepositoryRulesetBypassActor struct { + // The ID of the actor that can bypass a ruleset. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. + actor_id *int32 + // The type of actor that can bypass a ruleset. + actor_type *RepositoryRulesetBypassActor_actor_type + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. + bypass_mode *RepositoryRulesetBypassActor_bypass_mode +} +// NewRepositoryRulesetBypassActor instantiates a new RepositoryRulesetBypassActor and sets the default values. +func NewRepositoryRulesetBypassActor()(*RepositoryRulesetBypassActor) { + m := &RepositoryRulesetBypassActor{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRulesetBypassActorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRulesetBypassActorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRulesetBypassActor(), nil +} +// GetActorId gets the actor_id property value. The ID of the actor that can bypass a ruleset. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. +// returns a *int32 when successful +func (m *RepositoryRulesetBypassActor) GetActorId()(*int32) { + return m.actor_id +} +// GetActorType gets the actor_type property value. The type of actor that can bypass a ruleset. +// returns a *RepositoryRulesetBypassActor_actor_type when successful +func (m *RepositoryRulesetBypassActor) GetActorType()(*RepositoryRulesetBypassActor_actor_type) { + return m.actor_type +} +// 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 *RepositoryRulesetBypassActor) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassMode gets the bypass_mode property value. When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. +// returns a *RepositoryRulesetBypassActor_bypass_mode when successful +func (m *RepositoryRulesetBypassActor) GetBypassMode()(*RepositoryRulesetBypassActor_bypass_mode) { + return m.bypass_mode +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRulesetBypassActor) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActorId(val) + } + return nil + } + res["actor_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRulesetBypassActor_actor_type) + if err != nil { + return err + } + if val != nil { + m.SetActorType(val.(*RepositoryRulesetBypassActor_actor_type)) + } + return nil + } + res["bypass_mode"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRepositoryRulesetBypassActor_bypass_mode) + if err != nil { + return err + } + if val != nil { + m.SetBypassMode(val.(*RepositoryRulesetBypassActor_bypass_mode)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *RepositoryRulesetBypassActor) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("actor_id", m.GetActorId()) + if err != nil { + return err + } + } + if m.GetActorType() != nil { + cast := (*m.GetActorType()).String() + err := writer.WriteStringValue("actor_type", &cast) + if err != nil { + return err + } + } + if m.GetBypassMode() != nil { + cast := (*m.GetBypassMode()).String() + err := writer.WriteStringValue("bypass_mode", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActorId sets the actor_id property value. The ID of the actor that can bypass a ruleset. If `actor_type` is `OrganizationAdmin`, this should be `1`. If `actor_type` is `DeployKey`, this should be null. `OrganizationAdmin` is not applicable for personal repositories. +func (m *RepositoryRulesetBypassActor) SetActorId(value *int32)() { + m.actor_id = value +} +// SetActorType sets the actor_type property value. The type of actor that can bypass a ruleset. +func (m *RepositoryRulesetBypassActor) SetActorType(value *RepositoryRulesetBypassActor_actor_type)() { + m.actor_type = 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 *RepositoryRulesetBypassActor) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassMode sets the bypass_mode property value. When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. +func (m *RepositoryRulesetBypassActor) SetBypassMode(value *RepositoryRulesetBypassActor_bypass_mode)() { + m.bypass_mode = value +} +type RepositoryRulesetBypassActorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActorId()(*int32) + GetActorType()(*RepositoryRulesetBypassActor_actor_type) + GetBypassMode()(*RepositoryRulesetBypassActor_bypass_mode) + SetActorId(value *int32)() + SetActorType(value *RepositoryRulesetBypassActor_actor_type)() + SetBypassMode(value *RepositoryRulesetBypassActor_bypass_mode)() +} diff --git a/pkg/github/models/repository_ruleset_bypass_actor_escaped_actor_escaped_type.go b/pkg/github/models/repository_ruleset_bypass_actor_escaped_actor_escaped_type.go new file mode 100644 index 00000000..39f567f6 --- /dev/null +++ b/pkg/github/models/repository_ruleset_bypass_actor_escaped_actor_escaped_type.go @@ -0,0 +1,43 @@ +package models +// The type of actor that can bypass a ruleset. +type RepositoryRulesetBypassActor_actor_type int + +const ( + INTEGRATION_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE RepositoryRulesetBypassActor_actor_type = iota + ORGANIZATIONADMIN_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + REPOSITORYROLE_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + TEAM_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + DEPLOYKEY_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE +) + +func (i RepositoryRulesetBypassActor_actor_type) String() string { + return []string{"Integration", "OrganizationAdmin", "RepositoryRole", "Team", "DeployKey"}[i] +} +func ParseRepositoryRulesetBypassActor_actor_type(v string) (any, error) { + result := INTEGRATION_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + switch v { + case "Integration": + result = INTEGRATION_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + case "OrganizationAdmin": + result = ORGANIZATIONADMIN_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + case "RepositoryRole": + result = REPOSITORYROLE_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + case "Team": + result = TEAM_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + case "DeployKey": + result = DEPLOYKEY_REPOSITORYRULESETBYPASSACTOR_ACTOR_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRulesetBypassActor_actor_type(values []RepositoryRulesetBypassActor_actor_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRulesetBypassActor_actor_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_ruleset_bypass_actor_escaped_bypass_escaped_mode.go b/pkg/github/models/repository_ruleset_bypass_actor_escaped_bypass_escaped_mode.go new file mode 100644 index 00000000..0e3249df --- /dev/null +++ b/pkg/github/models/repository_ruleset_bypass_actor_escaped_bypass_escaped_mode.go @@ -0,0 +1,34 @@ +package models +// When the specified actor can bypass the ruleset. `pull_request` means that an actor can only bypass rules on pull requests. `pull_request` is not applicable for the `DeployKey` actor type. +type RepositoryRulesetBypassActor_bypass_mode int + +const ( + ALWAYS_REPOSITORYRULESETBYPASSACTOR_BYPASS_MODE RepositoryRulesetBypassActor_bypass_mode = iota + PULL_REQUEST_REPOSITORYRULESETBYPASSACTOR_BYPASS_MODE +) + +func (i RepositoryRulesetBypassActor_bypass_mode) String() string { + return []string{"always", "pull_request"}[i] +} +func ParseRepositoryRulesetBypassActor_bypass_mode(v string) (any, error) { + result := ALWAYS_REPOSITORYRULESETBYPASSACTOR_BYPASS_MODE + switch v { + case "always": + result = ALWAYS_REPOSITORYRULESETBYPASSACTOR_BYPASS_MODE + case "pull_request": + result = PULL_REQUEST_REPOSITORYRULESETBYPASSACTOR_BYPASS_MODE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRulesetBypassActor_bypass_mode(values []RepositoryRulesetBypassActor_bypass_mode) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRulesetBypassActor_bypass_mode) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_ruleset_conditions.go b/pkg/github/models/repository_ruleset_conditions.go new file mode 100644 index 00000000..1b422421 --- /dev/null +++ b/pkg/github/models/repository_ruleset_conditions.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositoryRulesetConditions parameters for a repository ruleset ref name condition +type RepositoryRulesetConditions 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 ref_name property + ref_name RepositoryRulesetConditions_ref_nameable +} +// NewRepositoryRulesetConditions instantiates a new RepositoryRulesetConditions and sets the default values. +func NewRepositoryRulesetConditions()(*RepositoryRulesetConditions) { + m := &RepositoryRulesetConditions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRulesetConditionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRulesetConditionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRulesetConditions(), 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 *RepositoryRulesetConditions) 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 *RepositoryRulesetConditions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ref_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRulesetConditions_ref_nameFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRefName(val.(RepositoryRulesetConditions_ref_nameable)) + } + return nil + } + return res +} +// GetRefName gets the ref_name property value. The ref_name property +// returns a RepositoryRulesetConditions_ref_nameable when successful +func (m *RepositoryRulesetConditions) GetRefName()(RepositoryRulesetConditions_ref_nameable) { + return m.ref_name +} +// Serialize serializes information the current object +func (m *RepositoryRulesetConditions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("ref_name", m.GetRefName()) + 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 *RepositoryRulesetConditions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRefName sets the ref_name property value. The ref_name property +func (m *RepositoryRulesetConditions) SetRefName(value RepositoryRulesetConditions_ref_nameable)() { + m.ref_name = value +} +type RepositoryRulesetConditionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRefName()(RepositoryRulesetConditions_ref_nameable) + SetRefName(value RepositoryRulesetConditions_ref_nameable)() +} diff --git a/pkg/github/models/repository_ruleset_conditions_escaped_ref_escaped_name.go b/pkg/github/models/repository_ruleset_conditions_escaped_ref_escaped_name.go new file mode 100644 index 00000000..93efdde7 --- /dev/null +++ b/pkg/github/models/repository_ruleset_conditions_escaped_ref_escaped_name.go @@ -0,0 +1,121 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRulesetConditions_ref_name struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match. + exclude []string + // Array of ref names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~DEFAULT_BRANCH` to include the default branch or `~ALL` to include all branches. + include []string +} +// NewRepositoryRulesetConditions_ref_name instantiates a new RepositoryRulesetConditions_ref_name and sets the default values. +func NewRepositoryRulesetConditions_ref_name()(*RepositoryRulesetConditions_ref_name) { + m := &RepositoryRulesetConditions_ref_name{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRulesetConditions_ref_nameFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRulesetConditions_ref_nameFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRulesetConditions_ref_name(), 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 *RepositoryRulesetConditions_ref_name) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExclude gets the exclude property value. Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match. +// returns a []string when successful +func (m *RepositoryRulesetConditions_ref_name) GetExclude()([]string) { + return m.exclude +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RepositoryRulesetConditions_ref_name) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["exclude"] = 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.SetExclude(res) + } + return nil + } + res["include"] = 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.SetInclude(res) + } + return nil + } + return res +} +// GetInclude gets the include property value. Array of ref names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~DEFAULT_BRANCH` to include the default branch or `~ALL` to include all branches. +// returns a []string when successful +func (m *RepositoryRulesetConditions_ref_name) GetInclude()([]string) { + return m.include +} +// Serialize serializes information the current object +func (m *RepositoryRulesetConditions_ref_name) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetExclude() != nil { + err := writer.WriteCollectionOfStringValues("exclude", m.GetExclude()) + if err != nil { + return err + } + } + if m.GetInclude() != nil { + err := writer.WriteCollectionOfStringValues("include", m.GetInclude()) + 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 *RepositoryRulesetConditions_ref_name) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExclude sets the exclude property value. Array of ref names or patterns to exclude. The condition will not pass if any of these patterns match. +func (m *RepositoryRulesetConditions_ref_name) SetExclude(value []string)() { + m.exclude = value +} +// SetInclude sets the include property value. Array of ref names or patterns to include. One of these patterns must match for the condition to pass. Also accepts `~DEFAULT_BRANCH` to include the default branch or `~ALL` to include all branches. +func (m *RepositoryRulesetConditions_ref_name) SetInclude(value []string)() { + m.include = value +} +type RepositoryRulesetConditions_ref_nameable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExclude()([]string) + GetInclude()([]string) + SetExclude(value []string)() + SetInclude(value []string)() +} diff --git a/pkg/github/models/repository_ruleset_escaped__escaped_links.go b/pkg/github/models/repository_ruleset_escaped__escaped_links.go new file mode 100644 index 00000000..aa5b4ce8 --- /dev/null +++ b/pkg/github/models/repository_ruleset_escaped__escaped_links.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleset__links 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 html property + html RepositoryRuleset__links_htmlable + // The self property + self RepositoryRuleset__links_selfable +} +// NewRepositoryRuleset__links instantiates a new RepositoryRuleset__links and sets the default values. +func NewRepositoryRuleset__links()(*RepositoryRuleset__links) { + m := &RepositoryRuleset__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleset__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleset__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleset__links(), 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 *RepositoryRuleset__links) 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 *RepositoryRuleset__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleset__links_htmlFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHtml(val.(RepositoryRuleset__links_htmlable)) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRepositoryRuleset__links_selfFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSelf(val.(RepositoryRuleset__links_selfable)) + } + return nil + } + return res +} +// GetHtml gets the html property value. The html property +// returns a RepositoryRuleset__links_htmlable when successful +func (m *RepositoryRuleset__links) GetHtml()(RepositoryRuleset__links_htmlable) { + return m.html +} +// GetSelf gets the self property value. The self property +// returns a RepositoryRuleset__links_selfable when successful +func (m *RepositoryRuleset__links) GetSelf()(RepositoryRuleset__links_selfable) { + return m.self +} +// Serialize serializes information the current object +func (m *RepositoryRuleset__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("self", m.GetSelf()) + 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 *RepositoryRuleset__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtml sets the html property value. The html property +func (m *RepositoryRuleset__links) SetHtml(value RepositoryRuleset__links_htmlable)() { + m.html = value +} +// SetSelf sets the self property value. The self property +func (m *RepositoryRuleset__links) SetSelf(value RepositoryRuleset__links_selfable)() { + m.self = value +} +type RepositoryRuleset__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtml()(RepositoryRuleset__links_htmlable) + GetSelf()(RepositoryRuleset__links_selfable) + SetHtml(value RepositoryRuleset__links_htmlable)() + SetSelf(value RepositoryRuleset__links_selfable)() +} diff --git a/pkg/github/models/repository_ruleset_escaped__escaped_links_escaped_html.go b/pkg/github/models/repository_ruleset_escaped__escaped_links_escaped_html.go new file mode 100644 index 00000000..478469fd --- /dev/null +++ b/pkg/github/models/repository_ruleset_escaped__escaped_links_escaped_html.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleset__links_html 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 html URL of the ruleset + href *string +} +// NewRepositoryRuleset__links_html instantiates a new RepositoryRuleset__links_html and sets the default values. +func NewRepositoryRuleset__links_html()(*RepositoryRuleset__links_html) { + m := &RepositoryRuleset__links_html{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleset__links_htmlFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleset__links_htmlFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleset__links_html(), 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 *RepositoryRuleset__links_html) 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 *RepositoryRuleset__links_html) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The html URL of the ruleset +// returns a *string when successful +func (m *RepositoryRuleset__links_html) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *RepositoryRuleset__links_html) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *RepositoryRuleset__links_html) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The html URL of the ruleset +func (m *RepositoryRuleset__links_html) SetHref(value *string)() { + m.href = value +} +type RepositoryRuleset__links_htmlable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/pkg/github/models/repository_ruleset_escaped__escaped_links_escaped_self.go b/pkg/github/models/repository_ruleset_escaped__escaped_links_escaped_self.go new file mode 100644 index 00000000..692b860f --- /dev/null +++ b/pkg/github/models/repository_ruleset_escaped__escaped_links_escaped_self.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RepositoryRuleset__links_self 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 URL of the ruleset + href *string +} +// NewRepositoryRuleset__links_self instantiates a new RepositoryRuleset__links_self and sets the default values. +func NewRepositoryRuleset__links_self()(*RepositoryRuleset__links_self) { + m := &RepositoryRuleset__links_self{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoryRuleset__links_selfFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoryRuleset__links_selfFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoryRuleset__links_self(), 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 *RepositoryRuleset__links_self) 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 *RepositoryRuleset__links_self) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The URL of the ruleset +// returns a *string when successful +func (m *RepositoryRuleset__links_self) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *RepositoryRuleset__links_self) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *RepositoryRuleset__links_self) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The URL of the ruleset +func (m *RepositoryRuleset__links_self) SetHref(value *string)() { + m.href = value +} +type RepositoryRuleset__links_selfable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/pkg/github/models/repository_ruleset_escaped_current_escaped_user_escaped_can_escaped_bypass.go b/pkg/github/models/repository_ruleset_escaped_current_escaped_user_escaped_can_escaped_bypass.go new file mode 100644 index 00000000..c351e1a3 --- /dev/null +++ b/pkg/github/models/repository_ruleset_escaped_current_escaped_user_escaped_can_escaped_bypass.go @@ -0,0 +1,37 @@ +package models +// The bypass type of the user making the API request for this ruleset. This field is only returned whenquerying the repository-level endpoint. +type RepositoryRuleset_current_user_can_bypass int + +const ( + ALWAYS_REPOSITORYRULESET_CURRENT_USER_CAN_BYPASS RepositoryRuleset_current_user_can_bypass = iota + PULL_REQUESTS_ONLY_REPOSITORYRULESET_CURRENT_USER_CAN_BYPASS + NEVER_REPOSITORYRULESET_CURRENT_USER_CAN_BYPASS +) + +func (i RepositoryRuleset_current_user_can_bypass) String() string { + return []string{"always", "pull_requests_only", "never"}[i] +} +func ParseRepositoryRuleset_current_user_can_bypass(v string) (any, error) { + result := ALWAYS_REPOSITORYRULESET_CURRENT_USER_CAN_BYPASS + switch v { + case "always": + result = ALWAYS_REPOSITORYRULESET_CURRENT_USER_CAN_BYPASS + case "pull_requests_only": + result = PULL_REQUESTS_ONLY_REPOSITORYRULESET_CURRENT_USER_CAN_BYPASS + case "never": + result = NEVER_REPOSITORYRULESET_CURRENT_USER_CAN_BYPASS + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleset_current_user_can_bypass(values []RepositoryRuleset_current_user_can_bypass) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleset_current_user_can_bypass) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_ruleset_escaped_source_escaped_type.go b/pkg/github/models/repository_ruleset_escaped_source_escaped_type.go new file mode 100644 index 00000000..4f486276 --- /dev/null +++ b/pkg/github/models/repository_ruleset_escaped_source_escaped_type.go @@ -0,0 +1,34 @@ +package models +// The type of the source of the ruleset +type RepositoryRuleset_source_type int + +const ( + REPOSITORY_REPOSITORYRULESET_SOURCE_TYPE RepositoryRuleset_source_type = iota + ORGANIZATION_REPOSITORYRULESET_SOURCE_TYPE +) + +func (i RepositoryRuleset_source_type) String() string { + return []string{"Repository", "Organization"}[i] +} +func ParseRepositoryRuleset_source_type(v string) (any, error) { + result := REPOSITORY_REPOSITORYRULESET_SOURCE_TYPE + switch v { + case "Repository": + result = REPOSITORY_REPOSITORYRULESET_SOURCE_TYPE + case "Organization": + result = ORGANIZATION_REPOSITORYRULESET_SOURCE_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleset_source_type(values []RepositoryRuleset_source_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleset_source_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_ruleset_escaped_target.go b/pkg/github/models/repository_ruleset_escaped_target.go new file mode 100644 index 00000000..ea036dc8 --- /dev/null +++ b/pkg/github/models/repository_ruleset_escaped_target.go @@ -0,0 +1,37 @@ +package models +// The target of the ruleset +type RepositoryRuleset_target int + +const ( + BRANCH_REPOSITORYRULESET_TARGET RepositoryRuleset_target = iota + TAG_REPOSITORYRULESET_TARGET + PUSH_REPOSITORYRULESET_TARGET +) + +func (i RepositoryRuleset_target) String() string { + return []string{"branch", "tag", "push"}[i] +} +func ParseRepositoryRuleset_target(v string) (any, error) { + result := BRANCH_REPOSITORYRULESET_TARGET + switch v { + case "branch": + result = BRANCH_REPOSITORYRULESET_TARGET + case "tag": + result = TAG_REPOSITORYRULESET_TARGET + case "push": + result = PUSH_REPOSITORYRULESET_TARGET + default: + return nil, nil + } + return &result, nil +} +func SerializeRepositoryRuleset_target(values []RepositoryRuleset_target) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepositoryRuleset_target) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/repository_subscription.go b/pkg/github/models/repository_subscription.go new file mode 100644 index 00000000..da687342 --- /dev/null +++ b/pkg/github/models/repository_subscription.go @@ -0,0 +1,227 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RepositorySubscription repository invitations let you manage who you collaborate with. +type RepositorySubscription 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 + // Determines if all notifications should be blocked from this repository. + ignored *bool + // The reason property + reason *string + // The repository_url property + repository_url *string + // Determines if notifications should be received from this repository. + subscribed *bool + // The url property + url *string +} +// NewRepositorySubscription instantiates a new RepositorySubscription and sets the default values. +func NewRepositorySubscription()(*RepositorySubscription) { + m := &RepositorySubscription{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositorySubscriptionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositorySubscriptionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositorySubscription(), 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 *RepositorySubscription) 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 *RepositorySubscription) 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 *RepositorySubscription) 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["ignored"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIgnored(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["subscribed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribed(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetIgnored gets the ignored property value. Determines if all notifications should be blocked from this repository. +// returns a *bool when successful +func (m *RepositorySubscription) GetIgnored()(*bool) { + return m.ignored +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *RepositorySubscription) GetReason()(*string) { + return m.reason +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *RepositorySubscription) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetSubscribed gets the subscribed property value. Determines if notifications should be received from this repository. +// returns a *bool when successful +func (m *RepositorySubscription) GetSubscribed()(*bool) { + return m.subscribed +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *RepositorySubscription) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *RepositorySubscription) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("ignored", m.GetIgnored()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("subscribed", m.GetSubscribed()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *RepositorySubscription) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *RepositorySubscription) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetIgnored sets the ignored property value. Determines if all notifications should be blocked from this repository. +func (m *RepositorySubscription) SetIgnored(value *bool)() { + m.ignored = value +} +// SetReason sets the reason property value. The reason property +func (m *RepositorySubscription) SetReason(value *string)() { + m.reason = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *RepositorySubscription) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetSubscribed sets the subscribed property value. Determines if notifications should be received from this repository. +func (m *RepositorySubscription) SetSubscribed(value *bool)() { + m.subscribed = value +} +// SetUrl sets the url property value. The url property +func (m *RepositorySubscription) SetUrl(value *string)() { + m.url = value +} +type RepositorySubscriptionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetIgnored()(*bool) + GetReason()(*string) + GetRepositoryUrl()(*string) + GetSubscribed()(*bool) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetIgnored(value *bool)() + SetReason(value *string)() + SetRepositoryUrl(value *string)() + SetSubscribed(value *bool)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/review_comment.go b/pkg/github/models/review_comment.go new file mode 100644 index 00000000..f9e40b4f --- /dev/null +++ b/pkg/github/models/review_comment.go @@ -0,0 +1,872 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReviewComment legacy Review Comment +type ReviewComment struct { + // The _links property + _links ReviewComment__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // The body property + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The commit_id property + commit_id *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The diff_hunk property + diff_hunk *string + // The html_url property + html_url *string + // The id property + id *int64 + // The in_reply_to_id property + in_reply_to_id *int32 + // The line of the blob to which the comment applies. The last line of the range for a multi-line comment + line *int32 + // The node_id property + node_id *string + // The original_commit_id property + original_commit_id *string + // The original line of the blob to which the comment applies. The last line of the range for a multi-line comment + original_line *int32 + // The original_position property + original_position *int32 + // The original first line of the range for a multi-line comment. + original_start_line *int32 + // The path property + path *string + // The position property + position *int32 + // The pull_request_review_id property + pull_request_review_id *int64 + // The pull_request_url property + pull_request_url *string + // The reactions property + reactions ReactionRollupable + // The side of the first line of the range for a multi-line comment. + side *ReviewComment_side + // The first line of the range for a multi-line comment. + start_line *int32 + // The side of the first line of the range for a multi-line comment. + start_side *ReviewComment_start_side + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // A GitHub user. + user NullableSimpleUserable +} +// NewReviewComment instantiates a new ReviewComment and sets the default values. +func NewReviewComment()(*ReviewComment) { + m := &ReviewComment{ + } + m.SetAdditionalData(make(map[string]any)) + sideValue := RIGHT_REVIEWCOMMENT_SIDE + m.SetSide(&sideValue) + start_sideValue := RIGHT_REVIEWCOMMENT_START_SIDE + m.SetStartSide(&start_sideValue) + return m +} +// CreateReviewCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewComment(), 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 *ReviewComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *ReviewComment) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *ReviewComment) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *ReviewComment) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *ReviewComment) GetBodyText()(*string) { + return m.body_text +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *ReviewComment) GetCommitId()(*string) { + return m.commit_id +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *ReviewComment) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDiffHunk gets the diff_hunk property value. The diff_hunk property +// returns a *string when successful +func (m *ReviewComment) GetDiffHunk()(*string) { + return m.diff_hunk +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReviewComment__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(ReviewComment__linksable)) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + 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["diff_hunk"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiffHunk(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["in_reply_to_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInReplyToId(val) + } + return nil + } + res["line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLine(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["original_commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOriginalCommitId(val) + } + return nil + } + res["original_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOriginalLine(val) + } + return nil + } + res["original_position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOriginalPosition(val) + } + return nil + } + res["original_start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOriginalStartLine(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + res["pull_request_review_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestReviewId(val) + } + return nil + } + res["pull_request_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestUrl(val) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["side"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseReviewComment_side) + if err != nil { + return err + } + if val != nil { + m.SetSide(val.(*ReviewComment_side)) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + res["start_side"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseReviewComment_start_side) + if err != nil { + return err + } + if val != nil { + m.SetStartSide(val.(*ReviewComment_start_side)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(NullableSimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *ReviewComment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *ReviewComment) GetId()(*int64) { + return m.id +} +// GetInReplyToId gets the in_reply_to_id property value. The in_reply_to_id property +// returns a *int32 when successful +func (m *ReviewComment) GetInReplyToId()(*int32) { + return m.in_reply_to_id +} +// GetLine gets the line property value. The line of the blob to which the comment applies. The last line of the range for a multi-line comment +// returns a *int32 when successful +func (m *ReviewComment) GetLine()(*int32) { + return m.line +} +// GetLinks gets the _links property value. The _links property +// returns a ReviewComment__linksable when successful +func (m *ReviewComment) GetLinks()(ReviewComment__linksable) { + return m._links +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ReviewComment) GetNodeId()(*string) { + return m.node_id +} +// GetOriginalCommitId gets the original_commit_id property value. The original_commit_id property +// returns a *string when successful +func (m *ReviewComment) GetOriginalCommitId()(*string) { + return m.original_commit_id +} +// GetOriginalLine gets the original_line property value. The original line of the blob to which the comment applies. The last line of the range for a multi-line comment +// returns a *int32 when successful +func (m *ReviewComment) GetOriginalLine()(*int32) { + return m.original_line +} +// GetOriginalPosition gets the original_position property value. The original_position property +// returns a *int32 when successful +func (m *ReviewComment) GetOriginalPosition()(*int32) { + return m.original_position +} +// GetOriginalStartLine gets the original_start_line property value. The original first line of the range for a multi-line comment. +// returns a *int32 when successful +func (m *ReviewComment) GetOriginalStartLine()(*int32) { + return m.original_start_line +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *ReviewComment) GetPath()(*string) { + return m.path +} +// GetPosition gets the position property value. The position property +// returns a *int32 when successful +func (m *ReviewComment) GetPosition()(*int32) { + return m.position +} +// GetPullRequestReviewId gets the pull_request_review_id property value. The pull_request_review_id property +// returns a *int64 when successful +func (m *ReviewComment) GetPullRequestReviewId()(*int64) { + return m.pull_request_review_id +} +// GetPullRequestUrl gets the pull_request_url property value. The pull_request_url property +// returns a *string when successful +func (m *ReviewComment) GetPullRequestUrl()(*string) { + return m.pull_request_url +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *ReviewComment) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetSide gets the side property value. The side of the first line of the range for a multi-line comment. +// returns a *ReviewComment_side when successful +func (m *ReviewComment) GetSide()(*ReviewComment_side) { + return m.side +} +// GetStartLine gets the start_line property value. The first line of the range for a multi-line comment. +// returns a *int32 when successful +func (m *ReviewComment) GetStartLine()(*int32) { + return m.start_line +} +// GetStartSide gets the start_side property value. The side of the first line of the range for a multi-line comment. +// returns a *ReviewComment_start_side when successful +func (m *ReviewComment) GetStartSide()(*ReviewComment_start_side) { + return m.start_side +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *ReviewComment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ReviewComment) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *ReviewComment) GetUser()(NullableSimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *ReviewComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("diff_hunk", m.GetDiffHunk()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("in_reply_to_id", m.GetInReplyToId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("line", m.GetLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("original_commit_id", m.GetOriginalCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("original_line", m.GetOriginalLine()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("original_position", m.GetOriginalPosition()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("original_start_line", m.GetOriginalStartLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("position", m.GetPosition()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("pull_request_review_id", m.GetPullRequestReviewId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pull_request_url", m.GetPullRequestUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + if m.GetSide() != nil { + cast := (*m.GetSide()).String() + err := writer.WriteStringValue("side", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("start_line", m.GetStartLine()) + if err != nil { + return err + } + } + if m.GetStartSide() != nil { + cast := (*m.GetStartSide()).String() + err := writer.WriteStringValue("start_side", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *ReviewComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *ReviewComment) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. The body property +func (m *ReviewComment) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *ReviewComment) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *ReviewComment) SetBodyText(value *string)() { + m.body_text = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *ReviewComment) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ReviewComment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDiffHunk sets the diff_hunk property value. The diff_hunk property +func (m *ReviewComment) SetDiffHunk(value *string)() { + m.diff_hunk = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *ReviewComment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *ReviewComment) SetId(value *int64)() { + m.id = value +} +// SetInReplyToId sets the in_reply_to_id property value. The in_reply_to_id property +func (m *ReviewComment) SetInReplyToId(value *int32)() { + m.in_reply_to_id = value +} +// SetLine sets the line property value. The line of the blob to which the comment applies. The last line of the range for a multi-line comment +func (m *ReviewComment) SetLine(value *int32)() { + m.line = value +} +// SetLinks sets the _links property value. The _links property +func (m *ReviewComment) SetLinks(value ReviewComment__linksable)() { + m._links = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ReviewComment) SetNodeId(value *string)() { + m.node_id = value +} +// SetOriginalCommitId sets the original_commit_id property value. The original_commit_id property +func (m *ReviewComment) SetOriginalCommitId(value *string)() { + m.original_commit_id = value +} +// SetOriginalLine sets the original_line property value. The original line of the blob to which the comment applies. The last line of the range for a multi-line comment +func (m *ReviewComment) SetOriginalLine(value *int32)() { + m.original_line = value +} +// SetOriginalPosition sets the original_position property value. The original_position property +func (m *ReviewComment) SetOriginalPosition(value *int32)() { + m.original_position = value +} +// SetOriginalStartLine sets the original_start_line property value. The original first line of the range for a multi-line comment. +func (m *ReviewComment) SetOriginalStartLine(value *int32)() { + m.original_start_line = value +} +// SetPath sets the path property value. The path property +func (m *ReviewComment) SetPath(value *string)() { + m.path = value +} +// SetPosition sets the position property value. The position property +func (m *ReviewComment) SetPosition(value *int32)() { + m.position = value +} +// SetPullRequestReviewId sets the pull_request_review_id property value. The pull_request_review_id property +func (m *ReviewComment) SetPullRequestReviewId(value *int64)() { + m.pull_request_review_id = value +} +// SetPullRequestUrl sets the pull_request_url property value. The pull_request_url property +func (m *ReviewComment) SetPullRequestUrl(value *string)() { + m.pull_request_url = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *ReviewComment) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetSide sets the side property value. The side of the first line of the range for a multi-line comment. +func (m *ReviewComment) SetSide(value *ReviewComment_side)() { + m.side = value +} +// SetStartLine sets the start_line property value. The first line of the range for a multi-line comment. +func (m *ReviewComment) SetStartLine(value *int32)() { + m.start_line = value +} +// SetStartSide sets the start_side property value. The side of the first line of the range for a multi-line comment. +func (m *ReviewComment) SetStartSide(value *ReviewComment_start_side)() { + m.start_side = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *ReviewComment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *ReviewComment) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *ReviewComment) SetUser(value NullableSimpleUserable)() { + m.user = value +} +type ReviewCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetCommitId()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDiffHunk()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetInReplyToId()(*int32) + GetLine()(*int32) + GetLinks()(ReviewComment__linksable) + GetNodeId()(*string) + GetOriginalCommitId()(*string) + GetOriginalLine()(*int32) + GetOriginalPosition()(*int32) + GetOriginalStartLine()(*int32) + GetPath()(*string) + GetPosition()(*int32) + GetPullRequestReviewId()(*int64) + GetPullRequestUrl()(*string) + GetReactions()(ReactionRollupable) + GetSide()(*ReviewComment_side) + GetStartLine()(*int32) + GetStartSide()(*ReviewComment_start_side) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(NullableSimpleUserable) + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetCommitId(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDiffHunk(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetInReplyToId(value *int32)() + SetLine(value *int32)() + SetLinks(value ReviewComment__linksable)() + SetNodeId(value *string)() + SetOriginalCommitId(value *string)() + SetOriginalLine(value *int32)() + SetOriginalPosition(value *int32)() + SetOriginalStartLine(value *int32)() + SetPath(value *string)() + SetPosition(value *int32)() + SetPullRequestReviewId(value *int64)() + SetPullRequestUrl(value *string)() + SetReactions(value ReactionRollupable)() + SetSide(value *ReviewComment_side)() + SetStartLine(value *int32)() + SetStartSide(value *ReviewComment_start_side)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value NullableSimpleUserable)() +} diff --git a/pkg/github/models/review_comment_escaped__escaped_links.go b/pkg/github/models/review_comment_escaped__escaped_links.go new file mode 100644 index 00000000..ed64eb2d --- /dev/null +++ b/pkg/github/models/review_comment_escaped__escaped_links.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ReviewComment__links struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Hypermedia Link + html Linkable + // Hypermedia Link + pull_request Linkable + // Hypermedia Link + self Linkable +} +// NewReviewComment__links instantiates a new ReviewComment__links and sets the default values. +func NewReviewComment__links()(*ReviewComment__links) { + m := &ReviewComment__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReviewComment__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewComment__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewComment__links(), 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 *ReviewComment__links) 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 *ReviewComment__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHtml(val.(Linkable)) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(Linkable)) + } + return nil + } + res["self"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateLinkFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSelf(val.(Linkable)) + } + return nil + } + return res +} +// GetHtml gets the html property value. Hypermedia Link +// returns a Linkable when successful +func (m *ReviewComment__links) GetHtml()(Linkable) { + return m.html +} +// GetPullRequest gets the pull_request property value. Hypermedia Link +// returns a Linkable when successful +func (m *ReviewComment__links) GetPullRequest()(Linkable) { + return m.pull_request +} +// GetSelf gets the self property value. Hypermedia Link +// returns a Linkable when successful +func (m *ReviewComment__links) GetSelf()(Linkable) { + return m.self +} +// Serialize serializes information the current object +func (m *ReviewComment__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("self", m.GetSelf()) + 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 *ReviewComment__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtml sets the html property value. Hypermedia Link +func (m *ReviewComment__links) SetHtml(value Linkable)() { + m.html = value +} +// SetPullRequest sets the pull_request property value. Hypermedia Link +func (m *ReviewComment__links) SetPullRequest(value Linkable)() { + m.pull_request = value +} +// SetSelf sets the self property value. Hypermedia Link +func (m *ReviewComment__links) SetSelf(value Linkable)() { + m.self = value +} +type ReviewComment__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtml()(Linkable) + GetPullRequest()(Linkable) + GetSelf()(Linkable) + SetHtml(value Linkable)() + SetPullRequest(value Linkable)() + SetSelf(value Linkable)() +} diff --git a/pkg/github/models/review_comment_escaped_side.go b/pkg/github/models/review_comment_escaped_side.go new file mode 100644 index 00000000..709785d7 --- /dev/null +++ b/pkg/github/models/review_comment_escaped_side.go @@ -0,0 +1,34 @@ +package models +// The side of the first line of the range for a multi-line comment. +type ReviewComment_side int + +const ( + LEFT_REVIEWCOMMENT_SIDE ReviewComment_side = iota + RIGHT_REVIEWCOMMENT_SIDE +) + +func (i ReviewComment_side) String() string { + return []string{"LEFT", "RIGHT"}[i] +} +func ParseReviewComment_side(v string) (any, error) { + result := LEFT_REVIEWCOMMENT_SIDE + switch v { + case "LEFT": + result = LEFT_REVIEWCOMMENT_SIDE + case "RIGHT": + result = RIGHT_REVIEWCOMMENT_SIDE + default: + return nil, nil + } + return &result, nil +} +func SerializeReviewComment_side(values []ReviewComment_side) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReviewComment_side) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/review_comment_escaped_start_escaped_side.go b/pkg/github/models/review_comment_escaped_start_escaped_side.go new file mode 100644 index 00000000..80b32dd6 --- /dev/null +++ b/pkg/github/models/review_comment_escaped_start_escaped_side.go @@ -0,0 +1,34 @@ +package models +// The side of the first line of the range for a multi-line comment. +type ReviewComment_start_side int + +const ( + LEFT_REVIEWCOMMENT_START_SIDE ReviewComment_start_side = iota + RIGHT_REVIEWCOMMENT_START_SIDE +) + +func (i ReviewComment_start_side) String() string { + return []string{"LEFT", "RIGHT"}[i] +} +func ParseReviewComment_start_side(v string) (any, error) { + result := LEFT_REVIEWCOMMENT_START_SIDE + switch v { + case "LEFT": + result = LEFT_REVIEWCOMMENT_START_SIDE + case "RIGHT": + result = RIGHT_REVIEWCOMMENT_START_SIDE + default: + return nil, nil + } + return &result, nil +} +func SerializeReviewComment_start_side(values []ReviewComment_start_side) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReviewComment_start_side) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/review_custom_gates_comment_required.go b/pkg/github/models/review_custom_gates_comment_required.go new file mode 100644 index 00000000..fe7a3343 --- /dev/null +++ b/pkg/github/models/review_custom_gates_comment_required.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ReviewCustomGatesCommentRequired struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Comment associated with the pending deployment protection rule. **Required when state is not provided.** + comment *string + // The name of the environment to approve or reject. + environment_name *string +} +// NewReviewCustomGatesCommentRequired instantiates a new ReviewCustomGatesCommentRequired and sets the default values. +func NewReviewCustomGatesCommentRequired()(*ReviewCustomGatesCommentRequired) { + m := &ReviewCustomGatesCommentRequired{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReviewCustomGatesCommentRequiredFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewCustomGatesCommentRequiredFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewCustomGatesCommentRequired(), 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 *ReviewCustomGatesCommentRequired) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComment gets the comment property value. Comment associated with the pending deployment protection rule. **Required when state is not provided.** +// returns a *string when successful +func (m *ReviewCustomGatesCommentRequired) GetComment()(*string) { + return m.comment +} +// GetEnvironmentName gets the environment_name property value. The name of the environment to approve or reject. +// returns a *string when successful +func (m *ReviewCustomGatesCommentRequired) GetEnvironmentName()(*string) { + return m.environment_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewCustomGatesCommentRequired) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetComment(val) + } + return nil + } + res["environment_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironmentName(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ReviewCustomGatesCommentRequired) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("comment", m.GetComment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment_name", m.GetEnvironmentName()) + 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 *ReviewCustomGatesCommentRequired) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComment sets the comment property value. Comment associated with the pending deployment protection rule. **Required when state is not provided.** +func (m *ReviewCustomGatesCommentRequired) SetComment(value *string)() { + m.comment = value +} +// SetEnvironmentName sets the environment_name property value. The name of the environment to approve or reject. +func (m *ReviewCustomGatesCommentRequired) SetEnvironmentName(value *string)() { + m.environment_name = value +} +type ReviewCustomGatesCommentRequiredable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComment()(*string) + GetEnvironmentName()(*string) + SetComment(value *string)() + SetEnvironmentName(value *string)() +} diff --git a/pkg/github/models/review_custom_gates_state_required.go b/pkg/github/models/review_custom_gates_state_required.go new file mode 100644 index 00000000..1cd04c17 --- /dev/null +++ b/pkg/github/models/review_custom_gates_state_required.go @@ -0,0 +1,139 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ReviewCustomGatesStateRequired struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Optional comment to include with the review. + comment *string + // The name of the environment to approve or reject. + environment_name *string + // Whether to approve or reject deployment to the specified environments. + state *ReviewCustomGatesStateRequired_state +} +// NewReviewCustomGatesStateRequired instantiates a new ReviewCustomGatesStateRequired and sets the default values. +func NewReviewCustomGatesStateRequired()(*ReviewCustomGatesStateRequired) { + m := &ReviewCustomGatesStateRequired{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReviewCustomGatesStateRequiredFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewCustomGatesStateRequiredFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewCustomGatesStateRequired(), 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 *ReviewCustomGatesStateRequired) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComment gets the comment property value. Optional comment to include with the review. +// returns a *string when successful +func (m *ReviewCustomGatesStateRequired) GetComment()(*string) { + return m.comment +} +// GetEnvironmentName gets the environment_name property value. The name of the environment to approve or reject. +// returns a *string when successful +func (m *ReviewCustomGatesStateRequired) GetEnvironmentName()(*string) { + return m.environment_name +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewCustomGatesStateRequired) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetComment(val) + } + return nil + } + res["environment_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironmentName(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseReviewCustomGatesStateRequired_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*ReviewCustomGatesStateRequired_state)) + } + return nil + } + return res +} +// GetState gets the state property value. Whether to approve or reject deployment to the specified environments. +// returns a *ReviewCustomGatesStateRequired_state when successful +func (m *ReviewCustomGatesStateRequired) GetState()(*ReviewCustomGatesStateRequired_state) { + return m.state +} +// Serialize serializes information the current object +func (m *ReviewCustomGatesStateRequired) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("comment", m.GetComment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment_name", m.GetEnvironmentName()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &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 *ReviewCustomGatesStateRequired) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComment sets the comment property value. Optional comment to include with the review. +func (m *ReviewCustomGatesStateRequired) SetComment(value *string)() { + m.comment = value +} +// SetEnvironmentName sets the environment_name property value. The name of the environment to approve or reject. +func (m *ReviewCustomGatesStateRequired) SetEnvironmentName(value *string)() { + m.environment_name = value +} +// SetState sets the state property value. Whether to approve or reject deployment to the specified environments. +func (m *ReviewCustomGatesStateRequired) SetState(value *ReviewCustomGatesStateRequired_state)() { + m.state = value +} +type ReviewCustomGatesStateRequiredable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComment()(*string) + GetEnvironmentName()(*string) + GetState()(*ReviewCustomGatesStateRequired_state) + SetComment(value *string)() + SetEnvironmentName(value *string)() + SetState(value *ReviewCustomGatesStateRequired_state)() +} diff --git a/pkg/github/models/review_custom_gates_state_required_escaped_state.go b/pkg/github/models/review_custom_gates_state_required_escaped_state.go new file mode 100644 index 00000000..79db28d8 --- /dev/null +++ b/pkg/github/models/review_custom_gates_state_required_escaped_state.go @@ -0,0 +1,34 @@ +package models +// Whether to approve or reject deployment to the specified environments. +type ReviewCustomGatesStateRequired_state int + +const ( + APPROVED_REVIEWCUSTOMGATESSTATEREQUIRED_STATE ReviewCustomGatesStateRequired_state = iota + REJECTED_REVIEWCUSTOMGATESSTATEREQUIRED_STATE +) + +func (i ReviewCustomGatesStateRequired_state) String() string { + return []string{"approved", "rejected"}[i] +} +func ParseReviewCustomGatesStateRequired_state(v string) (any, error) { + result := APPROVED_REVIEWCUSTOMGATESSTATEREQUIRED_STATE + switch v { + case "approved": + result = APPROVED_REVIEWCUSTOMGATESSTATEREQUIRED_STATE + case "rejected": + result = REJECTED_REVIEWCUSTOMGATESSTATEREQUIRED_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeReviewCustomGatesStateRequired_state(values []ReviewCustomGatesStateRequired_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReviewCustomGatesStateRequired_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/review_dismissed_issue_event.go b/pkg/github/models/review_dismissed_issue_event.go new file mode 100644 index 00000000..668bd74b --- /dev/null +++ b/pkg/github/models/review_dismissed_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReviewDismissedIssueEvent review Dismissed Issue Event +type ReviewDismissedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The dismissed_review property + dismissed_review ReviewDismissedIssueEvent_dismissed_reviewable + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewReviewDismissedIssueEvent instantiates a new ReviewDismissedIssueEvent and sets the default values. +func NewReviewDismissedIssueEvent()(*ReviewDismissedIssueEvent) { + m := &ReviewDismissedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReviewDismissedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewDismissedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewDismissedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ReviewDismissedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *ReviewDismissedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetDismissedReview gets the dismissed_review property value. The dismissed_review property +// returns a ReviewDismissedIssueEvent_dismissed_reviewable when successful +func (m *ReviewDismissedIssueEvent) GetDismissedReview()(ReviewDismissedIssueEvent_dismissed_reviewable) { + return m.dismissed_review +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewDismissedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["dismissed_review"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReviewDismissedIssueEvent_dismissed_reviewFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReview(val.(ReviewDismissedIssueEvent_dismissed_reviewable)) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ReviewDismissedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *ReviewDismissedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ReviewDismissedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dismissed_review", m.GetDismissedReview()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *ReviewDismissedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *ReviewDismissedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *ReviewDismissedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *ReviewDismissedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ReviewDismissedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetDismissedReview sets the dismissed_review property value. The dismissed_review property +func (m *ReviewDismissedIssueEvent) SetDismissedReview(value ReviewDismissedIssueEvent_dismissed_reviewable)() { + m.dismissed_review = value +} +// SetEvent sets the event property value. The event property +func (m *ReviewDismissedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *ReviewDismissedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ReviewDismissedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *ReviewDismissedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *ReviewDismissedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type ReviewDismissedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetDismissedReview()(ReviewDismissedIssueEvent_dismissed_reviewable) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetDismissedReview(value ReviewDismissedIssueEvent_dismissed_reviewable)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/review_dismissed_issue_event_escaped_dismissed_escaped_review.go b/pkg/github/models/review_dismissed_issue_event_escaped_dismissed_escaped_review.go new file mode 100644 index 00000000..56440070 --- /dev/null +++ b/pkg/github/models/review_dismissed_issue_event_escaped_dismissed_escaped_review.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ReviewDismissedIssueEvent_dismissed_review 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 dismissal_commit_id property + dismissal_commit_id *string + // The dismissal_message property + dismissal_message *string + // The review_id property + review_id *int32 + // The state property + state *string +} +// NewReviewDismissedIssueEvent_dismissed_review instantiates a new ReviewDismissedIssueEvent_dismissed_review and sets the default values. +func NewReviewDismissedIssueEvent_dismissed_review()(*ReviewDismissedIssueEvent_dismissed_review) { + m := &ReviewDismissedIssueEvent_dismissed_review{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReviewDismissedIssueEvent_dismissed_reviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewDismissedIssueEvent_dismissed_reviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewDismissedIssueEvent_dismissed_review(), 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 *ReviewDismissedIssueEvent_dismissed_review) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDismissalCommitId gets the dismissal_commit_id property value. The dismissal_commit_id property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent_dismissed_review) GetDismissalCommitId()(*string) { + return m.dismissal_commit_id +} +// GetDismissalMessage gets the dismissal_message property value. The dismissal_message property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent_dismissed_review) GetDismissalMessage()(*string) { + return m.dismissal_message +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewDismissedIssueEvent_dismissed_review) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["dismissal_commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissalCommitId(val) + } + return nil + } + res["dismissal_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissalMessage(val) + } + return nil + } + res["review_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetReviewId(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + return res +} +// GetReviewId gets the review_id property value. The review_id property +// returns a *int32 when successful +func (m *ReviewDismissedIssueEvent_dismissed_review) GetReviewId()(*int32) { + return m.review_id +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *ReviewDismissedIssueEvent_dismissed_review) GetState()(*string) { + return m.state +} +// Serialize serializes information the current object +func (m *ReviewDismissedIssueEvent_dismissed_review) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("dismissal_commit_id", m.GetDismissalCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("dismissal_message", m.GetDismissalMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("review_id", m.GetReviewId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + 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 *ReviewDismissedIssueEvent_dismissed_review) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDismissalCommitId sets the dismissal_commit_id property value. The dismissal_commit_id property +func (m *ReviewDismissedIssueEvent_dismissed_review) SetDismissalCommitId(value *string)() { + m.dismissal_commit_id = value +} +// SetDismissalMessage sets the dismissal_message property value. The dismissal_message property +func (m *ReviewDismissedIssueEvent_dismissed_review) SetDismissalMessage(value *string)() { + m.dismissal_message = value +} +// SetReviewId sets the review_id property value. The review_id property +func (m *ReviewDismissedIssueEvent_dismissed_review) SetReviewId(value *int32)() { + m.review_id = value +} +// SetState sets the state property value. The state property +func (m *ReviewDismissedIssueEvent_dismissed_review) SetState(value *string)() { + m.state = value +} +type ReviewDismissedIssueEvent_dismissed_reviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDismissalCommitId()(*string) + GetDismissalMessage()(*string) + GetReviewId()(*int32) + GetState()(*string) + SetDismissalCommitId(value *string)() + SetDismissalMessage(value *string)() + SetReviewId(value *int32)() + SetState(value *string)() +} diff --git a/pkg/github/models/review_request_removed_issue_event.go b/pkg/github/models/review_request_removed_issue_event.go new file mode 100644 index 00000000..9aca40a8 --- /dev/null +++ b/pkg/github/models/review_request_removed_issue_event.go @@ -0,0 +1,400 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReviewRequestRemovedIssueEvent review Request Removed Issue Event +type ReviewRequestRemovedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // A GitHub user. + requested_reviewer SimpleUserable + // Groups of organization members that gives permissions on specified repositories. + requested_team Teamable + // A GitHub user. + review_requester SimpleUserable + // The url property + url *string +} +// NewReviewRequestRemovedIssueEvent instantiates a new ReviewRequestRemovedIssueEvent and sets the default values. +func NewReviewRequestRemovedIssueEvent()(*ReviewRequestRemovedIssueEvent) { + m := &ReviewRequestRemovedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReviewRequestRemovedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewRequestRemovedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewRequestRemovedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ReviewRequestRemovedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *ReviewRequestRemovedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *ReviewRequestRemovedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *ReviewRequestRemovedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *ReviewRequestRemovedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *ReviewRequestRemovedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewRequestRemovedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["requested_reviewer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequestedReviewer(val.(SimpleUserable)) + } + return nil + } + res["requested_team"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequestedTeam(val.(Teamable)) + } + return nil + } + res["review_requester"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewRequester(val.(SimpleUserable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ReviewRequestRemovedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ReviewRequestRemovedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *ReviewRequestRemovedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetRequestedReviewer gets the requested_reviewer property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ReviewRequestRemovedIssueEvent) GetRequestedReviewer()(SimpleUserable) { + return m.requested_reviewer +} +// GetRequestedTeam gets the requested_team property value. Groups of organization members that gives permissions on specified repositories. +// returns a Teamable when successful +func (m *ReviewRequestRemovedIssueEvent) GetRequestedTeam()(Teamable) { + return m.requested_team +} +// GetReviewRequester gets the review_requester property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ReviewRequestRemovedIssueEvent) GetReviewRequester()(SimpleUserable) { + return m.review_requester +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ReviewRequestRemovedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ReviewRequestRemovedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("requested_reviewer", m.GetRequestedReviewer()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("requested_team", m.GetRequestedTeam()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("review_requester", m.GetReviewRequester()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *ReviewRequestRemovedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *ReviewRequestRemovedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *ReviewRequestRemovedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *ReviewRequestRemovedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ReviewRequestRemovedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *ReviewRequestRemovedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *ReviewRequestRemovedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ReviewRequestRemovedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *ReviewRequestRemovedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetRequestedReviewer sets the requested_reviewer property value. A GitHub user. +func (m *ReviewRequestRemovedIssueEvent) SetRequestedReviewer(value SimpleUserable)() { + m.requested_reviewer = value +} +// SetRequestedTeam sets the requested_team property value. Groups of organization members that gives permissions on specified repositories. +func (m *ReviewRequestRemovedIssueEvent) SetRequestedTeam(value Teamable)() { + m.requested_team = value +} +// SetReviewRequester sets the review_requester property value. A GitHub user. +func (m *ReviewRequestRemovedIssueEvent) SetReviewRequester(value SimpleUserable)() { + m.review_requester = value +} +// SetUrl sets the url property value. The url property +func (m *ReviewRequestRemovedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type ReviewRequestRemovedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetRequestedReviewer()(SimpleUserable) + GetRequestedTeam()(Teamable) + GetReviewRequester()(SimpleUserable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetRequestedReviewer(value SimpleUserable)() + SetRequestedTeam(value Teamable)() + SetReviewRequester(value SimpleUserable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/review_requested_issue_event.go b/pkg/github/models/review_requested_issue_event.go new file mode 100644 index 00000000..b35cf9cc --- /dev/null +++ b/pkg/github/models/review_requested_issue_event.go @@ -0,0 +1,400 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ReviewRequestedIssueEvent review Requested Issue Event +type ReviewRequestedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // A GitHub user. + requested_reviewer SimpleUserable + // Groups of organization members that gives permissions on specified repositories. + requested_team Teamable + // A GitHub user. + review_requester SimpleUserable + // The url property + url *string +} +// NewReviewRequestedIssueEvent instantiates a new ReviewRequestedIssueEvent and sets the default values. +func NewReviewRequestedIssueEvent()(*ReviewRequestedIssueEvent) { + m := &ReviewRequestedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReviewRequestedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReviewRequestedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReviewRequestedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ReviewRequestedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *ReviewRequestedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *ReviewRequestedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *ReviewRequestedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *ReviewRequestedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *ReviewRequestedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ReviewRequestedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["requested_reviewer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequestedReviewer(val.(SimpleUserable)) + } + return nil + } + res["requested_team"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequestedTeam(val.(Teamable)) + } + return nil + } + res["review_requester"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReviewRequester(val.(SimpleUserable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *ReviewRequestedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *ReviewRequestedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *ReviewRequestedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetRequestedReviewer gets the requested_reviewer property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ReviewRequestedIssueEvent) GetRequestedReviewer()(SimpleUserable) { + return m.requested_reviewer +} +// GetRequestedTeam gets the requested_team property value. Groups of organization members that gives permissions on specified repositories. +// returns a Teamable when successful +func (m *ReviewRequestedIssueEvent) GetRequestedTeam()(Teamable) { + return m.requested_team +} +// GetReviewRequester gets the review_requester property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *ReviewRequestedIssueEvent) GetReviewRequester()(SimpleUserable) { + return m.review_requester +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ReviewRequestedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ReviewRequestedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("requested_reviewer", m.GetRequestedReviewer()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("requested_team", m.GetRequestedTeam()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("review_requester", m.GetReviewRequester()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *ReviewRequestedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *ReviewRequestedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *ReviewRequestedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *ReviewRequestedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ReviewRequestedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *ReviewRequestedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *ReviewRequestedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *ReviewRequestedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *ReviewRequestedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetRequestedReviewer sets the requested_reviewer property value. A GitHub user. +func (m *ReviewRequestedIssueEvent) SetRequestedReviewer(value SimpleUserable)() { + m.requested_reviewer = value +} +// SetRequestedTeam sets the requested_team property value. Groups of organization members that gives permissions on specified repositories. +func (m *ReviewRequestedIssueEvent) SetRequestedTeam(value Teamable)() { + m.requested_team = value +} +// SetReviewRequester sets the review_requester property value. A GitHub user. +func (m *ReviewRequestedIssueEvent) SetReviewRequester(value SimpleUserable)() { + m.review_requester = value +} +// SetUrl sets the url property value. The url property +func (m *ReviewRequestedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type ReviewRequestedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetRequestedReviewer()(SimpleUserable) + GetRequestedTeam()(Teamable) + GetReviewRequester()(SimpleUserable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetRequestedReviewer(value SimpleUserable)() + SetRequestedTeam(value Teamable)() + SetReviewRequester(value SimpleUserable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/root.go b/pkg/github/models/root.go new file mode 100644 index 00000000..6f327934 --- /dev/null +++ b/pkg/github/models/root.go @@ -0,0 +1,1011 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Root 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 authorizations_url property + authorizations_url *string + // The code_search_url property + code_search_url *string + // The commit_search_url property + commit_search_url *string + // The current_user_authorizations_html_url property + current_user_authorizations_html_url *string + // The current_user_repositories_url property + current_user_repositories_url *string + // The current_user_url property + current_user_url *string + // The emails_url property + emails_url *string + // The emojis_url property + emojis_url *string + // The events_url property + events_url *string + // The feeds_url property + feeds_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The hub_url property + // Deprecated: + hub_url *string + // The issue_search_url property + issue_search_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The label_search_url property + label_search_url *string + // The notifications_url property + notifications_url *string + // The organization_repositories_url property + organization_repositories_url *string + // The organization_teams_url property + organization_teams_url *string + // The organization_url property + organization_url *string + // The public_gists_url property + public_gists_url *string + // The rate_limit_url property + rate_limit_url *string + // The repository_search_url property + repository_search_url *string + // The repository_url property + repository_url *string + // The starred_gists_url property + starred_gists_url *string + // The starred_url property + starred_url *string + // The topic_search_url property + topic_search_url *string + // The user_organizations_url property + user_organizations_url *string + // The user_repositories_url property + user_repositories_url *string + // The user_search_url property + user_search_url *string + // The user_url property + user_url *string +} +// NewRoot instantiates a new Root and sets the default values. +func NewRoot()(*Root) { + m := &Root{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRootFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRootFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRoot(), 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 *Root) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorizationsUrl gets the authorizations_url property value. The authorizations_url property +// returns a *string when successful +func (m *Root) GetAuthorizationsUrl()(*string) { + return m.authorizations_url +} +// GetCodeSearchUrl gets the code_search_url property value. The code_search_url property +// returns a *string when successful +func (m *Root) GetCodeSearchUrl()(*string) { + return m.code_search_url +} +// GetCommitSearchUrl gets the commit_search_url property value. The commit_search_url property +// returns a *string when successful +func (m *Root) GetCommitSearchUrl()(*string) { + return m.commit_search_url +} +// GetCurrentUserAuthorizationsHtmlUrl gets the current_user_authorizations_html_url property value. The current_user_authorizations_html_url property +// returns a *string when successful +func (m *Root) GetCurrentUserAuthorizationsHtmlUrl()(*string) { + return m.current_user_authorizations_html_url +} +// GetCurrentUserRepositoriesUrl gets the current_user_repositories_url property value. The current_user_repositories_url property +// returns a *string when successful +func (m *Root) GetCurrentUserRepositoriesUrl()(*string) { + return m.current_user_repositories_url +} +// GetCurrentUserUrl gets the current_user_url property value. The current_user_url property +// returns a *string when successful +func (m *Root) GetCurrentUserUrl()(*string) { + return m.current_user_url +} +// GetEmailsUrl gets the emails_url property value. The emails_url property +// returns a *string when successful +func (m *Root) GetEmailsUrl()(*string) { + return m.emails_url +} +// GetEmojisUrl gets the emojis_url property value. The emojis_url property +// returns a *string when successful +func (m *Root) GetEmojisUrl()(*string) { + return m.emojis_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *Root) GetEventsUrl()(*string) { + return m.events_url +} +// GetFeedsUrl gets the feeds_url property value. The feeds_url property +// returns a *string when successful +func (m *Root) GetFeedsUrl()(*string) { + return m.feeds_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Root) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["authorizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAuthorizationsUrl(val) + } + return nil + } + res["code_search_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCodeSearchUrl(val) + } + return nil + } + res["commit_search_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitSearchUrl(val) + } + return nil + } + res["current_user_authorizations_html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserAuthorizationsHtmlUrl(val) + } + return nil + } + res["current_user_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserRepositoriesUrl(val) + } + return nil + } + res["current_user_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCurrentUserUrl(val) + } + return nil + } + res["emails_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmailsUrl(val) + } + return nil + } + res["emojis_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmojisUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["feeds_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFeedsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["hub_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHubUrl(val) + } + return nil + } + res["issue_search_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueSearchUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["label_search_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelSearchUrl(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["organization_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationRepositoriesUrl(val) + } + return nil + } + res["organization_teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationTeamsUrl(val) + } + return nil + } + res["organization_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationUrl(val) + } + return nil + } + res["public_gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicGistsUrl(val) + } + return nil + } + res["rate_limit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRateLimitUrl(val) + } + return nil + } + res["repository_search_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositorySearchUrl(val) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["starred_gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredGistsUrl(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["topic_search_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTopicSearchUrl(val) + } + return nil + } + res["user_organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserOrganizationsUrl(val) + } + return nil + } + res["user_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserRepositoriesUrl(val) + } + return nil + } + res["user_search_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserSearchUrl(val) + } + return nil + } + res["user_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUserUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *Root) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *Root) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *Root) GetGistsUrl()(*string) { + return m.gists_url +} +// GetHubUrl gets the hub_url property value. The hub_url property +// Deprecated: +// returns a *string when successful +func (m *Root) GetHubUrl()(*string) { + return m.hub_url +} +// GetIssueSearchUrl gets the issue_search_url property value. The issue_search_url property +// returns a *string when successful +func (m *Root) GetIssueSearchUrl()(*string) { + return m.issue_search_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *Root) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *Root) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelSearchUrl gets the label_search_url property value. The label_search_url property +// returns a *string when successful +func (m *Root) GetLabelSearchUrl()(*string) { + return m.label_search_url +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *Root) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOrganizationRepositoriesUrl gets the organization_repositories_url property value. The organization_repositories_url property +// returns a *string when successful +func (m *Root) GetOrganizationRepositoriesUrl()(*string) { + return m.organization_repositories_url +} +// GetOrganizationTeamsUrl gets the organization_teams_url property value. The organization_teams_url property +// returns a *string when successful +func (m *Root) GetOrganizationTeamsUrl()(*string) { + return m.organization_teams_url +} +// GetOrganizationUrl gets the organization_url property value. The organization_url property +// returns a *string when successful +func (m *Root) GetOrganizationUrl()(*string) { + return m.organization_url +} +// GetPublicGistsUrl gets the public_gists_url property value. The public_gists_url property +// returns a *string when successful +func (m *Root) GetPublicGistsUrl()(*string) { + return m.public_gists_url +} +// GetRateLimitUrl gets the rate_limit_url property value. The rate_limit_url property +// returns a *string when successful +func (m *Root) GetRateLimitUrl()(*string) { + return m.rate_limit_url +} +// GetRepositorySearchUrl gets the repository_search_url property value. The repository_search_url property +// returns a *string when successful +func (m *Root) GetRepositorySearchUrl()(*string) { + return m.repository_search_url +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *Root) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetStarredGistsUrl gets the starred_gists_url property value. The starred_gists_url property +// returns a *string when successful +func (m *Root) GetStarredGistsUrl()(*string) { + return m.starred_gists_url +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *Root) GetStarredUrl()(*string) { + return m.starred_url +} +// GetTopicSearchUrl gets the topic_search_url property value. The topic_search_url property +// returns a *string when successful +func (m *Root) GetTopicSearchUrl()(*string) { + return m.topic_search_url +} +// GetUserOrganizationsUrl gets the user_organizations_url property value. The user_organizations_url property +// returns a *string when successful +func (m *Root) GetUserOrganizationsUrl()(*string) { + return m.user_organizations_url +} +// GetUserRepositoriesUrl gets the user_repositories_url property value. The user_repositories_url property +// returns a *string when successful +func (m *Root) GetUserRepositoriesUrl()(*string) { + return m.user_repositories_url +} +// GetUserSearchUrl gets the user_search_url property value. The user_search_url property +// returns a *string when successful +func (m *Root) GetUserSearchUrl()(*string) { + return m.user_search_url +} +// GetUserUrl gets the user_url property value. The user_url property +// returns a *string when successful +func (m *Root) GetUserUrl()(*string) { + return m.user_url +} +// Serialize serializes information the current object +func (m *Root) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("authorizations_url", m.GetAuthorizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("code_search_url", m.GetCodeSearchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_search_url", m.GetCommitSearchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("current_user_authorizations_html_url", m.GetCurrentUserAuthorizationsHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("current_user_repositories_url", m.GetCurrentUserRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("current_user_url", m.GetCurrentUserUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("emails_url", m.GetEmailsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("emojis_url", m.GetEmojisUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("feeds_url", m.GetFeedsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hub_url", m.GetHubUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_search_url", m.GetIssueSearchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("label_search_url", m.GetLabelSearchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_repositories_url", m.GetOrganizationRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_teams_url", m.GetOrganizationTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_url", m.GetOrganizationUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_gists_url", m.GetPublicGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("rate_limit_url", m.GetRateLimitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_search_url", m.GetRepositorySearchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_gists_url", m.GetStarredGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("topic_search_url", m.GetTopicSearchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user_organizations_url", m.GetUserOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user_repositories_url", m.GetUserRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user_search_url", m.GetUserSearchUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("user_url", m.GetUserUrl()) + 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 *Root) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorizationsUrl sets the authorizations_url property value. The authorizations_url property +func (m *Root) SetAuthorizationsUrl(value *string)() { + m.authorizations_url = value +} +// SetCodeSearchUrl sets the code_search_url property value. The code_search_url property +func (m *Root) SetCodeSearchUrl(value *string)() { + m.code_search_url = value +} +// SetCommitSearchUrl sets the commit_search_url property value. The commit_search_url property +func (m *Root) SetCommitSearchUrl(value *string)() { + m.commit_search_url = value +} +// SetCurrentUserAuthorizationsHtmlUrl sets the current_user_authorizations_html_url property value. The current_user_authorizations_html_url property +func (m *Root) SetCurrentUserAuthorizationsHtmlUrl(value *string)() { + m.current_user_authorizations_html_url = value +} +// SetCurrentUserRepositoriesUrl sets the current_user_repositories_url property value. The current_user_repositories_url property +func (m *Root) SetCurrentUserRepositoriesUrl(value *string)() { + m.current_user_repositories_url = value +} +// SetCurrentUserUrl sets the current_user_url property value. The current_user_url property +func (m *Root) SetCurrentUserUrl(value *string)() { + m.current_user_url = value +} +// SetEmailsUrl sets the emails_url property value. The emails_url property +func (m *Root) SetEmailsUrl(value *string)() { + m.emails_url = value +} +// SetEmojisUrl sets the emojis_url property value. The emojis_url property +func (m *Root) SetEmojisUrl(value *string)() { + m.emojis_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *Root) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFeedsUrl sets the feeds_url property value. The feeds_url property +func (m *Root) SetFeedsUrl(value *string)() { + m.feeds_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *Root) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *Root) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *Root) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetHubUrl sets the hub_url property value. The hub_url property +// Deprecated: +func (m *Root) SetHubUrl(value *string)() { + m.hub_url = value +} +// SetIssueSearchUrl sets the issue_search_url property value. The issue_search_url property +func (m *Root) SetIssueSearchUrl(value *string)() { + m.issue_search_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *Root) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *Root) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelSearchUrl sets the label_search_url property value. The label_search_url property +func (m *Root) SetLabelSearchUrl(value *string)() { + m.label_search_url = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *Root) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOrganizationRepositoriesUrl sets the organization_repositories_url property value. The organization_repositories_url property +func (m *Root) SetOrganizationRepositoriesUrl(value *string)() { + m.organization_repositories_url = value +} +// SetOrganizationTeamsUrl sets the organization_teams_url property value. The organization_teams_url property +func (m *Root) SetOrganizationTeamsUrl(value *string)() { + m.organization_teams_url = value +} +// SetOrganizationUrl sets the organization_url property value. The organization_url property +func (m *Root) SetOrganizationUrl(value *string)() { + m.organization_url = value +} +// SetPublicGistsUrl sets the public_gists_url property value. The public_gists_url property +func (m *Root) SetPublicGistsUrl(value *string)() { + m.public_gists_url = value +} +// SetRateLimitUrl sets the rate_limit_url property value. The rate_limit_url property +func (m *Root) SetRateLimitUrl(value *string)() { + m.rate_limit_url = value +} +// SetRepositorySearchUrl sets the repository_search_url property value. The repository_search_url property +func (m *Root) SetRepositorySearchUrl(value *string)() { + m.repository_search_url = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *Root) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetStarredGistsUrl sets the starred_gists_url property value. The starred_gists_url property +func (m *Root) SetStarredGistsUrl(value *string)() { + m.starred_gists_url = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *Root) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetTopicSearchUrl sets the topic_search_url property value. The topic_search_url property +func (m *Root) SetTopicSearchUrl(value *string)() { + m.topic_search_url = value +} +// SetUserOrganizationsUrl sets the user_organizations_url property value. The user_organizations_url property +func (m *Root) SetUserOrganizationsUrl(value *string)() { + m.user_organizations_url = value +} +// SetUserRepositoriesUrl sets the user_repositories_url property value. The user_repositories_url property +func (m *Root) SetUserRepositoriesUrl(value *string)() { + m.user_repositories_url = value +} +// SetUserSearchUrl sets the user_search_url property value. The user_search_url property +func (m *Root) SetUserSearchUrl(value *string)() { + m.user_search_url = value +} +// SetUserUrl sets the user_url property value. The user_url property +func (m *Root) SetUserUrl(value *string)() { + m.user_url = value +} +type Rootable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorizationsUrl()(*string) + GetCodeSearchUrl()(*string) + GetCommitSearchUrl()(*string) + GetCurrentUserAuthorizationsHtmlUrl()(*string) + GetCurrentUserRepositoriesUrl()(*string) + GetCurrentUserUrl()(*string) + GetEmailsUrl()(*string) + GetEmojisUrl()(*string) + GetEventsUrl()(*string) + GetFeedsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetHubUrl()(*string) + GetIssueSearchUrl()(*string) + GetIssuesUrl()(*string) + GetKeysUrl()(*string) + GetLabelSearchUrl()(*string) + GetNotificationsUrl()(*string) + GetOrganizationRepositoriesUrl()(*string) + GetOrganizationTeamsUrl()(*string) + GetOrganizationUrl()(*string) + GetPublicGistsUrl()(*string) + GetRateLimitUrl()(*string) + GetRepositorySearchUrl()(*string) + GetRepositoryUrl()(*string) + GetStarredGistsUrl()(*string) + GetStarredUrl()(*string) + GetTopicSearchUrl()(*string) + GetUserOrganizationsUrl()(*string) + GetUserRepositoriesUrl()(*string) + GetUserSearchUrl()(*string) + GetUserUrl()(*string) + SetAuthorizationsUrl(value *string)() + SetCodeSearchUrl(value *string)() + SetCommitSearchUrl(value *string)() + SetCurrentUserAuthorizationsHtmlUrl(value *string)() + SetCurrentUserRepositoriesUrl(value *string)() + SetCurrentUserUrl(value *string)() + SetEmailsUrl(value *string)() + SetEmojisUrl(value *string)() + SetEventsUrl(value *string)() + SetFeedsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetHubUrl(value *string)() + SetIssueSearchUrl(value *string)() + SetIssuesUrl(value *string)() + SetKeysUrl(value *string)() + SetLabelSearchUrl(value *string)() + SetNotificationsUrl(value *string)() + SetOrganizationRepositoriesUrl(value *string)() + SetOrganizationTeamsUrl(value *string)() + SetOrganizationUrl(value *string)() + SetPublicGistsUrl(value *string)() + SetRateLimitUrl(value *string)() + SetRepositorySearchUrl(value *string)() + SetRepositoryUrl(value *string)() + SetStarredGistsUrl(value *string)() + SetStarredUrl(value *string)() + SetTopicSearchUrl(value *string)() + SetUserOrganizationsUrl(value *string)() + SetUserRepositoriesUrl(value *string)() + SetUserSearchUrl(value *string)() + SetUserUrl(value *string)() +} diff --git a/pkg/github/models/rule_suite.go b/pkg/github/models/rule_suite.go new file mode 100644 index 00000000..65c86b16 --- /dev/null +++ b/pkg/github/models/rule_suite.go @@ -0,0 +1,415 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RuleSuite response +type RuleSuite struct { + // The number that identifies the user. + actor_id *int32 + // The handle for the GitHub user account. + actor_name *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The last commit sha in the push evaluation. + after_sha *string + // The first commit sha before the push evaluation. + before_sha *string + // The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run. + evaluation_result *RuleSuite_evaluation_result + // The unique identifier of the rule insight. + id *int32 + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The ref name that the evaluation ran on. + ref *string + // The ID of the repository associated with the rule evaluation. + repository_id *int32 + // The name of the repository without the `.git` extension. + repository_name *string + // The result of the rule evaluations for rules with the `active` enforcement status. + result *RuleSuite_result + // Details on the evaluated rules. + rule_evaluations []RuleSuite_rule_evaluationsable +} +// NewRuleSuite instantiates a new RuleSuite and sets the default values. +func NewRuleSuite()(*RuleSuite) { + m := &RuleSuite{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRuleSuiteFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRuleSuiteFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRuleSuite(), nil +} +// GetActorId gets the actor_id property value. The number that identifies the user. +// returns a *int32 when successful +func (m *RuleSuite) GetActorId()(*int32) { + return m.actor_id +} +// GetActorName gets the actor_name property value. The handle for the GitHub user account. +// returns a *string when successful +func (m *RuleSuite) GetActorName()(*string) { + return m.actor_name +} +// 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 *RuleSuite) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAfterSha gets the after_sha property value. The last commit sha in the push evaluation. +// returns a *string when successful +func (m *RuleSuite) GetAfterSha()(*string) { + return m.after_sha +} +// GetBeforeSha gets the before_sha property value. The first commit sha before the push evaluation. +// returns a *string when successful +func (m *RuleSuite) GetBeforeSha()(*string) { + return m.before_sha +} +// GetEvaluationResult gets the evaluation_result property value. The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run. +// returns a *RuleSuite_evaluation_result when successful +func (m *RuleSuite) GetEvaluationResult()(*RuleSuite_evaluation_result) { + return m.evaluation_result +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RuleSuite) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActorId(val) + } + return nil + } + res["actor_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActorName(val) + } + return nil + } + res["after_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAfterSha(val) + } + return nil + } + res["before_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBeforeSha(val) + } + return nil + } + res["evaluation_result"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRuleSuite_evaluation_result) + if err != nil { + return err + } + if val != nil { + m.SetEvaluationResult(val.(*RuleSuite_evaluation_result)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + res["repository_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryName(val) + } + return nil + } + res["result"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRuleSuite_result) + if err != nil { + return err + } + if val != nil { + m.SetResult(val.(*RuleSuite_result)) + } + return nil + } + res["rule_evaluations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRuleSuite_rule_evaluationsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RuleSuite_rule_evaluationsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RuleSuite_rule_evaluationsable) + } + } + m.SetRuleEvaluations(res) + } + return nil + } + return res +} +// GetId gets the id property value. The unique identifier of the rule insight. +// returns a *int32 when successful +func (m *RuleSuite) GetId()(*int32) { + return m.id +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *RuleSuite) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetRef gets the ref property value. The ref name that the evaluation ran on. +// returns a *string when successful +func (m *RuleSuite) GetRef()(*string) { + return m.ref +} +// GetRepositoryId gets the repository_id property value. The ID of the repository associated with the rule evaluation. +// returns a *int32 when successful +func (m *RuleSuite) GetRepositoryId()(*int32) { + return m.repository_id +} +// GetRepositoryName gets the repository_name property value. The name of the repository without the `.git` extension. +// returns a *string when successful +func (m *RuleSuite) GetRepositoryName()(*string) { + return m.repository_name +} +// GetResult gets the result property value. The result of the rule evaluations for rules with the `active` enforcement status. +// returns a *RuleSuite_result when successful +func (m *RuleSuite) GetResult()(*RuleSuite_result) { + return m.result +} +// GetRuleEvaluations gets the rule_evaluations property value. Details on the evaluated rules. +// returns a []RuleSuite_rule_evaluationsable when successful +func (m *RuleSuite) GetRuleEvaluations()([]RuleSuite_rule_evaluationsable) { + return m.rule_evaluations +} +// Serialize serializes information the current object +func (m *RuleSuite) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("actor_id", m.GetActorId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("actor_name", m.GetActorName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("after_sha", m.GetAfterSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("before_sha", m.GetBeforeSha()) + if err != nil { + return err + } + } + if m.GetEvaluationResult() != nil { + cast := (*m.GetEvaluationResult()).String() + err := writer.WriteStringValue("evaluation_result", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_name", m.GetRepositoryName()) + if err != nil { + return err + } + } + if m.GetResult() != nil { + cast := (*m.GetResult()).String() + err := writer.WriteStringValue("result", &cast) + if err != nil { + return err + } + } + if m.GetRuleEvaluations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRuleEvaluations())) + for i, v := range m.GetRuleEvaluations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("rule_evaluations", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActorId sets the actor_id property value. The number that identifies the user. +func (m *RuleSuite) SetActorId(value *int32)() { + m.actor_id = value +} +// SetActorName sets the actor_name property value. The handle for the GitHub user account. +func (m *RuleSuite) SetActorName(value *string)() { + m.actor_name = 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 *RuleSuite) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAfterSha sets the after_sha property value. The last commit sha in the push evaluation. +func (m *RuleSuite) SetAfterSha(value *string)() { + m.after_sha = value +} +// SetBeforeSha sets the before_sha property value. The first commit sha before the push evaluation. +func (m *RuleSuite) SetBeforeSha(value *string)() { + m.before_sha = value +} +// SetEvaluationResult sets the evaluation_result property value. The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run. +func (m *RuleSuite) SetEvaluationResult(value *RuleSuite_evaluation_result)() { + m.evaluation_result = value +} +// SetId sets the id property value. The unique identifier of the rule insight. +func (m *RuleSuite) SetId(value *int32)() { + m.id = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *RuleSuite) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetRef sets the ref property value. The ref name that the evaluation ran on. +func (m *RuleSuite) SetRef(value *string)() { + m.ref = value +} +// SetRepositoryId sets the repository_id property value. The ID of the repository associated with the rule evaluation. +func (m *RuleSuite) SetRepositoryId(value *int32)() { + m.repository_id = value +} +// SetRepositoryName sets the repository_name property value. The name of the repository without the `.git` extension. +func (m *RuleSuite) SetRepositoryName(value *string)() { + m.repository_name = value +} +// SetResult sets the result property value. The result of the rule evaluations for rules with the `active` enforcement status. +func (m *RuleSuite) SetResult(value *RuleSuite_result)() { + m.result = value +} +// SetRuleEvaluations sets the rule_evaluations property value. Details on the evaluated rules. +func (m *RuleSuite) SetRuleEvaluations(value []RuleSuite_rule_evaluationsable)() { + m.rule_evaluations = value +} +type RuleSuiteable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActorId()(*int32) + GetActorName()(*string) + GetAfterSha()(*string) + GetBeforeSha()(*string) + GetEvaluationResult()(*RuleSuite_evaluation_result) + GetId()(*int32) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetRef()(*string) + GetRepositoryId()(*int32) + GetRepositoryName()(*string) + GetResult()(*RuleSuite_result) + GetRuleEvaluations()([]RuleSuite_rule_evaluationsable) + SetActorId(value *int32)() + SetActorName(value *string)() + SetAfterSha(value *string)() + SetBeforeSha(value *string)() + SetEvaluationResult(value *RuleSuite_evaluation_result)() + SetId(value *int32)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetRef(value *string)() + SetRepositoryId(value *int32)() + SetRepositoryName(value *string)() + SetResult(value *RuleSuite_result)() + SetRuleEvaluations(value []RuleSuite_rule_evaluationsable)() +} diff --git a/pkg/github/models/rule_suite_escaped_evaluation_escaped_result.go b/pkg/github/models/rule_suite_escaped_evaluation_escaped_result.go new file mode 100644 index 00000000..7bd5dca0 --- /dev/null +++ b/pkg/github/models/rule_suite_escaped_evaluation_escaped_result.go @@ -0,0 +1,34 @@ +package models +// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. Null if no rules with `evaluate` enforcement status were run. +type RuleSuite_evaluation_result int + +const ( + PASS_RULESUITE_EVALUATION_RESULT RuleSuite_evaluation_result = iota + FAIL_RULESUITE_EVALUATION_RESULT +) + +func (i RuleSuite_evaluation_result) String() string { + return []string{"pass", "fail"}[i] +} +func ParseRuleSuite_evaluation_result(v string) (any, error) { + result := PASS_RULESUITE_EVALUATION_RESULT + switch v { + case "pass": + result = PASS_RULESUITE_EVALUATION_RESULT + case "fail": + result = FAIL_RULESUITE_EVALUATION_RESULT + default: + return nil, nil + } + return &result, nil +} +func SerializeRuleSuite_evaluation_result(values []RuleSuite_evaluation_result) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RuleSuite_evaluation_result) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/rule_suite_escaped_result.go b/pkg/github/models/rule_suite_escaped_result.go new file mode 100644 index 00000000..9c429e6b --- /dev/null +++ b/pkg/github/models/rule_suite_escaped_result.go @@ -0,0 +1,37 @@ +package models +// The result of the rule evaluations for rules with the `active` enforcement status. +type RuleSuite_result int + +const ( + PASS_RULESUITE_RESULT RuleSuite_result = iota + FAIL_RULESUITE_RESULT + BYPASS_RULESUITE_RESULT +) + +func (i RuleSuite_result) String() string { + return []string{"pass", "fail", "bypass"}[i] +} +func ParseRuleSuite_result(v string) (any, error) { + result := PASS_RULESUITE_RESULT + switch v { + case "pass": + result = PASS_RULESUITE_RESULT + case "fail": + result = FAIL_RULESUITE_RESULT + case "bypass": + result = BYPASS_RULESUITE_RESULT + default: + return nil, nil + } + return &result, nil +} +func SerializeRuleSuite_result(values []RuleSuite_result) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RuleSuite_result) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/rule_suite_escaped_rule_escaped_evaluations.go b/pkg/github/models/rule_suite_escaped_rule_escaped_evaluations.go new file mode 100644 index 00000000..5338cd44 --- /dev/null +++ b/pkg/github/models/rule_suite_escaped_rule_escaped_evaluations.go @@ -0,0 +1,198 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RuleSuite_rule_evaluations struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The detailed failure message for the rule. Null if the rule passed. + details *string + // The enforcement level of this rule source. + enforcement *RuleSuite_rule_evaluations_enforcement + // The result of the evaluation of the individual rule. + result *RuleSuite_rule_evaluations_result + // The rule_source property + rule_source RuleSuite_rule_evaluations_rule_sourceable + // The type of rule. + rule_type *string +} +// NewRuleSuite_rule_evaluations instantiates a new RuleSuite_rule_evaluations and sets the default values. +func NewRuleSuite_rule_evaluations()(*RuleSuite_rule_evaluations) { + m := &RuleSuite_rule_evaluations{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRuleSuite_rule_evaluationsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRuleSuite_rule_evaluationsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRuleSuite_rule_evaluations(), 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 *RuleSuite_rule_evaluations) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDetails gets the details property value. The detailed failure message for the rule. Null if the rule passed. +// returns a *string when successful +func (m *RuleSuite_rule_evaluations) GetDetails()(*string) { + return m.details +} +// GetEnforcement gets the enforcement property value. The enforcement level of this rule source. +// returns a *RuleSuite_rule_evaluations_enforcement when successful +func (m *RuleSuite_rule_evaluations) GetEnforcement()(*RuleSuite_rule_evaluations_enforcement) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RuleSuite_rule_evaluations) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["details"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDetails(val) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRuleSuite_rule_evaluations_enforcement) + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val.(*RuleSuite_rule_evaluations_enforcement)) + } + return nil + } + res["result"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRuleSuite_rule_evaluations_result) + if err != nil { + return err + } + if val != nil { + m.SetResult(val.(*RuleSuite_rule_evaluations_result)) + } + return nil + } + res["rule_source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateRuleSuite_rule_evaluations_rule_sourceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRuleSource(val.(RuleSuite_rule_evaluations_rule_sourceable)) + } + return nil + } + res["rule_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRuleType(val) + } + return nil + } + return res +} +// GetResult gets the result property value. The result of the evaluation of the individual rule. +// returns a *RuleSuite_rule_evaluations_result when successful +func (m *RuleSuite_rule_evaluations) GetResult()(*RuleSuite_rule_evaluations_result) { + return m.result +} +// GetRuleSource gets the rule_source property value. The rule_source property +// returns a RuleSuite_rule_evaluations_rule_sourceable when successful +func (m *RuleSuite_rule_evaluations) GetRuleSource()(RuleSuite_rule_evaluations_rule_sourceable) { + return m.rule_source +} +// GetRuleType gets the rule_type property value. The type of rule. +// returns a *string when successful +func (m *RuleSuite_rule_evaluations) GetRuleType()(*string) { + return m.rule_type +} +// Serialize serializes information the current object +func (m *RuleSuite_rule_evaluations) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("details", m.GetDetails()) + if err != nil { + return err + } + } + if m.GetEnforcement() != nil { + cast := (*m.GetEnforcement()).String() + err := writer.WriteStringValue("enforcement", &cast) + if err != nil { + return err + } + } + if m.GetResult() != nil { + cast := (*m.GetResult()).String() + err := writer.WriteStringValue("result", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("rule_source", m.GetRuleSource()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("rule_type", m.GetRuleType()) + 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 *RuleSuite_rule_evaluations) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDetails sets the details property value. The detailed failure message for the rule. Null if the rule passed. +func (m *RuleSuite_rule_evaluations) SetDetails(value *string)() { + m.details = value +} +// SetEnforcement sets the enforcement property value. The enforcement level of this rule source. +func (m *RuleSuite_rule_evaluations) SetEnforcement(value *RuleSuite_rule_evaluations_enforcement)() { + m.enforcement = value +} +// SetResult sets the result property value. The result of the evaluation of the individual rule. +func (m *RuleSuite_rule_evaluations) SetResult(value *RuleSuite_rule_evaluations_result)() { + m.result = value +} +// SetRuleSource sets the rule_source property value. The rule_source property +func (m *RuleSuite_rule_evaluations) SetRuleSource(value RuleSuite_rule_evaluations_rule_sourceable)() { + m.rule_source = value +} +// SetRuleType sets the rule_type property value. The type of rule. +func (m *RuleSuite_rule_evaluations) SetRuleType(value *string)() { + m.rule_type = value +} +type RuleSuite_rule_evaluationsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDetails()(*string) + GetEnforcement()(*RuleSuite_rule_evaluations_enforcement) + GetResult()(*RuleSuite_rule_evaluations_result) + GetRuleSource()(RuleSuite_rule_evaluations_rule_sourceable) + GetRuleType()(*string) + SetDetails(value *string)() + SetEnforcement(value *RuleSuite_rule_evaluations_enforcement)() + SetResult(value *RuleSuite_rule_evaluations_result)() + SetRuleSource(value RuleSuite_rule_evaluations_rule_sourceable)() + SetRuleType(value *string)() +} diff --git a/pkg/github/models/rule_suite_escaped_rule_escaped_evaluations_escaped_enforcement.go b/pkg/github/models/rule_suite_escaped_rule_escaped_evaluations_escaped_enforcement.go new file mode 100644 index 00000000..1ddc02ce --- /dev/null +++ b/pkg/github/models/rule_suite_escaped_rule_escaped_evaluations_escaped_enforcement.go @@ -0,0 +1,37 @@ +package models +// The enforcement level of this rule source. +type RuleSuite_rule_evaluations_enforcement int + +const ( + ACTIVE_RULESUITE_RULE_EVALUATIONS_ENFORCEMENT RuleSuite_rule_evaluations_enforcement = iota + EVALUATE_RULESUITE_RULE_EVALUATIONS_ENFORCEMENT + DELETEDRULESET_RULESUITE_RULE_EVALUATIONS_ENFORCEMENT +) + +func (i RuleSuite_rule_evaluations_enforcement) String() string { + return []string{"active", "evaluate", "deleted ruleset"}[i] +} +func ParseRuleSuite_rule_evaluations_enforcement(v string) (any, error) { + result := ACTIVE_RULESUITE_RULE_EVALUATIONS_ENFORCEMENT + switch v { + case "active": + result = ACTIVE_RULESUITE_RULE_EVALUATIONS_ENFORCEMENT + case "evaluate": + result = EVALUATE_RULESUITE_RULE_EVALUATIONS_ENFORCEMENT + case "deleted ruleset": + result = DELETEDRULESET_RULESUITE_RULE_EVALUATIONS_ENFORCEMENT + default: + return nil, nil + } + return &result, nil +} +func SerializeRuleSuite_rule_evaluations_enforcement(values []RuleSuite_rule_evaluations_enforcement) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RuleSuite_rule_evaluations_enforcement) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/rule_suite_escaped_rule_escaped_evaluations_escaped_result.go b/pkg/github/models/rule_suite_escaped_rule_escaped_evaluations_escaped_result.go new file mode 100644 index 00000000..24ea62d5 --- /dev/null +++ b/pkg/github/models/rule_suite_escaped_rule_escaped_evaluations_escaped_result.go @@ -0,0 +1,34 @@ +package models +// The result of the evaluation of the individual rule. +type RuleSuite_rule_evaluations_result int + +const ( + PASS_RULESUITE_RULE_EVALUATIONS_RESULT RuleSuite_rule_evaluations_result = iota + FAIL_RULESUITE_RULE_EVALUATIONS_RESULT +) + +func (i RuleSuite_rule_evaluations_result) String() string { + return []string{"pass", "fail"}[i] +} +func ParseRuleSuite_rule_evaluations_result(v string) (any, error) { + result := PASS_RULESUITE_RULE_EVALUATIONS_RESULT + switch v { + case "pass": + result = PASS_RULESUITE_RULE_EVALUATIONS_RESULT + case "fail": + result = FAIL_RULESUITE_RULE_EVALUATIONS_RESULT + default: + return nil, nil + } + return &result, nil +} +func SerializeRuleSuite_rule_evaluations_result(values []RuleSuite_rule_evaluations_result) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RuleSuite_rule_evaluations_result) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/rule_suite_escaped_rule_escaped_evaluations_escaped_rule_escaped_source.go b/pkg/github/models/rule_suite_escaped_rule_escaped_evaluations_escaped_rule_escaped_source.go new file mode 100644 index 00000000..f287a1b5 --- /dev/null +++ b/pkg/github/models/rule_suite_escaped_rule_escaped_evaluations_escaped_rule_escaped_source.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RuleSuite_rule_evaluations_rule_source struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ID of the rule source. + id *int32 + // The name of the rule source. + name *string + // The type of rule source. + typeEscaped *string +} +// NewRuleSuite_rule_evaluations_rule_source instantiates a new RuleSuite_rule_evaluations_rule_source and sets the default values. +func NewRuleSuite_rule_evaluations_rule_source()(*RuleSuite_rule_evaluations_rule_source) { + m := &RuleSuite_rule_evaluations_rule_source{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRuleSuite_rule_evaluations_rule_sourceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRuleSuite_rule_evaluations_rule_sourceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRuleSuite_rule_evaluations_rule_source(), 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 *RuleSuite_rule_evaluations_rule_source) 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 *RuleSuite_rule_evaluations_rule_source) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + return res +} +// GetId gets the id property value. The ID of the rule source. +// returns a *int32 when successful +func (m *RuleSuite_rule_evaluations_rule_source) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name of the rule source. +// returns a *string when successful +func (m *RuleSuite_rule_evaluations_rule_source) GetName()(*string) { + return m.name +} +// GetTypeEscaped gets the type property value. The type of rule source. +// returns a *string when successful +func (m *RuleSuite_rule_evaluations_rule_source) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RuleSuite_rule_evaluations_rule_source) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + 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 *RuleSuite_rule_evaluations_rule_source) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The ID of the rule source. +func (m *RuleSuite_rule_evaluations_rule_source) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name of the rule source. +func (m *RuleSuite_rule_evaluations_rule_source) SetName(value *string)() { + m.name = value +} +// SetTypeEscaped sets the type property value. The type of rule source. +func (m *RuleSuite_rule_evaluations_rule_source) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +type RuleSuite_rule_evaluations_rule_sourceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetName()(*string) + GetTypeEscaped()(*string) + SetId(value *int32)() + SetName(value *string)() + SetTypeEscaped(value *string)() +} diff --git a/pkg/github/models/rule_suites.go b/pkg/github/models/rule_suites.go new file mode 100644 index 00000000..9e67b8a4 --- /dev/null +++ b/pkg/github/models/rule_suites.go @@ -0,0 +1,373 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RuleSuites struct { + // The number that identifies the user. + actor_id *int32 + // The handle for the GitHub user account. + actor_name *string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The last commit sha in the push evaluation. + after_sha *string + // The first commit sha before the push evaluation. + before_sha *string + // The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. + evaluation_result *RuleSuites_evaluation_result + // The unique identifier of the rule insight. + id *int32 + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The ref name that the evaluation ran on. + ref *string + // The ID of the repository associated with the rule evaluation. + repository_id *int32 + // The name of the repository without the `.git` extension. + repository_name *string + // The result of the rule evaluations for rules with the `active` enforcement status. + result *RuleSuites_result +} +// NewRuleSuites instantiates a new RuleSuites and sets the default values. +func NewRuleSuites()(*RuleSuites) { + m := &RuleSuites{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRuleSuitesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRuleSuitesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRuleSuites(), nil +} +// GetActorId gets the actor_id property value. The number that identifies the user. +// returns a *int32 when successful +func (m *RuleSuites) GetActorId()(*int32) { + return m.actor_id +} +// GetActorName gets the actor_name property value. The handle for the GitHub user account. +// returns a *string when successful +func (m *RuleSuites) GetActorName()(*string) { + return m.actor_name +} +// 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 *RuleSuites) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAfterSha gets the after_sha property value. The last commit sha in the push evaluation. +// returns a *string when successful +func (m *RuleSuites) GetAfterSha()(*string) { + return m.after_sha +} +// GetBeforeSha gets the before_sha property value. The first commit sha before the push evaluation. +// returns a *string when successful +func (m *RuleSuites) GetBeforeSha()(*string) { + return m.before_sha +} +// GetEvaluationResult gets the evaluation_result property value. The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. +// returns a *RuleSuites_evaluation_result when successful +func (m *RuleSuites) GetEvaluationResult()(*RuleSuites_evaluation_result) { + return m.evaluation_result +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RuleSuites) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetActorId(val) + } + return nil + } + res["actor_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetActorName(val) + } + return nil + } + res["after_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAfterSha(val) + } + return nil + } + res["before_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBeforeSha(val) + } + return nil + } + res["evaluation_result"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRuleSuites_evaluation_result) + if err != nil { + return err + } + if val != nil { + m.SetEvaluationResult(val.(*RuleSuites_evaluation_result)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryId(val) + } + return nil + } + res["repository_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryName(val) + } + return nil + } + res["result"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRuleSuites_result) + if err != nil { + return err + } + if val != nil { + m.SetResult(val.(*RuleSuites_result)) + } + return nil + } + return res +} +// GetId gets the id property value. The unique identifier of the rule insight. +// returns a *int32 when successful +func (m *RuleSuites) GetId()(*int32) { + return m.id +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *RuleSuites) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetRef gets the ref property value. The ref name that the evaluation ran on. +// returns a *string when successful +func (m *RuleSuites) GetRef()(*string) { + return m.ref +} +// GetRepositoryId gets the repository_id property value. The ID of the repository associated with the rule evaluation. +// returns a *int32 when successful +func (m *RuleSuites) GetRepositoryId()(*int32) { + return m.repository_id +} +// GetRepositoryName gets the repository_name property value. The name of the repository without the `.git` extension. +// returns a *string when successful +func (m *RuleSuites) GetRepositoryName()(*string) { + return m.repository_name +} +// GetResult gets the result property value. The result of the rule evaluations for rules with the `active` enforcement status. +// returns a *RuleSuites_result when successful +func (m *RuleSuites) GetResult()(*RuleSuites_result) { + return m.result +} +// Serialize serializes information the current object +func (m *RuleSuites) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("actor_id", m.GetActorId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("actor_name", m.GetActorName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("after_sha", m.GetAfterSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("before_sha", m.GetBeforeSha()) + if err != nil { + return err + } + } + if m.GetEvaluationResult() != nil { + cast := (*m.GetEvaluationResult()).String() + err := writer.WriteStringValue("evaluation_result", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_id", m.GetRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_name", m.GetRepositoryName()) + if err != nil { + return err + } + } + if m.GetResult() != nil { + cast := (*m.GetResult()).String() + err := writer.WriteStringValue("result", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActorId sets the actor_id property value. The number that identifies the user. +func (m *RuleSuites) SetActorId(value *int32)() { + m.actor_id = value +} +// SetActorName sets the actor_name property value. The handle for the GitHub user account. +func (m *RuleSuites) SetActorName(value *string)() { + m.actor_name = 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 *RuleSuites) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAfterSha sets the after_sha property value. The last commit sha in the push evaluation. +func (m *RuleSuites) SetAfterSha(value *string)() { + m.after_sha = value +} +// SetBeforeSha sets the before_sha property value. The first commit sha before the push evaluation. +func (m *RuleSuites) SetBeforeSha(value *string)() { + m.before_sha = value +} +// SetEvaluationResult sets the evaluation_result property value. The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. +func (m *RuleSuites) SetEvaluationResult(value *RuleSuites_evaluation_result)() { + m.evaluation_result = value +} +// SetId sets the id property value. The unique identifier of the rule insight. +func (m *RuleSuites) SetId(value *int32)() { + m.id = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *RuleSuites) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetRef sets the ref property value. The ref name that the evaluation ran on. +func (m *RuleSuites) SetRef(value *string)() { + m.ref = value +} +// SetRepositoryId sets the repository_id property value. The ID of the repository associated with the rule evaluation. +func (m *RuleSuites) SetRepositoryId(value *int32)() { + m.repository_id = value +} +// SetRepositoryName sets the repository_name property value. The name of the repository without the `.git` extension. +func (m *RuleSuites) SetRepositoryName(value *string)() { + m.repository_name = value +} +// SetResult sets the result property value. The result of the rule evaluations for rules with the `active` enforcement status. +func (m *RuleSuites) SetResult(value *RuleSuites_result)() { + m.result = value +} +type RuleSuitesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActorId()(*int32) + GetActorName()(*string) + GetAfterSha()(*string) + GetBeforeSha()(*string) + GetEvaluationResult()(*RuleSuites_evaluation_result) + GetId()(*int32) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetRef()(*string) + GetRepositoryId()(*int32) + GetRepositoryName()(*string) + GetResult()(*RuleSuites_result) + SetActorId(value *int32)() + SetActorName(value *string)() + SetAfterSha(value *string)() + SetBeforeSha(value *string)() + SetEvaluationResult(value *RuleSuites_evaluation_result)() + SetId(value *int32)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetRef(value *string)() + SetRepositoryId(value *int32)() + SetRepositoryName(value *string)() + SetResult(value *RuleSuites_result)() +} diff --git a/pkg/github/models/rule_suites_escaped_evaluation_escaped_result.go b/pkg/github/models/rule_suites_escaped_evaluation_escaped_result.go new file mode 100644 index 00000000..764d5498 --- /dev/null +++ b/pkg/github/models/rule_suites_escaped_evaluation_escaped_result.go @@ -0,0 +1,34 @@ +package models +// The result of the rule evaluations for rules with the `active` and `evaluate` enforcement statuses, demonstrating whether rules would pass or fail if all rules in the rule suite were `active`. +type RuleSuites_evaluation_result int + +const ( + PASS_RULESUITES_EVALUATION_RESULT RuleSuites_evaluation_result = iota + FAIL_RULESUITES_EVALUATION_RESULT +) + +func (i RuleSuites_evaluation_result) String() string { + return []string{"pass", "fail"}[i] +} +func ParseRuleSuites_evaluation_result(v string) (any, error) { + result := PASS_RULESUITES_EVALUATION_RESULT + switch v { + case "pass": + result = PASS_RULESUITES_EVALUATION_RESULT + case "fail": + result = FAIL_RULESUITES_EVALUATION_RESULT + default: + return nil, nil + } + return &result, nil +} +func SerializeRuleSuites_evaluation_result(values []RuleSuites_evaluation_result) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RuleSuites_evaluation_result) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/rule_suites_escaped_result.go b/pkg/github/models/rule_suites_escaped_result.go new file mode 100644 index 00000000..c660e6cc --- /dev/null +++ b/pkg/github/models/rule_suites_escaped_result.go @@ -0,0 +1,37 @@ +package models +// The result of the rule evaluations for rules with the `active` enforcement status. +type RuleSuites_result int + +const ( + PASS_RULESUITES_RESULT RuleSuites_result = iota + FAIL_RULESUITES_RESULT + BYPASS_RULESUITES_RESULT +) + +func (i RuleSuites_result) String() string { + return []string{"pass", "fail", "bypass"}[i] +} +func ParseRuleSuites_result(v string) (any, error) { + result := PASS_RULESUITES_RESULT + switch v { + case "pass": + result = PASS_RULESUITES_RESULT + case "fail": + result = FAIL_RULESUITES_RESULT + case "bypass": + result = BYPASS_RULESUITES_RESULT + default: + return nil, nil + } + return &result, nil +} +func SerializeRuleSuites_result(values []RuleSuites_result) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RuleSuites_result) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/runner.go b/pkg/github/models/runner.go new file mode 100644 index 00000000..09ce496e --- /dev/null +++ b/pkg/github/models/runner.go @@ -0,0 +1,267 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Runner a self hosted runner +type Runner 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 busy property + busy *bool + // The id of the runner. + id *int32 + // The labels property + labels []RunnerLabelable + // The name of the runner. + name *string + // The Operating System of the runner. + os *string + // The id of the runner group. + runner_group_id *int32 + // The status of the runner. + status *string +} +// NewRunner instantiates a new Runner and sets the default values. +func NewRunner()(*Runner) { + m := &Runner{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRunnerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRunnerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRunner(), 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 *Runner) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBusy gets the busy property value. The busy property +// returns a *bool when successful +func (m *Runner) GetBusy()(*bool) { + return m.busy +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Runner) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["busy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetBusy(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(RunnerLabelable) + } + } + m.SetLabels(res) + } + 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["os"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOs(val) + } + return nil + } + res["runner_group_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunnerGroupId(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id of the runner. +// returns a *int32 when successful +func (m *Runner) GetId()(*int32) { + return m.id +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *Runner) GetLabels()([]RunnerLabelable) { + return m.labels +} +// GetName gets the name property value. The name of the runner. +// returns a *string when successful +func (m *Runner) GetName()(*string) { + return m.name +} +// GetOs gets the os property value. The Operating System of the runner. +// returns a *string when successful +func (m *Runner) GetOs()(*string) { + return m.os +} +// GetRunnerGroupId gets the runner_group_id property value. The id of the runner group. +// returns a *int32 when successful +func (m *Runner) GetRunnerGroupId()(*int32) { + return m.runner_group_id +} +// GetStatus gets the status property value. The status of the runner. +// returns a *string when successful +func (m *Runner) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *Runner) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("busy", m.GetBusy()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("os", m.GetOs()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("runner_group_id", m.GetRunnerGroupId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *Runner) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBusy sets the busy property value. The busy property +func (m *Runner) SetBusy(value *bool)() { + m.busy = value +} +// SetId sets the id property value. The id of the runner. +func (m *Runner) SetId(value *int32)() { + m.id = value +} +// SetLabels sets the labels property value. The labels property +func (m *Runner) SetLabels(value []RunnerLabelable)() { + m.labels = value +} +// SetName sets the name property value. The name of the runner. +func (m *Runner) SetName(value *string)() { + m.name = value +} +// SetOs sets the os property value. The Operating System of the runner. +func (m *Runner) SetOs(value *string)() { + m.os = value +} +// SetRunnerGroupId sets the runner_group_id property value. The id of the runner group. +func (m *Runner) SetRunnerGroupId(value *int32)() { + m.runner_group_id = value +} +// SetStatus sets the status property value. The status of the runner. +func (m *Runner) SetStatus(value *string)() { + m.status = value +} +type Runnerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBusy()(*bool) + GetId()(*int32) + GetLabels()([]RunnerLabelable) + GetName()(*string) + GetOs()(*string) + GetRunnerGroupId()(*int32) + GetStatus()(*string) + SetBusy(value *bool)() + SetId(value *int32)() + SetLabels(value []RunnerLabelable)() + SetName(value *string)() + SetOs(value *string)() + SetRunnerGroupId(value *int32)() + SetStatus(value *string)() +} diff --git a/pkg/github/models/runner_application.go b/pkg/github/models/runner_application.go new file mode 100644 index 00000000..b46e5c60 --- /dev/null +++ b/pkg/github/models/runner_application.go @@ -0,0 +1,226 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RunnerApplication runner Application +type RunnerApplication 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 architecture property + architecture *string + // The download_url property + download_url *string + // The filename property + filename *string + // The os property + os *string + // The sha256_checksum property + sha256_checksum *string + // A short lived bearer token used to download the runner, if needed. + temp_download_token *string +} +// NewRunnerApplication instantiates a new RunnerApplication and sets the default values. +func NewRunnerApplication()(*RunnerApplication) { + m := &RunnerApplication{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRunnerApplicationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRunnerApplicationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRunnerApplication(), 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 *RunnerApplication) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchitecture gets the architecture property value. The architecture property +// returns a *string when successful +func (m *RunnerApplication) GetArchitecture()(*string) { + return m.architecture +} +// GetDownloadUrl gets the download_url property value. The download_url property +// returns a *string when successful +func (m *RunnerApplication) GetDownloadUrl()(*string) { + return m.download_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RunnerApplication) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["architecture"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchitecture(val) + } + return nil + } + res["download_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadUrl(val) + } + return nil + } + res["filename"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFilename(val) + } + return nil + } + res["os"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOs(val) + } + return nil + } + res["sha256_checksum"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha256Checksum(val) + } + return nil + } + res["temp_download_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempDownloadToken(val) + } + return nil + } + return res +} +// GetFilename gets the filename property value. The filename property +// returns a *string when successful +func (m *RunnerApplication) GetFilename()(*string) { + return m.filename +} +// GetOs gets the os property value. The os property +// returns a *string when successful +func (m *RunnerApplication) GetOs()(*string) { + return m.os +} +// GetSha256Checksum gets the sha256_checksum property value. The sha256_checksum property +// returns a *string when successful +func (m *RunnerApplication) GetSha256Checksum()(*string) { + return m.sha256_checksum +} +// GetTempDownloadToken gets the temp_download_token property value. A short lived bearer token used to download the runner, if needed. +// returns a *string when successful +func (m *RunnerApplication) GetTempDownloadToken()(*string) { + return m.temp_download_token +} +// Serialize serializes information the current object +func (m *RunnerApplication) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("architecture", m.GetArchitecture()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("download_url", m.GetDownloadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("filename", m.GetFilename()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("os", m.GetOs()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha256_checksum", m.GetSha256Checksum()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_download_token", m.GetTempDownloadToken()) + 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 *RunnerApplication) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchitecture sets the architecture property value. The architecture property +func (m *RunnerApplication) SetArchitecture(value *string)() { + m.architecture = value +} +// SetDownloadUrl sets the download_url property value. The download_url property +func (m *RunnerApplication) SetDownloadUrl(value *string)() { + m.download_url = value +} +// SetFilename sets the filename property value. The filename property +func (m *RunnerApplication) SetFilename(value *string)() { + m.filename = value +} +// SetOs sets the os property value. The os property +func (m *RunnerApplication) SetOs(value *string)() { + m.os = value +} +// SetSha256Checksum sets the sha256_checksum property value. The sha256_checksum property +func (m *RunnerApplication) SetSha256Checksum(value *string)() { + m.sha256_checksum = value +} +// SetTempDownloadToken sets the temp_download_token property value. A short lived bearer token used to download the runner, if needed. +func (m *RunnerApplication) SetTempDownloadToken(value *string)() { + m.temp_download_token = value +} +type RunnerApplicationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchitecture()(*string) + GetDownloadUrl()(*string) + GetFilename()(*string) + GetOs()(*string) + GetSha256Checksum()(*string) + GetTempDownloadToken()(*string) + SetArchitecture(value *string)() + SetDownloadUrl(value *string)() + SetFilename(value *string)() + SetOs(value *string)() + SetSha256Checksum(value *string)() + SetTempDownloadToken(value *string)() +} diff --git a/pkg/github/models/runner_groups_enterprise.go b/pkg/github/models/runner_groups_enterprise.go new file mode 100644 index 00000000..b8b92d54 --- /dev/null +++ b/pkg/github/models/runner_groups_enterprise.go @@ -0,0 +1,347 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RunnerGroupsEnterprise 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 allows_public_repositories property + allows_public_repositories *bool + // The default property + defaultEscaped *bool + // The id property + id *float64 + // The name property + name *string + // If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + restricted_to_workflows *bool + // The runners_url property + runners_url *string + // The selected_organizations_url property + selected_organizations_url *string + // List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + selected_workflows []string + // The visibility property + visibility *string + // If `true`, the `restricted_to_workflows` and `selected_workflows` fields cannot be modified. + workflow_restrictions_read_only *bool +} +// NewRunnerGroupsEnterprise instantiates a new RunnerGroupsEnterprise and sets the default values. +func NewRunnerGroupsEnterprise()(*RunnerGroupsEnterprise) { + m := &RunnerGroupsEnterprise{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRunnerGroupsEnterpriseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRunnerGroupsEnterpriseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRunnerGroupsEnterprise(), 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 *RunnerGroupsEnterprise) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowsPublicRepositories gets the allows_public_repositories property value. The allows_public_repositories property +// returns a *bool when successful +func (m *RunnerGroupsEnterprise) GetAllowsPublicRepositories()(*bool) { + return m.allows_public_repositories +} +// GetDefaultEscaped gets the default property value. The default property +// returns a *bool when successful +func (m *RunnerGroupsEnterprise) GetDefaultEscaped()(*bool) { + return m.defaultEscaped +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RunnerGroupsEnterprise) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allows_public_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowsPublicRepositories(val) + } + return nil + } + res["default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultEscaped(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["restricted_to_workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRestrictedToWorkflows(val) + } + return nil + } + res["runners_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRunnersUrl(val) + } + return nil + } + res["selected_organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedOrganizationsUrl(val) + } + return nil + } + res["selected_workflows"] = 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.SetSelectedWorkflows(res) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["workflow_restrictions_read_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkflowRestrictionsReadOnly(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *float64 when successful +func (m *RunnerGroupsEnterprise) GetId()(*float64) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *RunnerGroupsEnterprise) GetName()(*string) { + return m.name +} +// GetRestrictedToWorkflows gets the restricted_to_workflows property value. If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. +// returns a *bool when successful +func (m *RunnerGroupsEnterprise) GetRestrictedToWorkflows()(*bool) { + return m.restricted_to_workflows +} +// GetRunnersUrl gets the runners_url property value. The runners_url property +// returns a *string when successful +func (m *RunnerGroupsEnterprise) GetRunnersUrl()(*string) { + return m.runners_url +} +// GetSelectedOrganizationsUrl gets the selected_organizations_url property value. The selected_organizations_url property +// returns a *string when successful +func (m *RunnerGroupsEnterprise) GetSelectedOrganizationsUrl()(*string) { + return m.selected_organizations_url +} +// GetSelectedWorkflows gets the selected_workflows property value. List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +// returns a []string when successful +func (m *RunnerGroupsEnterprise) GetSelectedWorkflows()([]string) { + return m.selected_workflows +} +// GetVisibility gets the visibility property value. The visibility property +// returns a *string when successful +func (m *RunnerGroupsEnterprise) GetVisibility()(*string) { + return m.visibility +} +// GetWorkflowRestrictionsReadOnly gets the workflow_restrictions_read_only property value. If `true`, the `restricted_to_workflows` and `selected_workflows` fields cannot be modified. +// returns a *bool when successful +func (m *RunnerGroupsEnterprise) GetWorkflowRestrictionsReadOnly()(*bool) { + return m.workflow_restrictions_read_only +} +// Serialize serializes information the current object +func (m *RunnerGroupsEnterprise) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allows_public_repositories", m.GetAllowsPublicRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("default", m.GetDefaultEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("restricted_to_workflows", m.GetRestrictedToWorkflows()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("runners_url", m.GetRunnersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_organizations_url", m.GetSelectedOrganizationsUrl()) + if err != nil { + return err + } + } + if m.GetSelectedWorkflows() != nil { + err := writer.WriteCollectionOfStringValues("selected_workflows", m.GetSelectedWorkflows()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("workflow_restrictions_read_only", m.GetWorkflowRestrictionsReadOnly()) + 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 *RunnerGroupsEnterprise) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowsPublicRepositories sets the allows_public_repositories property value. The allows_public_repositories property +func (m *RunnerGroupsEnterprise) SetAllowsPublicRepositories(value *bool)() { + m.allows_public_repositories = value +} +// SetDefaultEscaped sets the default property value. The default property +func (m *RunnerGroupsEnterprise) SetDefaultEscaped(value *bool)() { + m.defaultEscaped = value +} +// SetId sets the id property value. The id property +func (m *RunnerGroupsEnterprise) SetId(value *float64)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *RunnerGroupsEnterprise) SetName(value *string)() { + m.name = value +} +// SetRestrictedToWorkflows sets the restricted_to_workflows property value. If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. +func (m *RunnerGroupsEnterprise) SetRestrictedToWorkflows(value *bool)() { + m.restricted_to_workflows = value +} +// SetRunnersUrl sets the runners_url property value. The runners_url property +func (m *RunnerGroupsEnterprise) SetRunnersUrl(value *string)() { + m.runners_url = value +} +// SetSelectedOrganizationsUrl sets the selected_organizations_url property value. The selected_organizations_url property +func (m *RunnerGroupsEnterprise) SetSelectedOrganizationsUrl(value *string)() { + m.selected_organizations_url = value +} +// SetSelectedWorkflows sets the selected_workflows property value. List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +func (m *RunnerGroupsEnterprise) SetSelectedWorkflows(value []string)() { + m.selected_workflows = value +} +// SetVisibility sets the visibility property value. The visibility property +func (m *RunnerGroupsEnterprise) SetVisibility(value *string)() { + m.visibility = value +} +// SetWorkflowRestrictionsReadOnly sets the workflow_restrictions_read_only property value. If `true`, the `restricted_to_workflows` and `selected_workflows` fields cannot be modified. +func (m *RunnerGroupsEnterprise) SetWorkflowRestrictionsReadOnly(value *bool)() { + m.workflow_restrictions_read_only = value +} +type RunnerGroupsEnterpriseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowsPublicRepositories()(*bool) + GetDefaultEscaped()(*bool) + GetId()(*float64) + GetName()(*string) + GetRestrictedToWorkflows()(*bool) + GetRunnersUrl()(*string) + GetSelectedOrganizationsUrl()(*string) + GetSelectedWorkflows()([]string) + GetVisibility()(*string) + GetWorkflowRestrictionsReadOnly()(*bool) + SetAllowsPublicRepositories(value *bool)() + SetDefaultEscaped(value *bool)() + SetId(value *float64)() + SetName(value *string)() + SetRestrictedToWorkflows(value *bool)() + SetRunnersUrl(value *string)() + SetSelectedOrganizationsUrl(value *string)() + SetSelectedWorkflows(value []string)() + SetVisibility(value *string)() + SetWorkflowRestrictionsReadOnly(value *bool)() +} diff --git a/pkg/github/models/runner_groups_org.go b/pkg/github/models/runner_groups_org.go new file mode 100644 index 00000000..9e7c9d9f --- /dev/null +++ b/pkg/github/models/runner_groups_org.go @@ -0,0 +1,405 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type RunnerGroupsOrg 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 allows_public_repositories property + allows_public_repositories *bool + // The default property + defaultEscaped *bool + // The id property + id *float64 + // The inherited property + inherited *bool + // The inherited_allows_public_repositories property + inherited_allows_public_repositories *bool + // The name property + name *string + // If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + restricted_to_workflows *bool + // The runners_url property + runners_url *string + // Link to the selected repositories resource for this runner group. Not present unless visibility was set to `selected` + selected_repositories_url *string + // List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + selected_workflows []string + // The visibility property + visibility *string + // If `true`, the `restricted_to_workflows` and `selected_workflows` fields cannot be modified. + workflow_restrictions_read_only *bool +} +// NewRunnerGroupsOrg instantiates a new RunnerGroupsOrg and sets the default values. +func NewRunnerGroupsOrg()(*RunnerGroupsOrg) { + m := &RunnerGroupsOrg{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRunnerGroupsOrgFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRunnerGroupsOrgFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRunnerGroupsOrg(), 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 *RunnerGroupsOrg) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowsPublicRepositories gets the allows_public_repositories property value. The allows_public_repositories property +// returns a *bool when successful +func (m *RunnerGroupsOrg) GetAllowsPublicRepositories()(*bool) { + return m.allows_public_repositories +} +// GetDefaultEscaped gets the default property value. The default property +// returns a *bool when successful +func (m *RunnerGroupsOrg) GetDefaultEscaped()(*bool) { + return m.defaultEscaped +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *RunnerGroupsOrg) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allows_public_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowsPublicRepositories(val) + } + return nil + } + res["default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultEscaped(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["inherited"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetInherited(val) + } + return nil + } + res["inherited_allows_public_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetInheritedAllowsPublicRepositories(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["restricted_to_workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRestrictedToWorkflows(val) + } + return nil + } + res["runners_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRunnersUrl(val) + } + return nil + } + res["selected_repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSelectedRepositoriesUrl(val) + } + return nil + } + res["selected_workflows"] = 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.SetSelectedWorkflows(res) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["workflow_restrictions_read_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkflowRestrictionsReadOnly(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *float64 when successful +func (m *RunnerGroupsOrg) GetId()(*float64) { + return m.id +} +// GetInherited gets the inherited property value. The inherited property +// returns a *bool when successful +func (m *RunnerGroupsOrg) GetInherited()(*bool) { + return m.inherited +} +// GetInheritedAllowsPublicRepositories gets the inherited_allows_public_repositories property value. The inherited_allows_public_repositories property +// returns a *bool when successful +func (m *RunnerGroupsOrg) GetInheritedAllowsPublicRepositories()(*bool) { + return m.inherited_allows_public_repositories +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *RunnerGroupsOrg) GetName()(*string) { + return m.name +} +// GetRestrictedToWorkflows gets the restricted_to_workflows property value. If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. +// returns a *bool when successful +func (m *RunnerGroupsOrg) GetRestrictedToWorkflows()(*bool) { + return m.restricted_to_workflows +} +// GetRunnersUrl gets the runners_url property value. The runners_url property +// returns a *string when successful +func (m *RunnerGroupsOrg) GetRunnersUrl()(*string) { + return m.runners_url +} +// GetSelectedRepositoriesUrl gets the selected_repositories_url property value. Link to the selected repositories resource for this runner group. Not present unless visibility was set to `selected` +// returns a *string when successful +func (m *RunnerGroupsOrg) GetSelectedRepositoriesUrl()(*string) { + return m.selected_repositories_url +} +// GetSelectedWorkflows gets the selected_workflows property value. List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +// returns a []string when successful +func (m *RunnerGroupsOrg) GetSelectedWorkflows()([]string) { + return m.selected_workflows +} +// GetVisibility gets the visibility property value. The visibility property +// returns a *string when successful +func (m *RunnerGroupsOrg) GetVisibility()(*string) { + return m.visibility +} +// GetWorkflowRestrictionsReadOnly gets the workflow_restrictions_read_only property value. If `true`, the `restricted_to_workflows` and `selected_workflows` fields cannot be modified. +// returns a *bool when successful +func (m *RunnerGroupsOrg) GetWorkflowRestrictionsReadOnly()(*bool) { + return m.workflow_restrictions_read_only +} +// Serialize serializes information the current object +func (m *RunnerGroupsOrg) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allows_public_repositories", m.GetAllowsPublicRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("default", m.GetDefaultEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("inherited", m.GetInherited()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("inherited_allows_public_repositories", m.GetInheritedAllowsPublicRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("restricted_to_workflows", m.GetRestrictedToWorkflows()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("runners_url", m.GetRunnersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("selected_repositories_url", m.GetSelectedRepositoriesUrl()) + if err != nil { + return err + } + } + if m.GetSelectedWorkflows() != nil { + err := writer.WriteCollectionOfStringValues("selected_workflows", m.GetSelectedWorkflows()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("workflow_restrictions_read_only", m.GetWorkflowRestrictionsReadOnly()) + 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 *RunnerGroupsOrg) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowsPublicRepositories sets the allows_public_repositories property value. The allows_public_repositories property +func (m *RunnerGroupsOrg) SetAllowsPublicRepositories(value *bool)() { + m.allows_public_repositories = value +} +// SetDefaultEscaped sets the default property value. The default property +func (m *RunnerGroupsOrg) SetDefaultEscaped(value *bool)() { + m.defaultEscaped = value +} +// SetId sets the id property value. The id property +func (m *RunnerGroupsOrg) SetId(value *float64)() { + m.id = value +} +// SetInherited sets the inherited property value. The inherited property +func (m *RunnerGroupsOrg) SetInherited(value *bool)() { + m.inherited = value +} +// SetInheritedAllowsPublicRepositories sets the inherited_allows_public_repositories property value. The inherited_allows_public_repositories property +func (m *RunnerGroupsOrg) SetInheritedAllowsPublicRepositories(value *bool)() { + m.inherited_allows_public_repositories = value +} +// SetName sets the name property value. The name property +func (m *RunnerGroupsOrg) SetName(value *string)() { + m.name = value +} +// SetRestrictedToWorkflows sets the restricted_to_workflows property value. If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. +func (m *RunnerGroupsOrg) SetRestrictedToWorkflows(value *bool)() { + m.restricted_to_workflows = value +} +// SetRunnersUrl sets the runners_url property value. The runners_url property +func (m *RunnerGroupsOrg) SetRunnersUrl(value *string)() { + m.runners_url = value +} +// SetSelectedRepositoriesUrl sets the selected_repositories_url property value. Link to the selected repositories resource for this runner group. Not present unless visibility was set to `selected` +func (m *RunnerGroupsOrg) SetSelectedRepositoriesUrl(value *string)() { + m.selected_repositories_url = value +} +// SetSelectedWorkflows sets the selected_workflows property value. List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +func (m *RunnerGroupsOrg) SetSelectedWorkflows(value []string)() { + m.selected_workflows = value +} +// SetVisibility sets the visibility property value. The visibility property +func (m *RunnerGroupsOrg) SetVisibility(value *string)() { + m.visibility = value +} +// SetWorkflowRestrictionsReadOnly sets the workflow_restrictions_read_only property value. If `true`, the `restricted_to_workflows` and `selected_workflows` fields cannot be modified. +func (m *RunnerGroupsOrg) SetWorkflowRestrictionsReadOnly(value *bool)() { + m.workflow_restrictions_read_only = value +} +type RunnerGroupsOrgable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowsPublicRepositories()(*bool) + GetDefaultEscaped()(*bool) + GetId()(*float64) + GetInherited()(*bool) + GetInheritedAllowsPublicRepositories()(*bool) + GetName()(*string) + GetRestrictedToWorkflows()(*bool) + GetRunnersUrl()(*string) + GetSelectedRepositoriesUrl()(*string) + GetSelectedWorkflows()([]string) + GetVisibility()(*string) + GetWorkflowRestrictionsReadOnly()(*bool) + SetAllowsPublicRepositories(value *bool)() + SetDefaultEscaped(value *bool)() + SetId(value *float64)() + SetInherited(value *bool)() + SetInheritedAllowsPublicRepositories(value *bool)() + SetName(value *string)() + SetRestrictedToWorkflows(value *bool)() + SetRunnersUrl(value *string)() + SetSelectedRepositoriesUrl(value *string)() + SetSelectedWorkflows(value []string)() + SetVisibility(value *string)() + SetWorkflowRestrictionsReadOnly(value *bool)() +} diff --git a/pkg/github/models/runner_label.go b/pkg/github/models/runner_label.go new file mode 100644 index 00000000..f26890cd --- /dev/null +++ b/pkg/github/models/runner_label.go @@ -0,0 +1,140 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// RunnerLabel a label for a self hosted runner +type RunnerLabel struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Unique identifier of the label. + id *int32 + // Name of the label. + name *string + // The type of label. Read-only labels are applied automatically when the runner is configured. + typeEscaped *RunnerLabel_type +} +// NewRunnerLabel instantiates a new RunnerLabel and sets the default values. +func NewRunnerLabel()(*RunnerLabel) { + m := &RunnerLabel{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRunnerLabelFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRunnerLabelFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRunnerLabel(), 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 *RunnerLabel) 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 *RunnerLabel) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseRunnerLabel_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*RunnerLabel_type)) + } + return nil + } + return res +} +// GetId gets the id property value. Unique identifier of the label. +// returns a *int32 when successful +func (m *RunnerLabel) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. Name of the label. +// returns a *string when successful +func (m *RunnerLabel) GetName()(*string) { + return m.name +} +// GetTypeEscaped gets the type property value. The type of label. Read-only labels are applied automatically when the runner is configured. +// returns a *RunnerLabel_type when successful +func (m *RunnerLabel) GetTypeEscaped()(*RunnerLabel_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *RunnerLabel) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *RunnerLabel) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. Unique identifier of the label. +func (m *RunnerLabel) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. Name of the label. +func (m *RunnerLabel) SetName(value *string)() { + m.name = value +} +// SetTypeEscaped sets the type property value. The type of label. Read-only labels are applied automatically when the runner is configured. +func (m *RunnerLabel) SetTypeEscaped(value *RunnerLabel_type)() { + m.typeEscaped = value +} +type RunnerLabelable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetName()(*string) + GetTypeEscaped()(*RunnerLabel_type) + SetId(value *int32)() + SetName(value *string)() + SetTypeEscaped(value *RunnerLabel_type)() +} diff --git a/pkg/github/models/runner_label_escaped_type.go b/pkg/github/models/runner_label_escaped_type.go new file mode 100644 index 00000000..117d258d --- /dev/null +++ b/pkg/github/models/runner_label_escaped_type.go @@ -0,0 +1,34 @@ +package models +// The type of label. Read-only labels are applied automatically when the runner is configured. +type RunnerLabel_type int + +const ( + READONLY_RUNNERLABEL_TYPE RunnerLabel_type = iota + CUSTOM_RUNNERLABEL_TYPE +) + +func (i RunnerLabel_type) String() string { + return []string{"read-only", "custom"}[i] +} +func ParseRunnerLabel_type(v string) (any, error) { + result := READONLY_RUNNERLABEL_TYPE + switch v { + case "read-only": + result = READONLY_RUNNERLABEL_TYPE + case "custom": + result = CUSTOM_RUNNERLABEL_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeRunnerLabel_type(values []RunnerLabel_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RunnerLabel_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/scim_enterprise_group_list.go b/pkg/github/models/scim_enterprise_group_list.go new file mode 100644 index 00000000..b1c1fab0 --- /dev/null +++ b/pkg/github/models/scim_enterprise_group_list.go @@ -0,0 +1,214 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ScimEnterpriseGroupList struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Number of objects per page + itemsPerPage *int32 + // Information about each provisioned group. + resources []ScimEnterpriseGroupResponseable + // The URIs that are used to indicate the namespaces of the list SCIM schemas. + schemas []ScimEnterpriseGroupList_schemas + // A starting index for the returned page + startIndex *int32 + // Number of results found + totalResults *int32 +} +// NewScimEnterpriseGroupList instantiates a new ScimEnterpriseGroupList and sets the default values. +func NewScimEnterpriseGroupList()(*ScimEnterpriseGroupList) { + m := &ScimEnterpriseGroupList{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateScimEnterpriseGroupListFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateScimEnterpriseGroupListFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewScimEnterpriseGroupList(), 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 *ScimEnterpriseGroupList) 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 *ScimEnterpriseGroupList) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["itemsPerPage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetItemsPerPage(val) + } + return nil + } + res["Resources"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateScimEnterpriseGroupResponseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ScimEnterpriseGroupResponseable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ScimEnterpriseGroupResponseable) + } + } + m.SetResources(res) + } + return nil + } + res["schemas"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseScimEnterpriseGroupList_schemas) + if err != nil { + return err + } + if val != nil { + res := make([]ScimEnterpriseGroupList_schemas, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*ScimEnterpriseGroupList_schemas)) + } + } + m.SetSchemas(res) + } + return nil + } + res["startIndex"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartIndex(val) + } + return nil + } + res["totalResults"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalResults(val) + } + return nil + } + return res +} +// GetItemsPerPage gets the itemsPerPage property value. Number of objects per page +// returns a *int32 when successful +func (m *ScimEnterpriseGroupList) GetItemsPerPage()(*int32) { + return m.itemsPerPage +} +// GetResources gets the Resources property value. Information about each provisioned group. +// returns a []ScimEnterpriseGroupResponseable when successful +func (m *ScimEnterpriseGroupList) GetResources()([]ScimEnterpriseGroupResponseable) { + return m.resources +} +// GetSchemas gets the schemas property value. The URIs that are used to indicate the namespaces of the list SCIM schemas. +// returns a []ScimEnterpriseGroupList_schemas when successful +func (m *ScimEnterpriseGroupList) GetSchemas()([]ScimEnterpriseGroupList_schemas) { + return m.schemas +} +// GetStartIndex gets the startIndex property value. A starting index for the returned page +// returns a *int32 when successful +func (m *ScimEnterpriseGroupList) GetStartIndex()(*int32) { + return m.startIndex +} +// GetTotalResults gets the totalResults property value. Number of results found +// returns a *int32 when successful +func (m *ScimEnterpriseGroupList) GetTotalResults()(*int32) { + return m.totalResults +} +// Serialize serializes information the current object +func (m *ScimEnterpriseGroupList) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("itemsPerPage", m.GetItemsPerPage()) + if err != nil { + return err + } + } + if m.GetResources() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetResources())) + for i, v := range m.GetResources() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("Resources", cast) + if err != nil { + return err + } + } + if m.GetSchemas() != nil { + err := writer.WriteCollectionOfStringValues("schemas", SerializeScimEnterpriseGroupList_schemas(m.GetSchemas())) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("startIndex", m.GetStartIndex()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("totalResults", m.GetTotalResults()) + 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 *ScimEnterpriseGroupList) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetItemsPerPage sets the itemsPerPage property value. Number of objects per page +func (m *ScimEnterpriseGroupList) SetItemsPerPage(value *int32)() { + m.itemsPerPage = value +} +// SetResources sets the Resources property value. Information about each provisioned group. +func (m *ScimEnterpriseGroupList) SetResources(value []ScimEnterpriseGroupResponseable)() { + m.resources = value +} +// SetSchemas sets the schemas property value. The URIs that are used to indicate the namespaces of the list SCIM schemas. +func (m *ScimEnterpriseGroupList) SetSchemas(value []ScimEnterpriseGroupList_schemas)() { + m.schemas = value +} +// SetStartIndex sets the startIndex property value. A starting index for the returned page +func (m *ScimEnterpriseGroupList) SetStartIndex(value *int32)() { + m.startIndex = value +} +// SetTotalResults sets the totalResults property value. Number of results found +func (m *ScimEnterpriseGroupList) SetTotalResults(value *int32)() { + m.totalResults = value +} +type ScimEnterpriseGroupListable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemsPerPage()(*int32) + GetResources()([]ScimEnterpriseGroupResponseable) + GetSchemas()([]ScimEnterpriseGroupList_schemas) + GetStartIndex()(*int32) + GetTotalResults()(*int32) + SetItemsPerPage(value *int32)() + SetResources(value []ScimEnterpriseGroupResponseable)() + SetSchemas(value []ScimEnterpriseGroupList_schemas)() + SetStartIndex(value *int32)() + SetTotalResults(value *int32)() +} diff --git a/pkg/github/models/scim_enterprise_group_list_escaped_schemas.go b/pkg/github/models/scim_enterprise_group_list_escaped_schemas.go new file mode 100644 index 00000000..9e3fedf4 --- /dev/null +++ b/pkg/github/models/scim_enterprise_group_list_escaped_schemas.go @@ -0,0 +1,30 @@ +package models +type ScimEnterpriseGroupList_schemas int + +const ( + URNIETFPARAMSSCIMAPIMESSAGES20LISTRESPONSE_SCIMENTERPRISEGROUPLIST_SCHEMAS ScimEnterpriseGroupList_schemas = iota +) + +func (i ScimEnterpriseGroupList_schemas) String() string { + return []string{"urn:ietf:params:scim:api:messages:2.0:ListResponse"}[i] +} +func ParseScimEnterpriseGroupList_schemas(v string) (any, error) { + result := URNIETFPARAMSSCIMAPIMESSAGES20LISTRESPONSE_SCIMENTERPRISEGROUPLIST_SCHEMAS + switch v { + case "urn:ietf:params:scim:api:messages:2.0:ListResponse": + result = URNIETFPARAMSSCIMAPIMESSAGES20LISTRESPONSE_SCIMENTERPRISEGROUPLIST_SCHEMAS + default: + return nil, nil + } + return &result, nil +} +func SerializeScimEnterpriseGroupList_schemas(values []ScimEnterpriseGroupList_schemas) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ScimEnterpriseGroupList_schemas) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/scim_enterprise_group_response.go b/pkg/github/models/scim_enterprise_group_response.go new file mode 100644 index 00000000..3e1b3166 --- /dev/null +++ b/pkg/github/models/scim_enterprise_group_response.go @@ -0,0 +1,97 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ScimEnterpriseGroupResponse struct { + GroupResponse + // The internally generated id for the group object. + id *string + // The metadata associated with the creation/updates to the user. + meta Metaable +} +// NewScimEnterpriseGroupResponse instantiates a new ScimEnterpriseGroupResponse and sets the default values. +func NewScimEnterpriseGroupResponse()(*ScimEnterpriseGroupResponse) { + m := &ScimEnterpriseGroupResponse{ + GroupResponse: *NewGroupResponse(), + } + return m +} +// CreateScimEnterpriseGroupResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateScimEnterpriseGroupResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewScimEnterpriseGroupResponse(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ScimEnterpriseGroupResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := m.GroupResponse.GetFieldDeserializers() + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["meta"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMetaFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMeta(val.(Metaable)) + } + return nil + } + return res +} +// GetId gets the id property value. The internally generated id for the group object. +// returns a *string when successful +func (m *ScimEnterpriseGroupResponse) GetId()(*string) { + return m.id +} +// GetMeta gets the meta property value. The metadata associated with the creation/updates to the user. +// returns a Metaable when successful +func (m *ScimEnterpriseGroupResponse) GetMeta()(Metaable) { + return m.meta +} +// Serialize serializes information the current object +func (m *ScimEnterpriseGroupResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + err := m.GroupResponse.Serialize(writer) + if err != nil { + return err + } + { + err = writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("meta", m.GetMeta()) + if err != nil { + return err + } + } + return nil +} +// SetId sets the id property value. The internally generated id for the group object. +func (m *ScimEnterpriseGroupResponse) SetId(value *string)() { + m.id = value +} +// SetMeta sets the meta property value. The metadata associated with the creation/updates to the user. +func (m *ScimEnterpriseGroupResponse) SetMeta(value Metaable)() { + m.meta = value +} +type ScimEnterpriseGroupResponseable interface { + GroupResponseable + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*string) + GetMeta()(Metaable) + SetId(value *string)() + SetMeta(value Metaable)() +} diff --git a/pkg/github/models/scim_enterprise_group_response_escaped_members.go b/pkg/github/models/scim_enterprise_group_response_escaped_members.go new file mode 100644 index 00000000..7a807c2d --- /dev/null +++ b/pkg/github/models/scim_enterprise_group_response_escaped_members.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ScimEnterpriseGroupResponse_members 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 display property + display *string + // The Ref property + ref *string + // The value property + value *string +} +// NewScimEnterpriseGroupResponse_members instantiates a new ScimEnterpriseGroupResponse_members and sets the default values. +func NewScimEnterpriseGroupResponse_members()(*ScimEnterpriseGroupResponse_members) { + m := &ScimEnterpriseGroupResponse_members{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateScimEnterpriseGroupResponse_membersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateScimEnterpriseGroupResponse_membersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewScimEnterpriseGroupResponse_members(), 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 *ScimEnterpriseGroupResponse_members) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDisplay gets the display property value. The display property +// returns a *string when successful +func (m *ScimEnterpriseGroupResponse_members) GetDisplay()(*string) { + return m.display +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ScimEnterpriseGroupResponse_members) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["display"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplay(val) + } + return nil + } + res["$ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetRef gets the $ref property value. The Ref property +// returns a *string when successful +func (m *ScimEnterpriseGroupResponse_members) GetRef()(*string) { + return m.ref +} +// GetValue gets the value property value. The value property +// returns a *string when successful +func (m *ScimEnterpriseGroupResponse_members) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ScimEnterpriseGroupResponse_members) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("display", m.GetDisplay()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("$ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + 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 *ScimEnterpriseGroupResponse_members) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDisplay sets the display property value. The display property +func (m *ScimEnterpriseGroupResponse_members) SetDisplay(value *string)() { + m.display = value +} +// SetRef sets the $ref property value. The Ref property +func (m *ScimEnterpriseGroupResponse_members) SetRef(value *string)() { + m.ref = value +} +// SetValue sets the value property value. The value property +func (m *ScimEnterpriseGroupResponse_members) SetValue(value *string)() { + m.value = value +} +type ScimEnterpriseGroupResponse_membersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDisplay()(*string) + GetRef()(*string) + GetValue()(*string) + SetDisplay(value *string)() + SetRef(value *string)() + SetValue(value *string)() +} diff --git a/pkg/github/models/scim_enterprise_user_list.go b/pkg/github/models/scim_enterprise_user_list.go new file mode 100644 index 00000000..68b63ed9 --- /dev/null +++ b/pkg/github/models/scim_enterprise_user_list.go @@ -0,0 +1,214 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ScimEnterpriseUserList struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Number of objects per page + itemsPerPage *int32 + // Information about each provisioned account. + resources []ScimEnterpriseUserResponseable + // The URIs that are used to indicate the namespaces of the list SCIM schemas. + schemas []ScimEnterpriseUserList_schemas + // A starting index for the returned page + startIndex *int32 + // Number of results found + totalResults *int32 +} +// NewScimEnterpriseUserList instantiates a new ScimEnterpriseUserList and sets the default values. +func NewScimEnterpriseUserList()(*ScimEnterpriseUserList) { + m := &ScimEnterpriseUserList{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateScimEnterpriseUserListFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateScimEnterpriseUserListFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewScimEnterpriseUserList(), 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 *ScimEnterpriseUserList) 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 *ScimEnterpriseUserList) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["itemsPerPage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetItemsPerPage(val) + } + return nil + } + res["Resources"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateScimEnterpriseUserResponseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ScimEnterpriseUserResponseable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ScimEnterpriseUserResponseable) + } + } + m.SetResources(res) + } + return nil + } + res["schemas"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseScimEnterpriseUserList_schemas) + if err != nil { + return err + } + if val != nil { + res := make([]ScimEnterpriseUserList_schemas, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*ScimEnterpriseUserList_schemas)) + } + } + m.SetSchemas(res) + } + return nil + } + res["startIndex"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartIndex(val) + } + return nil + } + res["totalResults"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalResults(val) + } + return nil + } + return res +} +// GetItemsPerPage gets the itemsPerPage property value. Number of objects per page +// returns a *int32 when successful +func (m *ScimEnterpriseUserList) GetItemsPerPage()(*int32) { + return m.itemsPerPage +} +// GetResources gets the Resources property value. Information about each provisioned account. +// returns a []ScimEnterpriseUserResponseable when successful +func (m *ScimEnterpriseUserList) GetResources()([]ScimEnterpriseUserResponseable) { + return m.resources +} +// GetSchemas gets the schemas property value. The URIs that are used to indicate the namespaces of the list SCIM schemas. +// returns a []ScimEnterpriseUserList_schemas when successful +func (m *ScimEnterpriseUserList) GetSchemas()([]ScimEnterpriseUserList_schemas) { + return m.schemas +} +// GetStartIndex gets the startIndex property value. A starting index for the returned page +// returns a *int32 when successful +func (m *ScimEnterpriseUserList) GetStartIndex()(*int32) { + return m.startIndex +} +// GetTotalResults gets the totalResults property value. Number of results found +// returns a *int32 when successful +func (m *ScimEnterpriseUserList) GetTotalResults()(*int32) { + return m.totalResults +} +// Serialize serializes information the current object +func (m *ScimEnterpriseUserList) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("itemsPerPage", m.GetItemsPerPage()) + if err != nil { + return err + } + } + if m.GetResources() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetResources())) + for i, v := range m.GetResources() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("Resources", cast) + if err != nil { + return err + } + } + if m.GetSchemas() != nil { + err := writer.WriteCollectionOfStringValues("schemas", SerializeScimEnterpriseUserList_schemas(m.GetSchemas())) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("startIndex", m.GetStartIndex()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("totalResults", m.GetTotalResults()) + 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 *ScimEnterpriseUserList) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetItemsPerPage sets the itemsPerPage property value. Number of objects per page +func (m *ScimEnterpriseUserList) SetItemsPerPage(value *int32)() { + m.itemsPerPage = value +} +// SetResources sets the Resources property value. Information about each provisioned account. +func (m *ScimEnterpriseUserList) SetResources(value []ScimEnterpriseUserResponseable)() { + m.resources = value +} +// SetSchemas sets the schemas property value. The URIs that are used to indicate the namespaces of the list SCIM schemas. +func (m *ScimEnterpriseUserList) SetSchemas(value []ScimEnterpriseUserList_schemas)() { + m.schemas = value +} +// SetStartIndex sets the startIndex property value. A starting index for the returned page +func (m *ScimEnterpriseUserList) SetStartIndex(value *int32)() { + m.startIndex = value +} +// SetTotalResults sets the totalResults property value. Number of results found +func (m *ScimEnterpriseUserList) SetTotalResults(value *int32)() { + m.totalResults = value +} +type ScimEnterpriseUserListable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemsPerPage()(*int32) + GetResources()([]ScimEnterpriseUserResponseable) + GetSchemas()([]ScimEnterpriseUserList_schemas) + GetStartIndex()(*int32) + GetTotalResults()(*int32) + SetItemsPerPage(value *int32)() + SetResources(value []ScimEnterpriseUserResponseable)() + SetSchemas(value []ScimEnterpriseUserList_schemas)() + SetStartIndex(value *int32)() + SetTotalResults(value *int32)() +} diff --git a/pkg/github/models/scim_enterprise_user_list_escaped_schemas.go b/pkg/github/models/scim_enterprise_user_list_escaped_schemas.go new file mode 100644 index 00000000..9db8ee17 --- /dev/null +++ b/pkg/github/models/scim_enterprise_user_list_escaped_schemas.go @@ -0,0 +1,30 @@ +package models +type ScimEnterpriseUserList_schemas int + +const ( + URNIETFPARAMSSCIMAPIMESSAGES20LISTRESPONSE_SCIMENTERPRISEUSERLIST_SCHEMAS ScimEnterpriseUserList_schemas = iota +) + +func (i ScimEnterpriseUserList_schemas) String() string { + return []string{"urn:ietf:params:scim:api:messages:2.0:ListResponse"}[i] +} +func ParseScimEnterpriseUserList_schemas(v string) (any, error) { + result := URNIETFPARAMSSCIMAPIMESSAGES20LISTRESPONSE_SCIMENTERPRISEUSERLIST_SCHEMAS + switch v { + case "urn:ietf:params:scim:api:messages:2.0:ListResponse": + result = URNIETFPARAMSSCIMAPIMESSAGES20LISTRESPONSE_SCIMENTERPRISEUSERLIST_SCHEMAS + default: + return nil, nil + } + return &result, nil +} +func SerializeScimEnterpriseUserList_schemas(values []ScimEnterpriseUserList_schemas) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ScimEnterpriseUserList_schemas) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/scim_enterprise_user_response.go b/pkg/github/models/scim_enterprise_user_response.go new file mode 100644 index 00000000..bf169025 --- /dev/null +++ b/pkg/github/models/scim_enterprise_user_response.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ScimEnterpriseUserResponse struct { + UserResponse + // Provisioned SCIM groups that the user is a member of. + groups []ScimEnterpriseUserResponse_groupsable + // The internally generated id for the user object. + id *string + // The metadata associated with the creation/updates to the user. + meta Metaable +} +// NewScimEnterpriseUserResponse instantiates a new ScimEnterpriseUserResponse and sets the default values. +func NewScimEnterpriseUserResponse()(*ScimEnterpriseUserResponse) { + m := &ScimEnterpriseUserResponse{ + UserResponse: *NewUserResponse(), + } + return m +} +// CreateScimEnterpriseUserResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateScimEnterpriseUserResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewScimEnterpriseUserResponse(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ScimEnterpriseUserResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := m.UserResponse.GetFieldDeserializers() + res["groups"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateScimEnterpriseUserResponse_groupsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ScimEnterpriseUserResponse_groupsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ScimEnterpriseUserResponse_groupsable) + } + } + m.SetGroups(res) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["meta"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMetaFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMeta(val.(Metaable)) + } + return nil + } + return res +} +// GetGroups gets the groups property value. Provisioned SCIM groups that the user is a member of. +// returns a []ScimEnterpriseUserResponse_groupsable when successful +func (m *ScimEnterpriseUserResponse) GetGroups()([]ScimEnterpriseUserResponse_groupsable) { + return m.groups +} +// GetId gets the id property value. The internally generated id for the user object. +// returns a *string when successful +func (m *ScimEnterpriseUserResponse) GetId()(*string) { + return m.id +} +// GetMeta gets the meta property value. The metadata associated with the creation/updates to the user. +// returns a Metaable when successful +func (m *ScimEnterpriseUserResponse) GetMeta()(Metaable) { + return m.meta +} +// Serialize serializes information the current object +func (m *ScimEnterpriseUserResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + err := m.UserResponse.Serialize(writer) + if err != nil { + return err + } + if m.GetGroups() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetGroups())) + for i, v := range m.GetGroups() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err = writer.WriteCollectionOfObjectValues("groups", cast) + if err != nil { + return err + } + } + { + err = writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err = writer.WriteObjectValue("meta", m.GetMeta()) + if err != nil { + return err + } + } + return nil +} +// SetGroups sets the groups property value. Provisioned SCIM groups that the user is a member of. +func (m *ScimEnterpriseUserResponse) SetGroups(value []ScimEnterpriseUserResponse_groupsable)() { + m.groups = value +} +// SetId sets the id property value. The internally generated id for the user object. +func (m *ScimEnterpriseUserResponse) SetId(value *string)() { + m.id = value +} +// SetMeta sets the meta property value. The metadata associated with the creation/updates to the user. +func (m *ScimEnterpriseUserResponse) SetMeta(value Metaable)() { + m.meta = value +} +type ScimEnterpriseUserResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + UserResponseable + GetGroups()([]ScimEnterpriseUserResponse_groupsable) + GetId()(*string) + GetMeta()(Metaable) + SetGroups(value []ScimEnterpriseUserResponse_groupsable)() + SetId(value *string)() + SetMeta(value Metaable)() +} diff --git a/pkg/github/models/scim_enterprise_user_response_escaped_groups.go b/pkg/github/models/scim_enterprise_user_response_escaped_groups.go new file mode 100644 index 00000000..2b29284d --- /dev/null +++ b/pkg/github/models/scim_enterprise_user_response_escaped_groups.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ScimEnterpriseUserResponse_groups 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 display property + display *string + // The Ref property + ref *string + // The value property + value *string +} +// NewScimEnterpriseUserResponse_groups instantiates a new ScimEnterpriseUserResponse_groups and sets the default values. +func NewScimEnterpriseUserResponse_groups()(*ScimEnterpriseUserResponse_groups) { + m := &ScimEnterpriseUserResponse_groups{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateScimEnterpriseUserResponse_groupsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateScimEnterpriseUserResponse_groupsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewScimEnterpriseUserResponse_groups(), 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 *ScimEnterpriseUserResponse_groups) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDisplay gets the display property value. The display property +// returns a *string when successful +func (m *ScimEnterpriseUserResponse_groups) GetDisplay()(*string) { + return m.display +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ScimEnterpriseUserResponse_groups) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["display"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplay(val) + } + return nil + } + res["$ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetRef gets the $ref property value. The Ref property +// returns a *string when successful +func (m *ScimEnterpriseUserResponse_groups) GetRef()(*string) { + return m.ref +} +// GetValue gets the value property value. The value property +// returns a *string when successful +func (m *ScimEnterpriseUserResponse_groups) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ScimEnterpriseUserResponse_groups) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("display", m.GetDisplay()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("$ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + 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 *ScimEnterpriseUserResponse_groups) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDisplay sets the display property value. The display property +func (m *ScimEnterpriseUserResponse_groups) SetDisplay(value *string)() { + m.display = value +} +// SetRef sets the $ref property value. The Ref property +func (m *ScimEnterpriseUserResponse_groups) SetRef(value *string)() { + m.ref = value +} +// SetValue sets the value property value. The value property +func (m *ScimEnterpriseUserResponse_groups) SetValue(value *string)() { + m.value = value +} +type ScimEnterpriseUserResponse_groupsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDisplay()(*string) + GetRef()(*string) + GetValue()(*string) + SetDisplay(value *string)() + SetRef(value *string)() + SetValue(value *string)() +} diff --git a/pkg/github/models/scim_error.go b/pkg/github/models/scim_error.go new file mode 100644 index 00000000..81fc74da --- /dev/null +++ b/pkg/github/models/scim_error.go @@ -0,0 +1,240 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ScimError scim Error +type ScimError 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 detail property + detail *string + // The documentation_url property + documentation_url *string + // The message property + message *string + // The schemas property + schemas []string + // The scimType property + scimType *string + // The status property + status *int32 +} +// NewScimError instantiates a new ScimError and sets the default values. +func NewScimError()(*ScimError) { + m := &ScimError{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateScimErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateScimErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewScimError(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ScimError) 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 *ScimError) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDetail gets the detail property value. The detail property +// returns a *string when successful +func (m *ScimError) GetDetail()(*string) { + return m.detail +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ScimError) 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 *ScimError) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["detail"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDetail(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 + } + res["schemas"] = 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.SetSchemas(res) + } + return nil + } + res["scimType"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetScimType(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ScimError) GetMessage()(*string) { + return m.message +} +// GetSchemas gets the schemas property value. The schemas property +// returns a []string when successful +func (m *ScimError) GetSchemas()([]string) { + return m.schemas +} +// GetScimType gets the scimType property value. The scimType property +// returns a *string when successful +func (m *ScimError) GetScimType()(*string) { + return m.scimType +} +// GetStatus gets the status property value. The status property +// returns a *int32 when successful +func (m *ScimError) GetStatus()(*int32) { + return m.status +} +// Serialize serializes information the current object +func (m *ScimError) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("detail", m.GetDetail()) + 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 + } + } + if m.GetSchemas() != nil { + err := writer.WriteCollectionOfStringValues("schemas", m.GetSchemas()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("scimType", m.GetScimType()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("status", m.GetStatus()) + 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 *ScimError) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDetail sets the detail property value. The detail property +func (m *ScimError) SetDetail(value *string)() { + m.detail = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ScimError) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ScimError) SetMessage(value *string)() { + m.message = value +} +// SetSchemas sets the schemas property value. The schemas property +func (m *ScimError) SetSchemas(value []string)() { + m.schemas = value +} +// SetScimType sets the scimType property value. The scimType property +func (m *ScimError) SetScimType(value *string)() { + m.scimType = value +} +// SetStatus sets the status property value. The status property +func (m *ScimError) SetStatus(value *int32)() { + m.status = value +} +type ScimErrorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDetail()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + GetSchemas()([]string) + GetScimType()(*string) + GetStatus()(*int32) + SetDetail(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() + SetSchemas(value []string)() + SetScimType(value *string)() + SetStatus(value *int32)() +} diff --git a/pkg/github/models/secret_scanning_alert.go b/pkg/github/models/secret_scanning_alert.go new file mode 100644 index 00000000..db6d214a --- /dev/null +++ b/pkg/github/models/secret_scanning_alert.go @@ -0,0 +1,547 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SecretScanningAlert struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The GitHub URL of the alert resource. + html_url *string + // The REST API URL of the code locations for this alert. + locations_url *string + // The security alert number. + number *int32 + // 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`. + push_protection_bypassed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + push_protection_bypassed_by NullableSimpleUserable + // **Required when the `state` is `resolved`.** The reason for resolving the alert. + resolution *SecretScanningAlertResolution + // An optional comment to resolve an alert. + resolution_comment *string + // The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + resolved_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + resolved_by NullableSimpleUserable + // The secret that was detected. + secret *string + // The type of secret that secret scanning detected. + secret_type *string + // User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." + secret_type_display_name *string + // Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. + state *SecretScanningAlertState + // The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The REST API URL of the alert resource. + url *string + // The token status as of the latest validity check. + validity *SecretScanningAlert_validity +} +// NewSecretScanningAlert instantiates a new SecretScanningAlert and sets the default values. +func NewSecretScanningAlert()(*SecretScanningAlert) { + m := &SecretScanningAlert{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningAlertFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningAlertFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningAlert(), 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 *SecretScanningAlert) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *SecretScanningAlert) 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 *SecretScanningAlert) 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["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["locations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocationsUrl(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["push_protection_bypassed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPushProtectionBypassed(val) + } + return nil + } + res["push_protection_bypassed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushProtectionBypassedAt(val) + } + return nil + } + res["push_protection_bypassed_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPushProtectionBypassedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["resolution"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecretScanningAlertResolution) + if err != nil { + return err + } + if val != nil { + m.SetResolution(val.(*SecretScanningAlertResolution)) + } + return nil + } + res["resolution_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResolutionComment(val) + } + return nil + } + res["resolved_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetResolvedAt(val) + } + return nil + } + res["resolved_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetResolvedBy(val.(NullableSimpleUserable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["secret_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretType(val) + } + return nil + } + res["secret_type_display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretTypeDisplayName(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecretScanningAlertState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*SecretScanningAlertState)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["validity"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecretScanningAlert_validity) + if err != nil { + return err + } + if val != nil { + m.SetValidity(val.(*SecretScanningAlert_validity)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The GitHub URL of the alert resource. +// returns a *string when successful +func (m *SecretScanningAlert) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLocationsUrl gets the locations_url property value. The REST API URL of the code locations for this alert. +// returns a *string when successful +func (m *SecretScanningAlert) GetLocationsUrl()(*string) { + return m.locations_url +} +// GetNumber gets the number property value. The security alert number. +// returns a *int32 when successful +func (m *SecretScanningAlert) GetNumber()(*int32) { + return m.number +} +// GetPushProtectionBypassed gets the push_protection_bypassed property value. Whether push protection was bypassed for the detected secret. +// returns a *bool when successful +func (m *SecretScanningAlert) GetPushProtectionBypassed()(*bool) { + return m.push_protection_bypassed +} +// GetPushProtectionBypassedAt gets the push_protection_bypassed_at property value. The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *SecretScanningAlert) GetPushProtectionBypassedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.push_protection_bypassed_at +} +// GetPushProtectionBypassedBy gets the push_protection_bypassed_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *SecretScanningAlert) GetPushProtectionBypassedBy()(NullableSimpleUserable) { + return m.push_protection_bypassed_by +} +// 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) { + return m.resolution +} +// GetResolutionComment gets the resolution_comment property value. An optional comment to resolve an alert. +// returns a *string when successful +func (m *SecretScanningAlert) GetResolutionComment()(*string) { + return m.resolution_comment +} +// GetResolvedAt gets the resolved_at property value. The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *SecretScanningAlert) GetResolvedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.resolved_at +} +// GetResolvedBy gets the resolved_by property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *SecretScanningAlert) GetResolvedBy()(NullableSimpleUserable) { + return m.resolved_by +} +// GetSecret gets the secret property value. The secret that was detected. +// returns a *string when successful +func (m *SecretScanningAlert) GetSecret()(*string) { + return m.secret +} +// GetSecretType gets the secret_type property value. The type of secret that secret scanning detected. +// returns a *string when successful +func (m *SecretScanningAlert) GetSecretType()(*string) { + return m.secret_type +} +// GetSecretTypeDisplayName gets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." +// returns a *string when successful +func (m *SecretScanningAlert) GetSecretTypeDisplayName()(*string) { + return m.secret_type_display_name +} +// GetState gets the state property value. Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. +// returns a *SecretScanningAlertState when successful +func (m *SecretScanningAlert) GetState()(*SecretScanningAlertState) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *SecretScanningAlert) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The REST API URL of the alert resource. +// returns a *string when successful +func (m *SecretScanningAlert) GetUrl()(*string) { + return m.url +} +// GetValidity gets the validity property value. The token status as of the latest validity check. +// returns a *SecretScanningAlert_validity when successful +func (m *SecretScanningAlert) GetValidity()(*SecretScanningAlert_validity) { + return m.validity +} +// Serialize serializes information the current object +func (m *SecretScanningAlert) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("locations_url", m.GetLocationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push_protection_bypassed", m.GetPushProtectionBypassed()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("push_protection_bypassed_at", m.GetPushProtectionBypassedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("push_protection_bypassed_by", m.GetPushProtectionBypassedBy()) + if err != nil { + return err + } + } + if m.GetResolution() != nil { + cast := (*m.GetResolution()).String() + err := writer.WriteStringValue("resolution", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resolution_comment", m.GetResolutionComment()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("resolved_at", m.GetResolvedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("resolved_by", m.GetResolvedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_type", m.GetSecretType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_type_display_name", m.GetSecretTypeDisplayName()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + if m.GetValidity() != nil { + cast := (*m.GetValidity()).String() + err := writer.WriteStringValue("validity", &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 *SecretScanningAlert) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time that the alert was created in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *SecretScanningAlert) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The GitHub URL of the alert resource. +func (m *SecretScanningAlert) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLocationsUrl sets the locations_url property value. The REST API URL of the code locations for this alert. +func (m *SecretScanningAlert) SetLocationsUrl(value *string)() { + m.locations_url = value +} +// SetNumber sets the number property value. The security alert number. +func (m *SecretScanningAlert) SetNumber(value *int32)() { + m.number = value +} +// SetPushProtectionBypassed sets the push_protection_bypassed property value. Whether push protection was bypassed for the detected secret. +func (m *SecretScanningAlert) SetPushProtectionBypassed(value *bool)() { + m.push_protection_bypassed = value +} +// SetPushProtectionBypassedAt sets the push_protection_bypassed_at property value. The time that push protection was bypassed in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *SecretScanningAlert) SetPushProtectionBypassedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.push_protection_bypassed_at = value +} +// SetPushProtectionBypassedBy sets the push_protection_bypassed_by property value. A GitHub user. +func (m *SecretScanningAlert) SetPushProtectionBypassedBy(value NullableSimpleUserable)() { + m.push_protection_bypassed_by = 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 +} +// SetResolutionComment sets the resolution_comment property value. An optional comment to resolve an alert. +func (m *SecretScanningAlert) SetResolutionComment(value *string)() { + m.resolution_comment = value +} +// SetResolvedAt sets the resolved_at property value. The time that the alert was resolved in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *SecretScanningAlert) SetResolvedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.resolved_at = value +} +// SetResolvedBy sets the resolved_by property value. A GitHub user. +func (m *SecretScanningAlert) SetResolvedBy(value NullableSimpleUserable)() { + m.resolved_by = value +} +// SetSecret sets the secret property value. The secret that was detected. +func (m *SecretScanningAlert) SetSecret(value *string)() { + m.secret = value +} +// SetSecretType sets the secret_type property value. The type of secret that secret scanning detected. +func (m *SecretScanningAlert) SetSecretType(value *string)() { + m.secret_type = value +} +// SetSecretTypeDisplayName sets the secret_type_display_name property value. User-friendly name for the detected secret, matching the `secret_type`.For a list of built-in patterns, see "[Supported secret scanning patterns](https://docs.github.com/enterprise-server@3.14/code-security/secret-scanning/introduction/supported-secret-scanning-patterns#supported-secrets)." +func (m *SecretScanningAlert) SetSecretTypeDisplayName(value *string)() { + m.secret_type_display_name = value +} +// SetState sets the state property value. Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. +func (m *SecretScanningAlert) SetState(value *SecretScanningAlertState)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The time that the alert was last updated in ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *SecretScanningAlert) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The REST API URL of the alert resource. +func (m *SecretScanningAlert) SetUrl(value *string)() { + m.url = value +} +// SetValidity sets the validity property value. The token status as of the latest validity check. +func (m *SecretScanningAlert) SetValidity(value *SecretScanningAlert_validity)() { + m.validity = value +} +type SecretScanningAlertable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetLocationsUrl()(*string) + GetNumber()(*int32) + GetPushProtectionBypassed()(*bool) + GetPushProtectionBypassedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetPushProtectionBypassedBy()(NullableSimpleUserable) + GetResolution()(*SecretScanningAlertResolution) + GetResolutionComment()(*string) + GetResolvedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetResolvedBy()(NullableSimpleUserable) + GetSecret()(*string) + GetSecretType()(*string) + GetSecretTypeDisplayName()(*string) + GetState()(*SecretScanningAlertState) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetValidity()(*SecretScanningAlert_validity) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetLocationsUrl(value *string)() + SetNumber(value *int32)() + SetPushProtectionBypassed(value *bool)() + SetPushProtectionBypassedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetPushProtectionBypassedBy(value NullableSimpleUserable)() + SetResolution(value *SecretScanningAlertResolution)() + SetResolutionComment(value *string)() + SetResolvedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetResolvedBy(value NullableSimpleUserable)() + SetSecret(value *string)() + SetSecretType(value *string)() + SetSecretTypeDisplayName(value *string)() + SetState(value *SecretScanningAlertState)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetValidity(value *SecretScanningAlert_validity)() +} diff --git a/pkg/github/models/secret_scanning_alert503_error.go b/pkg/github/models/secret_scanning_alert503_error.go new file mode 100644 index 00000000..5eb9722f --- /dev/null +++ b/pkg/github/models/secret_scanning_alert503_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 SecretScanningAlert503Error 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 +} +// NewSecretScanningAlert503Error instantiates a new SecretScanningAlert503Error and sets the default values. +func NewSecretScanningAlert503Error()(*SecretScanningAlert503Error) { + m := &SecretScanningAlert503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningAlert503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningAlert503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningAlert503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *SecretScanningAlert503Error) 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 *SecretScanningAlert503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *SecretScanningAlert503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *SecretScanningAlert503Error) 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 *SecretScanningAlert503Error) 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 *SecretScanningAlert503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *SecretScanningAlert503Error) 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 *SecretScanningAlert503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *SecretScanningAlert503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *SecretScanningAlert503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *SecretScanningAlert503Error) SetMessage(value *string)() { + m.message = value +} +type SecretScanningAlert503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/pkg/github/models/secret_scanning_alert_escaped_validity.go b/pkg/github/models/secret_scanning_alert_escaped_validity.go new file mode 100644 index 00000000..d63fd164 --- /dev/null +++ b/pkg/github/models/secret_scanning_alert_escaped_validity.go @@ -0,0 +1,37 @@ +package models +// The token status as of the latest validity check. +type SecretScanningAlert_validity int + +const ( + ACTIVE_SECRETSCANNINGALERT_VALIDITY SecretScanningAlert_validity = iota + INACTIVE_SECRETSCANNINGALERT_VALIDITY + UNKNOWN_SECRETSCANNINGALERT_VALIDITY +) + +func (i SecretScanningAlert_validity) String() string { + return []string{"active", "inactive", "unknown"}[i] +} +func ParseSecretScanningAlert_validity(v string) (any, error) { + result := ACTIVE_SECRETSCANNINGALERT_VALIDITY + switch v { + case "active": + result = ACTIVE_SECRETSCANNINGALERT_VALIDITY + case "inactive": + result = INACTIVE_SECRETSCANNINGALERT_VALIDITY + case "unknown": + result = UNKNOWN_SECRETSCANNINGALERT_VALIDITY + default: + return nil, nil + } + return &result, nil +} +func SerializeSecretScanningAlert_validity(values []SecretScanningAlert_validity) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecretScanningAlert_validity) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/secret_scanning_alert_resolution.go b/pkg/github/models/secret_scanning_alert_resolution.go new file mode 100644 index 00000000..d5620971 --- /dev/null +++ b/pkg/github/models/secret_scanning_alert_resolution.go @@ -0,0 +1,40 @@ +package models +// **Required when the `state` is `resolved`.** The reason for resolving the alert. +type SecretScanningAlertResolution int + +const ( + FALSE_POSITIVE_SECRETSCANNINGALERTRESOLUTION SecretScanningAlertResolution = iota + WONT_FIX_SECRETSCANNINGALERTRESOLUTION + REVOKED_SECRETSCANNINGALERTRESOLUTION + USED_IN_TESTS_SECRETSCANNINGALERTRESOLUTION +) + +func (i SecretScanningAlertResolution) String() string { + return []string{"false_positive", "wont_fix", "revoked", "used_in_tests"}[i] +} +func ParseSecretScanningAlertResolution(v string) (any, error) { + result := FALSE_POSITIVE_SECRETSCANNINGALERTRESOLUTION + switch v { + case "false_positive": + result = FALSE_POSITIVE_SECRETSCANNINGALERTRESOLUTION + case "wont_fix": + result = WONT_FIX_SECRETSCANNINGALERTRESOLUTION + case "revoked": + result = REVOKED_SECRETSCANNINGALERTRESOLUTION + case "used_in_tests": + result = USED_IN_TESTS_SECRETSCANNINGALERTRESOLUTION + default: + return nil, nil + } + return &result, nil +} +func SerializeSecretScanningAlertResolution(values []SecretScanningAlertResolution) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecretScanningAlertResolution) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/secret_scanning_alert_state.go b/pkg/github/models/secret_scanning_alert_state.go new file mode 100644 index 00000000..f390eba6 --- /dev/null +++ b/pkg/github/models/secret_scanning_alert_state.go @@ -0,0 +1,34 @@ +package models +// Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. +type SecretScanningAlertState int + +const ( + OPEN_SECRETSCANNINGALERTSTATE SecretScanningAlertState = iota + RESOLVED_SECRETSCANNINGALERTSTATE +) + +func (i SecretScanningAlertState) String() string { + return []string{"open", "resolved"}[i] +} +func ParseSecretScanningAlertState(v string) (any, error) { + result := OPEN_SECRETSCANNINGALERTSTATE + switch v { + case "open": + result = OPEN_SECRETSCANNINGALERTSTATE + case "resolved": + result = RESOLVED_SECRETSCANNINGALERTSTATE + default: + return nil, nil + } + return &result, nil +} +func SerializeSecretScanningAlertState(values []SecretScanningAlertState) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecretScanningAlertState) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/secret_scanning_location.go b/pkg/github/models/secret_scanning_location.go new file mode 100644 index 00000000..bc5f454a --- /dev/null +++ b/pkg/github/models/secret_scanning_location.go @@ -0,0 +1,391 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SecretScanningLocation 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 details property + details SecretScanningLocation_SecretScanningLocation_detailsable + // The location type. Because secrets may be found in different types of resources (ie. code, comments, issues, pull requests, discussions), this field identifies the type of resource where the secret was found. + typeEscaped *SecretScanningLocation_type +} +// SecretScanningLocation_SecretScanningLocation_details composed type wrapper for classes SecretScanningLocationCommitable, SecretScanningLocationDiscussionBodyable, SecretScanningLocationDiscussionCommentable, SecretScanningLocationDiscussionTitleable, SecretScanningLocationIssueBodyable, SecretScanningLocationIssueCommentable, SecretScanningLocationIssueTitleable, SecretScanningLocationPullRequestBodyable, SecretScanningLocationPullRequestCommentable, SecretScanningLocationPullRequestReviewable, SecretScanningLocationPullRequestReviewCommentable, SecretScanningLocationPullRequestTitleable, SecretScanningLocationWikiCommitable +type SecretScanningLocation_SecretScanningLocation_details struct { + // Composed type representation for type SecretScanningLocationCommitable + secretScanningLocationCommit SecretScanningLocationCommitable + // Composed type representation for type SecretScanningLocationDiscussionBodyable + secretScanningLocationDiscussionBody SecretScanningLocationDiscussionBodyable + // Composed type representation for type SecretScanningLocationDiscussionCommentable + secretScanningLocationDiscussionComment SecretScanningLocationDiscussionCommentable + // Composed type representation for type SecretScanningLocationDiscussionTitleable + secretScanningLocationDiscussionTitle SecretScanningLocationDiscussionTitleable + // Composed type representation for type SecretScanningLocationIssueBodyable + secretScanningLocationIssueBody SecretScanningLocationIssueBodyable + // Composed type representation for type SecretScanningLocationIssueCommentable + secretScanningLocationIssueComment SecretScanningLocationIssueCommentable + // Composed type representation for type SecretScanningLocationIssueTitleable + secretScanningLocationIssueTitle SecretScanningLocationIssueTitleable + // Composed type representation for type SecretScanningLocationPullRequestBodyable + secretScanningLocationPullRequestBody SecretScanningLocationPullRequestBodyable + // Composed type representation for type SecretScanningLocationPullRequestCommentable + secretScanningLocationPullRequestComment SecretScanningLocationPullRequestCommentable + // Composed type representation for type SecretScanningLocationPullRequestReviewable + secretScanningLocationPullRequestReview SecretScanningLocationPullRequestReviewable + // Composed type representation for type SecretScanningLocationPullRequestReviewCommentable + secretScanningLocationPullRequestReviewComment SecretScanningLocationPullRequestReviewCommentable + // Composed type representation for type SecretScanningLocationPullRequestTitleable + secretScanningLocationPullRequestTitle SecretScanningLocationPullRequestTitleable + // Composed type representation for type SecretScanningLocationWikiCommitable + secretScanningLocationWikiCommit SecretScanningLocationWikiCommitable +} +// NewSecretScanningLocation_SecretScanningLocation_details instantiates a new SecretScanningLocation_SecretScanningLocation_details and sets the default values. +func NewSecretScanningLocation_SecretScanningLocation_details()(*SecretScanningLocation_SecretScanningLocation_details) { + m := &SecretScanningLocation_SecretScanningLocation_details{ + } + return m +} +// CreateSecretScanningLocation_SecretScanningLocation_detailsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocation_SecretScanningLocation_detailsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewSecretScanningLocation_SecretScanningLocation_details() + 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 { + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) 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 *SecretScanningLocation_SecretScanningLocation_details) GetIsComposedType()(bool) { + return true +} +// GetSecretScanningLocationCommit gets the secretScanningLocationCommit property value. Composed type representation for type SecretScanningLocationCommitable +// returns a SecretScanningLocationCommitable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationCommit()(SecretScanningLocationCommitable) { + return m.secretScanningLocationCommit +} +// GetSecretScanningLocationDiscussionBody gets the secretScanningLocationDiscussionBody property value. Composed type representation for type SecretScanningLocationDiscussionBodyable +// returns a SecretScanningLocationDiscussionBodyable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationDiscussionBody()(SecretScanningLocationDiscussionBodyable) { + return m.secretScanningLocationDiscussionBody +} +// GetSecretScanningLocationDiscussionComment gets the secretScanningLocationDiscussionComment property value. Composed type representation for type SecretScanningLocationDiscussionCommentable +// returns a SecretScanningLocationDiscussionCommentable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationDiscussionComment()(SecretScanningLocationDiscussionCommentable) { + return m.secretScanningLocationDiscussionComment +} +// GetSecretScanningLocationDiscussionTitle gets the secretScanningLocationDiscussionTitle property value. Composed type representation for type SecretScanningLocationDiscussionTitleable +// returns a SecretScanningLocationDiscussionTitleable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationDiscussionTitle()(SecretScanningLocationDiscussionTitleable) { + return m.secretScanningLocationDiscussionTitle +} +// GetSecretScanningLocationIssueBody gets the secretScanningLocationIssueBody property value. Composed type representation for type SecretScanningLocationIssueBodyable +// returns a SecretScanningLocationIssueBodyable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationIssueBody()(SecretScanningLocationIssueBodyable) { + return m.secretScanningLocationIssueBody +} +// GetSecretScanningLocationIssueComment gets the secretScanningLocationIssueComment property value. Composed type representation for type SecretScanningLocationIssueCommentable +// returns a SecretScanningLocationIssueCommentable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationIssueComment()(SecretScanningLocationIssueCommentable) { + return m.secretScanningLocationIssueComment +} +// GetSecretScanningLocationIssueTitle gets the secretScanningLocationIssueTitle property value. Composed type representation for type SecretScanningLocationIssueTitleable +// returns a SecretScanningLocationIssueTitleable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationIssueTitle()(SecretScanningLocationIssueTitleable) { + return m.secretScanningLocationIssueTitle +} +// GetSecretScanningLocationPullRequestBody gets the secretScanningLocationPullRequestBody property value. Composed type representation for type SecretScanningLocationPullRequestBodyable +// returns a SecretScanningLocationPullRequestBodyable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationPullRequestBody()(SecretScanningLocationPullRequestBodyable) { + return m.secretScanningLocationPullRequestBody +} +// GetSecretScanningLocationPullRequestComment gets the secretScanningLocationPullRequestComment property value. Composed type representation for type SecretScanningLocationPullRequestCommentable +// returns a SecretScanningLocationPullRequestCommentable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationPullRequestComment()(SecretScanningLocationPullRequestCommentable) { + return m.secretScanningLocationPullRequestComment +} +// GetSecretScanningLocationPullRequestReview gets the secretScanningLocationPullRequestReview property value. Composed type representation for type SecretScanningLocationPullRequestReviewable +// returns a SecretScanningLocationPullRequestReviewable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationPullRequestReview()(SecretScanningLocationPullRequestReviewable) { + return m.secretScanningLocationPullRequestReview +} +// GetSecretScanningLocationPullRequestReviewComment gets the secretScanningLocationPullRequestReviewComment property value. Composed type representation for type SecretScanningLocationPullRequestReviewCommentable +// returns a SecretScanningLocationPullRequestReviewCommentable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationPullRequestReviewComment()(SecretScanningLocationPullRequestReviewCommentable) { + return m.secretScanningLocationPullRequestReviewComment +} +// GetSecretScanningLocationPullRequestTitle gets the secretScanningLocationPullRequestTitle property value. Composed type representation for type SecretScanningLocationPullRequestTitleable +// returns a SecretScanningLocationPullRequestTitleable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationPullRequestTitle()(SecretScanningLocationPullRequestTitleable) { + return m.secretScanningLocationPullRequestTitle +} +// GetSecretScanningLocationWikiCommit gets the secretScanningLocationWikiCommit property value. Composed type representation for type SecretScanningLocationWikiCommitable +// returns a SecretScanningLocationWikiCommitable when successful +func (m *SecretScanningLocation_SecretScanningLocation_details) GetSecretScanningLocationWikiCommit()(SecretScanningLocationWikiCommitable) { + return m.secretScanningLocationWikiCommit +} +// Serialize serializes information the current object +func (m *SecretScanningLocation_SecretScanningLocation_details) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecretScanningLocationCommit() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationCommit()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationDiscussionBody() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationDiscussionBody()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationDiscussionComment() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationDiscussionComment()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationDiscussionTitle() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationDiscussionTitle()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationIssueBody() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationIssueBody()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationIssueComment() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationIssueComment()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationIssueTitle() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationIssueTitle()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationPullRequestBody() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationPullRequestBody()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationPullRequestComment() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationPullRequestComment()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationPullRequestReview() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationPullRequestReview()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationPullRequestReviewComment() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationPullRequestReviewComment()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationPullRequestTitle() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationPullRequestTitle()) + if err != nil { + return err + } + } else if m.GetSecretScanningLocationWikiCommit() != nil { + err := writer.WriteObjectValue("", m.GetSecretScanningLocationWikiCommit()) + if err != nil { + return err + } + } + return nil +} +// SetSecretScanningLocationCommit sets the secretScanningLocationCommit property value. Composed type representation for type SecretScanningLocationCommitable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationCommit(value SecretScanningLocationCommitable)() { + m.secretScanningLocationCommit = value +} +// SetSecretScanningLocationDiscussionBody sets the secretScanningLocationDiscussionBody property value. Composed type representation for type SecretScanningLocationDiscussionBodyable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationDiscussionBody(value SecretScanningLocationDiscussionBodyable)() { + m.secretScanningLocationDiscussionBody = value +} +// SetSecretScanningLocationDiscussionComment sets the secretScanningLocationDiscussionComment property value. Composed type representation for type SecretScanningLocationDiscussionCommentable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationDiscussionComment(value SecretScanningLocationDiscussionCommentable)() { + m.secretScanningLocationDiscussionComment = value +} +// SetSecretScanningLocationDiscussionTitle sets the secretScanningLocationDiscussionTitle property value. Composed type representation for type SecretScanningLocationDiscussionTitleable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationDiscussionTitle(value SecretScanningLocationDiscussionTitleable)() { + m.secretScanningLocationDiscussionTitle = value +} +// SetSecretScanningLocationIssueBody sets the secretScanningLocationIssueBody property value. Composed type representation for type SecretScanningLocationIssueBodyable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationIssueBody(value SecretScanningLocationIssueBodyable)() { + m.secretScanningLocationIssueBody = value +} +// SetSecretScanningLocationIssueComment sets the secretScanningLocationIssueComment property value. Composed type representation for type SecretScanningLocationIssueCommentable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationIssueComment(value SecretScanningLocationIssueCommentable)() { + m.secretScanningLocationIssueComment = value +} +// SetSecretScanningLocationIssueTitle sets the secretScanningLocationIssueTitle property value. Composed type representation for type SecretScanningLocationIssueTitleable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationIssueTitle(value SecretScanningLocationIssueTitleable)() { + m.secretScanningLocationIssueTitle = value +} +// SetSecretScanningLocationPullRequestBody sets the secretScanningLocationPullRequestBody property value. Composed type representation for type SecretScanningLocationPullRequestBodyable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationPullRequestBody(value SecretScanningLocationPullRequestBodyable)() { + m.secretScanningLocationPullRequestBody = value +} +// SetSecretScanningLocationPullRequestComment sets the secretScanningLocationPullRequestComment property value. Composed type representation for type SecretScanningLocationPullRequestCommentable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationPullRequestComment(value SecretScanningLocationPullRequestCommentable)() { + m.secretScanningLocationPullRequestComment = value +} +// SetSecretScanningLocationPullRequestReview sets the secretScanningLocationPullRequestReview property value. Composed type representation for type SecretScanningLocationPullRequestReviewable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationPullRequestReview(value SecretScanningLocationPullRequestReviewable)() { + m.secretScanningLocationPullRequestReview = value +} +// SetSecretScanningLocationPullRequestReviewComment sets the secretScanningLocationPullRequestReviewComment property value. Composed type representation for type SecretScanningLocationPullRequestReviewCommentable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationPullRequestReviewComment(value SecretScanningLocationPullRequestReviewCommentable)() { + m.secretScanningLocationPullRequestReviewComment = value +} +// SetSecretScanningLocationPullRequestTitle sets the secretScanningLocationPullRequestTitle property value. Composed type representation for type SecretScanningLocationPullRequestTitleable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationPullRequestTitle(value SecretScanningLocationPullRequestTitleable)() { + m.secretScanningLocationPullRequestTitle = value +} +// SetSecretScanningLocationWikiCommit sets the secretScanningLocationWikiCommit property value. Composed type representation for type SecretScanningLocationWikiCommitable +func (m *SecretScanningLocation_SecretScanningLocation_details) SetSecretScanningLocationWikiCommit(value SecretScanningLocationWikiCommitable)() { + m.secretScanningLocationWikiCommit = value +} +type SecretScanningLocation_SecretScanningLocation_detailsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecretScanningLocationCommit()(SecretScanningLocationCommitable) + GetSecretScanningLocationDiscussionBody()(SecretScanningLocationDiscussionBodyable) + GetSecretScanningLocationDiscussionComment()(SecretScanningLocationDiscussionCommentable) + GetSecretScanningLocationDiscussionTitle()(SecretScanningLocationDiscussionTitleable) + GetSecretScanningLocationIssueBody()(SecretScanningLocationIssueBodyable) + GetSecretScanningLocationIssueComment()(SecretScanningLocationIssueCommentable) + GetSecretScanningLocationIssueTitle()(SecretScanningLocationIssueTitleable) + GetSecretScanningLocationPullRequestBody()(SecretScanningLocationPullRequestBodyable) + GetSecretScanningLocationPullRequestComment()(SecretScanningLocationPullRequestCommentable) + GetSecretScanningLocationPullRequestReview()(SecretScanningLocationPullRequestReviewable) + GetSecretScanningLocationPullRequestReviewComment()(SecretScanningLocationPullRequestReviewCommentable) + GetSecretScanningLocationPullRequestTitle()(SecretScanningLocationPullRequestTitleable) + GetSecretScanningLocationWikiCommit()(SecretScanningLocationWikiCommitable) + SetSecretScanningLocationCommit(value SecretScanningLocationCommitable)() + SetSecretScanningLocationDiscussionBody(value SecretScanningLocationDiscussionBodyable)() + SetSecretScanningLocationDiscussionComment(value SecretScanningLocationDiscussionCommentable)() + SetSecretScanningLocationDiscussionTitle(value SecretScanningLocationDiscussionTitleable)() + SetSecretScanningLocationIssueBody(value SecretScanningLocationIssueBodyable)() + SetSecretScanningLocationIssueComment(value SecretScanningLocationIssueCommentable)() + SetSecretScanningLocationIssueTitle(value SecretScanningLocationIssueTitleable)() + SetSecretScanningLocationPullRequestBody(value SecretScanningLocationPullRequestBodyable)() + SetSecretScanningLocationPullRequestComment(value SecretScanningLocationPullRequestCommentable)() + SetSecretScanningLocationPullRequestReview(value SecretScanningLocationPullRequestReviewable)() + SetSecretScanningLocationPullRequestReviewComment(value SecretScanningLocationPullRequestReviewCommentable)() + SetSecretScanningLocationPullRequestTitle(value SecretScanningLocationPullRequestTitleable)() + SetSecretScanningLocationWikiCommit(value SecretScanningLocationWikiCommitable)() +} +// NewSecretScanningLocation instantiates a new SecretScanningLocation and sets the default values. +func NewSecretScanningLocation()(*SecretScanningLocation) { + m := &SecretScanningLocation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocation(), 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 *SecretScanningLocation) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDetails gets the details property value. The details property +// returns a SecretScanningLocation_SecretScanningLocation_detailsable when successful +func (m *SecretScanningLocation) GetDetails()(SecretScanningLocation_SecretScanningLocation_detailsable) { + return m.details +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["details"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecretScanningLocation_SecretScanningLocation_detailsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDetails(val.(SecretScanningLocation_SecretScanningLocation_detailsable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecretScanningLocation_type) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*SecretScanningLocation_type)) + } + return nil + } + return res +} +// GetTypeEscaped gets the type property value. The location type. Because secrets may be found in different types of resources (ie. code, comments, issues, pull requests, discussions), this field identifies the type of resource where the secret was found. +// returns a *SecretScanningLocation_type when successful +func (m *SecretScanningLocation) GetTypeEscaped()(*SecretScanningLocation_type) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *SecretScanningLocation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("details", m.GetDetails()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *SecretScanningLocation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDetails sets the details property value. The details property +func (m *SecretScanningLocation) SetDetails(value SecretScanningLocation_SecretScanningLocation_detailsable)() { + m.details = value +} +// SetTypeEscaped sets the type property value. The location type. Because secrets may be found in different types of resources (ie. code, comments, issues, pull requests, discussions), this field identifies the type of resource where the secret was found. +func (m *SecretScanningLocation) SetTypeEscaped(value *SecretScanningLocation_type)() { + m.typeEscaped = value +} +type SecretScanningLocationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDetails()(SecretScanningLocation_SecretScanningLocation_detailsable) + GetTypeEscaped()(*SecretScanningLocation_type) + SetDetails(value SecretScanningLocation_SecretScanningLocation_detailsable)() + SetTypeEscaped(value *SecretScanningLocation_type)() +} diff --git a/pkg/github/models/secret_scanning_location_commit.go b/pkg/github/models/secret_scanning_location_commit.go new file mode 100644 index 00000000..0b0cc7bb --- /dev/null +++ b/pkg/github/models/secret_scanning_location_commit.go @@ -0,0 +1,313 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationCommit represents a 'commit' secret scanning location type. This location type shows that a secret was detected inside a commit to a repository. +type SecretScanningLocationCommit 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-1 hash ID of the associated blob + blob_sha *string + // The API URL to get the associated blob resource + blob_url *string + // SHA-1 hash ID of the associated commit + commit_sha *string + // The API URL to get the associated commit resource + commit_url *string + // The column at which the secret ends within the end line when the file is interpreted as 8BIT ASCII + end_column *float64 + // Line number at which the secret ends in the file + end_line *float64 + // The file path in the repository + path *string + // The column at which the secret starts within the start line when the file is interpreted as 8BIT ASCII + start_column *float64 + // Line number at which the secret starts in the file + start_line *float64 +} +// NewSecretScanningLocationCommit instantiates a new SecretScanningLocationCommit and sets the default values. +func NewSecretScanningLocationCommit()(*SecretScanningLocationCommit) { + m := &SecretScanningLocationCommit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationCommit(), 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 *SecretScanningLocationCommit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBlobSha gets the blob_sha property value. SHA-1 hash ID of the associated blob +// returns a *string when successful +func (m *SecretScanningLocationCommit) GetBlobSha()(*string) { + return m.blob_sha +} +// GetBlobUrl gets the blob_url property value. The API URL to get the associated blob resource +// returns a *string when successful +func (m *SecretScanningLocationCommit) GetBlobUrl()(*string) { + return m.blob_url +} +// GetCommitSha gets the commit_sha property value. SHA-1 hash ID of the associated commit +// returns a *string when successful +func (m *SecretScanningLocationCommit) GetCommitSha()(*string) { + return m.commit_sha +} +// GetCommitUrl gets the commit_url property value. The API URL to get the associated commit resource +// returns a *string when successful +func (m *SecretScanningLocationCommit) GetCommitUrl()(*string) { + return m.commit_url +} +// GetEndColumn gets the end_column property value. The column at which the secret ends within the end line when the file is interpreted as 8BIT ASCII +// returns a *float64 when successful +func (m *SecretScanningLocationCommit) GetEndColumn()(*float64) { + return m.end_column +} +// GetEndLine gets the end_line property value. Line number at which the secret ends in the file +// returns a *float64 when successful +func (m *SecretScanningLocationCommit) GetEndLine()(*float64) { + return m.end_line +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationCommit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["blob_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobSha(val) + } + return nil + } + res["blob_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobUrl(val) + } + return nil + } + res["commit_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitSha(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["end_column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetEndColumn(val) + } + return nil + } + res["end_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetEndLine(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["start_column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetStartColumn(val) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + return res +} +// GetPath gets the path property value. The file path in the repository +// returns a *string when successful +func (m *SecretScanningLocationCommit) GetPath()(*string) { + return m.path +} +// GetStartColumn gets the start_column property value. The column at which the secret starts within the start line when the file is interpreted as 8BIT ASCII +// returns a *float64 when successful +func (m *SecretScanningLocationCommit) GetStartColumn()(*float64) { + return m.start_column +} +// GetStartLine gets the start_line property value. Line number at which the secret starts in the file +// returns a *float64 when successful +func (m *SecretScanningLocationCommit) GetStartLine()(*float64) { + return m.start_line +} +// Serialize serializes information the current object +func (m *SecretScanningLocationCommit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("blob_sha", m.GetBlobSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blob_url", m.GetBlobUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_sha", m.GetCommitSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("end_column", m.GetEndColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("end_line", m.GetEndLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("start_column", m.GetStartColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("start_line", m.GetStartLine()) + 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 *SecretScanningLocationCommit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBlobSha sets the blob_sha property value. SHA-1 hash ID of the associated blob +func (m *SecretScanningLocationCommit) SetBlobSha(value *string)() { + m.blob_sha = value +} +// SetBlobUrl sets the blob_url property value. The API URL to get the associated blob resource +func (m *SecretScanningLocationCommit) SetBlobUrl(value *string)() { + m.blob_url = value +} +// SetCommitSha sets the commit_sha property value. SHA-1 hash ID of the associated commit +func (m *SecretScanningLocationCommit) SetCommitSha(value *string)() { + m.commit_sha = value +} +// SetCommitUrl sets the commit_url property value. The API URL to get the associated commit resource +func (m *SecretScanningLocationCommit) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetEndColumn sets the end_column property value. The column at which the secret ends within the end line when the file is interpreted as 8BIT ASCII +func (m *SecretScanningLocationCommit) SetEndColumn(value *float64)() { + m.end_column = value +} +// SetEndLine sets the end_line property value. Line number at which the secret ends in the file +func (m *SecretScanningLocationCommit) SetEndLine(value *float64)() { + m.end_line = value +} +// SetPath sets the path property value. The file path in the repository +func (m *SecretScanningLocationCommit) SetPath(value *string)() { + m.path = value +} +// SetStartColumn sets the start_column property value. The column at which the secret starts within the start line when the file is interpreted as 8BIT ASCII +func (m *SecretScanningLocationCommit) SetStartColumn(value *float64)() { + m.start_column = value +} +// SetStartLine sets the start_line property value. Line number at which the secret starts in the file +func (m *SecretScanningLocationCommit) SetStartLine(value *float64)() { + m.start_line = value +} +type SecretScanningLocationCommitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBlobSha()(*string) + GetBlobUrl()(*string) + GetCommitSha()(*string) + GetCommitUrl()(*string) + GetEndColumn()(*float64) + GetEndLine()(*float64) + GetPath()(*string) + GetStartColumn()(*float64) + GetStartLine()(*float64) + SetBlobSha(value *string)() + SetBlobUrl(value *string)() + SetCommitSha(value *string)() + SetCommitUrl(value *string)() + SetEndColumn(value *float64)() + SetEndLine(value *float64)() + SetPath(value *string)() + SetStartColumn(value *float64)() + SetStartLine(value *float64)() +} diff --git a/pkg/github/models/secret_scanning_location_discussion_body.go b/pkg/github/models/secret_scanning_location_discussion_body.go new file mode 100644 index 00000000..66ddae50 --- /dev/null +++ b/pkg/github/models/secret_scanning_location_discussion_body.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationDiscussionBody represents a 'discussion_body' secret scanning location type. This location type shows that a secret was detected in the body of a discussion. +type SecretScanningLocationDiscussionBody 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 URL to the discussion where the secret was detected. + discussion_body_url *string +} +// NewSecretScanningLocationDiscussionBody instantiates a new SecretScanningLocationDiscussionBody and sets the default values. +func NewSecretScanningLocationDiscussionBody()(*SecretScanningLocationDiscussionBody) { + m := &SecretScanningLocationDiscussionBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationDiscussionBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationDiscussionBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationDiscussionBody(), 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 *SecretScanningLocationDiscussionBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDiscussionBodyUrl gets the discussion_body_url property value. The URL to the discussion where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationDiscussionBody) GetDiscussionBodyUrl()(*string) { + return m.discussion_body_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationDiscussionBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["discussion_body_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiscussionBodyUrl(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *SecretScanningLocationDiscussionBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("discussion_body_url", m.GetDiscussionBodyUrl()) + 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 *SecretScanningLocationDiscussionBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDiscussionBodyUrl sets the discussion_body_url property value. The URL to the discussion where the secret was detected. +func (m *SecretScanningLocationDiscussionBody) SetDiscussionBodyUrl(value *string)() { + m.discussion_body_url = value +} +type SecretScanningLocationDiscussionBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDiscussionBodyUrl()(*string) + SetDiscussionBodyUrl(value *string)() +} diff --git a/pkg/github/models/secret_scanning_location_discussion_comment.go b/pkg/github/models/secret_scanning_location_discussion_comment.go new file mode 100644 index 00000000..cfe8f97c --- /dev/null +++ b/pkg/github/models/secret_scanning_location_discussion_comment.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationDiscussionComment represents a 'discussion_comment' secret scanning location type. This location type shows that a secret was detected in a comment on a discussion. +type SecretScanningLocationDiscussionComment 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 API URL to get the discussion comment where the secret was detected. + discussion_comment_url *string +} +// NewSecretScanningLocationDiscussionComment instantiates a new SecretScanningLocationDiscussionComment and sets the default values. +func NewSecretScanningLocationDiscussionComment()(*SecretScanningLocationDiscussionComment) { + m := &SecretScanningLocationDiscussionComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationDiscussionCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationDiscussionCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationDiscussionComment(), 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 *SecretScanningLocationDiscussionComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDiscussionCommentUrl gets the discussion_comment_url property value. The API URL to get the discussion comment where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationDiscussionComment) GetDiscussionCommentUrl()(*string) { + return m.discussion_comment_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationDiscussionComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["discussion_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiscussionCommentUrl(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *SecretScanningLocationDiscussionComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("discussion_comment_url", m.GetDiscussionCommentUrl()) + 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 *SecretScanningLocationDiscussionComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDiscussionCommentUrl sets the discussion_comment_url property value. The API URL to get the discussion comment where the secret was detected. +func (m *SecretScanningLocationDiscussionComment) SetDiscussionCommentUrl(value *string)() { + m.discussion_comment_url = value +} +type SecretScanningLocationDiscussionCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDiscussionCommentUrl()(*string) + SetDiscussionCommentUrl(value *string)() +} diff --git a/pkg/github/models/secret_scanning_location_discussion_title.go b/pkg/github/models/secret_scanning_location_discussion_title.go new file mode 100644 index 00000000..cd63d068 --- /dev/null +++ b/pkg/github/models/secret_scanning_location_discussion_title.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationDiscussionTitle represents a 'discussion_title' secret scanning location type. This location type shows that a secret was detected in the title of a discussion. +type SecretScanningLocationDiscussionTitle 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 URL to the discussion where the secret was detected. + discussion_title_url *string +} +// NewSecretScanningLocationDiscussionTitle instantiates a new SecretScanningLocationDiscussionTitle and sets the default values. +func NewSecretScanningLocationDiscussionTitle()(*SecretScanningLocationDiscussionTitle) { + m := &SecretScanningLocationDiscussionTitle{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationDiscussionTitleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationDiscussionTitleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationDiscussionTitle(), 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 *SecretScanningLocationDiscussionTitle) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDiscussionTitleUrl gets the discussion_title_url property value. The URL to the discussion where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationDiscussionTitle) GetDiscussionTitleUrl()(*string) { + return m.discussion_title_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationDiscussionTitle) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["discussion_title_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiscussionTitleUrl(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *SecretScanningLocationDiscussionTitle) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("discussion_title_url", m.GetDiscussionTitleUrl()) + 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 *SecretScanningLocationDiscussionTitle) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDiscussionTitleUrl sets the discussion_title_url property value. The URL to the discussion where the secret was detected. +func (m *SecretScanningLocationDiscussionTitle) SetDiscussionTitleUrl(value *string)() { + m.discussion_title_url = value +} +type SecretScanningLocationDiscussionTitleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDiscussionTitleUrl()(*string) + SetDiscussionTitleUrl(value *string)() +} diff --git a/pkg/github/models/secret_scanning_location_escaped_type.go b/pkg/github/models/secret_scanning_location_escaped_type.go new file mode 100644 index 00000000..2a2c3e14 --- /dev/null +++ b/pkg/github/models/secret_scanning_location_escaped_type.go @@ -0,0 +1,67 @@ +package models +// The location type. Because secrets may be found in different types of resources (ie. code, comments, issues, pull requests, discussions), this field identifies the type of resource where the secret was found. +type SecretScanningLocation_type int + +const ( + COMMIT_SECRETSCANNINGLOCATION_TYPE SecretScanningLocation_type = iota + WIKI_COMMIT_SECRETSCANNINGLOCATION_TYPE + ISSUE_TITLE_SECRETSCANNINGLOCATION_TYPE + ISSUE_BODY_SECRETSCANNINGLOCATION_TYPE + ISSUE_COMMENT_SECRETSCANNINGLOCATION_TYPE + DISCUSSION_TITLE_SECRETSCANNINGLOCATION_TYPE + DISCUSSION_BODY_SECRETSCANNINGLOCATION_TYPE + DISCUSSION_COMMENT_SECRETSCANNINGLOCATION_TYPE + PULL_REQUEST_TITLE_SECRETSCANNINGLOCATION_TYPE + PULL_REQUEST_BODY_SECRETSCANNINGLOCATION_TYPE + PULL_REQUEST_COMMENT_SECRETSCANNINGLOCATION_TYPE + PULL_REQUEST_REVIEW_SECRETSCANNINGLOCATION_TYPE + PULL_REQUEST_REVIEW_COMMENT_SECRETSCANNINGLOCATION_TYPE +) + +func (i SecretScanningLocation_type) String() string { + return []string{"commit", "wiki_commit", "issue_title", "issue_body", "issue_comment", "discussion_title", "discussion_body", "discussion_comment", "pull_request_title", "pull_request_body", "pull_request_comment", "pull_request_review", "pull_request_review_comment"}[i] +} +func ParseSecretScanningLocation_type(v string) (any, error) { + result := COMMIT_SECRETSCANNINGLOCATION_TYPE + switch v { + case "commit": + result = COMMIT_SECRETSCANNINGLOCATION_TYPE + case "wiki_commit": + result = WIKI_COMMIT_SECRETSCANNINGLOCATION_TYPE + case "issue_title": + result = ISSUE_TITLE_SECRETSCANNINGLOCATION_TYPE + case "issue_body": + result = ISSUE_BODY_SECRETSCANNINGLOCATION_TYPE + case "issue_comment": + result = ISSUE_COMMENT_SECRETSCANNINGLOCATION_TYPE + case "discussion_title": + result = DISCUSSION_TITLE_SECRETSCANNINGLOCATION_TYPE + case "discussion_body": + result = DISCUSSION_BODY_SECRETSCANNINGLOCATION_TYPE + case "discussion_comment": + result = DISCUSSION_COMMENT_SECRETSCANNINGLOCATION_TYPE + case "pull_request_title": + result = PULL_REQUEST_TITLE_SECRETSCANNINGLOCATION_TYPE + case "pull_request_body": + result = PULL_REQUEST_BODY_SECRETSCANNINGLOCATION_TYPE + case "pull_request_comment": + result = PULL_REQUEST_COMMENT_SECRETSCANNINGLOCATION_TYPE + case "pull_request_review": + result = PULL_REQUEST_REVIEW_SECRETSCANNINGLOCATION_TYPE + case "pull_request_review_comment": + result = PULL_REQUEST_REVIEW_COMMENT_SECRETSCANNINGLOCATION_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeSecretScanningLocation_type(values []SecretScanningLocation_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecretScanningLocation_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/secret_scanning_location_issue_body.go b/pkg/github/models/secret_scanning_location_issue_body.go new file mode 100644 index 00000000..79987521 --- /dev/null +++ b/pkg/github/models/secret_scanning_location_issue_body.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationIssueBody represents an 'issue_body' secret scanning location type. This location type shows that a secret was detected in the body of an issue. +type SecretScanningLocationIssueBody 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 API URL to get the issue where the secret was detected. + issue_body_url *string +} +// NewSecretScanningLocationIssueBody instantiates a new SecretScanningLocationIssueBody and sets the default values. +func NewSecretScanningLocationIssueBody()(*SecretScanningLocationIssueBody) { + m := &SecretScanningLocationIssueBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationIssueBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationIssueBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationIssueBody(), 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 *SecretScanningLocationIssueBody) 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 *SecretScanningLocationIssueBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["issue_body_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueBodyUrl(val) + } + return nil + } + return res +} +// GetIssueBodyUrl gets the issue_body_url property value. The API URL to get the issue where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationIssueBody) GetIssueBodyUrl()(*string) { + return m.issue_body_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationIssueBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("issue_body_url", m.GetIssueBodyUrl()) + 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 *SecretScanningLocationIssueBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIssueBodyUrl sets the issue_body_url property value. The API URL to get the issue where the secret was detected. +func (m *SecretScanningLocationIssueBody) SetIssueBodyUrl(value *string)() { + m.issue_body_url = value +} +type SecretScanningLocationIssueBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIssueBodyUrl()(*string) + SetIssueBodyUrl(value *string)() +} diff --git a/pkg/github/models/secret_scanning_location_issue_comment.go b/pkg/github/models/secret_scanning_location_issue_comment.go new file mode 100644 index 00000000..5d4c73e9 --- /dev/null +++ b/pkg/github/models/secret_scanning_location_issue_comment.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationIssueComment represents an 'issue_comment' secret scanning location type. This location type shows that a secret was detected in a comment on an issue. +type SecretScanningLocationIssueComment 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 API URL to get the issue comment where the secret was detected. + issue_comment_url *string +} +// NewSecretScanningLocationIssueComment instantiates a new SecretScanningLocationIssueComment and sets the default values. +func NewSecretScanningLocationIssueComment()(*SecretScanningLocationIssueComment) { + m := &SecretScanningLocationIssueComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationIssueCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationIssueCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationIssueComment(), 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 *SecretScanningLocationIssueComment) 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 *SecretScanningLocationIssueComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + return res +} +// GetIssueCommentUrl gets the issue_comment_url property value. The API URL to get the issue comment where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationIssueComment) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationIssueComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + 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 *SecretScanningLocationIssueComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The API URL to get the issue comment where the secret was detected. +func (m *SecretScanningLocationIssueComment) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +type SecretScanningLocationIssueCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIssueCommentUrl()(*string) + SetIssueCommentUrl(value *string)() +} diff --git a/pkg/github/models/secret_scanning_location_issue_title.go b/pkg/github/models/secret_scanning_location_issue_title.go new file mode 100644 index 00000000..a0eef7c5 --- /dev/null +++ b/pkg/github/models/secret_scanning_location_issue_title.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationIssueTitle represents an 'issue_title' secret scanning location type. This location type shows that a secret was detected in the title of an issue. +type SecretScanningLocationIssueTitle 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 API URL to get the issue where the secret was detected. + issue_title_url *string +} +// NewSecretScanningLocationIssueTitle instantiates a new SecretScanningLocationIssueTitle and sets the default values. +func NewSecretScanningLocationIssueTitle()(*SecretScanningLocationIssueTitle) { + m := &SecretScanningLocationIssueTitle{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationIssueTitleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationIssueTitleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationIssueTitle(), 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 *SecretScanningLocationIssueTitle) 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 *SecretScanningLocationIssueTitle) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["issue_title_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueTitleUrl(val) + } + return nil + } + return res +} +// GetIssueTitleUrl gets the issue_title_url property value. The API URL to get the issue where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationIssueTitle) GetIssueTitleUrl()(*string) { + return m.issue_title_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationIssueTitle) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("issue_title_url", m.GetIssueTitleUrl()) + 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 *SecretScanningLocationIssueTitle) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIssueTitleUrl sets the issue_title_url property value. The API URL to get the issue where the secret was detected. +func (m *SecretScanningLocationIssueTitle) SetIssueTitleUrl(value *string)() { + m.issue_title_url = value +} +type SecretScanningLocationIssueTitleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIssueTitleUrl()(*string) + SetIssueTitleUrl(value *string)() +} diff --git a/pkg/github/models/secret_scanning_location_pull_request_body.go b/pkg/github/models/secret_scanning_location_pull_request_body.go new file mode 100644 index 00000000..3ca6cfe6 --- /dev/null +++ b/pkg/github/models/secret_scanning_location_pull_request_body.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationPullRequestBody represents a 'pull_request_body' secret scanning location type. This location type shows that a secret was detected in the body of a pull request. +type SecretScanningLocationPullRequestBody 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 API URL to get the pull request where the secret was detected. + pull_request_body_url *string +} +// NewSecretScanningLocationPullRequestBody instantiates a new SecretScanningLocationPullRequestBody and sets the default values. +func NewSecretScanningLocationPullRequestBody()(*SecretScanningLocationPullRequestBody) { + m := &SecretScanningLocationPullRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationPullRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationPullRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationPullRequestBody(), 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 *SecretScanningLocationPullRequestBody) 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 *SecretScanningLocationPullRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pull_request_body_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestBodyUrl(val) + } + return nil + } + return res +} +// GetPullRequestBodyUrl gets the pull_request_body_url property value. The API URL to get the pull request where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationPullRequestBody) GetPullRequestBodyUrl()(*string) { + return m.pull_request_body_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationPullRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("pull_request_body_url", m.GetPullRequestBodyUrl()) + 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 *SecretScanningLocationPullRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPullRequestBodyUrl sets the pull_request_body_url property value. The API URL to get the pull request where the secret was detected. +func (m *SecretScanningLocationPullRequestBody) SetPullRequestBodyUrl(value *string)() { + m.pull_request_body_url = value +} +type SecretScanningLocationPullRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPullRequestBodyUrl()(*string) + SetPullRequestBodyUrl(value *string)() +} diff --git a/pkg/github/models/secret_scanning_location_pull_request_comment.go b/pkg/github/models/secret_scanning_location_pull_request_comment.go new file mode 100644 index 00000000..a11440a9 --- /dev/null +++ b/pkg/github/models/secret_scanning_location_pull_request_comment.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationPullRequestComment represents a 'pull_request_comment' secret scanning location type. This location type shows that a secret was detected in a comment on a pull request. +type SecretScanningLocationPullRequestComment 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 API URL to get the pull request comment where the secret was detected. + pull_request_comment_url *string +} +// NewSecretScanningLocationPullRequestComment instantiates a new SecretScanningLocationPullRequestComment and sets the default values. +func NewSecretScanningLocationPullRequestComment()(*SecretScanningLocationPullRequestComment) { + m := &SecretScanningLocationPullRequestComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationPullRequestCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationPullRequestCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationPullRequestComment(), 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 *SecretScanningLocationPullRequestComment) 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 *SecretScanningLocationPullRequestComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pull_request_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestCommentUrl(val) + } + return nil + } + return res +} +// GetPullRequestCommentUrl gets the pull_request_comment_url property value. The API URL to get the pull request comment where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationPullRequestComment) GetPullRequestCommentUrl()(*string) { + return m.pull_request_comment_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationPullRequestComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("pull_request_comment_url", m.GetPullRequestCommentUrl()) + 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 *SecretScanningLocationPullRequestComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPullRequestCommentUrl sets the pull_request_comment_url property value. The API URL to get the pull request comment where the secret was detected. +func (m *SecretScanningLocationPullRequestComment) SetPullRequestCommentUrl(value *string)() { + m.pull_request_comment_url = value +} +type SecretScanningLocationPullRequestCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPullRequestCommentUrl()(*string) + SetPullRequestCommentUrl(value *string)() +} diff --git a/pkg/github/models/secret_scanning_location_pull_request_review.go b/pkg/github/models/secret_scanning_location_pull_request_review.go new file mode 100644 index 00000000..89d63890 --- /dev/null +++ b/pkg/github/models/secret_scanning_location_pull_request_review.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationPullRequestReview represents a 'pull_request_review' secret scanning location type. This location type shows that a secret was detected in a review on a pull request. +type SecretScanningLocationPullRequestReview 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 API URL to get the pull request review where the secret was detected. + pull_request_review_url *string +} +// NewSecretScanningLocationPullRequestReview instantiates a new SecretScanningLocationPullRequestReview and sets the default values. +func NewSecretScanningLocationPullRequestReview()(*SecretScanningLocationPullRequestReview) { + m := &SecretScanningLocationPullRequestReview{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationPullRequestReviewFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationPullRequestReviewFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationPullRequestReview(), 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 *SecretScanningLocationPullRequestReview) 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 *SecretScanningLocationPullRequestReview) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pull_request_review_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestReviewUrl(val) + } + return nil + } + return res +} +// GetPullRequestReviewUrl gets the pull_request_review_url property value. The API URL to get the pull request review where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationPullRequestReview) GetPullRequestReviewUrl()(*string) { + return m.pull_request_review_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationPullRequestReview) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("pull_request_review_url", m.GetPullRequestReviewUrl()) + 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 *SecretScanningLocationPullRequestReview) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPullRequestReviewUrl sets the pull_request_review_url property value. The API URL to get the pull request review where the secret was detected. +func (m *SecretScanningLocationPullRequestReview) SetPullRequestReviewUrl(value *string)() { + m.pull_request_review_url = value +} +type SecretScanningLocationPullRequestReviewable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPullRequestReviewUrl()(*string) + SetPullRequestReviewUrl(value *string)() +} diff --git a/pkg/github/models/secret_scanning_location_pull_request_review_comment.go b/pkg/github/models/secret_scanning_location_pull_request_review_comment.go new file mode 100644 index 00000000..8a11d0d9 --- /dev/null +++ b/pkg/github/models/secret_scanning_location_pull_request_review_comment.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationPullRequestReviewComment represents a 'pull_request_review_comment' secret scanning location type. This location type shows that a secret was detected in a review comment on a pull request. +type SecretScanningLocationPullRequestReviewComment 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 API URL to get the pull request review comment where the secret was detected. + pull_request_review_comment_url *string +} +// NewSecretScanningLocationPullRequestReviewComment instantiates a new SecretScanningLocationPullRequestReviewComment and sets the default values. +func NewSecretScanningLocationPullRequestReviewComment()(*SecretScanningLocationPullRequestReviewComment) { + m := &SecretScanningLocationPullRequestReviewComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationPullRequestReviewCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationPullRequestReviewCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationPullRequestReviewComment(), 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 *SecretScanningLocationPullRequestReviewComment) 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 *SecretScanningLocationPullRequestReviewComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pull_request_review_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestReviewCommentUrl(val) + } + return nil + } + return res +} +// GetPullRequestReviewCommentUrl gets the pull_request_review_comment_url property value. The API URL to get the pull request review comment where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationPullRequestReviewComment) GetPullRequestReviewCommentUrl()(*string) { + return m.pull_request_review_comment_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationPullRequestReviewComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("pull_request_review_comment_url", m.GetPullRequestReviewCommentUrl()) + 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 *SecretScanningLocationPullRequestReviewComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPullRequestReviewCommentUrl sets the pull_request_review_comment_url property value. The API URL to get the pull request review comment where the secret was detected. +func (m *SecretScanningLocationPullRequestReviewComment) SetPullRequestReviewCommentUrl(value *string)() { + m.pull_request_review_comment_url = value +} +type SecretScanningLocationPullRequestReviewCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPullRequestReviewCommentUrl()(*string) + SetPullRequestReviewCommentUrl(value *string)() +} diff --git a/pkg/github/models/secret_scanning_location_pull_request_title.go b/pkg/github/models/secret_scanning_location_pull_request_title.go new file mode 100644 index 00000000..e5c8d82c --- /dev/null +++ b/pkg/github/models/secret_scanning_location_pull_request_title.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationPullRequestTitle represents a 'pull_request_title' secret scanning location type. This location type shows that a secret was detected in the title of a pull request. +type SecretScanningLocationPullRequestTitle 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 API URL to get the pull request where the secret was detected. + pull_request_title_url *string +} +// NewSecretScanningLocationPullRequestTitle instantiates a new SecretScanningLocationPullRequestTitle and sets the default values. +func NewSecretScanningLocationPullRequestTitle()(*SecretScanningLocationPullRequestTitle) { + m := &SecretScanningLocationPullRequestTitle{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationPullRequestTitleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationPullRequestTitleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationPullRequestTitle(), 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 *SecretScanningLocationPullRequestTitle) 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 *SecretScanningLocationPullRequestTitle) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pull_request_title_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestTitleUrl(val) + } + return nil + } + return res +} +// GetPullRequestTitleUrl gets the pull_request_title_url property value. The API URL to get the pull request where the secret was detected. +// returns a *string when successful +func (m *SecretScanningLocationPullRequestTitle) GetPullRequestTitleUrl()(*string) { + return m.pull_request_title_url +} +// Serialize serializes information the current object +func (m *SecretScanningLocationPullRequestTitle) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("pull_request_title_url", m.GetPullRequestTitleUrl()) + 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 *SecretScanningLocationPullRequestTitle) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPullRequestTitleUrl sets the pull_request_title_url property value. The API URL to get the pull request where the secret was detected. +func (m *SecretScanningLocationPullRequestTitle) SetPullRequestTitleUrl(value *string)() { + m.pull_request_title_url = value +} +type SecretScanningLocationPullRequestTitleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPullRequestTitleUrl()(*string) + SetPullRequestTitleUrl(value *string)() +} diff --git a/pkg/github/models/secret_scanning_location_wiki_commit.go b/pkg/github/models/secret_scanning_location_wiki_commit.go new file mode 100644 index 00000000..14032fbf --- /dev/null +++ b/pkg/github/models/secret_scanning_location_wiki_commit.go @@ -0,0 +1,313 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecretScanningLocationWikiCommit represents a 'wiki_commit' secret scanning location type. This location type shows that a secret was detected inside a commit to a repository wiki. +type SecretScanningLocationWikiCommit 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-1 hash ID of the associated blob + blob_sha *string + // SHA-1 hash ID of the associated commit + commit_sha *string + // The GitHub URL to get the associated wiki commit + commit_url *string + // The column at which the secret ends within the end line when the file is interpreted as 8-bit ASCII. + end_column *float64 + // Line number at which the secret ends in the file + end_line *float64 + // The GitHub URL to get the associated wiki page + page_url *string + // The file path of the wiki page + path *string + // The column at which the secret starts within the start line when the file is interpreted as 8-bit ASCII. + start_column *float64 + // Line number at which the secret starts in the file + start_line *float64 +} +// NewSecretScanningLocationWikiCommit instantiates a new SecretScanningLocationWikiCommit and sets the default values. +func NewSecretScanningLocationWikiCommit()(*SecretScanningLocationWikiCommit) { + m := &SecretScanningLocationWikiCommit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecretScanningLocationWikiCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecretScanningLocationWikiCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecretScanningLocationWikiCommit(), 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 *SecretScanningLocationWikiCommit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBlobSha gets the blob_sha property value. SHA-1 hash ID of the associated blob +// returns a *string when successful +func (m *SecretScanningLocationWikiCommit) GetBlobSha()(*string) { + return m.blob_sha +} +// GetCommitSha gets the commit_sha property value. SHA-1 hash ID of the associated commit +// returns a *string when successful +func (m *SecretScanningLocationWikiCommit) GetCommitSha()(*string) { + return m.commit_sha +} +// GetCommitUrl gets the commit_url property value. The GitHub URL to get the associated wiki commit +// returns a *string when successful +func (m *SecretScanningLocationWikiCommit) GetCommitUrl()(*string) { + return m.commit_url +} +// GetEndColumn gets the end_column property value. The column at which the secret ends within the end line when the file is interpreted as 8-bit ASCII. +// returns a *float64 when successful +func (m *SecretScanningLocationWikiCommit) GetEndColumn()(*float64) { + return m.end_column +} +// GetEndLine gets the end_line property value. Line number at which the secret ends in the file +// returns a *float64 when successful +func (m *SecretScanningLocationWikiCommit) GetEndLine()(*float64) { + return m.end_line +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecretScanningLocationWikiCommit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["blob_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobSha(val) + } + return nil + } + res["commit_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitSha(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["end_column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetEndColumn(val) + } + return nil + } + res["end_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetEndLine(val) + } + return nil + } + res["page_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPageUrl(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["start_column"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetStartColumn(val) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + return res +} +// GetPageUrl gets the page_url property value. The GitHub URL to get the associated wiki page +// returns a *string when successful +func (m *SecretScanningLocationWikiCommit) GetPageUrl()(*string) { + return m.page_url +} +// GetPath gets the path property value. The file path of the wiki page +// returns a *string when successful +func (m *SecretScanningLocationWikiCommit) GetPath()(*string) { + return m.path +} +// GetStartColumn gets the start_column property value. The column at which the secret starts within the start line when the file is interpreted as 8-bit ASCII. +// returns a *float64 when successful +func (m *SecretScanningLocationWikiCommit) GetStartColumn()(*float64) { + return m.start_column +} +// GetStartLine gets the start_line property value. Line number at which the secret starts in the file +// returns a *float64 when successful +func (m *SecretScanningLocationWikiCommit) GetStartLine()(*float64) { + return m.start_line +} +// Serialize serializes information the current object +func (m *SecretScanningLocationWikiCommit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("blob_sha", m.GetBlobSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_sha", m.GetCommitSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("end_column", m.GetEndColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("end_line", m.GetEndLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("page_url", m.GetPageUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("start_column", m.GetStartColumn()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("start_line", m.GetStartLine()) + 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 *SecretScanningLocationWikiCommit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBlobSha sets the blob_sha property value. SHA-1 hash ID of the associated blob +func (m *SecretScanningLocationWikiCommit) SetBlobSha(value *string)() { + m.blob_sha = value +} +// SetCommitSha sets the commit_sha property value. SHA-1 hash ID of the associated commit +func (m *SecretScanningLocationWikiCommit) SetCommitSha(value *string)() { + m.commit_sha = value +} +// SetCommitUrl sets the commit_url property value. The GitHub URL to get the associated wiki commit +func (m *SecretScanningLocationWikiCommit) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetEndColumn sets the end_column property value. The column at which the secret ends within the end line when the file is interpreted as 8-bit ASCII. +func (m *SecretScanningLocationWikiCommit) SetEndColumn(value *float64)() { + m.end_column = value +} +// SetEndLine sets the end_line property value. Line number at which the secret ends in the file +func (m *SecretScanningLocationWikiCommit) SetEndLine(value *float64)() { + m.end_line = value +} +// SetPageUrl sets the page_url property value. The GitHub URL to get the associated wiki page +func (m *SecretScanningLocationWikiCommit) SetPageUrl(value *string)() { + m.page_url = value +} +// SetPath sets the path property value. The file path of the wiki page +func (m *SecretScanningLocationWikiCommit) SetPath(value *string)() { + m.path = value +} +// SetStartColumn sets the start_column property value. The column at which the secret starts within the start line when the file is interpreted as 8-bit ASCII. +func (m *SecretScanningLocationWikiCommit) SetStartColumn(value *float64)() { + m.start_column = value +} +// SetStartLine sets the start_line property value. Line number at which the secret starts in the file +func (m *SecretScanningLocationWikiCommit) SetStartLine(value *float64)() { + m.start_line = value +} +type SecretScanningLocationWikiCommitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBlobSha()(*string) + GetCommitSha()(*string) + GetCommitUrl()(*string) + GetEndColumn()(*float64) + GetEndLine()(*float64) + GetPageUrl()(*string) + GetPath()(*string) + GetStartColumn()(*float64) + GetStartLine()(*float64) + SetBlobSha(value *string)() + SetCommitSha(value *string)() + SetCommitUrl(value *string)() + SetEndColumn(value *float64)() + SetEndLine(value *float64)() + SetPageUrl(value *string)() + SetPath(value *string)() + SetStartColumn(value *float64)() + SetStartLine(value *float64)() +} diff --git a/pkg/github/models/security_advisory_credit_types.go b/pkg/github/models/security_advisory_credit_types.go new file mode 100644 index 00000000..4d65384c --- /dev/null +++ b/pkg/github/models/security_advisory_credit_types.go @@ -0,0 +1,58 @@ +package models +// The type of credit the user is receiving. +type SecurityAdvisoryCreditTypes int + +const ( + ANALYST_SECURITYADVISORYCREDITTYPES SecurityAdvisoryCreditTypes = iota + FINDER_SECURITYADVISORYCREDITTYPES + REPORTER_SECURITYADVISORYCREDITTYPES + COORDINATOR_SECURITYADVISORYCREDITTYPES + REMEDIATION_DEVELOPER_SECURITYADVISORYCREDITTYPES + REMEDIATION_REVIEWER_SECURITYADVISORYCREDITTYPES + REMEDIATION_VERIFIER_SECURITYADVISORYCREDITTYPES + TOOL_SECURITYADVISORYCREDITTYPES + SPONSOR_SECURITYADVISORYCREDITTYPES + OTHER_SECURITYADVISORYCREDITTYPES +) + +func (i SecurityAdvisoryCreditTypes) String() string { + return []string{"analyst", "finder", "reporter", "coordinator", "remediation_developer", "remediation_reviewer", "remediation_verifier", "tool", "sponsor", "other"}[i] +} +func ParseSecurityAdvisoryCreditTypes(v string) (any, error) { + result := ANALYST_SECURITYADVISORYCREDITTYPES + switch v { + case "analyst": + result = ANALYST_SECURITYADVISORYCREDITTYPES + case "finder": + result = FINDER_SECURITYADVISORYCREDITTYPES + case "reporter": + result = REPORTER_SECURITYADVISORYCREDITTYPES + case "coordinator": + result = COORDINATOR_SECURITYADVISORYCREDITTYPES + case "remediation_developer": + result = REMEDIATION_DEVELOPER_SECURITYADVISORYCREDITTYPES + case "remediation_reviewer": + result = REMEDIATION_REVIEWER_SECURITYADVISORYCREDITTYPES + case "remediation_verifier": + result = REMEDIATION_VERIFIER_SECURITYADVISORYCREDITTYPES + case "tool": + result = TOOL_SECURITYADVISORYCREDITTYPES + case "sponsor": + result = SPONSOR_SECURITYADVISORYCREDITTYPES + case "other": + result = OTHER_SECURITYADVISORYCREDITTYPES + default: + return nil, nil + } + return &result, nil +} +func SerializeSecurityAdvisoryCreditTypes(values []SecurityAdvisoryCreditTypes) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecurityAdvisoryCreditTypes) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/security_advisory_ecosystems.go b/pkg/github/models/security_advisory_ecosystems.go new file mode 100644 index 00000000..7794d66c --- /dev/null +++ b/pkg/github/models/security_advisory_ecosystems.go @@ -0,0 +1,67 @@ +package models +// The package's language or package management ecosystem. +type SecurityAdvisoryEcosystems int + +const ( + RUBYGEMS_SECURITYADVISORYECOSYSTEMS SecurityAdvisoryEcosystems = iota + NPM_SECURITYADVISORYECOSYSTEMS + PIP_SECURITYADVISORYECOSYSTEMS + MAVEN_SECURITYADVISORYECOSYSTEMS + NUGET_SECURITYADVISORYECOSYSTEMS + COMPOSER_SECURITYADVISORYECOSYSTEMS + GO_SECURITYADVISORYECOSYSTEMS + RUST_SECURITYADVISORYECOSYSTEMS + ERLANG_SECURITYADVISORYECOSYSTEMS + ACTIONS_SECURITYADVISORYECOSYSTEMS + PUB_SECURITYADVISORYECOSYSTEMS + OTHER_SECURITYADVISORYECOSYSTEMS + SWIFT_SECURITYADVISORYECOSYSTEMS +) + +func (i SecurityAdvisoryEcosystems) String() string { + return []string{"rubygems", "npm", "pip", "maven", "nuget", "composer", "go", "rust", "erlang", "actions", "pub", "other", "swift"}[i] +} +func ParseSecurityAdvisoryEcosystems(v string) (any, error) { + result := RUBYGEMS_SECURITYADVISORYECOSYSTEMS + switch v { + case "rubygems": + result = RUBYGEMS_SECURITYADVISORYECOSYSTEMS + case "npm": + result = NPM_SECURITYADVISORYECOSYSTEMS + case "pip": + result = PIP_SECURITYADVISORYECOSYSTEMS + case "maven": + result = MAVEN_SECURITYADVISORYECOSYSTEMS + case "nuget": + result = NUGET_SECURITYADVISORYECOSYSTEMS + case "composer": + result = COMPOSER_SECURITYADVISORYECOSYSTEMS + case "go": + result = GO_SECURITYADVISORYECOSYSTEMS + case "rust": + result = RUST_SECURITYADVISORYECOSYSTEMS + case "erlang": + result = ERLANG_SECURITYADVISORYECOSYSTEMS + case "actions": + result = ACTIONS_SECURITYADVISORYECOSYSTEMS + case "pub": + result = PUB_SECURITYADVISORYECOSYSTEMS + case "other": + result = OTHER_SECURITYADVISORYECOSYSTEMS + case "swift": + result = SWIFT_SECURITYADVISORYECOSYSTEMS + default: + return nil, nil + } + return &result, nil +} +func SerializeSecurityAdvisoryEcosystems(values []SecurityAdvisoryEcosystems) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecurityAdvisoryEcosystems) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/security_and_analysis.go b/pkg/github/models/security_and_analysis.go new file mode 100644 index 00000000..d6bb1ec1 --- /dev/null +++ b/pkg/github/models/security_and_analysis.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SecurityAndAnalysis 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 advanced_security property + advanced_security SecurityAndAnalysis_advanced_securityable + // Enable or disable Dependabot security updates for the repository. + dependabot_security_updates SecurityAndAnalysis_dependabot_security_updatesable + // The secret_scanning property + secret_scanning SecurityAndAnalysis_secret_scanningable + // The secret_scanning_push_protection property + secret_scanning_push_protection SecurityAndAnalysis_secret_scanning_push_protectionable +} +// NewSecurityAndAnalysis instantiates a new SecurityAndAnalysis and sets the default values. +func NewSecurityAndAnalysis()(*SecurityAndAnalysis) { + m := &SecurityAndAnalysis{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecurityAndAnalysisFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecurityAndAnalysisFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecurityAndAnalysis(), 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 *SecurityAndAnalysis) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurity gets the advanced_security property value. The advanced_security property +// returns a SecurityAndAnalysis_advanced_securityable when successful +func (m *SecurityAndAnalysis) GetAdvancedSecurity()(SecurityAndAnalysis_advanced_securityable) { + return m.advanced_security +} +// GetDependabotSecurityUpdates gets the dependabot_security_updates property value. Enable or disable Dependabot security updates for the repository. +// returns a SecurityAndAnalysis_dependabot_security_updatesable when successful +func (m *SecurityAndAnalysis) GetDependabotSecurityUpdates()(SecurityAndAnalysis_dependabot_security_updatesable) { + return m.dependabot_security_updates +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SecurityAndAnalysis) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advanced_security"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecurityAndAnalysis_advanced_securityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurity(val.(SecurityAndAnalysis_advanced_securityable)) + } + return nil + } + res["dependabot_security_updates"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecurityAndAnalysis_dependabot_security_updatesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDependabotSecurityUpdates(val.(SecurityAndAnalysis_dependabot_security_updatesable)) + } + return nil + } + res["secret_scanning"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecurityAndAnalysis_secret_scanningFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanning(val.(SecurityAndAnalysis_secret_scanningable)) + } + return nil + } + res["secret_scanning_push_protection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSecurityAndAnalysis_secret_scanning_push_protectionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtection(val.(SecurityAndAnalysis_secret_scanning_push_protectionable)) + } + return nil + } + return res +} +// GetSecretScanning gets the secret_scanning property value. The secret_scanning property +// returns a SecurityAndAnalysis_secret_scanningable when successful +func (m *SecurityAndAnalysis) GetSecretScanning()(SecurityAndAnalysis_secret_scanningable) { + return m.secret_scanning +} +// GetSecretScanningPushProtection gets the secret_scanning_push_protection property value. The secret_scanning_push_protection property +// returns a SecurityAndAnalysis_secret_scanning_push_protectionable when successful +func (m *SecurityAndAnalysis) GetSecretScanningPushProtection()(SecurityAndAnalysis_secret_scanning_push_protectionable) { + return m.secret_scanning_push_protection +} +// Serialize serializes information the current object +func (m *SecurityAndAnalysis) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("advanced_security", m.GetAdvancedSecurity()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dependabot_security_updates", m.GetDependabotSecurityUpdates()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("secret_scanning", m.GetSecretScanning()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("secret_scanning_push_protection", m.GetSecretScanningPushProtection()) + 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 *SecurityAndAnalysis) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurity sets the advanced_security property value. The advanced_security property +func (m *SecurityAndAnalysis) SetAdvancedSecurity(value SecurityAndAnalysis_advanced_securityable)() { + m.advanced_security = value +} +// SetDependabotSecurityUpdates sets the dependabot_security_updates property value. Enable or disable Dependabot security updates for the repository. +func (m *SecurityAndAnalysis) SetDependabotSecurityUpdates(value SecurityAndAnalysis_dependabot_security_updatesable)() { + m.dependabot_security_updates = value +} +// SetSecretScanning sets the secret_scanning property value. The secret_scanning property +func (m *SecurityAndAnalysis) SetSecretScanning(value SecurityAndAnalysis_secret_scanningable)() { + m.secret_scanning = value +} +// SetSecretScanningPushProtection sets the secret_scanning_push_protection property value. The secret_scanning_push_protection property +func (m *SecurityAndAnalysis) SetSecretScanningPushProtection(value SecurityAndAnalysis_secret_scanning_push_protectionable)() { + m.secret_scanning_push_protection = value +} +type SecurityAndAnalysisable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurity()(SecurityAndAnalysis_advanced_securityable) + GetDependabotSecurityUpdates()(SecurityAndAnalysis_dependabot_security_updatesable) + GetSecretScanning()(SecurityAndAnalysis_secret_scanningable) + GetSecretScanningPushProtection()(SecurityAndAnalysis_secret_scanning_push_protectionable) + SetAdvancedSecurity(value SecurityAndAnalysis_advanced_securityable)() + SetDependabotSecurityUpdates(value SecurityAndAnalysis_dependabot_security_updatesable)() + SetSecretScanning(value SecurityAndAnalysis_secret_scanningable)() + SetSecretScanningPushProtection(value SecurityAndAnalysis_secret_scanning_push_protectionable)() +} diff --git a/pkg/github/models/security_and_analysis_escaped_advanced_escaped_security.go b/pkg/github/models/security_and_analysis_escaped_advanced_escaped_security.go new file mode 100644 index 00000000..11e63c9f --- /dev/null +++ b/pkg/github/models/security_and_analysis_escaped_advanced_escaped_security.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SecurityAndAnalysis_advanced_security 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 status property + status *SecurityAndAnalysis_advanced_security_status +} +// NewSecurityAndAnalysis_advanced_security instantiates a new SecurityAndAnalysis_advanced_security and sets the default values. +func NewSecurityAndAnalysis_advanced_security()(*SecurityAndAnalysis_advanced_security) { + m := &SecurityAndAnalysis_advanced_security{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecurityAndAnalysis_advanced_securityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecurityAndAnalysis_advanced_securityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecurityAndAnalysis_advanced_security(), 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 *SecurityAndAnalysis_advanced_security) 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 *SecurityAndAnalysis_advanced_security) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAndAnalysis_advanced_security_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*SecurityAndAnalysis_advanced_security_status)) + } + return nil + } + return res +} +// GetStatus gets the status property value. The status property +// returns a *SecurityAndAnalysis_advanced_security_status when successful +func (m *SecurityAndAnalysis_advanced_security) GetStatus()(*SecurityAndAnalysis_advanced_security_status) { + return m.status +} +// Serialize serializes information the current object +func (m *SecurityAndAnalysis_advanced_security) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + 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 *SecurityAndAnalysis_advanced_security) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The status property +func (m *SecurityAndAnalysis_advanced_security) SetStatus(value *SecurityAndAnalysis_advanced_security_status)() { + m.status = value +} +type SecurityAndAnalysis_advanced_securityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*SecurityAndAnalysis_advanced_security_status) + SetStatus(value *SecurityAndAnalysis_advanced_security_status)() +} diff --git a/pkg/github/models/security_and_analysis_escaped_advanced_escaped_security_escaped_status.go b/pkg/github/models/security_and_analysis_escaped_advanced_escaped_security_escaped_status.go new file mode 100644 index 00000000..cc36996c --- /dev/null +++ b/pkg/github/models/security_and_analysis_escaped_advanced_escaped_security_escaped_status.go @@ -0,0 +1,33 @@ +package models +type SecurityAndAnalysis_advanced_security_status int + +const ( + ENABLED_SECURITYANDANALYSIS_ADVANCED_SECURITY_STATUS SecurityAndAnalysis_advanced_security_status = iota + DISABLED_SECURITYANDANALYSIS_ADVANCED_SECURITY_STATUS +) + +func (i SecurityAndAnalysis_advanced_security_status) String() string { + return []string{"enabled", "disabled"}[i] +} +func ParseSecurityAndAnalysis_advanced_security_status(v string) (any, error) { + result := ENABLED_SECURITYANDANALYSIS_ADVANCED_SECURITY_STATUS + switch v { + case "enabled": + result = ENABLED_SECURITYANDANALYSIS_ADVANCED_SECURITY_STATUS + case "disabled": + result = DISABLED_SECURITYANDANALYSIS_ADVANCED_SECURITY_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeSecurityAndAnalysis_advanced_security_status(values []SecurityAndAnalysis_advanced_security_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecurityAndAnalysis_advanced_security_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/security_and_analysis_escaped_dependabot_escaped_security_escaped_updates.go b/pkg/github/models/security_and_analysis_escaped_dependabot_escaped_security_escaped_updates.go new file mode 100644 index 00000000..d8c84482 --- /dev/null +++ b/pkg/github/models/security_and_analysis_escaped_dependabot_escaped_security_escaped_updates.go @@ -0,0 +1,82 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SecurityAndAnalysis_dependabot_security_updates enable or disable Dependabot security updates for the repository. +type SecurityAndAnalysis_dependabot_security_updates 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 enablement status of Dependabot security updates for the repository. + status *SecurityAndAnalysis_dependabot_security_updates_status +} +// NewSecurityAndAnalysis_dependabot_security_updates instantiates a new SecurityAndAnalysis_dependabot_security_updates and sets the default values. +func NewSecurityAndAnalysis_dependabot_security_updates()(*SecurityAndAnalysis_dependabot_security_updates) { + m := &SecurityAndAnalysis_dependabot_security_updates{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecurityAndAnalysis_dependabot_security_updatesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecurityAndAnalysis_dependabot_security_updatesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecurityAndAnalysis_dependabot_security_updates(), 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 *SecurityAndAnalysis_dependabot_security_updates) 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 *SecurityAndAnalysis_dependabot_security_updates) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAndAnalysis_dependabot_security_updates_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*SecurityAndAnalysis_dependabot_security_updates_status)) + } + return nil + } + return res +} +// GetStatus gets the status property value. The enablement status of Dependabot security updates for the repository. +// returns a *SecurityAndAnalysis_dependabot_security_updates_status when successful +func (m *SecurityAndAnalysis_dependabot_security_updates) GetStatus()(*SecurityAndAnalysis_dependabot_security_updates_status) { + return m.status +} +// Serialize serializes information the current object +func (m *SecurityAndAnalysis_dependabot_security_updates) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + 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 *SecurityAndAnalysis_dependabot_security_updates) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The enablement status of Dependabot security updates for the repository. +func (m *SecurityAndAnalysis_dependabot_security_updates) SetStatus(value *SecurityAndAnalysis_dependabot_security_updates_status)() { + m.status = value +} +type SecurityAndAnalysis_dependabot_security_updatesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*SecurityAndAnalysis_dependabot_security_updates_status) + SetStatus(value *SecurityAndAnalysis_dependabot_security_updates_status)() +} diff --git a/pkg/github/models/security_and_analysis_escaped_dependabot_escaped_security_escaped_updates_escaped_status.go b/pkg/github/models/security_and_analysis_escaped_dependabot_escaped_security_escaped_updates_escaped_status.go new file mode 100644 index 00000000..2e902915 --- /dev/null +++ b/pkg/github/models/security_and_analysis_escaped_dependabot_escaped_security_escaped_updates_escaped_status.go @@ -0,0 +1,34 @@ +package models +// The enablement status of Dependabot security updates for the repository. +type SecurityAndAnalysis_dependabot_security_updates_status int + +const ( + ENABLED_SECURITYANDANALYSIS_DEPENDABOT_SECURITY_UPDATES_STATUS SecurityAndAnalysis_dependabot_security_updates_status = iota + DISABLED_SECURITYANDANALYSIS_DEPENDABOT_SECURITY_UPDATES_STATUS +) + +func (i SecurityAndAnalysis_dependabot_security_updates_status) String() string { + return []string{"enabled", "disabled"}[i] +} +func ParseSecurityAndAnalysis_dependabot_security_updates_status(v string) (any, error) { + result := ENABLED_SECURITYANDANALYSIS_DEPENDABOT_SECURITY_UPDATES_STATUS + switch v { + case "enabled": + result = ENABLED_SECURITYANDANALYSIS_DEPENDABOT_SECURITY_UPDATES_STATUS + case "disabled": + result = DISABLED_SECURITYANDANALYSIS_DEPENDABOT_SECURITY_UPDATES_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeSecurityAndAnalysis_dependabot_security_updates_status(values []SecurityAndAnalysis_dependabot_security_updates_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecurityAndAnalysis_dependabot_security_updates_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning.go b/pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning.go new file mode 100644 index 00000000..27a4fa5b --- /dev/null +++ b/pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SecurityAndAnalysis_secret_scanning 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 status property + status *SecurityAndAnalysis_secret_scanning_status +} +// NewSecurityAndAnalysis_secret_scanning instantiates a new SecurityAndAnalysis_secret_scanning and sets the default values. +func NewSecurityAndAnalysis_secret_scanning()(*SecurityAndAnalysis_secret_scanning) { + m := &SecurityAndAnalysis_secret_scanning{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecurityAndAnalysis_secret_scanningFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecurityAndAnalysis_secret_scanningFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecurityAndAnalysis_secret_scanning(), 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 *SecurityAndAnalysis_secret_scanning) 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 *SecurityAndAnalysis_secret_scanning) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAndAnalysis_secret_scanning_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*SecurityAndAnalysis_secret_scanning_status)) + } + return nil + } + return res +} +// GetStatus gets the status property value. The status property +// returns a *SecurityAndAnalysis_secret_scanning_status when successful +func (m *SecurityAndAnalysis_secret_scanning) GetStatus()(*SecurityAndAnalysis_secret_scanning_status) { + return m.status +} +// Serialize serializes information the current object +func (m *SecurityAndAnalysis_secret_scanning) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + 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 *SecurityAndAnalysis_secret_scanning) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The status property +func (m *SecurityAndAnalysis_secret_scanning) SetStatus(value *SecurityAndAnalysis_secret_scanning_status)() { + m.status = value +} +type SecurityAndAnalysis_secret_scanningable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*SecurityAndAnalysis_secret_scanning_status) + SetStatus(value *SecurityAndAnalysis_secret_scanning_status)() +} diff --git a/pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning_escaped_push_escaped_protection.go b/pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning_escaped_push_escaped_protection.go new file mode 100644 index 00000000..97a7db07 --- /dev/null +++ b/pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning_escaped_push_escaped_protection.go @@ -0,0 +1,81 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SecurityAndAnalysis_secret_scanning_push_protection 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 status property + status *SecurityAndAnalysis_secret_scanning_push_protection_status +} +// NewSecurityAndAnalysis_secret_scanning_push_protection instantiates a new SecurityAndAnalysis_secret_scanning_push_protection and sets the default values. +func NewSecurityAndAnalysis_secret_scanning_push_protection()(*SecurityAndAnalysis_secret_scanning_push_protection) { + m := &SecurityAndAnalysis_secret_scanning_push_protection{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSecurityAndAnalysis_secret_scanning_push_protectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSecurityAndAnalysis_secret_scanning_push_protectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSecurityAndAnalysis_secret_scanning_push_protection(), 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 *SecurityAndAnalysis_secret_scanning_push_protection) 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 *SecurityAndAnalysis_secret_scanning_push_protection) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAndAnalysis_secret_scanning_push_protection_status) + if err != nil { + return err + } + if val != nil { + m.SetStatus(val.(*SecurityAndAnalysis_secret_scanning_push_protection_status)) + } + return nil + } + return res +} +// GetStatus gets the status property value. The status property +// returns a *SecurityAndAnalysis_secret_scanning_push_protection_status when successful +func (m *SecurityAndAnalysis_secret_scanning_push_protection) GetStatus()(*SecurityAndAnalysis_secret_scanning_push_protection_status) { + return m.status +} +// Serialize serializes information the current object +func (m *SecurityAndAnalysis_secret_scanning_push_protection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + 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 *SecurityAndAnalysis_secret_scanning_push_protection) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. The status property +func (m *SecurityAndAnalysis_secret_scanning_push_protection) SetStatus(value *SecurityAndAnalysis_secret_scanning_push_protection_status)() { + m.status = value +} +type SecurityAndAnalysis_secret_scanning_push_protectionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*SecurityAndAnalysis_secret_scanning_push_protection_status) + SetStatus(value *SecurityAndAnalysis_secret_scanning_push_protection_status)() +} diff --git a/pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning_escaped_push_escaped_protection_escaped_status.go b/pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning_escaped_push_escaped_protection_escaped_status.go new file mode 100644 index 00000000..2b5e12d2 --- /dev/null +++ b/pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning_escaped_push_escaped_protection_escaped_status.go @@ -0,0 +1,33 @@ +package models +type SecurityAndAnalysis_secret_scanning_push_protection_status int + +const ( + ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_PUSH_PROTECTION_STATUS SecurityAndAnalysis_secret_scanning_push_protection_status = iota + DISABLED_SECURITYANDANALYSIS_SECRET_SCANNING_PUSH_PROTECTION_STATUS +) + +func (i SecurityAndAnalysis_secret_scanning_push_protection_status) String() string { + return []string{"enabled", "disabled"}[i] +} +func ParseSecurityAndAnalysis_secret_scanning_push_protection_status(v string) (any, error) { + result := ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_PUSH_PROTECTION_STATUS + switch v { + case "enabled": + result = ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_PUSH_PROTECTION_STATUS + case "disabled": + result = DISABLED_SECURITYANDANALYSIS_SECRET_SCANNING_PUSH_PROTECTION_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeSecurityAndAnalysis_secret_scanning_push_protection_status(values []SecurityAndAnalysis_secret_scanning_push_protection_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecurityAndAnalysis_secret_scanning_push_protection_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning_escaped_status.go b/pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning_escaped_status.go new file mode 100644 index 00000000..00909bcf --- /dev/null +++ b/pkg/github/models/security_and_analysis_escaped_secret_escaped_scanning_escaped_status.go @@ -0,0 +1,33 @@ +package models +type SecurityAndAnalysis_secret_scanning_status int + +const ( + ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_STATUS SecurityAndAnalysis_secret_scanning_status = iota + DISABLED_SECURITYANDANALYSIS_SECRET_SCANNING_STATUS +) + +func (i SecurityAndAnalysis_secret_scanning_status) String() string { + return []string{"enabled", "disabled"}[i] +} +func ParseSecurityAndAnalysis_secret_scanning_status(v string) (any, error) { + result := ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_STATUS + switch v { + case "enabled": + result = ENABLED_SECURITYANDANALYSIS_SECRET_SCANNING_STATUS + case "disabled": + result = DISABLED_SECURITYANDANALYSIS_SECRET_SCANNING_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeSecurityAndAnalysis_secret_scanning_status(values []SecurityAndAnalysis_secret_scanning_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i SecurityAndAnalysis_secret_scanning_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/selected_actions.go b/pkg/github/models/selected_actions.go new file mode 100644 index 00000000..ef82be79 --- /dev/null +++ b/pkg/github/models/selected_actions.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SelectedActions 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 GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. + github_owned_allowed *bool + // Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`. + patterns_allowed []string +} +// NewSelectedActions instantiates a new SelectedActions and sets the default values. +func NewSelectedActions()(*SelectedActions) { + m := &SelectedActions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSelectedActionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSelectedActionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSelectedActions(), 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 *SelectedActions) 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 *SelectedActions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["github_owned_allowed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetGithubOwnedAllowed(val) + } + return nil + } + res["patterns_allowed"] = 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.SetPatternsAllowed(res) + } + return nil + } + return res +} +// GetGithubOwnedAllowed gets the github_owned_allowed property value. Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. +// returns a *bool when successful +func (m *SelectedActions) GetGithubOwnedAllowed()(*bool) { + return m.github_owned_allowed +} +// GetPatternsAllowed gets the patterns_allowed property value. Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`. +// returns a []string when successful +func (m *SelectedActions) GetPatternsAllowed()([]string) { + return m.patterns_allowed +} +// Serialize serializes information the current object +func (m *SelectedActions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("github_owned_allowed", m.GetGithubOwnedAllowed()) + if err != nil { + return err + } + } + if m.GetPatternsAllowed() != nil { + err := writer.WriteCollectionOfStringValues("patterns_allowed", m.GetPatternsAllowed()) + 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 *SelectedActions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGithubOwnedAllowed sets the github_owned_allowed property value. Whether GitHub-owned actions are allowed. For example, this includes the actions in the `actions` organization. +func (m *SelectedActions) SetGithubOwnedAllowed(value *bool)() { + m.github_owned_allowed = value +} +// SetPatternsAllowed sets the patterns_allowed property value. Specifies a list of string-matching patterns to allow specific action(s). Wildcards, tags, and SHAs are allowed. For example, `monalisa/octocat@*`, `monalisa/octocat@v2`, `monalisa/*`. +func (m *SelectedActions) SetPatternsAllowed(value []string)() { + m.patterns_allowed = value +} +type SelectedActionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGithubOwnedAllowed()(*bool) + GetPatternsAllowed()([]string) + SetGithubOwnedAllowed(value *bool)() + SetPatternsAllowed(value []string)() +} diff --git a/pkg/github/models/short_blob.go b/pkg/github/models/short_blob.go new file mode 100644 index 00000000..56966b1c --- /dev/null +++ b/pkg/github/models/short_blob.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ShortBlob short Blob +type ShortBlob 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 sha property + sha *string + // The url property + url *string +} +// NewShortBlob instantiates a new ShortBlob and sets the default values. +func NewShortBlob()(*ShortBlob) { + m := &ShortBlob{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateShortBlobFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateShortBlobFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewShortBlob(), 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 *ShortBlob) 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 *ShortBlob) 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *ShortBlob) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ShortBlob) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ShortBlob) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ShortBlob) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *ShortBlob) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *ShortBlob) SetUrl(value *string)() { + m.url = value +} +type ShortBlobable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/short_branch.go b/pkg/github/models/short_branch.go new file mode 100644 index 00000000..b60d2869 --- /dev/null +++ b/pkg/github/models/short_branch.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ShortBranch short Branch +type ShortBranch 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 commit property + commit ShortBranch_commitable + // The name property + name *string + // The protected property + protected *bool + // Branch Protection + protection BranchProtectionable + // The protection_url property + protection_url *string +} +// NewShortBranch instantiates a new ShortBranch and sets the default values. +func NewShortBranch()(*ShortBranch) { + m := &ShortBranch{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateShortBranchFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateShortBranchFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewShortBranch(), 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 *ShortBranch) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommit gets the commit property value. The commit property +// returns a ShortBranch_commitable when successful +func (m *ShortBranch) GetCommit()(ShortBranch_commitable) { + return m.commit +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ShortBranch) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateShortBranch_commitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommit(val.(ShortBranch_commitable)) + } + 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["protected"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetProtected(val) + } + return nil + } + res["protection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateBranchProtectionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetProtection(val.(BranchProtectionable)) + } + return nil + } + res["protection_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProtectionUrl(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *ShortBranch) GetName()(*string) { + return m.name +} +// GetProtected gets the protected property value. The protected property +// returns a *bool when successful +func (m *ShortBranch) GetProtected()(*bool) { + return m.protected +} +// GetProtection gets the protection property value. Branch Protection +// returns a BranchProtectionable when successful +func (m *ShortBranch) GetProtection()(BranchProtectionable) { + return m.protection +} +// GetProtectionUrl gets the protection_url property value. The protection_url property +// returns a *string when successful +func (m *ShortBranch) GetProtectionUrl()(*string) { + return m.protection_url +} +// Serialize serializes information the current object +func (m *ShortBranch) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("protected", m.GetProtected()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("protection", m.GetProtection()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("protection_url", m.GetProtectionUrl()) + 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 *ShortBranch) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommit sets the commit property value. The commit property +func (m *ShortBranch) SetCommit(value ShortBranch_commitable)() { + m.commit = value +} +// SetName sets the name property value. The name property +func (m *ShortBranch) SetName(value *string)() { + m.name = value +} +// SetProtected sets the protected property value. The protected property +func (m *ShortBranch) SetProtected(value *bool)() { + m.protected = value +} +// SetProtection sets the protection property value. Branch Protection +func (m *ShortBranch) SetProtection(value BranchProtectionable)() { + m.protection = value +} +// SetProtectionUrl sets the protection_url property value. The protection_url property +func (m *ShortBranch) SetProtectionUrl(value *string)() { + m.protection_url = value +} +type ShortBranchable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommit()(ShortBranch_commitable) + GetName()(*string) + GetProtected()(*bool) + GetProtection()(BranchProtectionable) + GetProtectionUrl()(*string) + SetCommit(value ShortBranch_commitable)() + SetName(value *string)() + SetProtected(value *bool)() + SetProtection(value BranchProtectionable)() + SetProtectionUrl(value *string)() +} diff --git a/pkg/github/models/short_branch_escaped_commit.go b/pkg/github/models/short_branch_escaped_commit.go new file mode 100644 index 00000000..292c4adf --- /dev/null +++ b/pkg/github/models/short_branch_escaped_commit.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ShortBranch_commit 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 sha property + sha *string + // The url property + url *string +} +// NewShortBranch_commit instantiates a new ShortBranch_commit and sets the default values. +func NewShortBranch_commit()(*ShortBranch_commit) { + m := &ShortBranch_commit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateShortBranch_commitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateShortBranch_commitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewShortBranch_commit(), 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 *ShortBranch_commit) 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 *ShortBranch_commit) 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *ShortBranch_commit) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ShortBranch_commit) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ShortBranch_commit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ShortBranch_commit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *ShortBranch_commit) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *ShortBranch_commit) SetUrl(value *string)() { + m.url = value +} +type ShortBranch_commitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/simple_commit.go b/pkg/github/models/simple_commit.go new file mode 100644 index 00000000..319c3cd9 --- /dev/null +++ b/pkg/github/models/simple_commit.go @@ -0,0 +1,227 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleCommit a commit. +type SimpleCommit struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Information about the Git author + author SimpleCommit_authorable + // Information about the Git committer + committer SimpleCommit_committerable + // SHA for the commit + id *string + // Message describing the purpose of the commit + message *string + // Timestamp of the commit + timestamp *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // SHA for the commit's tree + tree_id *string +} +// NewSimpleCommit instantiates a new SimpleCommit and sets the default values. +func NewSimpleCommit()(*SimpleCommit) { + m := &SimpleCommit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleCommitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleCommitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleCommit(), 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 *SimpleCommit) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. Information about the Git author +// returns a SimpleCommit_authorable when successful +func (m *SimpleCommit) GetAuthor()(SimpleCommit_authorable) { + return m.author +} +// GetCommitter gets the committer property value. Information about the Git committer +// returns a SimpleCommit_committerable when successful +func (m *SimpleCommit) GetCommitter()(SimpleCommit_committerable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleCommit) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleCommit_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(SimpleCommit_authorable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleCommit_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(SimpleCommit_committerable)) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(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 + } + res["timestamp"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetTimestamp(val) + } + return nil + } + res["tree_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreeId(val) + } + return nil + } + return res +} +// GetId gets the id property value. SHA for the commit +// returns a *string when successful +func (m *SimpleCommit) GetId()(*string) { + return m.id +} +// GetMessage gets the message property value. Message describing the purpose of the commit +// returns a *string when successful +func (m *SimpleCommit) GetMessage()(*string) { + return m.message +} +// GetTimestamp gets the timestamp property value. Timestamp of the commit +// returns a *Time when successful +func (m *SimpleCommit) GetTimestamp()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.timestamp +} +// GetTreeId gets the tree_id property value. SHA for the commit's tree +// returns a *string when successful +func (m *SimpleCommit) GetTreeId()(*string) { + return m.tree_id +} +// Serialize serializes information the current object +func (m *SimpleCommit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("timestamp", m.GetTimestamp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tree_id", m.GetTreeId()) + 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 *SimpleCommit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. Information about the Git author +func (m *SimpleCommit) SetAuthor(value SimpleCommit_authorable)() { + m.author = value +} +// SetCommitter sets the committer property value. Information about the Git committer +func (m *SimpleCommit) SetCommitter(value SimpleCommit_committerable)() { + m.committer = value +} +// SetId sets the id property value. SHA for the commit +func (m *SimpleCommit) SetId(value *string)() { + m.id = value +} +// SetMessage sets the message property value. Message describing the purpose of the commit +func (m *SimpleCommit) SetMessage(value *string)() { + m.message = value +} +// SetTimestamp sets the timestamp property value. Timestamp of the commit +func (m *SimpleCommit) SetTimestamp(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.timestamp = value +} +// SetTreeId sets the tree_id property value. SHA for the commit's tree +func (m *SimpleCommit) SetTreeId(value *string)() { + m.tree_id = value +} +type SimpleCommitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(SimpleCommit_authorable) + GetCommitter()(SimpleCommit_committerable) + GetId()(*string) + GetMessage()(*string) + GetTimestamp()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTreeId()(*string) + SetAuthor(value SimpleCommit_authorable)() + SetCommitter(value SimpleCommit_committerable)() + SetId(value *string)() + SetMessage(value *string)() + SetTimestamp(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTreeId(value *string)() +} diff --git a/pkg/github/models/simple_commit_escaped_author.go b/pkg/github/models/simple_commit_escaped_author.go new file mode 100644 index 00000000..5b308cf5 --- /dev/null +++ b/pkg/github/models/simple_commit_escaped_author.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleCommit_author information about the Git author +type SimpleCommit_author struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Git email address of the commit's author + email *string + // Name of the commit's author + name *string +} +// NewSimpleCommit_author instantiates a new SimpleCommit_author and sets the default values. +func NewSimpleCommit_author()(*SimpleCommit_author) { + m := &SimpleCommit_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleCommit_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleCommit_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleCommit_author(), 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 *SimpleCommit_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. Git email address of the commit's author +// returns a *string when successful +func (m *SimpleCommit_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleCommit_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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. Name of the commit's author +// returns a *string when successful +func (m *SimpleCommit_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *SimpleCommit_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *SimpleCommit_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. Git email address of the commit's author +func (m *SimpleCommit_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the commit's author +func (m *SimpleCommit_author) SetName(value *string)() { + m.name = value +} +type SimpleCommit_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/simple_commit_escaped_committer.go b/pkg/github/models/simple_commit_escaped_committer.go new file mode 100644 index 00000000..01500898 --- /dev/null +++ b/pkg/github/models/simple_commit_escaped_committer.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleCommit_committer information about the Git committer +type SimpleCommit_committer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Git email address of the commit's committer + email *string + // Name of the commit's committer + name *string +} +// NewSimpleCommit_committer instantiates a new SimpleCommit_committer and sets the default values. +func NewSimpleCommit_committer()(*SimpleCommit_committer) { + m := &SimpleCommit_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleCommit_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleCommit_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleCommit_committer(), 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 *SimpleCommit_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. Git email address of the commit's committer +// returns a *string when successful +func (m *SimpleCommit_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleCommit_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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. Name of the commit's committer +// returns a *string when successful +func (m *SimpleCommit_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *SimpleCommit_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *SimpleCommit_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. Git email address of the commit's committer +func (m *SimpleCommit_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the commit's committer +func (m *SimpleCommit_committer) SetName(value *string)() { + m.name = value +} +type SimpleCommit_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/simple_commit_status.go b/pkg/github/models/simple_commit_status.go new file mode 100644 index 00000000..bcd10b4c --- /dev/null +++ b/pkg/github/models/simple_commit_status.go @@ -0,0 +1,371 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SimpleCommitStatus 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 avatar_url property + avatar_url *string + // The context property + context *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The description property + description *string + // The id property + id *int32 + // The node_id property + node_id *string + // The required property + required *bool + // The state property + state *string + // The target_url property + target_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewSimpleCommitStatus instantiates a new SimpleCommitStatus and sets the default values. +func NewSimpleCommitStatus()(*SimpleCommitStatus) { + m := &SimpleCommitStatus{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleCommitStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleCommitStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleCommitStatus(), 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 *SimpleCommitStatus) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *SimpleCommitStatus) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetContext gets the context property value. The context property +// returns a *string when successful +func (m *SimpleCommitStatus) GetContext()(*string) { + return m.context +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *SimpleCommitStatus) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *SimpleCommitStatus) 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 *SimpleCommitStatus) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + 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["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(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["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["target_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetUrl(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *SimpleCommitStatus) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *SimpleCommitStatus) GetNodeId()(*string) { + return m.node_id +} +// GetRequired gets the required property value. The required property +// returns a *bool when successful +func (m *SimpleCommitStatus) GetRequired()(*bool) { + return m.required +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *SimpleCommitStatus) GetState()(*string) { + return m.state +} +// GetTargetUrl gets the target_url property value. The target_url property +// returns a *string when successful +func (m *SimpleCommitStatus) GetTargetUrl()(*string) { + return m.target_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *SimpleCommitStatus) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *SimpleCommitStatus) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *SimpleCommitStatus) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("context", m.GetContext()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("required", m.GetRequired()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_url", m.GetTargetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *SimpleCommitStatus) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *SimpleCommitStatus) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetContext sets the context property value. The context property +func (m *SimpleCommitStatus) SetContext(value *string)() { + m.context = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *SimpleCommitStatus) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *SimpleCommitStatus) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The id property +func (m *SimpleCommitStatus) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *SimpleCommitStatus) SetNodeId(value *string)() { + m.node_id = value +} +// SetRequired sets the required property value. The required property +func (m *SimpleCommitStatus) SetRequired(value *bool)() { + m.required = value +} +// SetState sets the state property value. The state property +func (m *SimpleCommitStatus) SetState(value *string)() { + m.state = value +} +// SetTargetUrl sets the target_url property value. The target_url property +func (m *SimpleCommitStatus) SetTargetUrl(value *string)() { + m.target_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *SimpleCommitStatus) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *SimpleCommitStatus) SetUrl(value *string)() { + m.url = value +} +type SimpleCommitStatusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetContext()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetRequired()(*bool) + GetState()(*string) + GetTargetUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetContext(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetRequired(value *bool)() + SetState(value *string)() + SetTargetUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/simple_repository.go b/pkg/github/models/simple_repository.go new file mode 100644 index 00000000..dae4b6d3 --- /dev/null +++ b/pkg/github/models/simple_repository.go @@ -0,0 +1,1386 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleRepository a GitHub repository. +type SimpleRepository 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 template for the API URL to download the repository as an archive. + archive_url *string + // A template for the API URL to list the available assignees for issues in the repository. + assignees_url *string + // A template for the API URL to create or retrieve a raw Git blob in the repository. + blobs_url *string + // A template for the API URL to get information about branches in the repository. + branches_url *string + // A template for the API URL to get information about collaborators of the repository. + collaborators_url *string + // A template for the API URL to get information about comments on the repository. + comments_url *string + // A template for the API URL to get information about commits on the repository. + commits_url *string + // A template for the API URL to compare two commits or refs. + compare_url *string + // A template for the API URL to get the contents of the repository. + contents_url *string + // A template for the API URL to list the contributors to the repository. + contributors_url *string + // The API URL to list the deployments of the repository. + deployments_url *string + // The repository description. + description *string + // The API URL to list the downloads on the repository. + downloads_url *string + // The API URL to list the events of the repository. + events_url *string + // Whether the repository is a fork. + fork *bool + // The API URL to list the forks of the repository. + forks_url *string + // The full, globally unique, name of the repository. + full_name *string + // A template for the API URL to get information about Git commits of the repository. + git_commits_url *string + // A template for the API URL to get information about Git refs of the repository. + git_refs_url *string + // A template for the API URL to get information about Git tags of the repository. + git_tags_url *string + // The API URL to list the hooks on the repository. + hooks_url *string + // The URL to view the repository on GitHub.com. + html_url *string + // A unique identifier of the repository. + id *int64 + // A template for the API URL to get information about issue comments on the repository. + issue_comment_url *string + // A template for the API URL to get information about issue events on the repository. + issue_events_url *string + // A template for the API URL to get information about issues on the repository. + issues_url *string + // A template for the API URL to get information about deploy keys on the repository. + keys_url *string + // A template for the API URL to get information about labels of the repository. + labels_url *string + // The API URL to get information about the languages of the repository. + languages_url *string + // The API URL to merge branches in the repository. + merges_url *string + // A template for the API URL to get information about milestones of the repository. + milestones_url *string + // The name of the repository. + name *string + // The GraphQL identifier of the repository. + node_id *string + // A template for the API URL to get information about notifications on the repository. + notifications_url *string + // A GitHub user. + owner SimpleUserable + // Whether the repository is private. + private *bool + // A template for the API URL to get information about pull requests on the repository. + pulls_url *string + // A template for the API URL to get information about releases on the repository. + releases_url *string + // The API URL to list the stargazers on the repository. + stargazers_url *string + // A template for the API URL to get information about statuses of a commit. + statuses_url *string + // The API URL to list the subscribers on the repository. + subscribers_url *string + // The API URL to subscribe to notifications for this repository. + subscription_url *string + // The API URL to get information about tags on the repository. + tags_url *string + // The API URL to list the teams on the repository. + teams_url *string + // A template for the API URL to create or retrieve a raw Git tree of the repository. + trees_url *string + // The URL to get more information about the repository from the GitHub API. + url *string +} +// NewSimpleRepository instantiates a new SimpleRepository and sets the default values. +func NewSimpleRepository()(*SimpleRepository) { + m := &SimpleRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleRepository(), 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 *SimpleRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchiveUrl gets the archive_url property value. A template for the API URL to download the repository as an archive. +// returns a *string when successful +func (m *SimpleRepository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. A template for the API URL to list the available assignees for issues in the repository. +// returns a *string when successful +func (m *SimpleRepository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. A template for the API URL to create or retrieve a raw Git blob in the repository. +// returns a *string when successful +func (m *SimpleRepository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. A template for the API URL to get information about branches in the repository. +// returns a *string when successful +func (m *SimpleRepository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. A template for the API URL to get information about collaborators of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. A template for the API URL to get information about comments on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. A template for the API URL to get information about commits on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. A template for the API URL to compare two commits or refs. +// returns a *string when successful +func (m *SimpleRepository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. A template for the API URL to get the contents of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. A template for the API URL to list the contributors to the repository. +// returns a *string when successful +func (m *SimpleRepository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetDeploymentsUrl gets the deployments_url property value. The API URL to list the deployments of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The repository description. +// returns a *string when successful +func (m *SimpleRepository) GetDescription()(*string) { + return m.description +} +// GetDownloadsUrl gets the downloads_url property value. The API URL to list the downloads on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The API URL to list the events of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + 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["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(SimpleUserable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. Whether the repository is a fork. +// returns a *bool when successful +func (m *SimpleRepository) GetFork()(*bool) { + return m.fork +} +// GetForksUrl gets the forks_url property value. The API URL to list the forks of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full, globally unique, name of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. A template for the API URL to get information about Git commits of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. A template for the API URL to get information about Git refs of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. A template for the API URL to get information about Git tags of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetHooksUrl gets the hooks_url property value. The API URL to list the hooks on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The URL to view the repository on GitHub.com. +// returns a *string when successful +func (m *SimpleRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. A unique identifier of the repository. +// returns a *int64 when successful +func (m *SimpleRepository) GetId()(*int64) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. A template for the API URL to get information about issue comments on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. A template for the API URL to get information about issue events on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. A template for the API URL to get information about issues on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetKeysUrl gets the keys_url property value. A template for the API URL to get information about deploy keys on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. A template for the API URL to get information about labels of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguagesUrl gets the languages_url property value. The API URL to get information about the languages of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetMergesUrl gets the merges_url property value. The API URL to merge branches in the repository. +// returns a *string when successful +func (m *SimpleRepository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. A template for the API URL to get information about milestones of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The GraphQL identifier of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. A template for the API URL to get information about notifications on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOwner gets the owner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *SimpleRepository) GetOwner()(SimpleUserable) { + return m.owner +} +// GetPrivate gets the private property value. Whether the repository is private. +// returns a *bool when successful +func (m *SimpleRepository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. A template for the API URL to get information about pull requests on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetReleasesUrl gets the releases_url property value. A template for the API URL to get information about releases on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetStargazersUrl gets the stargazers_url property value. The API URL to list the stargazers on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. A template for the API URL to get information about statuses of a commit. +// returns a *string when successful +func (m *SimpleRepository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersUrl gets the subscribers_url property value. The API URL to list the subscribers on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The API URL to subscribe to notifications for this repository. +// returns a *string when successful +func (m *SimpleRepository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetTagsUrl gets the tags_url property value. The API URL to get information about tags on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The API URL to list the teams on the repository. +// returns a *string when successful +func (m *SimpleRepository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTreesUrl gets the trees_url property value. A template for the API URL to create or retrieve a raw Git tree of the repository. +// returns a *string when successful +func (m *SimpleRepository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUrl gets the url property value. The URL to get more information about the repository from the GitHub API. +// returns a *string when successful +func (m *SimpleRepository) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *SimpleRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *SimpleRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchiveUrl sets the archive_url property value. A template for the API URL to download the repository as an archive. +func (m *SimpleRepository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. A template for the API URL to list the available assignees for issues in the repository. +func (m *SimpleRepository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. A template for the API URL to create or retrieve a raw Git blob in the repository. +func (m *SimpleRepository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. A template for the API URL to get information about branches in the repository. +func (m *SimpleRepository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. A template for the API URL to get information about collaborators of the repository. +func (m *SimpleRepository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. A template for the API URL to get information about comments on the repository. +func (m *SimpleRepository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. A template for the API URL to get information about commits on the repository. +func (m *SimpleRepository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. A template for the API URL to compare two commits or refs. +func (m *SimpleRepository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. A template for the API URL to get the contents of the repository. +func (m *SimpleRepository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. A template for the API URL to list the contributors to the repository. +func (m *SimpleRepository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetDeploymentsUrl sets the deployments_url property value. The API URL to list the deployments of the repository. +func (m *SimpleRepository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The repository description. +func (m *SimpleRepository) SetDescription(value *string)() { + m.description = value +} +// SetDownloadsUrl sets the downloads_url property value. The API URL to list the downloads on the repository. +func (m *SimpleRepository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The API URL to list the events of the repository. +func (m *SimpleRepository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. Whether the repository is a fork. +func (m *SimpleRepository) SetFork(value *bool)() { + m.fork = value +} +// SetForksUrl sets the forks_url property value. The API URL to list the forks of the repository. +func (m *SimpleRepository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full, globally unique, name of the repository. +func (m *SimpleRepository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. A template for the API URL to get information about Git commits of the repository. +func (m *SimpleRepository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. A template for the API URL to get information about Git refs of the repository. +func (m *SimpleRepository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. A template for the API URL to get information about Git tags of the repository. +func (m *SimpleRepository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetHooksUrl sets the hooks_url property value. The API URL to list the hooks on the repository. +func (m *SimpleRepository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The URL to view the repository on GitHub.com. +func (m *SimpleRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. A unique identifier of the repository. +func (m *SimpleRepository) SetId(value *int64)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. A template for the API URL to get information about issue comments on the repository. +func (m *SimpleRepository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. A template for the API URL to get information about issue events on the repository. +func (m *SimpleRepository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. A template for the API URL to get information about issues on the repository. +func (m *SimpleRepository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetKeysUrl sets the keys_url property value. A template for the API URL to get information about deploy keys on the repository. +func (m *SimpleRepository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. A template for the API URL to get information about labels of the repository. +func (m *SimpleRepository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguagesUrl sets the languages_url property value. The API URL to get information about the languages of the repository. +func (m *SimpleRepository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetMergesUrl sets the merges_url property value. The API URL to merge branches in the repository. +func (m *SimpleRepository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. A template for the API URL to get information about milestones of the repository. +func (m *SimpleRepository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetName sets the name property value. The name of the repository. +func (m *SimpleRepository) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The GraphQL identifier of the repository. +func (m *SimpleRepository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. A template for the API URL to get information about notifications on the repository. +func (m *SimpleRepository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *SimpleRepository) SetOwner(value SimpleUserable)() { + m.owner = value +} +// SetPrivate sets the private property value. Whether the repository is private. +func (m *SimpleRepository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. A template for the API URL to get information about pull requests on the repository. +func (m *SimpleRepository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetReleasesUrl sets the releases_url property value. A template for the API URL to get information about releases on the repository. +func (m *SimpleRepository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetStargazersUrl sets the stargazers_url property value. The API URL to list the stargazers on the repository. +func (m *SimpleRepository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. A template for the API URL to get information about statuses of a commit. +func (m *SimpleRepository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersUrl sets the subscribers_url property value. The API URL to list the subscribers on the repository. +func (m *SimpleRepository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The API URL to subscribe to notifications for this repository. +func (m *SimpleRepository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetTagsUrl sets the tags_url property value. The API URL to get information about tags on the repository. +func (m *SimpleRepository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The API URL to list the teams on the repository. +func (m *SimpleRepository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTreesUrl sets the trees_url property value. A template for the API URL to create or retrieve a raw Git tree of the repository. +func (m *SimpleRepository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUrl sets the url property value. The URL to get more information about the repository from the GitHub API. +func (m *SimpleRepository) SetUrl(value *string)() { + m.url = value +} +type SimpleRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguagesUrl()(*string) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOwner()(SimpleUserable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetReleasesUrl()(*string) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTreesUrl()(*string) + GetUrl()(*string) + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguagesUrl(value *string)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOwner(value SimpleUserable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetReleasesUrl(value *string)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTreesUrl(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/simple_user.go b/pkg/github/models/simple_user.go new file mode 100644 index 00000000..d90bd0f3 --- /dev/null +++ b/pkg/github/models/simple_user.go @@ -0,0 +1,661 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SimpleUser a GitHub user. +type SimpleUser 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 avatar_url property + avatar_url *string + // The email property + email *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int64 + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_at property + starred_at *string + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewSimpleUser instantiates a new SimpleUser and sets the default values. +func NewSimpleUser()(*SimpleUser) { + m := &SimpleUser{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSimpleUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSimpleUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSimpleUser(), 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 *SimpleUser) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *SimpleUser) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *SimpleUser) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *SimpleUser) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *SimpleUser) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredAt(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *SimpleUser) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *SimpleUser) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *SimpleUser) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *SimpleUser) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *SimpleUser) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *SimpleUser) GetId()(*int64) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *SimpleUser) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *SimpleUser) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *SimpleUser) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *SimpleUser) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *SimpleUser) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *SimpleUser) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *SimpleUser) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredAt gets the starred_at property value. The starred_at property +// returns a *string when successful +func (m *SimpleUser) GetStarredAt()(*string) { + return m.starred_at +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *SimpleUser) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *SimpleUser) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *SimpleUser) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *SimpleUser) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *SimpleUser) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_at", m.GetStarredAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *SimpleUser) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *SimpleUser) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEmail sets the email property value. The email property +func (m *SimpleUser) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *SimpleUser) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *SimpleUser) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *SimpleUser) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *SimpleUser) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *SimpleUser) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *SimpleUser) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *SimpleUser) SetId(value *int64)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *SimpleUser) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *SimpleUser) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *SimpleUser) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *SimpleUser) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *SimpleUser) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *SimpleUser) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *SimpleUser) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredAt sets the starred_at property value. The starred_at property +func (m *SimpleUser) SetStarredAt(value *string)() { + m.starred_at = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *SimpleUser) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *SimpleUser) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *SimpleUser) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *SimpleUser) SetUrl(value *string)() { + m.url = value +} +type SimpleUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredAt()(*string) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredAt(value *string)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/snapshot.go b/pkg/github/models/snapshot.go new file mode 100644 index 00000000..fc696912 --- /dev/null +++ b/pkg/github/models/snapshot.go @@ -0,0 +1,266 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Snapshot create a new snapshot of a repository's dependencies. +type Snapshot struct { + // A description of the detector used. + detector Snapshot_detectorable + // The job property + job Snapshot_jobable + // A collection of package manifests, which are a collection of related dependencies declared in a file or representing a logical group of dependencies. + manifests Snapshot_manifestsable + // User-defined metadata to store domain-specific information limited to 8 keys with scalar values. + metadata Metadataable + // The repository branch that triggered this snapshot. + ref *string + // The time at which the snapshot was scanned. + scanned *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The commit SHA associated with this dependency snapshot. Maximum length: 40 characters. + sha *string + // The version of the repository snapshot submission. + version *int32 +} +// NewSnapshot instantiates a new Snapshot and sets the default values. +func NewSnapshot()(*Snapshot) { + m := &Snapshot{ + } + return m +} +// CreateSnapshotFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSnapshotFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSnapshot(), nil +} +// GetDetector gets the detector property value. A description of the detector used. +// returns a Snapshot_detectorable when successful +func (m *Snapshot) GetDetector()(Snapshot_detectorable) { + return m.detector +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Snapshot) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["detector"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSnapshot_detectorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDetector(val.(Snapshot_detectorable)) + } + return nil + } + res["job"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSnapshot_jobFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetJob(val.(Snapshot_jobable)) + } + return nil + } + res["manifests"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSnapshot_manifestsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetManifests(val.(Snapshot_manifestsable)) + } + return nil + } + res["metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMetadataFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMetadata(val.(Metadataable)) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["scanned"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetScanned(val) + } + return nil + } + 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["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} +// GetJob gets the job property value. The job property +// returns a Snapshot_jobable when successful +func (m *Snapshot) GetJob()(Snapshot_jobable) { + return m.job +} +// GetManifests gets the manifests property value. A collection of package manifests, which are a collection of related dependencies declared in a file or representing a logical group of dependencies. +// returns a Snapshot_manifestsable when successful +func (m *Snapshot) GetManifests()(Snapshot_manifestsable) { + return m.manifests +} +// GetMetadata gets the metadata property value. User-defined metadata to store domain-specific information limited to 8 keys with scalar values. +// returns a Metadataable when successful +func (m *Snapshot) GetMetadata()(Metadataable) { + return m.metadata +} +// GetRef gets the ref property value. The repository branch that triggered this snapshot. +// returns a *string when successful +func (m *Snapshot) GetRef()(*string) { + return m.ref +} +// GetScanned gets the scanned property value. The time at which the snapshot was scanned. +// returns a *Time when successful +func (m *Snapshot) GetScanned()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.scanned +} +// GetSha gets the sha property value. The commit SHA associated with this dependency snapshot. Maximum length: 40 characters. +// returns a *string when successful +func (m *Snapshot) GetSha()(*string) { + return m.sha +} +// GetVersion gets the version property value. The version of the repository snapshot submission. +// returns a *int32 when successful +func (m *Snapshot) GetVersion()(*int32) { + return m.version +} +// Serialize serializes information the current object +func (m *Snapshot) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("detector", m.GetDetector()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("job", m.GetJob()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("manifests", m.GetManifests()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("metadata", m.GetMetadata()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("scanned", m.GetScanned()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("version", m.GetVersion()) + if err != nil { + return err + } + } + return nil +} +// SetDetector sets the detector property value. A description of the detector used. +func (m *Snapshot) SetDetector(value Snapshot_detectorable)() { + m.detector = value +} +// SetJob sets the job property value. The job property +func (m *Snapshot) SetJob(value Snapshot_jobable)() { + m.job = value +} +// SetManifests sets the manifests property value. A collection of package manifests, which are a collection of related dependencies declared in a file or representing a logical group of dependencies. +func (m *Snapshot) SetManifests(value Snapshot_manifestsable)() { + m.manifests = value +} +// SetMetadata sets the metadata property value. User-defined metadata to store domain-specific information limited to 8 keys with scalar values. +func (m *Snapshot) SetMetadata(value Metadataable)() { + m.metadata = value +} +// SetRef sets the ref property value. The repository branch that triggered this snapshot. +func (m *Snapshot) SetRef(value *string)() { + m.ref = value +} +// SetScanned sets the scanned property value. The time at which the snapshot was scanned. +func (m *Snapshot) SetScanned(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.scanned = value +} +// SetSha sets the sha property value. The commit SHA associated with this dependency snapshot. Maximum length: 40 characters. +func (m *Snapshot) SetSha(value *string)() { + m.sha = value +} +// SetVersion sets the version property value. The version of the repository snapshot submission. +func (m *Snapshot) SetVersion(value *int32)() { + m.version = value +} +type Snapshotable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDetector()(Snapshot_detectorable) + GetJob()(Snapshot_jobable) + GetManifests()(Snapshot_manifestsable) + GetMetadata()(Metadataable) + GetRef()(*string) + GetScanned()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetSha()(*string) + GetVersion()(*int32) + SetDetector(value Snapshot_detectorable)() + SetJob(value Snapshot_jobable)() + SetManifests(value Snapshot_manifestsable)() + SetMetadata(value Metadataable)() + SetRef(value *string)() + SetScanned(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetSha(value *string)() + SetVersion(value *int32)() +} diff --git a/pkg/github/models/snapshot_escaped_detector.go b/pkg/github/models/snapshot_escaped_detector.go new file mode 100644 index 00000000..4c3e499f --- /dev/null +++ b/pkg/github/models/snapshot_escaped_detector.go @@ -0,0 +1,120 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Snapshot_detector a description of the detector used. +type Snapshot_detector struct { + // The name of the detector used. + name *string + // The url of the detector used. + url *string + // The version of the detector used. + version *string +} +// NewSnapshot_detector instantiates a new Snapshot_detector and sets the default values. +func NewSnapshot_detector()(*Snapshot_detector) { + m := &Snapshot_detector{ + } + return m +} +// CreateSnapshot_detectorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSnapshot_detectorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSnapshot_detector(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Snapshot_detector) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVersion(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the detector used. +// returns a *string when successful +func (m *Snapshot_detector) GetName()(*string) { + return m.name +} +// GetUrl gets the url property value. The url of the detector used. +// returns a *string when successful +func (m *Snapshot_detector) GetUrl()(*string) { + return m.url +} +// GetVersion gets the version property value. The version of the detector used. +// returns a *string when successful +func (m *Snapshot_detector) GetVersion()(*string) { + return m.version +} +// Serialize serializes information the current object +func (m *Snapshot_detector) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("version", m.GetVersion()) + if err != nil { + return err + } + } + return nil +} +// SetName sets the name property value. The name of the detector used. +func (m *Snapshot_detector) SetName(value *string)() { + m.name = value +} +// SetUrl sets the url property value. The url of the detector used. +func (m *Snapshot_detector) SetUrl(value *string)() { + m.url = value +} +// SetVersion sets the version property value. The version of the detector used. +func (m *Snapshot_detector) SetVersion(value *string)() { + m.version = value +} +type Snapshot_detectorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetUrl()(*string) + GetVersion()(*string) + SetName(value *string)() + SetUrl(value *string)() + SetVersion(value *string)() +} diff --git a/pkg/github/models/snapshot_escaped_job.go b/pkg/github/models/snapshot_escaped_job.go new file mode 100644 index 00000000..aff72c67 --- /dev/null +++ b/pkg/github/models/snapshot_escaped_job.go @@ -0,0 +1,119 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Snapshot_job struct { + // Correlator provides a key that is used to group snapshots submitted over time. Only the "latest" submitted snapshot for a given combination of `job.correlator` and `detector.name` will be considered when calculating a repository's current dependencies. Correlator should be as unique as it takes to distinguish all detection runs for a given "wave" of CI workflow you run. If you're using GitHub Actions, a good default value for this could be the environment variables GITHUB_WORKFLOW and GITHUB_JOB concatenated together. If you're using a build matrix, then you'll also need to add additional key(s) to distinguish between each submission inside a matrix variation. + correlator *string + // The url for the job. + html_url *string + // The external ID of the job. + id *string +} +// NewSnapshot_job instantiates a new Snapshot_job and sets the default values. +func NewSnapshot_job()(*Snapshot_job) { + m := &Snapshot_job{ + } + return m +} +// CreateSnapshot_jobFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSnapshot_jobFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSnapshot_job(), nil +} +// GetCorrelator gets the correlator property value. Correlator provides a key that is used to group snapshots submitted over time. Only the "latest" submitted snapshot for a given combination of `job.correlator` and `detector.name` will be considered when calculating a repository's current dependencies. Correlator should be as unique as it takes to distinguish all detection runs for a given "wave" of CI workflow you run. If you're using GitHub Actions, a good default value for this could be the environment variables GITHUB_WORKFLOW and GITHUB_JOB concatenated together. If you're using a build matrix, then you'll also need to add additional key(s) to distinguish between each submission inside a matrix variation. +// returns a *string when successful +func (m *Snapshot_job) GetCorrelator()(*string) { + return m.correlator +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Snapshot_job) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["correlator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCorrelator(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The url for the job. +// returns a *string when successful +func (m *Snapshot_job) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The external ID of the job. +// returns a *string when successful +func (m *Snapshot_job) GetId()(*string) { + return m.id +} +// Serialize serializes information the current object +func (m *Snapshot_job) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("correlator", m.GetCorrelator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + return nil +} +// SetCorrelator sets the correlator property value. Correlator provides a key that is used to group snapshots submitted over time. Only the "latest" submitted snapshot for a given combination of `job.correlator` and `detector.name` will be considered when calculating a repository's current dependencies. Correlator should be as unique as it takes to distinguish all detection runs for a given "wave" of CI workflow you run. If you're using GitHub Actions, a good default value for this could be the environment variables GITHUB_WORKFLOW and GITHUB_JOB concatenated together. If you're using a build matrix, then you'll also need to add additional key(s) to distinguish between each submission inside a matrix variation. +func (m *Snapshot_job) SetCorrelator(value *string)() { + m.correlator = value +} +// SetHtmlUrl sets the html_url property value. The url for the job. +func (m *Snapshot_job) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The external ID of the job. +func (m *Snapshot_job) SetId(value *string)() { + m.id = value +} +type Snapshot_jobable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCorrelator()(*string) + GetHtmlUrl()(*string) + GetId()(*string) + SetCorrelator(value *string)() + SetHtmlUrl(value *string)() + SetId(value *string)() +} diff --git a/pkg/github/models/snapshot_escaped_manifests.go b/pkg/github/models/snapshot_escaped_manifests.go new file mode 100644 index 00000000..77dcf519 --- /dev/null +++ b/pkg/github/models/snapshot_escaped_manifests.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Snapshot_manifests a collection of package manifests, which are a collection of related dependencies declared in a file or representing a logical group of dependencies. +type Snapshot_manifests struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewSnapshot_manifests instantiates a new Snapshot_manifests and sets the default values. +func NewSnapshot_manifests()(*Snapshot_manifests) { + m := &Snapshot_manifests{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSnapshot_manifestsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSnapshot_manifestsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSnapshot_manifests(), 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 *Snapshot_manifests) 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 *Snapshot_manifests) 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 *Snapshot_manifests) 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 *Snapshot_manifests) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type Snapshot_manifestsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/social_account.go b/pkg/github/models/social_account.go new file mode 100644 index 00000000..5998cfe1 --- /dev/null +++ b/pkg/github/models/social_account.go @@ -0,0 +1,110 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SocialAccount social media account +type SocialAccount 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 provider property + provider *string + // The url property + url *string +} +// NewSocialAccount instantiates a new SocialAccount and sets the default values. +func NewSocialAccount()(*SocialAccount) { + m := &SocialAccount{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSocialAccountFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSocialAccountFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSocialAccount(), 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 *SocialAccount) 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 *SocialAccount) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["provider"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProvider(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetProvider gets the provider property value. The provider property +// returns a *string when successful +func (m *SocialAccount) GetProvider()(*string) { + return m.provider +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *SocialAccount) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *SocialAccount) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("provider", m.GetProvider()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *SocialAccount) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetProvider sets the provider property value. The provider property +func (m *SocialAccount) SetProvider(value *string)() { + m.provider = value +} +// SetUrl sets the url property value. The url property +func (m *SocialAccount) SetUrl(value *string)() { + m.url = value +} +type SocialAccountable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetProvider()(*string) + GetUrl()(*string) + SetProvider(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/ssh_key.go b/pkg/github/models/ssh_key.go new file mode 100644 index 00000000..86f983dc --- /dev/null +++ b/pkg/github/models/ssh_key.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type SshKey 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 key property + key *string + // The prettyPrint property + prettyPrint *string +} +// NewSshKey instantiates a new SshKey and sets the default values. +func NewSshKey()(*SshKey) { + m := &SshKey{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSshKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSshKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSshKey(), 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 *SshKey) 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 *SshKey) 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["pretty-print"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPrettyPrint(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *SshKey) GetKey()(*string) { + return m.key +} +// GetPrettyPrint gets the pretty-print property value. The prettyPrint property +// returns a *string when successful +func (m *SshKey) GetPrettyPrint()(*string) { + return m.prettyPrint +} +// Serialize serializes information the current object +func (m *SshKey) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pretty-print", m.GetPrettyPrint()) + 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 *SshKey) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The key property +func (m *SshKey) SetKey(value *string)() { + m.key = value +} +// SetPrettyPrint sets the pretty-print property value. The prettyPrint property +func (m *SshKey) SetPrettyPrint(value *string)() { + m.prettyPrint = value +} +type SshKeyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetPrettyPrint()(*string) + SetKey(value *string)() + SetPrettyPrint(value *string)() +} diff --git a/pkg/github/models/ssh_signing_key.go b/pkg/github/models/ssh_signing_key.go new file mode 100644 index 00000000..21a76d38 --- /dev/null +++ b/pkg/github/models/ssh_signing_key.go @@ -0,0 +1,169 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// SshSigningKey a public SSH key used to sign Git commits +type SshSigningKey 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 id property + id *int32 + // The key property + key *string + // The title property + title *string +} +// NewSshSigningKey instantiates a new SshSigningKey and sets the default values. +func NewSshSigningKey()(*SshSigningKey) { + m := &SshSigningKey{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSshSigningKeyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSshSigningKeyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSshSigningKey(), 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 *SshSigningKey) 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 *SshSigningKey) 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 *SshSigningKey) 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + 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["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *SshSigningKey) GetId()(*int32) { + return m.id +} +// GetKey gets the key property value. The key property +// returns a *string when successful +func (m *SshSigningKey) GetKey()(*string) { + return m.key +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *SshSigningKey) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *SshSigningKey) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *SshSigningKey) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *SshSigningKey) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetId sets the id property value. The id property +func (m *SshSigningKey) SetId(value *int32)() { + m.id = value +} +// SetKey sets the key property value. The key property +func (m *SshSigningKey) SetKey(value *string)() { + m.key = value +} +// SetTitle sets the title property value. The title property +func (m *SshSigningKey) SetTitle(value *string)() { + m.title = value +} +type SshSigningKeyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetId()(*int32) + GetKey()(*string) + GetTitle()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetId(value *int32)() + SetKey(value *string)() + SetTitle(value *string)() +} diff --git a/pkg/github/models/state_change_issue_event.go b/pkg/github/models/state_change_issue_event.go new file mode 100644 index 00000000..da93e4ae --- /dev/null +++ b/pkg/github/models/state_change_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// StateChangeIssueEvent state Change Issue Event +type StateChangeIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The state_reason property + state_reason *string + // The url property + url *string +} +// NewStateChangeIssueEvent instantiates a new StateChangeIssueEvent and sets the default values. +func NewStateChangeIssueEvent()(*StateChangeIssueEvent) { + m := &StateChangeIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateStateChangeIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateStateChangeIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewStateChangeIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *StateChangeIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *StateChangeIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *StateChangeIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *StateChangeIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *StateChangeIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *StateChangeIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *StateChangeIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["state_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStateReason(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *StateChangeIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *StateChangeIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *StateChangeIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetStateReason gets the state_reason property value. The state_reason property +// returns a *string when successful +func (m *StateChangeIssueEvent) GetStateReason()(*string) { + return m.state_reason +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *StateChangeIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *StateChangeIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state_reason", m.GetStateReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *StateChangeIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *StateChangeIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *StateChangeIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *StateChangeIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *StateChangeIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *StateChangeIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *StateChangeIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *StateChangeIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *StateChangeIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetStateReason sets the state_reason property value. The state_reason property +func (m *StateChangeIssueEvent) SetStateReason(value *string)() { + m.state_reason = value +} +// SetUrl sets the url property value. The url property +func (m *StateChangeIssueEvent) SetUrl(value *string)() { + m.url = value +} +type StateChangeIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetStateReason()(*string) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetStateReason(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/status.go b/pkg/github/models/status.go new file mode 100644 index 00000000..e6d2a277 --- /dev/null +++ b/pkg/github/models/status.go @@ -0,0 +1,371 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Status the status of a commit. +type Status 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 avatar_url property + avatar_url *string + // The context property + context *string + // The created_at property + created_at *string + // A GitHub user. + creator NullableSimpleUserable + // The description property + description *string + // The id property + id *int32 + // The node_id property + node_id *string + // The state property + state *string + // The target_url property + target_url *string + // The updated_at property + updated_at *string + // The url property + url *string +} +// NewStatus instantiates a new Status and sets the default values. +func NewStatus()(*Status) { + m := &Status{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateStatusFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateStatusFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewStatus(), 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 *Status) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *Status) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetContext gets the context property value. The context property +// returns a *string when successful +func (m *Status) GetContext()(*string) { + return m.context +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *Status) GetCreatedAt()(*string) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *Status) GetCreator()(NullableSimpleUserable) { + return m.creator +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *Status) 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 *Status) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(NullableSimpleUserable)) + } + 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["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["target_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetUrl(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Status) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Status) GetNodeId()(*string) { + return m.node_id +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *Status) GetState()(*string) { + return m.state +} +// GetTargetUrl gets the target_url property value. The target_url property +// returns a *string when successful +func (m *Status) GetTargetUrl()(*string) { + return m.target_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *Status) GetUpdatedAt()(*string) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Status) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Status) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("context", m.GetContext()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_url", m.GetTargetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Status) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *Status) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetContext sets the context property value. The context property +func (m *Status) SetContext(value *string)() { + m.context = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Status) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *Status) SetCreator(value NullableSimpleUserable)() { + m.creator = value +} +// SetDescription sets the description property value. The description property +func (m *Status) SetDescription(value *string)() { + m.description = value +} +// SetId sets the id property value. The id property +func (m *Status) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Status) SetNodeId(value *string)() { + m.node_id = value +} +// SetState sets the state property value. The state property +func (m *Status) SetState(value *string)() { + m.state = value +} +// SetTargetUrl sets the target_url property value. The target_url property +func (m *Status) SetTargetUrl(value *string)() { + m.target_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Status) SetUpdatedAt(value *string)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Status) SetUrl(value *string)() { + m.url = value +} +type Statusable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetContext()(*string) + GetCreatedAt()(*string) + GetCreator()(NullableSimpleUserable) + GetDescription()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetState()(*string) + GetTargetUrl()(*string) + GetUpdatedAt()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetContext(value *string)() + SetCreatedAt(value *string)() + SetCreator(value NullableSimpleUserable)() + SetDescription(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetState(value *string)() + SetTargetUrl(value *string)() + SetUpdatedAt(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/status_check_policy.go b/pkg/github/models/status_check_policy.go new file mode 100644 index 00000000..383fa002 --- /dev/null +++ b/pkg/github/models/status_check_policy.go @@ -0,0 +1,215 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// StatusCheckPolicy status Check Policy +type StatusCheckPolicy 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 checks property + checks []StatusCheckPolicy_checksable + // The contexts property + contexts []string + // The contexts_url property + contexts_url *string + // The strict property + strict *bool + // The url property + url *string +} +// NewStatusCheckPolicy instantiates a new StatusCheckPolicy and sets the default values. +func NewStatusCheckPolicy()(*StatusCheckPolicy) { + m := &StatusCheckPolicy{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateStatusCheckPolicyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateStatusCheckPolicyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewStatusCheckPolicy(), 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 *StatusCheckPolicy) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChecks gets the checks property value. The checks property +// returns a []StatusCheckPolicy_checksable when successful +func (m *StatusCheckPolicy) GetChecks()([]StatusCheckPolicy_checksable) { + return m.checks +} +// GetContexts gets the contexts property value. The contexts property +// returns a []string when successful +func (m *StatusCheckPolicy) GetContexts()([]string) { + return m.contexts +} +// GetContextsUrl gets the contexts_url property value. The contexts_url property +// returns a *string when successful +func (m *StatusCheckPolicy) GetContextsUrl()(*string) { + return m.contexts_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *StatusCheckPolicy) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateStatusCheckPolicy_checksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]StatusCheckPolicy_checksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(StatusCheckPolicy_checksable) + } + } + m.SetChecks(res) + } + return nil + } + res["contexts"] = 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.SetContexts(res) + } + return nil + } + res["contexts_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContextsUrl(val) + } + return nil + } + res["strict"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetStrict(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetStrict gets the strict property value. The strict property +// returns a *bool when successful +func (m *StatusCheckPolicy) GetStrict()(*bool) { + return m.strict +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *StatusCheckPolicy) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *StatusCheckPolicy) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetChecks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetChecks())) + for i, v := range m.GetChecks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("checks", cast) + if err != nil { + return err + } + } + if m.GetContexts() != nil { + err := writer.WriteCollectionOfStringValues("contexts", m.GetContexts()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contexts_url", m.GetContextsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("strict", m.GetStrict()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *StatusCheckPolicy) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChecks sets the checks property value. The checks property +func (m *StatusCheckPolicy) SetChecks(value []StatusCheckPolicy_checksable)() { + m.checks = value +} +// SetContexts sets the contexts property value. The contexts property +func (m *StatusCheckPolicy) SetContexts(value []string)() { + m.contexts = value +} +// SetContextsUrl sets the contexts_url property value. The contexts_url property +func (m *StatusCheckPolicy) SetContextsUrl(value *string)() { + m.contexts_url = value +} +// SetStrict sets the strict property value. The strict property +func (m *StatusCheckPolicy) SetStrict(value *bool)() { + m.strict = value +} +// SetUrl sets the url property value. The url property +func (m *StatusCheckPolicy) SetUrl(value *string)() { + m.url = value +} +type StatusCheckPolicyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChecks()([]StatusCheckPolicy_checksable) + GetContexts()([]string) + GetContextsUrl()(*string) + GetStrict()(*bool) + GetUrl()(*string) + SetChecks(value []StatusCheckPolicy_checksable)() + SetContexts(value []string)() + SetContextsUrl(value *string)() + SetStrict(value *bool)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/status_check_policy_escaped_checks.go b/pkg/github/models/status_check_policy_escaped_checks.go new file mode 100644 index 00000000..cde7c500 --- /dev/null +++ b/pkg/github/models/status_check_policy_escaped_checks.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type StatusCheckPolicy_checks 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 app_id property + app_id *int32 + // The context property + context *string +} +// NewStatusCheckPolicy_checks instantiates a new StatusCheckPolicy_checks and sets the default values. +func NewStatusCheckPolicy_checks()(*StatusCheckPolicy_checks) { + m := &StatusCheckPolicy_checks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateStatusCheckPolicy_checksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateStatusCheckPolicy_checksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewStatusCheckPolicy_checks(), 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 *StatusCheckPolicy_checks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAppId gets the app_id property value. The app_id property +// returns a *int32 when successful +func (m *StatusCheckPolicy_checks) GetAppId()(*int32) { + return m.app_id +} +// GetContext gets the context property value. The context property +// returns a *string when successful +func (m *StatusCheckPolicy_checks) GetContext()(*string) { + return m.context +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *StatusCheckPolicy_checks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *StatusCheckPolicy_checks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("app_id", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("context", m.GetContext()) + 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 *StatusCheckPolicy_checks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAppId sets the app_id property value. The app_id property +func (m *StatusCheckPolicy_checks) SetAppId(value *int32)() { + m.app_id = value +} +// SetContext sets the context property value. The context property +func (m *StatusCheckPolicy_checks) SetContext(value *string)() { + m.context = value +} +type StatusCheckPolicy_checksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId()(*int32) + GetContext()(*string) + SetAppId(value *int32)() + SetContext(value *string)() +} diff --git a/pkg/github/models/tag.go b/pkg/github/models/tag.go new file mode 100644 index 00000000..33a02696 --- /dev/null +++ b/pkg/github/models/tag.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Tag tag +type Tag 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 commit property + commit Tag_commitable + // The name property + name *string + // The node_id property + node_id *string + // The tarball_url property + tarball_url *string + // The zipball_url property + zipball_url *string +} +// NewTag instantiates a new Tag and sets the default values. +func NewTag()(*Tag) { + m := &Tag{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTagFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTagFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTag(), 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 *Tag) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommit gets the commit property value. The commit property +// returns a Tag_commitable when successful +func (m *Tag) GetCommit()(Tag_commitable) { + return m.commit +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Tag) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTag_commitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommit(val.(Tag_commitable)) + } + 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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["tarball_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTarballUrl(val) + } + return nil + } + res["zipball_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetZipballUrl(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Tag) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Tag) GetNodeId()(*string) { + return m.node_id +} +// GetTarballUrl gets the tarball_url property value. The tarball_url property +// returns a *string when successful +func (m *Tag) GetTarballUrl()(*string) { + return m.tarball_url +} +// GetZipballUrl gets the zipball_url property value. The zipball_url property +// returns a *string when successful +func (m *Tag) GetZipballUrl()(*string) { + return m.zipball_url +} +// Serialize serializes information the current object +func (m *Tag) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("commit", m.GetCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tarball_url", m.GetTarballUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("zipball_url", m.GetZipballUrl()) + 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 *Tag) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommit sets the commit property value. The commit property +func (m *Tag) SetCommit(value Tag_commitable)() { + m.commit = value +} +// SetName sets the name property value. The name property +func (m *Tag) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Tag) SetNodeId(value *string)() { + m.node_id = value +} +// SetTarballUrl sets the tarball_url property value. The tarball_url property +func (m *Tag) SetTarballUrl(value *string)() { + m.tarball_url = value +} +// SetZipballUrl sets the zipball_url property value. The zipball_url property +func (m *Tag) SetZipballUrl(value *string)() { + m.zipball_url = value +} +type Tagable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommit()(Tag_commitable) + GetName()(*string) + GetNodeId()(*string) + GetTarballUrl()(*string) + GetZipballUrl()(*string) + SetCommit(value Tag_commitable)() + SetName(value *string)() + SetNodeId(value *string)() + SetTarballUrl(value *string)() + SetZipballUrl(value *string)() +} diff --git a/pkg/github/models/tag_escaped_commit.go b/pkg/github/models/tag_escaped_commit.go new file mode 100644 index 00000000..63ff25e1 --- /dev/null +++ b/pkg/github/models/tag_escaped_commit.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Tag_commit 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 sha property + sha *string + // The url property + url *string +} +// NewTag_commit instantiates a new Tag_commit and sets the default values. +func NewTag_commit()(*Tag_commit) { + m := &Tag_commit{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTag_commitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTag_commitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTag_commit(), 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 *Tag_commit) 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 *Tag_commit) 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. The sha property +// returns a *string when successful +func (m *Tag_commit) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Tag_commit) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Tag_commit) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Tag_commit) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. The sha property +func (m *Tag_commit) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *Tag_commit) SetUrl(value *string)() { + m.url = value +} +type Tag_commitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/tag_protection.go b/pkg/github/models/tag_protection.go new file mode 100644 index 00000000..a0d9766f --- /dev/null +++ b/pkg/github/models/tag_protection.go @@ -0,0 +1,197 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TagProtection tag protection +type TagProtection 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 *string + // The enabled property + enabled *bool + // The id property + id *int32 + // The pattern property + pattern *string + // The updated_at property + updated_at *string +} +// NewTagProtection instantiates a new TagProtection and sets the default values. +func NewTagProtection()(*TagProtection) { + m := &TagProtection{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTagProtectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTagProtectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTagProtection(), 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 *TagProtection) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *TagProtection) GetCreatedAt()(*string) { + return m.created_at +} +// GetEnabled gets the enabled property value. The enabled property +// returns a *bool when successful +func (m *TagProtection) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TagProtection) 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.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TagProtection) GetId()(*int32) { + return m.id +} +// GetPattern gets the pattern property value. The pattern property +// returns a *string when successful +func (m *TagProtection) GetPattern()(*string) { + return m.pattern +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *TagProtection) GetUpdatedAt()(*string) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *TagProtection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + 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 *TagProtection) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TagProtection) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEnabled sets the enabled property value. The enabled property +func (m *TagProtection) SetEnabled(value *bool)() { + m.enabled = value +} +// SetId sets the id property value. The id property +func (m *TagProtection) SetId(value *int32)() { + m.id = value +} +// SetPattern sets the pattern property value. The pattern property +func (m *TagProtection) SetPattern(value *string)() { + m.pattern = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TagProtection) SetUpdatedAt(value *string)() { + m.updated_at = value +} +type TagProtectionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetEnabled()(*bool) + GetId()(*int32) + GetPattern()(*string) + GetUpdatedAt()(*string) + SetCreatedAt(value *string)() + SetEnabled(value *bool)() + SetId(value *int32)() + SetPattern(value *string)() + SetUpdatedAt(value *string)() +} diff --git a/pkg/github/models/team.go b/pkg/github/models/team.go new file mode 100644 index 00000000..ecd18c82 --- /dev/null +++ b/pkg/github/models/team.go @@ -0,0 +1,458 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Team groups of organization members that gives permissions on specified repositories. +type Team 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 property + description *string + // The html_url property + html_url *string + // The id property + id *int32 + // The members_url property + members_url *string + // The name property + name *string + // The node_id property + node_id *string + // The notification_setting property + notification_setting *string + // Groups of organization members that gives permissions on specified repositories. + parent NullableTeamSimpleable + // The permission property + permission *string + // The permissions property + permissions Team_permissionsable + // The privacy property + privacy *string + // The repositories_url property + repositories_url *string + // The slug property + slug *string + // The url property + url *string +} +// NewTeam instantiates a new Team and sets the default values. +func NewTeam()(*Team) { + m := &Team{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeam(), 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 *Team) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *Team) 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 *Team) 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["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationSetting(val) + } + return nil + } + res["parent"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableTeamSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParent(val.(NullableTeamSimpleable)) + } + return nil + } + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeam_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(Team_permissionsable)) + } + return nil + } + res["privacy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivacy(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Team) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Team) GetId()(*int32) { + return m.id +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *Team) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Team) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Team) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationSetting gets the notification_setting property value. The notification_setting property +// returns a *string when successful +func (m *Team) GetNotificationSetting()(*string) { + return m.notification_setting +} +// GetParent gets the parent property value. Groups of organization members that gives permissions on specified repositories. +// returns a NullableTeamSimpleable when successful +func (m *Team) GetParent()(NullableTeamSimpleable) { + return m.parent +} +// GetPermission gets the permission property value. The permission property +// returns a *string when successful +func (m *Team) GetPermission()(*string) { + return m.permission +} +// GetPermissions gets the permissions property value. The permissions property +// returns a Team_permissionsable when successful +func (m *Team) GetPermissions()(Team_permissionsable) { + return m.permissions +} +// GetPrivacy gets the privacy property value. The privacy property +// returns a *string when successful +func (m *Team) GetPrivacy()(*string) { + return m.privacy +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *Team) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *Team) GetSlug()(*string) { + return m.slug +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Team) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Team) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_setting", m.GetNotificationSetting()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("parent", m.GetParent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("privacy", m.GetPrivacy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Team) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description property +func (m *Team) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Team) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Team) SetId(value *int32)() { + m.id = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *Team) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. The name property +func (m *Team) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Team) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationSetting sets the notification_setting property value. The notification_setting property +func (m *Team) SetNotificationSetting(value *string)() { + m.notification_setting = value +} +// SetParent sets the parent property value. Groups of organization members that gives permissions on specified repositories. +func (m *Team) SetParent(value NullableTeamSimpleable)() { + m.parent = value +} +// SetPermission sets the permission property value. The permission property +func (m *Team) SetPermission(value *string)() { + m.permission = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *Team) SetPermissions(value Team_permissionsable)() { + m.permissions = value +} +// SetPrivacy sets the privacy property value. The privacy property +func (m *Team) SetPrivacy(value *string)() { + m.privacy = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *Team) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetSlug sets the slug property value. The slug property +func (m *Team) SetSlug(value *string)() { + m.slug = value +} +// SetUrl sets the url property value. The url property +func (m *Team) SetUrl(value *string)() { + m.url = value +} +type Teamable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationSetting()(*string) + GetParent()(NullableTeamSimpleable) + GetPermission()(*string) + GetPermissions()(Team_permissionsable) + GetPrivacy()(*string) + GetRepositoriesUrl()(*string) + GetSlug()(*string) + GetUrl()(*string) + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationSetting(value *string)() + SetParent(value NullableTeamSimpleable)() + SetPermission(value *string)() + SetPermissions(value Team_permissionsable)() + SetPrivacy(value *string)() + SetRepositoriesUrl(value *string)() + SetSlug(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/team_discussion.go b/pkg/github/models/team_discussion.go new file mode 100644 index 00000000..1ee99716 --- /dev/null +++ b/pkg/github/models/team_discussion.go @@ -0,0 +1,575 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamDiscussion a team discussion is a persistent record of a free-form conversation within a team. +type TeamDiscussion 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 GitHub user. + author NullableSimpleUserable + // The main text of the discussion. + body *string + // The body_html property + body_html *string + // The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. + body_version *string + // The comments_count property + comments_count *int32 + // The comments_url property + comments_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // The last_edited_at property + last_edited_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The node_id property + node_id *string + // The unique sequence number of a team discussion. + number *int32 + // Whether or not this discussion should be pinned for easy retrieval. + pinned *bool + // Whether or not this discussion should be restricted to team members and organization owners. + private *bool + // The reactions property + reactions ReactionRollupable + // The team_url property + team_url *string + // The title of the discussion. + title *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewTeamDiscussion instantiates a new TeamDiscussion and sets the default values. +func NewTeamDiscussion()(*TeamDiscussion) { + m := &TeamDiscussion{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamDiscussionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamDiscussionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamDiscussion(), 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 *TeamDiscussion) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *TeamDiscussion) GetAuthor()(NullableSimpleUserable) { + return m.author +} +// GetBody gets the body property value. The main text of the discussion. +// returns a *string when successful +func (m *TeamDiscussion) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *TeamDiscussion) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyVersion gets the body_version property value. The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. +// returns a *string when successful +func (m *TeamDiscussion) GetBodyVersion()(*string) { + return m.body_version +} +// GetCommentsCount gets the comments_count property value. The comments_count property +// returns a *int32 when successful +func (m *TeamDiscussion) GetCommentsCount()(*int32) { + return m.comments_count +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *TeamDiscussion) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *TeamDiscussion) 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 *TeamDiscussion) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(NullableSimpleUserable)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyVersion(val) + } + return nil + } + res["comments_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCommentsCount(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + 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["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["last_edited_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastEditedAt(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["pinned"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPinned(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + return nil + } + res["team_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamUrl(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamDiscussion) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLastEditedAt gets the last_edited_at property value. The last_edited_at property +// returns a *Time when successful +func (m *TeamDiscussion) GetLastEditedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_edited_at +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamDiscussion) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The unique sequence number of a team discussion. +// returns a *int32 when successful +func (m *TeamDiscussion) GetNumber()(*int32) { + return m.number +} +// GetPinned gets the pinned property value. Whether or not this discussion should be pinned for easy retrieval. +// returns a *bool when successful +func (m *TeamDiscussion) GetPinned()(*bool) { + return m.pinned +} +// GetPrivate gets the private property value. Whether or not this discussion should be restricted to team members and organization owners. +// returns a *bool when successful +func (m *TeamDiscussion) GetPrivate()(*bool) { + return m.private +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *TeamDiscussion) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetTeamUrl gets the team_url property value. The team_url property +// returns a *string when successful +func (m *TeamDiscussion) GetTeamUrl()(*string) { + return m.team_url +} +// GetTitle gets the title property value. The title of the discussion. +// returns a *string when successful +func (m *TeamDiscussion) GetTitle()(*string) { + return m.title +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TeamDiscussion) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TeamDiscussion) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TeamDiscussion) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_version", m.GetBodyVersion()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("comments_count", m.GetCommentsCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("last_edited_at", m.GetLastEditedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pinned", m.GetPinned()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("team_url", m.GetTeamUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TeamDiscussion) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. A GitHub user. +func (m *TeamDiscussion) SetAuthor(value NullableSimpleUserable)() { + m.author = value +} +// SetBody sets the body property value. The main text of the discussion. +func (m *TeamDiscussion) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *TeamDiscussion) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyVersion sets the body_version property value. The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. +func (m *TeamDiscussion) SetBodyVersion(value *string)() { + m.body_version = value +} +// SetCommentsCount sets the comments_count property value. The comments_count property +func (m *TeamDiscussion) SetCommentsCount(value *int32)() { + m.comments_count = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *TeamDiscussion) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TeamDiscussion) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamDiscussion) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLastEditedAt sets the last_edited_at property value. The last_edited_at property +func (m *TeamDiscussion) SetLastEditedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_edited_at = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamDiscussion) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The unique sequence number of a team discussion. +func (m *TeamDiscussion) SetNumber(value *int32)() { + m.number = value +} +// SetPinned sets the pinned property value. Whether or not this discussion should be pinned for easy retrieval. +func (m *TeamDiscussion) SetPinned(value *bool)() { + m.pinned = value +} +// SetPrivate sets the private property value. Whether or not this discussion should be restricted to team members and organization owners. +func (m *TeamDiscussion) SetPrivate(value *bool)() { + m.private = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *TeamDiscussion) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetTeamUrl sets the team_url property value. The team_url property +func (m *TeamDiscussion) SetTeamUrl(value *string)() { + m.team_url = value +} +// SetTitle sets the title property value. The title of the discussion. +func (m *TeamDiscussion) SetTitle(value *string)() { + m.title = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TeamDiscussion) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *TeamDiscussion) SetUrl(value *string)() { + m.url = value +} +type TeamDiscussionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(NullableSimpleUserable) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyVersion()(*string) + GetCommentsCount()(*int32) + GetCommentsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetLastEditedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetNodeId()(*string) + GetNumber()(*int32) + GetPinned()(*bool) + GetPrivate()(*bool) + GetReactions()(ReactionRollupable) + GetTeamUrl()(*string) + GetTitle()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAuthor(value NullableSimpleUserable)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyVersion(value *string)() + SetCommentsCount(value *int32)() + SetCommentsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetLastEditedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetPinned(value *bool)() + SetPrivate(value *bool)() + SetReactions(value ReactionRollupable)() + SetTeamUrl(value *string)() + SetTitle(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/team_discussion_comment.go b/pkg/github/models/team_discussion_comment.go new file mode 100644 index 00000000..660d75ed --- /dev/null +++ b/pkg/github/models/team_discussion_comment.go @@ -0,0 +1,430 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamDiscussionComment a reply to a discussion within a team. +type TeamDiscussionComment 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 GitHub user. + author NullableSimpleUserable + // The main text of the comment. + body *string + // The body_html property + body_html *string + // The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. + body_version *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The discussion_url property + discussion_url *string + // The html_url property + html_url *string + // The last_edited_at property + last_edited_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The node_id property + node_id *string + // The unique sequence number of a team discussion comment. + number *int32 + // The reactions property + reactions ReactionRollupable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewTeamDiscussionComment instantiates a new TeamDiscussionComment and sets the default values. +func NewTeamDiscussionComment()(*TeamDiscussionComment) { + m := &TeamDiscussionComment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamDiscussionCommentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamDiscussionCommentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamDiscussionComment(), 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 *TeamDiscussionComment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *TeamDiscussionComment) GetAuthor()(NullableSimpleUserable) { + return m.author +} +// GetBody gets the body property value. The main text of the comment. +// returns a *string when successful +func (m *TeamDiscussionComment) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *TeamDiscussionComment) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyVersion gets the body_version property value. The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. +// returns a *string when successful +func (m *TeamDiscussionComment) GetBodyVersion()(*string) { + return m.body_version +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *TeamDiscussionComment) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDiscussionUrl gets the discussion_url property value. The discussion_url property +// returns a *string when successful +func (m *TeamDiscussionComment) GetDiscussionUrl()(*string) { + return m.discussion_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamDiscussionComment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(NullableSimpleUserable)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyVersion(val) + } + return nil + } + 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["discussion_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDiscussionUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["last_edited_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastEditedAt(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamDiscussionComment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetLastEditedAt gets the last_edited_at property value. The last_edited_at property +// returns a *Time when successful +func (m *TeamDiscussionComment) GetLastEditedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_edited_at +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamDiscussionComment) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The unique sequence number of a team discussion comment. +// returns a *int32 when successful +func (m *TeamDiscussionComment) GetNumber()(*int32) { + return m.number +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *TeamDiscussionComment) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TeamDiscussionComment) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TeamDiscussionComment) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TeamDiscussionComment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_version", m.GetBodyVersion()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("discussion_url", m.GetDiscussionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("last_edited_at", m.GetLastEditedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TeamDiscussionComment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. A GitHub user. +func (m *TeamDiscussionComment) SetAuthor(value NullableSimpleUserable)() { + m.author = value +} +// SetBody sets the body property value. The main text of the comment. +func (m *TeamDiscussionComment) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *TeamDiscussionComment) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyVersion sets the body_version property value. The current version of the body content. If provided, this update operation will be rejected if the given version does not match the latest version on the server. +func (m *TeamDiscussionComment) SetBodyVersion(value *string)() { + m.body_version = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TeamDiscussionComment) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDiscussionUrl sets the discussion_url property value. The discussion_url property +func (m *TeamDiscussionComment) SetDiscussionUrl(value *string)() { + m.discussion_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamDiscussionComment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetLastEditedAt sets the last_edited_at property value. The last_edited_at property +func (m *TeamDiscussionComment) SetLastEditedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_edited_at = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamDiscussionComment) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The unique sequence number of a team discussion comment. +func (m *TeamDiscussionComment) SetNumber(value *int32)() { + m.number = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *TeamDiscussionComment) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TeamDiscussionComment) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *TeamDiscussionComment) SetUrl(value *string)() { + m.url = value +} +type TeamDiscussionCommentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(NullableSimpleUserable) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyVersion()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDiscussionUrl()(*string) + GetHtmlUrl()(*string) + GetLastEditedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetNodeId()(*string) + GetNumber()(*int32) + GetReactions()(ReactionRollupable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAuthor(value NullableSimpleUserable)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyVersion(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDiscussionUrl(value *string)() + SetHtmlUrl(value *string)() + SetLastEditedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetReactions(value ReactionRollupable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/team_escaped_permissions.go b/pkg/github/models/team_escaped_permissions.go new file mode 100644 index 00000000..22127e9f --- /dev/null +++ b/pkg/github/models/team_escaped_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Team_permissions 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 admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewTeam_permissions instantiates a new Team_permissions and sets the default values. +func NewTeam_permissions()(*Team_permissions) { + m := &Team_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeam_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeam_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeam_permissions(), 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 *Team_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *Team_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Team_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *Team_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *Team_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *Team_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *Team_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *Team_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *Team_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *Team_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *Team_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *Team_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *Team_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *Team_permissions) SetTriage(value *bool)() { + m.triage = value +} +type Team_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/pkg/github/models/team_full.go b/pkg/github/models/team_full.go new file mode 100644 index 00000000..26cbb656 --- /dev/null +++ b/pkg/github/models/team_full.go @@ -0,0 +1,606 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamFull groups of organization members that gives permissions on specified repositories. +type TeamFull 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 description property + description *string + // The html_url property + html_url *string + // Unique identifier of the team + id *int32 + // Distinguished Name (DN) that team maps to within LDAP environment + ldap_dn *string + // The members_count property + members_count *int32 + // The members_url property + members_url *string + // Name of the team + name *string + // The node_id property + node_id *string + // The notification setting the team has set + notification_setting *TeamFull_notification_setting + // Team Organization + organization TeamOrganizationable + // Groups of organization members that gives permissions on specified repositories. + parent NullableTeamSimpleable + // Permission that the team will have for its repositories + permission *string + // The level of privacy this team should have + privacy *TeamFull_privacy + // The repos_count property + repos_count *int32 + // The repositories_url property + repositories_url *string + // The slug property + slug *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // URL for the team + url *string +} +// NewTeamFull instantiates a new TeamFull and sets the default values. +func NewTeamFull()(*TeamFull) { + m := &TeamFull{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamFullFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamFullFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamFull(), 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 *TeamFull) 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 *TeamFull) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *TeamFull) 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 *TeamFull) 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["description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDescription(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["ldap_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLdapDn(val) + } + return nil + } + res["members_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetMembersCount(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseTeamFull_notification_setting) + if err != nil { + return err + } + if val != nil { + m.SetNotificationSetting(val.(*TeamFull_notification_setting)) + } + return nil + } + res["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamOrganizationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val.(TeamOrganizationable)) + } + return nil + } + res["parent"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableTeamSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParent(val.(NullableTeamSimpleable)) + } + return nil + } + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["privacy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseTeamFull_privacy) + if err != nil { + return err + } + if val != nil { + m.SetPrivacy(val.(*TeamFull_privacy)) + } + return nil + } + res["repos_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetReposCount(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamFull) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the team +// returns a *int32 when successful +func (m *TeamFull) GetId()(*int32) { + return m.id +} +// GetLdapDn gets the ldap_dn property value. Distinguished Name (DN) that team maps to within LDAP environment +// returns a *string when successful +func (m *TeamFull) GetLdapDn()(*string) { + return m.ldap_dn +} +// GetMembersCount gets the members_count property value. The members_count property +// returns a *int32 when successful +func (m *TeamFull) GetMembersCount()(*int32) { + return m.members_count +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *TeamFull) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. Name of the team +// returns a *string when successful +func (m *TeamFull) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamFull) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationSetting gets the notification_setting property value. The notification setting the team has set +// returns a *TeamFull_notification_setting when successful +func (m *TeamFull) GetNotificationSetting()(*TeamFull_notification_setting) { + return m.notification_setting +} +// GetOrganization gets the organization property value. Team Organization +// returns a TeamOrganizationable when successful +func (m *TeamFull) GetOrganization()(TeamOrganizationable) { + return m.organization +} +// GetParent gets the parent property value. Groups of organization members that gives permissions on specified repositories. +// returns a NullableTeamSimpleable when successful +func (m *TeamFull) GetParent()(NullableTeamSimpleable) { + return m.parent +} +// GetPermission gets the permission property value. Permission that the team will have for its repositories +// returns a *string when successful +func (m *TeamFull) GetPermission()(*string) { + return m.permission +} +// GetPrivacy gets the privacy property value. The level of privacy this team should have +// returns a *TeamFull_privacy when successful +func (m *TeamFull) GetPrivacy()(*TeamFull_privacy) { + return m.privacy +} +// GetReposCount gets the repos_count property value. The repos_count property +// returns a *int32 when successful +func (m *TeamFull) GetReposCount()(*int32) { + return m.repos_count +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *TeamFull) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *TeamFull) GetSlug()(*string) { + return m.slug +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TeamFull) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. URL for the team +// returns a *string when successful +func (m *TeamFull) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TeamFull) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ldap_dn", m.GetLdapDn()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("members_count", m.GetMembersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetNotificationSetting() != nil { + cast := (*m.GetNotificationSetting()).String() + err := writer.WriteStringValue("notification_setting", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("organization", m.GetOrganization()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("parent", m.GetParent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + if m.GetPrivacy() != nil { + cast := (*m.GetPrivacy()).String() + err := writer.WriteStringValue("privacy", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repos_count", m.GetReposCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TeamFull) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TeamFull) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDescription sets the description property value. The description property +func (m *TeamFull) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamFull) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the team +func (m *TeamFull) SetId(value *int32)() { + m.id = value +} +// SetLdapDn sets the ldap_dn property value. Distinguished Name (DN) that team maps to within LDAP environment +func (m *TeamFull) SetLdapDn(value *string)() { + m.ldap_dn = value +} +// SetMembersCount sets the members_count property value. The members_count property +func (m *TeamFull) SetMembersCount(value *int32)() { + m.members_count = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *TeamFull) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. Name of the team +func (m *TeamFull) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamFull) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationSetting sets the notification_setting property value. The notification setting the team has set +func (m *TeamFull) SetNotificationSetting(value *TeamFull_notification_setting)() { + m.notification_setting = value +} +// SetOrganization sets the organization property value. Team Organization +func (m *TeamFull) SetOrganization(value TeamOrganizationable)() { + m.organization = value +} +// SetParent sets the parent property value. Groups of organization members that gives permissions on specified repositories. +func (m *TeamFull) SetParent(value NullableTeamSimpleable)() { + m.parent = value +} +// SetPermission sets the permission property value. Permission that the team will have for its repositories +func (m *TeamFull) SetPermission(value *string)() { + m.permission = value +} +// SetPrivacy sets the privacy property value. The level of privacy this team should have +func (m *TeamFull) SetPrivacy(value *TeamFull_privacy)() { + m.privacy = value +} +// SetReposCount sets the repos_count property value. The repos_count property +func (m *TeamFull) SetReposCount(value *int32)() { + m.repos_count = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *TeamFull) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetSlug sets the slug property value. The slug property +func (m *TeamFull) SetSlug(value *string)() { + m.slug = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TeamFull) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. URL for the team +func (m *TeamFull) SetUrl(value *string)() { + m.url = value +} +type TeamFullable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLdapDn()(*string) + GetMembersCount()(*int32) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationSetting()(*TeamFull_notification_setting) + GetOrganization()(TeamOrganizationable) + GetParent()(NullableTeamSimpleable) + GetPermission()(*string) + GetPrivacy()(*TeamFull_privacy) + GetReposCount()(*int32) + GetRepositoriesUrl()(*string) + GetSlug()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLdapDn(value *string)() + SetMembersCount(value *int32)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationSetting(value *TeamFull_notification_setting)() + SetOrganization(value TeamOrganizationable)() + SetParent(value NullableTeamSimpleable)() + SetPermission(value *string)() + SetPrivacy(value *TeamFull_privacy)() + SetReposCount(value *int32)() + SetRepositoriesUrl(value *string)() + SetSlug(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/team_full_escaped_notification_escaped_setting.go b/pkg/github/models/team_full_escaped_notification_escaped_setting.go new file mode 100644 index 00000000..d8d0c92b --- /dev/null +++ b/pkg/github/models/team_full_escaped_notification_escaped_setting.go @@ -0,0 +1,34 @@ +package models +// The notification setting the team has set +type TeamFull_notification_setting int + +const ( + NOTIFICATIONS_ENABLED_TEAMFULL_NOTIFICATION_SETTING TeamFull_notification_setting = iota + NOTIFICATIONS_DISABLED_TEAMFULL_NOTIFICATION_SETTING +) + +func (i TeamFull_notification_setting) String() string { + return []string{"notifications_enabled", "notifications_disabled"}[i] +} +func ParseTeamFull_notification_setting(v string) (any, error) { + result := NOTIFICATIONS_ENABLED_TEAMFULL_NOTIFICATION_SETTING + switch v { + case "notifications_enabled": + result = NOTIFICATIONS_ENABLED_TEAMFULL_NOTIFICATION_SETTING + case "notifications_disabled": + result = NOTIFICATIONS_DISABLED_TEAMFULL_NOTIFICATION_SETTING + default: + return nil, nil + } + return &result, nil +} +func SerializeTeamFull_notification_setting(values []TeamFull_notification_setting) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i TeamFull_notification_setting) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/team_full_escaped_privacy.go b/pkg/github/models/team_full_escaped_privacy.go new file mode 100644 index 00000000..5114ae48 --- /dev/null +++ b/pkg/github/models/team_full_escaped_privacy.go @@ -0,0 +1,34 @@ +package models +// The level of privacy this team should have +type TeamFull_privacy int + +const ( + CLOSED_TEAMFULL_PRIVACY TeamFull_privacy = iota + SECRET_TEAMFULL_PRIVACY +) + +func (i TeamFull_privacy) String() string { + return []string{"closed", "secret"}[i] +} +func ParseTeamFull_privacy(v string) (any, error) { + result := CLOSED_TEAMFULL_PRIVACY + switch v { + case "closed": + result = CLOSED_TEAMFULL_PRIVACY + case "secret": + result = SECRET_TEAMFULL_PRIVACY + default: + return nil, nil + } + return &result, nil +} +func SerializeTeamFull_privacy(values []TeamFull_privacy) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i TeamFull_privacy) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/team_membership.go b/pkg/github/models/team_membership.go new file mode 100644 index 00000000..8f5bdf01 --- /dev/null +++ b/pkg/github/models/team_membership.go @@ -0,0 +1,143 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamMembership team Membership +type TeamMembership 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 role of the user in the team. + role *TeamMembership_role + // The state of the user's membership in the team. + state *TeamMembership_state + // The url property + url *string +} +// NewTeamMembership instantiates a new TeamMembership and sets the default values. +func NewTeamMembership()(*TeamMembership) { + m := &TeamMembership{ + } + m.SetAdditionalData(make(map[string]any)) + roleValue := MEMBER_TEAMMEMBERSHIP_ROLE + m.SetRole(&roleValue) + return m +} +// CreateTeamMembershipFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamMembershipFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamMembership(), 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 *TeamMembership) 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 *TeamMembership) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["role"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseTeamMembership_role) + if err != nil { + return err + } + if val != nil { + m.SetRole(val.(*TeamMembership_role)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseTeamMembership_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*TeamMembership_state)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetRole gets the role property value. The role of the user in the team. +// returns a *TeamMembership_role when successful +func (m *TeamMembership) GetRole()(*TeamMembership_role) { + return m.role +} +// GetState gets the state property value. The state of the user's membership in the team. +// returns a *TeamMembership_state when successful +func (m *TeamMembership) GetState()(*TeamMembership_state) { + return m.state +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TeamMembership) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TeamMembership) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRole() != nil { + cast := (*m.GetRole()).String() + err := writer.WriteStringValue("role", &cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TeamMembership) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRole sets the role property value. The role of the user in the team. +func (m *TeamMembership) SetRole(value *TeamMembership_role)() { + m.role = value +} +// SetState sets the state property value. The state of the user's membership in the team. +func (m *TeamMembership) SetState(value *TeamMembership_state)() { + m.state = value +} +// SetUrl sets the url property value. The url property +func (m *TeamMembership) SetUrl(value *string)() { + m.url = value +} +type TeamMembershipable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRole()(*TeamMembership_role) + GetState()(*TeamMembership_state) + GetUrl()(*string) + SetRole(value *TeamMembership_role)() + SetState(value *TeamMembership_state)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/team_membership_escaped_role.go b/pkg/github/models/team_membership_escaped_role.go new file mode 100644 index 00000000..b23d6953 --- /dev/null +++ b/pkg/github/models/team_membership_escaped_role.go @@ -0,0 +1,34 @@ +package models +// The role of the user in the team. +type TeamMembership_role int + +const ( + MEMBER_TEAMMEMBERSHIP_ROLE TeamMembership_role = iota + MAINTAINER_TEAMMEMBERSHIP_ROLE +) + +func (i TeamMembership_role) String() string { + return []string{"member", "maintainer"}[i] +} +func ParseTeamMembership_role(v string) (any, error) { + result := MEMBER_TEAMMEMBERSHIP_ROLE + switch v { + case "member": + result = MEMBER_TEAMMEMBERSHIP_ROLE + case "maintainer": + result = MAINTAINER_TEAMMEMBERSHIP_ROLE + default: + return nil, nil + } + return &result, nil +} +func SerializeTeamMembership_role(values []TeamMembership_role) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i TeamMembership_role) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/team_membership_escaped_state.go b/pkg/github/models/team_membership_escaped_state.go new file mode 100644 index 00000000..c1e6f4e5 --- /dev/null +++ b/pkg/github/models/team_membership_escaped_state.go @@ -0,0 +1,34 @@ +package models +// The state of the user's membership in the team. +type TeamMembership_state int + +const ( + ACTIVE_TEAMMEMBERSHIP_STATE TeamMembership_state = iota + PENDING_TEAMMEMBERSHIP_STATE +) + +func (i TeamMembership_state) String() string { + return []string{"active", "pending"}[i] +} +func ParseTeamMembership_state(v string) (any, error) { + result := ACTIVE_TEAMMEMBERSHIP_STATE + switch v { + case "active": + result = ACTIVE_TEAMMEMBERSHIP_STATE + case "pending": + result = PENDING_TEAMMEMBERSHIP_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeTeamMembership_state(values []TeamMembership_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i TeamMembership_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/team_organization.go b/pkg/github/models/team_organization.go new file mode 100644 index 00000000..439df771 --- /dev/null +++ b/pkg/github/models/team_organization.go @@ -0,0 +1,1474 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamOrganization team Organization +type TeamOrganization 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 archived_at property + archived_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The avatar_url property + avatar_url *string + // The billing_email property + billing_email *string + // The blog property + blog *string + // The collaborators property + collaborators *int32 + // The company property + company *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default_repository_permission property + default_repository_permission *string + // The description property + description *string + // The disk_usage property + disk_usage *int32 + // The email property + email *string + // The events_url property + events_url *string + // The followers property + followers *int32 + // The following property + following *int32 + // The has_organization_projects property + has_organization_projects *bool + // The has_repository_projects property + has_repository_projects *bool + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // The id property + id *int32 + // The is_verified property + is_verified *bool + // The issues_url property + issues_url *string + // The location property + location *string + // The login property + login *string + // The members_allowed_repository_creation_type property + members_allowed_repository_creation_type *string + // The members_can_create_internal_repositories property + members_can_create_internal_repositories *bool + // The members_can_create_pages property + members_can_create_pages *bool + // The members_can_create_private_pages property + members_can_create_private_pages *bool + // The members_can_create_private_repositories property + members_can_create_private_repositories *bool + // The members_can_create_public_pages property + members_can_create_public_pages *bool + // The members_can_create_public_repositories property + members_can_create_public_repositories *bool + // The members_can_create_repositories property + members_can_create_repositories *bool + // The members_can_fork_private_repositories property + members_can_fork_private_repositories *bool + // The members_url property + members_url *string + // The name property + name *string + // The node_id property + node_id *string + // The owned_private_repos property + owned_private_repos *int32 + // The plan property + plan TeamOrganization_planable + // The private_gists property + private_gists *int32 + // The public_gists property + public_gists *int32 + // The public_members_url property + public_members_url *string + // The public_repos property + public_repos *int32 + // The repos_url property + repos_url *string + // The total_private_repos property + total_private_repos *int32 + // The twitter_username property + twitter_username *string + // The two_factor_requirement_enabled property + two_factor_requirement_enabled *bool + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The web_commit_signoff_required property + web_commit_signoff_required *bool +} +// NewTeamOrganization instantiates a new TeamOrganization and sets the default values. +func NewTeamOrganization()(*TeamOrganization) { + m := &TeamOrganization{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamOrganizationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamOrganizationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamOrganization(), 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 *TeamOrganization) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchivedAt gets the archived_at property value. The archived_at property +// returns a *Time when successful +func (m *TeamOrganization) GetArchivedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.archived_at +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *TeamOrganization) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetBillingEmail gets the billing_email property value. The billing_email property +// returns a *string when successful +func (m *TeamOrganization) GetBillingEmail()(*string) { + return m.billing_email +} +// GetBlog gets the blog property value. The blog property +// returns a *string when successful +func (m *TeamOrganization) GetBlog()(*string) { + return m.blog +} +// GetCollaborators gets the collaborators property value. The collaborators property +// returns a *int32 when successful +func (m *TeamOrganization) GetCollaborators()(*int32) { + return m.collaborators +} +// GetCompany gets the company property value. The company property +// returns a *string when successful +func (m *TeamOrganization) GetCompany()(*string) { + return m.company +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *TeamOrganization) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultRepositoryPermission gets the default_repository_permission property value. The default_repository_permission property +// returns a *string when successful +func (m *TeamOrganization) GetDefaultRepositoryPermission()(*string) { + return m.default_repository_permission +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *TeamOrganization) GetDescription()(*string) { + return m.description +} +// GetDiskUsage gets the disk_usage property value. The disk_usage property +// returns a *int32 when successful +func (m *TeamOrganization) GetDiskUsage()(*int32) { + return m.disk_usage +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *TeamOrganization) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *TeamOrganization) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamOrganization) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["archived_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetArchivedAt(val) + } + return nil + } + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["billing_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBillingEmail(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["collaborators"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCollaborators(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + 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["default_repository_permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultRepositoryPermission(val) + } + 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["disk_usage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetDiskUsage(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowers(val) + } + return nil + } + res["following"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowing(val) + } + return nil + } + res["has_organization_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasOrganizationProjects(val) + } + return nil + } + res["has_repository_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasRepositoryProjects(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsVerified(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(val) + } + return nil + } + res["members_allowed_repository_creation_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersAllowedRepositoryCreationType(val) + } + return nil + } + res["members_can_create_internal_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreateInternalRepositories(val) + } + return nil + } + res["members_can_create_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePages(val) + } + return nil + } + res["members_can_create_private_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePrivatePages(val) + } + return nil + } + res["members_can_create_private_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePrivateRepositories(val) + } + return nil + } + res["members_can_create_public_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePublicPages(val) + } + return nil + } + res["members_can_create_public_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePublicRepositories(val) + } + return nil + } + res["members_can_create_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreateRepositories(val) + } + return nil + } + res["members_can_fork_private_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanForkPrivateRepositories(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["owned_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOwnedPrivateRepos(val) + } + return nil + } + res["plan"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamOrganization_planFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPlan(val.(TeamOrganization_planable)) + } + return nil + } + res["private_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateGists(val) + } + return nil + } + res["public_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicGists(val) + } + return nil + } + res["public_members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPublicMembersUrl(val) + } + return nil + } + res["public_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicRepos(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["total_private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalPrivateRepos(val) + } + return nil + } + res["twitter_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTwitterUsername(val) + } + return nil + } + res["two_factor_requirement_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTwoFactorRequirementEnabled(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFollowers gets the followers property value. The followers property +// returns a *int32 when successful +func (m *TeamOrganization) GetFollowers()(*int32) { + return m.followers +} +// GetFollowing gets the following property value. The following property +// returns a *int32 when successful +func (m *TeamOrganization) GetFollowing()(*int32) { + return m.following +} +// GetHasOrganizationProjects gets the has_organization_projects property value. The has_organization_projects property +// returns a *bool when successful +func (m *TeamOrganization) GetHasOrganizationProjects()(*bool) { + return m.has_organization_projects +} +// GetHasRepositoryProjects gets the has_repository_projects property value. The has_repository_projects property +// returns a *bool when successful +func (m *TeamOrganization) GetHasRepositoryProjects()(*bool) { + return m.has_repository_projects +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *TeamOrganization) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamOrganization) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TeamOrganization) GetId()(*int32) { + return m.id +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *TeamOrganization) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsVerified gets the is_verified property value. The is_verified property +// returns a *bool when successful +func (m *TeamOrganization) GetIsVerified()(*bool) { + return m.is_verified +} +// GetLocation gets the location property value. The location property +// returns a *string when successful +func (m *TeamOrganization) GetLocation()(*string) { + return m.location +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *TeamOrganization) GetLogin()(*string) { + return m.login +} +// GetMembersAllowedRepositoryCreationType gets the members_allowed_repository_creation_type property value. The members_allowed_repository_creation_type property +// returns a *string when successful +func (m *TeamOrganization) GetMembersAllowedRepositoryCreationType()(*string) { + return m.members_allowed_repository_creation_type +} +// GetMembersCanCreateInternalRepositories gets the members_can_create_internal_repositories property value. The members_can_create_internal_repositories property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanCreateInternalRepositories()(*bool) { + return m.members_can_create_internal_repositories +} +// GetMembersCanCreatePages gets the members_can_create_pages property value. The members_can_create_pages property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanCreatePages()(*bool) { + return m.members_can_create_pages +} +// GetMembersCanCreatePrivatePages gets the members_can_create_private_pages property value. The members_can_create_private_pages property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanCreatePrivatePages()(*bool) { + return m.members_can_create_private_pages +} +// GetMembersCanCreatePrivateRepositories gets the members_can_create_private_repositories property value. The members_can_create_private_repositories property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanCreatePrivateRepositories()(*bool) { + return m.members_can_create_private_repositories +} +// GetMembersCanCreatePublicPages gets the members_can_create_public_pages property value. The members_can_create_public_pages property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanCreatePublicPages()(*bool) { + return m.members_can_create_public_pages +} +// GetMembersCanCreatePublicRepositories gets the members_can_create_public_repositories property value. The members_can_create_public_repositories property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanCreatePublicRepositories()(*bool) { + return m.members_can_create_public_repositories +} +// GetMembersCanCreateRepositories gets the members_can_create_repositories property value. The members_can_create_repositories property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanCreateRepositories()(*bool) { + return m.members_can_create_repositories +} +// GetMembersCanForkPrivateRepositories gets the members_can_fork_private_repositories property value. The members_can_fork_private_repositories property +// returns a *bool when successful +func (m *TeamOrganization) GetMembersCanForkPrivateRepositories()(*bool) { + return m.members_can_fork_private_repositories +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *TeamOrganization) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *TeamOrganization) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamOrganization) GetNodeId()(*string) { + return m.node_id +} +// GetOwnedPrivateRepos gets the owned_private_repos property value. The owned_private_repos property +// returns a *int32 when successful +func (m *TeamOrganization) GetOwnedPrivateRepos()(*int32) { + return m.owned_private_repos +} +// GetPlan gets the plan property value. The plan property +// returns a TeamOrganization_planable when successful +func (m *TeamOrganization) GetPlan()(TeamOrganization_planable) { + return m.plan +} +// GetPrivateGists gets the private_gists property value. The private_gists property +// returns a *int32 when successful +func (m *TeamOrganization) GetPrivateGists()(*int32) { + return m.private_gists +} +// GetPublicGists gets the public_gists property value. The public_gists property +// returns a *int32 when successful +func (m *TeamOrganization) GetPublicGists()(*int32) { + return m.public_gists +} +// GetPublicMembersUrl gets the public_members_url property value. The public_members_url property +// returns a *string when successful +func (m *TeamOrganization) GetPublicMembersUrl()(*string) { + return m.public_members_url +} +// GetPublicRepos gets the public_repos property value. The public_repos property +// returns a *int32 when successful +func (m *TeamOrganization) GetPublicRepos()(*int32) { + return m.public_repos +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *TeamOrganization) GetReposUrl()(*string) { + return m.repos_url +} +// GetTotalPrivateRepos gets the total_private_repos property value. The total_private_repos property +// returns a *int32 when successful +func (m *TeamOrganization) GetTotalPrivateRepos()(*int32) { + return m.total_private_repos +} +// GetTwitterUsername gets the twitter_username property value. The twitter_username property +// returns a *string when successful +func (m *TeamOrganization) GetTwitterUsername()(*string) { + return m.twitter_username +} +// GetTwoFactorRequirementEnabled gets the two_factor_requirement_enabled property value. The two_factor_requirement_enabled property +// returns a *bool when successful +func (m *TeamOrganization) GetTwoFactorRequirementEnabled()(*bool) { + return m.two_factor_requirement_enabled +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *TeamOrganization) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TeamOrganization) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TeamOrganization) GetUrl()(*string) { + return m.url +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. The web_commit_signoff_required property +// returns a *bool when successful +func (m *TeamOrganization) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *TeamOrganization) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("archived_at", m.GetArchivedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("billing_email", m.GetBillingEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("collaborators", m.GetCollaborators()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_repository_permission", m.GetDefaultRepositoryPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("disk_usage", m.GetDiskUsage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("followers", m.GetFollowers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("following", m.GetFollowing()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_organization_projects", m.GetHasOrganizationProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_repository_projects", m.GetHasRepositoryProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_verified", m.GetIsVerified()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_allowed_repository_creation_type", m.GetMembersAllowedRepositoryCreationType()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_internal_repositories", m.GetMembersCanCreateInternalRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_pages", m.GetMembersCanCreatePages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_private_pages", m.GetMembersCanCreatePrivatePages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_private_repositories", m.GetMembersCanCreatePrivateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_public_pages", m.GetMembersCanCreatePublicPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_public_repositories", m.GetMembersCanCreatePublicRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_repositories", m.GetMembersCanCreateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_fork_private_repositories", m.GetMembersCanForkPrivateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("owned_private_repos", m.GetOwnedPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("plan", m.GetPlan()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_gists", m.GetPrivateGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_gists", m.GetPublicGists()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("public_members_url", m.GetPublicMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_repos", m.GetPublicRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("total_private_repos", m.GetTotalPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("twitter_username", m.GetTwitterUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("two_factor_requirement_enabled", m.GetTwoFactorRequirementEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *TeamOrganization) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchivedAt sets the archived_at property value. The archived_at property +func (m *TeamOrganization) SetArchivedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.archived_at = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *TeamOrganization) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetBillingEmail sets the billing_email property value. The billing_email property +func (m *TeamOrganization) SetBillingEmail(value *string)() { + m.billing_email = value +} +// SetBlog sets the blog property value. The blog property +func (m *TeamOrganization) SetBlog(value *string)() { + m.blog = value +} +// SetCollaborators sets the collaborators property value. The collaborators property +func (m *TeamOrganization) SetCollaborators(value *int32)() { + m.collaborators = value +} +// SetCompany sets the company property value. The company property +func (m *TeamOrganization) SetCompany(value *string)() { + m.company = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TeamOrganization) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultRepositoryPermission sets the default_repository_permission property value. The default_repository_permission property +func (m *TeamOrganization) SetDefaultRepositoryPermission(value *string)() { + m.default_repository_permission = value +} +// SetDescription sets the description property value. The description property +func (m *TeamOrganization) SetDescription(value *string)() { + m.description = value +} +// SetDiskUsage sets the disk_usage property value. The disk_usage property +func (m *TeamOrganization) SetDiskUsage(value *int32)() { + m.disk_usage = value +} +// SetEmail sets the email property value. The email property +func (m *TeamOrganization) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *TeamOrganization) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowers sets the followers property value. The followers property +func (m *TeamOrganization) SetFollowers(value *int32)() { + m.followers = value +} +// SetFollowing sets the following property value. The following property +func (m *TeamOrganization) SetFollowing(value *int32)() { + m.following = value +} +// SetHasOrganizationProjects sets the has_organization_projects property value. The has_organization_projects property +func (m *TeamOrganization) SetHasOrganizationProjects(value *bool)() { + m.has_organization_projects = value +} +// SetHasRepositoryProjects sets the has_repository_projects property value. The has_repository_projects property +func (m *TeamOrganization) SetHasRepositoryProjects(value *bool)() { + m.has_repository_projects = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *TeamOrganization) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamOrganization) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *TeamOrganization) SetId(value *int32)() { + m.id = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *TeamOrganization) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsVerified sets the is_verified property value. The is_verified property +func (m *TeamOrganization) SetIsVerified(value *bool)() { + m.is_verified = value +} +// SetLocation sets the location property value. The location property +func (m *TeamOrganization) SetLocation(value *string)() { + m.location = value +} +// SetLogin sets the login property value. The login property +func (m *TeamOrganization) SetLogin(value *string)() { + m.login = value +} +// SetMembersAllowedRepositoryCreationType sets the members_allowed_repository_creation_type property value. The members_allowed_repository_creation_type property +func (m *TeamOrganization) SetMembersAllowedRepositoryCreationType(value *string)() { + m.members_allowed_repository_creation_type = value +} +// SetMembersCanCreateInternalRepositories sets the members_can_create_internal_repositories property value. The members_can_create_internal_repositories property +func (m *TeamOrganization) SetMembersCanCreateInternalRepositories(value *bool)() { + m.members_can_create_internal_repositories = value +} +// SetMembersCanCreatePages sets the members_can_create_pages property value. The members_can_create_pages property +func (m *TeamOrganization) SetMembersCanCreatePages(value *bool)() { + m.members_can_create_pages = value +} +// SetMembersCanCreatePrivatePages sets the members_can_create_private_pages property value. The members_can_create_private_pages property +func (m *TeamOrganization) SetMembersCanCreatePrivatePages(value *bool)() { + m.members_can_create_private_pages = value +} +// SetMembersCanCreatePrivateRepositories sets the members_can_create_private_repositories property value. The members_can_create_private_repositories property +func (m *TeamOrganization) SetMembersCanCreatePrivateRepositories(value *bool)() { + m.members_can_create_private_repositories = value +} +// SetMembersCanCreatePublicPages sets the members_can_create_public_pages property value. The members_can_create_public_pages property +func (m *TeamOrganization) SetMembersCanCreatePublicPages(value *bool)() { + m.members_can_create_public_pages = value +} +// SetMembersCanCreatePublicRepositories sets the members_can_create_public_repositories property value. The members_can_create_public_repositories property +func (m *TeamOrganization) SetMembersCanCreatePublicRepositories(value *bool)() { + m.members_can_create_public_repositories = value +} +// SetMembersCanCreateRepositories sets the members_can_create_repositories property value. The members_can_create_repositories property +func (m *TeamOrganization) SetMembersCanCreateRepositories(value *bool)() { + m.members_can_create_repositories = value +} +// SetMembersCanForkPrivateRepositories sets the members_can_fork_private_repositories property value. The members_can_fork_private_repositories property +func (m *TeamOrganization) SetMembersCanForkPrivateRepositories(value *bool)() { + m.members_can_fork_private_repositories = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *TeamOrganization) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. The name property +func (m *TeamOrganization) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamOrganization) SetNodeId(value *string)() { + m.node_id = value +} +// SetOwnedPrivateRepos sets the owned_private_repos property value. The owned_private_repos property +func (m *TeamOrganization) SetOwnedPrivateRepos(value *int32)() { + m.owned_private_repos = value +} +// SetPlan sets the plan property value. The plan property +func (m *TeamOrganization) SetPlan(value TeamOrganization_planable)() { + m.plan = value +} +// SetPrivateGists sets the private_gists property value. The private_gists property +func (m *TeamOrganization) SetPrivateGists(value *int32)() { + m.private_gists = value +} +// SetPublicGists sets the public_gists property value. The public_gists property +func (m *TeamOrganization) SetPublicGists(value *int32)() { + m.public_gists = value +} +// SetPublicMembersUrl sets the public_members_url property value. The public_members_url property +func (m *TeamOrganization) SetPublicMembersUrl(value *string)() { + m.public_members_url = value +} +// SetPublicRepos sets the public_repos property value. The public_repos property +func (m *TeamOrganization) SetPublicRepos(value *int32)() { + m.public_repos = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *TeamOrganization) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetTotalPrivateRepos sets the total_private_repos property value. The total_private_repos property +func (m *TeamOrganization) SetTotalPrivateRepos(value *int32)() { + m.total_private_repos = value +} +// SetTwitterUsername sets the twitter_username property value. The twitter_username property +func (m *TeamOrganization) SetTwitterUsername(value *string)() { + m.twitter_username = value +} +// SetTwoFactorRequirementEnabled sets the two_factor_requirement_enabled property value. The two_factor_requirement_enabled property +func (m *TeamOrganization) SetTwoFactorRequirementEnabled(value *bool)() { + m.two_factor_requirement_enabled = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *TeamOrganization) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TeamOrganization) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *TeamOrganization) SetUrl(value *string)() { + m.url = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. The web_commit_signoff_required property +func (m *TeamOrganization) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type TeamOrganizationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchivedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetAvatarUrl()(*string) + GetBillingEmail()(*string) + GetBlog()(*string) + GetCollaborators()(*int32) + GetCompany()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultRepositoryPermission()(*string) + GetDescription()(*string) + GetDiskUsage()(*int32) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowers()(*int32) + GetFollowing()(*int32) + GetHasOrganizationProjects()(*bool) + GetHasRepositoryProjects()(*bool) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssuesUrl()(*string) + GetIsVerified()(*bool) + GetLocation()(*string) + GetLogin()(*string) + GetMembersAllowedRepositoryCreationType()(*string) + GetMembersCanCreateInternalRepositories()(*bool) + GetMembersCanCreatePages()(*bool) + GetMembersCanCreatePrivatePages()(*bool) + GetMembersCanCreatePrivateRepositories()(*bool) + GetMembersCanCreatePublicPages()(*bool) + GetMembersCanCreatePublicRepositories()(*bool) + GetMembersCanCreateRepositories()(*bool) + GetMembersCanForkPrivateRepositories()(*bool) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOwnedPrivateRepos()(*int32) + GetPlan()(TeamOrganization_planable) + GetPrivateGists()(*int32) + GetPublicGists()(*int32) + GetPublicMembersUrl()(*string) + GetPublicRepos()(*int32) + GetReposUrl()(*string) + GetTotalPrivateRepos()(*int32) + GetTwitterUsername()(*string) + GetTwoFactorRequirementEnabled()(*bool) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetWebCommitSignoffRequired()(*bool) + SetArchivedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetAvatarUrl(value *string)() + SetBillingEmail(value *string)() + SetBlog(value *string)() + SetCollaborators(value *int32)() + SetCompany(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultRepositoryPermission(value *string)() + SetDescription(value *string)() + SetDiskUsage(value *int32)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowers(value *int32)() + SetFollowing(value *int32)() + SetHasOrganizationProjects(value *bool)() + SetHasRepositoryProjects(value *bool)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssuesUrl(value *string)() + SetIsVerified(value *bool)() + SetLocation(value *string)() + SetLogin(value *string)() + SetMembersAllowedRepositoryCreationType(value *string)() + SetMembersCanCreateInternalRepositories(value *bool)() + SetMembersCanCreatePages(value *bool)() + SetMembersCanCreatePrivatePages(value *bool)() + SetMembersCanCreatePrivateRepositories(value *bool)() + SetMembersCanCreatePublicPages(value *bool)() + SetMembersCanCreatePublicRepositories(value *bool)() + SetMembersCanCreateRepositories(value *bool)() + SetMembersCanForkPrivateRepositories(value *bool)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOwnedPrivateRepos(value *int32)() + SetPlan(value TeamOrganization_planable)() + SetPrivateGists(value *int32)() + SetPublicGists(value *int32)() + SetPublicMembersUrl(value *string)() + SetPublicRepos(value *int32)() + SetReposUrl(value *string)() + SetTotalPrivateRepos(value *int32)() + SetTwitterUsername(value *string)() + SetTwoFactorRequirementEnabled(value *bool)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/pkg/github/models/team_organization_escaped_plan.go b/pkg/github/models/team_organization_escaped_plan.go new file mode 100644 index 00000000..774360a9 --- /dev/null +++ b/pkg/github/models/team_organization_escaped_plan.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TeamOrganization_plan 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 filled_seats property + filled_seats *int32 + // The name property + name *string + // The private_repos property + private_repos *int32 + // The seats property + seats *int32 + // The space property + space *int32 +} +// NewTeamOrganization_plan instantiates a new TeamOrganization_plan and sets the default values. +func NewTeamOrganization_plan()(*TeamOrganization_plan) { + m := &TeamOrganization_plan{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamOrganization_planFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamOrganization_planFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamOrganization_plan(), 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 *TeamOrganization_plan) 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 *TeamOrganization_plan) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["filled_seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFilledSeats(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["private_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPrivateRepos(val) + } + return nil + } + res["seats"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSeats(val) + } + return nil + } + res["space"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSpace(val) + } + return nil + } + return res +} +// GetFilledSeats gets the filled_seats property value. The filled_seats property +// returns a *int32 when successful +func (m *TeamOrganization_plan) GetFilledSeats()(*int32) { + return m.filled_seats +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *TeamOrganization_plan) GetName()(*string) { + return m.name +} +// GetPrivateRepos gets the private_repos property value. The private_repos property +// returns a *int32 when successful +func (m *TeamOrganization_plan) GetPrivateRepos()(*int32) { + return m.private_repos +} +// GetSeats gets the seats property value. The seats property +// returns a *int32 when successful +func (m *TeamOrganization_plan) GetSeats()(*int32) { + return m.seats +} +// GetSpace gets the space property value. The space property +// returns a *int32 when successful +func (m *TeamOrganization_plan) GetSpace()(*int32) { + return m.space +} +// Serialize serializes information the current object +func (m *TeamOrganization_plan) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("filled_seats", m.GetFilledSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("private_repos", m.GetPrivateRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("seats", m.GetSeats()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("space", m.GetSpace()) + 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 *TeamOrganization_plan) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFilledSeats sets the filled_seats property value. The filled_seats property +func (m *TeamOrganization_plan) SetFilledSeats(value *int32)() { + m.filled_seats = value +} +// SetName sets the name property value. The name property +func (m *TeamOrganization_plan) SetName(value *string)() { + m.name = value +} +// SetPrivateRepos sets the private_repos property value. The private_repos property +func (m *TeamOrganization_plan) SetPrivateRepos(value *int32)() { + m.private_repos = value +} +// SetSeats sets the seats property value. The seats property +func (m *TeamOrganization_plan) SetSeats(value *int32)() { + m.seats = value +} +// SetSpace sets the space property value. The space property +func (m *TeamOrganization_plan) SetSpace(value *int32)() { + m.space = value +} +type TeamOrganization_planable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFilledSeats()(*int32) + GetName()(*string) + GetPrivateRepos()(*int32) + GetSeats()(*int32) + GetSpace()(*int32) + SetFilledSeats(value *int32)() + SetName(value *string)() + SetPrivateRepos(value *int32)() + SetSeats(value *int32)() + SetSpace(value *int32)() +} diff --git a/pkg/github/models/team_project.go b/pkg/github/models/team_project.go new file mode 100644 index 00000000..df9e7887 --- /dev/null +++ b/pkg/github/models/team_project.go @@ -0,0 +1,516 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamProject a team's access to a project. +type TeamProject 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 body property + body *string + // The columns_url property + columns_url *string + // The created_at property + created_at *string + // A GitHub user. + creator SimpleUserable + // The html_url property + html_url *string + // The id property + id *int32 + // The name property + name *string + // The node_id property + node_id *string + // The number property + number *int32 + // The organization permission for this project. Only present when owner is an organization. + organization_permission *string + // The owner_url property + owner_url *string + // The permissions property + permissions TeamProject_permissionsable + // Whether the project is private or not. Only present when owner is an organization. + private *bool + // The state property + state *string + // The updated_at property + updated_at *string + // The url property + url *string +} +// NewTeamProject instantiates a new TeamProject and sets the default values. +func NewTeamProject()(*TeamProject) { + m := &TeamProject{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamProjectFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamProjectFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamProject(), 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 *TeamProject) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The body property +// returns a *string when successful +func (m *TeamProject) GetBody()(*string) { + return m.body +} +// GetColumnsUrl gets the columns_url property value. The columns_url property +// returns a *string when successful +func (m *TeamProject) GetColumnsUrl()(*string) { + return m.columns_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *TeamProject) GetCreatedAt()(*string) { + return m.created_at +} +// GetCreator gets the creator property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TeamProject) GetCreator()(SimpleUserable) { + return m.creator +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamProject) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["columns_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColumnsUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["creator"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCreator(val.(SimpleUserable)) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNumber(val) + } + return nil + } + res["organization_permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationPermission(val) + } + return nil + } + res["owner_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOwnerUrl(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamProject_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(TeamProject_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamProject) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TeamProject) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *TeamProject) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamProject) GetNodeId()(*string) { + return m.node_id +} +// GetNumber gets the number property value. The number property +// returns a *int32 when successful +func (m *TeamProject) GetNumber()(*int32) { + return m.number +} +// GetOrganizationPermission gets the organization_permission property value. The organization permission for this project. Only present when owner is an organization. +// returns a *string when successful +func (m *TeamProject) GetOrganizationPermission()(*string) { + return m.organization_permission +} +// GetOwnerUrl gets the owner_url property value. The owner_url property +// returns a *string when successful +func (m *TeamProject) GetOwnerUrl()(*string) { + return m.owner_url +} +// GetPermissions gets the permissions property value. The permissions property +// returns a TeamProject_permissionsable when successful +func (m *TeamProject) GetPermissions()(TeamProject_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. Whether the project is private or not. Only present when owner is an organization. +// returns a *bool when successful +func (m *TeamProject) GetPrivate()(*bool) { + return m.private +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *TeamProject) GetState()(*string) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *TeamProject) GetUpdatedAt()(*string) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TeamProject) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TeamProject) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("columns_url", m.GetColumnsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("creator", m.GetCreator()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("number", m.GetNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization_permission", m.GetOrganizationPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("owner_url", m.GetOwnerUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TeamProject) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The body property +func (m *TeamProject) SetBody(value *string)() { + m.body = value +} +// SetColumnsUrl sets the columns_url property value. The columns_url property +func (m *TeamProject) SetColumnsUrl(value *string)() { + m.columns_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TeamProject) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetCreator sets the creator property value. A GitHub user. +func (m *TeamProject) SetCreator(value SimpleUserable)() { + m.creator = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamProject) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *TeamProject) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *TeamProject) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamProject) SetNodeId(value *string)() { + m.node_id = value +} +// SetNumber sets the number property value. The number property +func (m *TeamProject) SetNumber(value *int32)() { + m.number = value +} +// SetOrganizationPermission sets the organization_permission property value. The organization permission for this project. Only present when owner is an organization. +func (m *TeamProject) SetOrganizationPermission(value *string)() { + m.organization_permission = value +} +// SetOwnerUrl sets the owner_url property value. The owner_url property +func (m *TeamProject) SetOwnerUrl(value *string)() { + m.owner_url = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *TeamProject) SetPermissions(value TeamProject_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. Whether the project is private or not. Only present when owner is an organization. +func (m *TeamProject) SetPrivate(value *bool)() { + m.private = value +} +// SetState sets the state property value. The state property +func (m *TeamProject) SetState(value *string)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TeamProject) SetUpdatedAt(value *string)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *TeamProject) SetUrl(value *string)() { + m.url = value +} +type TeamProjectable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetColumnsUrl()(*string) + GetCreatedAt()(*string) + GetCreator()(SimpleUserable) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetNumber()(*int32) + GetOrganizationPermission()(*string) + GetOwnerUrl()(*string) + GetPermissions()(TeamProject_permissionsable) + GetPrivate()(*bool) + GetState()(*string) + GetUpdatedAt()(*string) + GetUrl()(*string) + SetBody(value *string)() + SetColumnsUrl(value *string)() + SetCreatedAt(value *string)() + SetCreator(value SimpleUserable)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetNumber(value *int32)() + SetOrganizationPermission(value *string)() + SetOwnerUrl(value *string)() + SetPermissions(value TeamProject_permissionsable)() + SetPrivate(value *bool)() + SetState(value *string)() + SetUpdatedAt(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/team_project_escaped_permissions.go b/pkg/github/models/team_project_escaped_permissions.go new file mode 100644 index 00000000..bdaed3c3 --- /dev/null +++ b/pkg/github/models/team_project_escaped_permissions.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TeamProject_permissions 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 admin property + admin *bool + // The read property + read *bool + // The write property + write *bool +} +// NewTeamProject_permissions instantiates a new TeamProject_permissions and sets the default values. +func NewTeamProject_permissions()(*TeamProject_permissions) { + m := &TeamProject_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamProject_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamProject_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamProject_permissions(), 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 *TeamProject_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *TeamProject_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamProject_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["read"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRead(val) + } + return nil + } + res["write"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWrite(val) + } + return nil + } + return res +} +// GetRead gets the read property value. The read property +// returns a *bool when successful +func (m *TeamProject_permissions) GetRead()(*bool) { + return m.read +} +// GetWrite gets the write property value. The write property +// returns a *bool when successful +func (m *TeamProject_permissions) GetWrite()(*bool) { + return m.write +} +// Serialize serializes information the current object +func (m *TeamProject_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("read", m.GetRead()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("write", m.GetWrite()) + 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 *TeamProject_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *TeamProject_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetRead sets the read property value. The read property +func (m *TeamProject_permissions) SetRead(value *bool)() { + m.read = value +} +// SetWrite sets the write property value. The write property +func (m *TeamProject_permissions) SetWrite(value *bool)() { + m.write = value +} +type TeamProject_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetRead()(*bool) + GetWrite()(*bool) + SetAdmin(value *bool)() + SetRead(value *bool)() + SetWrite(value *bool)() +} diff --git a/pkg/github/models/team_repository.go b/pkg/github/models/team_repository.go new file mode 100644 index 00000000..c50f114d --- /dev/null +++ b/pkg/github/models/team_repository.go @@ -0,0 +1,2642 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamRepository a team's access to a repository. +type TeamRepository 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 allow Auto-merge to be used on pull requests. + allow_auto_merge *bool + // Whether to allow forking this repo + allow_forking *bool + // Whether to allow merge commits for pull requests. + allow_merge_commit *bool + // Whether to allow rebase merges for pull requests. + allow_rebase_merge *bool + // Whether to allow squash merges for pull requests. + allow_squash_merge *bool + // The archive_url property + archive_url *string + // Whether the repository is archived. + archived *bool + // The assignees_url property + assignees_url *string + // The blobs_url property + blobs_url *string + // The branches_url property + branches_url *string + // The clone_url property + clone_url *string + // The collaborators_url property + collaborators_url *string + // The comments_url property + comments_url *string + // The commits_url property + commits_url *string + // The compare_url property + compare_url *string + // The contents_url property + contents_url *string + // The contributors_url property + contributors_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The default branch of the repository. + default_branch *string + // Whether to delete head branches when pull requests are merged + delete_branch_on_merge *bool + // The deployments_url property + deployments_url *string + // The description property + description *string + // Returns whether or not this repository disabled. + disabled *bool + // The downloads_url property + downloads_url *string + // The events_url property + events_url *string + // The fork property + fork *bool + // The forks property + forks *int32 + // The forks_count property + forks_count *int32 + // The forks_url property + forks_url *string + // The full_name property + full_name *string + // The git_commits_url property + git_commits_url *string + // The git_refs_url property + git_refs_url *string + // The git_tags_url property + git_tags_url *string + // The git_url property + git_url *string + // Whether downloads are enabled. + has_downloads *bool + // Whether issues are enabled. + has_issues *bool + // The has_pages property + has_pages *bool + // Whether projects are enabled. + has_projects *bool + // Whether the wiki is enabled. + has_wiki *bool + // The homepage property + homepage *string + // The hooks_url property + hooks_url *string + // The html_url property + html_url *string + // Unique identifier of the repository + id *int32 + // Whether this repository acts as a template that can be used to generate new repositories. + is_template *bool + // The issue_comment_url property + issue_comment_url *string + // The issue_events_url property + issue_events_url *string + // The issues_url property + issues_url *string + // The keys_url property + keys_url *string + // The labels_url property + labels_url *string + // The language property + language *string + // The languages_url property + languages_url *string + // License Simple + license NullableLicenseSimpleable + // The master_branch property + master_branch *string + // The merges_url property + merges_url *string + // The milestones_url property + milestones_url *string + // The mirror_url property + mirror_url *string + // The name of the repository. + name *string + // The network_count property + network_count *int32 + // The node_id property + node_id *string + // The notifications_url property + notifications_url *string + // The open_issues property + open_issues *int32 + // The open_issues_count property + open_issues_count *int32 + // A GitHub user. + owner NullableSimpleUserable + // The permissions property + permissions TeamRepository_permissionsable + // Whether the repository is private or public. + private *bool + // The pulls_url property + pulls_url *string + // The pushed_at property + pushed_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The releases_url property + releases_url *string + // The role_name property + role_name *string + // The size property + size *int32 + // The ssh_url property + ssh_url *string + // The stargazers_count property + stargazers_count *int32 + // The stargazers_url property + stargazers_url *string + // The statuses_url property + statuses_url *string + // The subscribers_count property + subscribers_count *int32 + // The subscribers_url property + subscribers_url *string + // The subscription_url property + subscription_url *string + // The svn_url property + svn_url *string + // The tags_url property + tags_url *string + // The teams_url property + teams_url *string + // The temp_clone_token property + temp_clone_token *string + // The topics property + topics []string + // The trees_url property + trees_url *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string + // The repository visibility: public, private, or internal. + visibility *string + // The watchers property + watchers *int32 + // The watchers_count property + watchers_count *int32 + // Whether to require contributors to sign off on web-based commits + web_commit_signoff_required *bool +} +// NewTeamRepository instantiates a new TeamRepository and sets the default values. +func NewTeamRepository()(*TeamRepository) { + m := &TeamRepository{ + } + m.SetAdditionalData(make(map[string]any)) + visibilityValue := "public" + m.SetVisibility(&visibilityValue) + return m +} +// CreateTeamRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamRepository(), 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 *TeamRepository) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +// returns a *bool when successful +func (m *TeamRepository) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowForking gets the allow_forking property value. Whether to allow forking this repo +// returns a *bool when successful +func (m *TeamRepository) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +// returns a *bool when successful +func (m *TeamRepository) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +// returns a *bool when successful +func (m *TeamRepository) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +// returns a *bool when successful +func (m *TeamRepository) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetArchived gets the archived property value. Whether the repository is archived. +// returns a *bool when successful +func (m *TeamRepository) GetArchived()(*bool) { + return m.archived +} +// GetArchiveUrl gets the archive_url property value. The archive_url property +// returns a *string when successful +func (m *TeamRepository) GetArchiveUrl()(*string) { + return m.archive_url +} +// GetAssigneesUrl gets the assignees_url property value. The assignees_url property +// returns a *string when successful +func (m *TeamRepository) GetAssigneesUrl()(*string) { + return m.assignees_url +} +// GetBlobsUrl gets the blobs_url property value. The blobs_url property +// returns a *string when successful +func (m *TeamRepository) GetBlobsUrl()(*string) { + return m.blobs_url +} +// GetBranchesUrl gets the branches_url property value. The branches_url property +// returns a *string when successful +func (m *TeamRepository) GetBranchesUrl()(*string) { + return m.branches_url +} +// GetCloneUrl gets the clone_url property value. The clone_url property +// returns a *string when successful +func (m *TeamRepository) GetCloneUrl()(*string) { + return m.clone_url +} +// GetCollaboratorsUrl gets the collaborators_url property value. The collaborators_url property +// returns a *string when successful +func (m *TeamRepository) GetCollaboratorsUrl()(*string) { + return m.collaborators_url +} +// GetCommentsUrl gets the comments_url property value. The comments_url property +// returns a *string when successful +func (m *TeamRepository) GetCommentsUrl()(*string) { + return m.comments_url +} +// GetCommitsUrl gets the commits_url property value. The commits_url property +// returns a *string when successful +func (m *TeamRepository) GetCommitsUrl()(*string) { + return m.commits_url +} +// GetCompareUrl gets the compare_url property value. The compare_url property +// returns a *string when successful +func (m *TeamRepository) GetCompareUrl()(*string) { + return m.compare_url +} +// GetContentsUrl gets the contents_url property value. The contents_url property +// returns a *string when successful +func (m *TeamRepository) GetContentsUrl()(*string) { + return m.contents_url +} +// GetContributorsUrl gets the contributors_url property value. The contributors_url property +// returns a *string when successful +func (m *TeamRepository) GetContributorsUrl()(*string) { + return m.contributors_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *TeamRepository) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDefaultBranch gets the default_branch property value. The default branch of the repository. +// returns a *string when successful +func (m *TeamRepository) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +// returns a *bool when successful +func (m *TeamRepository) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDeploymentsUrl gets the deployments_url property value. The deployments_url property +// returns a *string when successful +func (m *TeamRepository) GetDeploymentsUrl()(*string) { + return m.deployments_url +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *TeamRepository) GetDescription()(*string) { + return m.description +} +// GetDisabled gets the disabled property value. Returns whether or not this repository disabled. +// returns a *bool when successful +func (m *TeamRepository) GetDisabled()(*bool) { + return m.disabled +} +// GetDownloadsUrl gets the downloads_url property value. The downloads_url property +// returns a *string when successful +func (m *TeamRepository) GetDownloadsUrl()(*string) { + return m.downloads_url +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *TeamRepository) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamRepository) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["archive_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArchiveUrl(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["assignees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssigneesUrl(val) + } + return nil + } + res["blobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlobsUrl(val) + } + return nil + } + res["branches_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranchesUrl(val) + } + return nil + } + res["clone_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCloneUrl(val) + } + return nil + } + res["collaborators_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCollaboratorsUrl(val) + } + return nil + } + res["comments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommentsUrl(val) + } + return nil + } + res["commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitsUrl(val) + } + return nil + } + res["compare_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompareUrl(val) + } + return nil + } + res["contents_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentsUrl(val) + } + return nil + } + res["contributors_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContributorsUrl(val) + } + return nil + } + 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["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + return nil + } + res["deployments_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDeploymentsUrl(val) + } + 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["disabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDisabled(val) + } + return nil + } + res["downloads_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDownloadsUrl(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["fork"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFork(val) + } + return nil + } + res["forks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForks(val) + } + return nil + } + res["forks_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetForksCount(val) + } + return nil + } + res["forks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetForksUrl(val) + } + return nil + } + res["full_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFullName(val) + } + return nil + } + res["git_commits_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitCommitsUrl(val) + } + return nil + } + res["git_refs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitRefsUrl(val) + } + return nil + } + res["git_tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitTagsUrl(val) + } + return nil + } + res["git_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitUrl(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasPages(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["hooks_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHooksUrl(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["issue_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueCommentUrl(val) + } + return nil + } + res["issue_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueEventsUrl(val) + } + return nil + } + res["issues_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssuesUrl(val) + } + return nil + } + res["keys_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeysUrl(val) + } + return nil + } + res["labels_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabelsUrl(val) + } + return nil + } + res["language"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguage(val) + } + return nil + } + res["languages_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLanguagesUrl(val) + } + return nil + } + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableLicenseSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLicense(val.(NullableLicenseSimpleable)) + } + return nil + } + res["master_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMasterBranch(val) + } + return nil + } + res["merges_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMergesUrl(val) + } + return nil + } + res["milestones_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMilestonesUrl(val) + } + return nil + } + res["mirror_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMirrorUrl(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["network_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetNetworkCount(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notifications_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationsUrl(val) + } + return nil + } + res["open_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssues(val) + } + return nil + } + res["open_issues_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetOpenIssuesCount(val) + } + return nil + } + res["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetOwner(val.(NullableSimpleUserable)) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamRepository_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(TeamRepository_permissionsable)) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["pulls_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullsUrl(val) + } + return nil + } + res["pushed_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetPushedAt(val) + } + return nil + } + res["releases_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleasesUrl(val) + } + return nil + } + res["role_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRoleName(val) + } + return nil + } + res["size"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSize(val) + } + return nil + } + res["ssh_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSshUrl(val) + } + return nil + } + res["stargazers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStargazersCount(val) + } + return nil + } + res["stargazers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStargazersUrl(val) + } + return nil + } + res["statuses_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatusesUrl(val) + } + return nil + } + res["subscribers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersCount(val) + } + return nil + } + res["subscribers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribersUrl(val) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["svn_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSvnUrl(val) + } + return nil + } + res["tags_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagsUrl(val) + } + return nil + } + res["teams_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTeamsUrl(val) + } + return nil + } + res["temp_clone_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTempCloneToken(val) + } + return nil + } + res["topics"] = 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.SetTopics(res) + } + return nil + } + res["trees_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTreesUrl(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["visibility"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVisibility(val) + } + return nil + } + res["watchers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchers(val) + } + return nil + } + res["watchers_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWatchersCount(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetFork gets the fork property value. The fork property +// returns a *bool when successful +func (m *TeamRepository) GetFork()(*bool) { + return m.fork +} +// GetForks gets the forks property value. The forks property +// returns a *int32 when successful +func (m *TeamRepository) GetForks()(*int32) { + return m.forks +} +// GetForksCount gets the forks_count property value. The forks_count property +// returns a *int32 when successful +func (m *TeamRepository) GetForksCount()(*int32) { + return m.forks_count +} +// GetForksUrl gets the forks_url property value. The forks_url property +// returns a *string when successful +func (m *TeamRepository) GetForksUrl()(*string) { + return m.forks_url +} +// GetFullName gets the full_name property value. The full_name property +// returns a *string when successful +func (m *TeamRepository) GetFullName()(*string) { + return m.full_name +} +// GetGitCommitsUrl gets the git_commits_url property value. The git_commits_url property +// returns a *string when successful +func (m *TeamRepository) GetGitCommitsUrl()(*string) { + return m.git_commits_url +} +// GetGitRefsUrl gets the git_refs_url property value. The git_refs_url property +// returns a *string when successful +func (m *TeamRepository) GetGitRefsUrl()(*string) { + return m.git_refs_url +} +// GetGitTagsUrl gets the git_tags_url property value. The git_tags_url property +// returns a *string when successful +func (m *TeamRepository) GetGitTagsUrl()(*string) { + return m.git_tags_url +} +// GetGitUrl gets the git_url property value. The git_url property +// returns a *string when successful +func (m *TeamRepository) GetGitUrl()(*string) { + return m.git_url +} +// GetHasDownloads gets the has_downloads property value. Whether downloads are enabled. +// returns a *bool when successful +func (m *TeamRepository) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. Whether issues are enabled. +// returns a *bool when successful +func (m *TeamRepository) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasPages gets the has_pages property value. The has_pages property +// returns a *bool when successful +func (m *TeamRepository) GetHasPages()(*bool) { + return m.has_pages +} +// GetHasProjects gets the has_projects property value. Whether projects are enabled. +// returns a *bool when successful +func (m *TeamRepository) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. Whether the wiki is enabled. +// returns a *bool when successful +func (m *TeamRepository) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. The homepage property +// returns a *string when successful +func (m *TeamRepository) GetHomepage()(*string) { + return m.homepage +} +// GetHooksUrl gets the hooks_url property value. The hooks_url property +// returns a *string when successful +func (m *TeamRepository) GetHooksUrl()(*string) { + return m.hooks_url +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamRepository) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the repository +// returns a *int32 when successful +func (m *TeamRepository) GetId()(*int32) { + return m.id +} +// GetIssueCommentUrl gets the issue_comment_url property value. The issue_comment_url property +// returns a *string when successful +func (m *TeamRepository) GetIssueCommentUrl()(*string) { + return m.issue_comment_url +} +// GetIssueEventsUrl gets the issue_events_url property value. The issue_events_url property +// returns a *string when successful +func (m *TeamRepository) GetIssueEventsUrl()(*string) { + return m.issue_events_url +} +// GetIssuesUrl gets the issues_url property value. The issues_url property +// returns a *string when successful +func (m *TeamRepository) GetIssuesUrl()(*string) { + return m.issues_url +} +// GetIsTemplate gets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +// returns a *bool when successful +func (m *TeamRepository) GetIsTemplate()(*bool) { + return m.is_template +} +// GetKeysUrl gets the keys_url property value. The keys_url property +// returns a *string when successful +func (m *TeamRepository) GetKeysUrl()(*string) { + return m.keys_url +} +// GetLabelsUrl gets the labels_url property value. The labels_url property +// returns a *string when successful +func (m *TeamRepository) GetLabelsUrl()(*string) { + return m.labels_url +} +// GetLanguage gets the language property value. The language property +// returns a *string when successful +func (m *TeamRepository) GetLanguage()(*string) { + return m.language +} +// GetLanguagesUrl gets the languages_url property value. The languages_url property +// returns a *string when successful +func (m *TeamRepository) GetLanguagesUrl()(*string) { + return m.languages_url +} +// GetLicense gets the license property value. License Simple +// returns a NullableLicenseSimpleable when successful +func (m *TeamRepository) GetLicense()(NullableLicenseSimpleable) { + return m.license +} +// GetMasterBranch gets the master_branch property value. The master_branch property +// returns a *string when successful +func (m *TeamRepository) GetMasterBranch()(*string) { + return m.master_branch +} +// GetMergesUrl gets the merges_url property value. The merges_url property +// returns a *string when successful +func (m *TeamRepository) GetMergesUrl()(*string) { + return m.merges_url +} +// GetMilestonesUrl gets the milestones_url property value. The milestones_url property +// returns a *string when successful +func (m *TeamRepository) GetMilestonesUrl()(*string) { + return m.milestones_url +} +// GetMirrorUrl gets the mirror_url property value. The mirror_url property +// returns a *string when successful +func (m *TeamRepository) GetMirrorUrl()(*string) { + return m.mirror_url +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *TeamRepository) GetName()(*string) { + return m.name +} +// GetNetworkCount gets the network_count property value. The network_count property +// returns a *int32 when successful +func (m *TeamRepository) GetNetworkCount()(*int32) { + return m.network_count +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamRepository) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationsUrl gets the notifications_url property value. The notifications_url property +// returns a *string when successful +func (m *TeamRepository) GetNotificationsUrl()(*string) { + return m.notifications_url +} +// GetOpenIssues gets the open_issues property value. The open_issues property +// returns a *int32 when successful +func (m *TeamRepository) GetOpenIssues()(*int32) { + return m.open_issues +} +// GetOpenIssuesCount gets the open_issues_count property value. The open_issues_count property +// returns a *int32 when successful +func (m *TeamRepository) GetOpenIssuesCount()(*int32) { + return m.open_issues_count +} +// GetOwner gets the owner property value. A GitHub user. +// returns a NullableSimpleUserable when successful +func (m *TeamRepository) GetOwner()(NullableSimpleUserable) { + return m.owner +} +// GetPermissions gets the permissions property value. The permissions property +// returns a TeamRepository_permissionsable when successful +func (m *TeamRepository) GetPermissions()(TeamRepository_permissionsable) { + return m.permissions +} +// GetPrivate gets the private property value. Whether the repository is private or public. +// returns a *bool when successful +func (m *TeamRepository) GetPrivate()(*bool) { + return m.private +} +// GetPullsUrl gets the pulls_url property value. The pulls_url property +// returns a *string when successful +func (m *TeamRepository) GetPullsUrl()(*string) { + return m.pulls_url +} +// GetPushedAt gets the pushed_at property value. The pushed_at property +// returns a *Time when successful +func (m *TeamRepository) GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.pushed_at +} +// GetReleasesUrl gets the releases_url property value. The releases_url property +// returns a *string when successful +func (m *TeamRepository) GetReleasesUrl()(*string) { + return m.releases_url +} +// GetRoleName gets the role_name property value. The role_name property +// returns a *string when successful +func (m *TeamRepository) GetRoleName()(*string) { + return m.role_name +} +// GetSize gets the size property value. The size property +// returns a *int32 when successful +func (m *TeamRepository) GetSize()(*int32) { + return m.size +} +// GetSshUrl gets the ssh_url property value. The ssh_url property +// returns a *string when successful +func (m *TeamRepository) GetSshUrl()(*string) { + return m.ssh_url +} +// GetStargazersCount gets the stargazers_count property value. The stargazers_count property +// returns a *int32 when successful +func (m *TeamRepository) GetStargazersCount()(*int32) { + return m.stargazers_count +} +// GetStargazersUrl gets the stargazers_url property value. The stargazers_url property +// returns a *string when successful +func (m *TeamRepository) GetStargazersUrl()(*string) { + return m.stargazers_url +} +// GetStatusesUrl gets the statuses_url property value. The statuses_url property +// returns a *string when successful +func (m *TeamRepository) GetStatusesUrl()(*string) { + return m.statuses_url +} +// GetSubscribersCount gets the subscribers_count property value. The subscribers_count property +// returns a *int32 when successful +func (m *TeamRepository) GetSubscribersCount()(*int32) { + return m.subscribers_count +} +// GetSubscribersUrl gets the subscribers_url property value. The subscribers_url property +// returns a *string when successful +func (m *TeamRepository) GetSubscribersUrl()(*string) { + return m.subscribers_url +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *TeamRepository) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetSvnUrl gets the svn_url property value. The svn_url property +// returns a *string when successful +func (m *TeamRepository) GetSvnUrl()(*string) { + return m.svn_url +} +// GetTagsUrl gets the tags_url property value. The tags_url property +// returns a *string when successful +func (m *TeamRepository) GetTagsUrl()(*string) { + return m.tags_url +} +// GetTeamsUrl gets the teams_url property value. The teams_url property +// returns a *string when successful +func (m *TeamRepository) GetTeamsUrl()(*string) { + return m.teams_url +} +// GetTempCloneToken gets the temp_clone_token property value. The temp_clone_token property +// returns a *string when successful +func (m *TeamRepository) GetTempCloneToken()(*string) { + return m.temp_clone_token +} +// GetTopics gets the topics property value. The topics property +// returns a []string when successful +func (m *TeamRepository) GetTopics()([]string) { + return m.topics +} +// GetTreesUrl gets the trees_url property value. The trees_url property +// returns a *string when successful +func (m *TeamRepository) GetTreesUrl()(*string) { + return m.trees_url +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TeamRepository) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TeamRepository) GetUrl()(*string) { + return m.url +} +// GetVisibility gets the visibility property value. The repository visibility: public, private, or internal. +// returns a *string when successful +func (m *TeamRepository) GetVisibility()(*string) { + return m.visibility +} +// GetWatchers gets the watchers property value. The watchers property +// returns a *int32 when successful +func (m *TeamRepository) GetWatchers()(*int32) { + return m.watchers +} +// GetWatchersCount gets the watchers_count property value. The watchers_count property +// returns a *int32 when successful +func (m *TeamRepository) GetWatchersCount()(*int32) { + return m.watchers_count +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. Whether to require contributors to sign off on web-based commits +// returns a *bool when successful +func (m *TeamRepository) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *TeamRepository) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("archive_url", m.GetArchiveUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("assignees_url", m.GetAssigneesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blobs_url", m.GetBlobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branches_url", m.GetBranchesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("clone_url", m.GetCloneUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("collaborators_url", m.GetCollaboratorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("comments_url", m.GetCommentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commits_url", m.GetCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("compare_url", m.GetCompareUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contents_url", m.GetContentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("contributors_url", m.GetContributorsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("deployments_url", m.GetDeploymentsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("disabled", m.GetDisabled()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("downloads_url", m.GetDownloadsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("fork", m.GetFork()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks", m.GetForks()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("forks_count", m.GetForksCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("forks_url", m.GetForksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("full_name", m.GetFullName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_commits_url", m.GetGitCommitsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_refs_url", m.GetGitRefsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_tags_url", m.GetGitTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("git_url", m.GetGitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_pages", m.GetHasPages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("hooks_url", m.GetHooksUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issues_url", m.GetIssuesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_comment_url", m.GetIssueCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_events_url", m.GetIssueEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("keys_url", m.GetKeysUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("labels_url", m.GetLabelsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("language", m.GetLanguage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("languages_url", m.GetLanguagesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("master_branch", m.GetMasterBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("merges_url", m.GetMergesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("milestones_url", m.GetMilestonesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("mirror_url", m.GetMirrorUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("network_count", m.GetNetworkCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notifications_url", m.GetNotificationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues", m.GetOpenIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("open_issues_count", m.GetOpenIssuesCount()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pulls_url", m.GetPullsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("pushed_at", m.GetPushedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("releases_url", m.GetReleasesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("role_name", m.GetRoleName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("size", m.GetSize()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ssh_url", m.GetSshUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("stargazers_count", m.GetStargazersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("stargazers_url", m.GetStargazersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("statuses_url", m.GetStatusesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("subscribers_count", m.GetSubscribersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscribers_url", m.GetSubscribersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("svn_url", m.GetSvnUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tags_url", m.GetTagsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("teams_url", m.GetTeamsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("temp_clone_token", m.GetTempCloneToken()) + if err != nil { + return err + } + } + if m.GetTopics() != nil { + err := writer.WriteCollectionOfStringValues("topics", m.GetTopics()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("trees_url", m.GetTreesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("visibility", m.GetVisibility()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers", m.GetWatchers()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("watchers_count", m.GetWatchersCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *TeamRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +func (m *TeamRepository) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowForking sets the allow_forking property value. Whether to allow forking this repo +func (m *TeamRepository) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +func (m *TeamRepository) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +func (m *TeamRepository) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +func (m *TeamRepository) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetArchived sets the archived property value. Whether the repository is archived. +func (m *TeamRepository) SetArchived(value *bool)() { + m.archived = value +} +// SetArchiveUrl sets the archive_url property value. The archive_url property +func (m *TeamRepository) SetArchiveUrl(value *string)() { + m.archive_url = value +} +// SetAssigneesUrl sets the assignees_url property value. The assignees_url property +func (m *TeamRepository) SetAssigneesUrl(value *string)() { + m.assignees_url = value +} +// SetBlobsUrl sets the blobs_url property value. The blobs_url property +func (m *TeamRepository) SetBlobsUrl(value *string)() { + m.blobs_url = value +} +// SetBranchesUrl sets the branches_url property value. The branches_url property +func (m *TeamRepository) SetBranchesUrl(value *string)() { + m.branches_url = value +} +// SetCloneUrl sets the clone_url property value. The clone_url property +func (m *TeamRepository) SetCloneUrl(value *string)() { + m.clone_url = value +} +// SetCollaboratorsUrl sets the collaborators_url property value. The collaborators_url property +func (m *TeamRepository) SetCollaboratorsUrl(value *string)() { + m.collaborators_url = value +} +// SetCommentsUrl sets the comments_url property value. The comments_url property +func (m *TeamRepository) SetCommentsUrl(value *string)() { + m.comments_url = value +} +// SetCommitsUrl sets the commits_url property value. The commits_url property +func (m *TeamRepository) SetCommitsUrl(value *string)() { + m.commits_url = value +} +// SetCompareUrl sets the compare_url property value. The compare_url property +func (m *TeamRepository) SetCompareUrl(value *string)() { + m.compare_url = value +} +// SetContentsUrl sets the contents_url property value. The contents_url property +func (m *TeamRepository) SetContentsUrl(value *string)() { + m.contents_url = value +} +// SetContributorsUrl sets the contributors_url property value. The contributors_url property +func (m *TeamRepository) SetContributorsUrl(value *string)() { + m.contributors_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TeamRepository) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDefaultBranch sets the default_branch property value. The default branch of the repository. +func (m *TeamRepository) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +func (m *TeamRepository) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDeploymentsUrl sets the deployments_url property value. The deployments_url property +func (m *TeamRepository) SetDeploymentsUrl(value *string)() { + m.deployments_url = value +} +// SetDescription sets the description property value. The description property +func (m *TeamRepository) SetDescription(value *string)() { + m.description = value +} +// SetDisabled sets the disabled property value. Returns whether or not this repository disabled. +func (m *TeamRepository) SetDisabled(value *bool)() { + m.disabled = value +} +// SetDownloadsUrl sets the downloads_url property value. The downloads_url property +func (m *TeamRepository) SetDownloadsUrl(value *string)() { + m.downloads_url = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *TeamRepository) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFork sets the fork property value. The fork property +func (m *TeamRepository) SetFork(value *bool)() { + m.fork = value +} +// SetForks sets the forks property value. The forks property +func (m *TeamRepository) SetForks(value *int32)() { + m.forks = value +} +// SetForksCount sets the forks_count property value. The forks_count property +func (m *TeamRepository) SetForksCount(value *int32)() { + m.forks_count = value +} +// SetForksUrl sets the forks_url property value. The forks_url property +func (m *TeamRepository) SetForksUrl(value *string)() { + m.forks_url = value +} +// SetFullName sets the full_name property value. The full_name property +func (m *TeamRepository) SetFullName(value *string)() { + m.full_name = value +} +// SetGitCommitsUrl sets the git_commits_url property value. The git_commits_url property +func (m *TeamRepository) SetGitCommitsUrl(value *string)() { + m.git_commits_url = value +} +// SetGitRefsUrl sets the git_refs_url property value. The git_refs_url property +func (m *TeamRepository) SetGitRefsUrl(value *string)() { + m.git_refs_url = value +} +// SetGitTagsUrl sets the git_tags_url property value. The git_tags_url property +func (m *TeamRepository) SetGitTagsUrl(value *string)() { + m.git_tags_url = value +} +// SetGitUrl sets the git_url property value. The git_url property +func (m *TeamRepository) SetGitUrl(value *string)() { + m.git_url = value +} +// SetHasDownloads sets the has_downloads property value. Whether downloads are enabled. +func (m *TeamRepository) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. Whether issues are enabled. +func (m *TeamRepository) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasPages sets the has_pages property value. The has_pages property +func (m *TeamRepository) SetHasPages(value *bool)() { + m.has_pages = value +} +// SetHasProjects sets the has_projects property value. Whether projects are enabled. +func (m *TeamRepository) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. Whether the wiki is enabled. +func (m *TeamRepository) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. The homepage property +func (m *TeamRepository) SetHomepage(value *string)() { + m.homepage = value +} +// SetHooksUrl sets the hooks_url property value. The hooks_url property +func (m *TeamRepository) SetHooksUrl(value *string)() { + m.hooks_url = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamRepository) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the repository +func (m *TeamRepository) SetId(value *int32)() { + m.id = value +} +// SetIssueCommentUrl sets the issue_comment_url property value. The issue_comment_url property +func (m *TeamRepository) SetIssueCommentUrl(value *string)() { + m.issue_comment_url = value +} +// SetIssueEventsUrl sets the issue_events_url property value. The issue_events_url property +func (m *TeamRepository) SetIssueEventsUrl(value *string)() { + m.issue_events_url = value +} +// SetIssuesUrl sets the issues_url property value. The issues_url property +func (m *TeamRepository) SetIssuesUrl(value *string)() { + m.issues_url = value +} +// SetIsTemplate sets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +func (m *TeamRepository) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetKeysUrl sets the keys_url property value. The keys_url property +func (m *TeamRepository) SetKeysUrl(value *string)() { + m.keys_url = value +} +// SetLabelsUrl sets the labels_url property value. The labels_url property +func (m *TeamRepository) SetLabelsUrl(value *string)() { + m.labels_url = value +} +// SetLanguage sets the language property value. The language property +func (m *TeamRepository) SetLanguage(value *string)() { + m.language = value +} +// SetLanguagesUrl sets the languages_url property value. The languages_url property +func (m *TeamRepository) SetLanguagesUrl(value *string)() { + m.languages_url = value +} +// SetLicense sets the license property value. License Simple +func (m *TeamRepository) SetLicense(value NullableLicenseSimpleable)() { + m.license = value +} +// SetMasterBranch sets the master_branch property value. The master_branch property +func (m *TeamRepository) SetMasterBranch(value *string)() { + m.master_branch = value +} +// SetMergesUrl sets the merges_url property value. The merges_url property +func (m *TeamRepository) SetMergesUrl(value *string)() { + m.merges_url = value +} +// SetMilestonesUrl sets the milestones_url property value. The milestones_url property +func (m *TeamRepository) SetMilestonesUrl(value *string)() { + m.milestones_url = value +} +// SetMirrorUrl sets the mirror_url property value. The mirror_url property +func (m *TeamRepository) SetMirrorUrl(value *string)() { + m.mirror_url = value +} +// SetName sets the name property value. The name of the repository. +func (m *TeamRepository) SetName(value *string)() { + m.name = value +} +// SetNetworkCount sets the network_count property value. The network_count property +func (m *TeamRepository) SetNetworkCount(value *int32)() { + m.network_count = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamRepository) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationsUrl sets the notifications_url property value. The notifications_url property +func (m *TeamRepository) SetNotificationsUrl(value *string)() { + m.notifications_url = value +} +// SetOpenIssues sets the open_issues property value. The open_issues property +func (m *TeamRepository) SetOpenIssues(value *int32)() { + m.open_issues = value +} +// SetOpenIssuesCount sets the open_issues_count property value. The open_issues_count property +func (m *TeamRepository) SetOpenIssuesCount(value *int32)() { + m.open_issues_count = value +} +// SetOwner sets the owner property value. A GitHub user. +func (m *TeamRepository) SetOwner(value NullableSimpleUserable)() { + m.owner = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *TeamRepository) SetPermissions(value TeamRepository_permissionsable)() { + m.permissions = value +} +// SetPrivate sets the private property value. Whether the repository is private or public. +func (m *TeamRepository) SetPrivate(value *bool)() { + m.private = value +} +// SetPullsUrl sets the pulls_url property value. The pulls_url property +func (m *TeamRepository) SetPullsUrl(value *string)() { + m.pulls_url = value +} +// SetPushedAt sets the pushed_at property value. The pushed_at property +func (m *TeamRepository) SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.pushed_at = value +} +// SetReleasesUrl sets the releases_url property value. The releases_url property +func (m *TeamRepository) SetReleasesUrl(value *string)() { + m.releases_url = value +} +// SetRoleName sets the role_name property value. The role_name property +func (m *TeamRepository) SetRoleName(value *string)() { + m.role_name = value +} +// SetSize sets the size property value. The size property +func (m *TeamRepository) SetSize(value *int32)() { + m.size = value +} +// SetSshUrl sets the ssh_url property value. The ssh_url property +func (m *TeamRepository) SetSshUrl(value *string)() { + m.ssh_url = value +} +// SetStargazersCount sets the stargazers_count property value. The stargazers_count property +func (m *TeamRepository) SetStargazersCount(value *int32)() { + m.stargazers_count = value +} +// SetStargazersUrl sets the stargazers_url property value. The stargazers_url property +func (m *TeamRepository) SetStargazersUrl(value *string)() { + m.stargazers_url = value +} +// SetStatusesUrl sets the statuses_url property value. The statuses_url property +func (m *TeamRepository) SetStatusesUrl(value *string)() { + m.statuses_url = value +} +// SetSubscribersCount sets the subscribers_count property value. The subscribers_count property +func (m *TeamRepository) SetSubscribersCount(value *int32)() { + m.subscribers_count = value +} +// SetSubscribersUrl sets the subscribers_url property value. The subscribers_url property +func (m *TeamRepository) SetSubscribersUrl(value *string)() { + m.subscribers_url = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *TeamRepository) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetSvnUrl sets the svn_url property value. The svn_url property +func (m *TeamRepository) SetSvnUrl(value *string)() { + m.svn_url = value +} +// SetTagsUrl sets the tags_url property value. The tags_url property +func (m *TeamRepository) SetTagsUrl(value *string)() { + m.tags_url = value +} +// SetTeamsUrl sets the teams_url property value. The teams_url property +func (m *TeamRepository) SetTeamsUrl(value *string)() { + m.teams_url = value +} +// SetTempCloneToken sets the temp_clone_token property value. The temp_clone_token property +func (m *TeamRepository) SetTempCloneToken(value *string)() { + m.temp_clone_token = value +} +// SetTopics sets the topics property value. The topics property +func (m *TeamRepository) SetTopics(value []string)() { + m.topics = value +} +// SetTreesUrl sets the trees_url property value. The trees_url property +func (m *TeamRepository) SetTreesUrl(value *string)() { + m.trees_url = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TeamRepository) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *TeamRepository) SetUrl(value *string)() { + m.url = value +} +// SetVisibility sets the visibility property value. The repository visibility: public, private, or internal. +func (m *TeamRepository) SetVisibility(value *string)() { + m.visibility = value +} +// SetWatchers sets the watchers property value. The watchers property +func (m *TeamRepository) SetWatchers(value *int32)() { + m.watchers = value +} +// SetWatchersCount sets the watchers_count property value. The watchers_count property +func (m *TeamRepository) SetWatchersCount(value *int32)() { + m.watchers_count = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. Whether to require contributors to sign off on web-based commits +func (m *TeamRepository) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type TeamRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetArchived()(*bool) + GetArchiveUrl()(*string) + GetAssigneesUrl()(*string) + GetBlobsUrl()(*string) + GetBranchesUrl()(*string) + GetCloneUrl()(*string) + GetCollaboratorsUrl()(*string) + GetCommentsUrl()(*string) + GetCommitsUrl()(*string) + GetCompareUrl()(*string) + GetContentsUrl()(*string) + GetContributorsUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDeploymentsUrl()(*string) + GetDescription()(*string) + GetDisabled()(*bool) + GetDownloadsUrl()(*string) + GetEventsUrl()(*string) + GetFork()(*bool) + GetForks()(*int32) + GetForksCount()(*int32) + GetForksUrl()(*string) + GetFullName()(*string) + GetGitCommitsUrl()(*string) + GetGitRefsUrl()(*string) + GetGitTagsUrl()(*string) + GetGitUrl()(*string) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasPages()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetHooksUrl()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssueCommentUrl()(*string) + GetIssueEventsUrl()(*string) + GetIssuesUrl()(*string) + GetIsTemplate()(*bool) + GetKeysUrl()(*string) + GetLabelsUrl()(*string) + GetLanguage()(*string) + GetLanguagesUrl()(*string) + GetLicense()(NullableLicenseSimpleable) + GetMasterBranch()(*string) + GetMergesUrl()(*string) + GetMilestonesUrl()(*string) + GetMirrorUrl()(*string) + GetName()(*string) + GetNetworkCount()(*int32) + GetNodeId()(*string) + GetNotificationsUrl()(*string) + GetOpenIssues()(*int32) + GetOpenIssuesCount()(*int32) + GetOwner()(NullableSimpleUserable) + GetPermissions()(TeamRepository_permissionsable) + GetPrivate()(*bool) + GetPullsUrl()(*string) + GetPushedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetReleasesUrl()(*string) + GetRoleName()(*string) + GetSize()(*int32) + GetSshUrl()(*string) + GetStargazersCount()(*int32) + GetStargazersUrl()(*string) + GetStatusesUrl()(*string) + GetSubscribersCount()(*int32) + GetSubscribersUrl()(*string) + GetSubscriptionUrl()(*string) + GetSvnUrl()(*string) + GetTagsUrl()(*string) + GetTeamsUrl()(*string) + GetTempCloneToken()(*string) + GetTopics()([]string) + GetTreesUrl()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetVisibility()(*string) + GetWatchers()(*int32) + GetWatchersCount()(*int32) + GetWebCommitSignoffRequired()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetArchived(value *bool)() + SetArchiveUrl(value *string)() + SetAssigneesUrl(value *string)() + SetBlobsUrl(value *string)() + SetBranchesUrl(value *string)() + SetCloneUrl(value *string)() + SetCollaboratorsUrl(value *string)() + SetCommentsUrl(value *string)() + SetCommitsUrl(value *string)() + SetCompareUrl(value *string)() + SetContentsUrl(value *string)() + SetContributorsUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDeploymentsUrl(value *string)() + SetDescription(value *string)() + SetDisabled(value *bool)() + SetDownloadsUrl(value *string)() + SetEventsUrl(value *string)() + SetFork(value *bool)() + SetForks(value *int32)() + SetForksCount(value *int32)() + SetForksUrl(value *string)() + SetFullName(value *string)() + SetGitCommitsUrl(value *string)() + SetGitRefsUrl(value *string)() + SetGitTagsUrl(value *string)() + SetGitUrl(value *string)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasPages(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetHooksUrl(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssueCommentUrl(value *string)() + SetIssueEventsUrl(value *string)() + SetIssuesUrl(value *string)() + SetIsTemplate(value *bool)() + SetKeysUrl(value *string)() + SetLabelsUrl(value *string)() + SetLanguage(value *string)() + SetLanguagesUrl(value *string)() + SetLicense(value NullableLicenseSimpleable)() + SetMasterBranch(value *string)() + SetMergesUrl(value *string)() + SetMilestonesUrl(value *string)() + SetMirrorUrl(value *string)() + SetName(value *string)() + SetNetworkCount(value *int32)() + SetNodeId(value *string)() + SetNotificationsUrl(value *string)() + SetOpenIssues(value *int32)() + SetOpenIssuesCount(value *int32)() + SetOwner(value NullableSimpleUserable)() + SetPermissions(value TeamRepository_permissionsable)() + SetPrivate(value *bool)() + SetPullsUrl(value *string)() + SetPushedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetReleasesUrl(value *string)() + SetRoleName(value *string)() + SetSize(value *int32)() + SetSshUrl(value *string)() + SetStargazersCount(value *int32)() + SetStargazersUrl(value *string)() + SetStatusesUrl(value *string)() + SetSubscribersCount(value *int32)() + SetSubscribersUrl(value *string)() + SetSubscriptionUrl(value *string)() + SetSvnUrl(value *string)() + SetTagsUrl(value *string)() + SetTeamsUrl(value *string)() + SetTempCloneToken(value *string)() + SetTopics(value []string)() + SetTreesUrl(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetVisibility(value *string)() + SetWatchers(value *int32)() + SetWatchersCount(value *int32)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/pkg/github/models/team_repository_escaped_permissions.go b/pkg/github/models/team_repository_escaped_permissions.go new file mode 100644 index 00000000..5546c286 --- /dev/null +++ b/pkg/github/models/team_repository_escaped_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TeamRepository_permissions 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 admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewTeamRepository_permissions instantiates a new TeamRepository_permissions and sets the default values. +func NewTeamRepository_permissions()(*TeamRepository_permissions) { + m := &TeamRepository_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamRepository_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamRepository_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamRepository_permissions(), 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 *TeamRepository_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *TeamRepository_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamRepository_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *TeamRepository_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *TeamRepository_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *TeamRepository_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *TeamRepository_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *TeamRepository_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *TeamRepository_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *TeamRepository_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *TeamRepository_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *TeamRepository_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *TeamRepository_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *TeamRepository_permissions) SetTriage(value *bool)() { + m.triage = value +} +type TeamRepository_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/pkg/github/models/team_role_assignment.go b/pkg/github/models/team_role_assignment.go new file mode 100644 index 00000000..e51c85fc --- /dev/null +++ b/pkg/github/models/team_role_assignment.go @@ -0,0 +1,458 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamRoleAssignment the Relationship a Team has with a role. +type TeamRoleAssignment 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 property + description *string + // The html_url property + html_url *string + // The id property + id *int32 + // The members_url property + members_url *string + // The name property + name *string + // The node_id property + node_id *string + // The notification_setting property + notification_setting *string + // Groups of organization members that gives permissions on specified repositories. + parent NullableTeamSimpleable + // The permission property + permission *string + // The permissions property + permissions TeamRoleAssignment_permissionsable + // The privacy property + privacy *string + // The repositories_url property + repositories_url *string + // The slug property + slug *string + // The url property + url *string +} +// NewTeamRoleAssignment instantiates a new TeamRoleAssignment and sets the default values. +func NewTeamRoleAssignment()(*TeamRoleAssignment) { + m := &TeamRoleAssignment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamRoleAssignmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamRoleAssignmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamRoleAssignment(), 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 *TeamRoleAssignment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *TeamRoleAssignment) 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 *TeamRoleAssignment) 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["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationSetting(val) + } + return nil + } + res["parent"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableTeamSimpleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetParent(val.(NullableTeamSimpleable)) + } + return nil + } + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["permissions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTeamRoleAssignment_permissionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPermissions(val.(TeamRoleAssignment_permissionsable)) + } + return nil + } + res["privacy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivacy(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamRoleAssignment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TeamRoleAssignment) GetId()(*int32) { + return m.id +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *TeamRoleAssignment) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *TeamRoleAssignment) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamRoleAssignment) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationSetting gets the notification_setting property value. The notification_setting property +// returns a *string when successful +func (m *TeamRoleAssignment) GetNotificationSetting()(*string) { + return m.notification_setting +} +// GetParent gets the parent property value. Groups of organization members that gives permissions on specified repositories. +// returns a NullableTeamSimpleable when successful +func (m *TeamRoleAssignment) GetParent()(NullableTeamSimpleable) { + return m.parent +} +// GetPermission gets the permission property value. The permission property +// returns a *string when successful +func (m *TeamRoleAssignment) GetPermission()(*string) { + return m.permission +} +// GetPermissions gets the permissions property value. The permissions property +// returns a TeamRoleAssignment_permissionsable when successful +func (m *TeamRoleAssignment) GetPermissions()(TeamRoleAssignment_permissionsable) { + return m.permissions +} +// GetPrivacy gets the privacy property value. The privacy property +// returns a *string when successful +func (m *TeamRoleAssignment) GetPrivacy()(*string) { + return m.privacy +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *TeamRoleAssignment) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *TeamRoleAssignment) GetSlug()(*string) { + return m.slug +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TeamRoleAssignment) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TeamRoleAssignment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_setting", m.GetNotificationSetting()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("parent", m.GetParent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("permissions", m.GetPermissions()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("privacy", m.GetPrivacy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TeamRoleAssignment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description property +func (m *TeamRoleAssignment) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamRoleAssignment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *TeamRoleAssignment) SetId(value *int32)() { + m.id = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *TeamRoleAssignment) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. The name property +func (m *TeamRoleAssignment) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamRoleAssignment) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationSetting sets the notification_setting property value. The notification_setting property +func (m *TeamRoleAssignment) SetNotificationSetting(value *string)() { + m.notification_setting = value +} +// SetParent sets the parent property value. Groups of organization members that gives permissions on specified repositories. +func (m *TeamRoleAssignment) SetParent(value NullableTeamSimpleable)() { + m.parent = value +} +// SetPermission sets the permission property value. The permission property +func (m *TeamRoleAssignment) SetPermission(value *string)() { + m.permission = value +} +// SetPermissions sets the permissions property value. The permissions property +func (m *TeamRoleAssignment) SetPermissions(value TeamRoleAssignment_permissionsable)() { + m.permissions = value +} +// SetPrivacy sets the privacy property value. The privacy property +func (m *TeamRoleAssignment) SetPrivacy(value *string)() { + m.privacy = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *TeamRoleAssignment) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetSlug sets the slug property value. The slug property +func (m *TeamRoleAssignment) SetSlug(value *string)() { + m.slug = value +} +// SetUrl sets the url property value. The url property +func (m *TeamRoleAssignment) SetUrl(value *string)() { + m.url = value +} +type TeamRoleAssignmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationSetting()(*string) + GetParent()(NullableTeamSimpleable) + GetPermission()(*string) + GetPermissions()(TeamRoleAssignment_permissionsable) + GetPrivacy()(*string) + GetRepositoriesUrl()(*string) + GetSlug()(*string) + GetUrl()(*string) + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationSetting(value *string)() + SetParent(value NullableTeamSimpleable)() + SetPermission(value *string)() + SetPermissions(value TeamRoleAssignment_permissionsable)() + SetPrivacy(value *string)() + SetRepositoriesUrl(value *string)() + SetSlug(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/team_role_assignment_escaped_permissions.go b/pkg/github/models/team_role_assignment_escaped_permissions.go new file mode 100644 index 00000000..295a8588 --- /dev/null +++ b/pkg/github/models/team_role_assignment_escaped_permissions.go @@ -0,0 +1,196 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TeamRoleAssignment_permissions 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 admin property + admin *bool + // The maintain property + maintain *bool + // The pull property + pull *bool + // The push property + push *bool + // The triage property + triage *bool +} +// NewTeamRoleAssignment_permissions instantiates a new TeamRoleAssignment_permissions and sets the default values. +func NewTeamRoleAssignment_permissions()(*TeamRoleAssignment_permissions) { + m := &TeamRoleAssignment_permissions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamRoleAssignment_permissionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamRoleAssignment_permissionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamRoleAssignment_permissions(), 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 *TeamRoleAssignment_permissions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdmin gets the admin property value. The admin property +// returns a *bool when successful +func (m *TeamRoleAssignment_permissions) GetAdmin()(*bool) { + return m.admin +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamRoleAssignment_permissions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdmin(val) + } + return nil + } + res["maintain"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintain(val) + } + return nil + } + res["pull"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPull(val) + } + return nil + } + res["push"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPush(val) + } + return nil + } + res["triage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTriage(val) + } + return nil + } + return res +} +// GetMaintain gets the maintain property value. The maintain property +// returns a *bool when successful +func (m *TeamRoleAssignment_permissions) GetMaintain()(*bool) { + return m.maintain +} +// GetPull gets the pull property value. The pull property +// returns a *bool when successful +func (m *TeamRoleAssignment_permissions) GetPull()(*bool) { + return m.pull +} +// GetPush gets the push property value. The push property +// returns a *bool when successful +func (m *TeamRoleAssignment_permissions) GetPush()(*bool) { + return m.push +} +// GetTriage gets the triage property value. The triage property +// returns a *bool when successful +func (m *TeamRoleAssignment_permissions) GetTriage()(*bool) { + return m.triage +} +// Serialize serializes information the current object +func (m *TeamRoleAssignment_permissions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("admin", m.GetAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintain", m.GetMaintain()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("pull", m.GetPull()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("push", m.GetPush()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("triage", m.GetTriage()) + 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 *TeamRoleAssignment_permissions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdmin sets the admin property value. The admin property +func (m *TeamRoleAssignment_permissions) SetAdmin(value *bool)() { + m.admin = value +} +// SetMaintain sets the maintain property value. The maintain property +func (m *TeamRoleAssignment_permissions) SetMaintain(value *bool)() { + m.maintain = value +} +// SetPull sets the pull property value. The pull property +func (m *TeamRoleAssignment_permissions) SetPull(value *bool)() { + m.pull = value +} +// SetPush sets the push property value. The push property +func (m *TeamRoleAssignment_permissions) SetPush(value *bool)() { + m.push = value +} +// SetTriage sets the triage property value. The triage property +func (m *TeamRoleAssignment_permissions) SetTriage(value *bool)() { + m.triage = value +} +type TeamRoleAssignment_permissionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdmin()(*bool) + GetMaintain()(*bool) + GetPull()(*bool) + GetPush()(*bool) + GetTriage()(*bool) + SetAdmin(value *bool)() + SetMaintain(value *bool)() + SetPull(value *bool)() + SetPush(value *bool)() + SetTriage(value *bool)() +} diff --git a/pkg/github/models/team_simple.go b/pkg/github/models/team_simple.go new file mode 100644 index 00000000..b71d3cce --- /dev/null +++ b/pkg/github/models/team_simple.go @@ -0,0 +1,429 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TeamSimple groups of organization members that gives permissions on specified repositories. +type TeamSimple struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Description of the team + description *string + // The html_url property + html_url *string + // Unique identifier of the team + id *int32 + // Distinguished Name (DN) that team maps to within LDAP environment + ldap_dn *string + // The members_url property + members_url *string + // Name of the team + name *string + // The node_id property + node_id *string + // The notification setting the team has set + notification_setting *string + // Permission that the team will have for its repositories + permission *string + // The level of privacy this team should have + privacy *string + // The repositories_url property + repositories_url *string + // The slug property + slug *string + // URL for the team + url *string +} +// NewTeamSimple instantiates a new TeamSimple and sets the default values. +func NewTeamSimple()(*TeamSimple) { + m := &TeamSimple{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTeamSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTeamSimple(), 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 *TeamSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. Description of the team +// returns a *string when successful +func (m *TeamSimple) 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 *TeamSimple) 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["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["ldap_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLdapDn(val) + } + return nil + } + res["members_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["notification_setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNotificationSetting(val) + } + return nil + } + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + res["privacy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivacy(val) + } + return nil + } + res["repositories_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoriesUrl(val) + } + return nil + } + res["slug"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSlug(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TeamSimple) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the team +// returns a *int32 when successful +func (m *TeamSimple) GetId()(*int32) { + return m.id +} +// GetLdapDn gets the ldap_dn property value. Distinguished Name (DN) that team maps to within LDAP environment +// returns a *string when successful +func (m *TeamSimple) GetLdapDn()(*string) { + return m.ldap_dn +} +// GetMembersUrl gets the members_url property value. The members_url property +// returns a *string when successful +func (m *TeamSimple) GetMembersUrl()(*string) { + return m.members_url +} +// GetName gets the name property value. Name of the team +// returns a *string when successful +func (m *TeamSimple) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TeamSimple) GetNodeId()(*string) { + return m.node_id +} +// GetNotificationSetting gets the notification_setting property value. The notification setting the team has set +// returns a *string when successful +func (m *TeamSimple) GetNotificationSetting()(*string) { + return m.notification_setting +} +// GetPermission gets the permission property value. Permission that the team will have for its repositories +// returns a *string when successful +func (m *TeamSimple) GetPermission()(*string) { + return m.permission +} +// GetPrivacy gets the privacy property value. The level of privacy this team should have +// returns a *string when successful +func (m *TeamSimple) GetPrivacy()(*string) { + return m.privacy +} +// GetRepositoriesUrl gets the repositories_url property value. The repositories_url property +// returns a *string when successful +func (m *TeamSimple) GetRepositoriesUrl()(*string) { + return m.repositories_url +} +// GetSlug gets the slug property value. The slug property +// returns a *string when successful +func (m *TeamSimple) GetSlug()(*string) { + return m.slug +} +// GetUrl gets the url property value. URL for the team +// returns a *string when successful +func (m *TeamSimple) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TeamSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ldap_dn", m.GetLdapDn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("members_url", m.GetMembersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("notification_setting", m.GetNotificationSetting()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("permission", m.GetPermission()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("privacy", m.GetPrivacy()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repositories_url", m.GetRepositoriesUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("slug", m.GetSlug()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TeamSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. Description of the team +func (m *TeamSimple) SetDescription(value *string)() { + m.description = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TeamSimple) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the team +func (m *TeamSimple) SetId(value *int32)() { + m.id = value +} +// SetLdapDn sets the ldap_dn property value. Distinguished Name (DN) that team maps to within LDAP environment +func (m *TeamSimple) SetLdapDn(value *string)() { + m.ldap_dn = value +} +// SetMembersUrl sets the members_url property value. The members_url property +func (m *TeamSimple) SetMembersUrl(value *string)() { + m.members_url = value +} +// SetName sets the name property value. Name of the team +func (m *TeamSimple) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TeamSimple) SetNodeId(value *string)() { + m.node_id = value +} +// SetNotificationSetting sets the notification_setting property value. The notification setting the team has set +func (m *TeamSimple) SetNotificationSetting(value *string)() { + m.notification_setting = value +} +// SetPermission sets the permission property value. Permission that the team will have for its repositories +func (m *TeamSimple) SetPermission(value *string)() { + m.permission = value +} +// SetPrivacy sets the privacy property value. The level of privacy this team should have +func (m *TeamSimple) SetPrivacy(value *string)() { + m.privacy = value +} +// SetRepositoriesUrl sets the repositories_url property value. The repositories_url property +func (m *TeamSimple) SetRepositoriesUrl(value *string)() { + m.repositories_url = value +} +// SetSlug sets the slug property value. The slug property +func (m *TeamSimple) SetSlug(value *string)() { + m.slug = value +} +// SetUrl sets the url property value. URL for the team +func (m *TeamSimple) SetUrl(value *string)() { + m.url = value +} +type TeamSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLdapDn()(*string) + GetMembersUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetNotificationSetting()(*string) + GetPermission()(*string) + GetPrivacy()(*string) + GetRepositoriesUrl()(*string) + GetSlug()(*string) + GetUrl()(*string) + SetDescription(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLdapDn(value *string)() + SetMembersUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetNotificationSetting(value *string)() + SetPermission(value *string)() + SetPrivacy(value *string)() + SetRepositoriesUrl(value *string)() + SetSlug(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/thread.go b/pkg/github/models/thread.go new file mode 100644 index 00000000..094b07a1 --- /dev/null +++ b/pkg/github/models/thread.go @@ -0,0 +1,313 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Thread thread +type Thread struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *string + // The last_read_at property + last_read_at *string + // The reason property + reason *string + // Minimal Repository + repository MinimalRepositoryable + // The subject property + subject Thread_subjectable + // The subscription_url property + subscription_url *string + // The unread property + unread *bool + // The updated_at property + updated_at *string + // The url property + url *string +} +// NewThread instantiates a new Thread and sets the default values. +func NewThread()(*Thread) { + m := &Thread{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateThreadFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateThreadFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewThread(), 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 *Thread) 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 *Thread) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["last_read_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLastReadAt(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["subject"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateThread_subjectFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSubject(val.(Thread_subjectable)) + } + return nil + } + res["subscription_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionUrl(val) + } + return nil + } + res["unread"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUnread(val) + } + return nil + } + res["updated_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUpdatedAt(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *string when successful +func (m *Thread) GetId()(*string) { + return m.id +} +// GetLastReadAt gets the last_read_at property value. The last_read_at property +// returns a *string when successful +func (m *Thread) GetLastReadAt()(*string) { + return m.last_read_at +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *Thread) GetReason()(*string) { + return m.reason +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *Thread) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetSubject gets the subject property value. The subject property +// returns a Thread_subjectable when successful +func (m *Thread) GetSubject()(Thread_subjectable) { + return m.subject +} +// GetSubscriptionUrl gets the subscription_url property value. The subscription_url property +// returns a *string when successful +func (m *Thread) GetSubscriptionUrl()(*string) { + return m.subscription_url +} +// GetUnread gets the unread property value. The unread property +// returns a *bool when successful +func (m *Thread) GetUnread()(*bool) { + return m.unread +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *string when successful +func (m *Thread) GetUpdatedAt()(*string) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Thread) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Thread) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("last_read_at", m.GetLastReadAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("subject", m.GetSubject()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscription_url", m.GetSubscriptionUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("unread", m.GetUnread()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Thread) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *Thread) SetId(value *string)() { + m.id = value +} +// SetLastReadAt sets the last_read_at property value. The last_read_at property +func (m *Thread) SetLastReadAt(value *string)() { + m.last_read_at = value +} +// SetReason sets the reason property value. The reason property +func (m *Thread) SetReason(value *string)() { + m.reason = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *Thread) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetSubject sets the subject property value. The subject property +func (m *Thread) SetSubject(value Thread_subjectable)() { + m.subject = value +} +// SetSubscriptionUrl sets the subscription_url property value. The subscription_url property +func (m *Thread) SetSubscriptionUrl(value *string)() { + m.subscription_url = value +} +// SetUnread sets the unread property value. The unread property +func (m *Thread) SetUnread(value *bool)() { + m.unread = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Thread) SetUpdatedAt(value *string)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Thread) SetUrl(value *string)() { + m.url = value +} +type Threadable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*string) + GetLastReadAt()(*string) + GetReason()(*string) + GetRepository()(MinimalRepositoryable) + GetSubject()(Thread_subjectable) + GetSubscriptionUrl()(*string) + GetUnread()(*bool) + GetUpdatedAt()(*string) + GetUrl()(*string) + SetId(value *string)() + SetLastReadAt(value *string)() + SetReason(value *string)() + SetRepository(value MinimalRepositoryable)() + SetSubject(value Thread_subjectable)() + SetSubscriptionUrl(value *string)() + SetUnread(value *bool)() + SetUpdatedAt(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/thread_escaped_subject.go b/pkg/github/models/thread_escaped_subject.go new file mode 100644 index 00000000..252b430e --- /dev/null +++ b/pkg/github/models/thread_escaped_subject.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Thread_subject 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 latest_comment_url property + latest_comment_url *string + // The title property + title *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewThread_subject instantiates a new Thread_subject and sets the default values. +func NewThread_subject()(*Thread_subject) { + m := &Thread_subject{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateThread_subjectFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateThread_subjectFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewThread_subject(), 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 *Thread_subject) 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 *Thread_subject) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["latest_comment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLatestCommentUrl(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetLatestCommentUrl gets the latest_comment_url property value. The latest_comment_url property +// returns a *string when successful +func (m *Thread_subject) GetLatestCommentUrl()(*string) { + return m.latest_comment_url +} +// GetTitle gets the title property value. The title property +// returns a *string when successful +func (m *Thread_subject) GetTitle()(*string) { + return m.title +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *Thread_subject) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Thread_subject) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Thread_subject) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("latest_comment_url", m.GetLatestCommentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Thread_subject) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLatestCommentUrl sets the latest_comment_url property value. The latest_comment_url property +func (m *Thread_subject) SetLatestCommentUrl(value *string)() { + m.latest_comment_url = value +} +// SetTitle sets the title property value. The title property +func (m *Thread_subject) SetTitle(value *string)() { + m.title = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *Thread_subject) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *Thread_subject) SetUrl(value *string)() { + m.url = value +} +type Thread_subjectable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLatestCommentUrl()(*string) + GetTitle()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetLatestCommentUrl(value *string)() + SetTitle(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/thread_subscription.go b/pkg/github/models/thread_subscription.go new file mode 100644 index 00000000..2c473ff5 --- /dev/null +++ b/pkg/github/models/thread_subscription.go @@ -0,0 +1,256 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ThreadSubscription thread Subscription +type ThreadSubscription 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 ignored property + ignored *bool + // The reason property + reason *string + // The repository_url property + repository_url *string + // The subscribed property + subscribed *bool + // The thread_url property + thread_url *string + // The url property + url *string +} +// NewThreadSubscription instantiates a new ThreadSubscription and sets the default values. +func NewThreadSubscription()(*ThreadSubscription) { + m := &ThreadSubscription{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateThreadSubscriptionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateThreadSubscriptionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewThreadSubscription(), 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 *ThreadSubscription) 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 *ThreadSubscription) 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 *ThreadSubscription) 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["ignored"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIgnored(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["repository_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryUrl(val) + } + return nil + } + res["subscribed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribed(val) + } + return nil + } + res["thread_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetThreadUrl(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetIgnored gets the ignored property value. The ignored property +// returns a *bool when successful +func (m *ThreadSubscription) GetIgnored()(*bool) { + return m.ignored +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *ThreadSubscription) GetReason()(*string) { + return m.reason +} +// GetRepositoryUrl gets the repository_url property value. The repository_url property +// returns a *string when successful +func (m *ThreadSubscription) GetRepositoryUrl()(*string) { + return m.repository_url +} +// GetSubscribed gets the subscribed property value. The subscribed property +// returns a *bool when successful +func (m *ThreadSubscription) GetSubscribed()(*bool) { + return m.subscribed +} +// GetThreadUrl gets the thread_url property value. The thread_url property +// returns a *string when successful +func (m *ThreadSubscription) GetThreadUrl()(*string) { + return m.thread_url +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ThreadSubscription) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ThreadSubscription) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("ignored", m.GetIgnored()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_url", m.GetRepositoryUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("subscribed", m.GetSubscribed()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("thread_url", m.GetThreadUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ThreadSubscription) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *ThreadSubscription) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetIgnored sets the ignored property value. The ignored property +func (m *ThreadSubscription) SetIgnored(value *bool)() { + m.ignored = value +} +// SetReason sets the reason property value. The reason property +func (m *ThreadSubscription) SetReason(value *string)() { + m.reason = value +} +// SetRepositoryUrl sets the repository_url property value. The repository_url property +func (m *ThreadSubscription) SetRepositoryUrl(value *string)() { + m.repository_url = value +} +// SetSubscribed sets the subscribed property value. The subscribed property +func (m *ThreadSubscription) SetSubscribed(value *bool)() { + m.subscribed = value +} +// SetThreadUrl sets the thread_url property value. The thread_url property +func (m *ThreadSubscription) SetThreadUrl(value *string)() { + m.thread_url = value +} +// SetUrl sets the url property value. The url property +func (m *ThreadSubscription) SetUrl(value *string)() { + m.url = value +} +type ThreadSubscriptionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetIgnored()(*bool) + GetReason()(*string) + GetRepositoryUrl()(*string) + GetSubscribed()(*bool) + GetThreadUrl()(*string) + GetUrl()(*string) + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetIgnored(value *bool)() + SetReason(value *string)() + SetRepositoryUrl(value *string)() + SetSubscribed(value *bool)() + SetThreadUrl(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/timeline_assigned_issue_event.go b/pkg/github/models/timeline_assigned_issue_event.go new file mode 100644 index 00000000..4a9d802b --- /dev/null +++ b/pkg/github/models/timeline_assigned_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineAssignedIssueEvent timeline Assigned Issue Event +type TimelineAssignedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee SimpleUserable + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewTimelineAssignedIssueEvent instantiates a new TimelineAssignedIssueEvent and sets the default values. +func NewTimelineAssignedIssueEvent()(*TimelineAssignedIssueEvent) { + m := &TimelineAssignedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineAssignedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineAssignedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineAssignedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineAssignedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *TimelineAssignedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineAssignedIssueEvent) GetAssignee()(SimpleUserable) { + return m.assignee +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *TimelineAssignedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *TimelineAssignedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *TimelineAssignedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineAssignedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineAssignedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TimelineAssignedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TimelineAssignedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *TimelineAssignedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TimelineAssignedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TimelineAssignedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *TimelineAssignedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *TimelineAssignedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *TimelineAssignedIssueEvent) SetAssignee(value SimpleUserable)() { + m.assignee = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *TimelineAssignedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *TimelineAssignedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TimelineAssignedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineAssignedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *TimelineAssignedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TimelineAssignedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *TimelineAssignedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *TimelineAssignedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type TimelineAssignedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetAssignee()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetAssignee(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/timeline_comment_event.go b/pkg/github/models/timeline_comment_event.go new file mode 100644 index 00000000..129e61b2 --- /dev/null +++ b/pkg/github/models/timeline_comment_event.go @@ -0,0 +1,518 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineCommentEvent timeline Comment Event +type TimelineCommentEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // Contents of the issue comment + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The event property + event *string + // The html_url property + html_url *string + // Unique identifier of the issue comment + id *int32 + // The issue_url property + issue_url *string + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The reactions property + reactions ReactionRollupable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // URL for the issue comment + url *string + // A GitHub user. + user SimpleUserable +} +// NewTimelineCommentEvent instantiates a new TimelineCommentEvent and sets the default values. +func NewTimelineCommentEvent()(*TimelineCommentEvent) { + m := &TimelineCommentEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommentEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommentEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommentEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineCommentEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *TimelineCommentEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *TimelineCommentEvent) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. Contents of the issue comment +// returns a *string when successful +func (m *TimelineCommentEvent) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *TimelineCommentEvent) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *TimelineCommentEvent) GetBodyText()(*string) { + return m.body_text +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *TimelineCommentEvent) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineCommentEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCommentEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + 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["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["issue_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetIssueUrl(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["reactions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateReactionRollupFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetReactions(val.(ReactionRollupable)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TimelineCommentEvent) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the issue comment +// returns a *int32 when successful +func (m *TimelineCommentEvent) GetId()(*int32) { + return m.id +} +// GetIssueUrl gets the issue_url property value. The issue_url property +// returns a *string when successful +func (m *TimelineCommentEvent) GetIssueUrl()(*string) { + return m.issue_url +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TimelineCommentEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *TimelineCommentEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetReactions gets the reactions property value. The reactions property +// returns a ReactionRollupable when successful +func (m *TimelineCommentEvent) GetReactions()(ReactionRollupable) { + return m.reactions +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TimelineCommentEvent) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. URL for the issue comment +// returns a *string when successful +func (m *TimelineCommentEvent) GetUrl()(*string) { + return m.url +} +// GetUser gets the user property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineCommentEvent) GetUser()(SimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *TimelineCommentEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("issue_url", m.GetIssueUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("reactions", m.GetReactions()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *TimelineCommentEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *TimelineCommentEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *TimelineCommentEvent) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. Contents of the issue comment +func (m *TimelineCommentEvent) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *TimelineCommentEvent) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *TimelineCommentEvent) SetBodyText(value *string)() { + m.body_text = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TimelineCommentEvent) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineCommentEvent) SetEvent(value *string)() { + m.event = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TimelineCommentEvent) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the issue comment +func (m *TimelineCommentEvent) SetId(value *int32)() { + m.id = value +} +// SetIssueUrl sets the issue_url property value. The issue_url property +func (m *TimelineCommentEvent) SetIssueUrl(value *string)() { + m.issue_url = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TimelineCommentEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *TimelineCommentEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetReactions sets the reactions property value. The reactions property +func (m *TimelineCommentEvent) SetReactions(value ReactionRollupable)() { + m.reactions = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TimelineCommentEvent) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. URL for the issue comment +func (m *TimelineCommentEvent) SetUrl(value *string)() { + m.url = value +} +// SetUser sets the user property value. A GitHub user. +func (m *TimelineCommentEvent) SetUser(value SimpleUserable)() { + m.user = value +} +type TimelineCommentEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEvent()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetIssueUrl()(*string) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetReactions()(ReactionRollupable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetUser()(SimpleUserable) + SetActor(value SimpleUserable)() + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEvent(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetIssueUrl(value *string)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetReactions(value ReactionRollupable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetUser(value SimpleUserable)() +} diff --git a/pkg/github/models/timeline_commit_commented_event.go b/pkg/github/models/timeline_commit_commented_event.go new file mode 100644 index 00000000..c5a92844 --- /dev/null +++ b/pkg/github/models/timeline_commit_commented_event.go @@ -0,0 +1,180 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineCommitCommentedEvent timeline Commit Commented Event +type TimelineCommitCommentedEvent 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 comments property + comments []CommitCommentable + // The commit_id property + commit_id *string + // The event property + event *string + // The node_id property + node_id *string +} +// NewTimelineCommitCommentedEvent instantiates a new TimelineCommitCommentedEvent and sets the default values. +func NewTimelineCommitCommentedEvent()(*TimelineCommitCommentedEvent) { + m := &TimelineCommitCommentedEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommitCommentedEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommitCommentedEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommitCommentedEvent(), 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 *TimelineCommitCommentedEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. The comments property +// returns a []CommitCommentable when successful +func (m *TimelineCommitCommentedEvent) GetComments()([]CommitCommentable) { + return m.comments +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *TimelineCommitCommentedEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineCommitCommentedEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCommitCommentedEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateCommitCommentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]CommitCommentable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(CommitCommentable) + } + } + m.SetComments(res) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + return res +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TimelineCommitCommentedEvent) GetNodeId()(*string) { + return m.node_id +} +// Serialize serializes information the current object +func (m *TimelineCommitCommentedEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetComments() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetComments())) + for i, v := range m.GetComments() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("comments", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + 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 *TimelineCommitCommentedEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. The comments property +func (m *TimelineCommitCommentedEvent) SetComments(value []CommitCommentable)() { + m.comments = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *TimelineCommitCommentedEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineCommitCommentedEvent) SetEvent(value *string)() { + m.event = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TimelineCommitCommentedEvent) SetNodeId(value *string)() { + m.node_id = value +} +type TimelineCommitCommentedEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()([]CommitCommentable) + GetCommitId()(*string) + GetEvent()(*string) + GetNodeId()(*string) + SetComments(value []CommitCommentable)() + SetCommitId(value *string)() + SetEvent(value *string)() + SetNodeId(value *string)() +} diff --git a/pkg/github/models/timeline_committed_event.go b/pkg/github/models/timeline_committed_event.go new file mode 100644 index 00000000..e9ed04b4 --- /dev/null +++ b/pkg/github/models/timeline_committed_event.go @@ -0,0 +1,383 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineCommittedEvent timeline Committed Event +type TimelineCommittedEvent struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Identifying information for the git-user + author TimelineCommittedEvent_authorable + // Identifying information for the git-user + committer TimelineCommittedEvent_committerable + // The event property + event *string + // The html_url property + html_url *string + // Message describing the purpose of the commit + message *string + // The node_id property + node_id *string + // The parents property + parents []TimelineCommittedEvent_parentsable + // SHA for the commit + sha *string + // The tree property + tree TimelineCommittedEvent_treeable + // The url property + url *string + // The verification property + verification TimelineCommittedEvent_verificationable +} +// NewTimelineCommittedEvent instantiates a new TimelineCommittedEvent and sets the default values. +func NewTimelineCommittedEvent()(*TimelineCommittedEvent) { + m := &TimelineCommittedEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommittedEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommittedEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommittedEvent(), 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 *TimelineCommittedEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. Identifying information for the git-user +// returns a TimelineCommittedEvent_authorable when successful +func (m *TimelineCommittedEvent) GetAuthor()(TimelineCommittedEvent_authorable) { + return m.author +} +// GetCommitter gets the committer property value. Identifying information for the git-user +// returns a TimelineCommittedEvent_committerable when successful +func (m *TimelineCommittedEvent) GetCommitter()(TimelineCommittedEvent_committerable) { + return m.committer +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineCommittedEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCommittedEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineCommittedEvent_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(TimelineCommittedEvent_authorable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineCommittedEvent_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(TimelineCommittedEvent_committerable)) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(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 + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["parents"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTimelineCommittedEvent_parentsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]TimelineCommittedEvent_parentsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(TimelineCommittedEvent_parentsable) + } + } + m.SetParents(res) + } + return nil + } + 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["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineCommittedEvent_treeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTree(val.(TimelineCommittedEvent_treeable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["verification"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineCommittedEvent_verificationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetVerification(val.(TimelineCommittedEvent_verificationable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TimelineCommittedEvent) GetHtmlUrl()(*string) { + return m.html_url +} +// GetMessage gets the message property value. Message describing the purpose of the commit +// returns a *string when successful +func (m *TimelineCommittedEvent) GetMessage()(*string) { + return m.message +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TimelineCommittedEvent) GetNodeId()(*string) { + return m.node_id +} +// GetParents gets the parents property value. The parents property +// returns a []TimelineCommittedEvent_parentsable when successful +func (m *TimelineCommittedEvent) GetParents()([]TimelineCommittedEvent_parentsable) { + return m.parents +} +// GetSha gets the sha property value. SHA for the commit +// returns a *string when successful +func (m *TimelineCommittedEvent) GetSha()(*string) { + return m.sha +} +// GetTree gets the tree property value. The tree property +// returns a TimelineCommittedEvent_treeable when successful +func (m *TimelineCommittedEvent) GetTree()(TimelineCommittedEvent_treeable) { + return m.tree +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TimelineCommittedEvent) GetUrl()(*string) { + return m.url +} +// GetVerification gets the verification property value. The verification property +// returns a TimelineCommittedEvent_verificationable when successful +func (m *TimelineCommittedEvent) GetVerification()(TimelineCommittedEvent_verificationable) { + return m.verification +} +// Serialize serializes information the current object +func (m *TimelineCommittedEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + if m.GetParents() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetParents())) + for i, v := range m.GetParents() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("parents", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tree", m.GetTree()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("verification", m.GetVerification()) + 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 *TimelineCommittedEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. Identifying information for the git-user +func (m *TimelineCommittedEvent) SetAuthor(value TimelineCommittedEvent_authorable)() { + m.author = value +} +// SetCommitter sets the committer property value. Identifying information for the git-user +func (m *TimelineCommittedEvent) SetCommitter(value TimelineCommittedEvent_committerable)() { + m.committer = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineCommittedEvent) SetEvent(value *string)() { + m.event = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TimelineCommittedEvent) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetMessage sets the message property value. Message describing the purpose of the commit +func (m *TimelineCommittedEvent) SetMessage(value *string)() { + m.message = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TimelineCommittedEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetParents sets the parents property value. The parents property +func (m *TimelineCommittedEvent) SetParents(value []TimelineCommittedEvent_parentsable)() { + m.parents = value +} +// SetSha sets the sha property value. SHA for the commit +func (m *TimelineCommittedEvent) SetSha(value *string)() { + m.sha = value +} +// SetTree sets the tree property value. The tree property +func (m *TimelineCommittedEvent) SetTree(value TimelineCommittedEvent_treeable)() { + m.tree = value +} +// SetUrl sets the url property value. The url property +func (m *TimelineCommittedEvent) SetUrl(value *string)() { + m.url = value +} +// SetVerification sets the verification property value. The verification property +func (m *TimelineCommittedEvent) SetVerification(value TimelineCommittedEvent_verificationable)() { + m.verification = value +} +type TimelineCommittedEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(TimelineCommittedEvent_authorable) + GetCommitter()(TimelineCommittedEvent_committerable) + GetEvent()(*string) + GetHtmlUrl()(*string) + GetMessage()(*string) + GetNodeId()(*string) + GetParents()([]TimelineCommittedEvent_parentsable) + GetSha()(*string) + GetTree()(TimelineCommittedEvent_treeable) + GetUrl()(*string) + GetVerification()(TimelineCommittedEvent_verificationable) + SetAuthor(value TimelineCommittedEvent_authorable)() + SetCommitter(value TimelineCommittedEvent_committerable)() + SetEvent(value *string)() + SetHtmlUrl(value *string)() + SetMessage(value *string)() + SetNodeId(value *string)() + SetParents(value []TimelineCommittedEvent_parentsable)() + SetSha(value *string)() + SetTree(value TimelineCommittedEvent_treeable)() + SetUrl(value *string)() + SetVerification(value TimelineCommittedEvent_verificationable)() +} diff --git a/pkg/github/models/timeline_committed_event_escaped_author.go b/pkg/github/models/timeline_committed_event_escaped_author.go new file mode 100644 index 00000000..8e7fa09c --- /dev/null +++ b/pkg/github/models/timeline_committed_event_escaped_author.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineCommittedEvent_author identifying information for the git-user +type TimelineCommittedEvent_author struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Timestamp of the commit + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Git email address of the user + email *string + // Name of the git user + name *string +} +// NewTimelineCommittedEvent_author instantiates a new TimelineCommittedEvent_author and sets the default values. +func NewTimelineCommittedEvent_author()(*TimelineCommittedEvent_author) { + m := &TimelineCommittedEvent_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommittedEvent_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommittedEvent_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommittedEvent_author(), 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 *TimelineCommittedEvent_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. Timestamp of the commit +// returns a *Time when successful +func (m *TimelineCommittedEvent_author) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. Git email address of the user +// returns a *string when successful +func (m *TimelineCommittedEvent_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCommittedEvent_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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. Name of the git user +// returns a *string when successful +func (m *TimelineCommittedEvent_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *TimelineCommittedEvent_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *TimelineCommittedEvent_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. Timestamp of the commit +func (m *TimelineCommittedEvent_author) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. Git email address of the user +func (m *TimelineCommittedEvent_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the git user +func (m *TimelineCommittedEvent_author) SetName(value *string)() { + m.name = value +} +type TimelineCommittedEvent_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/timeline_committed_event_escaped_committer.go b/pkg/github/models/timeline_committed_event_escaped_committer.go new file mode 100644 index 00000000..bf582488 --- /dev/null +++ b/pkg/github/models/timeline_committed_event_escaped_committer.go @@ -0,0 +1,140 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineCommittedEvent_committer identifying information for the git-user +type TimelineCommittedEvent_committer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Timestamp of the commit + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Git email address of the user + email *string + // Name of the git user + name *string +} +// NewTimelineCommittedEvent_committer instantiates a new TimelineCommittedEvent_committer and sets the default values. +func NewTimelineCommittedEvent_committer()(*TimelineCommittedEvent_committer) { + m := &TimelineCommittedEvent_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommittedEvent_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommittedEvent_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommittedEvent_committer(), 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 *TimelineCommittedEvent_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. Timestamp of the commit +// returns a *Time when successful +func (m *TimelineCommittedEvent_committer) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. Git email address of the user +// returns a *string when successful +func (m *TimelineCommittedEvent_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCommittedEvent_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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. Name of the git user +// returns a *string when successful +func (m *TimelineCommittedEvent_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *TimelineCommittedEvent_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *TimelineCommittedEvent_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. Timestamp of the commit +func (m *TimelineCommittedEvent_committer) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. Git email address of the user +func (m *TimelineCommittedEvent_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. Name of the git user +func (m *TimelineCommittedEvent_committer) SetName(value *string)() { + m.name = value +} +type TimelineCommittedEvent_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/timeline_committed_event_escaped_parents.go b/pkg/github/models/timeline_committed_event_escaped_parents.go new file mode 100644 index 00000000..f6c79c36 --- /dev/null +++ b/pkg/github/models/timeline_committed_event_escaped_parents.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TimelineCommittedEvent_parents 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 html_url property + html_url *string + // SHA for the commit + sha *string + // The url property + url *string +} +// NewTimelineCommittedEvent_parents instantiates a new TimelineCommittedEvent_parents and sets the default values. +func NewTimelineCommittedEvent_parents()(*TimelineCommittedEvent_parents) { + m := &TimelineCommittedEvent_parents{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommittedEvent_parentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommittedEvent_parentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommittedEvent_parents(), 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 *TimelineCommittedEvent_parents) 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 *TimelineCommittedEvent_parents) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TimelineCommittedEvent_parents) GetHtmlUrl()(*string) { + return m.html_url +} +// GetSha gets the sha property value. SHA for the commit +// returns a *string when successful +func (m *TimelineCommittedEvent_parents) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TimelineCommittedEvent_parents) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TimelineCommittedEvent_parents) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TimelineCommittedEvent_parents) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TimelineCommittedEvent_parents) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetSha sets the sha property value. SHA for the commit +func (m *TimelineCommittedEvent_parents) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *TimelineCommittedEvent_parents) SetUrl(value *string)() { + m.url = value +} +type TimelineCommittedEvent_parentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtmlUrl()(*string) + GetSha()(*string) + GetUrl()(*string) + SetHtmlUrl(value *string)() + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/timeline_committed_event_escaped_tree.go b/pkg/github/models/timeline_committed_event_escaped_tree.go new file mode 100644 index 00000000..7286cc68 --- /dev/null +++ b/pkg/github/models/timeline_committed_event_escaped_tree.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TimelineCommittedEvent_tree 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 for the commit + sha *string + // The url property + url *string +} +// NewTimelineCommittedEvent_tree instantiates a new TimelineCommittedEvent_tree and sets the default values. +func NewTimelineCommittedEvent_tree()(*TimelineCommittedEvent_tree) { + m := &TimelineCommittedEvent_tree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommittedEvent_treeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommittedEvent_treeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommittedEvent_tree(), 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 *TimelineCommittedEvent_tree) 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 *TimelineCommittedEvent_tree) 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. SHA for the commit +// returns a *string when successful +func (m *TimelineCommittedEvent_tree) GetSha()(*string) { + return m.sha +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TimelineCommittedEvent_tree) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TimelineCommittedEvent_tree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("sha", m.GetSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *TimelineCommittedEvent_tree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSha sets the sha property value. SHA for the commit +func (m *TimelineCommittedEvent_tree) SetSha(value *string)() { + m.sha = value +} +// SetUrl sets the url property value. The url property +func (m *TimelineCommittedEvent_tree) SetUrl(value *string)() { + m.url = value +} +type TimelineCommittedEvent_treeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSha()(*string) + GetUrl()(*string) + SetSha(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/timeline_committed_event_escaped_verification.go b/pkg/github/models/timeline_committed_event_escaped_verification.go new file mode 100644 index 00000000..8d14cad8 --- /dev/null +++ b/pkg/github/models/timeline_committed_event_escaped_verification.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TimelineCommittedEvent_verification 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 payload property + payload *string + // The reason property + reason *string + // The signature property + signature *string + // The verified property + verified *bool +} +// NewTimelineCommittedEvent_verification instantiates a new TimelineCommittedEvent_verification and sets the default values. +func NewTimelineCommittedEvent_verification()(*TimelineCommittedEvent_verification) { + m := &TimelineCommittedEvent_verification{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCommittedEvent_verificationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCommittedEvent_verificationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCommittedEvent_verification(), 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 *TimelineCommittedEvent_verification) 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 *TimelineCommittedEvent_verification) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["signature"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSignature(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetPayload gets the payload property value. The payload property +// returns a *string when successful +func (m *TimelineCommittedEvent_verification) GetPayload()(*string) { + return m.payload +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *TimelineCommittedEvent_verification) GetReason()(*string) { + return m.reason +} +// GetSignature gets the signature property value. The signature property +// returns a *string when successful +func (m *TimelineCommittedEvent_verification) GetSignature()(*string) { + return m.signature +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *TimelineCommittedEvent_verification) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *TimelineCommittedEvent_verification) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("signature", m.GetSignature()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + 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 *TimelineCommittedEvent_verification) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPayload sets the payload property value. The payload property +func (m *TimelineCommittedEvent_verification) SetPayload(value *string)() { + m.payload = value +} +// SetReason sets the reason property value. The reason property +func (m *TimelineCommittedEvent_verification) SetReason(value *string)() { + m.reason = value +} +// SetSignature sets the signature property value. The signature property +func (m *TimelineCommittedEvent_verification) SetSignature(value *string)() { + m.signature = value +} +// SetVerified sets the verified property value. The verified property +func (m *TimelineCommittedEvent_verification) SetVerified(value *bool)() { + m.verified = value +} +type TimelineCommittedEvent_verificationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPayload()(*string) + GetReason()(*string) + GetSignature()(*string) + GetVerified()(*bool) + SetPayload(value *string)() + SetReason(value *string)() + SetSignature(value *string)() + SetVerified(value *bool)() +} diff --git a/pkg/github/models/timeline_cross_referenced_event.go b/pkg/github/models/timeline_cross_referenced_event.go new file mode 100644 index 00000000..30445865 --- /dev/null +++ b/pkg/github/models/timeline_cross_referenced_event.go @@ -0,0 +1,198 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineCrossReferencedEvent timeline Cross Referenced Event +type TimelineCrossReferencedEvent struct { + // A GitHub user. + actor SimpleUserable + // 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 event property + event *string + // The source property + source TimelineCrossReferencedEvent_sourceable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewTimelineCrossReferencedEvent instantiates a new TimelineCrossReferencedEvent and sets the default values. +func NewTimelineCrossReferencedEvent()(*TimelineCrossReferencedEvent) { + m := &TimelineCrossReferencedEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCrossReferencedEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCrossReferencedEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCrossReferencedEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineCrossReferencedEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *TimelineCrossReferencedEvent) 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 *TimelineCrossReferencedEvent) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineCrossReferencedEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineCrossReferencedEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + 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["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineCrossReferencedEvent_sourceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSource(val.(TimelineCrossReferencedEvent_sourceable)) + } + 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 + } + return res +} +// GetSource gets the source property value. The source property +// returns a TimelineCrossReferencedEvent_sourceable when successful +func (m *TimelineCrossReferencedEvent) GetSource()(TimelineCrossReferencedEvent_sourceable) { + return m.source +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TimelineCrossReferencedEvent) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *TimelineCrossReferencedEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("source", m.GetSource()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *TimelineCrossReferencedEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *TimelineCrossReferencedEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TimelineCrossReferencedEvent) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineCrossReferencedEvent) SetEvent(value *string)() { + m.event = value +} +// SetSource sets the source property value. The source property +func (m *TimelineCrossReferencedEvent) SetSource(value TimelineCrossReferencedEvent_sourceable)() { + m.source = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TimelineCrossReferencedEvent) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type TimelineCrossReferencedEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEvent()(*string) + GetSource()(TimelineCrossReferencedEvent_sourceable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetActor(value SimpleUserable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEvent(value *string)() + SetSource(value TimelineCrossReferencedEvent_sourceable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/timeline_cross_referenced_event_escaped_source.go b/pkg/github/models/timeline_cross_referenced_event_escaped_source.go new file mode 100644 index 00000000..e0dbbd8f --- /dev/null +++ b/pkg/github/models/timeline_cross_referenced_event_escaped_source.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TimelineCrossReferencedEvent_source struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. + issue Issueable + // The type property + typeEscaped *string +} +// NewTimelineCrossReferencedEvent_source instantiates a new TimelineCrossReferencedEvent_source and sets the default values. +func NewTimelineCrossReferencedEvent_source()(*TimelineCrossReferencedEvent_source) { + m := &TimelineCrossReferencedEvent_source{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineCrossReferencedEvent_sourceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineCrossReferencedEvent_sourceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineCrossReferencedEvent_source(), 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 *TimelineCrossReferencedEvent_source) 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 *TimelineCrossReferencedEvent_source) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["issue"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateIssueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetIssue(val.(Issueable)) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + return res +} +// GetIssue gets the issue property value. Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +// returns a Issueable when successful +func (m *TimelineCrossReferencedEvent_source) GetIssue()(Issueable) { + return m.issue +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *TimelineCrossReferencedEvent_source) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *TimelineCrossReferencedEvent_source) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("issue", m.GetIssue()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + 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 *TimelineCrossReferencedEvent_source) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIssue sets the issue property value. Issues are a great way to keep track of tasks, enhancements, and bugs for your projects. +func (m *TimelineCrossReferencedEvent_source) SetIssue(value Issueable)() { + m.issue = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *TimelineCrossReferencedEvent_source) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +type TimelineCrossReferencedEvent_sourceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIssue()(Issueable) + GetTypeEscaped()(*string) + SetIssue(value Issueable)() + SetTypeEscaped(value *string)() +} diff --git a/pkg/github/models/timeline_issue_events.go b/pkg/github/models/timeline_issue_events.go new file mode 100644 index 00000000..f48fc553 --- /dev/null +++ b/pkg/github/models/timeline_issue_events.go @@ -0,0 +1,592 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineIssueEvents composed type wrapper for classes AddedToProjectIssueEventable, ConvertedNoteToIssueIssueEventable, DemilestonedIssueEventable, LabeledIssueEventable, LockedIssueEventable, MilestonedIssueEventable, MovedColumnInProjectIssueEventable, RemovedFromProjectIssueEventable, RenamedIssueEventable, ReviewDismissedIssueEventable, ReviewRequestedIssueEventable, ReviewRequestRemovedIssueEventable, StateChangeIssueEventable, TimelineAssignedIssueEventable, TimelineCommentEventable, TimelineCommitCommentedEventable, TimelineCommittedEventable, TimelineCrossReferencedEventable, TimelineLineCommentedEventable, TimelineReviewedEventable, TimelineUnassignedIssueEventable, UnlabeledIssueEventable +type TimelineIssueEvents struct { + // Composed type representation for type AddedToProjectIssueEventable + addedToProjectIssueEvent AddedToProjectIssueEventable + // Composed type representation for type ConvertedNoteToIssueIssueEventable + convertedNoteToIssueIssueEvent ConvertedNoteToIssueIssueEventable + // Composed type representation for type DemilestonedIssueEventable + demilestonedIssueEvent DemilestonedIssueEventable + // Composed type representation for type LabeledIssueEventable + labeledIssueEvent LabeledIssueEventable + // Composed type representation for type LockedIssueEventable + lockedIssueEvent LockedIssueEventable + // Composed type representation for type MilestonedIssueEventable + milestonedIssueEvent MilestonedIssueEventable + // Composed type representation for type MovedColumnInProjectIssueEventable + movedColumnInProjectIssueEvent MovedColumnInProjectIssueEventable + // Composed type representation for type RemovedFromProjectIssueEventable + removedFromProjectIssueEvent RemovedFromProjectIssueEventable + // Composed type representation for type RenamedIssueEventable + renamedIssueEvent RenamedIssueEventable + // Composed type representation for type ReviewDismissedIssueEventable + reviewDismissedIssueEvent ReviewDismissedIssueEventable + // Composed type representation for type ReviewRequestedIssueEventable + reviewRequestedIssueEvent ReviewRequestedIssueEventable + // Composed type representation for type ReviewRequestRemovedIssueEventable + reviewRequestRemovedIssueEvent ReviewRequestRemovedIssueEventable + // Composed type representation for type StateChangeIssueEventable + stateChangeIssueEvent StateChangeIssueEventable + // Composed type representation for type TimelineAssignedIssueEventable + timelineAssignedIssueEvent TimelineAssignedIssueEventable + // Composed type representation for type TimelineCommentEventable + timelineCommentEvent TimelineCommentEventable + // Composed type representation for type TimelineCommitCommentedEventable + timelineCommitCommentedEvent TimelineCommitCommentedEventable + // Composed type representation for type TimelineCommittedEventable + timelineCommittedEvent TimelineCommittedEventable + // Composed type representation for type TimelineCrossReferencedEventable + timelineCrossReferencedEvent TimelineCrossReferencedEventable + // Composed type representation for type TimelineLineCommentedEventable + timelineLineCommentedEvent TimelineLineCommentedEventable + // Composed type representation for type TimelineReviewedEventable + timelineReviewedEvent TimelineReviewedEventable + // Composed type representation for type TimelineUnassignedIssueEventable + timelineUnassignedIssueEvent TimelineUnassignedIssueEventable + // Composed type representation for type UnlabeledIssueEventable + unlabeledIssueEvent UnlabeledIssueEventable +} +// NewTimelineIssueEvents instantiates a new TimelineIssueEvents and sets the default values. +func NewTimelineIssueEvents()(*TimelineIssueEvents) { + m := &TimelineIssueEvents{ + } + return m +} +// CreateTimelineIssueEventsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineIssueEventsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewTimelineIssueEvents() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateAddedToProjectIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(AddedToProjectIssueEventable); ok { + result.SetAddedToProjectIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateConvertedNoteToIssueIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ConvertedNoteToIssueIssueEventable); ok { + result.SetConvertedNoteToIssueIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateDemilestonedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(DemilestonedIssueEventable); ok { + result.SetDemilestonedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateLabeledIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(LabeledIssueEventable); ok { + result.SetLabeledIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateLockedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(LockedIssueEventable); ok { + result.SetLockedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateMilestonedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(MilestonedIssueEventable); ok { + result.SetMilestonedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateMovedColumnInProjectIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(MovedColumnInProjectIssueEventable); ok { + result.SetMovedColumnInProjectIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateRemovedFromProjectIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(RemovedFromProjectIssueEventable); ok { + result.SetRemovedFromProjectIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateRenamedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(RenamedIssueEventable); ok { + result.SetRenamedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateReviewDismissedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ReviewDismissedIssueEventable); ok { + result.SetReviewDismissedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateReviewRequestedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ReviewRequestedIssueEventable); ok { + result.SetReviewRequestedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateReviewRequestRemovedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ReviewRequestRemovedIssueEventable); ok { + result.SetReviewRequestRemovedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateStateChangeIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(StateChangeIssueEventable); ok { + result.SetStateChangeIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineAssignedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineAssignedIssueEventable); ok { + result.SetTimelineAssignedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineCommentEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineCommentEventable); ok { + result.SetTimelineCommentEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineCommitCommentedEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineCommitCommentedEventable); ok { + result.SetTimelineCommitCommentedEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineCommittedEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineCommittedEventable); ok { + result.SetTimelineCommittedEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineCrossReferencedEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineCrossReferencedEventable); ok { + result.SetTimelineCrossReferencedEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineLineCommentedEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineLineCommentedEventable); ok { + result.SetTimelineLineCommentedEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineReviewedEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineReviewedEventable); ok { + result.SetTimelineReviewedEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateTimelineUnassignedIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(TimelineUnassignedIssueEventable); ok { + result.SetTimelineUnassignedIssueEvent(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateUnlabeledIssueEventFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(UnlabeledIssueEventable); ok { + result.SetUnlabeledIssueEvent(cast) + } + } + } + return result, nil +} +// GetAddedToProjectIssueEvent gets the addedToProjectIssueEvent property value. Composed type representation for type AddedToProjectIssueEventable +// returns a AddedToProjectIssueEventable when successful +func (m *TimelineIssueEvents) GetAddedToProjectIssueEvent()(AddedToProjectIssueEventable) { + return m.addedToProjectIssueEvent +} +// GetConvertedNoteToIssueIssueEvent gets the convertedNoteToIssueIssueEvent property value. Composed type representation for type ConvertedNoteToIssueIssueEventable +// returns a ConvertedNoteToIssueIssueEventable when successful +func (m *TimelineIssueEvents) GetConvertedNoteToIssueIssueEvent()(ConvertedNoteToIssueIssueEventable) { + return m.convertedNoteToIssueIssueEvent +} +// GetDemilestonedIssueEvent gets the demilestonedIssueEvent property value. Composed type representation for type DemilestonedIssueEventable +// returns a DemilestonedIssueEventable when successful +func (m *TimelineIssueEvents) GetDemilestonedIssueEvent()(DemilestonedIssueEventable) { + return m.demilestonedIssueEvent +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineIssueEvents) 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 *TimelineIssueEvents) GetIsComposedType()(bool) { + return true +} +// GetLabeledIssueEvent gets the labeledIssueEvent property value. Composed type representation for type LabeledIssueEventable +// returns a LabeledIssueEventable when successful +func (m *TimelineIssueEvents) GetLabeledIssueEvent()(LabeledIssueEventable) { + return m.labeledIssueEvent +} +// GetLockedIssueEvent gets the lockedIssueEvent property value. Composed type representation for type LockedIssueEventable +// returns a LockedIssueEventable when successful +func (m *TimelineIssueEvents) GetLockedIssueEvent()(LockedIssueEventable) { + return m.lockedIssueEvent +} +// GetMilestonedIssueEvent gets the milestonedIssueEvent property value. Composed type representation for type MilestonedIssueEventable +// returns a MilestonedIssueEventable when successful +func (m *TimelineIssueEvents) GetMilestonedIssueEvent()(MilestonedIssueEventable) { + return m.milestonedIssueEvent +} +// GetMovedColumnInProjectIssueEvent gets the movedColumnInProjectIssueEvent property value. Composed type representation for type MovedColumnInProjectIssueEventable +// returns a MovedColumnInProjectIssueEventable when successful +func (m *TimelineIssueEvents) GetMovedColumnInProjectIssueEvent()(MovedColumnInProjectIssueEventable) { + return m.movedColumnInProjectIssueEvent +} +// GetRemovedFromProjectIssueEvent gets the removedFromProjectIssueEvent property value. Composed type representation for type RemovedFromProjectIssueEventable +// returns a RemovedFromProjectIssueEventable when successful +func (m *TimelineIssueEvents) GetRemovedFromProjectIssueEvent()(RemovedFromProjectIssueEventable) { + return m.removedFromProjectIssueEvent +} +// GetRenamedIssueEvent gets the renamedIssueEvent property value. Composed type representation for type RenamedIssueEventable +// returns a RenamedIssueEventable when successful +func (m *TimelineIssueEvents) GetRenamedIssueEvent()(RenamedIssueEventable) { + return m.renamedIssueEvent +} +// GetReviewDismissedIssueEvent gets the reviewDismissedIssueEvent property value. Composed type representation for type ReviewDismissedIssueEventable +// returns a ReviewDismissedIssueEventable when successful +func (m *TimelineIssueEvents) GetReviewDismissedIssueEvent()(ReviewDismissedIssueEventable) { + return m.reviewDismissedIssueEvent +} +// GetReviewRequestedIssueEvent gets the reviewRequestedIssueEvent property value. Composed type representation for type ReviewRequestedIssueEventable +// returns a ReviewRequestedIssueEventable when successful +func (m *TimelineIssueEvents) GetReviewRequestedIssueEvent()(ReviewRequestedIssueEventable) { + return m.reviewRequestedIssueEvent +} +// GetReviewRequestRemovedIssueEvent gets the reviewRequestRemovedIssueEvent property value. Composed type representation for type ReviewRequestRemovedIssueEventable +// returns a ReviewRequestRemovedIssueEventable when successful +func (m *TimelineIssueEvents) GetReviewRequestRemovedIssueEvent()(ReviewRequestRemovedIssueEventable) { + return m.reviewRequestRemovedIssueEvent +} +// GetStateChangeIssueEvent gets the stateChangeIssueEvent property value. Composed type representation for type StateChangeIssueEventable +// returns a StateChangeIssueEventable when successful +func (m *TimelineIssueEvents) GetStateChangeIssueEvent()(StateChangeIssueEventable) { + return m.stateChangeIssueEvent +} +// GetTimelineAssignedIssueEvent gets the timelineAssignedIssueEvent property value. Composed type representation for type TimelineAssignedIssueEventable +// returns a TimelineAssignedIssueEventable when successful +func (m *TimelineIssueEvents) GetTimelineAssignedIssueEvent()(TimelineAssignedIssueEventable) { + return m.timelineAssignedIssueEvent +} +// GetTimelineCommentEvent gets the timelineCommentEvent property value. Composed type representation for type TimelineCommentEventable +// returns a TimelineCommentEventable when successful +func (m *TimelineIssueEvents) GetTimelineCommentEvent()(TimelineCommentEventable) { + return m.timelineCommentEvent +} +// GetTimelineCommitCommentedEvent gets the timelineCommitCommentedEvent property value. Composed type representation for type TimelineCommitCommentedEventable +// returns a TimelineCommitCommentedEventable when successful +func (m *TimelineIssueEvents) GetTimelineCommitCommentedEvent()(TimelineCommitCommentedEventable) { + return m.timelineCommitCommentedEvent +} +// GetTimelineCommittedEvent gets the timelineCommittedEvent property value. Composed type representation for type TimelineCommittedEventable +// returns a TimelineCommittedEventable when successful +func (m *TimelineIssueEvents) GetTimelineCommittedEvent()(TimelineCommittedEventable) { + return m.timelineCommittedEvent +} +// GetTimelineCrossReferencedEvent gets the timelineCrossReferencedEvent property value. Composed type representation for type TimelineCrossReferencedEventable +// returns a TimelineCrossReferencedEventable when successful +func (m *TimelineIssueEvents) GetTimelineCrossReferencedEvent()(TimelineCrossReferencedEventable) { + return m.timelineCrossReferencedEvent +} +// GetTimelineLineCommentedEvent gets the timelineLineCommentedEvent property value. Composed type representation for type TimelineLineCommentedEventable +// returns a TimelineLineCommentedEventable when successful +func (m *TimelineIssueEvents) GetTimelineLineCommentedEvent()(TimelineLineCommentedEventable) { + return m.timelineLineCommentedEvent +} +// GetTimelineReviewedEvent gets the timelineReviewedEvent property value. Composed type representation for type TimelineReviewedEventable +// returns a TimelineReviewedEventable when successful +func (m *TimelineIssueEvents) GetTimelineReviewedEvent()(TimelineReviewedEventable) { + return m.timelineReviewedEvent +} +// GetTimelineUnassignedIssueEvent gets the timelineUnassignedIssueEvent property value. Composed type representation for type TimelineUnassignedIssueEventable +// returns a TimelineUnassignedIssueEventable when successful +func (m *TimelineIssueEvents) GetTimelineUnassignedIssueEvent()(TimelineUnassignedIssueEventable) { + return m.timelineUnassignedIssueEvent +} +// GetUnlabeledIssueEvent gets the unlabeledIssueEvent property value. Composed type representation for type UnlabeledIssueEventable +// returns a UnlabeledIssueEventable when successful +func (m *TimelineIssueEvents) GetUnlabeledIssueEvent()(UnlabeledIssueEventable) { + return m.unlabeledIssueEvent +} +// Serialize serializes information the current object +func (m *TimelineIssueEvents) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAddedToProjectIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetAddedToProjectIssueEvent()) + if err != nil { + return err + } + } else if m.GetConvertedNoteToIssueIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetConvertedNoteToIssueIssueEvent()) + if err != nil { + return err + } + } else if m.GetDemilestonedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetDemilestonedIssueEvent()) + if err != nil { + return err + } + } else if m.GetLabeledIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetLabeledIssueEvent()) + if err != nil { + return err + } + } else if m.GetLockedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetLockedIssueEvent()) + if err != nil { + return err + } + } else if m.GetMilestonedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetMilestonedIssueEvent()) + if err != nil { + return err + } + } else if m.GetMovedColumnInProjectIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetMovedColumnInProjectIssueEvent()) + if err != nil { + return err + } + } else if m.GetRemovedFromProjectIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetRemovedFromProjectIssueEvent()) + if err != nil { + return err + } + } else if m.GetRenamedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetRenamedIssueEvent()) + if err != nil { + return err + } + } else if m.GetReviewDismissedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetReviewDismissedIssueEvent()) + if err != nil { + return err + } + } else if m.GetReviewRequestedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetReviewRequestedIssueEvent()) + if err != nil { + return err + } + } else if m.GetReviewRequestRemovedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetReviewRequestRemovedIssueEvent()) + if err != nil { + return err + } + } else if m.GetStateChangeIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetStateChangeIssueEvent()) + if err != nil { + return err + } + } else if m.GetTimelineAssignedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineAssignedIssueEvent()) + if err != nil { + return err + } + } else if m.GetTimelineCommentEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineCommentEvent()) + if err != nil { + return err + } + } else if m.GetTimelineCommitCommentedEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineCommitCommentedEvent()) + if err != nil { + return err + } + } else if m.GetTimelineCommittedEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineCommittedEvent()) + if err != nil { + return err + } + } else if m.GetTimelineCrossReferencedEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineCrossReferencedEvent()) + if err != nil { + return err + } + } else if m.GetTimelineLineCommentedEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineLineCommentedEvent()) + if err != nil { + return err + } + } else if m.GetTimelineReviewedEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineReviewedEvent()) + if err != nil { + return err + } + } else if m.GetTimelineUnassignedIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetTimelineUnassignedIssueEvent()) + if err != nil { + return err + } + } else if m.GetUnlabeledIssueEvent() != nil { + err := writer.WriteObjectValue("", m.GetUnlabeledIssueEvent()) + if err != nil { + return err + } + } + return nil +} +// SetAddedToProjectIssueEvent sets the addedToProjectIssueEvent property value. Composed type representation for type AddedToProjectIssueEventable +func (m *TimelineIssueEvents) SetAddedToProjectIssueEvent(value AddedToProjectIssueEventable)() { + m.addedToProjectIssueEvent = value +} +// SetConvertedNoteToIssueIssueEvent sets the convertedNoteToIssueIssueEvent property value. Composed type representation for type ConvertedNoteToIssueIssueEventable +func (m *TimelineIssueEvents) SetConvertedNoteToIssueIssueEvent(value ConvertedNoteToIssueIssueEventable)() { + m.convertedNoteToIssueIssueEvent = value +} +// SetDemilestonedIssueEvent sets the demilestonedIssueEvent property value. Composed type representation for type DemilestonedIssueEventable +func (m *TimelineIssueEvents) SetDemilestonedIssueEvent(value DemilestonedIssueEventable)() { + m.demilestonedIssueEvent = value +} +// SetLabeledIssueEvent sets the labeledIssueEvent property value. Composed type representation for type LabeledIssueEventable +func (m *TimelineIssueEvents) SetLabeledIssueEvent(value LabeledIssueEventable)() { + m.labeledIssueEvent = value +} +// SetLockedIssueEvent sets the lockedIssueEvent property value. Composed type representation for type LockedIssueEventable +func (m *TimelineIssueEvents) SetLockedIssueEvent(value LockedIssueEventable)() { + m.lockedIssueEvent = value +} +// SetMilestonedIssueEvent sets the milestonedIssueEvent property value. Composed type representation for type MilestonedIssueEventable +func (m *TimelineIssueEvents) SetMilestonedIssueEvent(value MilestonedIssueEventable)() { + m.milestonedIssueEvent = value +} +// SetMovedColumnInProjectIssueEvent sets the movedColumnInProjectIssueEvent property value. Composed type representation for type MovedColumnInProjectIssueEventable +func (m *TimelineIssueEvents) SetMovedColumnInProjectIssueEvent(value MovedColumnInProjectIssueEventable)() { + m.movedColumnInProjectIssueEvent = value +} +// SetRemovedFromProjectIssueEvent sets the removedFromProjectIssueEvent property value. Composed type representation for type RemovedFromProjectIssueEventable +func (m *TimelineIssueEvents) SetRemovedFromProjectIssueEvent(value RemovedFromProjectIssueEventable)() { + m.removedFromProjectIssueEvent = value +} +// SetRenamedIssueEvent sets the renamedIssueEvent property value. Composed type representation for type RenamedIssueEventable +func (m *TimelineIssueEvents) SetRenamedIssueEvent(value RenamedIssueEventable)() { + m.renamedIssueEvent = value +} +// SetReviewDismissedIssueEvent sets the reviewDismissedIssueEvent property value. Composed type representation for type ReviewDismissedIssueEventable +func (m *TimelineIssueEvents) SetReviewDismissedIssueEvent(value ReviewDismissedIssueEventable)() { + m.reviewDismissedIssueEvent = value +} +// SetReviewRequestedIssueEvent sets the reviewRequestedIssueEvent property value. Composed type representation for type ReviewRequestedIssueEventable +func (m *TimelineIssueEvents) SetReviewRequestedIssueEvent(value ReviewRequestedIssueEventable)() { + m.reviewRequestedIssueEvent = value +} +// SetReviewRequestRemovedIssueEvent sets the reviewRequestRemovedIssueEvent property value. Composed type representation for type ReviewRequestRemovedIssueEventable +func (m *TimelineIssueEvents) SetReviewRequestRemovedIssueEvent(value ReviewRequestRemovedIssueEventable)() { + m.reviewRequestRemovedIssueEvent = value +} +// SetStateChangeIssueEvent sets the stateChangeIssueEvent property value. Composed type representation for type StateChangeIssueEventable +func (m *TimelineIssueEvents) SetStateChangeIssueEvent(value StateChangeIssueEventable)() { + m.stateChangeIssueEvent = value +} +// SetTimelineAssignedIssueEvent sets the timelineAssignedIssueEvent property value. Composed type representation for type TimelineAssignedIssueEventable +func (m *TimelineIssueEvents) SetTimelineAssignedIssueEvent(value TimelineAssignedIssueEventable)() { + m.timelineAssignedIssueEvent = value +} +// SetTimelineCommentEvent sets the timelineCommentEvent property value. Composed type representation for type TimelineCommentEventable +func (m *TimelineIssueEvents) SetTimelineCommentEvent(value TimelineCommentEventable)() { + m.timelineCommentEvent = value +} +// SetTimelineCommitCommentedEvent sets the timelineCommitCommentedEvent property value. Composed type representation for type TimelineCommitCommentedEventable +func (m *TimelineIssueEvents) SetTimelineCommitCommentedEvent(value TimelineCommitCommentedEventable)() { + m.timelineCommitCommentedEvent = value +} +// SetTimelineCommittedEvent sets the timelineCommittedEvent property value. Composed type representation for type TimelineCommittedEventable +func (m *TimelineIssueEvents) SetTimelineCommittedEvent(value TimelineCommittedEventable)() { + m.timelineCommittedEvent = value +} +// SetTimelineCrossReferencedEvent sets the timelineCrossReferencedEvent property value. Composed type representation for type TimelineCrossReferencedEventable +func (m *TimelineIssueEvents) SetTimelineCrossReferencedEvent(value TimelineCrossReferencedEventable)() { + m.timelineCrossReferencedEvent = value +} +// SetTimelineLineCommentedEvent sets the timelineLineCommentedEvent property value. Composed type representation for type TimelineLineCommentedEventable +func (m *TimelineIssueEvents) SetTimelineLineCommentedEvent(value TimelineLineCommentedEventable)() { + m.timelineLineCommentedEvent = value +} +// SetTimelineReviewedEvent sets the timelineReviewedEvent property value. Composed type representation for type TimelineReviewedEventable +func (m *TimelineIssueEvents) SetTimelineReviewedEvent(value TimelineReviewedEventable)() { + m.timelineReviewedEvent = value +} +// SetTimelineUnassignedIssueEvent sets the timelineUnassignedIssueEvent property value. Composed type representation for type TimelineUnassignedIssueEventable +func (m *TimelineIssueEvents) SetTimelineUnassignedIssueEvent(value TimelineUnassignedIssueEventable)() { + m.timelineUnassignedIssueEvent = value +} +// SetUnlabeledIssueEvent sets the unlabeledIssueEvent property value. Composed type representation for type UnlabeledIssueEventable +func (m *TimelineIssueEvents) SetUnlabeledIssueEvent(value UnlabeledIssueEventable)() { + m.unlabeledIssueEvent = value +} +type TimelineIssueEventsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAddedToProjectIssueEvent()(AddedToProjectIssueEventable) + GetConvertedNoteToIssueIssueEvent()(ConvertedNoteToIssueIssueEventable) + GetDemilestonedIssueEvent()(DemilestonedIssueEventable) + GetLabeledIssueEvent()(LabeledIssueEventable) + GetLockedIssueEvent()(LockedIssueEventable) + GetMilestonedIssueEvent()(MilestonedIssueEventable) + GetMovedColumnInProjectIssueEvent()(MovedColumnInProjectIssueEventable) + GetRemovedFromProjectIssueEvent()(RemovedFromProjectIssueEventable) + GetRenamedIssueEvent()(RenamedIssueEventable) + GetReviewDismissedIssueEvent()(ReviewDismissedIssueEventable) + GetReviewRequestedIssueEvent()(ReviewRequestedIssueEventable) + GetReviewRequestRemovedIssueEvent()(ReviewRequestRemovedIssueEventable) + GetStateChangeIssueEvent()(StateChangeIssueEventable) + GetTimelineAssignedIssueEvent()(TimelineAssignedIssueEventable) + GetTimelineCommentEvent()(TimelineCommentEventable) + GetTimelineCommitCommentedEvent()(TimelineCommitCommentedEventable) + GetTimelineCommittedEvent()(TimelineCommittedEventable) + GetTimelineCrossReferencedEvent()(TimelineCrossReferencedEventable) + GetTimelineLineCommentedEvent()(TimelineLineCommentedEventable) + GetTimelineReviewedEvent()(TimelineReviewedEventable) + GetTimelineUnassignedIssueEvent()(TimelineUnassignedIssueEventable) + GetUnlabeledIssueEvent()(UnlabeledIssueEventable) + SetAddedToProjectIssueEvent(value AddedToProjectIssueEventable)() + SetConvertedNoteToIssueIssueEvent(value ConvertedNoteToIssueIssueEventable)() + SetDemilestonedIssueEvent(value DemilestonedIssueEventable)() + SetLabeledIssueEvent(value LabeledIssueEventable)() + SetLockedIssueEvent(value LockedIssueEventable)() + SetMilestonedIssueEvent(value MilestonedIssueEventable)() + SetMovedColumnInProjectIssueEvent(value MovedColumnInProjectIssueEventable)() + SetRemovedFromProjectIssueEvent(value RemovedFromProjectIssueEventable)() + SetRenamedIssueEvent(value RenamedIssueEventable)() + SetReviewDismissedIssueEvent(value ReviewDismissedIssueEventable)() + SetReviewRequestedIssueEvent(value ReviewRequestedIssueEventable)() + SetReviewRequestRemovedIssueEvent(value ReviewRequestRemovedIssueEventable)() + SetStateChangeIssueEvent(value StateChangeIssueEventable)() + SetTimelineAssignedIssueEvent(value TimelineAssignedIssueEventable)() + SetTimelineCommentEvent(value TimelineCommentEventable)() + SetTimelineCommitCommentedEvent(value TimelineCommitCommentedEventable)() + SetTimelineCommittedEvent(value TimelineCommittedEventable)() + SetTimelineCrossReferencedEvent(value TimelineCrossReferencedEventable)() + SetTimelineLineCommentedEvent(value TimelineLineCommentedEventable)() + SetTimelineReviewedEvent(value TimelineReviewedEventable)() + SetTimelineUnassignedIssueEvent(value TimelineUnassignedIssueEventable)() + SetUnlabeledIssueEvent(value UnlabeledIssueEventable)() +} diff --git a/pkg/github/models/timeline_line_commented_event.go b/pkg/github/models/timeline_line_commented_event.go new file mode 100644 index 00000000..998052a6 --- /dev/null +++ b/pkg/github/models/timeline_line_commented_event.go @@ -0,0 +1,151 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineLineCommentedEvent timeline Line Commented Event +type TimelineLineCommentedEvent 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 comments property + comments []PullRequestReviewCommentable + // The event property + event *string + // The node_id property + node_id *string +} +// NewTimelineLineCommentedEvent instantiates a new TimelineLineCommentedEvent and sets the default values. +func NewTimelineLineCommentedEvent()(*TimelineLineCommentedEvent) { + m := &TimelineLineCommentedEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineLineCommentedEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineLineCommentedEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineLineCommentedEvent(), 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 *TimelineLineCommentedEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComments gets the comments property value. The comments property +// returns a []PullRequestReviewCommentable when successful +func (m *TimelineLineCommentedEvent) GetComments()([]PullRequestReviewCommentable) { + return m.comments +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineLineCommentedEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineLineCommentedEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePullRequestReviewCommentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PullRequestReviewCommentable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PullRequestReviewCommentable) + } + } + m.SetComments(res) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + return res +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TimelineLineCommentedEvent) GetNodeId()(*string) { + return m.node_id +} +// Serialize serializes information the current object +func (m *TimelineLineCommentedEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetComments() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetComments())) + for i, v := range m.GetComments() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("comments", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + 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 *TimelineLineCommentedEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComments sets the comments property value. The comments property +func (m *TimelineLineCommentedEvent) SetComments(value []PullRequestReviewCommentable)() { + m.comments = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineLineCommentedEvent) SetEvent(value *string)() { + m.event = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TimelineLineCommentedEvent) SetNodeId(value *string)() { + m.node_id = value +} +type TimelineLineCommentedEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComments()([]PullRequestReviewCommentable) + GetEvent()(*string) + GetNodeId()(*string) + SetComments(value []PullRequestReviewCommentable)() + SetEvent(value *string)() + SetNodeId(value *string)() +} diff --git a/pkg/github/models/timeline_reviewed_event.go b/pkg/github/models/timeline_reviewed_event.go new file mode 100644 index 00000000..fbd75052 --- /dev/null +++ b/pkg/github/models/timeline_reviewed_event.go @@ -0,0 +1,460 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineReviewedEvent timeline Reviewed Event +type TimelineReviewedEvent struct { + // The _links property + _links TimelineReviewedEvent__linksable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // How the author is associated with the repository. + author_association *AuthorAssociation + // The text of the review. + body *string + // The body_html property + body_html *string + // The body_text property + body_text *string + // A commit SHA for the review. + commit_id *string + // The event property + event *string + // The html_url property + html_url *string + // Unique identifier of the review + id *int32 + // The node_id property + node_id *string + // The pull_request_url property + pull_request_url *string + // The state property + state *string + // The submitted_at property + submitted_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // A GitHub user. + user SimpleUserable +} +// NewTimelineReviewedEvent instantiates a new TimelineReviewedEvent and sets the default values. +func NewTimelineReviewedEvent()(*TimelineReviewedEvent) { + m := &TimelineReviewedEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineReviewedEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineReviewedEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineReviewedEvent(), 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 *TimelineReviewedEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorAssociation gets the author_association property value. How the author is associated with the repository. +// returns a *AuthorAssociation when successful +func (m *TimelineReviewedEvent) GetAuthorAssociation()(*AuthorAssociation) { + return m.author_association +} +// GetBody gets the body property value. The text of the review. +// returns a *string when successful +func (m *TimelineReviewedEvent) GetBody()(*string) { + return m.body +} +// GetBodyHtml gets the body_html property value. The body_html property +// returns a *string when successful +func (m *TimelineReviewedEvent) GetBodyHtml()(*string) { + return m.body_html +} +// GetBodyText gets the body_text property value. The body_text property +// returns a *string when successful +func (m *TimelineReviewedEvent) GetBodyText()(*string) { + return m.body_text +} +// GetCommitId gets the commit_id property value. A commit SHA for the review. +// returns a *string when successful +func (m *TimelineReviewedEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineReviewedEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineReviewedEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["_links"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineReviewedEvent__linksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLinks(val.(TimelineReviewedEvent__linksable)) + } + return nil + } + res["author_association"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseAuthorAssociation) + if err != nil { + return err + } + if val != nil { + m.SetAuthorAssociation(val.(*AuthorAssociation)) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["body_html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyHtml(val) + } + return nil + } + res["body_text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBodyText(val) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["pull_request_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPullRequestUrl(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + res["submitted_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetSubmittedAt(val) + } + return nil + } + res["user"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetUser(val.(SimpleUserable)) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *TimelineReviewedEvent) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. Unique identifier of the review +// returns a *int32 when successful +func (m *TimelineReviewedEvent) GetId()(*int32) { + return m.id +} +// GetLinks gets the _links property value. The _links property +// returns a TimelineReviewedEvent__linksable when successful +func (m *TimelineReviewedEvent) GetLinks()(TimelineReviewedEvent__linksable) { + return m._links +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TimelineReviewedEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPullRequestUrl gets the pull_request_url property value. The pull_request_url property +// returns a *string when successful +func (m *TimelineReviewedEvent) GetPullRequestUrl()(*string) { + return m.pull_request_url +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *TimelineReviewedEvent) GetState()(*string) { + return m.state +} +// GetSubmittedAt gets the submitted_at property value. The submitted_at property +// returns a *Time when successful +func (m *TimelineReviewedEvent) GetSubmittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.submitted_at +} +// GetUser gets the user property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineReviewedEvent) GetUser()(SimpleUserable) { + return m.user +} +// Serialize serializes information the current object +func (m *TimelineReviewedEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAuthorAssociation() != nil { + cast := (*m.GetAuthorAssociation()).String() + err := writer.WriteStringValue("author_association", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_html", m.GetBodyHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body_text", m.GetBodyText()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pull_request_url", m.GetPullRequestUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("submitted_at", m.GetSubmittedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("user", m.GetUser()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("_links", m.GetLinks()) + 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 *TimelineReviewedEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorAssociation sets the author_association property value. How the author is associated with the repository. +func (m *TimelineReviewedEvent) SetAuthorAssociation(value *AuthorAssociation)() { + m.author_association = value +} +// SetBody sets the body property value. The text of the review. +func (m *TimelineReviewedEvent) SetBody(value *string)() { + m.body = value +} +// SetBodyHtml sets the body_html property value. The body_html property +func (m *TimelineReviewedEvent) SetBodyHtml(value *string)() { + m.body_html = value +} +// SetBodyText sets the body_text property value. The body_text property +func (m *TimelineReviewedEvent) SetBodyText(value *string)() { + m.body_text = value +} +// SetCommitId sets the commit_id property value. A commit SHA for the review. +func (m *TimelineReviewedEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineReviewedEvent) SetEvent(value *string)() { + m.event = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *TimelineReviewedEvent) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. Unique identifier of the review +func (m *TimelineReviewedEvent) SetId(value *int32)() { + m.id = value +} +// SetLinks sets the _links property value. The _links property +func (m *TimelineReviewedEvent) SetLinks(value TimelineReviewedEvent__linksable)() { + m._links = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TimelineReviewedEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPullRequestUrl sets the pull_request_url property value. The pull_request_url property +func (m *TimelineReviewedEvent) SetPullRequestUrl(value *string)() { + m.pull_request_url = value +} +// SetState sets the state property value. The state property +func (m *TimelineReviewedEvent) SetState(value *string)() { + m.state = value +} +// SetSubmittedAt sets the submitted_at property value. The submitted_at property +func (m *TimelineReviewedEvent) SetSubmittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.submitted_at = value +} +// SetUser sets the user property value. A GitHub user. +func (m *TimelineReviewedEvent) SetUser(value SimpleUserable)() { + m.user = value +} +type TimelineReviewedEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorAssociation()(*AuthorAssociation) + GetBody()(*string) + GetBodyHtml()(*string) + GetBodyText()(*string) + GetCommitId()(*string) + GetEvent()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLinks()(TimelineReviewedEvent__linksable) + GetNodeId()(*string) + GetPullRequestUrl()(*string) + GetState()(*string) + GetSubmittedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUser()(SimpleUserable) + SetAuthorAssociation(value *AuthorAssociation)() + SetBody(value *string)() + SetBodyHtml(value *string)() + SetBodyText(value *string)() + SetCommitId(value *string)() + SetEvent(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLinks(value TimelineReviewedEvent__linksable)() + SetNodeId(value *string)() + SetPullRequestUrl(value *string)() + SetState(value *string)() + SetSubmittedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUser(value SimpleUserable)() +} diff --git a/pkg/github/models/timeline_reviewed_event_escaped__escaped_links.go b/pkg/github/models/timeline_reviewed_event_escaped__escaped_links.go new file mode 100644 index 00000000..74e93ddf --- /dev/null +++ b/pkg/github/models/timeline_reviewed_event_escaped__escaped_links.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TimelineReviewedEvent__links 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 html property + html TimelineReviewedEvent__links_htmlable + // The pull_request property + pull_request TimelineReviewedEvent__links_pull_requestable +} +// NewTimelineReviewedEvent__links instantiates a new TimelineReviewedEvent__links and sets the default values. +func NewTimelineReviewedEvent__links()(*TimelineReviewedEvent__links) { + m := &TimelineReviewedEvent__links{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineReviewedEvent__linksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineReviewedEvent__linksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineReviewedEvent__links(), 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 *TimelineReviewedEvent__links) 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 *TimelineReviewedEvent__links) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["html"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineReviewedEvent__links_htmlFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHtml(val.(TimelineReviewedEvent__links_htmlable)) + } + return nil + } + res["pull_request"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTimelineReviewedEvent__links_pull_requestFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPullRequest(val.(TimelineReviewedEvent__links_pull_requestable)) + } + return nil + } + return res +} +// GetHtml gets the html property value. The html property +// returns a TimelineReviewedEvent__links_htmlable when successful +func (m *TimelineReviewedEvent__links) GetHtml()(TimelineReviewedEvent__links_htmlable) { + return m.html +} +// GetPullRequest gets the pull_request property value. The pull_request property +// returns a TimelineReviewedEvent__links_pull_requestable when successful +func (m *TimelineReviewedEvent__links) GetPullRequest()(TimelineReviewedEvent__links_pull_requestable) { + return m.pull_request +} +// Serialize serializes information the current object +func (m *TimelineReviewedEvent__links) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("html", m.GetHtml()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("pull_request", m.GetPullRequest()) + 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 *TimelineReviewedEvent__links) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHtml sets the html property value. The html property +func (m *TimelineReviewedEvent__links) SetHtml(value TimelineReviewedEvent__links_htmlable)() { + m.html = value +} +// SetPullRequest sets the pull_request property value. The pull_request property +func (m *TimelineReviewedEvent__links) SetPullRequest(value TimelineReviewedEvent__links_pull_requestable)() { + m.pull_request = value +} +type TimelineReviewedEvent__linksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHtml()(TimelineReviewedEvent__links_htmlable) + GetPullRequest()(TimelineReviewedEvent__links_pull_requestable) + SetHtml(value TimelineReviewedEvent__links_htmlable)() + SetPullRequest(value TimelineReviewedEvent__links_pull_requestable)() +} diff --git a/pkg/github/models/timeline_reviewed_event_escaped__escaped_links_escaped_html.go b/pkg/github/models/timeline_reviewed_event_escaped__escaped_links_escaped_html.go new file mode 100644 index 00000000..c886137f --- /dev/null +++ b/pkg/github/models/timeline_reviewed_event_escaped__escaped_links_escaped_html.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TimelineReviewedEvent__links_html 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 href property + href *string +} +// NewTimelineReviewedEvent__links_html instantiates a new TimelineReviewedEvent__links_html and sets the default values. +func NewTimelineReviewedEvent__links_html()(*TimelineReviewedEvent__links_html) { + m := &TimelineReviewedEvent__links_html{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineReviewedEvent__links_htmlFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineReviewedEvent__links_htmlFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineReviewedEvent__links_html(), 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 *TimelineReviewedEvent__links_html) 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 *TimelineReviewedEvent__links_html) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *TimelineReviewedEvent__links_html) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *TimelineReviewedEvent__links_html) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *TimelineReviewedEvent__links_html) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *TimelineReviewedEvent__links_html) SetHref(value *string)() { + m.href = value +} +type TimelineReviewedEvent__links_htmlable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/pkg/github/models/timeline_reviewed_event_escaped__escaped_links_escaped_pull_escaped_request.go b/pkg/github/models/timeline_reviewed_event_escaped__escaped_links_escaped_pull_escaped_request.go new file mode 100644 index 00000000..d8d35c27 --- /dev/null +++ b/pkg/github/models/timeline_reviewed_event_escaped__escaped_links_escaped_pull_escaped_request.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TimelineReviewedEvent__links_pull_request 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 href property + href *string +} +// NewTimelineReviewedEvent__links_pull_request instantiates a new TimelineReviewedEvent__links_pull_request and sets the default values. +func NewTimelineReviewedEvent__links_pull_request()(*TimelineReviewedEvent__links_pull_request) { + m := &TimelineReviewedEvent__links_pull_request{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineReviewedEvent__links_pull_requestFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineReviewedEvent__links_pull_requestFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineReviewedEvent__links_pull_request(), 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 *TimelineReviewedEvent__links_pull_request) 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 *TimelineReviewedEvent__links_pull_request) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["href"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHref(val) + } + return nil + } + return res +} +// GetHref gets the href property value. The href property +// returns a *string when successful +func (m *TimelineReviewedEvent__links_pull_request) GetHref()(*string) { + return m.href +} +// Serialize serializes information the current object +func (m *TimelineReviewedEvent__links_pull_request) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("href", m.GetHref()) + 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 *TimelineReviewedEvent__links_pull_request) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHref sets the href property value. The href property +func (m *TimelineReviewedEvent__links_pull_request) SetHref(value *string)() { + m.href = value +} +type TimelineReviewedEvent__links_pull_requestable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHref()(*string) + SetHref(value *string)() +} diff --git a/pkg/github/models/timeline_unassigned_issue_event.go b/pkg/github/models/timeline_unassigned_issue_event.go new file mode 100644 index 00000000..228839d6 --- /dev/null +++ b/pkg/github/models/timeline_unassigned_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TimelineUnassignedIssueEvent timeline Unassigned Issue Event +type TimelineUnassignedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee SimpleUserable + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewTimelineUnassignedIssueEvent instantiates a new TimelineUnassignedIssueEvent and sets the default values. +func NewTimelineUnassignedIssueEvent()(*TimelineUnassignedIssueEvent) { + m := &TimelineUnassignedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTimelineUnassignedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTimelineUnassignedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTimelineUnassignedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineUnassignedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *TimelineUnassignedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *TimelineUnassignedIssueEvent) GetAssignee()(SimpleUserable) { + return m.assignee +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *TimelineUnassignedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *TimelineUnassignedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *TimelineUnassignedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *TimelineUnassignedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TimelineUnassignedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TimelineUnassignedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *TimelineUnassignedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *TimelineUnassignedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *TimelineUnassignedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *TimelineUnassignedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *TimelineUnassignedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *TimelineUnassignedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *TimelineUnassignedIssueEvent) SetAssignee(value SimpleUserable)() { + m.assignee = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *TimelineUnassignedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *TimelineUnassignedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TimelineUnassignedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *TimelineUnassignedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *TimelineUnassignedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *TimelineUnassignedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *TimelineUnassignedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *TimelineUnassignedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type TimelineUnassignedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetAssignee()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetAssignee(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/topic.go b/pkg/github/models/topic.go new file mode 100644 index 00000000..86b2eba8 --- /dev/null +++ b/pkg/github/models/topic.go @@ -0,0 +1,87 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Topic a topic aggregates entities that are related to a subject. +type Topic 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 names property + names []string +} +// NewTopic instantiates a new Topic and sets the default values. +func NewTopic()(*Topic) { + m := &Topic{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopic(), 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 *Topic) 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 *Topic) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["names"] = 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.SetNames(res) + } + return nil + } + return res +} +// GetNames gets the names property value. The names property +// returns a []string when successful +func (m *Topic) GetNames()([]string) { + return m.names +} +// Serialize serializes information the current object +func (m *Topic) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetNames() != nil { + err := writer.WriteCollectionOfStringValues("names", m.GetNames()) + 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 *Topic) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNames sets the names property value. The names property +func (m *Topic) SetNames(value []string)() { + m.names = value +} +type Topicable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNames()([]string) + SetNames(value []string)() +} diff --git a/pkg/github/models/topic_search_result_item.go b/pkg/github/models/topic_search_result_item.go new file mode 100644 index 00000000..909ee437 --- /dev/null +++ b/pkg/github/models/topic_search_result_item.go @@ -0,0 +1,553 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// TopicSearchResultItem topic Search Result Item +type TopicSearchResultItem 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 aliases property + aliases []TopicSearchResultItem_aliasesable + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The created_by property + created_by *string + // The curated property + curated *bool + // The description property + description *string + // The display_name property + display_name *string + // The featured property + featured *bool + // The logo_url property + logo_url *string + // The name property + name *string + // The related property + related []TopicSearchResultItem_relatedable + // The released property + released *string + // The repository_count property + repository_count *int32 + // The score property + score *float64 + // The short_description property + short_description *string + // The text_matches property + text_matches []Topicsable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewTopicSearchResultItem instantiates a new TopicSearchResultItem and sets the default values. +func NewTopicSearchResultItem()(*TopicSearchResultItem) { + m := &TopicSearchResultItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicSearchResultItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicSearchResultItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopicSearchResultItem(), 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 *TopicSearchResultItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAliases gets the aliases property value. The aliases property +// returns a []TopicSearchResultItem_aliasesable when successful +func (m *TopicSearchResultItem) GetAliases()([]TopicSearchResultItem_aliasesable) { + return m.aliases +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *TopicSearchResultItem) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetCreatedBy gets the created_by property value. The created_by property +// returns a *string when successful +func (m *TopicSearchResultItem) GetCreatedBy()(*string) { + return m.created_by +} +// GetCurated gets the curated property value. The curated property +// returns a *bool when successful +func (m *TopicSearchResultItem) GetCurated()(*bool) { + return m.curated +} +// GetDescription gets the description property value. The description property +// returns a *string when successful +func (m *TopicSearchResultItem) GetDescription()(*string) { + return m.description +} +// GetDisplayName gets the display_name property value. The display_name property +// returns a *string when successful +func (m *TopicSearchResultItem) GetDisplayName()(*string) { + return m.display_name +} +// GetFeatured gets the featured property value. The featured property +// returns a *bool when successful +func (m *TopicSearchResultItem) GetFeatured()(*bool) { + return m.featured +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TopicSearchResultItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["aliases"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTopicSearchResultItem_aliasesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]TopicSearchResultItem_aliasesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(TopicSearchResultItem_aliasesable) + } + } + m.SetAliases(res) + } + return nil + } + 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["created_by"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedBy(val) + } + return nil + } + res["curated"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetCurated(val) + } + 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["display_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["featured"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetFeatured(val) + } + return nil + } + res["logo_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogoUrl(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["related"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTopicSearchResultItem_relatedFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]TopicSearchResultItem_relatedable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(TopicSearchResultItem_relatedable) + } + } + m.SetRelated(res) + } + return nil + } + res["released"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReleased(val) + } + return nil + } + res["repository_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRepositoryCount(val) + } + return nil + } + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["short_description"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetShortDescription(val) + } + return nil + } + res["text_matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTopicsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Topicsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Topicsable) + } + } + m.SetTextMatches(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 + } + return res +} +// GetLogoUrl gets the logo_url property value. The logo_url property +// returns a *string when successful +func (m *TopicSearchResultItem) GetLogoUrl()(*string) { + return m.logo_url +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *TopicSearchResultItem) GetName()(*string) { + return m.name +} +// GetRelated gets the related property value. The related property +// returns a []TopicSearchResultItem_relatedable when successful +func (m *TopicSearchResultItem) GetRelated()([]TopicSearchResultItem_relatedable) { + return m.related +} +// GetReleased gets the released property value. The released property +// returns a *string when successful +func (m *TopicSearchResultItem) GetReleased()(*string) { + return m.released +} +// GetRepositoryCount gets the repository_count property value. The repository_count property +// returns a *int32 when successful +func (m *TopicSearchResultItem) GetRepositoryCount()(*int32) { + return m.repository_count +} +// GetScore gets the score property value. The score property +// returns a *float64 when successful +func (m *TopicSearchResultItem) GetScore()(*float64) { + return m.score +} +// GetShortDescription gets the short_description property value. The short_description property +// returns a *string when successful +func (m *TopicSearchResultItem) GetShortDescription()(*string) { + return m.short_description +} +// GetTextMatches gets the text_matches property value. The text_matches property +// returns a []Topicsable when successful +func (m *TopicSearchResultItem) GetTextMatches()([]Topicsable) { + return m.text_matches +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *TopicSearchResultItem) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// Serialize serializes information the current object +func (m *TopicSearchResultItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAliases() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAliases())) + for i, v := range m.GetAliases() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("aliases", cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_by", m.GetCreatedBy()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("curated", m.GetCurated()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("display_name", m.GetDisplayName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("featured", m.GetFeatured()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("logo_url", m.GetLogoUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetRelated() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRelated())) + for i, v := range m.GetRelated() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("related", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("released", m.GetReleased()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("repository_count", m.GetRepositoryCount()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("score", m.GetScore()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("short_description", m.GetShortDescription()) + if err != nil { + return err + } + } + if m.GetTextMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTextMatches())) + for i, v := range m.GetTextMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("text_matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + 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 *TopicSearchResultItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAliases sets the aliases property value. The aliases property +func (m *TopicSearchResultItem) SetAliases(value []TopicSearchResultItem_aliasesable)() { + m.aliases = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *TopicSearchResultItem) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetCreatedBy sets the created_by property value. The created_by property +func (m *TopicSearchResultItem) SetCreatedBy(value *string)() { + m.created_by = value +} +// SetCurated sets the curated property value. The curated property +func (m *TopicSearchResultItem) SetCurated(value *bool)() { + m.curated = value +} +// SetDescription sets the description property value. The description property +func (m *TopicSearchResultItem) SetDescription(value *string)() { + m.description = value +} +// SetDisplayName sets the display_name property value. The display_name property +func (m *TopicSearchResultItem) SetDisplayName(value *string)() { + m.display_name = value +} +// SetFeatured sets the featured property value. The featured property +func (m *TopicSearchResultItem) SetFeatured(value *bool)() { + m.featured = value +} +// SetLogoUrl sets the logo_url property value. The logo_url property +func (m *TopicSearchResultItem) SetLogoUrl(value *string)() { + m.logo_url = value +} +// SetName sets the name property value. The name property +func (m *TopicSearchResultItem) SetName(value *string)() { + m.name = value +} +// SetRelated sets the related property value. The related property +func (m *TopicSearchResultItem) SetRelated(value []TopicSearchResultItem_relatedable)() { + m.related = value +} +// SetReleased sets the released property value. The released property +func (m *TopicSearchResultItem) SetReleased(value *string)() { + m.released = value +} +// SetRepositoryCount sets the repository_count property value. The repository_count property +func (m *TopicSearchResultItem) SetRepositoryCount(value *int32)() { + m.repository_count = value +} +// SetScore sets the score property value. The score property +func (m *TopicSearchResultItem) SetScore(value *float64)() { + m.score = value +} +// SetShortDescription sets the short_description property value. The short_description property +func (m *TopicSearchResultItem) SetShortDescription(value *string)() { + m.short_description = value +} +// SetTextMatches sets the text_matches property value. The text_matches property +func (m *TopicSearchResultItem) SetTextMatches(value []Topicsable)() { + m.text_matches = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *TopicSearchResultItem) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +type TopicSearchResultItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAliases()([]TopicSearchResultItem_aliasesable) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetCreatedBy()(*string) + GetCurated()(*bool) + GetDescription()(*string) + GetDisplayName()(*string) + GetFeatured()(*bool) + GetLogoUrl()(*string) + GetName()(*string) + GetRelated()([]TopicSearchResultItem_relatedable) + GetReleased()(*string) + GetRepositoryCount()(*int32) + GetScore()(*float64) + GetShortDescription()(*string) + GetTextMatches()([]Topicsable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetAliases(value []TopicSearchResultItem_aliasesable)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetCreatedBy(value *string)() + SetCurated(value *bool)() + SetDescription(value *string)() + SetDisplayName(value *string)() + SetFeatured(value *bool)() + SetLogoUrl(value *string)() + SetName(value *string)() + SetRelated(value []TopicSearchResultItem_relatedable)() + SetReleased(value *string)() + SetRepositoryCount(value *int32)() + SetScore(value *float64)() + SetShortDescription(value *string)() + SetTextMatches(value []Topicsable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/models/topic_search_result_item_escaped_aliases.go b/pkg/github/models/topic_search_result_item_escaped_aliases.go new file mode 100644 index 00000000..8e3eabd2 --- /dev/null +++ b/pkg/github/models/topic_search_result_item_escaped_aliases.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TopicSearchResultItem_aliases 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 topic_relation property + topic_relation TopicSearchResultItem_aliases_topic_relationable +} +// NewTopicSearchResultItem_aliases instantiates a new TopicSearchResultItem_aliases and sets the default values. +func NewTopicSearchResultItem_aliases()(*TopicSearchResultItem_aliases) { + m := &TopicSearchResultItem_aliases{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicSearchResultItem_aliasesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicSearchResultItem_aliasesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopicSearchResultItem_aliases(), 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 *TopicSearchResultItem_aliases) 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 *TopicSearchResultItem_aliases) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["topic_relation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTopicSearchResultItem_aliases_topic_relationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTopicRelation(val.(TopicSearchResultItem_aliases_topic_relationable)) + } + return nil + } + return res +} +// GetTopicRelation gets the topic_relation property value. The topic_relation property +// returns a TopicSearchResultItem_aliases_topic_relationable when successful +func (m *TopicSearchResultItem_aliases) GetTopicRelation()(TopicSearchResultItem_aliases_topic_relationable) { + return m.topic_relation +} +// Serialize serializes information the current object +func (m *TopicSearchResultItem_aliases) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("topic_relation", m.GetTopicRelation()) + 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 *TopicSearchResultItem_aliases) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTopicRelation sets the topic_relation property value. The topic_relation property +func (m *TopicSearchResultItem_aliases) SetTopicRelation(value TopicSearchResultItem_aliases_topic_relationable)() { + m.topic_relation = value +} +type TopicSearchResultItem_aliasesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTopicRelation()(TopicSearchResultItem_aliases_topic_relationable) + SetTopicRelation(value TopicSearchResultItem_aliases_topic_relationable)() +} diff --git a/pkg/github/models/topic_search_result_item_escaped_aliases_escaped_topic_escaped_relation.go b/pkg/github/models/topic_search_result_item_escaped_aliases_escaped_topic_escaped_relation.go new file mode 100644 index 00000000..b0027c50 --- /dev/null +++ b/pkg/github/models/topic_search_result_item_escaped_aliases_escaped_topic_escaped_relation.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TopicSearchResultItem_aliases_topic_relation struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // The name property + name *string + // The relation_type property + relation_type *string + // The topic_id property + topic_id *int32 +} +// NewTopicSearchResultItem_aliases_topic_relation instantiates a new TopicSearchResultItem_aliases_topic_relation and sets the default values. +func NewTopicSearchResultItem_aliases_topic_relation()(*TopicSearchResultItem_aliases_topic_relation) { + m := &TopicSearchResultItem_aliases_topic_relation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicSearchResultItem_aliases_topic_relationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicSearchResultItem_aliases_topic_relationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopicSearchResultItem_aliases_topic_relation(), 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 *TopicSearchResultItem_aliases_topic_relation) 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 *TopicSearchResultItem_aliases_topic_relation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["relation_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRelationType(val) + } + return nil + } + res["topic_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTopicId(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TopicSearchResultItem_aliases_topic_relation) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *TopicSearchResultItem_aliases_topic_relation) GetName()(*string) { + return m.name +} +// GetRelationType gets the relation_type property value. The relation_type property +// returns a *string when successful +func (m *TopicSearchResultItem_aliases_topic_relation) GetRelationType()(*string) { + return m.relation_type +} +// GetTopicId gets the topic_id property value. The topic_id property +// returns a *int32 when successful +func (m *TopicSearchResultItem_aliases_topic_relation) GetTopicId()(*int32) { + return m.topic_id +} +// Serialize serializes information the current object +func (m *TopicSearchResultItem_aliases_topic_relation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("relation_type", m.GetRelationType()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("topic_id", m.GetTopicId()) + 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 *TopicSearchResultItem_aliases_topic_relation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *TopicSearchResultItem_aliases_topic_relation) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *TopicSearchResultItem_aliases_topic_relation) SetName(value *string)() { + m.name = value +} +// SetRelationType sets the relation_type property value. The relation_type property +func (m *TopicSearchResultItem_aliases_topic_relation) SetRelationType(value *string)() { + m.relation_type = value +} +// SetTopicId sets the topic_id property value. The topic_id property +func (m *TopicSearchResultItem_aliases_topic_relation) SetTopicId(value *int32)() { + m.topic_id = value +} +type TopicSearchResultItem_aliases_topic_relationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetName()(*string) + GetRelationType()(*string) + GetTopicId()(*int32) + SetId(value *int32)() + SetName(value *string)() + SetRelationType(value *string)() + SetTopicId(value *int32)() +} diff --git a/pkg/github/models/topic_search_result_item_escaped_related.go b/pkg/github/models/topic_search_result_item_escaped_related.go new file mode 100644 index 00000000..0eeb02d9 --- /dev/null +++ b/pkg/github/models/topic_search_result_item_escaped_related.go @@ -0,0 +1,80 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TopicSearchResultItem_related 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 topic_relation property + topic_relation TopicSearchResultItem_related_topic_relationable +} +// NewTopicSearchResultItem_related instantiates a new TopicSearchResultItem_related and sets the default values. +func NewTopicSearchResultItem_related()(*TopicSearchResultItem_related) { + m := &TopicSearchResultItem_related{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicSearchResultItem_relatedFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicSearchResultItem_relatedFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopicSearchResultItem_related(), 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 *TopicSearchResultItem_related) 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 *TopicSearchResultItem_related) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["topic_relation"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateTopicSearchResultItem_related_topic_relationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTopicRelation(val.(TopicSearchResultItem_related_topic_relationable)) + } + return nil + } + return res +} +// GetTopicRelation gets the topic_relation property value. The topic_relation property +// returns a TopicSearchResultItem_related_topic_relationable when successful +func (m *TopicSearchResultItem_related) GetTopicRelation()(TopicSearchResultItem_related_topic_relationable) { + return m.topic_relation +} +// Serialize serializes information the current object +func (m *TopicSearchResultItem_related) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("topic_relation", m.GetTopicRelation()) + 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 *TopicSearchResultItem_related) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTopicRelation sets the topic_relation property value. The topic_relation property +func (m *TopicSearchResultItem_related) SetTopicRelation(value TopicSearchResultItem_related_topic_relationable)() { + m.topic_relation = value +} +type TopicSearchResultItem_relatedable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTopicRelation()(TopicSearchResultItem_related_topic_relationable) + SetTopicRelation(value TopicSearchResultItem_related_topic_relationable)() +} diff --git a/pkg/github/models/topic_search_result_item_escaped_related_escaped_topic_escaped_relation.go b/pkg/github/models/topic_search_result_item_escaped_related_escaped_topic_escaped_relation.go new file mode 100644 index 00000000..65cd1bf1 --- /dev/null +++ b/pkg/github/models/topic_search_result_item_escaped_related_escaped_topic_escaped_relation.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type TopicSearchResultItem_related_topic_relation struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id property + id *int32 + // The name property + name *string + // The relation_type property + relation_type *string + // The topic_id property + topic_id *int32 +} +// NewTopicSearchResultItem_related_topic_relation instantiates a new TopicSearchResultItem_related_topic_relation and sets the default values. +func NewTopicSearchResultItem_related_topic_relation()(*TopicSearchResultItem_related_topic_relation) { + m := &TopicSearchResultItem_related_topic_relation{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicSearchResultItem_related_topic_relationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicSearchResultItem_related_topic_relationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopicSearchResultItem_related_topic_relation(), 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 *TopicSearchResultItem_related_topic_relation) 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 *TopicSearchResultItem_related_topic_relation) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["relation_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRelationType(val) + } + return nil + } + res["topic_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTopicId(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *TopicSearchResultItem_related_topic_relation) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *TopicSearchResultItem_related_topic_relation) GetName()(*string) { + return m.name +} +// GetRelationType gets the relation_type property value. The relation_type property +// returns a *string when successful +func (m *TopicSearchResultItem_related_topic_relation) GetRelationType()(*string) { + return m.relation_type +} +// GetTopicId gets the topic_id property value. The topic_id property +// returns a *int32 when successful +func (m *TopicSearchResultItem_related_topic_relation) GetTopicId()(*int32) { + return m.topic_id +} +// Serialize serializes information the current object +func (m *TopicSearchResultItem_related_topic_relation) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("relation_type", m.GetRelationType()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("topic_id", m.GetTopicId()) + 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 *TopicSearchResultItem_related_topic_relation) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id property +func (m *TopicSearchResultItem_related_topic_relation) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *TopicSearchResultItem_related_topic_relation) SetName(value *string)() { + m.name = value +} +// SetRelationType sets the relation_type property value. The relation_type property +func (m *TopicSearchResultItem_related_topic_relation) SetRelationType(value *string)() { + m.relation_type = value +} +// SetTopicId sets the topic_id property value. The topic_id property +func (m *TopicSearchResultItem_related_topic_relation) SetTopicId(value *int32)() { + m.topic_id = value +} +type TopicSearchResultItem_related_topic_relationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetName()(*string) + GetRelationType()(*string) + GetTopicId()(*int32) + SetId(value *int32)() + SetName(value *string)() + SetRelationType(value *string)() + SetTopicId(value *int32)() +} diff --git a/pkg/github/models/topics.go b/pkg/github/models/topics.go new file mode 100644 index 00000000..981a379f --- /dev/null +++ b/pkg/github/models/topics.go @@ -0,0 +1,208 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Topics struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The fragment property + fragment *string + // The matches property + matches []Topics_matchesable + // The object_type property + object_type *string + // The object_url property + object_url *string + // The property property + property *string +} +// NewTopics instantiates a new Topics and sets the default values. +func NewTopics()(*Topics) { + m := &Topics{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopics(), 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 *Topics) 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 *Topics) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["fragment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFragment(val) + } + return nil + } + res["matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateTopics_matchesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Topics_matchesable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Topics_matchesable) + } + } + m.SetMatches(res) + } + return nil + } + res["object_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectType(val) + } + return nil + } + res["object_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObjectUrl(val) + } + return nil + } + res["property"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetProperty(val) + } + return nil + } + return res +} +// GetFragment gets the fragment property value. The fragment property +// returns a *string when successful +func (m *Topics) GetFragment()(*string) { + return m.fragment +} +// GetMatches gets the matches property value. The matches property +// returns a []Topics_matchesable when successful +func (m *Topics) GetMatches()([]Topics_matchesable) { + return m.matches +} +// GetObjectType gets the object_type property value. The object_type property +// returns a *string when successful +func (m *Topics) GetObjectType()(*string) { + return m.object_type +} +// GetObjectUrl gets the object_url property value. The object_url property +// returns a *string when successful +func (m *Topics) GetObjectUrl()(*string) { + return m.object_url +} +// GetProperty gets the property property value. The property property +// returns a *string when successful +func (m *Topics) GetProperty()(*string) { + return m.property +} +// Serialize serializes information the current object +func (m *Topics) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("fragment", m.GetFragment()) + if err != nil { + return err + } + } + if m.GetMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetMatches())) + for i, v := range m.GetMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_type", m.GetObjectType()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object_url", m.GetObjectUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("property", m.GetProperty()) + 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 *Topics) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFragment sets the fragment property value. The fragment property +func (m *Topics) SetFragment(value *string)() { + m.fragment = value +} +// SetMatches sets the matches property value. The matches property +func (m *Topics) SetMatches(value []Topics_matchesable)() { + m.matches = value +} +// SetObjectType sets the object_type property value. The object_type property +func (m *Topics) SetObjectType(value *string)() { + m.object_type = value +} +// SetObjectUrl sets the object_url property value. The object_url property +func (m *Topics) SetObjectUrl(value *string)() { + m.object_url = value +} +// SetProperty sets the property property value. The property property +func (m *Topics) SetProperty(value *string)() { + m.property = value +} +type Topicsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFragment()(*string) + GetMatches()([]Topics_matchesable) + GetObjectType()(*string) + GetObjectUrl()(*string) + GetProperty()(*string) + SetFragment(value *string)() + SetMatches(value []Topics_matchesable)() + SetObjectType(value *string)() + SetObjectUrl(value *string)() + SetProperty(value *string)() +} diff --git a/pkg/github/models/topics_escaped_matches.go b/pkg/github/models/topics_escaped_matches.go new file mode 100644 index 00000000..7c500d49 --- /dev/null +++ b/pkg/github/models/topics_escaped_matches.go @@ -0,0 +1,115 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Topics_matches struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The indices property + indices []int32 + // The text property + text *string +} +// NewTopics_matches instantiates a new Topics_matches and sets the default values. +func NewTopics_matches()(*Topics_matches) { + m := &Topics_matches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopics_matchesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopics_matchesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopics_matches(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Topics_matches) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Topics_matches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["indices"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfPrimitiveValues("int32") + if err != nil { + return err + } + if val != nil { + res := make([]int32, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*int32)) + } + } + m.SetIndices(res) + } + return nil + } + res["text"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetText(val) + } + return nil + } + return res +} +// GetIndices gets the indices property value. The indices property +// returns a []int32 when successful +func (m *Topics_matches) GetIndices()([]int32) { + return m.indices +} +// GetText gets the text property value. The text property +// returns a *string when successful +func (m *Topics_matches) GetText()(*string) { + return m.text +} +// Serialize serializes information the current object +func (m *Topics_matches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIndices() != nil { + err := writer.WriteCollectionOfInt32Values("indices", m.GetIndices()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("text", m.GetText()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *Topics_matches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIndices sets the indices property value. The indices property +func (m *Topics_matches) SetIndices(value []int32)() { + m.indices = value +} +// SetText sets the text property value. The text property +func (m *Topics_matches) SetText(value *string)() { + m.text = value +} +type Topics_matchesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIndices()([]int32) + GetText()(*string) + SetIndices(value []int32)() + SetText(value *string)() +} diff --git a/pkg/github/models/unassigned_issue_event.go b/pkg/github/models/unassigned_issue_event.go new file mode 100644 index 00000000..2a1ea945 --- /dev/null +++ b/pkg/github/models/unassigned_issue_event.go @@ -0,0 +1,371 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// UnassignedIssueEvent unassigned Issue Event +type UnassignedIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A GitHub user. + assignee SimpleUserable + // A GitHub user. + assigner SimpleUserable + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewUnassignedIssueEvent instantiates a new UnassignedIssueEvent and sets the default values. +func NewUnassignedIssueEvent()(*UnassignedIssueEvent) { + m := &UnassignedIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUnassignedIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUnassignedIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUnassignedIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *UnassignedIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *UnassignedIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *UnassignedIssueEvent) GetAssignee()(SimpleUserable) { + return m.assignee +} +// GetAssigner gets the assigner property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *UnassignedIssueEvent) GetAssigner()(SimpleUserable) { + return m.assigner +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *UnassignedIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *UnassignedIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *UnassignedIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *UnassignedIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UnassignedIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val.(SimpleUserable)) + } + return nil + } + res["assigner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAssigner(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *UnassignedIssueEvent) GetId()(*int32) { + return m.id +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *UnassignedIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *UnassignedIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *UnassignedIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *UnassignedIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("assigner", m.GetAssigner()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *UnassignedIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *UnassignedIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. A GitHub user. +func (m *UnassignedIssueEvent) SetAssignee(value SimpleUserable)() { + m.assignee = value +} +// SetAssigner sets the assigner property value. A GitHub user. +func (m *UnassignedIssueEvent) SetAssigner(value SimpleUserable)() { + m.assigner = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *UnassignedIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *UnassignedIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *UnassignedIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *UnassignedIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *UnassignedIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *UnassignedIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *UnassignedIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *UnassignedIssueEvent) SetUrl(value *string)() { + m.url = value +} +type UnassignedIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetAssignee()(SimpleUserable) + GetAssigner()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetAssignee(value SimpleUserable)() + SetAssigner(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/unlabeled_issue_event.go b/pkg/github/models/unlabeled_issue_event.go new file mode 100644 index 00000000..85e560ca --- /dev/null +++ b/pkg/github/models/unlabeled_issue_event.go @@ -0,0 +1,342 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// UnlabeledIssueEvent unlabeled Issue Event +type UnlabeledIssueEvent struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The commit_id property + commit_id *string + // The commit_url property + commit_url *string + // The created_at property + created_at *string + // The event property + event *string + // The id property + id *int32 + // The label property + label UnlabeledIssueEvent_labelable + // The node_id property + node_id *string + // GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. + performed_via_github_app NullableIntegrationable + // The url property + url *string +} +// NewUnlabeledIssueEvent instantiates a new UnlabeledIssueEvent and sets the default values. +func NewUnlabeledIssueEvent()(*UnlabeledIssueEvent) { + m := &UnlabeledIssueEvent{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUnlabeledIssueEventFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUnlabeledIssueEventFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUnlabeledIssueEvent(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *UnlabeledIssueEvent) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *UnlabeledIssueEvent) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitId gets the commit_id property value. The commit_id property +// returns a *string when successful +func (m *UnlabeledIssueEvent) GetCommitId()(*string) { + return m.commit_id +} +// GetCommitUrl gets the commit_url property value. The commit_url property +// returns a *string when successful +func (m *UnlabeledIssueEvent) GetCommitUrl()(*string) { + return m.commit_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *string when successful +func (m *UnlabeledIssueEvent) GetCreatedAt()(*string) { + return m.created_at +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *UnlabeledIssueEvent) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UnlabeledIssueEvent) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["commit_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitUrl(val) + } + return nil + } + res["created_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateUnlabeledIssueEvent_labelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetLabel(val.(UnlabeledIssueEvent_labelable)) + } + return nil + } + res["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["performed_via_github_app"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableIntegrationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPerformedViaGithubApp(val.(NullableIntegrationable)) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *UnlabeledIssueEvent) GetId()(*int32) { + return m.id +} +// GetLabel gets the label property value. The label property +// returns a UnlabeledIssueEvent_labelable when successful +func (m *UnlabeledIssueEvent) GetLabel()(UnlabeledIssueEvent_labelable) { + return m.label +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *UnlabeledIssueEvent) GetNodeId()(*string) { + return m.node_id +} +// GetPerformedViaGithubApp gets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +// returns a NullableIntegrationable when successful +func (m *UnlabeledIssueEvent) GetPerformedViaGithubApp()(NullableIntegrationable) { + return m.performed_via_github_app +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *UnlabeledIssueEvent) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *UnlabeledIssueEvent) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_url", m.GetCommitUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("performed_via_github_app", m.GetPerformedViaGithubApp()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *UnlabeledIssueEvent) SetActor(value SimpleUserable)() { + m.actor = 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 *UnlabeledIssueEvent) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitId sets the commit_id property value. The commit_id property +func (m *UnlabeledIssueEvent) SetCommitId(value *string)() { + m.commit_id = value +} +// SetCommitUrl sets the commit_url property value. The commit_url property +func (m *UnlabeledIssueEvent) SetCommitUrl(value *string)() { + m.commit_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *UnlabeledIssueEvent) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetEvent sets the event property value. The event property +func (m *UnlabeledIssueEvent) SetEvent(value *string)() { + m.event = value +} +// SetId sets the id property value. The id property +func (m *UnlabeledIssueEvent) SetId(value *int32)() { + m.id = value +} +// SetLabel sets the label property value. The label property +func (m *UnlabeledIssueEvent) SetLabel(value UnlabeledIssueEvent_labelable)() { + m.label = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *UnlabeledIssueEvent) SetNodeId(value *string)() { + m.node_id = value +} +// SetPerformedViaGithubApp sets the performed_via_github_app property value. GitHub apps are a new way to extend GitHub. They can be installed directly on organizations and user accounts and granted access to specific repositories. They come with granular permissions and built-in webhooks. GitHub apps are first class actors within GitHub. +func (m *UnlabeledIssueEvent) SetPerformedViaGithubApp(value NullableIntegrationable)() { + m.performed_via_github_app = value +} +// SetUrl sets the url property value. The url property +func (m *UnlabeledIssueEvent) SetUrl(value *string)() { + m.url = value +} +type UnlabeledIssueEventable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetCommitId()(*string) + GetCommitUrl()(*string) + GetCreatedAt()(*string) + GetEvent()(*string) + GetId()(*int32) + GetLabel()(UnlabeledIssueEvent_labelable) + GetNodeId()(*string) + GetPerformedViaGithubApp()(NullableIntegrationable) + GetUrl()(*string) + SetActor(value SimpleUserable)() + SetCommitId(value *string)() + SetCommitUrl(value *string)() + SetCreatedAt(value *string)() + SetEvent(value *string)() + SetId(value *int32)() + SetLabel(value UnlabeledIssueEvent_labelable)() + SetNodeId(value *string)() + SetPerformedViaGithubApp(value NullableIntegrationable)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/unlabeled_issue_event_escaped_label.go b/pkg/github/models/unlabeled_issue_event_escaped_label.go new file mode 100644 index 00000000..36e77e8a --- /dev/null +++ b/pkg/github/models/unlabeled_issue_event_escaped_label.go @@ -0,0 +1,109 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type UnlabeledIssueEvent_label 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 color property + color *string + // The name property + name *string +} +// NewUnlabeledIssueEvent_label instantiates a new UnlabeledIssueEvent_label and sets the default values. +func NewUnlabeledIssueEvent_label()(*UnlabeledIssueEvent_label) { + m := &UnlabeledIssueEvent_label{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUnlabeledIssueEvent_labelFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUnlabeledIssueEvent_labelFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUnlabeledIssueEvent_label(), 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 *UnlabeledIssueEvent_label) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The color property +// returns a *string when successful +func (m *UnlabeledIssueEvent_label) GetColor()(*string) { + return m.color +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UnlabeledIssueEvent_label) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(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 property +// returns a *string when successful +func (m *UnlabeledIssueEvent_label) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *UnlabeledIssueEvent_label) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *UnlabeledIssueEvent_label) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The color property +func (m *UnlabeledIssueEvent_label) SetColor(value *string)() { + m.color = value +} +// SetName sets the name property value. The name property +func (m *UnlabeledIssueEvent_label) SetName(value *string)() { + m.name = value +} +type UnlabeledIssueEvent_labelable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetName()(*string) + SetColor(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/models/user.go b/pkg/github/models/user.go new file mode 100644 index 00000000..1b5ebb5a --- /dev/null +++ b/pkg/github/models/user.go @@ -0,0 +1,313 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type User struct { + // Whether the user active in the IdP. + active *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A human-readable name for the user. + displayName *string + // The emails for the user. + emails []Usersable + // A unique identifier for the resource as defined by the provisioning client. + externalId *string + // The name property + name UserNameable + // The roles assigned to the user. + roles []Usersable + // The URIs that are used to indicate the namespaces of the SCIM schemas. + schemas []User_schemas + // The username for the user. + userName *string +} +// NewUser instantiates a new User and sets the default values. +func NewUser()(*User) { + m := &User{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUser(), nil +} +// GetActive gets the active property value. Whether the user active in the IdP. +// returns a *bool when successful +func (m *User) GetActive()(*bool) { + return m.active +} +// 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 *User) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDisplayName gets the displayName property value. A human-readable name for the user. +// returns a *string when successful +func (m *User) GetDisplayName()(*string) { + return m.displayName +} +// GetEmails gets the emails property value. The emails for the user. +// returns a []Usersable when successful +func (m *User) GetEmails()([]Usersable) { + return m.emails +} +// GetExternalId gets the externalId property value. A unique identifier for the resource as defined by the provisioning client. +// returns a *string when successful +func (m *User) GetExternalId()(*string) { + return m.externalId +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *User) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["displayName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["emails"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateUsersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Usersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Usersable) + } + } + m.SetEmails(res) + } + return nil + } + res["externalId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExternalId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateUserNameFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetName(val.(UserNameable)) + } + return nil + } + res["roles"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateUsersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Usersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Usersable) + } + } + m.SetRoles(res) + } + return nil + } + res["schemas"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseUser_schemas) + if err != nil { + return err + } + if val != nil { + res := make([]User_schemas, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*User_schemas)) + } + } + m.SetSchemas(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 +} +// GetName gets the name property value. The name property +// returns a UserNameable when successful +func (m *User) GetName()(UserNameable) { + return m.name +} +// GetRoles gets the roles property value. The roles assigned to the user. +// returns a []Usersable when successful +func (m *User) GetRoles()([]Usersable) { + return m.roles +} +// GetSchemas gets the schemas property value. The URIs that are used to indicate the namespaces of the SCIM schemas. +// returns a []User_schemas when successful +func (m *User) GetSchemas()([]User_schemas) { + return m.schemas +} +// GetUserName gets the userName property value. The username for the user. +// returns a *string when successful +func (m *User) GetUserName()(*string) { + return m.userName +} +// Serialize serializes information the current object +func (m *User) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("displayName", m.GetDisplayName()) + if err != nil { + return err + } + } + if m.GetEmails() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetEmails())) + for i, v := range m.GetEmails() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("emails", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("externalId", m.GetExternalId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetRoles() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRoles())) + for i, v := range m.GetRoles() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("roles", cast) + if err != nil { + return err + } + } + if m.GetSchemas() != nil { + err := writer.WriteCollectionOfStringValues("schemas", SerializeUser_schemas(m.GetSchemas())) + 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 +} +// SetActive sets the active property value. Whether the user active in the IdP. +func (m *User) SetActive(value *bool)() { + m.active = 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 *User) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDisplayName sets the displayName property value. A human-readable name for the user. +func (m *User) SetDisplayName(value *string)() { + m.displayName = value +} +// SetEmails sets the emails property value. The emails for the user. +func (m *User) SetEmails(value []Usersable)() { + m.emails = value +} +// SetExternalId sets the externalId property value. A unique identifier for the resource as defined by the provisioning client. +func (m *User) SetExternalId(value *string)() { + m.externalId = value +} +// SetName sets the name property value. The name property +func (m *User) SetName(value UserNameable)() { + m.name = value +} +// SetRoles sets the roles property value. The roles assigned to the user. +func (m *User) SetRoles(value []Usersable)() { + m.roles = value +} +// SetSchemas sets the schemas property value. The URIs that are used to indicate the namespaces of the SCIM schemas. +func (m *User) SetSchemas(value []User_schemas)() { + m.schemas = value +} +// SetUserName sets the userName property value. The username for the user. +func (m *User) SetUserName(value *string)() { + m.userName = value +} +type Userable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetDisplayName()(*string) + GetEmails()([]Usersable) + GetExternalId()(*string) + GetName()(UserNameable) + GetRoles()([]Usersable) + GetSchemas()([]User_schemas) + GetUserName()(*string) + SetActive(value *bool)() + SetDisplayName(value *string)() + SetEmails(value []Usersable)() + SetExternalId(value *string)() + SetName(value UserNameable)() + SetRoles(value []Usersable)() + SetSchemas(value []User_schemas)() + SetUserName(value *string)() +} diff --git a/pkg/github/models/user_escaped_schemas.go b/pkg/github/models/user_escaped_schemas.go new file mode 100644 index 00000000..c273066f --- /dev/null +++ b/pkg/github/models/user_escaped_schemas.go @@ -0,0 +1,30 @@ +package models +type User_schemas int + +const ( + URNIETFPARAMSSCIMSCHEMASCORE20USER_USER_SCHEMAS User_schemas = iota +) + +func (i User_schemas) String() string { + return []string{"urn:ietf:params:scim:schemas:core:2.0:User"}[i] +} +func ParseUser_schemas(v string) (any, error) { + result := URNIETFPARAMSSCIMSCHEMASCORE20USER_USER_SCHEMAS + switch v { + case "urn:ietf:params:scim:schemas:core:2.0:User": + result = URNIETFPARAMSSCIMSCHEMASCORE20USER_USER_SCHEMAS + default: + return nil, nil + } + return &result, nil +} +func SerializeUser_schemas(values []User_schemas) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i User_schemas) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/user_name.go b/pkg/github/models/user_name.go new file mode 100644 index 00000000..9eaabfaf --- /dev/null +++ b/pkg/github/models/user_name.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type UserName 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 family name of the user. + familyName *string + // The full name, including all middle names, titles, and suffixes as appropriate, formatted for display. + formatted *string + // The given name of the user. + givenName *string + // The middle name(s) of the user. + middleName *string +} +// NewUserName instantiates a new UserName and sets the default values. +func NewUserName()(*UserName) { + m := &UserName{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUserNameFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUserNameFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUserName(), 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 *UserName) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFamilyName gets the familyName property value. The family name of the user. +// returns a *string when successful +func (m *UserName) GetFamilyName()(*string) { + return m.familyName +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UserName) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["familyName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFamilyName(val) + } + return nil + } + res["formatted"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFormatted(val) + } + return nil + } + res["givenName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGivenName(val) + } + return nil + } + res["middleName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMiddleName(val) + } + return nil + } + return res +} +// GetFormatted gets the formatted property value. The full name, including all middle names, titles, and suffixes as appropriate, formatted for display. +// returns a *string when successful +func (m *UserName) GetFormatted()(*string) { + return m.formatted +} +// GetGivenName gets the givenName property value. The given name of the user. +// returns a *string when successful +func (m *UserName) GetGivenName()(*string) { + return m.givenName +} +// GetMiddleName gets the middleName property value. The middle name(s) of the user. +// returns a *string when successful +func (m *UserName) GetMiddleName()(*string) { + return m.middleName +} +// Serialize serializes information the current object +func (m *UserName) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("familyName", m.GetFamilyName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("formatted", m.GetFormatted()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("givenName", m.GetGivenName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("middleName", m.GetMiddleName()) + 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 *UserName) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFamilyName sets the familyName property value. The family name of the user. +func (m *UserName) SetFamilyName(value *string)() { + m.familyName = value +} +// SetFormatted sets the formatted property value. The full name, including all middle names, titles, and suffixes as appropriate, formatted for display. +func (m *UserName) SetFormatted(value *string)() { + m.formatted = value +} +// SetGivenName sets the givenName property value. The given name of the user. +func (m *UserName) SetGivenName(value *string)() { + m.givenName = value +} +// SetMiddleName sets the middleName property value. The middle name(s) of the user. +func (m *UserName) SetMiddleName(value *string)() { + m.middleName = value +} +type UserNameable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFamilyName()(*string) + GetFormatted()(*string) + GetGivenName()(*string) + GetMiddleName()(*string) + SetFamilyName(value *string)() + SetFormatted(value *string)() + SetGivenName(value *string)() + SetMiddleName(value *string)() +} diff --git a/pkg/github/models/user_name_response.go b/pkg/github/models/user_name_response.go new file mode 100644 index 00000000..d72fe613 --- /dev/null +++ b/pkg/github/models/user_name_response.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type UserNameResponse 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 family name of the user. + familyName *string + // The full name, including all middle names, titles, and suffixes as appropriate, formatted for display. + formatted *string + // The given name of the user. + givenName *string + // The middle name(s) of the user. + middleName *string +} +// NewUserNameResponse instantiates a new UserNameResponse and sets the default values. +func NewUserNameResponse()(*UserNameResponse) { + m := &UserNameResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUserNameResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUserNameResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUserNameResponse(), 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 *UserNameResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFamilyName gets the familyName property value. The family name of the user. +// returns a *string when successful +func (m *UserNameResponse) GetFamilyName()(*string) { + return m.familyName +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UserNameResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["familyName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFamilyName(val) + } + return nil + } + res["formatted"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFormatted(val) + } + return nil + } + res["givenName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGivenName(val) + } + return nil + } + res["middleName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMiddleName(val) + } + return nil + } + return res +} +// GetFormatted gets the formatted property value. The full name, including all middle names, titles, and suffixes as appropriate, formatted for display. +// returns a *string when successful +func (m *UserNameResponse) GetFormatted()(*string) { + return m.formatted +} +// GetGivenName gets the givenName property value. The given name of the user. +// returns a *string when successful +func (m *UserNameResponse) GetGivenName()(*string) { + return m.givenName +} +// GetMiddleName gets the middleName property value. The middle name(s) of the user. +// returns a *string when successful +func (m *UserNameResponse) GetMiddleName()(*string) { + return m.middleName +} +// Serialize serializes information the current object +func (m *UserNameResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("familyName", m.GetFamilyName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("formatted", m.GetFormatted()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("givenName", m.GetGivenName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("middleName", m.GetMiddleName()) + 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 *UserNameResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFamilyName sets the familyName property value. The family name of the user. +func (m *UserNameResponse) SetFamilyName(value *string)() { + m.familyName = value +} +// SetFormatted sets the formatted property value. The full name, including all middle names, titles, and suffixes as appropriate, formatted for display. +func (m *UserNameResponse) SetFormatted(value *string)() { + m.formatted = value +} +// SetGivenName sets the givenName property value. The given name of the user. +func (m *UserNameResponse) SetGivenName(value *string)() { + m.givenName = value +} +// SetMiddleName sets the middleName property value. The middle name(s) of the user. +func (m *UserNameResponse) SetMiddleName(value *string)() { + m.middleName = value +} +type UserNameResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFamilyName()(*string) + GetFormatted()(*string) + GetGivenName()(*string) + GetMiddleName()(*string) + SetFamilyName(value *string)() + SetFormatted(value *string)() + SetGivenName(value *string)() + SetMiddleName(value *string)() +} diff --git a/pkg/github/models/user_response.go b/pkg/github/models/user_response.go new file mode 100644 index 00000000..ec8e7d8b --- /dev/null +++ b/pkg/github/models/user_response.go @@ -0,0 +1,313 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type UserResponse struct { + // Whether the user active in the IdP. + active *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // A human-readable name for the user. + displayName *string + // The emails for the user. + emails []Usersable + // A unique identifier for the resource as defined by the provisioning client. + externalId *string + // The name property + name UserNameResponseable + // The roles assigned to the user. + roles []Usersable + // The URIs that are used to indicate the namespaces of the SCIM schemas. + schemas []UserResponse_schemas + // The username for the user. + userName *string +} +// NewUserResponse instantiates a new UserResponse and sets the default values. +func NewUserResponse()(*UserResponse) { + m := &UserResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUserResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUserResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUserResponse(), nil +} +// GetActive gets the active property value. Whether the user active in the IdP. +// returns a *bool when successful +func (m *UserResponse) GetActive()(*bool) { + return m.active +} +// 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 *UserResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDisplayName gets the displayName property value. A human-readable name for the user. +// returns a *string when successful +func (m *UserResponse) GetDisplayName()(*string) { + return m.displayName +} +// GetEmails gets the emails property value. The emails for the user. +// returns a []Usersable when successful +func (m *UserResponse) GetEmails()([]Usersable) { + return m.emails +} +// GetExternalId gets the externalId property value. A unique identifier for the resource as defined by the provisioning client. +// returns a *string when successful +func (m *UserResponse) GetExternalId()(*string) { + return m.externalId +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UserResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["displayName"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayName(val) + } + return nil + } + res["emails"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateUsersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Usersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Usersable) + } + } + m.SetEmails(res) + } + return nil + } + res["externalId"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExternalId(val) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateUserNameResponseFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetName(val.(UserNameResponseable)) + } + return nil + } + res["roles"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateUsersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Usersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Usersable) + } + } + m.SetRoles(res) + } + return nil + } + res["schemas"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfEnumValues(ParseUserResponse_schemas) + if err != nil { + return err + } + if val != nil { + res := make([]UserResponse_schemas, len(val)) + for i, v := range val { + if v != nil { + res[i] = *(v.(*UserResponse_schemas)) + } + } + m.SetSchemas(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 +} +// GetName gets the name property value. The name property +// returns a UserNameResponseable when successful +func (m *UserResponse) GetName()(UserNameResponseable) { + return m.name +} +// GetRoles gets the roles property value. The roles assigned to the user. +// returns a []Usersable when successful +func (m *UserResponse) GetRoles()([]Usersable) { + return m.roles +} +// GetSchemas gets the schemas property value. The URIs that are used to indicate the namespaces of the SCIM schemas. +// returns a []UserResponse_schemas when successful +func (m *UserResponse) GetSchemas()([]UserResponse_schemas) { + return m.schemas +} +// GetUserName gets the userName property value. The username for the user. +// returns a *string when successful +func (m *UserResponse) GetUserName()(*string) { + return m.userName +} +// Serialize serializes information the current object +func (m *UserResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("displayName", m.GetDisplayName()) + if err != nil { + return err + } + } + if m.GetEmails() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetEmails())) + for i, v := range m.GetEmails() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("emails", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("externalId", m.GetExternalId()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetRoles() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRoles())) + for i, v := range m.GetRoles() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("roles", cast) + if err != nil { + return err + } + } + if m.GetSchemas() != nil { + err := writer.WriteCollectionOfStringValues("schemas", SerializeUserResponse_schemas(m.GetSchemas())) + 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 +} +// SetActive sets the active property value. Whether the user active in the IdP. +func (m *UserResponse) SetActive(value *bool)() { + m.active = 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 *UserResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDisplayName sets the displayName property value. A human-readable name for the user. +func (m *UserResponse) SetDisplayName(value *string)() { + m.displayName = value +} +// SetEmails sets the emails property value. The emails for the user. +func (m *UserResponse) SetEmails(value []Usersable)() { + m.emails = value +} +// SetExternalId sets the externalId property value. A unique identifier for the resource as defined by the provisioning client. +func (m *UserResponse) SetExternalId(value *string)() { + m.externalId = value +} +// SetName sets the name property value. The name property +func (m *UserResponse) SetName(value UserNameResponseable)() { + m.name = value +} +// SetRoles sets the roles property value. The roles assigned to the user. +func (m *UserResponse) SetRoles(value []Usersable)() { + m.roles = value +} +// SetSchemas sets the schemas property value. The URIs that are used to indicate the namespaces of the SCIM schemas. +func (m *UserResponse) SetSchemas(value []UserResponse_schemas)() { + m.schemas = value +} +// SetUserName sets the userName property value. The username for the user. +func (m *UserResponse) SetUserName(value *string)() { + m.userName = value +} +type UserResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetDisplayName()(*string) + GetEmails()([]Usersable) + GetExternalId()(*string) + GetName()(UserNameResponseable) + GetRoles()([]Usersable) + GetSchemas()([]UserResponse_schemas) + GetUserName()(*string) + SetActive(value *bool)() + SetDisplayName(value *string)() + SetEmails(value []Usersable)() + SetExternalId(value *string)() + SetName(value UserNameResponseable)() + SetRoles(value []Usersable)() + SetSchemas(value []UserResponse_schemas)() + SetUserName(value *string)() +} diff --git a/pkg/github/models/user_response_escaped_schemas.go b/pkg/github/models/user_response_escaped_schemas.go new file mode 100644 index 00000000..6fdaf37d --- /dev/null +++ b/pkg/github/models/user_response_escaped_schemas.go @@ -0,0 +1,30 @@ +package models +type UserResponse_schemas int + +const ( + URNIETFPARAMSSCIMSCHEMASCORE20USER_USERRESPONSE_SCHEMAS UserResponse_schemas = iota +) + +func (i UserResponse_schemas) String() string { + return []string{"urn:ietf:params:scim:schemas:core:2.0:User"}[i] +} +func ParseUserResponse_schemas(v string) (any, error) { + result := URNIETFPARAMSSCIMSCHEMASCORE20USER_USERRESPONSE_SCHEMAS + switch v { + case "urn:ietf:params:scim:schemas:core:2.0:User": + result = URNIETFPARAMSSCIMSCHEMASCORE20USER_USERRESPONSE_SCHEMAS + default: + return nil, nil + } + return &result, nil +} +func SerializeUserResponse_schemas(values []UserResponse_schemas) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i UserResponse_schemas) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/user_role_assignment.go b/pkg/github/models/user_role_assignment.go new file mode 100644 index 00000000..245e3452 --- /dev/null +++ b/pkg/github/models/user_role_assignment.go @@ -0,0 +1,661 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// UserRoleAssignment the Relationship a User has with a role. +type UserRoleAssignment 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 avatar_url property + avatar_url *string + // The email property + email *string + // The events_url property + events_url *string + // The followers_url property + followers_url *string + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The html_url property + html_url *string + // The id property + id *int32 + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The site_admin property + site_admin *bool + // The starred_at property + starred_at *string + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The type property + typeEscaped *string + // The url property + url *string +} +// NewUserRoleAssignment instantiates a new UserRoleAssignment and sets the default values. +func NewUserRoleAssignment()(*UserRoleAssignment) { + m := &UserRoleAssignment{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUserRoleAssignmentFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUserRoleAssignmentFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUserRoleAssignment(), 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 *UserRoleAssignment) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *UserRoleAssignment) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UserRoleAssignment) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredAt(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *UserRoleAssignment) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *UserRoleAssignment) GetId()(*int32) { + return m.id +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *UserRoleAssignment) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *UserRoleAssignment) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *UserRoleAssignment) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetReposUrl()(*string) { + return m.repos_url +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *UserRoleAssignment) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredAt gets the starred_at property value. The starred_at property +// returns a *string when successful +func (m *UserRoleAssignment) GetStarredAt()(*string) { + return m.starred_at +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *UserRoleAssignment) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *UserRoleAssignment) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *UserRoleAssignment) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *UserRoleAssignment) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_at", m.GetStarredAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *UserRoleAssignment) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *UserRoleAssignment) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetEmail sets the email property value. The email property +func (m *UserRoleAssignment) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *UserRoleAssignment) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *UserRoleAssignment) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *UserRoleAssignment) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *UserRoleAssignment) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *UserRoleAssignment) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *UserRoleAssignment) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *UserRoleAssignment) SetId(value *int32)() { + m.id = value +} +// SetLogin sets the login property value. The login property +func (m *UserRoleAssignment) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *UserRoleAssignment) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *UserRoleAssignment) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *UserRoleAssignment) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *UserRoleAssignment) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *UserRoleAssignment) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *UserRoleAssignment) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredAt sets the starred_at property value. The starred_at property +func (m *UserRoleAssignment) SetStarredAt(value *string)() { + m.starred_at = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *UserRoleAssignment) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *UserRoleAssignment) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *UserRoleAssignment) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUrl sets the url property value. The url property +func (m *UserRoleAssignment) SetUrl(value *string)() { + m.url = value +} +type UserRoleAssignmentable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowersUrl()(*string) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetSiteAdmin()(*bool) + GetStarredAt()(*string) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetTypeEscaped()(*string) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowersUrl(value *string)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetSiteAdmin(value *bool)() + SetStarredAt(value *string)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetTypeEscaped(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/user_search_result_item.go b/pkg/github/models/user_search_result_item.go new file mode 100644 index 00000000..3e393cb7 --- /dev/null +++ b/pkg/github/models/user_search_result_item.go @@ -0,0 +1,1051 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// UserSearchResultItem user Search Result Item +type UserSearchResultItem 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 avatar_url property + avatar_url *string + // The bio property + bio *string + // The blog property + blog *string + // The company property + company *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The email property + email *string + // The events_url property + events_url *string + // The followers property + followers *int32 + // The followers_url property + followers_url *string + // The following property + following *int32 + // The following_url property + following_url *string + // The gists_url property + gists_url *string + // The gravatar_id property + gravatar_id *string + // The hireable property + hireable *bool + // The html_url property + html_url *string + // The id property + id *int64 + // The location property + location *string + // The login property + login *string + // The name property + name *string + // The node_id property + node_id *string + // The organizations_url property + organizations_url *string + // The public_gists property + public_gists *int32 + // The public_repos property + public_repos *int32 + // The received_events_url property + received_events_url *string + // The repos_url property + repos_url *string + // The score property + score *float64 + // The site_admin property + site_admin *bool + // The starred_url property + starred_url *string + // The subscriptions_url property + subscriptions_url *string + // The suspended_at property + suspended_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The text_matches property + text_matches []Usersable + // The type property + typeEscaped *string + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewUserSearchResultItem instantiates a new UserSearchResultItem and sets the default values. +func NewUserSearchResultItem()(*UserSearchResultItem) { + m := &UserSearchResultItem{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUserSearchResultItemFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUserSearchResultItemFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUserSearchResultItem(), 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 *UserSearchResultItem) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvatarUrl gets the avatar_url property value. The avatar_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetAvatarUrl()(*string) { + return m.avatar_url +} +// GetBio gets the bio property value. The bio property +// returns a *string when successful +func (m *UserSearchResultItem) GetBio()(*string) { + return m.bio +} +// GetBlog gets the blog property value. The blog property +// returns a *string when successful +func (m *UserSearchResultItem) GetBlog()(*string) { + return m.blog +} +// GetCompany gets the company property value. The company property +// returns a *string when successful +func (m *UserSearchResultItem) GetCompany()(*string) { + return m.company +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *UserSearchResultItem) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetEmail gets the email property value. The email property +// returns a *string when successful +func (m *UserSearchResultItem) GetEmail()(*string) { + return m.email +} +// GetEventsUrl gets the events_url property value. The events_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetEventsUrl()(*string) { + return m.events_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UserSearchResultItem) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["avatar_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAvatarUrl(val) + } + return nil + } + res["bio"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBio(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + 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["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventsUrl(val) + } + return nil + } + res["followers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowers(val) + } + return nil + } + res["followers_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowersUrl(val) + } + return nil + } + res["following"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetFollowing(val) + } + return nil + } + res["following_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFollowingUrl(val) + } + return nil + } + res["gists_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGistsUrl(val) + } + return nil + } + res["gravatar_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGravatarId(val) + } + return nil + } + res["hireable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHireable(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["login"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogin(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["organizations_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganizationsUrl(val) + } + return nil + } + res["public_gists"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicGists(val) + } + return nil + } + res["public_repos"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPublicRepos(val) + } + return nil + } + res["received_events_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReceivedEventsUrl(val) + } + return nil + } + res["repos_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReposUrl(val) + } + return nil + } + res["score"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetScore(val) + } + return nil + } + res["site_admin"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSiteAdmin(val) + } + return nil + } + res["starred_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStarredUrl(val) + } + return nil + } + res["subscriptions_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscriptionsUrl(val) + } + return nil + } + res["suspended_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetSuspendedAt(val) + } + return nil + } + res["text_matches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateUsersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]Usersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(Usersable) + } + } + m.SetTextMatches(res) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetFollowers gets the followers property value. The followers property +// returns a *int32 when successful +func (m *UserSearchResultItem) GetFollowers()(*int32) { + return m.followers +} +// GetFollowersUrl gets the followers_url property value. The followers_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetFollowersUrl()(*string) { + return m.followers_url +} +// GetFollowing gets the following property value. The following property +// returns a *int32 when successful +func (m *UserSearchResultItem) GetFollowing()(*int32) { + return m.following +} +// GetFollowingUrl gets the following_url property value. The following_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetFollowingUrl()(*string) { + return m.following_url +} +// GetGistsUrl gets the gists_url property value. The gists_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetGistsUrl()(*string) { + return m.gists_url +} +// GetGravatarId gets the gravatar_id property value. The gravatar_id property +// returns a *string when successful +func (m *UserSearchResultItem) GetGravatarId()(*string) { + return m.gravatar_id +} +// GetHireable gets the hireable property value. The hireable property +// returns a *bool when successful +func (m *UserSearchResultItem) GetHireable()(*bool) { + return m.hireable +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int64 when successful +func (m *UserSearchResultItem) GetId()(*int64) { + return m.id +} +// GetLocation gets the location property value. The location property +// returns a *string when successful +func (m *UserSearchResultItem) GetLocation()(*string) { + return m.location +} +// GetLogin gets the login property value. The login property +// returns a *string when successful +func (m *UserSearchResultItem) GetLogin()(*string) { + return m.login +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *UserSearchResultItem) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *UserSearchResultItem) GetNodeId()(*string) { + return m.node_id +} +// GetOrganizationsUrl gets the organizations_url property value. The organizations_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetOrganizationsUrl()(*string) { + return m.organizations_url +} +// GetPublicGists gets the public_gists property value. The public_gists property +// returns a *int32 when successful +func (m *UserSearchResultItem) GetPublicGists()(*int32) { + return m.public_gists +} +// GetPublicRepos gets the public_repos property value. The public_repos property +// returns a *int32 when successful +func (m *UserSearchResultItem) GetPublicRepos()(*int32) { + return m.public_repos +} +// GetReceivedEventsUrl gets the received_events_url property value. The received_events_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetReceivedEventsUrl()(*string) { + return m.received_events_url +} +// GetReposUrl gets the repos_url property value. The repos_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetReposUrl()(*string) { + return m.repos_url +} +// GetScore gets the score property value. The score property +// returns a *float64 when successful +func (m *UserSearchResultItem) GetScore()(*float64) { + return m.score +} +// GetSiteAdmin gets the site_admin property value. The site_admin property +// returns a *bool when successful +func (m *UserSearchResultItem) GetSiteAdmin()(*bool) { + return m.site_admin +} +// GetStarredUrl gets the starred_url property value. The starred_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetStarredUrl()(*string) { + return m.starred_url +} +// GetSubscriptionsUrl gets the subscriptions_url property value. The subscriptions_url property +// returns a *string when successful +func (m *UserSearchResultItem) GetSubscriptionsUrl()(*string) { + return m.subscriptions_url +} +// GetSuspendedAt gets the suspended_at property value. The suspended_at property +// returns a *Time when successful +func (m *UserSearchResultItem) GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.suspended_at +} +// GetTextMatches gets the text_matches property value. The text_matches property +// returns a []Usersable when successful +func (m *UserSearchResultItem) GetTextMatches()([]Usersable) { + return m.text_matches +} +// GetTypeEscaped gets the type property value. The type property +// returns a *string when successful +func (m *UserSearchResultItem) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *UserSearchResultItem) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *UserSearchResultItem) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *UserSearchResultItem) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("avatar_url", m.GetAvatarUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("bio", m.GetBio()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("events_url", m.GetEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("followers", m.GetFollowers()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("followers_url", m.GetFollowersUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("following", m.GetFollowing()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("following_url", m.GetFollowingUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gists_url", m.GetGistsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gravatar_id", m.GetGravatarId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("hireable", m.GetHireable()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("login", m.GetLogin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organizations_url", m.GetOrganizationsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_gists", m.GetPublicGists()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("public_repos", m.GetPublicRepos()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("received_events_url", m.GetReceivedEventsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repos_url", m.GetReposUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("score", m.GetScore()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("site_admin", m.GetSiteAdmin()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("starred_url", m.GetStarredUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("subscriptions_url", m.GetSubscriptionsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("suspended_at", m.GetSuspendedAt()) + if err != nil { + return err + } + } + if m.GetTextMatches() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTextMatches())) + for i, v := range m.GetTextMatches() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("text_matches", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *UserSearchResultItem) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvatarUrl sets the avatar_url property value. The avatar_url property +func (m *UserSearchResultItem) SetAvatarUrl(value *string)() { + m.avatar_url = value +} +// SetBio sets the bio property value. The bio property +func (m *UserSearchResultItem) SetBio(value *string)() { + m.bio = value +} +// SetBlog sets the blog property value. The blog property +func (m *UserSearchResultItem) SetBlog(value *string)() { + m.blog = value +} +// SetCompany sets the company property value. The company property +func (m *UserSearchResultItem) SetCompany(value *string)() { + m.company = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *UserSearchResultItem) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetEmail sets the email property value. The email property +func (m *UserSearchResultItem) SetEmail(value *string)() { + m.email = value +} +// SetEventsUrl sets the events_url property value. The events_url property +func (m *UserSearchResultItem) SetEventsUrl(value *string)() { + m.events_url = value +} +// SetFollowers sets the followers property value. The followers property +func (m *UserSearchResultItem) SetFollowers(value *int32)() { + m.followers = value +} +// SetFollowersUrl sets the followers_url property value. The followers_url property +func (m *UserSearchResultItem) SetFollowersUrl(value *string)() { + m.followers_url = value +} +// SetFollowing sets the following property value. The following property +func (m *UserSearchResultItem) SetFollowing(value *int32)() { + m.following = value +} +// SetFollowingUrl sets the following_url property value. The following_url property +func (m *UserSearchResultItem) SetFollowingUrl(value *string)() { + m.following_url = value +} +// SetGistsUrl sets the gists_url property value. The gists_url property +func (m *UserSearchResultItem) SetGistsUrl(value *string)() { + m.gists_url = value +} +// SetGravatarId sets the gravatar_id property value. The gravatar_id property +func (m *UserSearchResultItem) SetGravatarId(value *string)() { + m.gravatar_id = value +} +// SetHireable sets the hireable property value. The hireable property +func (m *UserSearchResultItem) SetHireable(value *bool)() { + m.hireable = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *UserSearchResultItem) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *UserSearchResultItem) SetId(value *int64)() { + m.id = value +} +// SetLocation sets the location property value. The location property +func (m *UserSearchResultItem) SetLocation(value *string)() { + m.location = value +} +// SetLogin sets the login property value. The login property +func (m *UserSearchResultItem) SetLogin(value *string)() { + m.login = value +} +// SetName sets the name property value. The name property +func (m *UserSearchResultItem) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *UserSearchResultItem) SetNodeId(value *string)() { + m.node_id = value +} +// SetOrganizationsUrl sets the organizations_url property value. The organizations_url property +func (m *UserSearchResultItem) SetOrganizationsUrl(value *string)() { + m.organizations_url = value +} +// SetPublicGists sets the public_gists property value. The public_gists property +func (m *UserSearchResultItem) SetPublicGists(value *int32)() { + m.public_gists = value +} +// SetPublicRepos sets the public_repos property value. The public_repos property +func (m *UserSearchResultItem) SetPublicRepos(value *int32)() { + m.public_repos = value +} +// SetReceivedEventsUrl sets the received_events_url property value. The received_events_url property +func (m *UserSearchResultItem) SetReceivedEventsUrl(value *string)() { + m.received_events_url = value +} +// SetReposUrl sets the repos_url property value. The repos_url property +func (m *UserSearchResultItem) SetReposUrl(value *string)() { + m.repos_url = value +} +// SetScore sets the score property value. The score property +func (m *UserSearchResultItem) SetScore(value *float64)() { + m.score = value +} +// SetSiteAdmin sets the site_admin property value. The site_admin property +func (m *UserSearchResultItem) SetSiteAdmin(value *bool)() { + m.site_admin = value +} +// SetStarredUrl sets the starred_url property value. The starred_url property +func (m *UserSearchResultItem) SetStarredUrl(value *string)() { + m.starred_url = value +} +// SetSubscriptionsUrl sets the subscriptions_url property value. The subscriptions_url property +func (m *UserSearchResultItem) SetSubscriptionsUrl(value *string)() { + m.subscriptions_url = value +} +// SetSuspendedAt sets the suspended_at property value. The suspended_at property +func (m *UserSearchResultItem) SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.suspended_at = value +} +// SetTextMatches sets the text_matches property value. The text_matches property +func (m *UserSearchResultItem) SetTextMatches(value []Usersable)() { + m.text_matches = value +} +// SetTypeEscaped sets the type property value. The type property +func (m *UserSearchResultItem) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *UserSearchResultItem) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *UserSearchResultItem) SetUrl(value *string)() { + m.url = value +} +type UserSearchResultItemable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvatarUrl()(*string) + GetBio()(*string) + GetBlog()(*string) + GetCompany()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetEventsUrl()(*string) + GetFollowers()(*int32) + GetFollowersUrl()(*string) + GetFollowing()(*int32) + GetFollowingUrl()(*string) + GetGistsUrl()(*string) + GetGravatarId()(*string) + GetHireable()(*bool) + GetHtmlUrl()(*string) + GetId()(*int64) + GetLocation()(*string) + GetLogin()(*string) + GetName()(*string) + GetNodeId()(*string) + GetOrganizationsUrl()(*string) + GetPublicGists()(*int32) + GetPublicRepos()(*int32) + GetReceivedEventsUrl()(*string) + GetReposUrl()(*string) + GetScore()(*float64) + GetSiteAdmin()(*bool) + GetStarredUrl()(*string) + GetSubscriptionsUrl()(*string) + GetSuspendedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTextMatches()([]Usersable) + GetTypeEscaped()(*string) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetAvatarUrl(value *string)() + SetBio(value *string)() + SetBlog(value *string)() + SetCompany(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetEventsUrl(value *string)() + SetFollowers(value *int32)() + SetFollowersUrl(value *string)() + SetFollowing(value *int32)() + SetFollowingUrl(value *string)() + SetGistsUrl(value *string)() + SetGravatarId(value *string)() + SetHireable(value *bool)() + SetHtmlUrl(value *string)() + SetId(value *int64)() + SetLocation(value *string)() + SetLogin(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetOrganizationsUrl(value *string)() + SetPublicGists(value *int32)() + SetPublicRepos(value *int32)() + SetReceivedEventsUrl(value *string)() + SetReposUrl(value *string)() + SetScore(value *float64)() + SetSiteAdmin(value *bool)() + SetStarredUrl(value *string)() + SetSubscriptionsUrl(value *string)() + SetSuspendedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTextMatches(value []Usersable)() + SetTypeEscaped(value *string)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/users.go b/pkg/github/models/users.go new file mode 100644 index 00000000..cf42c03e --- /dev/null +++ b/pkg/github/models/users.go @@ -0,0 +1,138 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Users struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether this email address is the primary address. + primary *bool + // The type of email address. + typeEscaped *string + // The email address. + value *string +} +// NewUsers instantiates a new Users and sets the default values. +func NewUsers()(*Users) { + m := &Users{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUsersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUsers(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *Users) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Users) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["primary"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrimary(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetPrimary gets the primary property value. Whether this email address is the primary address. +// returns a *bool when successful +func (m *Users) GetPrimary()(*bool) { + return m.primary +} +// GetTypeEscaped gets the type property value. The type of email address. +// returns a *string when successful +func (m *Users) GetTypeEscaped()(*string) { + return m.typeEscaped +} +// GetValue gets the value property value. The email address. +// returns a *string when successful +func (m *Users) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *Users) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("primary", m.GetPrimary()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("type", m.GetTypeEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *Users) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPrimary sets the primary property value. Whether this email address is the primary address. +func (m *Users) SetPrimary(value *bool)() { + m.primary = value +} +// SetTypeEscaped sets the type property value. The type of email address. +func (m *Users) SetTypeEscaped(value *string)() { + m.typeEscaped = value +} +// SetValue sets the value property value. The email address. +func (m *Users) SetValue(value *string)() { + m.value = value +} +type Usersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPrimary()(*bool) + GetTypeEscaped()(*string) + GetValue()(*string) + SetPrimary(value *bool)() + SetTypeEscaped(value *string)() + SetValue(value *string)() +} diff --git a/pkg/github/models/users503_error.go b/pkg/github/models/users503_error.go new file mode 100644 index 00000000..02d5fad0 --- /dev/null +++ b/pkg/github/models/users503_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 Users503Error 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 +} +// NewUsers503Error instantiates a new Users503Error and sets the default values. +func NewUsers503Error()(*Users503Error) { + m := &Users503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUsers503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsers503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUsers503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *Users503Error) 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 *Users503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *Users503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *Users503Error) 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 *Users503Error) 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 *Users503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *Users503Error) 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 *Users503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *Users503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *Users503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *Users503Error) SetMessage(value *string)() { + m.message = value +} +type Users503Errorable 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/validation_error.go b/pkg/github/models/validation_error.go new file mode 100644 index 00000000..1c948775 --- /dev/null +++ b/pkg/github/models/validation_error.go @@ -0,0 +1,159 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ValidationError validation Error +type ValidationError 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 documentation_url property + documentation_url *string + // The errors property + errors []ValidationError_errorsable + // The message property + message *string +} +// NewValidationError instantiates a new ValidationError and sets the default values. +func NewValidationError()(*ValidationError) { + m := &ValidationError{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateValidationErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateValidationErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewValidationError(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ValidationError) 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 *ValidationError) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ValidationError) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []ValidationError_errorsable when successful +func (m *ValidationError) GetErrors()([]ValidationError_errorsable) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ValidationError) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateValidationError_errorsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ValidationError_errorsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ValidationError_errorsable) + } + } + m.SetErrors(res) + } + 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 *ValidationError) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ValidationError) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + if m.GetErrors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetErrors())) + for i, v := range m.GetErrors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("errors", cast) + 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 *ValidationError) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ValidationError) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ValidationError) SetErrors(value []ValidationError_errorsable)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ValidationError) SetMessage(value *string)() { + m.message = value +} +type ValidationErrorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetErrors()([]ValidationError_errorsable) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetErrors(value []ValidationError_errorsable)() + SetMessage(value *string)() +} diff --git a/pkg/github/models/validation_error_escaped_errors.go b/pkg/github/models/validation_error_escaped_errors.go new file mode 100644 index 00000000..25a901d8 --- /dev/null +++ b/pkg/github/models/validation_error_escaped_errors.go @@ -0,0 +1,319 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ValidationError_errors 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 code property + code *string + // The field property + field *string + // The index property + index *int32 + // The message property + message *string + // The resource property + resource *string + // The value property + value ValidationError_errors_ValidationError_errors_valueable +} +// ValidationError_errors_ValidationError_errors_value composed type wrapper for classes int32, string +type ValidationError_errors_ValidationError_errors_value struct { + // Composed type representation for type int32 + integer *int32 + // Composed type representation for type string + string *string +} +// NewValidationError_errors_ValidationError_errors_value instantiates a new ValidationError_errors_ValidationError_errors_value and sets the default values. +func NewValidationError_errors_ValidationError_errors_value()(*ValidationError_errors_ValidationError_errors_value) { + m := &ValidationError_errors_ValidationError_errors_value{ + } + return m +} +// CreateValidationError_errors_ValidationError_errors_valueFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateValidationError_errors_ValidationError_errors_valueFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewValidationError_errors_ValidationError_errors_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.GetInt32Value(); val != nil { + if err != nil { + return nil, err + } + result.SetInteger(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ValidationError_errors_ValidationError_errors_value) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetInteger gets the integer property value. Composed type representation for type int32 +// returns a *int32 when successful +func (m *ValidationError_errors_ValidationError_errors_value) GetInteger()(*int32) { + return m.integer +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ValidationError_errors_ValidationError_errors_value) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ValidationError_errors_ValidationError_errors_value) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ValidationError_errors_ValidationError_errors_value) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInteger() != nil { + err := writer.WriteInt32Value("", m.GetInteger()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetInteger sets the integer property value. Composed type representation for type int32 +func (m *ValidationError_errors_ValidationError_errors_value) SetInteger(value *int32)() { + m.integer = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ValidationError_errors_ValidationError_errors_value) SetString(value *string)() { + m.string = value +} +type ValidationError_errors_ValidationError_errors_valueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInteger()(*int32) + GetString()(*string) + SetInteger(value *int32)() + SetString(value *string)() +} +// NewValidationError_errors instantiates a new ValidationError_errors and sets the default values. +func NewValidationError_errors()(*ValidationError_errors) { + m := &ValidationError_errors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateValidationError_errorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateValidationError_errorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewValidationError_errors(), 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 *ValidationError_errors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *ValidationError_errors) GetCode()(*string) { + return m.code +} +// GetField gets the field property value. The field property +// returns a *string when successful +func (m *ValidationError_errors) GetField()(*string) { + return m.field +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ValidationError_errors) 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["field"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetField(val) + } + return nil + } + res["index"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetIndex(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 + } + res["resource"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResource(val) + } + return nil + } + res["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateValidationError_errors_ValidationError_errors_valueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetValue(val.(ValidationError_errors_ValidationError_errors_valueable)) + } + return nil + } + return res +} +// GetIndex gets the index property value. The index property +// returns a *int32 when successful +func (m *ValidationError_errors) GetIndex()(*int32) { + return m.index +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ValidationError_errors) GetMessage()(*string) { + return m.message +} +// GetResource gets the resource property value. The resource property +// returns a *string when successful +func (m *ValidationError_errors) GetResource()(*string) { + return m.resource +} +// GetValue gets the value property value. The value property +// returns a ValidationError_errors_ValidationError_errors_valueable when successful +func (m *ValidationError_errors) GetValue()(ValidationError_errors_ValidationError_errors_valueable) { + return m.value +} +// Serialize serializes information the current object +func (m *ValidationError_errors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("field", m.GetField()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("index", m.GetIndex()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resource", m.GetResource()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("value", m.GetValue()) + 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 *ValidationError_errors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *ValidationError_errors) SetCode(value *string)() { + m.code = value +} +// SetField sets the field property value. The field property +func (m *ValidationError_errors) SetField(value *string)() { + m.field = value +} +// SetIndex sets the index property value. The index property +func (m *ValidationError_errors) SetIndex(value *int32)() { + m.index = value +} +// SetMessage sets the message property value. The message property +func (m *ValidationError_errors) SetMessage(value *string)() { + m.message = value +} +// SetResource sets the resource property value. The resource property +func (m *ValidationError_errors) SetResource(value *string)() { + m.resource = value +} +// SetValue sets the value property value. The value property +func (m *ValidationError_errors) SetValue(value ValidationError_errors_ValidationError_errors_valueable)() { + m.value = value +} +type ValidationError_errorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetField()(*string) + GetIndex()(*int32) + GetMessage()(*string) + GetResource()(*string) + GetValue()(ValidationError_errors_ValidationError_errors_valueable) + SetCode(value *string)() + SetField(value *string)() + SetIndex(value *int32)() + SetMessage(value *string)() + SetResource(value *string)() + SetValue(value ValidationError_errors_ValidationError_errors_valueable)() +} diff --git a/pkg/github/models/validation_error_simple.go b/pkg/github/models/validation_error_simple.go new file mode 100644 index 00000000..dbe7ed25 --- /dev/null +++ b/pkg/github/models/validation_error_simple.go @@ -0,0 +1,153 @@ +package models + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ValidationErrorSimple validation Error Simple +type ValidationErrorSimple 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 documentation_url property + documentation_url *string + // The errors property + errors []string + // The message property + message *string +} +// NewValidationErrorSimple instantiates a new ValidationErrorSimple and sets the default values. +func NewValidationErrorSimple()(*ValidationErrorSimple) { + m := &ValidationErrorSimple{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateValidationErrorSimpleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateValidationErrorSimpleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewValidationErrorSimple(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ValidationErrorSimple) 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 *ValidationErrorSimple) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ValidationErrorSimple) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []string when successful +func (m *ValidationErrorSimple) GetErrors()([]string) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ValidationErrorSimple) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["errors"] = 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.SetErrors(res) + } + 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 *ValidationErrorSimple) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ValidationErrorSimple) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + if m.GetErrors() != nil { + err := writer.WriteCollectionOfStringValues("errors", m.GetErrors()) + 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 *ValidationErrorSimple) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ValidationErrorSimple) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ValidationErrorSimple) SetErrors(value []string)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ValidationErrorSimple) SetMessage(value *string)() { + m.message = value +} +type ValidationErrorSimpleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetErrors()([]string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetErrors(value []string)() + SetMessage(value *string)() +} diff --git a/pkg/github/models/verification.go b/pkg/github/models/verification.go new file mode 100644 index 00000000..8ee7f11e --- /dev/null +++ b/pkg/github/models/verification.go @@ -0,0 +1,167 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Verification 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 payload property + payload *string + // The reason property + reason *string + // The signature property + signature *string + // The verified property + verified *bool +} +// NewVerification instantiates a new Verification and sets the default values. +func NewVerification()(*Verification) { + m := &Verification{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateVerificationFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateVerificationFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewVerification(), 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 *Verification) 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 *Verification) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + res["signature"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSignature(val) + } + return nil + } + res["verified"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetVerified(val) + } + return nil + } + return res +} +// GetPayload gets the payload property value. The payload property +// returns a *string when successful +func (m *Verification) GetPayload()(*string) { + return m.payload +} +// GetReason gets the reason property value. The reason property +// returns a *string when successful +func (m *Verification) GetReason()(*string) { + return m.reason +} +// GetSignature gets the signature property value. The signature property +// returns a *string when successful +func (m *Verification) GetSignature()(*string) { + return m.signature +} +// GetVerified gets the verified property value. The verified property +// returns a *bool when successful +func (m *Verification) GetVerified()(*bool) { + return m.verified +} +// Serialize serializes information the current object +func (m *Verification) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("signature", m.GetSignature()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("verified", m.GetVerified()) + 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 *Verification) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPayload sets the payload property value. The payload property +func (m *Verification) SetPayload(value *string)() { + m.payload = value +} +// SetReason sets the reason property value. The reason property +func (m *Verification) SetReason(value *string)() { + m.reason = value +} +// SetSignature sets the signature property value. The signature property +func (m *Verification) SetSignature(value *string)() { + m.signature = value +} +// SetVerified sets the verified property value. The verified property +func (m *Verification) SetVerified(value *bool)() { + m.verified = value +} +type Verificationable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPayload()(*string) + GetReason()(*string) + GetSignature()(*string) + GetVerified()(*bool) + SetPayload(value *string)() + SetReason(value *string)() + SetSignature(value *string)() + SetVerified(value *bool)() +} diff --git a/pkg/github/models/vulnerability.go b/pkg/github/models/vulnerability.go new file mode 100644 index 00000000..5d1c49be --- /dev/null +++ b/pkg/github/models/vulnerability.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Vulnerability a vulnerability describing the product and its affected versions within a GitHub Security Advisory. +type Vulnerability 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 package version that resolves the vulnerability. + first_patched_version *string + // The name of the package affected by the vulnerability. + packageEscaped Vulnerability_packageable + // The functions in the package that are affected by the vulnerability. + vulnerable_functions []string + // The range of the package versions affected by the vulnerability. + vulnerable_version_range *string +} +// NewVulnerability instantiates a new Vulnerability and sets the default values. +func NewVulnerability()(*Vulnerability) { + m := &Vulnerability{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateVulnerabilityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateVulnerabilityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewVulnerability(), 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 *Vulnerability) 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 *Vulnerability) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["first_patched_version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetFirstPatchedVersion(val) + } + return nil + } + res["package"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateVulnerability_packageFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetPackageEscaped(val.(Vulnerability_packageable)) + } + return nil + } + res["vulnerable_functions"] = 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.SetVulnerableFunctions(res) + } + return nil + } + res["vulnerable_version_range"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetVulnerableVersionRange(val) + } + return nil + } + return res +} +// GetFirstPatchedVersion gets the first_patched_version property value. The package version that resolves the vulnerability. +// returns a *string when successful +func (m *Vulnerability) GetFirstPatchedVersion()(*string) { + return m.first_patched_version +} +// GetPackageEscaped gets the package property value. The name of the package affected by the vulnerability. +// returns a Vulnerability_packageable when successful +func (m *Vulnerability) GetPackageEscaped()(Vulnerability_packageable) { + return m.packageEscaped +} +// GetVulnerableFunctions gets the vulnerable_functions property value. The functions in the package that are affected by the vulnerability. +// returns a []string when successful +func (m *Vulnerability) GetVulnerableFunctions()([]string) { + return m.vulnerable_functions +} +// GetVulnerableVersionRange gets the vulnerable_version_range property value. The range of the package versions affected by the vulnerability. +// returns a *string when successful +func (m *Vulnerability) GetVulnerableVersionRange()(*string) { + return m.vulnerable_version_range +} +// Serialize serializes information the current object +func (m *Vulnerability) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("first_patched_version", m.GetFirstPatchedVersion()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("package", m.GetPackageEscaped()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("vulnerable_version_range", m.GetVulnerableVersionRange()) + 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 *Vulnerability) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetFirstPatchedVersion sets the first_patched_version property value. The package version that resolves the vulnerability. +func (m *Vulnerability) SetFirstPatchedVersion(value *string)() { + m.first_patched_version = value +} +// SetPackageEscaped sets the package property value. The name of the package affected by the vulnerability. +func (m *Vulnerability) SetPackageEscaped(value Vulnerability_packageable)() { + m.packageEscaped = value +} +// SetVulnerableFunctions sets the vulnerable_functions property value. The functions in the package that are affected by the vulnerability. +func (m *Vulnerability) SetVulnerableFunctions(value []string)() { + m.vulnerable_functions = value +} +// SetVulnerableVersionRange sets the vulnerable_version_range property value. The range of the package versions affected by the vulnerability. +func (m *Vulnerability) SetVulnerableVersionRange(value *string)() { + m.vulnerable_version_range = value +} +type Vulnerabilityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetFirstPatchedVersion()(*string) + GetPackageEscaped()(Vulnerability_packageable) + GetVulnerableFunctions()([]string) + GetVulnerableVersionRange()(*string) + SetFirstPatchedVersion(value *string)() + SetPackageEscaped(value Vulnerability_packageable)() + SetVulnerableFunctions(value []string)() + SetVulnerableVersionRange(value *string)() +} diff --git a/pkg/github/models/vulnerability_escaped_package.go b/pkg/github/models/vulnerability_escaped_package.go new file mode 100644 index 00000000..e111b4c2 --- /dev/null +++ b/pkg/github/models/vulnerability_escaped_package.go @@ -0,0 +1,111 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Vulnerability_package the name of the package affected by the vulnerability. +type Vulnerability_package 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 package's language or package management ecosystem. + ecosystem *SecurityAdvisoryEcosystems + // The unique package name within its ecosystem. + name *string +} +// NewVulnerability_package instantiates a new Vulnerability_package and sets the default values. +func NewVulnerability_package()(*Vulnerability_package) { + m := &Vulnerability_package{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateVulnerability_packageFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateVulnerability_packageFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewVulnerability_package(), 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 *Vulnerability_package) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEcosystem gets the ecosystem property value. The package's language or package management ecosystem. +// returns a *SecurityAdvisoryEcosystems when successful +func (m *Vulnerability_package) GetEcosystem()(*SecurityAdvisoryEcosystems) { + return m.ecosystem +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Vulnerability_package) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ecosystem"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseSecurityAdvisoryEcosystems) + if err != nil { + return err + } + if val != nil { + m.SetEcosystem(val.(*SecurityAdvisoryEcosystems)) + } + 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 unique package name within its ecosystem. +// returns a *string when successful +func (m *Vulnerability_package) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *Vulnerability_package) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEcosystem() != nil { + cast := (*m.GetEcosystem()).String() + err := writer.WriteStringValue("ecosystem", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *Vulnerability_package) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEcosystem sets the ecosystem property value. The package's language or package management ecosystem. +func (m *Vulnerability_package) SetEcosystem(value *SecurityAdvisoryEcosystems)() { + m.ecosystem = value +} +// SetName sets the name property value. The unique package name within its ecosystem. +func (m *Vulnerability_package) SetName(value *string)() { + m.name = value +} +type Vulnerability_packageable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEcosystem()(*SecurityAdvisoryEcosystems) + GetName()(*string) + SetEcosystem(value *SecurityAdvisoryEcosystems)() + SetName(value *string)() +} diff --git a/pkg/github/models/webhook_config.go b/pkg/github/models/webhook_config.go new file mode 100644 index 00000000..c4f89bb5 --- /dev/null +++ b/pkg/github/models/webhook_config.go @@ -0,0 +1,168 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// WebhookConfig configuration object of the webhook +type WebhookConfig 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 media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl WebhookConfigInsecureSslable + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewWebhookConfig instantiates a new WebhookConfig and sets the default values. +func NewWebhookConfig()(*WebhookConfig) { + m := &WebhookConfig{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWebhookConfigFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWebhookConfigFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWebhookConfig(), 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 *WebhookConfig) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *WebhookConfig) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WebhookConfig) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(WebhookConfigInsecureSslable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a WebhookConfigInsecureSslable when successful +func (m *WebhookConfig) GetInsecureSsl()(WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). +// returns a *string when successful +func (m *WebhookConfig) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *WebhookConfig) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *WebhookConfig) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *WebhookConfig) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *WebhookConfig) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *WebhookConfig) SetInsecureSsl(value WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). +func (m *WebhookConfig) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *WebhookConfig) SetUrl(value *string)() { + m.url = value +} +type WebhookConfigable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(WebhookConfigInsecureSslable) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value WebhookConfigInsecureSslable)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/webhook_config_insecure_ssl.go b/pkg/github/models/webhook_config_insecure_ssl.go new file mode 100644 index 00000000..7f27dd98 --- /dev/null +++ b/pkg/github/models/webhook_config_insecure_ssl.go @@ -0,0 +1,376 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// WebhookConfigInsecureSsl composed type wrapper for classes float64, string +type WebhookConfigInsecureSsl struct { + // Composed type representation for type float64 + double *float64 + // Composed type representation for type string + string *string + // Composed type representation for type float64 + webhookConfigInsecureSslDouble *float64 + // Composed type representation for type float64 + webhookConfigInsecureSslDouble0 *float64 + // Composed type representation for type float64 + webhookConfigInsecureSslDouble1 *float64 + // Composed type representation for type float64 + webhookConfigInsecureSslDouble2 *float64 + // Composed type representation for type float64 + webhookConfigInsecureSslDouble3 *float64 + // Composed type representation for type float64 + webhookConfigInsecureSslDouble4 *float64 + // Composed type representation for type string + webhookConfigInsecureSslString *string + // Composed type representation for type string + webhookConfigInsecureSslString0 *string + // Composed type representation for type string + webhookConfigInsecureSslString1 *string + // Composed type representation for type string + webhookConfigInsecureSslString2 *string + // Composed type representation for type string + webhookConfigInsecureSslString3 *string + // Composed type representation for type string + webhookConfigInsecureSslString4 *string +} +// NewWebhookConfigInsecureSsl instantiates a new WebhookConfigInsecureSsl and sets the default values. +func NewWebhookConfigInsecureSsl()(*WebhookConfigInsecureSsl) { + m := &WebhookConfigInsecureSsl{ + } + return m +} +// CreateWebhookConfigInsecureSslFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWebhookConfigInsecureSslFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewWebhookConfigInsecureSsl() + 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.GetFloat64Value(); val != nil { + if err != nil { + return nil, err + } + result.SetDouble(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } else if val, err := parseNode.GetFloat64Value(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslDouble(val) + } else if val, err := parseNode.GetFloat64Value(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslDouble0(val) + } else if val, err := parseNode.GetFloat64Value(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslDouble1(val) + } else if val, err := parseNode.GetFloat64Value(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslDouble2(val) + } else if val, err := parseNode.GetFloat64Value(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslDouble3(val) + } else if val, err := parseNode.GetFloat64Value(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslDouble4(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslString0(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslString1(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslString2(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslString3(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetWebhookConfigInsecureSslString4(val) + } + return result, nil +} +// GetDouble gets the double property value. Composed type representation for type float64 +// returns a *float64 when successful +func (m *WebhookConfigInsecureSsl) GetDouble()(*float64) { + return m.double +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WebhookConfigInsecureSsl) 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 *WebhookConfigInsecureSsl) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *WebhookConfigInsecureSsl) GetString()(*string) { + return m.string +} +// GetWebhookConfigInsecureSslDouble gets the double property value. Composed type representation for type float64 +// returns a *float64 when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslDouble()(*float64) { + return m.webhookConfigInsecureSslDouble +} +// GetWebhookConfigInsecureSslDouble0 gets the double property value. Composed type representation for type float64 +// returns a *float64 when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslDouble0()(*float64) { + return m.webhookConfigInsecureSslDouble0 +} +// GetWebhookConfigInsecureSslDouble1 gets the double property value. Composed type representation for type float64 +// returns a *float64 when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslDouble1()(*float64) { + return m.webhookConfigInsecureSslDouble1 +} +// GetWebhookConfigInsecureSslDouble2 gets the double property value. Composed type representation for type float64 +// returns a *float64 when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslDouble2()(*float64) { + return m.webhookConfigInsecureSslDouble2 +} +// GetWebhookConfigInsecureSslDouble3 gets the double property value. Composed type representation for type float64 +// returns a *float64 when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslDouble3()(*float64) { + return m.webhookConfigInsecureSslDouble3 +} +// GetWebhookConfigInsecureSslDouble4 gets the double property value. Composed type representation for type float64 +// returns a *float64 when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslDouble4()(*float64) { + return m.webhookConfigInsecureSslDouble4 +} +// GetWebhookConfigInsecureSslString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslString()(*string) { + return m.webhookConfigInsecureSslString +} +// GetWebhookConfigInsecureSslString0 gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslString0()(*string) { + return m.webhookConfigInsecureSslString0 +} +// GetWebhookConfigInsecureSslString1 gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslString1()(*string) { + return m.webhookConfigInsecureSslString1 +} +// GetWebhookConfigInsecureSslString2 gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslString2()(*string) { + return m.webhookConfigInsecureSslString2 +} +// GetWebhookConfigInsecureSslString3 gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslString3()(*string) { + return m.webhookConfigInsecureSslString3 +} +// GetWebhookConfigInsecureSslString4 gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *WebhookConfigInsecureSsl) GetWebhookConfigInsecureSslString4()(*string) { + return m.webhookConfigInsecureSslString4 +} +// Serialize serializes information the current object +func (m *WebhookConfigInsecureSsl) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetDouble() != nil { + err := writer.WriteFloat64Value("", m.GetDouble()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslDouble() != nil { + err := writer.WriteFloat64Value("", m.GetWebhookConfigInsecureSslDouble()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslDouble0() != nil { + err := writer.WriteFloat64Value("", m.GetWebhookConfigInsecureSslDouble0()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslDouble1() != nil { + err := writer.WriteFloat64Value("", m.GetWebhookConfigInsecureSslDouble1()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslDouble2() != nil { + err := writer.WriteFloat64Value("", m.GetWebhookConfigInsecureSslDouble2()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslDouble3() != nil { + err := writer.WriteFloat64Value("", m.GetWebhookConfigInsecureSslDouble3()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslDouble4() != nil { + err := writer.WriteFloat64Value("", m.GetWebhookConfigInsecureSslDouble4()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslString() != nil { + err := writer.WriteStringValue("", m.GetWebhookConfigInsecureSslString()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslString0() != nil { + err := writer.WriteStringValue("", m.GetWebhookConfigInsecureSslString0()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslString1() != nil { + err := writer.WriteStringValue("", m.GetWebhookConfigInsecureSslString1()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslString2() != nil { + err := writer.WriteStringValue("", m.GetWebhookConfigInsecureSslString2()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslString3() != nil { + err := writer.WriteStringValue("", m.GetWebhookConfigInsecureSslString3()) + if err != nil { + return err + } + } else if m.GetWebhookConfigInsecureSslString4() != nil { + err := writer.WriteStringValue("", m.GetWebhookConfigInsecureSslString4()) + if err != nil { + return err + } + } + return nil +} +// SetDouble sets the double property value. Composed type representation for type float64 +func (m *WebhookConfigInsecureSsl) SetDouble(value *float64)() { + m.double = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *WebhookConfigInsecureSsl) SetString(value *string)() { + m.string = value +} +// SetWebhookConfigInsecureSslDouble sets the double property value. Composed type representation for type float64 +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslDouble(value *float64)() { + m.webhookConfigInsecureSslDouble = value +} +// SetWebhookConfigInsecureSslDouble0 sets the double property value. Composed type representation for type float64 +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslDouble0(value *float64)() { + m.webhookConfigInsecureSslDouble0 = value +} +// SetWebhookConfigInsecureSslDouble1 sets the double property value. Composed type representation for type float64 +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslDouble1(value *float64)() { + m.webhookConfigInsecureSslDouble1 = value +} +// SetWebhookConfigInsecureSslDouble2 sets the double property value. Composed type representation for type float64 +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslDouble2(value *float64)() { + m.webhookConfigInsecureSslDouble2 = value +} +// SetWebhookConfigInsecureSslDouble3 sets the double property value. Composed type representation for type float64 +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslDouble3(value *float64)() { + m.webhookConfigInsecureSslDouble3 = value +} +// SetWebhookConfigInsecureSslDouble4 sets the double property value. Composed type representation for type float64 +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslDouble4(value *float64)() { + m.webhookConfigInsecureSslDouble4 = value +} +// SetWebhookConfigInsecureSslString sets the string property value. Composed type representation for type string +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslString(value *string)() { + m.webhookConfigInsecureSslString = value +} +// SetWebhookConfigInsecureSslString0 sets the string property value. Composed type representation for type string +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslString0(value *string)() { + m.webhookConfigInsecureSslString0 = value +} +// SetWebhookConfigInsecureSslString1 sets the string property value. Composed type representation for type string +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslString1(value *string)() { + m.webhookConfigInsecureSslString1 = value +} +// SetWebhookConfigInsecureSslString2 sets the string property value. Composed type representation for type string +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslString2(value *string)() { + m.webhookConfigInsecureSslString2 = value +} +// SetWebhookConfigInsecureSslString3 sets the string property value. Composed type representation for type string +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslString3(value *string)() { + m.webhookConfigInsecureSslString3 = value +} +// SetWebhookConfigInsecureSslString4 sets the string property value. Composed type representation for type string +func (m *WebhookConfigInsecureSsl) SetWebhookConfigInsecureSslString4(value *string)() { + m.webhookConfigInsecureSslString4 = value +} +type WebhookConfigInsecureSslable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDouble()(*float64) + GetString()(*string) + GetWebhookConfigInsecureSslDouble()(*float64) + GetWebhookConfigInsecureSslDouble0()(*float64) + GetWebhookConfigInsecureSslDouble1()(*float64) + GetWebhookConfigInsecureSslDouble2()(*float64) + GetWebhookConfigInsecureSslDouble3()(*float64) + GetWebhookConfigInsecureSslDouble4()(*float64) + GetWebhookConfigInsecureSslString()(*string) + GetWebhookConfigInsecureSslString0()(*string) + GetWebhookConfigInsecureSslString1()(*string) + GetWebhookConfigInsecureSslString2()(*string) + GetWebhookConfigInsecureSslString3()(*string) + GetWebhookConfigInsecureSslString4()(*string) + SetDouble(value *float64)() + SetString(value *string)() + SetWebhookConfigInsecureSslDouble(value *float64)() + SetWebhookConfigInsecureSslDouble0(value *float64)() + SetWebhookConfigInsecureSslDouble1(value *float64)() + SetWebhookConfigInsecureSslDouble2(value *float64)() + SetWebhookConfigInsecureSslDouble3(value *float64)() + SetWebhookConfigInsecureSslDouble4(value *float64)() + SetWebhookConfigInsecureSslString(value *string)() + SetWebhookConfigInsecureSslString0(value *string)() + SetWebhookConfigInsecureSslString1(value *string)() + SetWebhookConfigInsecureSslString2(value *string)() + SetWebhookConfigInsecureSslString3(value *string)() + SetWebhookConfigInsecureSslString4(value *string)() +} diff --git a/pkg/github/models/with_path_get_response_member1.go b/pkg/github/models/with_path_get_response_member1.go new file mode 100644 index 00000000..8d44ff8c --- /dev/null +++ b/pkg/github/models/with_path_get_response_member1.go @@ -0,0 +1,52 @@ +package models + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// WithPathGetResponseMember1 a list of directory items +type WithPathGetResponseMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewWithPathGetResponseMember1 instantiates a new WithPathGetResponseMember1 and sets the default values. +func NewWithPathGetResponseMember1()(*WithPathGetResponseMember1) { + m := &WithPathGetResponseMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWithPathGetResponseMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWithPathGetResponseMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWithPathGetResponseMember1(), 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 *WithPathGetResponseMember1) 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 *WithPathGetResponseMember1) 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 *WithPathGetResponseMember1) 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 *WithPathGetResponseMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type WithPathGetResponseMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/models/workflow.go b/pkg/github/models/workflow.go new file mode 100644 index 00000000..4d0fb6b6 --- /dev/null +++ b/pkg/github/models/workflow.go @@ -0,0 +1,373 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// Workflow a GitHub Actions workflow +type Workflow 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 badge_url property + badge_url *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The deleted_at property + deleted_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The html_url property + html_url *string + // The id property + id *int32 + // The name property + name *string + // The node_id property + node_id *string + // The path property + path *string + // The state property + state *Workflow_state + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The url property + url *string +} +// NewWorkflow instantiates a new Workflow and sets the default values. +func NewWorkflow()(*Workflow) { + m := &Workflow{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflow(), 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 *Workflow) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBadgeUrl gets the badge_url property value. The badge_url property +// returns a *string when successful +func (m *Workflow) GetBadgeUrl()(*string) { + return m.badge_url +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *Workflow) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDeletedAt gets the deleted_at property value. The deleted_at property +// returns a *Time when successful +func (m *Workflow) GetDeletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.deleted_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Workflow) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["badge_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBadgeUrl(val) + } + return nil + } + 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["deleted_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDeletedAt(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ParseWorkflow_state) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*Workflow_state)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *Workflow) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The id property +// returns a *int32 when successful +func (m *Workflow) GetId()(*int32) { + return m.id +} +// GetName gets the name property value. The name property +// returns a *string when successful +func (m *Workflow) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *Workflow) GetNodeId()(*string) { + return m.node_id +} +// GetPath gets the path property value. The path property +// returns a *string when successful +func (m *Workflow) GetPath()(*string) { + return m.path +} +// GetState gets the state property value. The state property +// returns a *Workflow_state when successful +func (m *Workflow) GetState()(*Workflow_state) { + return m.state +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *Workflow) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *Workflow) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *Workflow) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("badge_url", m.GetBadgeUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("deleted_at", m.GetDeletedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *Workflow) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBadgeUrl sets the badge_url property value. The badge_url property +func (m *Workflow) SetBadgeUrl(value *string)() { + m.badge_url = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *Workflow) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDeletedAt sets the deleted_at property value. The deleted_at property +func (m *Workflow) SetDeletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.deleted_at = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *Workflow) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The id property +func (m *Workflow) SetId(value *int32)() { + m.id = value +} +// SetName sets the name property value. The name property +func (m *Workflow) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *Workflow) SetNodeId(value *string)() { + m.node_id = value +} +// SetPath sets the path property value. The path property +func (m *Workflow) SetPath(value *string)() { + m.path = value +} +// SetState sets the state property value. The state property +func (m *Workflow) SetState(value *Workflow_state)() { + m.state = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *Workflow) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The url property +func (m *Workflow) SetUrl(value *string)() { + m.url = value +} +type Workflowable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBadgeUrl()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDeletedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetHtmlUrl()(*string) + GetId()(*int32) + GetName()(*string) + GetNodeId()(*string) + GetPath()(*string) + GetState()(*Workflow_state) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + SetBadgeUrl(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDeletedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetName(value *string)() + SetNodeId(value *string)() + SetPath(value *string)() + SetState(value *Workflow_state)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() +} diff --git a/pkg/github/models/workflow_escaped_state.go b/pkg/github/models/workflow_escaped_state.go new file mode 100644 index 00000000..22028ea1 --- /dev/null +++ b/pkg/github/models/workflow_escaped_state.go @@ -0,0 +1,42 @@ +package models +type Workflow_state int + +const ( + ACTIVE_WORKFLOW_STATE Workflow_state = iota + DELETED_WORKFLOW_STATE + DISABLED_FORK_WORKFLOW_STATE + DISABLED_INACTIVITY_WORKFLOW_STATE + DISABLED_MANUALLY_WORKFLOW_STATE +) + +func (i Workflow_state) String() string { + return []string{"active", "deleted", "disabled_fork", "disabled_inactivity", "disabled_manually"}[i] +} +func ParseWorkflow_state(v string) (any, error) { + result := ACTIVE_WORKFLOW_STATE + switch v { + case "active": + result = ACTIVE_WORKFLOW_STATE + case "deleted": + result = DELETED_WORKFLOW_STATE + case "disabled_fork": + result = DISABLED_FORK_WORKFLOW_STATE + case "disabled_inactivity": + result = DISABLED_INACTIVITY_WORKFLOW_STATE + case "disabled_manually": + result = DISABLED_MANUALLY_WORKFLOW_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeWorkflow_state(values []Workflow_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Workflow_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/models/workflow_run.go b/pkg/github/models/workflow_run.go new file mode 100644 index 00000000..f9555ee9 --- /dev/null +++ b/pkg/github/models/workflow_run.go @@ -0,0 +1,1121 @@ +package models + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// WorkflowRun an invocation of a workflow +type WorkflowRun struct { + // A GitHub user. + actor SimpleUserable + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The URL to the artifacts for the workflow run. + artifacts_url *string + // The URL to cancel the workflow run. + cancel_url *string + // The ID of the associated check suite. + check_suite_id *int32 + // The node ID of the associated check suite. + check_suite_node_id *string + // The URL to the associated check suite. + check_suite_url *string + // The conclusion property + conclusion *string + // The created_at property + created_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The event-specific title associated with the run or the run-name if set, or the value of `run-name` if it is set in the workflow. + display_title *string + // The event property + event *string + // The head_branch property + head_branch *string + // A commit. + head_commit NullableSimpleCommitable + // Minimal Repository + head_repository MinimalRepositoryable + // The head_repository_id property + head_repository_id *int32 + // The SHA of the head commit that points to the version of the workflow being run. + head_sha *string + // The html_url property + html_url *string + // The ID of the workflow run. + id *int32 + // The URL to the jobs for the workflow run. + jobs_url *string + // The URL to download the logs for the workflow run. + logs_url *string + // The name of the workflow run. + name *string + // The node_id property + node_id *string + // The full path of the workflow + path *string + // The URL to the previous attempted run of this workflow, if one exists. + previous_attempt_url *string + // Pull requests that are open with a `head_sha` or `head_branch` that matches the workflow run. The returned pull requests do not necessarily indicate pull requests that triggered the run. + pull_requests []PullRequestMinimalable + // The referenced_workflows property + referenced_workflows []ReferencedWorkflowable + // Minimal Repository + repository MinimalRepositoryable + // The URL to rerun the workflow run. + rerun_url *string + // Attempt number of the run, 1 for first attempt and higher if the workflow was re-run. + run_attempt *int32 + // The auto incrementing run number for the workflow run. + run_number *int32 + // The start time of the latest run. Resets on re-run. + run_started_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The status property + status *string + // A GitHub user. + triggering_actor SimpleUserable + // The updated_at property + updated_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The URL to the workflow run. + url *string + // The ID of the parent workflow. + workflow_id *int32 + // The URL to the workflow. + workflow_url *string +} +// NewWorkflowRun instantiates a new WorkflowRun and sets the default values. +func NewWorkflowRun()(*WorkflowRun) { + m := &WorkflowRun{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateWorkflowRunFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWorkflowRunFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewWorkflowRun(), nil +} +// GetActor gets the actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *WorkflowRun) GetActor()(SimpleUserable) { + return m.actor +} +// 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 *WorkflowRun) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArtifactsUrl gets the artifacts_url property value. The URL to the artifacts for the workflow run. +// returns a *string when successful +func (m *WorkflowRun) GetArtifactsUrl()(*string) { + return m.artifacts_url +} +// GetCancelUrl gets the cancel_url property value. The URL to cancel the workflow run. +// returns a *string when successful +func (m *WorkflowRun) GetCancelUrl()(*string) { + return m.cancel_url +} +// GetCheckSuiteId gets the check_suite_id property value. The ID of the associated check suite. +// returns a *int32 when successful +func (m *WorkflowRun) GetCheckSuiteId()(*int32) { + return m.check_suite_id +} +// GetCheckSuiteNodeId gets the check_suite_node_id property value. The node ID of the associated check suite. +// returns a *string when successful +func (m *WorkflowRun) GetCheckSuiteNodeId()(*string) { + return m.check_suite_node_id +} +// GetCheckSuiteUrl gets the check_suite_url property value. The URL to the associated check suite. +// returns a *string when successful +func (m *WorkflowRun) GetCheckSuiteUrl()(*string) { + return m.check_suite_url +} +// GetConclusion gets the conclusion property value. The conclusion property +// returns a *string when successful +func (m *WorkflowRun) GetConclusion()(*string) { + return m.conclusion +} +// GetCreatedAt gets the created_at property value. The created_at property +// returns a *Time when successful +func (m *WorkflowRun) GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.created_at +} +// GetDisplayTitle gets the display_title property value. The event-specific title associated with the run or the run-name if set, or the value of `run-name` if it is set in the workflow. +// returns a *string when successful +func (m *WorkflowRun) GetDisplayTitle()(*string) { + return m.display_title +} +// GetEvent gets the event property value. The event property +// returns a *string when successful +func (m *WorkflowRun) GetEvent()(*string) { + return m.event +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WorkflowRun) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetActor(val.(SimpleUserable)) + } + return nil + } + res["artifacts_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArtifactsUrl(val) + } + return nil + } + res["cancel_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCancelUrl(val) + } + return nil + } + res["check_suite_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetCheckSuiteId(val) + } + return nil + } + res["check_suite_node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCheckSuiteNodeId(val) + } + return nil + } + res["check_suite_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCheckSuiteUrl(val) + } + return nil + } + res["conclusion"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetConclusion(val) + } + return nil + } + 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["display_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDisplayTitle(val) + } + return nil + } + res["event"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEvent(val) + } + return nil + } + res["head_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadBranch(val) + } + return nil + } + res["head_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateNullableSimpleCommitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHeadCommit(val.(NullableSimpleCommitable)) + } + return nil + } + res["head_repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetHeadRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["head_repository_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetHeadRepositoryId(val) + } + return nil + } + res["head_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadSha(val) + } + return nil + } + res["html_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHtmlUrl(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["jobs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetJobsUrl(val) + } + return nil + } + res["logs_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogsUrl(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["node_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNodeId(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["previous_attempt_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousAttemptUrl(val) + } + return nil + } + res["pull_requests"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreatePullRequestMinimalFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]PullRequestMinimalable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(PullRequestMinimalable) + } + } + m.SetPullRequests(res) + } + return nil + } + res["referenced_workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateReferencedWorkflowFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ReferencedWorkflowable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ReferencedWorkflowable) + } + } + m.SetReferencedWorkflows(res) + } + return nil + } + res["repository"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRepository(val.(MinimalRepositoryable)) + } + return nil + } + res["rerun_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRerunUrl(val) + } + return nil + } + res["run_attempt"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunAttempt(val) + } + return nil + } + res["run_number"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunNumber(val) + } + return nil + } + res["run_started_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetRunStartedAt(val) + } + return nil + } + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + res["triggering_actor"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateSimpleUserFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTriggeringActor(val.(SimpleUserable)) + } + 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["workflow_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWorkflowId(val) + } + return nil + } + res["workflow_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkflowUrl(val) + } + return nil + } + return res +} +// GetHeadBranch gets the head_branch property value. The head_branch property +// returns a *string when successful +func (m *WorkflowRun) GetHeadBranch()(*string) { + return m.head_branch +} +// GetHeadCommit gets the head_commit property value. A commit. +// returns a NullableSimpleCommitable when successful +func (m *WorkflowRun) GetHeadCommit()(NullableSimpleCommitable) { + return m.head_commit +} +// GetHeadRepository gets the head_repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *WorkflowRun) GetHeadRepository()(MinimalRepositoryable) { + return m.head_repository +} +// GetHeadRepositoryId gets the head_repository_id property value. The head_repository_id property +// returns a *int32 when successful +func (m *WorkflowRun) GetHeadRepositoryId()(*int32) { + return m.head_repository_id +} +// GetHeadSha gets the head_sha property value. The SHA of the head commit that points to the version of the workflow being run. +// returns a *string when successful +func (m *WorkflowRun) GetHeadSha()(*string) { + return m.head_sha +} +// GetHtmlUrl gets the html_url property value. The html_url property +// returns a *string when successful +func (m *WorkflowRun) GetHtmlUrl()(*string) { + return m.html_url +} +// GetId gets the id property value. The ID of the workflow run. +// returns a *int32 when successful +func (m *WorkflowRun) GetId()(*int32) { + return m.id +} +// GetJobsUrl gets the jobs_url property value. The URL to the jobs for the workflow run. +// returns a *string when successful +func (m *WorkflowRun) GetJobsUrl()(*string) { + return m.jobs_url +} +// GetLogsUrl gets the logs_url property value. The URL to download the logs for the workflow run. +// returns a *string when successful +func (m *WorkflowRun) GetLogsUrl()(*string) { + return m.logs_url +} +// GetName gets the name property value. The name of the workflow run. +// returns a *string when successful +func (m *WorkflowRun) GetName()(*string) { + return m.name +} +// GetNodeId gets the node_id property value. The node_id property +// returns a *string when successful +func (m *WorkflowRun) GetNodeId()(*string) { + return m.node_id +} +// GetPath gets the path property value. The full path of the workflow +// returns a *string when successful +func (m *WorkflowRun) GetPath()(*string) { + return m.path +} +// GetPreviousAttemptUrl gets the previous_attempt_url property value. The URL to the previous attempted run of this workflow, if one exists. +// returns a *string when successful +func (m *WorkflowRun) GetPreviousAttemptUrl()(*string) { + return m.previous_attempt_url +} +// GetPullRequests gets the pull_requests property value. Pull requests that are open with a `head_sha` or `head_branch` that matches the workflow run. The returned pull requests do not necessarily indicate pull requests that triggered the run. +// returns a []PullRequestMinimalable when successful +func (m *WorkflowRun) GetPullRequests()([]PullRequestMinimalable) { + return m.pull_requests +} +// GetReferencedWorkflows gets the referenced_workflows property value. The referenced_workflows property +// returns a []ReferencedWorkflowable when successful +func (m *WorkflowRun) GetReferencedWorkflows()([]ReferencedWorkflowable) { + return m.referenced_workflows +} +// GetRepository gets the repository property value. Minimal Repository +// returns a MinimalRepositoryable when successful +func (m *WorkflowRun) GetRepository()(MinimalRepositoryable) { + return m.repository +} +// GetRerunUrl gets the rerun_url property value. The URL to rerun the workflow run. +// returns a *string when successful +func (m *WorkflowRun) GetRerunUrl()(*string) { + return m.rerun_url +} +// GetRunAttempt gets the run_attempt property value. Attempt number of the run, 1 for first attempt and higher if the workflow was re-run. +// returns a *int32 when successful +func (m *WorkflowRun) GetRunAttempt()(*int32) { + return m.run_attempt +} +// GetRunNumber gets the run_number property value. The auto incrementing run number for the workflow run. +// returns a *int32 when successful +func (m *WorkflowRun) GetRunNumber()(*int32) { + return m.run_number +} +// GetRunStartedAt gets the run_started_at property value. The start time of the latest run. Resets on re-run. +// returns a *Time when successful +func (m *WorkflowRun) GetRunStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.run_started_at +} +// GetStatus gets the status property value. The status property +// returns a *string when successful +func (m *WorkflowRun) GetStatus()(*string) { + return m.status +} +// GetTriggeringActor gets the triggering_actor property value. A GitHub user. +// returns a SimpleUserable when successful +func (m *WorkflowRun) GetTriggeringActor()(SimpleUserable) { + return m.triggering_actor +} +// GetUpdatedAt gets the updated_at property value. The updated_at property +// returns a *Time when successful +func (m *WorkflowRun) GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.updated_at +} +// GetUrl gets the url property value. The URL to the workflow run. +// returns a *string when successful +func (m *WorkflowRun) GetUrl()(*string) { + return m.url +} +// GetWorkflowId gets the workflow_id property value. The ID of the parent workflow. +// returns a *int32 when successful +func (m *WorkflowRun) GetWorkflowId()(*int32) { + return m.workflow_id +} +// GetWorkflowUrl gets the workflow_url property value. The URL to the workflow. +// returns a *string when successful +func (m *WorkflowRun) GetWorkflowUrl()(*string) { + return m.workflow_url +} +// Serialize serializes information the current object +func (m *WorkflowRun) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("actor", m.GetActor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("artifacts_url", m.GetArtifactsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("cancel_url", m.GetCancelUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("check_suite_id", m.GetCheckSuiteId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("check_suite_node_id", m.GetCheckSuiteNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("check_suite_url", m.GetCheckSuiteUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("conclusion", m.GetConclusion()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("display_title", m.GetDisplayTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event", m.GetEvent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_branch", m.GetHeadBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("head_commit", m.GetHeadCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("head_repository", m.GetHeadRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("head_repository_id", m.GetHeadRepositoryId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_sha", m.GetHeadSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("html_url", m.GetHtmlUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("jobs_url", m.GetJobsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("logs_url", m.GetLogsUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("node_id", m.GetNodeId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_attempt_url", m.GetPreviousAttemptUrl()) + if err != nil { + return err + } + } + if m.GetPullRequests() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetPullRequests())) + for i, v := range m.GetPullRequests() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("pull_requests", cast) + if err != nil { + return err + } + } + if m.GetReferencedWorkflows() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetReferencedWorkflows())) + for i, v := range m.GetReferencedWorkflows() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("referenced_workflows", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("repository", m.GetRepository()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("rerun_url", m.GetRerunUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("run_attempt", m.GetRunAttempt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("run_number", m.GetRunNumber()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("run_started_at", m.GetRunStartedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("status", m.GetStatus()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("triggering_actor", m.GetTriggeringActor()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("updated_at", m.GetUpdatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("workflow_id", m.GetWorkflowId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("workflow_url", m.GetWorkflowUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActor sets the actor property value. A GitHub user. +func (m *WorkflowRun) SetActor(value SimpleUserable)() { + m.actor = 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 *WorkflowRun) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArtifactsUrl sets the artifacts_url property value. The URL to the artifacts for the workflow run. +func (m *WorkflowRun) SetArtifactsUrl(value *string)() { + m.artifacts_url = value +} +// SetCancelUrl sets the cancel_url property value. The URL to cancel the workflow run. +func (m *WorkflowRun) SetCancelUrl(value *string)() { + m.cancel_url = value +} +// SetCheckSuiteId sets the check_suite_id property value. The ID of the associated check suite. +func (m *WorkflowRun) SetCheckSuiteId(value *int32)() { + m.check_suite_id = value +} +// SetCheckSuiteNodeId sets the check_suite_node_id property value. The node ID of the associated check suite. +func (m *WorkflowRun) SetCheckSuiteNodeId(value *string)() { + m.check_suite_node_id = value +} +// SetCheckSuiteUrl sets the check_suite_url property value. The URL to the associated check suite. +func (m *WorkflowRun) SetCheckSuiteUrl(value *string)() { + m.check_suite_url = value +} +// SetConclusion sets the conclusion property value. The conclusion property +func (m *WorkflowRun) SetConclusion(value *string)() { + m.conclusion = value +} +// SetCreatedAt sets the created_at property value. The created_at property +func (m *WorkflowRun) SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.created_at = value +} +// SetDisplayTitle sets the display_title property value. The event-specific title associated with the run or the run-name if set, or the value of `run-name` if it is set in the workflow. +func (m *WorkflowRun) SetDisplayTitle(value *string)() { + m.display_title = value +} +// SetEvent sets the event property value. The event property +func (m *WorkflowRun) SetEvent(value *string)() { + m.event = value +} +// SetHeadBranch sets the head_branch property value. The head_branch property +func (m *WorkflowRun) SetHeadBranch(value *string)() { + m.head_branch = value +} +// SetHeadCommit sets the head_commit property value. A commit. +func (m *WorkflowRun) SetHeadCommit(value NullableSimpleCommitable)() { + m.head_commit = value +} +// SetHeadRepository sets the head_repository property value. Minimal Repository +func (m *WorkflowRun) SetHeadRepository(value MinimalRepositoryable)() { + m.head_repository = value +} +// SetHeadRepositoryId sets the head_repository_id property value. The head_repository_id property +func (m *WorkflowRun) SetHeadRepositoryId(value *int32)() { + m.head_repository_id = value +} +// SetHeadSha sets the head_sha property value. The SHA of the head commit that points to the version of the workflow being run. +func (m *WorkflowRun) SetHeadSha(value *string)() { + m.head_sha = value +} +// SetHtmlUrl sets the html_url property value. The html_url property +func (m *WorkflowRun) SetHtmlUrl(value *string)() { + m.html_url = value +} +// SetId sets the id property value. The ID of the workflow run. +func (m *WorkflowRun) SetId(value *int32)() { + m.id = value +} +// SetJobsUrl sets the jobs_url property value. The URL to the jobs for the workflow run. +func (m *WorkflowRun) SetJobsUrl(value *string)() { + m.jobs_url = value +} +// SetLogsUrl sets the logs_url property value. The URL to download the logs for the workflow run. +func (m *WorkflowRun) SetLogsUrl(value *string)() { + m.logs_url = value +} +// SetName sets the name property value. The name of the workflow run. +func (m *WorkflowRun) SetName(value *string)() { + m.name = value +} +// SetNodeId sets the node_id property value. The node_id property +func (m *WorkflowRun) SetNodeId(value *string)() { + m.node_id = value +} +// SetPath sets the path property value. The full path of the workflow +func (m *WorkflowRun) SetPath(value *string)() { + m.path = value +} +// SetPreviousAttemptUrl sets the previous_attempt_url property value. The URL to the previous attempted run of this workflow, if one exists. +func (m *WorkflowRun) SetPreviousAttemptUrl(value *string)() { + m.previous_attempt_url = value +} +// SetPullRequests sets the pull_requests property value. Pull requests that are open with a `head_sha` or `head_branch` that matches the workflow run. The returned pull requests do not necessarily indicate pull requests that triggered the run. +func (m *WorkflowRun) SetPullRequests(value []PullRequestMinimalable)() { + m.pull_requests = value +} +// SetReferencedWorkflows sets the referenced_workflows property value. The referenced_workflows property +func (m *WorkflowRun) SetReferencedWorkflows(value []ReferencedWorkflowable)() { + m.referenced_workflows = value +} +// SetRepository sets the repository property value. Minimal Repository +func (m *WorkflowRun) SetRepository(value MinimalRepositoryable)() { + m.repository = value +} +// SetRerunUrl sets the rerun_url property value. The URL to rerun the workflow run. +func (m *WorkflowRun) SetRerunUrl(value *string)() { + m.rerun_url = value +} +// SetRunAttempt sets the run_attempt property value. Attempt number of the run, 1 for first attempt and higher if the workflow was re-run. +func (m *WorkflowRun) SetRunAttempt(value *int32)() { + m.run_attempt = value +} +// SetRunNumber sets the run_number property value. The auto incrementing run number for the workflow run. +func (m *WorkflowRun) SetRunNumber(value *int32)() { + m.run_number = value +} +// SetRunStartedAt sets the run_started_at property value. The start time of the latest run. Resets on re-run. +func (m *WorkflowRun) SetRunStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.run_started_at = value +} +// SetStatus sets the status property value. The status property +func (m *WorkflowRun) SetStatus(value *string)() { + m.status = value +} +// SetTriggeringActor sets the triggering_actor property value. A GitHub user. +func (m *WorkflowRun) SetTriggeringActor(value SimpleUserable)() { + m.triggering_actor = value +} +// SetUpdatedAt sets the updated_at property value. The updated_at property +func (m *WorkflowRun) SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.updated_at = value +} +// SetUrl sets the url property value. The URL to the workflow run. +func (m *WorkflowRun) SetUrl(value *string)() { + m.url = value +} +// SetWorkflowId sets the workflow_id property value. The ID of the parent workflow. +func (m *WorkflowRun) SetWorkflowId(value *int32)() { + m.workflow_id = value +} +// SetWorkflowUrl sets the workflow_url property value. The URL to the workflow. +func (m *WorkflowRun) SetWorkflowUrl(value *string)() { + m.workflow_url = value +} +type WorkflowRunable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActor()(SimpleUserable) + GetArtifactsUrl()(*string) + GetCancelUrl()(*string) + GetCheckSuiteId()(*int32) + GetCheckSuiteNodeId()(*string) + GetCheckSuiteUrl()(*string) + GetConclusion()(*string) + GetCreatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetDisplayTitle()(*string) + GetEvent()(*string) + GetHeadBranch()(*string) + GetHeadCommit()(NullableSimpleCommitable) + GetHeadRepository()(MinimalRepositoryable) + GetHeadRepositoryId()(*int32) + GetHeadSha()(*string) + GetHtmlUrl()(*string) + GetId()(*int32) + GetJobsUrl()(*string) + GetLogsUrl()(*string) + GetName()(*string) + GetNodeId()(*string) + GetPath()(*string) + GetPreviousAttemptUrl()(*string) + GetPullRequests()([]PullRequestMinimalable) + GetReferencedWorkflows()([]ReferencedWorkflowable) + GetRepository()(MinimalRepositoryable) + GetRerunUrl()(*string) + GetRunAttempt()(*int32) + GetRunNumber()(*int32) + GetRunStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetStatus()(*string) + GetTriggeringActor()(SimpleUserable) + GetUpdatedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetUrl()(*string) + GetWorkflowId()(*int32) + GetWorkflowUrl()(*string) + SetActor(value SimpleUserable)() + SetArtifactsUrl(value *string)() + SetCancelUrl(value *string)() + SetCheckSuiteId(value *int32)() + SetCheckSuiteNodeId(value *string)() + SetCheckSuiteUrl(value *string)() + SetConclusion(value *string)() + SetCreatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetDisplayTitle(value *string)() + SetEvent(value *string)() + SetHeadBranch(value *string)() + SetHeadCommit(value NullableSimpleCommitable)() + SetHeadRepository(value MinimalRepositoryable)() + SetHeadRepositoryId(value *int32)() + SetHeadSha(value *string)() + SetHtmlUrl(value *string)() + SetId(value *int32)() + SetJobsUrl(value *string)() + SetLogsUrl(value *string)() + SetName(value *string)() + SetNodeId(value *string)() + SetPath(value *string)() + SetPreviousAttemptUrl(value *string)() + SetPullRequests(value []PullRequestMinimalable)() + SetReferencedWorkflows(value []ReferencedWorkflowable)() + SetRepository(value MinimalRepositoryable)() + SetRerunUrl(value *string)() + SetRunAttempt(value *int32)() + SetRunNumber(value *int32)() + SetRunStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetStatus(value *string)() + SetTriggeringActor(value SimpleUserable)() + SetUpdatedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetUrl(value *string)() + SetWorkflowId(value *int32)() + SetWorkflowUrl(value *string)() +} diff --git a/pkg/github/networks/item_item_events_request_builder.go b/pkg/github/networks/item_item_events_request_builder.go new file mode 100644 index 00000000..412204cc --- /dev/null +++ b/pkg/github/networks/item_item_events_request_builder.go @@ -0,0 +1,73 @@ +package networks + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemEventsRequestBuilder builds and executes requests for operations under \networks\{owner}\{repo}\events +type ItemItemEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEventsRequestBuilderGetQueryParameters > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +type ItemItemEventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemEventsRequestBuilderInternal instantiates a new ItemItemEventsRequestBuilder and sets the default values. +func NewItemItemEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEventsRequestBuilder) { + m := &ItemItemEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/networks/{owner}/{repo}/events{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEventsRequestBuilder instantiates a new ItemItemEventsRequestBuilder and sets the default values. +func NewItemItemEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a []Eventable 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/enterprise-server@3.14/rest/activity/events#list-public-events-for-a-network-of-repositories +func (m *ItemItemEventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEventsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEventFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable) + } + } + return val, nil +} +// ToGetRequestInformation > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a *RequestInformation when successful +func (m *ItemItemEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEventsRequestBuilderGetQueryParameters])(*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 *ItemItemEventsRequestBuilder when successful +func (m *ItemItemEventsRequestBuilder) WithUrl(rawUrl string)(*ItemItemEventsRequestBuilder) { + return NewItemItemEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/networks/item_with_repo_item_request_builder.go b/pkg/github/networks/item_with_repo_item_request_builder.go new file mode 100644 index 00000000..f02c418b --- /dev/null +++ b/pkg/github/networks/item_with_repo_item_request_builder.go @@ -0,0 +1,28 @@ +package networks + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemWithRepoItemRequestBuilder builds and executes requests for operations under \networks\{owner}\{repo} +type ItemWithRepoItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemWithRepoItemRequestBuilderInternal instantiates a new ItemWithRepoItemRequestBuilder and sets the default values. +func NewItemWithRepoItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithRepoItemRequestBuilder) { + m := &ItemWithRepoItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/networks/{owner}/{repo}", pathParameters), + } + return m +} +// NewItemWithRepoItemRequestBuilder instantiates a new ItemWithRepoItemRequestBuilder and sets the default values. +func NewItemWithRepoItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithRepoItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemWithRepoItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Events the events property +// returns a *ItemItemEventsRequestBuilder when successful +func (m *ItemWithRepoItemRequestBuilder) Events()(*ItemItemEventsRequestBuilder) { + return NewItemItemEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/networks/networks_request_builder.go b/pkg/github/networks/networks_request_builder.go new file mode 100644 index 00000000..6ffac70a --- /dev/null +++ b/pkg/github/networks/networks_request_builder.go @@ -0,0 +1,35 @@ +package networks + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// NetworksRequestBuilder builds and executes requests for operations under \networks +type NetworksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByOwner gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.networks.item collection +// returns a *WithOwnerItemRequestBuilder when successful +func (m *NetworksRequestBuilder) ByOwner(owner string)(*WithOwnerItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if owner != "" { + urlTplParams["owner"] = owner + } + return NewWithOwnerItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewNetworksRequestBuilderInternal instantiates a new NetworksRequestBuilder and sets the default values. +func NewNetworksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*NetworksRequestBuilder) { + m := &NetworksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/networks", pathParameters), + } + return m +} +// NewNetworksRequestBuilder instantiates a new NetworksRequestBuilder and sets the default values. +func NewNetworksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*NetworksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewNetworksRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/networks/with_owner_item_request_builder.go b/pkg/github/networks/with_owner_item_request_builder.go new file mode 100644 index 00000000..6899fc5e --- /dev/null +++ b/pkg/github/networks/with_owner_item_request_builder.go @@ -0,0 +1,35 @@ +package networks + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// WithOwnerItemRequestBuilder builds and executes requests for operations under \networks\{owner} +type WithOwnerItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepo gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.networks.item.item collection +// returns a *ItemWithRepoItemRequestBuilder when successful +func (m *WithOwnerItemRequestBuilder) ByRepo(repo string)(*ItemWithRepoItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repo != "" { + urlTplParams["repo"] = repo + } + return NewItemWithRepoItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewWithOwnerItemRequestBuilderInternal instantiates a new WithOwnerItemRequestBuilder and sets the default values. +func NewWithOwnerItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithOwnerItemRequestBuilder) { + m := &WithOwnerItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/networks/{owner}", pathParameters), + } + return m +} +// NewWithOwnerItemRequestBuilder instantiates a new WithOwnerItemRequestBuilder and sets the default values. +func NewWithOwnerItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithOwnerItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithOwnerItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/notifications/notifications_put_request_body.go b/pkg/github/notifications/notifications_put_request_body.go new file mode 100644 index 00000000..f4bad88d --- /dev/null +++ b/pkg/github/notifications/notifications_put_request_body.go @@ -0,0 +1,110 @@ +package notifications + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NotificationsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. + last_read_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // Whether the notification has been read. + read *bool +} +// NewNotificationsPutRequestBody instantiates a new NotificationsPutRequestBody and sets the default values. +func NewNotificationsPutRequestBody()(*NotificationsPutRequestBody) { + m := &NotificationsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNotificationsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNotificationsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNotificationsPutRequestBody(), 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 *NotificationsPutRequestBody) 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 *NotificationsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["last_read_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastReadAt(val) + } + return nil + } + res["read"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRead(val) + } + return nil + } + return res +} +// GetLastReadAt gets the last_read_at property value. Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. +// returns a *Time when successful +func (m *NotificationsPutRequestBody) GetLastReadAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_read_at +} +// GetRead gets the read property value. Whether the notification has been read. +// returns a *bool when successful +func (m *NotificationsPutRequestBody) GetRead()(*bool) { + return m.read +} +// Serialize serializes information the current object +func (m *NotificationsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("last_read_at", m.GetLastReadAt()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("read", m.GetRead()) + 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 *NotificationsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLastReadAt sets the last_read_at property value. Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. +func (m *NotificationsPutRequestBody) SetLastReadAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_read_at = value +} +// SetRead sets the read property value. Whether the notification has been read. +func (m *NotificationsPutRequestBody) SetRead(value *bool)() { + m.read = value +} +type NotificationsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLastReadAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetRead()(*bool) + SetLastReadAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetRead(value *bool)() +} diff --git a/pkg/github/notifications/notifications_put_response.go b/pkg/github/notifications/notifications_put_response.go new file mode 100644 index 00000000..35f2fa9d --- /dev/null +++ b/pkg/github/notifications/notifications_put_response.go @@ -0,0 +1,80 @@ +package notifications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type NotificationsPutResponse 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 message property + message *string +} +// NewNotificationsPutResponse instantiates a new NotificationsPutResponse and sets the default values. +func NewNotificationsPutResponse()(*NotificationsPutResponse) { + m := &NotificationsPutResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateNotificationsPutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateNotificationsPutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewNotificationsPutResponse(), 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 *NotificationsPutResponse) 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 *NotificationsPutResponse) 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 + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *NotificationsPutResponse) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *NotificationsPutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *NotificationsPutResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The message property +func (m *NotificationsPutResponse) SetMessage(value *string)() { + m.message = value +} +type NotificationsPutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + SetMessage(value *string)() +} diff --git a/pkg/github/notifications/notifications_request_builder.go b/pkg/github/notifications/notifications_request_builder.go new file mode 100644 index 00000000..3683a30d --- /dev/null +++ b/pkg/github/notifications/notifications_request_builder.go @@ -0,0 +1,126 @@ +package notifications + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// NotificationsRequestBuilder builds and executes requests for operations under \notifications +type NotificationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NotificationsRequestBuilderGetQueryParameters list all notifications for the current user, sorted by most recently updated. +type NotificationsRequestBuilderGetQueryParameters struct { + // If `true`, show notifications marked as read. + All *bool `uriparametername:"all"` + // Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Before *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"before"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // If `true`, only shows notifications in which the user is directly participating or mentioned. + Participating *bool `uriparametername:"participating"` + // The number of results per page (max 50). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// NewNotificationsRequestBuilderInternal instantiates a new NotificationsRequestBuilder and sets the default values. +func NewNotificationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*NotificationsRequestBuilder) { + m := &NotificationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/notifications{?all*,before*,page*,participating*,per_page*,since*}", pathParameters), + } + return m +} +// NewNotificationsRequestBuilder instantiates a new NotificationsRequestBuilder and sets the default values. +func NewNotificationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*NotificationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewNotificationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all notifications for the current user, sorted by most recently updated. +// returns a []Threadable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#list-notifications-for-the-authenticated-user +func (m *NotificationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[NotificationsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Threadable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateThreadFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Threadable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Threadable) + } + } + return val, nil +} +// Put marks all notifications as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub Enterprise Server will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. +// returns a NotificationsPutResponseable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#mark-notifications-as-read +func (m *NotificationsRequestBuilder) Put(ctx context.Context, body NotificationsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(NotificationsPutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateNotificationsPutResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(NotificationsPutResponseable), nil +} +// Threads the threads property +// returns a *ThreadsRequestBuilder when successful +func (m *NotificationsRequestBuilder) Threads()(*ThreadsRequestBuilder) { + return NewThreadsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation list all notifications for the current user, sorted by most recently updated. +// returns a *RequestInformation when successful +func (m *NotificationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[NotificationsRequestBuilderGetQueryParameters])(*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 +} +// ToPutRequestInformation marks all notifications as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub Enterprise Server will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List notifications for the authenticated user](https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#list-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. +// returns a *RequestInformation when successful +func (m *NotificationsRequestBuilder) ToPutRequestInformation(ctx context.Context, body NotificationsPutRequestBodyable, 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 *NotificationsRequestBuilder when successful +func (m *NotificationsRequestBuilder) WithUrl(rawUrl string)(*NotificationsRequestBuilder) { + return NewNotificationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/notifications/threads_item_subscription_put_request_body.go b/pkg/github/notifications/threads_item_subscription_put_request_body.go new file mode 100644 index 00000000..c4780b47 --- /dev/null +++ b/pkg/github/notifications/threads_item_subscription_put_request_body.go @@ -0,0 +1,80 @@ +package notifications + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ThreadsItemSubscriptionPutRequestBody 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 block all notifications from a thread. + ignored *bool +} +// NewThreadsItemSubscriptionPutRequestBody instantiates a new ThreadsItemSubscriptionPutRequestBody and sets the default values. +func NewThreadsItemSubscriptionPutRequestBody()(*ThreadsItemSubscriptionPutRequestBody) { + m := &ThreadsItemSubscriptionPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateThreadsItemSubscriptionPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateThreadsItemSubscriptionPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewThreadsItemSubscriptionPutRequestBody(), 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 *ThreadsItemSubscriptionPutRequestBody) 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 *ThreadsItemSubscriptionPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ignored"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIgnored(val) + } + return nil + } + return res +} +// GetIgnored gets the ignored property value. Whether to block all notifications from a thread. +// returns a *bool when successful +func (m *ThreadsItemSubscriptionPutRequestBody) GetIgnored()(*bool) { + return m.ignored +} +// Serialize serializes information the current object +func (m *ThreadsItemSubscriptionPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("ignored", m.GetIgnored()) + 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 *ThreadsItemSubscriptionPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIgnored sets the ignored property value. Whether to block all notifications from a thread. +func (m *ThreadsItemSubscriptionPutRequestBody) SetIgnored(value *bool)() { + m.ignored = value +} +type ThreadsItemSubscriptionPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIgnored()(*bool) + SetIgnored(value *bool)() +} diff --git a/pkg/github/notifications/threads_item_subscription_request_builder.go b/pkg/github/notifications/threads_item_subscription_request_builder.go new file mode 100644 index 00000000..1ecced6a --- /dev/null +++ b/pkg/github/notifications/threads_item_subscription_request_builder.go @@ -0,0 +1,129 @@ +package notifications + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ThreadsItemSubscriptionRequestBuilder builds and executes requests for operations under \notifications\threads\{thread_id}\subscription +type ThreadsItemSubscriptionRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewThreadsItemSubscriptionRequestBuilderInternal instantiates a new ThreadsItemSubscriptionRequestBuilder and sets the default values. +func NewThreadsItemSubscriptionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ThreadsItemSubscriptionRequestBuilder) { + m := &ThreadsItemSubscriptionRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/notifications/threads/{thread_id}/subscription", pathParameters), + } + return m +} +// NewThreadsItemSubscriptionRequestBuilder instantiates a new ThreadsItemSubscriptionRequestBuilder and sets the default values. +func NewThreadsItemSubscriptionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ThreadsItemSubscriptionRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewThreadsItemSubscriptionRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#set-a-thread-subscription) endpoint and set `ignore` to `true`. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#delete-a-thread-subscription +func (m *ThreadsItemSubscriptionRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get this checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/enterprise-server@3.14/rest/activity/watching#get-a-repository-subscription).Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. +// returns a ThreadSubscriptionable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#get-a-thread-subscription-for-the-authenticated-user +func (m *ThreadsItemSubscriptionRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ThreadSubscriptionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateThreadSubscriptionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ThreadSubscriptionable), nil +} +// Put if you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#delete-a-thread-subscription) endpoint. +// returns a ThreadSubscriptionable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#set-a-thread-subscription +func (m *ThreadsItemSubscriptionRequestBuilder) Put(ctx context.Context, body ThreadsItemSubscriptionPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ThreadSubscriptionable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateThreadSubscriptionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ThreadSubscriptionable), nil +} +// ToDeleteRequestInformation mutes all future notifications for a conversation until you comment on the thread or get an **@mention**. If you are watching the repository of the thread, you will still receive notifications. To ignore future notifications for a repository you are watching, use the [Set a thread subscription](https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#set-a-thread-subscription) endpoint and set `ignore` to `true`. +// returns a *RequestInformation when successful +func (m *ThreadsItemSubscriptionRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation this checks to see if the current user is subscribed to a thread. You can also [get a repository subscription](https://docs.github.com/enterprise-server@3.14/rest/activity/watching#get-a-repository-subscription).Note that subscriptions are only generated if a user is participating in a conversation--for example, they've replied to the thread, were **@mentioned**, or manually subscribe to a thread. +// returns a *RequestInformation when successful +func (m *ThreadsItemSubscriptionRequestBuilder) 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 +} +// ToPutRequestInformation if you are watching a repository, you receive notifications for all threads by default. Use this endpoint to ignore future notifications for threads until you comment on the thread or get an **@mention**.You can also use this endpoint to subscribe to threads that you are currently not receiving notifications for or to subscribed to threads that you have previously ignored.Unsubscribing from a conversation in a repository that you are not watching is functionally equivalent to the [Delete a thread subscription](https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#delete-a-thread-subscription) endpoint. +// returns a *RequestInformation when successful +func (m *ThreadsItemSubscriptionRequestBuilder) ToPutRequestInformation(ctx context.Context, body ThreadsItemSubscriptionPutRequestBodyable, 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 *ThreadsItemSubscriptionRequestBuilder when successful +func (m *ThreadsItemSubscriptionRequestBuilder) WithUrl(rawUrl string)(*ThreadsItemSubscriptionRequestBuilder) { + return NewThreadsItemSubscriptionRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/notifications/threads_request_builder.go b/pkg/github/notifications/threads_request_builder.go new file mode 100644 index 00000000..084a0a3b --- /dev/null +++ b/pkg/github/notifications/threads_request_builder.go @@ -0,0 +1,34 @@ +package notifications + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ThreadsRequestBuilder builds and executes requests for operations under \notifications\threads +type ThreadsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByThread_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.notifications.threads.item collection +// returns a *ThreadsWithThread_ItemRequestBuilder when successful +func (m *ThreadsRequestBuilder) ByThread_id(thread_id int32)(*ThreadsWithThread_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["thread_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(thread_id), 10) + return NewThreadsWithThread_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewThreadsRequestBuilderInternal instantiates a new ThreadsRequestBuilder and sets the default values. +func NewThreadsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ThreadsRequestBuilder) { + m := &ThreadsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/notifications/threads", pathParameters), + } + return m +} +// NewThreadsRequestBuilder instantiates a new ThreadsRequestBuilder and sets the default values. +func NewThreadsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ThreadsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewThreadsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/notifications/threads_with_thread_escaped_item_request_builder.go b/pkg/github/notifications/threads_with_thread_escaped_item_request_builder.go new file mode 100644 index 00000000..ec68f596 --- /dev/null +++ b/pkg/github/notifications/threads_with_thread_escaped_item_request_builder.go @@ -0,0 +1,117 @@ +package notifications + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ThreadsWithThread_ItemRequestBuilder builds and executes requests for operations under \notifications\threads\{thread_id} +type ThreadsWithThread_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewThreadsWithThread_ItemRequestBuilderInternal instantiates a new ThreadsWithThread_ItemRequestBuilder and sets the default values. +func NewThreadsWithThread_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ThreadsWithThread_ItemRequestBuilder) { + m := &ThreadsWithThread_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/notifications/threads/{thread_id}", pathParameters), + } + return m +} +// NewThreadsWithThread_ItemRequestBuilder instantiates a new ThreadsWithThread_ItemRequestBuilder and sets the default values. +func NewThreadsWithThread_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ThreadsWithThread_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewThreadsWithThread_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete marks a thread as "done." Marking a thread as "done" is equivalent to marking a notification in your notification inbox on GitHub Enterprise Server as done: https://github.com/notifications. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#mark-a-thread-as-done +func (m *ThreadsWithThread_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets information about a notification thread. +// returns a Threadable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#get-a-thread +func (m *ThreadsWithThread_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Threadable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateThreadFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Threadable), nil +} +// Patch marks a thread as "read." Marking a thread as "read" is equivalent to clicking a notification in your notification inbox on GitHub Enterprise Server: https://github.com/notifications. +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#mark-a-thread-as-read +func (m *ThreadsWithThread_ItemRequestBuilder) Patch(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Subscription the subscription property +// returns a *ThreadsItemSubscriptionRequestBuilder when successful +func (m *ThreadsWithThread_ItemRequestBuilder) Subscription()(*ThreadsItemSubscriptionRequestBuilder) { + return NewThreadsItemSubscriptionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation marks a thread as "done." Marking a thread as "done" is equivalent to marking a notification in your notification inbox on GitHub Enterprise Server as done: https://github.com/notifications. +// returns a *RequestInformation when successful +func (m *ThreadsWithThread_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) + return requestInfo, nil +} +// ToGetRequestInformation gets information about a notification thread. +// returns a *RequestInformation when successful +func (m *ThreadsWithThread_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 marks a thread as "read." Marking a thread as "read" is equivalent to clicking a notification in your notification inbox on GitHub Enterprise Server: https://github.com/notifications. +// returns a *RequestInformation when successful +func (m *ThreadsWithThread_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, 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") + 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 *ThreadsWithThread_ItemRequestBuilder when successful +func (m *ThreadsWithThread_ItemRequestBuilder) WithUrl(rawUrl string)(*ThreadsWithThread_ItemRequestBuilder) { + return NewThreadsWithThread_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/octocat/octocat_request_builder.go b/pkg/github/octocat/octocat_request_builder.go new file mode 100644 index 00000000..9d541f97 --- /dev/null +++ b/pkg/github/octocat/octocat_request_builder.go @@ -0,0 +1,61 @@ +package octocat + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// OctocatRequestBuilder builds and executes requests for operations under \octocat +type OctocatRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// OctocatRequestBuilderGetQueryParameters get the octocat as ASCII art +type OctocatRequestBuilderGetQueryParameters struct { + // The words to show in Octocat's speech bubble + S *string `uriparametername:"s"` +} +// NewOctocatRequestBuilderInternal instantiates a new OctocatRequestBuilder and sets the default values. +func NewOctocatRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OctocatRequestBuilder) { + m := &OctocatRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/octocat{?s*}", pathParameters), + } + return m +} +// NewOctocatRequestBuilder instantiates a new OctocatRequestBuilder and sets the default values. +func NewOctocatRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OctocatRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewOctocatRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get the octocat as ASCII art +// returns a []byte when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/meta/meta#get-octocat +func (m *OctocatRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[OctocatRequestBuilderGetQueryParameters])([]byte, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.([]byte), nil +} +// ToGetRequestInformation get the octocat as ASCII art +// returns a *RequestInformation when successful +func (m *OctocatRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[OctocatRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/octocat-stream") + 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 *OctocatRequestBuilder when successful +func (m *OctocatRequestBuilder) WithUrl(rawUrl string)(*OctocatRequestBuilder) { + return NewOctocatRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/organizations/item_custom_escaped_roles_get_response.go b/pkg/github/organizations/item_custom_escaped_roles_get_response.go new file mode 100644 index 00000000..e44d39e9 --- /dev/null +++ b/pkg/github/organizations/item_custom_escaped_roles_get_response.go @@ -0,0 +1,122 @@ +package organizations + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemCustom_rolesGetResponse 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 custom_roles property + custom_roles []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable + // The number of custom roles in this organization + total_count *int32 +} +// NewItemCustom_rolesGetResponse instantiates a new ItemCustom_rolesGetResponse and sets the default values. +func NewItemCustom_rolesGetResponse()(*ItemCustom_rolesGetResponse) { + m := &ItemCustom_rolesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCustom_rolesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCustom_rolesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCustom_rolesGetResponse(), 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 *ItemCustom_rolesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCustomRoles gets the custom_roles property value. The custom_roles property +// returns a []OrganizationCustomRepositoryRoleable when successful +func (m *ItemCustom_rolesGetResponse) GetCustomRoles()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable) { + return m.custom_roles +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCustom_rolesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["custom_roles"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationCustomRepositoryRoleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable) + } + } + m.SetCustomRoles(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 number of custom roles in this organization +// returns a *int32 when successful +func (m *ItemCustom_rolesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemCustom_rolesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCustomRoles() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCustomRoles())) + for i, v := range m.GetCustomRoles() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("custom_roles", 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 *ItemCustom_rolesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCustomRoles sets the custom_roles property value. The custom_roles property +func (m *ItemCustom_rolesGetResponse) SetCustomRoles(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable)() { + m.custom_roles = value +} +// SetTotalCount sets the total_count property value. The number of custom roles in this organization +func (m *ItemCustom_rolesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemCustom_rolesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCustomRoles()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable) + GetTotalCount()(*int32) + SetCustomRoles(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/organizations/item_custom_escaped_roles_request_builder.go b/pkg/github/organizations/item_custom_escaped_roles_request_builder.go new file mode 100644 index 00000000..6b0d3b92 --- /dev/null +++ b/pkg/github/organizations/item_custom_escaped_roles_request_builder.go @@ -0,0 +1,59 @@ +package organizations + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemCustom_rolesRequestBuilder builds and executes requests for operations under \organizations\{organization_id}\custom_roles +type ItemCustom_rolesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCustom_rolesRequestBuilderInternal instantiates a new ItemCustom_rolesRequestBuilder and sets the default values. +func NewItemCustom_rolesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCustom_rolesRequestBuilder) { + m := &ItemCustom_rolesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/organizations/{organization_id}/custom_roles", pathParameters), + } + return m +} +// NewItemCustom_rolesRequestBuilder instantiates a new ItemCustom_rolesRequestBuilder and sets the default values. +func NewItemCustom_rolesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCustom_rolesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCustom_rolesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!WARNING]> **Deprecation notice:** This operation is deprecated and will be removed in the future. Use the "[List custom repository roles](https://docs.github.com/enterprise-server@3.14/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization)" endpoint instead.List the custom repository roles available in this organization. For more information on custom repository roles, see "[About custom repository roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-repository-roles)."The authenticated user must be administrator of the organization or of a repository of the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. +// Deprecated: +// returns a ItemCustom_rolesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/custom-roles#deprecated---list-custom-repository-roles-in-an-organization +func (m *ItemCustom_rolesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemCustom_rolesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCustom_rolesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCustom_rolesGetResponseable), nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This operation is deprecated and will be removed in the future. Use the "[List custom repository roles](https://docs.github.com/enterprise-server@3.14/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization)" endpoint instead.List the custom repository roles available in this organization. For more information on custom repository roles, see "[About custom repository roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-repository-roles)."The authenticated user must be administrator of the organization or of a repository of the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemCustom_rolesRequestBuilder) 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. +// Deprecated: +// returns a *ItemCustom_rolesRequestBuilder when successful +func (m *ItemCustom_rolesRequestBuilder) WithUrl(rawUrl string)(*ItemCustom_rolesRequestBuilder) { + return NewItemCustom_rolesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/organizations/organizations_request_builder.go b/pkg/github/organizations/organizations_request_builder.go new file mode 100644 index 00000000..2656fe5e --- /dev/null +++ b/pkg/github/organizations/organizations_request_builder.go @@ -0,0 +1,79 @@ +package organizations + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// OrganizationsRequestBuilder builds and executes requests for operations under \organizations +type OrganizationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// OrganizationsRequestBuilderGetQueryParameters lists all organizations, in the order that they were created.> [!NOTE]> Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of organizations. +type OrganizationsRequestBuilderGetQueryParameters struct { + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // An organization ID. Only return organizations with an ID greater than this ID. + Since *int32 `uriparametername:"since"` +} +// ByOrganization_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.organizations.item collection +// returns a *WithOrganization_ItemRequestBuilder when successful +func (m *OrganizationsRequestBuilder) ByOrganization_id(organization_id string)(*WithOrganization_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if organization_id != "" { + urlTplParams["organization_id"] = organization_id + } + return NewWithOrganization_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewOrganizationsRequestBuilderInternal instantiates a new OrganizationsRequestBuilder and sets the default values. +func NewOrganizationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrganizationsRequestBuilder) { + m := &OrganizationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/organizations{?per_page*,since*}", pathParameters), + } + return m +} +// NewOrganizationsRequestBuilder instantiates a new OrganizationsRequestBuilder and sets the default values. +func NewOrganizationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrganizationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewOrganizationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all organizations, in the order that they were created.> [!NOTE]> Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of organizations. +// returns a []OrganizationSimpleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/orgs#list-organizations +func (m *OrganizationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[OrganizationsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationSimpleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable) + } + } + return val, nil +} +// ToGetRequestInformation lists all organizations, in the order that they were created.> [!NOTE]> Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of organizations. +// returns a *RequestInformation when successful +func (m *OrganizationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[OrganizationsRequestBuilderGetQueryParameters])(*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 *OrganizationsRequestBuilder when successful +func (m *OrganizationsRequestBuilder) WithUrl(rawUrl string)(*OrganizationsRequestBuilder) { + return NewOrganizationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/organizations/with_organization_escaped_item_request_builder.go b/pkg/github/organizations/with_organization_escaped_item_request_builder.go new file mode 100644 index 00000000..f91f6961 --- /dev/null +++ b/pkg/github/organizations/with_organization_escaped_item_request_builder.go @@ -0,0 +1,28 @@ +package organizations + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// WithOrganization_ItemRequestBuilder builds and executes requests for operations under \organizations\{organization_id} +type WithOrganization_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithOrganization_ItemRequestBuilderInternal instantiates a new WithOrganization_ItemRequestBuilder and sets the default values. +func NewWithOrganization_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithOrganization_ItemRequestBuilder) { + m := &WithOrganization_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/organizations/{organization_id}", pathParameters), + } + return m +} +// NewWithOrganization_ItemRequestBuilder instantiates a new WithOrganization_ItemRequestBuilder and sets the default values. +func NewWithOrganization_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithOrganization_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithOrganization_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Custom_roles the custom_roles property +// returns a *ItemCustom_rolesRequestBuilder when successful +func (m *WithOrganization_ItemRequestBuilder) Custom_roles()(*ItemCustom_rolesRequestBuilder) { + return NewItemCustom_rolesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/orgs/item/actions/runnergroups/item/with_runner_escaped_group_escaped_patch_request_body_escaped_visibility.go b/pkg/github/orgs/item/actions/runnergroups/item/with_runner_escaped_group_escaped_patch_request_body_escaped_visibility.go new file mode 100644 index 00000000..a0fc8b90 --- /dev/null +++ b/pkg/github/orgs/item/actions/runnergroups/item/with_runner_escaped_group_escaped_patch_request_body_escaped_visibility.go @@ -0,0 +1,37 @@ +package item +// Visibility of a runner group. You can select all repositories, select individual repositories, or all private repositories. +type WithRunner_group_PatchRequestBody_visibility int + +const ( + SELECTED_WITHRUNNER_GROUP_PATCHREQUESTBODY_VISIBILITY WithRunner_group_PatchRequestBody_visibility = iota + ALL_WITHRUNNER_GROUP_PATCHREQUESTBODY_VISIBILITY + PRIVATE_WITHRUNNER_GROUP_PATCHREQUESTBODY_VISIBILITY +) + +func (i WithRunner_group_PatchRequestBody_visibility) String() string { + return []string{"selected", "all", "private"}[i] +} +func ParseWithRunner_group_PatchRequestBody_visibility(v string) (any, error) { + result := SELECTED_WITHRUNNER_GROUP_PATCHREQUESTBODY_VISIBILITY + switch v { + case "selected": + result = SELECTED_WITHRUNNER_GROUP_PATCHREQUESTBODY_VISIBILITY + case "all": + result = ALL_WITHRUNNER_GROUP_PATCHREQUESTBODY_VISIBILITY + case "private": + result = PRIVATE_WITHRUNNER_GROUP_PATCHREQUESTBODY_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeWithRunner_group_PatchRequestBody_visibility(values []WithRunner_group_PatchRequestBody_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithRunner_group_PatchRequestBody_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/actions/runnergroups/runner_groups_post_request_body_escaped_visibility.go b/pkg/github/orgs/item/actions/runnergroups/runner_groups_post_request_body_escaped_visibility.go new file mode 100644 index 00000000..8f6ac061 --- /dev/null +++ b/pkg/github/orgs/item/actions/runnergroups/runner_groups_post_request_body_escaped_visibility.go @@ -0,0 +1,37 @@ +package runnergroups +// Visibility of a runner group. You can select all repositories, select individual repositories, or limit access to private repositories. +type RunnerGroupsPostRequestBody_visibility int + +const ( + SELECTED_RUNNERGROUPSPOSTREQUESTBODY_VISIBILITY RunnerGroupsPostRequestBody_visibility = iota + ALL_RUNNERGROUPSPOSTREQUESTBODY_VISIBILITY + PRIVATE_RUNNERGROUPSPOSTREQUESTBODY_VISIBILITY +) + +func (i RunnerGroupsPostRequestBody_visibility) String() string { + return []string{"selected", "all", "private"}[i] +} +func ParseRunnerGroupsPostRequestBody_visibility(v string) (any, error) { + result := SELECTED_RUNNERGROUPSPOSTREQUESTBODY_VISIBILITY + switch v { + case "selected": + result = SELECTED_RUNNERGROUPSPOSTREQUESTBODY_VISIBILITY + case "all": + result = ALL_RUNNERGROUPSPOSTREQUESTBODY_VISIBILITY + case "private": + result = PRIVATE_RUNNERGROUPSPOSTREQUESTBODY_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeRunnerGroupsPostRequestBody_visibility(values []RunnerGroupsPostRequestBody_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RunnerGroupsPostRequestBody_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/actions/secrets/item/with_secret_escaped_name_put_request_body_escaped_visibility.go b/pkg/github/orgs/item/actions/secrets/item/with_secret_escaped_name_put_request_body_escaped_visibility.go new file mode 100644 index 00000000..5ce7ac3c --- /dev/null +++ b/pkg/github/orgs/item/actions/secrets/item/with_secret_escaped_name_put_request_body_escaped_visibility.go @@ -0,0 +1,37 @@ +package item +// Which type of organization repositories have access to the organization secret. `selected` means only the repositories specified by `selected_repository_ids` can access the secret. +type WithSecret_namePutRequestBody_visibility int + +const ( + ALL_WITHSECRET_NAMEPUTREQUESTBODY_VISIBILITY WithSecret_namePutRequestBody_visibility = iota + PRIVATE_WITHSECRET_NAMEPUTREQUESTBODY_VISIBILITY + SELECTED_WITHSECRET_NAMEPUTREQUESTBODY_VISIBILITY +) + +func (i WithSecret_namePutRequestBody_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseWithSecret_namePutRequestBody_visibility(v string) (any, error) { + result := ALL_WITHSECRET_NAMEPUTREQUESTBODY_VISIBILITY + switch v { + case "all": + result = ALL_WITHSECRET_NAMEPUTREQUESTBODY_VISIBILITY + case "private": + result = PRIVATE_WITHSECRET_NAMEPUTREQUESTBODY_VISIBILITY + case "selected": + result = SELECTED_WITHSECRET_NAMEPUTREQUESTBODY_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeWithSecret_namePutRequestBody_visibility(values []WithSecret_namePutRequestBody_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithSecret_namePutRequestBody_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/actions/variables/item/with_name_patch_request_body_escaped_visibility.go b/pkg/github/orgs/item/actions/variables/item/with_name_patch_request_body_escaped_visibility.go new file mode 100644 index 00000000..cc0f773d --- /dev/null +++ b/pkg/github/orgs/item/actions/variables/item/with_name_patch_request_body_escaped_visibility.go @@ -0,0 +1,37 @@ +package item +// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. +type WithNamePatchRequestBody_visibility int + +const ( + ALL_WITHNAMEPATCHREQUESTBODY_VISIBILITY WithNamePatchRequestBody_visibility = iota + PRIVATE_WITHNAMEPATCHREQUESTBODY_VISIBILITY + SELECTED_WITHNAMEPATCHREQUESTBODY_VISIBILITY +) + +func (i WithNamePatchRequestBody_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseWithNamePatchRequestBody_visibility(v string) (any, error) { + result := ALL_WITHNAMEPATCHREQUESTBODY_VISIBILITY + switch v { + case "all": + result = ALL_WITHNAMEPATCHREQUESTBODY_VISIBILITY + case "private": + result = PRIVATE_WITHNAMEPATCHREQUESTBODY_VISIBILITY + case "selected": + result = SELECTED_WITHNAMEPATCHREQUESTBODY_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeWithNamePatchRequestBody_visibility(values []WithNamePatchRequestBody_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithNamePatchRequestBody_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/actions/variables/variables_post_request_body_escaped_visibility.go b/pkg/github/orgs/item/actions/variables/variables_post_request_body_escaped_visibility.go new file mode 100644 index 00000000..2e22b42d --- /dev/null +++ b/pkg/github/orgs/item/actions/variables/variables_post_request_body_escaped_visibility.go @@ -0,0 +1,37 @@ +package variables +// The type of repositories in the organization that can access the variable. `selected` means only the repositories specified by `selected_repository_ids` can access the variable. +type VariablesPostRequestBody_visibility int + +const ( + ALL_VARIABLESPOSTREQUESTBODY_VISIBILITY VariablesPostRequestBody_visibility = iota + PRIVATE_VARIABLESPOSTREQUESTBODY_VISIBILITY + SELECTED_VARIABLESPOSTREQUESTBODY_VISIBILITY +) + +func (i VariablesPostRequestBody_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseVariablesPostRequestBody_visibility(v string) (any, error) { + result := ALL_VARIABLESPOSTREQUESTBODY_VISIBILITY + switch v { + case "all": + result = ALL_VARIABLESPOSTREQUESTBODY_VISIBILITY + case "private": + result = PRIVATE_VARIABLESPOSTREQUESTBODY_VISIBILITY + case "selected": + result = SELECTED_VARIABLESPOSTREQUESTBODY_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeVariablesPostRequestBody_visibility(values []VariablesPostRequestBody_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i VariablesPostRequestBody_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/auditlog/get_include_query_parameter_type.go b/pkg/github/orgs/item/auditlog/get_include_query_parameter_type.go new file mode 100644 index 00000000..28012aff --- /dev/null +++ b/pkg/github/orgs/item/auditlog/get_include_query_parameter_type.go @@ -0,0 +1,36 @@ +package auditlog +type GetIncludeQueryParameterType int + +const ( + WEB_GETINCLUDEQUERYPARAMETERTYPE GetIncludeQueryParameterType = iota + GIT_GETINCLUDEQUERYPARAMETERTYPE + ALL_GETINCLUDEQUERYPARAMETERTYPE +) + +func (i GetIncludeQueryParameterType) String() string { + return []string{"web", "git", "all"}[i] +} +func ParseGetIncludeQueryParameterType(v string) (any, error) { + result := WEB_GETINCLUDEQUERYPARAMETERTYPE + switch v { + case "web": + result = WEB_GETINCLUDEQUERYPARAMETERTYPE + case "git": + result = GIT_GETINCLUDEQUERYPARAMETERTYPE + case "all": + result = ALL_GETINCLUDEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetIncludeQueryParameterType(values []GetIncludeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetIncludeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/auditlog/get_order_query_parameter_type.go b/pkg/github/orgs/item/auditlog/get_order_query_parameter_type.go new file mode 100644 index 00000000..2ba54de5 --- /dev/null +++ b/pkg/github/orgs/item/auditlog/get_order_query_parameter_type.go @@ -0,0 +1,33 @@ +package auditlog +type GetOrderQueryParameterType int + +const ( + DESC_GETORDERQUERYPARAMETERTYPE GetOrderQueryParameterType = iota + ASC_GETORDERQUERYPARAMETERTYPE +) + +func (i GetOrderQueryParameterType) String() string { + return []string{"desc", "asc"}[i] +} +func ParseGetOrderQueryParameterType(v string) (any, error) { + result := DESC_GETORDERQUERYPARAMETERTYPE + switch v { + case "desc": + result = DESC_GETORDERQUERYPARAMETERTYPE + case "asc": + result = ASC_GETORDERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetOrderQueryParameterType(values []GetOrderQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetOrderQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/bcdc5a784bf4e6960d6d76096aeabbb3d532494516c3a0f112699915950585ad.go b/pkg/github/orgs/item/bcdc5a784bf4e6960d6d76096aeabbb3d532494516c3a0f112699915950585ad.go new file mode 100644 index 00000000..3d027294 --- /dev/null +++ b/pkg/github/orgs/item/bcdc5a784bf4e6960d6d76096aeabbb3d532494516c3a0f112699915950585ad.go @@ -0,0 +1,37 @@ +package item +// Specifies which types of repositories non-admin organization members can create. **Note:** This parameter is deprecated and will be removed in the future. Its return value ignores internal repositories. Using this parameter overrides values set in `members_can_create_repositories`. See the parameter deprecation notice in the operation description for details. +type WithOrgPatchRequestBody_members_allowed_repository_creation_type int + +const ( + ALL_WITHORGPATCHREQUESTBODY_MEMBERS_ALLOWED_REPOSITORY_CREATION_TYPE WithOrgPatchRequestBody_members_allowed_repository_creation_type = iota + PRIVATE_WITHORGPATCHREQUESTBODY_MEMBERS_ALLOWED_REPOSITORY_CREATION_TYPE + NONE_WITHORGPATCHREQUESTBODY_MEMBERS_ALLOWED_REPOSITORY_CREATION_TYPE +) + +func (i WithOrgPatchRequestBody_members_allowed_repository_creation_type) String() string { + return []string{"all", "private", "none"}[i] +} +func ParseWithOrgPatchRequestBody_members_allowed_repository_creation_type(v string) (any, error) { + result := ALL_WITHORGPATCHREQUESTBODY_MEMBERS_ALLOWED_REPOSITORY_CREATION_TYPE + switch v { + case "all": + result = ALL_WITHORGPATCHREQUESTBODY_MEMBERS_ALLOWED_REPOSITORY_CREATION_TYPE + case "private": + result = PRIVATE_WITHORGPATCHREQUESTBODY_MEMBERS_ALLOWED_REPOSITORY_CREATION_TYPE + case "none": + result = NONE_WITHORGPATCHREQUESTBODY_MEMBERS_ALLOWED_REPOSITORY_CREATION_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeWithOrgPatchRequestBody_members_allowed_repository_creation_type(values []WithOrgPatchRequestBody_members_allowed_repository_creation_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithOrgPatchRequestBody_members_allowed_repository_creation_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/codescanning/alerts/get_direction_query_parameter_type.go b/pkg/github/orgs/item/codescanning/alerts/get_direction_query_parameter_type.go new file mode 100644 index 00000000..0606c6d4 --- /dev/null +++ b/pkg/github/orgs/item/codescanning/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/codescanning/alerts/get_sort_query_parameter_type.go b/pkg/github/orgs/item/codescanning/alerts/get_sort_query_parameter_type.go new file mode 100644 index 00000000..719c5fb3 --- /dev/null +++ b/pkg/github/orgs/item/codescanning/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/dependabot/alerts/get_direction_query_parameter_type.go b/pkg/github/orgs/item/dependabot/alerts/get_direction_query_parameter_type.go new file mode 100644 index 00000000..0606c6d4 --- /dev/null +++ b/pkg/github/orgs/item/dependabot/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/dependabot/alerts/get_scope_query_parameter_type.go b/pkg/github/orgs/item/dependabot/alerts/get_scope_query_parameter_type.go new file mode 100644 index 00000000..5d3e9a31 --- /dev/null +++ b/pkg/github/orgs/item/dependabot/alerts/get_scope_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetScopeQueryParameterType int + +const ( + DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE GetScopeQueryParameterType = iota + RUNTIME_GETSCOPEQUERYPARAMETERTYPE +) + +func (i GetScopeQueryParameterType) String() string { + return []string{"development", "runtime"}[i] +} +func ParseGetScopeQueryParameterType(v string) (any, error) { + result := DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE + switch v { + case "development": + result = DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE + case "runtime": + result = RUNTIME_GETSCOPEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetScopeQueryParameterType(values []GetScopeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetScopeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/dependabot/alerts/get_sort_query_parameter_type.go b/pkg/github/orgs/item/dependabot/alerts/get_sort_query_parameter_type.go new file mode 100644 index 00000000..719c5fb3 --- /dev/null +++ b/pkg/github/orgs/item/dependabot/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/dependabot/secrets/item/with_secret_escaped_name_put_request_body_escaped_visibility.go b/pkg/github/orgs/item/dependabot/secrets/item/with_secret_escaped_name_put_request_body_escaped_visibility.go new file mode 100644 index 00000000..5ce7ac3c --- /dev/null +++ b/pkg/github/orgs/item/dependabot/secrets/item/with_secret_escaped_name_put_request_body_escaped_visibility.go @@ -0,0 +1,37 @@ +package item +// Which type of organization repositories have access to the organization secret. `selected` means only the repositories specified by `selected_repository_ids` can access the secret. +type WithSecret_namePutRequestBody_visibility int + +const ( + ALL_WITHSECRET_NAMEPUTREQUESTBODY_VISIBILITY WithSecret_namePutRequestBody_visibility = iota + PRIVATE_WITHSECRET_NAMEPUTREQUESTBODY_VISIBILITY + SELECTED_WITHSECRET_NAMEPUTREQUESTBODY_VISIBILITY +) + +func (i WithSecret_namePutRequestBody_visibility) String() string { + return []string{"all", "private", "selected"}[i] +} +func ParseWithSecret_namePutRequestBody_visibility(v string) (any, error) { + result := ALL_WITHSECRET_NAMEPUTREQUESTBODY_VISIBILITY + switch v { + case "all": + result = ALL_WITHSECRET_NAMEPUTREQUESTBODY_VISIBILITY + case "private": + result = PRIVATE_WITHSECRET_NAMEPUTREQUESTBODY_VISIBILITY + case "selected": + result = SELECTED_WITHSECRET_NAMEPUTREQUESTBODY_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeWithSecret_namePutRequestBody_visibility(values []WithSecret_namePutRequestBody_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithSecret_namePutRequestBody_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/issues/get_direction_query_parameter_type.go b/pkg/github/orgs/item/issues/get_direction_query_parameter_type.go new file mode 100644 index 00000000..f176c1cc --- /dev/null +++ b/pkg/github/orgs/item/issues/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package issues +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/issues/get_filter_query_parameter_type.go b/pkg/github/orgs/item/issues/get_filter_query_parameter_type.go new file mode 100644 index 00000000..0c77b959 --- /dev/null +++ b/pkg/github/orgs/item/issues/get_filter_query_parameter_type.go @@ -0,0 +1,45 @@ +package issues +type GetFilterQueryParameterType int + +const ( + ASSIGNED_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + CREATED_GETFILTERQUERYPARAMETERTYPE + MENTIONED_GETFILTERQUERYPARAMETERTYPE + SUBSCRIBED_GETFILTERQUERYPARAMETERTYPE + REPOS_GETFILTERQUERYPARAMETERTYPE + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"assigned", "created", "mentioned", "subscribed", "repos", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := ASSIGNED_GETFILTERQUERYPARAMETERTYPE + switch v { + case "assigned": + result = ASSIGNED_GETFILTERQUERYPARAMETERTYPE + case "created": + result = CREATED_GETFILTERQUERYPARAMETERTYPE + case "mentioned": + result = MENTIONED_GETFILTERQUERYPARAMETERTYPE + case "subscribed": + result = SUBSCRIBED_GETFILTERQUERYPARAMETERTYPE + case "repos": + result = REPOS_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/issues/get_sort_query_parameter_type.go b/pkg/github/orgs/item/issues/get_sort_query_parameter_type.go new file mode 100644 index 00000000..10b7912a --- /dev/null +++ b/pkg/github/orgs/item/issues/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package issues +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + COMMENTS_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "comments"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "comments": + result = COMMENTS_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/issues/get_state_query_parameter_type.go b/pkg/github/orgs/item/issues/get_state_query_parameter_type.go new file mode 100644 index 00000000..065faf93 --- /dev/null +++ b/pkg/github/orgs/item/issues/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package issues +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/item/item/with_enablement_post_request_body_escaped_query_escaped_suite.go b/pkg/github/orgs/item/item/item/with_enablement_post_request_body_escaped_query_escaped_suite.go new file mode 100644 index 00000000..e38e6874 --- /dev/null +++ b/pkg/github/orgs/item/item/item/with_enablement_post_request_body_escaped_query_escaped_suite.go @@ -0,0 +1,34 @@ +package item +// CodeQL query suite to be used. If you specify the `query_suite` parameter, the default setup will be configured with this query suite only on all repositories that didn't have default setup already configured. It will not change the query suite on repositories that already have default setup configured.If you don't specify any `query_suite` in your request, the preferred query suite of the organization will be applied. +type WithEnablementPostRequestBody_query_suite int + +const ( + DEFAULT_WITHENABLEMENTPOSTREQUESTBODY_QUERY_SUITE WithEnablementPostRequestBody_query_suite = iota + EXTENDED_WITHENABLEMENTPOSTREQUESTBODY_QUERY_SUITE +) + +func (i WithEnablementPostRequestBody_query_suite) String() string { + return []string{"default", "extended"}[i] +} +func ParseWithEnablementPostRequestBody_query_suite(v string) (any, error) { + result := DEFAULT_WITHENABLEMENTPOSTREQUESTBODY_QUERY_SUITE + switch v { + case "default": + result = DEFAULT_WITHENABLEMENTPOSTREQUESTBODY_QUERY_SUITE + case "extended": + result = EXTENDED_WITHENABLEMENTPOSTREQUESTBODY_QUERY_SUITE + default: + return nil, nil + } + return &result, nil +} +func SerializeWithEnablementPostRequestBody_query_suite(values []WithEnablementPostRequestBody_query_suite) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithEnablementPostRequestBody_query_suite) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/members/get_filter_query_parameter_type.go b/pkg/github/orgs/item/members/get_filter_query_parameter_type.go new file mode 100644 index 00000000..483c6d8b --- /dev/null +++ b/pkg/github/orgs/item/members/get_filter_query_parameter_type.go @@ -0,0 +1,33 @@ +package members +type GetFilterQueryParameterType int + +const ( + TWOFA_DISABLED_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"2fa_disabled", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := TWOFA_DISABLED_GETFILTERQUERYPARAMETERTYPE + switch v { + case "2fa_disabled": + result = TWOFA_DISABLED_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/members/get_role_query_parameter_type.go b/pkg/github/orgs/item/members/get_role_query_parameter_type.go new file mode 100644 index 00000000..92002b01 --- /dev/null +++ b/pkg/github/orgs/item/members/get_role_query_parameter_type.go @@ -0,0 +1,36 @@ +package members +type GetRoleQueryParameterType int + +const ( + ALL_GETROLEQUERYPARAMETERTYPE GetRoleQueryParameterType = iota + ADMIN_GETROLEQUERYPARAMETERTYPE + MEMBER_GETROLEQUERYPARAMETERTYPE +) + +func (i GetRoleQueryParameterType) String() string { + return []string{"all", "admin", "member"}[i] +} +func ParseGetRoleQueryParameterType(v string) (any, error) { + result := ALL_GETROLEQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETROLEQUERYPARAMETERTYPE + case "admin": + result = ADMIN_GETROLEQUERYPARAMETERTYPE + case "member": + result = MEMBER_GETROLEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetRoleQueryParameterType(values []GetRoleQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetRoleQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/memberships/item/with_username_put_request_body_escaped_role.go b/pkg/github/orgs/item/memberships/item/with_username_put_request_body_escaped_role.go new file mode 100644 index 00000000..01e9b75a --- /dev/null +++ b/pkg/github/orgs/item/memberships/item/with_username_put_request_body_escaped_role.go @@ -0,0 +1,34 @@ +package item +// The role to give the user in the organization. Can be one of: * `admin` - The user will become an owner of the organization. * `member` - The user will become a non-owner member of the organization. +type WithUsernamePutRequestBody_role int + +const ( + ADMIN_WITHUSERNAMEPUTREQUESTBODY_ROLE WithUsernamePutRequestBody_role = iota + MEMBER_WITHUSERNAMEPUTREQUESTBODY_ROLE +) + +func (i WithUsernamePutRequestBody_role) String() string { + return []string{"admin", "member"}[i] +} +func ParseWithUsernamePutRequestBody_role(v string) (any, error) { + result := ADMIN_WITHUSERNAMEPUTREQUESTBODY_ROLE + switch v { + case "admin": + result = ADMIN_WITHUSERNAMEPUTREQUESTBODY_ROLE + case "member": + result = MEMBER_WITHUSERNAMEPUTREQUESTBODY_ROLE + default: + return nil, nil + } + return &result, nil +} +func SerializeWithUsernamePutRequestBody_role(values []WithUsernamePutRequestBody_role) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithUsernamePutRequestBody_role) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/migrations/get_exclude_query_parameter_type.go b/pkg/github/orgs/item/migrations/get_exclude_query_parameter_type.go new file mode 100644 index 00000000..151552bd --- /dev/null +++ b/pkg/github/orgs/item/migrations/get_exclude_query_parameter_type.go @@ -0,0 +1,31 @@ +package migrations +// Allowed values that can be passed to the exclude param. +type GetExcludeQueryParameterType int + +const ( + REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE GetExcludeQueryParameterType = iota +) + +func (i GetExcludeQueryParameterType) String() string { + return []string{"repositories"}[i] +} +func ParseGetExcludeQueryParameterType(v string) (any, error) { + result := REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE + switch v { + case "repositories": + result = REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetExcludeQueryParameterType(values []GetExcludeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetExcludeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/migrations/item/get_exclude_query_parameter_type.go b/pkg/github/orgs/item/migrations/item/get_exclude_query_parameter_type.go new file mode 100644 index 00000000..e2033d1e --- /dev/null +++ b/pkg/github/orgs/item/migrations/item/get_exclude_query_parameter_type.go @@ -0,0 +1,31 @@ +package item +// Allowed values that can be passed to the exclude param. +type GetExcludeQueryParameterType int + +const ( + REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE GetExcludeQueryParameterType = iota +) + +func (i GetExcludeQueryParameterType) String() string { + return []string{"repositories"}[i] +} +func ParseGetExcludeQueryParameterType(v string) (any, error) { + result := REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE + switch v { + case "repositories": + result = REPOSITORIES_GETEXCLUDEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetExcludeQueryParameterType(values []GetExcludeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetExcludeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/migrations/migrations_post_request_body_escaped_exclude.go b/pkg/github/orgs/item/migrations/migrations_post_request_body_escaped_exclude.go new file mode 100644 index 00000000..b2d7de5c --- /dev/null +++ b/pkg/github/orgs/item/migrations/migrations_post_request_body_escaped_exclude.go @@ -0,0 +1,30 @@ +package migrations +type MigrationsPostRequestBody_exclude int + +const ( + REPOSITORIES_MIGRATIONSPOSTREQUESTBODY_EXCLUDE MigrationsPostRequestBody_exclude = iota +) + +func (i MigrationsPostRequestBody_exclude) String() string { + return []string{"repositories"}[i] +} +func ParseMigrationsPostRequestBody_exclude(v string) (any, error) { + result := REPOSITORIES_MIGRATIONSPOSTREQUESTBODY_EXCLUDE + switch v { + case "repositories": + result = REPOSITORIES_MIGRATIONSPOSTREQUESTBODY_EXCLUDE + default: + return nil, nil + } + return &result, nil +} +func SerializeMigrationsPostRequestBody_exclude(values []MigrationsPostRequestBody_exclude) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i MigrationsPostRequestBody_exclude) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/outside_collaborators/get_filter_query_parameter_type.go b/pkg/github/orgs/item/outside_collaborators/get_filter_query_parameter_type.go new file mode 100644 index 00000000..0d261e2b --- /dev/null +++ b/pkg/github/orgs/item/outside_collaborators/get_filter_query_parameter_type.go @@ -0,0 +1,33 @@ +package outside_collaborators +type GetFilterQueryParameterType int + +const ( + TWOFA_DISABLED_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"2fa_disabled", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := TWOFA_DISABLED_GETFILTERQUERYPARAMETERTYPE + switch v { + case "2fa_disabled": + result = TWOFA_DISABLED_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/packages/get_package_escaped_type_query_parameter_type.go b/pkg/github/orgs/item/packages/get_package_escaped_type_query_parameter_type.go new file mode 100644 index 00000000..071c8927 --- /dev/null +++ b/pkg/github/orgs/item/packages/get_package_escaped_type_query_parameter_type.go @@ -0,0 +1,45 @@ +package packages +type GetPackage_typeQueryParameterType int + +const ( + NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE GetPackage_typeQueryParameterType = iota + MAVEN_GETPACKAGE_TYPEQUERYPARAMETERTYPE + RUBYGEMS_GETPACKAGE_TYPEQUERYPARAMETERTYPE + DOCKER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + NUGET_GETPACKAGE_TYPEQUERYPARAMETERTYPE + CONTAINER_GETPACKAGE_TYPEQUERYPARAMETERTYPE +) + +func (i GetPackage_typeQueryParameterType) String() string { + return []string{"npm", "maven", "rubygems", "docker", "nuget", "container"}[i] +} +func ParseGetPackage_typeQueryParameterType(v string) (any, error) { + result := NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE + switch v { + case "npm": + result = NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "maven": + result = MAVEN_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "rubygems": + result = RUBYGEMS_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "docker": + result = DOCKER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "nuget": + result = NUGET_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "container": + result = CONTAINER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetPackage_typeQueryParameterType(values []GetPackage_typeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetPackage_typeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/packages/get_visibility_query_parameter_type.go b/pkg/github/orgs/item/packages/get_visibility_query_parameter_type.go new file mode 100644 index 00000000..f6ffbef0 --- /dev/null +++ b/pkg/github/orgs/item/packages/get_visibility_query_parameter_type.go @@ -0,0 +1,36 @@ +package packages +type GetVisibilityQueryParameterType int + +const ( + PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE GetVisibilityQueryParameterType = iota + PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE + INTERNAL_GETVISIBILITYQUERYPARAMETERTYPE +) + +func (i GetVisibilityQueryParameterType) String() string { + return []string{"public", "private", "internal"}[i] +} +func ParseGetVisibilityQueryParameterType(v string) (any, error) { + result := PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + switch v { + case "public": + result = PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + case "private": + result = PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE + case "internal": + result = INTERNAL_GETVISIBILITYQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetVisibilityQueryParameterType(values []GetVisibilityQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetVisibilityQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/packages/item/item/versions/get_state_query_parameter_type.go b/pkg/github/orgs/item/packages/item/item/versions/get_state_query_parameter_type.go new file mode 100644 index 00000000..e78d12f6 --- /dev/null +++ b/pkg/github/orgs/item/packages/item/item/versions/get_state_query_parameter_type.go @@ -0,0 +1,33 @@ +package versions +type GetStateQueryParameterType int + +const ( + ACTIVE_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + DELETED_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"active", "deleted"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := ACTIVE_GETSTATEQUERYPARAMETERTYPE + switch v { + case "active": + result = ACTIVE_GETSTATEQUERYPARAMETERTYPE + case "deleted": + result = DELETED_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/personalaccesstokenrequests/get_direction_query_parameter_type.go b/pkg/github/orgs/item/personalaccesstokenrequests/get_direction_query_parameter_type.go new file mode 100644 index 00000000..1057bb73 --- /dev/null +++ b/pkg/github/orgs/item/personalaccesstokenrequests/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package personalaccesstokenrequests +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/personalaccesstokenrequests/get_sort_query_parameter_type.go b/pkg/github/orgs/item/personalaccesstokenrequests/get_sort_query_parameter_type.go new file mode 100644 index 00000000..b7d3fa02 --- /dev/null +++ b/pkg/github/orgs/item/personalaccesstokenrequests/get_sort_query_parameter_type.go @@ -0,0 +1,30 @@ +package personalaccesstokenrequests +type GetSortQueryParameterType int + +const ( + CREATED_AT_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created_at"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_AT_GETSORTQUERYPARAMETERTYPE + switch v { + case "created_at": + result = CREATED_AT_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/personalaccesstokenrequests/item/with_pat_escaped_request_escaped_post_request_body_escaped_action.go b/pkg/github/orgs/item/personalaccesstokenrequests/item/with_pat_escaped_request_escaped_post_request_body_escaped_action.go new file mode 100644 index 00000000..4cecc464 --- /dev/null +++ b/pkg/github/orgs/item/personalaccesstokenrequests/item/with_pat_escaped_request_escaped_post_request_body_escaped_action.go @@ -0,0 +1,34 @@ +package item +// Action to apply to the request. +type WithPat_request_PostRequestBody_action int + +const ( + APPROVE_WITHPAT_REQUEST_POSTREQUESTBODY_ACTION WithPat_request_PostRequestBody_action = iota + DENY_WITHPAT_REQUEST_POSTREQUESTBODY_ACTION +) + +func (i WithPat_request_PostRequestBody_action) String() string { + return []string{"approve", "deny"}[i] +} +func ParseWithPat_request_PostRequestBody_action(v string) (any, error) { + result := APPROVE_WITHPAT_REQUEST_POSTREQUESTBODY_ACTION + switch v { + case "approve": + result = APPROVE_WITHPAT_REQUEST_POSTREQUESTBODY_ACTION + case "deny": + result = DENY_WITHPAT_REQUEST_POSTREQUESTBODY_ACTION + default: + return nil, nil + } + return &result, nil +} +func SerializeWithPat_request_PostRequestBody_action(values []WithPat_request_PostRequestBody_action) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithPat_request_PostRequestBody_action) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/personalaccesstokenrequests/personal_access_token_requests_post_request_body_escaped_action.go b/pkg/github/orgs/item/personalaccesstokenrequests/personal_access_token_requests_post_request_body_escaped_action.go new file mode 100644 index 00000000..9116530e --- /dev/null +++ b/pkg/github/orgs/item/personalaccesstokenrequests/personal_access_token_requests_post_request_body_escaped_action.go @@ -0,0 +1,34 @@ +package personalaccesstokenrequests +// Action to apply to the requests. +type PersonalAccessTokenRequestsPostRequestBody_action int + +const ( + APPROVE_PERSONALACCESSTOKENREQUESTSPOSTREQUESTBODY_ACTION PersonalAccessTokenRequestsPostRequestBody_action = iota + DENY_PERSONALACCESSTOKENREQUESTSPOSTREQUESTBODY_ACTION +) + +func (i PersonalAccessTokenRequestsPostRequestBody_action) String() string { + return []string{"approve", "deny"}[i] +} +func ParsePersonalAccessTokenRequestsPostRequestBody_action(v string) (any, error) { + result := APPROVE_PERSONALACCESSTOKENREQUESTSPOSTREQUESTBODY_ACTION + switch v { + case "approve": + result = APPROVE_PERSONALACCESSTOKENREQUESTSPOSTREQUESTBODY_ACTION + case "deny": + result = DENY_PERSONALACCESSTOKENREQUESTSPOSTREQUESTBODY_ACTION + default: + return nil, nil + } + return &result, nil +} +func SerializePersonalAccessTokenRequestsPostRequestBody_action(values []PersonalAccessTokenRequestsPostRequestBody_action) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PersonalAccessTokenRequestsPostRequestBody_action) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/personalaccesstokens/get_direction_query_parameter_type.go b/pkg/github/orgs/item/personalaccesstokens/get_direction_query_parameter_type.go new file mode 100644 index 00000000..fb86dd29 --- /dev/null +++ b/pkg/github/orgs/item/personalaccesstokens/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package personalaccesstokens +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/personalaccesstokens/get_sort_query_parameter_type.go b/pkg/github/orgs/item/personalaccesstokens/get_sort_query_parameter_type.go new file mode 100644 index 00000000..a32127f2 --- /dev/null +++ b/pkg/github/orgs/item/personalaccesstokens/get_sort_query_parameter_type.go @@ -0,0 +1,30 @@ +package personalaccesstokens +type GetSortQueryParameterType int + +const ( + CREATED_AT_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created_at"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_AT_GETSORTQUERYPARAMETERTYPE + switch v { + case "created_at": + result = CREATED_AT_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/personalaccesstokens/item/with_pat_escaped_post_request_body_escaped_action.go b/pkg/github/orgs/item/personalaccesstokens/item/with_pat_escaped_post_request_body_escaped_action.go new file mode 100644 index 00000000..7ba18a94 --- /dev/null +++ b/pkg/github/orgs/item/personalaccesstokens/item/with_pat_escaped_post_request_body_escaped_action.go @@ -0,0 +1,31 @@ +package item +// Action to apply to the fine-grained personal access token. +type WithPat_PostRequestBody_action int + +const ( + REVOKE_WITHPAT_POSTREQUESTBODY_ACTION WithPat_PostRequestBody_action = iota +) + +func (i WithPat_PostRequestBody_action) String() string { + return []string{"revoke"}[i] +} +func ParseWithPat_PostRequestBody_action(v string) (any, error) { + result := REVOKE_WITHPAT_POSTREQUESTBODY_ACTION + switch v { + case "revoke": + result = REVOKE_WITHPAT_POSTREQUESTBODY_ACTION + default: + return nil, nil + } + return &result, nil +} +func SerializeWithPat_PostRequestBody_action(values []WithPat_PostRequestBody_action) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithPat_PostRequestBody_action) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/personalaccesstokens/personal_access_tokens_post_request_body_escaped_action.go b/pkg/github/orgs/item/personalaccesstokens/personal_access_tokens_post_request_body_escaped_action.go new file mode 100644 index 00000000..ef59bba5 --- /dev/null +++ b/pkg/github/orgs/item/personalaccesstokens/personal_access_tokens_post_request_body_escaped_action.go @@ -0,0 +1,31 @@ +package personalaccesstokens +// Action to apply to the fine-grained personal access token. +type PersonalAccessTokensPostRequestBody_action int + +const ( + REVOKE_PERSONALACCESSTOKENSPOSTREQUESTBODY_ACTION PersonalAccessTokensPostRequestBody_action = iota +) + +func (i PersonalAccessTokensPostRequestBody_action) String() string { + return []string{"revoke"}[i] +} +func ParsePersonalAccessTokensPostRequestBody_action(v string) (any, error) { + result := REVOKE_PERSONALACCESSTOKENSPOSTREQUESTBODY_ACTION + switch v { + case "revoke": + result = REVOKE_PERSONALACCESSTOKENSPOSTREQUESTBODY_ACTION + default: + return nil, nil + } + return &result, nil +} +func SerializePersonalAccessTokensPostRequestBody_action(values []PersonalAccessTokensPostRequestBody_action) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PersonalAccessTokensPostRequestBody_action) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/prereceivehooks/get_direction_query_parameter_type.go b/pkg/github/orgs/item/prereceivehooks/get_direction_query_parameter_type.go new file mode 100644 index 00000000..cf3c4186 --- /dev/null +++ b/pkg/github/orgs/item/prereceivehooks/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package prereceivehooks +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/prereceivehooks/get_sort_query_parameter_type.go b/pkg/github/orgs/item/prereceivehooks/get_sort_query_parameter_type.go new file mode 100644 index 00000000..ea9591b1 --- /dev/null +++ b/pkg/github/orgs/item/prereceivehooks/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package prereceivehooks +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + NAME_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "name"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "name": + result = NAME_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/projects/get_state_query_parameter_type.go b/pkg/github/orgs/item/projects/get_state_query_parameter_type.go new file mode 100644 index 00000000..2c9bc230 --- /dev/null +++ b/pkg/github/orgs/item/projects/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package projects +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) 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 new file mode 100644 index 00000000..c0d471ea --- /dev/null +++ b/pkg/github/orgs/item/properties/schema/item/with_custom_escaped_property_escaped_name_put_request_body_escaped_value_escaped_type.go @@ -0,0 +1,40 @@ +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/repos/get_direction_query_parameter_type.go b/pkg/github/orgs/item/repos/get_direction_query_parameter_type.go new file mode 100644 index 00000000..03a299e2 --- /dev/null +++ b/pkg/github/orgs/item/repos/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package repos +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/repos/get_sort_query_parameter_type.go b/pkg/github/orgs/item/repos/get_sort_query_parameter_type.go new file mode 100644 index 00000000..58939d2b --- /dev/null +++ b/pkg/github/orgs/item/repos/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package repos +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + PUSHED_GETSORTQUERYPARAMETERTYPE + FULL_NAME_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "pushed", "full_name"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "pushed": + result = PUSHED_GETSORTQUERYPARAMETERTYPE + case "full_name": + result = FULL_NAME_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/repos/get_type_query_parameter_type.go b/pkg/github/orgs/item/repos/get_type_query_parameter_type.go new file mode 100644 index 00000000..16b68e6a --- /dev/null +++ b/pkg/github/orgs/item/repos/get_type_query_parameter_type.go @@ -0,0 +1,48 @@ +package repos +type GetTypeQueryParameterType int + +const ( + ALL_GETTYPEQUERYPARAMETERTYPE GetTypeQueryParameterType = iota + PUBLIC_GETTYPEQUERYPARAMETERTYPE + PRIVATE_GETTYPEQUERYPARAMETERTYPE + FORKS_GETTYPEQUERYPARAMETERTYPE + SOURCES_GETTYPEQUERYPARAMETERTYPE + MEMBER_GETTYPEQUERYPARAMETERTYPE + INTERNAL_GETTYPEQUERYPARAMETERTYPE +) + +func (i GetTypeQueryParameterType) String() string { + return []string{"all", "public", "private", "forks", "sources", "member", "internal"}[i] +} +func ParseGetTypeQueryParameterType(v string) (any, error) { + result := ALL_GETTYPEQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETTYPEQUERYPARAMETERTYPE + case "public": + result = PUBLIC_GETTYPEQUERYPARAMETERTYPE + case "private": + result = PRIVATE_GETTYPEQUERYPARAMETERTYPE + case "forks": + result = FORKS_GETTYPEQUERYPARAMETERTYPE + case "sources": + result = SOURCES_GETTYPEQUERYPARAMETERTYPE + case "member": + result = MEMBER_GETTYPEQUERYPARAMETERTYPE + case "internal": + result = INTERNAL_GETTYPEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetTypeQueryParameterType(values []GetTypeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTypeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_message.go b/pkg/github/orgs/item/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_message.go new file mode 100644 index 00000000..38d5b057 --- /dev/null +++ b/pkg/github/orgs/item/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_message.go @@ -0,0 +1,37 @@ +package repos +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type ReposPostRequestBody_merge_commit_message int + +const ( + PR_BODY_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE ReposPostRequestBody_merge_commit_message = iota + PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + BLANK_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE +) + +func (i ReposPostRequestBody_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParseReposPostRequestBody_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + default: + return nil, nil + } + return &result, nil +} +func SerializeReposPostRequestBody_merge_commit_message(values []ReposPostRequestBody_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_title.go b/pkg/github/orgs/item/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_title.go new file mode 100644 index 00000000..e110ce99 --- /dev/null +++ b/pkg/github/orgs/item/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_title.go @@ -0,0 +1,34 @@ +package repos +// Required when using `merge_commit_message`.The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +type ReposPostRequestBody_merge_commit_title int + +const ( + PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE ReposPostRequestBody_merge_commit_title = iota + MERGE_MESSAGE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE +) + +func (i ReposPostRequestBody_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParseReposPostRequestBody_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE + default: + return nil, nil + } + return &result, nil +} +func SerializeReposPostRequestBody_merge_commit_title(values []ReposPostRequestBody_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_message.go b/pkg/github/orgs/item/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_message.go new file mode 100644 index 00000000..1e336e72 --- /dev/null +++ b/pkg/github/orgs/item/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_message.go @@ -0,0 +1,37 @@ +package repos +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type ReposPostRequestBody_squash_merge_commit_message int + +const ( + PR_BODY_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE ReposPostRequestBody_squash_merge_commit_message = iota + COMMIT_MESSAGES_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i ReposPostRequestBody_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParseReposPostRequestBody_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + default: + return nil, nil + } + return &result, nil +} +func SerializeReposPostRequestBody_squash_merge_commit_message(values []ReposPostRequestBody_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_title.go b/pkg/github/orgs/item/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_title.go new file mode 100644 index 00000000..fc909b0b --- /dev/null +++ b/pkg/github/orgs/item/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_title.go @@ -0,0 +1,34 @@ +package repos +// Required when using `squash_merge_commit_message`.The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type ReposPostRequestBody_squash_merge_commit_title int + +const ( + PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE ReposPostRequestBody_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE +) + +func (i ReposPostRequestBody_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParseReposPostRequestBody_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + default: + return nil, nil + } + return &result, nil +} +func SerializeReposPostRequestBody_squash_merge_commit_title(values []ReposPostRequestBody_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/repos/repos_post_request_body_escaped_visibility.go b/pkg/github/orgs/item/repos/repos_post_request_body_escaped_visibility.go new file mode 100644 index 00000000..276ece6a --- /dev/null +++ b/pkg/github/orgs/item/repos/repos_post_request_body_escaped_visibility.go @@ -0,0 +1,37 @@ +package repos +// The visibility of the repository. **Note**: For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise. For more information, see "[Creating an internal repository](https://docs.github.com/enterprise-server@3.14/github/creating-cloning-and-archiving-repositories/about-repository-visibility#about-internal-repositories)" in the GitHub Help documentation. The `visibility` parameter overrides the `private` parameter when you use both parameters with the `nebula-preview` preview header. +type ReposPostRequestBody_visibility int + +const ( + PUBLIC_REPOSPOSTREQUESTBODY_VISIBILITY ReposPostRequestBody_visibility = iota + PRIVATE_REPOSPOSTREQUESTBODY_VISIBILITY + INTERNAL_REPOSPOSTREQUESTBODY_VISIBILITY +) + +func (i ReposPostRequestBody_visibility) String() string { + return []string{"public", "private", "internal"}[i] +} +func ParseReposPostRequestBody_visibility(v string) (any, error) { + result := PUBLIC_REPOSPOSTREQUESTBODY_VISIBILITY + switch v { + case "public": + result = PUBLIC_REPOSPOSTREQUESTBODY_VISIBILITY + case "private": + result = PRIVATE_REPOSPOSTREQUESTBODY_VISIBILITY + case "internal": + result = INTERNAL_REPOSPOSTREQUESTBODY_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeReposPostRequestBody_visibility(values []ReposPostRequestBody_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_visibility) 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 new file mode 100644 index 00000000..5ec257fb --- /dev/null +++ b/pkg/github/orgs/item/rulesets/item/with_ruleset_escaped_put_request_body_escaped_target.go @@ -0,0 +1,37 @@ +package item +// The target of the ruleset +type WithRuleset_PutRequestBody_target int + +const ( + BRANCH_WITHRULESET_PUTREQUESTBODY_TARGET WithRuleset_PutRequestBody_target = iota + TAG_WITHRULESET_PUTREQUESTBODY_TARGET + PUSH_WITHRULESET_PUTREQUESTBODY_TARGET +) + +func (i WithRuleset_PutRequestBody_target) String() string { + return []string{"branch", "tag", "push"}[i] +} +func ParseWithRuleset_PutRequestBody_target(v string) (any, error) { + result := BRANCH_WITHRULESET_PUTREQUESTBODY_TARGET + switch v { + case "branch": + result = BRANCH_WITHRULESET_PUTREQUESTBODY_TARGET + case "tag": + result = TAG_WITHRULESET_PUTREQUESTBODY_TARGET + case "push": + result = PUSH_WITHRULESET_PUTREQUESTBODY_TARGET + default: + return nil, nil + } + return &result, nil +} +func SerializeWithRuleset_PutRequestBody_target(values []WithRuleset_PutRequestBody_target) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithRuleset_PutRequestBody_target) isMultiValue() bool { + return false +} 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 new file mode 100644 index 00000000..bba7d001 --- /dev/null +++ b/pkg/github/orgs/item/rulesets/rulesets_post_request_body_escaped_target.go @@ -0,0 +1,37 @@ +package rulesets +// The target of the ruleset +type RulesetsPostRequestBody_target int + +const ( + BRANCH_RULESETSPOSTREQUESTBODY_TARGET RulesetsPostRequestBody_target = iota + TAG_RULESETSPOSTREQUESTBODY_TARGET + PUSH_RULESETSPOSTREQUESTBODY_TARGET +) + +func (i RulesetsPostRequestBody_target) String() string { + return []string{"branch", "tag", "push"}[i] +} +func ParseRulesetsPostRequestBody_target(v string) (any, error) { + result := BRANCH_RULESETSPOSTREQUESTBODY_TARGET + switch v { + case "branch": + result = BRANCH_RULESETSPOSTREQUESTBODY_TARGET + case "tag": + result = TAG_RULESETSPOSTREQUESTBODY_TARGET + case "push": + result = PUSH_RULESETSPOSTREQUESTBODY_TARGET + default: + return nil, nil + } + return &result, nil +} +func SerializeRulesetsPostRequestBody_target(values []RulesetsPostRequestBody_target) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RulesetsPostRequestBody_target) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/rulesets/rulesuites/get_rule_escaped_suite_escaped_result_query_parameter_type.go b/pkg/github/orgs/item/rulesets/rulesuites/get_rule_escaped_suite_escaped_result_query_parameter_type.go new file mode 100644 index 00000000..8665bcb0 --- /dev/null +++ b/pkg/github/orgs/item/rulesets/rulesuites/get_rule_escaped_suite_escaped_result_query_parameter_type.go @@ -0,0 +1,39 @@ +package rulesuites +type GetRule_suite_resultQueryParameterType int + +const ( + PASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE GetRule_suite_resultQueryParameterType = iota + FAIL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + BYPASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + ALL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE +) + +func (i GetRule_suite_resultQueryParameterType) String() string { + return []string{"pass", "fail", "bypass", "all"}[i] +} +func ParseGetRule_suite_resultQueryParameterType(v string) (any, error) { + result := PASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + switch v { + case "pass": + result = PASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + case "fail": + result = FAIL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + case "bypass": + result = BYPASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + case "all": + result = ALL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetRule_suite_resultQueryParameterType(values []GetRule_suite_resultQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetRule_suite_resultQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/rulesets/rulesuites/get_time_escaped_period_query_parameter_type.go b/pkg/github/orgs/item/rulesets/rulesuites/get_time_escaped_period_query_parameter_type.go new file mode 100644 index 00000000..ae408634 --- /dev/null +++ b/pkg/github/orgs/item/rulesets/rulesuites/get_time_escaped_period_query_parameter_type.go @@ -0,0 +1,39 @@ +package rulesuites +type GetTime_periodQueryParameterType int + +const ( + HOUR_GETTIME_PERIODQUERYPARAMETERTYPE GetTime_periodQueryParameterType = iota + DAY_GETTIME_PERIODQUERYPARAMETERTYPE + WEEK_GETTIME_PERIODQUERYPARAMETERTYPE + MONTH_GETTIME_PERIODQUERYPARAMETERTYPE +) + +func (i GetTime_periodQueryParameterType) String() string { + return []string{"hour", "day", "week", "month"}[i] +} +func ParseGetTime_periodQueryParameterType(v string) (any, error) { + result := HOUR_GETTIME_PERIODQUERYPARAMETERTYPE + switch v { + case "hour": + result = HOUR_GETTIME_PERIODQUERYPARAMETERTYPE + case "day": + result = DAY_GETTIME_PERIODQUERYPARAMETERTYPE + case "week": + result = WEEK_GETTIME_PERIODQUERYPARAMETERTYPE + case "month": + result = MONTH_GETTIME_PERIODQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetTime_periodQueryParameterType(values []GetTime_periodQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTime_periodQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/secretscanning/alerts/get_direction_query_parameter_type.go b/pkg/github/orgs/item/secretscanning/alerts/get_direction_query_parameter_type.go new file mode 100644 index 00000000..0606c6d4 --- /dev/null +++ b/pkg/github/orgs/item/secretscanning/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/secretscanning/alerts/get_sort_query_parameter_type.go b/pkg/github/orgs/item/secretscanning/alerts/get_sort_query_parameter_type.go new file mode 100644 index 00000000..719c5fb3 --- /dev/null +++ b/pkg/github/orgs/item/secretscanning/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/secretscanning/alerts/get_state_query_parameter_type.go b/pkg/github/orgs/item/secretscanning/alerts/get_state_query_parameter_type.go new file mode 100644 index 00000000..ae552fb1 --- /dev/null +++ b/pkg/github/orgs/item/secretscanning/alerts/get_state_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + RESOLVED_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "resolved"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "resolved": + result = RESOLVED_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/item/discussions/get_direction_query_parameter_type.go b/pkg/github/orgs/item/teams/item/discussions/get_direction_query_parameter_type.go new file mode 100644 index 00000000..464403a3 --- /dev/null +++ b/pkg/github/orgs/item/teams/item/discussions/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package discussions +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/item/discussions/item/comments/get_direction_query_parameter_type.go b/pkg/github/orgs/item/teams/item/discussions/item/comments/get_direction_query_parameter_type.go new file mode 100644 index 00000000..6561eb6a --- /dev/null +++ b/pkg/github/orgs/item/teams/item/discussions/item/comments/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package comments +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions/get_content_query_parameter_type.go b/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 00000000..f3e64542 --- /dev/null +++ b/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,51 @@ +package reactions +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions/reactions_post_request_body_escaped_content.go b/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions/reactions_post_request_body_escaped_content.go new file mode 100644 index 00000000..b203b01a --- /dev/null +++ b/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions/reactions_post_request_body_escaped_content.go @@ -0,0 +1,52 @@ +package reactions +// The [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions) to add to the team discussion comment. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return nil, nil + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/item/discussions/item/reactions/get_content_query_parameter_type.go b/pkg/github/orgs/item/teams/item/discussions/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 00000000..f3e64542 --- /dev/null +++ b/pkg/github/orgs/item/teams/item/discussions/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,51 @@ +package reactions +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/item/discussions/item/reactions/reactions_post_request_body_escaped_content.go b/pkg/github/orgs/item/teams/item/discussions/item/reactions/reactions_post_request_body_escaped_content.go new file mode 100644 index 00000000..6b5b61e1 --- /dev/null +++ b/pkg/github/orgs/item/teams/item/discussions/item/reactions/reactions_post_request_body_escaped_content.go @@ -0,0 +1,52 @@ +package reactions +// The [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions) to add to the team discussion. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return nil, nil + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/item/members/get_role_query_parameter_type.go b/pkg/github/orgs/item/teams/item/members/get_role_query_parameter_type.go new file mode 100644 index 00000000..4d703803 --- /dev/null +++ b/pkg/github/orgs/item/teams/item/members/get_role_query_parameter_type.go @@ -0,0 +1,36 @@ +package members +type GetRoleQueryParameterType int + +const ( + MEMBER_GETROLEQUERYPARAMETERTYPE GetRoleQueryParameterType = iota + MAINTAINER_GETROLEQUERYPARAMETERTYPE + ALL_GETROLEQUERYPARAMETERTYPE +) + +func (i GetRoleQueryParameterType) String() string { + return []string{"member", "maintainer", "all"}[i] +} +func ParseGetRoleQueryParameterType(v string) (any, error) { + result := MEMBER_GETROLEQUERYPARAMETERTYPE + switch v { + case "member": + result = MEMBER_GETROLEQUERYPARAMETERTYPE + case "maintainer": + result = MAINTAINER_GETROLEQUERYPARAMETERTYPE + case "all": + result = ALL_GETROLEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetRoleQueryParameterType(values []GetRoleQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetRoleQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/item/memberships/item/with_username_put_request_body_escaped_role.go b/pkg/github/orgs/item/teams/item/memberships/item/with_username_put_request_body_escaped_role.go new file mode 100644 index 00000000..d01d40bb --- /dev/null +++ b/pkg/github/orgs/item/teams/item/memberships/item/with_username_put_request_body_escaped_role.go @@ -0,0 +1,34 @@ +package item +// The role that this user should have in the team. +type WithUsernamePutRequestBody_role int + +const ( + MEMBER_WITHUSERNAMEPUTREQUESTBODY_ROLE WithUsernamePutRequestBody_role = iota + MAINTAINER_WITHUSERNAMEPUTREQUESTBODY_ROLE +) + +func (i WithUsernamePutRequestBody_role) String() string { + return []string{"member", "maintainer"}[i] +} +func ParseWithUsernamePutRequestBody_role(v string) (any, error) { + result := MEMBER_WITHUSERNAMEPUTREQUESTBODY_ROLE + switch v { + case "member": + result = MEMBER_WITHUSERNAMEPUTREQUESTBODY_ROLE + case "maintainer": + result = MAINTAINER_WITHUSERNAMEPUTREQUESTBODY_ROLE + default: + return nil, nil + } + return &result, nil +} +func SerializeWithUsernamePutRequestBody_role(values []WithUsernamePutRequestBody_role) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithUsernamePutRequestBody_role) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/item/projects/item/with_project_escaped_put_request_body_escaped_permission.go b/pkg/github/orgs/item/teams/item/projects/item/with_project_escaped_put_request_body_escaped_permission.go new file mode 100644 index 00000000..1cc17e0d --- /dev/null +++ b/pkg/github/orgs/item/teams/item/projects/item/with_project_escaped_put_request_body_escaped_permission.go @@ -0,0 +1,37 @@ +package item +// The permission to grant to the team for this project. Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +type WithProject_PutRequestBody_permission int + +const ( + READ_WITHPROJECT_PUTREQUESTBODY_PERMISSION WithProject_PutRequestBody_permission = iota + WRITE_WITHPROJECT_PUTREQUESTBODY_PERMISSION + ADMIN_WITHPROJECT_PUTREQUESTBODY_PERMISSION +) + +func (i WithProject_PutRequestBody_permission) String() string { + return []string{"read", "write", "admin"}[i] +} +func ParseWithProject_PutRequestBody_permission(v string) (any, error) { + result := READ_WITHPROJECT_PUTREQUESTBODY_PERMISSION + switch v { + case "read": + result = READ_WITHPROJECT_PUTREQUESTBODY_PERMISSION + case "write": + result = WRITE_WITHPROJECT_PUTREQUESTBODY_PERMISSION + case "admin": + result = ADMIN_WITHPROJECT_PUTREQUESTBODY_PERMISSION + default: + return nil, nil + } + return &result, nil +} +func SerializeWithProject_PutRequestBody_permission(values []WithProject_PutRequestBody_permission) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithProject_PutRequestBody_permission) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/item/with_team_escaped_slug_patch_request_body_escaped_notification_escaped_setting.go b/pkg/github/orgs/item/teams/item/with_team_escaped_slug_patch_request_body_escaped_notification_escaped_setting.go new file mode 100644 index 00000000..199c4f32 --- /dev/null +++ b/pkg/github/orgs/item/teams/item/with_team_escaped_slug_patch_request_body_escaped_notification_escaped_setting.go @@ -0,0 +1,34 @@ +package item +// The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: * `notifications_enabled` - team members receive notifications when the team is @mentioned. * `notifications_disabled` - no one receives notifications. +type WithTeam_slugPatchRequestBody_notification_setting int + +const ( + NOTIFICATIONS_ENABLED_WITHTEAM_SLUGPATCHREQUESTBODY_NOTIFICATION_SETTING WithTeam_slugPatchRequestBody_notification_setting = iota + NOTIFICATIONS_DISABLED_WITHTEAM_SLUGPATCHREQUESTBODY_NOTIFICATION_SETTING +) + +func (i WithTeam_slugPatchRequestBody_notification_setting) String() string { + return []string{"notifications_enabled", "notifications_disabled"}[i] +} +func ParseWithTeam_slugPatchRequestBody_notification_setting(v string) (any, error) { + result := NOTIFICATIONS_ENABLED_WITHTEAM_SLUGPATCHREQUESTBODY_NOTIFICATION_SETTING + switch v { + case "notifications_enabled": + result = NOTIFICATIONS_ENABLED_WITHTEAM_SLUGPATCHREQUESTBODY_NOTIFICATION_SETTING + case "notifications_disabled": + result = NOTIFICATIONS_DISABLED_WITHTEAM_SLUGPATCHREQUESTBODY_NOTIFICATION_SETTING + default: + return nil, nil + } + return &result, nil +} +func SerializeWithTeam_slugPatchRequestBody_notification_setting(values []WithTeam_slugPatchRequestBody_notification_setting) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithTeam_slugPatchRequestBody_notification_setting) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/item/with_team_escaped_slug_patch_request_body_escaped_permission.go b/pkg/github/orgs/item/teams/item/with_team_escaped_slug_patch_request_body_escaped_permission.go new file mode 100644 index 00000000..a79e7086 --- /dev/null +++ b/pkg/github/orgs/item/teams/item/with_team_escaped_slug_patch_request_body_escaped_permission.go @@ -0,0 +1,37 @@ +package item +// **Deprecated**. The permission that new repositories will be added to the team with when none is specified. +type WithTeam_slugPatchRequestBody_permission int + +const ( + PULL_WITHTEAM_SLUGPATCHREQUESTBODY_PERMISSION WithTeam_slugPatchRequestBody_permission = iota + PUSH_WITHTEAM_SLUGPATCHREQUESTBODY_PERMISSION + ADMIN_WITHTEAM_SLUGPATCHREQUESTBODY_PERMISSION +) + +func (i WithTeam_slugPatchRequestBody_permission) String() string { + return []string{"pull", "push", "admin"}[i] +} +func ParseWithTeam_slugPatchRequestBody_permission(v string) (any, error) { + result := PULL_WITHTEAM_SLUGPATCHREQUESTBODY_PERMISSION + switch v { + case "pull": + result = PULL_WITHTEAM_SLUGPATCHREQUESTBODY_PERMISSION + case "push": + result = PUSH_WITHTEAM_SLUGPATCHREQUESTBODY_PERMISSION + case "admin": + result = ADMIN_WITHTEAM_SLUGPATCHREQUESTBODY_PERMISSION + default: + return nil, nil + } + return &result, nil +} +func SerializeWithTeam_slugPatchRequestBody_permission(values []WithTeam_slugPatchRequestBody_permission) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithTeam_slugPatchRequestBody_permission) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/item/with_team_escaped_slug_patch_request_body_escaped_privacy.go b/pkg/github/orgs/item/teams/item/with_team_escaped_slug_patch_request_body_escaped_privacy.go new file mode 100644 index 00000000..4b6ec024 --- /dev/null +++ b/pkg/github/orgs/item/teams/item/with_team_escaped_slug_patch_request_body_escaped_privacy.go @@ -0,0 +1,34 @@ +package item +// The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. When a team is nested, the `privacy` for parent teams cannot be `secret`. The options are: **For a non-nested team:** * `secret` - only visible to organization owners and members of this team. * `closed` - visible to all members of this organization. **For a parent or child team:** * `closed` - visible to all members of this organization. +type WithTeam_slugPatchRequestBody_privacy int + +const ( + SECRET_WITHTEAM_SLUGPATCHREQUESTBODY_PRIVACY WithTeam_slugPatchRequestBody_privacy = iota + CLOSED_WITHTEAM_SLUGPATCHREQUESTBODY_PRIVACY +) + +func (i WithTeam_slugPatchRequestBody_privacy) String() string { + return []string{"secret", "closed"}[i] +} +func ParseWithTeam_slugPatchRequestBody_privacy(v string) (any, error) { + result := SECRET_WITHTEAM_SLUGPATCHREQUESTBODY_PRIVACY + switch v { + case "secret": + result = SECRET_WITHTEAM_SLUGPATCHREQUESTBODY_PRIVACY + case "closed": + result = CLOSED_WITHTEAM_SLUGPATCHREQUESTBODY_PRIVACY + default: + return nil, nil + } + return &result, nil +} +func SerializeWithTeam_slugPatchRequestBody_privacy(values []WithTeam_slugPatchRequestBody_privacy) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithTeam_slugPatchRequestBody_privacy) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/teams_post_request_body_escaped_notification_escaped_setting.go b/pkg/github/orgs/item/teams/teams_post_request_body_escaped_notification_escaped_setting.go new file mode 100644 index 00000000..f0397eba --- /dev/null +++ b/pkg/github/orgs/item/teams/teams_post_request_body_escaped_notification_escaped_setting.go @@ -0,0 +1,34 @@ +package teams +// The notification setting the team has chosen. The options are: * `notifications_enabled` - team members receive notifications when the team is @mentioned. * `notifications_disabled` - no one receives notifications. Default: `notifications_enabled` +type TeamsPostRequestBody_notification_setting int + +const ( + NOTIFICATIONS_ENABLED_TEAMSPOSTREQUESTBODY_NOTIFICATION_SETTING TeamsPostRequestBody_notification_setting = iota + NOTIFICATIONS_DISABLED_TEAMSPOSTREQUESTBODY_NOTIFICATION_SETTING +) + +func (i TeamsPostRequestBody_notification_setting) String() string { + return []string{"notifications_enabled", "notifications_disabled"}[i] +} +func ParseTeamsPostRequestBody_notification_setting(v string) (any, error) { + result := NOTIFICATIONS_ENABLED_TEAMSPOSTREQUESTBODY_NOTIFICATION_SETTING + switch v { + case "notifications_enabled": + result = NOTIFICATIONS_ENABLED_TEAMSPOSTREQUESTBODY_NOTIFICATION_SETTING + case "notifications_disabled": + result = NOTIFICATIONS_DISABLED_TEAMSPOSTREQUESTBODY_NOTIFICATION_SETTING + default: + return nil, nil + } + return &result, nil +} +func SerializeTeamsPostRequestBody_notification_setting(values []TeamsPostRequestBody_notification_setting) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i TeamsPostRequestBody_notification_setting) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/teams_post_request_body_escaped_permission.go b/pkg/github/orgs/item/teams/teams_post_request_body_escaped_permission.go new file mode 100644 index 00000000..3440cd2a --- /dev/null +++ b/pkg/github/orgs/item/teams/teams_post_request_body_escaped_permission.go @@ -0,0 +1,34 @@ +package teams +// **Deprecated**. The permission that new repositories will be added to the team with when none is specified. +type TeamsPostRequestBody_permission int + +const ( + PULL_TEAMSPOSTREQUESTBODY_PERMISSION TeamsPostRequestBody_permission = iota + PUSH_TEAMSPOSTREQUESTBODY_PERMISSION +) + +func (i TeamsPostRequestBody_permission) String() string { + return []string{"pull", "push"}[i] +} +func ParseTeamsPostRequestBody_permission(v string) (any, error) { + result := PULL_TEAMSPOSTREQUESTBODY_PERMISSION + switch v { + case "pull": + result = PULL_TEAMSPOSTREQUESTBODY_PERMISSION + case "push": + result = PUSH_TEAMSPOSTREQUESTBODY_PERMISSION + default: + return nil, nil + } + return &result, nil +} +func SerializeTeamsPostRequestBody_permission(values []TeamsPostRequestBody_permission) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i TeamsPostRequestBody_permission) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/teams/teams_post_request_body_escaped_privacy.go b/pkg/github/orgs/item/teams/teams_post_request_body_escaped_privacy.go new file mode 100644 index 00000000..7ef93527 --- /dev/null +++ b/pkg/github/orgs/item/teams/teams_post_request_body_escaped_privacy.go @@ -0,0 +1,34 @@ +package teams +// The level of privacy this team should have. The options are: **For a non-nested team:** * `secret` - only visible to organization owners and members of this team. * `closed` - visible to all members of this organization. Default: `secret` **For a parent or child team:** * `closed` - visible to all members of this organization. Default for child team: `closed` +type TeamsPostRequestBody_privacy int + +const ( + SECRET_TEAMSPOSTREQUESTBODY_PRIVACY TeamsPostRequestBody_privacy = iota + CLOSED_TEAMSPOSTREQUESTBODY_PRIVACY +) + +func (i TeamsPostRequestBody_privacy) String() string { + return []string{"secret", "closed"}[i] +} +func ParseTeamsPostRequestBody_privacy(v string) (any, error) { + result := SECRET_TEAMSPOSTREQUESTBODY_PRIVACY + switch v { + case "secret": + result = SECRET_TEAMSPOSTREQUESTBODY_PRIVACY + case "closed": + result = CLOSED_TEAMSPOSTREQUESTBODY_PRIVACY + default: + return nil, nil + } + return &result, nil +} +func SerializeTeamsPostRequestBody_privacy(values []TeamsPostRequestBody_privacy) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i TeamsPostRequestBody_privacy) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item/with_org_patch_request_body_escaped_default_escaped_repository_escaped_permission.go b/pkg/github/orgs/item/with_org_patch_request_body_escaped_default_escaped_repository_escaped_permission.go new file mode 100644 index 00000000..7d3f2596 --- /dev/null +++ b/pkg/github/orgs/item/with_org_patch_request_body_escaped_default_escaped_repository_escaped_permission.go @@ -0,0 +1,40 @@ +package item +// Default permission level members have for organization repositories. +type WithOrgPatchRequestBody_default_repository_permission int + +const ( + READ_WITHORGPATCHREQUESTBODY_DEFAULT_REPOSITORY_PERMISSION WithOrgPatchRequestBody_default_repository_permission = iota + WRITE_WITHORGPATCHREQUESTBODY_DEFAULT_REPOSITORY_PERMISSION + ADMIN_WITHORGPATCHREQUESTBODY_DEFAULT_REPOSITORY_PERMISSION + NONE_WITHORGPATCHREQUESTBODY_DEFAULT_REPOSITORY_PERMISSION +) + +func (i WithOrgPatchRequestBody_default_repository_permission) String() string { + return []string{"read", "write", "admin", "none"}[i] +} +func ParseWithOrgPatchRequestBody_default_repository_permission(v string) (any, error) { + result := READ_WITHORGPATCHREQUESTBODY_DEFAULT_REPOSITORY_PERMISSION + switch v { + case "read": + result = READ_WITHORGPATCHREQUESTBODY_DEFAULT_REPOSITORY_PERMISSION + case "write": + result = WRITE_WITHORGPATCHREQUESTBODY_DEFAULT_REPOSITORY_PERMISSION + case "admin": + result = ADMIN_WITHORGPATCHREQUESTBODY_DEFAULT_REPOSITORY_PERMISSION + case "none": + result = NONE_WITHORGPATCHREQUESTBODY_DEFAULT_REPOSITORY_PERMISSION + default: + return nil, nil + } + return &result, nil +} +func SerializeWithOrgPatchRequestBody_default_repository_permission(values []WithOrgPatchRequestBody_default_repository_permission) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithOrgPatchRequestBody_default_repository_permission) isMultiValue() bool { + return false +} diff --git a/pkg/github/orgs/item_actions_cache_request_builder.go b/pkg/github/orgs/item_actions_cache_request_builder.go new file mode 100644 index 00000000..3929cf9e --- /dev/null +++ b/pkg/github/orgs/item_actions_cache_request_builder.go @@ -0,0 +1,33 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsCacheRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\cache +type ItemActionsCacheRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsCacheRequestBuilderInternal instantiates a new ItemActionsCacheRequestBuilder and sets the default values. +func NewItemActionsCacheRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheRequestBuilder) { + m := &ItemActionsCacheRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/cache", pathParameters), + } + return m +} +// NewItemActionsCacheRequestBuilder instantiates a new ItemActionsCacheRequestBuilder and sets the default values. +func NewItemActionsCacheRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsCacheRequestBuilderInternal(urlParams, requestAdapter) +} +// Usage the usage property +// returns a *ItemActionsCacheUsageRequestBuilder when successful +func (m *ItemActionsCacheRequestBuilder) Usage()(*ItemActionsCacheUsageRequestBuilder) { + return NewItemActionsCacheUsageRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// UsageByRepository the usageByRepository property +// returns a *ItemActionsCacheUsageByRepositoryRequestBuilder when successful +func (m *ItemActionsCacheRequestBuilder) UsageByRepository()(*ItemActionsCacheUsageByRepositoryRequestBuilder) { + return NewItemActionsCacheUsageByRepositoryRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/orgs/item_actions_cache_usage_by_repository_get_response.go b/pkg/github/orgs/item_actions_cache_usage_by_repository_get_response.go new file mode 100644 index 00000000..273008dd --- /dev/null +++ b/pkg/github/orgs/item_actions_cache_usage_by_repository_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsCacheUsageByRepositoryGetResponse 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 repository_cache_usages property + repository_cache_usages []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsageByRepositoryable + // The total_count property + total_count *int32 +} +// NewItemActionsCacheUsageByRepositoryGetResponse instantiates a new ItemActionsCacheUsageByRepositoryGetResponse and sets the default values. +func NewItemActionsCacheUsageByRepositoryGetResponse()(*ItemActionsCacheUsageByRepositoryGetResponse) { + m := &ItemActionsCacheUsageByRepositoryGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsCacheUsageByRepositoryGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsCacheUsageByRepositoryGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsCacheUsageByRepositoryGetResponse(), 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 *ItemActionsCacheUsageByRepositoryGetResponse) 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 *ItemActionsCacheUsageByRepositoryGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repository_cache_usages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsCacheUsageByRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsageByRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsageByRepositoryable) + } + } + m.SetRepositoryCacheUsages(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 +} +// GetRepositoryCacheUsages gets the repository_cache_usages property value. The repository_cache_usages property +// returns a []ActionsCacheUsageByRepositoryable when successful +func (m *ItemActionsCacheUsageByRepositoryGetResponse) GetRepositoryCacheUsages()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsageByRepositoryable) { + return m.repository_cache_usages +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsCacheUsageByRepositoryGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsCacheUsageByRepositoryGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositoryCacheUsages() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositoryCacheUsages())) + for i, v := range m.GetRepositoryCacheUsages() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repository_cache_usages", 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 *ItemActionsCacheUsageByRepositoryGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositoryCacheUsages sets the repository_cache_usages property value. The repository_cache_usages property +func (m *ItemActionsCacheUsageByRepositoryGetResponse) SetRepositoryCacheUsages(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsageByRepositoryable)() { + m.repository_cache_usages = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsCacheUsageByRepositoryGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsCacheUsageByRepositoryGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositoryCacheUsages()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsageByRepositoryable) + GetTotalCount()(*int32) + SetRepositoryCacheUsages(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsageByRepositoryable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_actions_cache_usage_by_repository_request_builder.go b/pkg/github/orgs/item_actions_cache_usage_by_repository_request_builder.go new file mode 100644 index 00000000..fb138ed4 --- /dev/null +++ b/pkg/github/orgs/item_actions_cache_usage_by_repository_request_builder.go @@ -0,0 +1,63 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsCacheUsageByRepositoryRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\cache\usage-by-repository +type ItemActionsCacheUsageByRepositoryRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsCacheUsageByRepositoryRequestBuilderGetQueryParameters lists repositories and their GitHub Actions cache usage for an organization.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +type ItemActionsCacheUsageByRepositoryRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemActionsCacheUsageByRepositoryRequestBuilderInternal instantiates a new ItemActionsCacheUsageByRepositoryRequestBuilder and sets the default values. +func NewItemActionsCacheUsageByRepositoryRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheUsageByRepositoryRequestBuilder) { + m := &ItemActionsCacheUsageByRepositoryRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/cache/usage-by-repository{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsCacheUsageByRepositoryRequestBuilder instantiates a new ItemActionsCacheUsageByRepositoryRequestBuilder and sets the default values. +func NewItemActionsCacheUsageByRepositoryRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheUsageByRepositoryRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsCacheUsageByRepositoryRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repositories and their GitHub Actions cache usage for an organization.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// returns a ItemActionsCacheUsageByRepositoryGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#list-repositories-with-github-actions-cache-usage-for-an-organization +func (m *ItemActionsCacheUsageByRepositoryRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsCacheUsageByRepositoryRequestBuilderGetQueryParameters])(ItemActionsCacheUsageByRepositoryGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsCacheUsageByRepositoryGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsCacheUsageByRepositoryGetResponseable), nil +} +// ToGetRequestInformation lists repositories and their GitHub Actions cache usage for an organization.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsCacheUsageByRepositoryRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsCacheUsageByRepositoryRequestBuilderGetQueryParameters])(*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 *ItemActionsCacheUsageByRepositoryRequestBuilder when successful +func (m *ItemActionsCacheUsageByRepositoryRequestBuilder) WithUrl(rawUrl string)(*ItemActionsCacheUsageByRepositoryRequestBuilder) { + return NewItemActionsCacheUsageByRepositoryRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_cache_usage_request_builder.go b/pkg/github/orgs/item_actions_cache_usage_request_builder.go new file mode 100644 index 00000000..10ea7c48 --- /dev/null +++ b/pkg/github/orgs/item_actions_cache_usage_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsCacheUsageRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\cache\usage +type ItemActionsCacheUsageRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsCacheUsageRequestBuilderInternal instantiates a new ItemActionsCacheUsageRequestBuilder and sets the default values. +func NewItemActionsCacheUsageRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheUsageRequestBuilder) { + m := &ItemActionsCacheUsageRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/cache/usage", pathParameters), + } + return m +} +// NewItemActionsCacheUsageRequestBuilder instantiates a new ItemActionsCacheUsageRequestBuilder and sets the default values. +func NewItemActionsCacheUsageRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsCacheUsageRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsCacheUsageRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the total GitHub Actions cache usage for an organization.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// returns a ActionsCacheUsageOrgEnterpriseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#get-github-actions-cache-usage-for-an-organization +func (m *ItemActionsCacheUsageRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsageOrgEnterpriseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsCacheUsageOrgEnterpriseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsageOrgEnterpriseable), nil +} +// ToGetRequestInformation gets the total GitHub Actions cache usage for an organization.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.OAuth tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsCacheUsageRequestBuilder) 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 *ItemActionsCacheUsageRequestBuilder when successful +func (m *ItemActionsCacheUsageRequestBuilder) WithUrl(rawUrl string)(*ItemActionsCacheUsageRequestBuilder) { + return NewItemActionsCacheUsageRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_oidc_customization_request_builder.go b/pkg/github/orgs/item_actions_oidc_customization_request_builder.go new file mode 100644 index 00000000..febf2ccb --- /dev/null +++ b/pkg/github/orgs/item_actions_oidc_customization_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsOidcCustomizationRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\oidc\customization +type ItemActionsOidcCustomizationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsOidcCustomizationRequestBuilderInternal instantiates a new ItemActionsOidcCustomizationRequestBuilder and sets the default values. +func NewItemActionsOidcCustomizationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsOidcCustomizationRequestBuilder) { + m := &ItemActionsOidcCustomizationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/oidc/customization", pathParameters), + } + return m +} +// NewItemActionsOidcCustomizationRequestBuilder instantiates a new ItemActionsOidcCustomizationRequestBuilder and sets the default values. +func NewItemActionsOidcCustomizationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsOidcCustomizationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsOidcCustomizationRequestBuilderInternal(urlParams, requestAdapter) +} +// Sub the sub property +// returns a *ItemActionsOidcCustomizationSubRequestBuilder when successful +func (m *ItemActionsOidcCustomizationRequestBuilder) Sub()(*ItemActionsOidcCustomizationSubRequestBuilder) { + return NewItemActionsOidcCustomizationSubRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/orgs/item_actions_oidc_customization_sub_request_builder.go b/pkg/github/orgs/item_actions_oidc_customization_sub_request_builder.go new file mode 100644 index 00000000..c1e33d3e --- /dev/null +++ b/pkg/github/orgs/item_actions_oidc_customization_sub_request_builder.go @@ -0,0 +1,94 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsOidcCustomizationSubRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\oidc\customization\sub +type ItemActionsOidcCustomizationSubRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsOidcCustomizationSubRequestBuilderInternal instantiates a new ItemActionsOidcCustomizationSubRequestBuilder and sets the default values. +func NewItemActionsOidcCustomizationSubRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsOidcCustomizationSubRequestBuilder) { + m := &ItemActionsOidcCustomizationSubRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/oidc/customization/sub", pathParameters), + } + return m +} +// NewItemActionsOidcCustomizationSubRequestBuilder instantiates a new ItemActionsOidcCustomizationSubRequestBuilder and sets the default values. +func NewItemActionsOidcCustomizationSubRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsOidcCustomizationSubRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsOidcCustomizationSubRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the customization template for an OpenID Connect (OIDC) subject claim.OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// returns a OidcCustomSubable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-an-organization +func (m *ItemActionsOidcCustomizationSubRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OidcCustomSubable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOidcCustomSubFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OidcCustomSubable), nil +} +// Put creates or updates the customization template for an OpenID Connect (OIDC) subject claim.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a EmptyObjectable 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/enterprise-server@3.14/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-an-organization +func (m *ItemActionsOidcCustomizationSubRequestBuilder) Put(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OidcCustomSubable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToGetRequestInformation gets the customization template for an OpenID Connect (OIDC) subject claim.OAuth app tokens and personal access tokens (classic) need the `read:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsOidcCustomizationSubRequestBuilder) 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 +} +// ToPutRequestInformation creates or updates the customization template for an OpenID Connect (OIDC) subject claim.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsOidcCustomizationSubRequestBuilder) ToPutRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OidcCustomSubable, 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 *ItemActionsOidcCustomizationSubRequestBuilder when successful +func (m *ItemActionsOidcCustomizationSubRequestBuilder) WithUrl(rawUrl string)(*ItemActionsOidcCustomizationSubRequestBuilder) { + return NewItemActionsOidcCustomizationSubRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_oidc_request_builder.go b/pkg/github/orgs/item_actions_oidc_request_builder.go new file mode 100644 index 00000000..961dff29 --- /dev/null +++ b/pkg/github/orgs/item_actions_oidc_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsOidcRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\oidc +type ItemActionsOidcRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsOidcRequestBuilderInternal instantiates a new ItemActionsOidcRequestBuilder and sets the default values. +func NewItemActionsOidcRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsOidcRequestBuilder) { + m := &ItemActionsOidcRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/oidc", pathParameters), + } + return m +} +// NewItemActionsOidcRequestBuilder instantiates a new ItemActionsOidcRequestBuilder and sets the default values. +func NewItemActionsOidcRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsOidcRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsOidcRequestBuilderInternal(urlParams, requestAdapter) +} +// Customization the customization property +// returns a *ItemActionsOidcCustomizationRequestBuilder when successful +func (m *ItemActionsOidcRequestBuilder) Customization()(*ItemActionsOidcCustomizationRequestBuilder) { + return NewItemActionsOidcCustomizationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/orgs/item_actions_permissions_put_request_body.go b/pkg/github/orgs/item_actions_permissions_put_request_body.go new file mode 100644 index 00000000..e10868fc --- /dev/null +++ b/pkg/github/orgs/item_actions_permissions_put_request_body.go @@ -0,0 +1,112 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsPermissionsPutRequestBody 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 permissions policy that controls the actions that are allowed to run. + allowed_actions *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions + // The policy that controls the repositories in the organization that are allowed to run GitHub Actions. + enabled_repositories *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnabledRepositories +} +// NewItemActionsPermissionsPutRequestBody instantiates a new ItemActionsPermissionsPutRequestBody and sets the default values. +func NewItemActionsPermissionsPutRequestBody()(*ItemActionsPermissionsPutRequestBody) { + m := &ItemActionsPermissionsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsPermissionsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsPermissionsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsPermissionsPutRequestBody(), 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 *ItemActionsPermissionsPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedActions gets the allowed_actions property value. The permissions policy that controls the actions that are allowed to run. +// returns a *AllowedActions when successful +func (m *ItemActionsPermissionsPutRequestBody) GetAllowedActions()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions) { + return m.allowed_actions +} +// GetEnabledRepositories gets the enabled_repositories property value. The policy that controls the repositories in the organization that are allowed to run GitHub Actions. +// returns a *EnabledRepositories when successful +func (m *ItemActionsPermissionsPutRequestBody) GetEnabledRepositories()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnabledRepositories) { + return m.enabled_repositories +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsPermissionsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_actions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParseAllowedActions) + if err != nil { + return err + } + if val != nil { + m.SetAllowedActions(val.(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions)) + } + return nil + } + res["enabled_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParseEnabledRepositories) + if err != nil { + return err + } + if val != nil { + m.SetEnabledRepositories(val.(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnabledRepositories)) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemActionsPermissionsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedActions() != nil { + cast := (*m.GetAllowedActions()).String() + err := writer.WriteStringValue("allowed_actions", &cast) + if err != nil { + return err + } + } + if m.GetEnabledRepositories() != nil { + cast := (*m.GetEnabledRepositories()).String() + err := writer.WriteStringValue("enabled_repositories", &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 *ItemActionsPermissionsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedActions sets the allowed_actions property value. The permissions policy that controls the actions that are allowed to run. +func (m *ItemActionsPermissionsPutRequestBody) SetAllowedActions(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions)() { + m.allowed_actions = value +} +// SetEnabledRepositories sets the enabled_repositories property value. The policy that controls the repositories in the organization that are allowed to run GitHub Actions. +func (m *ItemActionsPermissionsPutRequestBody) SetEnabledRepositories(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnabledRepositories)() { + m.enabled_repositories = value +} +type ItemActionsPermissionsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedActions()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions) + GetEnabledRepositories()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnabledRepositories) + SetAllowedActions(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions)() + SetEnabledRepositories(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnabledRepositories)() +} diff --git a/pkg/github/orgs/item_actions_permissions_repositories_get_response.go b/pkg/github/orgs/item_actions_permissions_repositories_get_response.go new file mode 100644 index 00000000..13a69561 --- /dev/null +++ b/pkg/github/orgs/item_actions_permissions_repositories_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsPermissionsRepositoriesGetResponse 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 repositories property + repositories []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable + // The total_count property + total_count *float64 +} +// NewItemActionsPermissionsRepositoriesGetResponse instantiates a new ItemActionsPermissionsRepositoriesGetResponse and sets the default values. +func NewItemActionsPermissionsRepositoriesGetResponse()(*ItemActionsPermissionsRepositoriesGetResponse) { + m := &ItemActionsPermissionsRepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsPermissionsRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsPermissionsRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsPermissionsRepositoriesGetResponse(), 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 *ItemActionsPermissionsRepositoriesGetResponse) 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 *ItemActionsPermissionsRepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []Repositoryable when successful +func (m *ItemActionsPermissionsRepositoriesGetResponse) GetRepositories()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable) { + return m.repositories +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *float64 when successful +func (m *ItemActionsPermissionsRepositoriesGetResponse) GetTotalCount()(*float64) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsPermissionsRepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("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 *ItemActionsPermissionsRepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *ItemActionsPermissionsRepositoriesGetResponse) SetRepositories(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable)() { + m.repositories = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsPermissionsRepositoriesGetResponse) SetTotalCount(value *float64)() { + m.total_count = value +} +type ItemActionsPermissionsRepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable) + GetTotalCount()(*float64) + SetRepositories(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable)() + SetTotalCount(value *float64)() +} diff --git a/pkg/github/orgs/item_actions_permissions_repositories_put_request_body.go b/pkg/github/orgs/item_actions_permissions_repositories_put_request_body.go new file mode 100644 index 00000000..4c47be7c --- /dev/null +++ b/pkg/github/orgs/item_actions_permissions_repositories_put_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsPermissionsRepositoriesPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // List of repository IDs to enable for GitHub Actions. + selected_repository_ids []int32 +} +// NewItemActionsPermissionsRepositoriesPutRequestBody instantiates a new ItemActionsPermissionsRepositoriesPutRequestBody and sets the default values. +func NewItemActionsPermissionsRepositoriesPutRequestBody()(*ItemActionsPermissionsRepositoriesPutRequestBody) { + m := &ItemActionsPermissionsRepositoriesPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsPermissionsRepositoriesPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsPermissionsRepositoriesPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsPermissionsRepositoriesPutRequestBody(), 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 *ItemActionsPermissionsRepositoriesPutRequestBody) 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 *ItemActionsPermissionsRepositoriesPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 + } + return res +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. List of repository IDs to enable for GitHub Actions. +// returns a []int32 when successful +func (m *ItemActionsPermissionsRepositoriesPutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemActionsPermissionsRepositoriesPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *ItemActionsPermissionsRepositoriesPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. List of repository IDs to enable for GitHub Actions. +func (m *ItemActionsPermissionsRepositoriesPutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type ItemActionsPermissionsRepositoriesPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedRepositoryIds()([]int32) + SetSelectedRepositoryIds(value []int32)() +} diff --git a/pkg/github/orgs/item_actions_permissions_repositories_request_builder.go b/pkg/github/orgs/item_actions_permissions_repositories_request_builder.go new file mode 100644 index 00000000..754bf02b --- /dev/null +++ b/pkg/github/orgs/item_actions_permissions_repositories_request_builder.go @@ -0,0 +1,100 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsPermissionsRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\permissions\repositories +type ItemActionsPermissionsRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsPermissionsRepositoriesRequestBuilderGetQueryParameters lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemActionsPermissionsRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRepository_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.actions.permissions.repositories.item collection +// returns a *ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemActionsPermissionsRepositoriesRequestBuilder) ByRepository_id(repository_id int32)(*ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["repository_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(repository_id), 10) + return NewItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsPermissionsRepositoriesRequestBuilderInternal instantiates a new ItemActionsPermissionsRepositoriesRequestBuilder and sets the default values. +func NewItemActionsPermissionsRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsRepositoriesRequestBuilder) { + m := &ItemActionsPermissionsRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/permissions/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsPermissionsRepositoriesRequestBuilder instantiates a new ItemActionsPermissionsRepositoriesRequestBuilder and sets the default values. +func NewItemActionsPermissionsRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemActionsPermissionsRepositoriesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#list-selected-repositories-enabled-for-github-actions-in-an-organization +func (m *ItemActionsPermissionsRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsPermissionsRepositoriesRequestBuilderGetQueryParameters])(ItemActionsPermissionsRepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsPermissionsRepositoriesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsPermissionsRepositoriesGetResponseable), nil +} +// Put replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#set-selected-repositories-enabled-for-github-actions-in-an-organization +func (m *ItemActionsPermissionsRepositoriesRequestBuilder) Put(ctx context.Context, body ItemActionsPermissionsRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists the selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsPermissionsRepositoriesRequestBuilderGetQueryParameters])(*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 +} +// ToPutRequestInformation replaces the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsRepositoriesRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsPermissionsRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsPermissionsRepositoriesRequestBuilder when successful +func (m *ItemActionsPermissionsRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsRepositoriesRequestBuilder) { + return NewItemActionsPermissionsRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_permissions_repositories_with_repository_escaped_item_request_builder.go b/pkg/github/orgs/item_actions_permissions_repositories_with_repository_escaped_item_request_builder.go new file mode 100644 index 00000000..505e0b19 --- /dev/null +++ b/pkg/github/orgs/item_actions_permissions_repositories_with_repository_escaped_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\permissions\repositories\{repository_id} +type ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilderInternal instantiates a new ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) { + m := &ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/permissions/repositories/{repository_id}", pathParameters), + } + return m +} +// NewItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder instantiates a new ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#disable-a-selected-repository-for-github-actions-in-an-organization +func (m *ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#enable-a-selected-repository-for-github-actions-in-an-organization +func (m *ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a repository from the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsRepositoriesWithRepository_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) + return requestInfo, nil +} +// ToPutRequestInformation adds a repository to the list of selected repositories that are enabled for GitHub Actions in an organization. To use this endpoint, the organization permission policy for `enabled_repositories` must be must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder) { + return NewItemActionsPermissionsRepositoriesWithRepository_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_permissions_request_builder.go b/pkg/github/orgs/item_actions_permissions_request_builder.go new file mode 100644 index 00000000..971b1190 --- /dev/null +++ b/pkg/github/orgs/item_actions_permissions_request_builder.go @@ -0,0 +1,98 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsPermissionsRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\permissions +type ItemActionsPermissionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsPermissionsRequestBuilderInternal instantiates a new ItemActionsPermissionsRequestBuilder and sets the default values. +func NewItemActionsPermissionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsRequestBuilder) { + m := &ItemActionsPermissionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/permissions", pathParameters), + } + return m +} +// NewItemActionsPermissionsRequestBuilder instantiates a new ItemActionsPermissionsRequestBuilder and sets the default values. +func NewItemActionsPermissionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the GitHub Actions permissions policy for repositories and allowed actions in an organization.You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. +// returns a ActionsOrganizationPermissionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#get-github-actions-permissions-for-an-organization +func (m *ItemActionsPermissionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsOrganizationPermissionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsOrganizationPermissionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsOrganizationPermissionsable), nil +} +// Put sets the GitHub Actions permissions policy for repositories and allowed actions in an organization.If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as `allowed_actions` to `selected` actions, then you cannot override them for the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#set-github-actions-permissions-for-an-organization +func (m *ItemActionsPermissionsRequestBuilder) Put(ctx context.Context, body ItemActionsPermissionsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Repositories the repositories property +// returns a *ItemActionsPermissionsRepositoriesRequestBuilder when successful +func (m *ItemActionsPermissionsRequestBuilder) Repositories()(*ItemActionsPermissionsRepositoriesRequestBuilder) { + return NewItemActionsPermissionsRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SelectedActions the selectedActions property +// returns a *ItemActionsPermissionsSelectedActionsRequestBuilder when successful +func (m *ItemActionsPermissionsRequestBuilder) SelectedActions()(*ItemActionsPermissionsSelectedActionsRequestBuilder) { + return NewItemActionsPermissionsSelectedActionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets the GitHub Actions permissions policy for repositories and allowed actions in an organization.You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsRequestBuilder) 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 +} +// ToPutRequestInformation sets the GitHub Actions permissions policy for repositories and allowed actions in an organization.If the organization belongs to an enterprise that has set restrictive permissions at the enterprise level, such as `allowed_actions` to `selected` actions, then you cannot override them for the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsPermissionsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsPermissionsRequestBuilder when successful +func (m *ItemActionsPermissionsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsRequestBuilder) { + return NewItemActionsPermissionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} +// Workflow the workflow property +// returns a *ItemActionsPermissionsWorkflowRequestBuilder when successful +func (m *ItemActionsPermissionsRequestBuilder) Workflow()(*ItemActionsPermissionsWorkflowRequestBuilder) { + return NewItemActionsPermissionsWorkflowRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/orgs/item_actions_permissions_selected_actions_request_builder.go b/pkg/github/orgs/item_actions_permissions_selected_actions_request_builder.go new file mode 100644 index 00000000..6cec0003 --- /dev/null +++ b/pkg/github/orgs/item_actions_permissions_selected_actions_request_builder.go @@ -0,0 +1,83 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsPermissionsSelectedActionsRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\permissions\selected-actions +type ItemActionsPermissionsSelectedActionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsPermissionsSelectedActionsRequestBuilderInternal instantiates a new ItemActionsPermissionsSelectedActionsRequestBuilder and sets the default values. +func NewItemActionsPermissionsSelectedActionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsSelectedActionsRequestBuilder) { + m := &ItemActionsPermissionsSelectedActionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/permissions/selected-actions", pathParameters), + } + return m +} +// NewItemActionsPermissionsSelectedActionsRequestBuilder instantiates a new ItemActionsPermissionsSelectedActionsRequestBuilder and sets the default values. +func NewItemActionsPermissionsSelectedActionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsSelectedActionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsSelectedActionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).""You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. +// returns a SelectedActionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-an-organization +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SelectedActionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSelectedActionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SelectedActionsable), nil +} +// Put sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."If the organization belongs to an enterprise that has `selected` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings.To use the `patterns_allowed` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-an-organization +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) Put(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SelectedActionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets the selected actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization).""You must authenticate using an access token with the `admin:org` scope to use this endpoint. GitHub Apps must have the `administration` organization permission to use this API. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) 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 +} +// ToPutRequestInformation sets the actions that are allowed in an organization. To use this endpoint, the organization permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for an organization](#set-github-actions-permissions-for-an-organization)."If the organization belongs to an enterprise that has `selected` actions set at the enterprise level, then you cannot override any of the enterprise's allowed actions settings.To use the `patterns_allowed` setting for private repositories, the organization must belong to an enterprise. If the organization does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SelectedActionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsPermissionsSelectedActionsRequestBuilder when successful +func (m *ItemActionsPermissionsSelectedActionsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsSelectedActionsRequestBuilder) { + return NewItemActionsPermissionsSelectedActionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_permissions_workflow_request_builder.go b/pkg/github/orgs/item_actions_permissions_workflow_request_builder.go new file mode 100644 index 00000000..c6e734ad --- /dev/null +++ b/pkg/github/orgs/item_actions_permissions_workflow_request_builder.go @@ -0,0 +1,83 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsPermissionsWorkflowRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\permissions\workflow +type ItemActionsPermissionsWorkflowRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsPermissionsWorkflowRequestBuilderInternal instantiates a new ItemActionsPermissionsWorkflowRequestBuilder and sets the default values. +func NewItemActionsPermissionsWorkflowRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsWorkflowRequestBuilder) { + m := &ItemActionsPermissionsWorkflowRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/permissions/workflow", pathParameters), + } + return m +} +// NewItemActionsPermissionsWorkflowRequestBuilder instantiates a new ItemActionsPermissionsWorkflowRequestBuilder and sets the default values. +func NewItemActionsPermissionsWorkflowRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsPermissionsWorkflowRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsPermissionsWorkflowRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization,as well as whether GitHub Actions can submit approving pull request reviews. For more information, see"[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ActionsGetDefaultWorkflowPermissionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#get-default-workflow-permissions-for-an-organization +func (m *ItemActionsPermissionsWorkflowRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsGetDefaultWorkflowPermissionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsGetDefaultWorkflowPermissionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsGetDefaultWorkflowPermissionsable), nil +} +// Put sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actionscan submit approving pull request reviews. For more information, see"[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#set-default-workflow-permissions-for-an-organization +func (m *ItemActionsPermissionsWorkflowRequestBuilder) Put(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSetDefaultWorkflowPermissionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization,as well as whether GitHub Actions can submit approving pull request reviews. For more information, see"[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsWorkflowRequestBuilder) 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 +} +// ToPutRequestInformation sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in an organization, and sets if GitHub Actionscan submit approving pull request reviews. For more information, see"[Setting the permissions of the GITHUB_TOKEN for your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-organization-settings/disabling-or-limiting-github-actions-for-your-organization#setting-the-permissions-of-the-github_token-for-your-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsPermissionsWorkflowRequestBuilder) ToPutRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSetDefaultWorkflowPermissionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsPermissionsWorkflowRequestBuilder when successful +func (m *ItemActionsPermissionsWorkflowRequestBuilder) WithUrl(rawUrl string)(*ItemActionsPermissionsWorkflowRequestBuilder) { + return NewItemActionsPermissionsWorkflowRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_request_builder.go b/pkg/github/orgs/item_actions_request_builder.go new file mode 100644 index 00000000..36a9844f --- /dev/null +++ b/pkg/github/orgs/item_actions_request_builder.go @@ -0,0 +1,58 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsRequestBuilder builds and executes requests for operations under \orgs\{org}\actions +type ItemActionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Cache the cache property +// returns a *ItemActionsCacheRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Cache()(*ItemActionsCacheRequestBuilder) { + return NewItemActionsCacheRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRequestBuilderInternal instantiates a new ItemActionsRequestBuilder and sets the default values. +func NewItemActionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRequestBuilder) { + m := &ItemActionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions", pathParameters), + } + return m +} +// NewItemActionsRequestBuilder instantiates a new ItemActionsRequestBuilder and sets the default values. +func NewItemActionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Oidc the oidc property +// returns a *ItemActionsOidcRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Oidc()(*ItemActionsOidcRequestBuilder) { + return NewItemActionsOidcRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Permissions the permissions property +// returns a *ItemActionsPermissionsRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Permissions()(*ItemActionsPermissionsRequestBuilder) { + return NewItemActionsPermissionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// RunnerGroups the runnerGroups property +// returns a *ItemActionsRunnerGroupsRequestBuilder when successful +func (m *ItemActionsRequestBuilder) RunnerGroups()(*ItemActionsRunnerGroupsRequestBuilder) { + return NewItemActionsRunnerGroupsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Runners the runners property +// returns a *ItemActionsRunnersRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Runners()(*ItemActionsRunnersRequestBuilder) { + return NewItemActionsRunnersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Secrets the secrets property +// returns a *ItemActionsSecretsRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Secrets()(*ItemActionsSecretsRequestBuilder) { + return NewItemActionsSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Variables the variables property +// returns a *ItemActionsVariablesRequestBuilder when successful +func (m *ItemActionsRequestBuilder) Variables()(*ItemActionsVariablesRequestBuilder) { + return NewItemActionsVariablesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/orgs/item_actions_runner_groups_get_response.go b/pkg/github/orgs/item_actions_runner_groups_get_response.go new file mode 100644 index 00000000..9b9e9fcd --- /dev/null +++ b/pkg/github/orgs/item_actions_runner_groups_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnerGroupsGetResponse 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 runner_groups property + runner_groups []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsOrgable + // The total_count property + total_count *float64 +} +// NewItemActionsRunnerGroupsGetResponse instantiates a new ItemActionsRunnerGroupsGetResponse and sets the default values. +func NewItemActionsRunnerGroupsGetResponse()(*ItemActionsRunnerGroupsGetResponse) { + m := &ItemActionsRunnerGroupsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnerGroupsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnerGroupsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnerGroupsGetResponse(), 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 *ItemActionsRunnerGroupsGetResponse) 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 *ItemActionsRunnerGroupsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["runner_groups"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerGroupsOrgFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsOrgable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsOrgable) + } + } + m.SetRunnerGroups(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRunnerGroups gets the runner_groups property value. The runner_groups property +// returns a []RunnerGroupsOrgable when successful +func (m *ItemActionsRunnerGroupsGetResponse) GetRunnerGroups()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsOrgable) { + return m.runner_groups +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *float64 when successful +func (m *ItemActionsRunnerGroupsGetResponse) GetTotalCount()(*float64) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnerGroupsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRunnerGroups() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRunnerGroups())) + for i, v := range m.GetRunnerGroups() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("runner_groups", cast) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("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 *ItemActionsRunnerGroupsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRunnerGroups sets the runner_groups property value. The runner_groups property +func (m *ItemActionsRunnerGroupsGetResponse) SetRunnerGroups(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsOrgable)() { + m.runner_groups = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnerGroupsGetResponse) SetTotalCount(value *float64)() { + m.total_count = value +} +type ItemActionsRunnerGroupsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRunnerGroups()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsOrgable) + GetTotalCount()(*float64) + SetRunnerGroups(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsOrgable)() + SetTotalCount(value *float64)() +} diff --git a/pkg/github/orgs/item_actions_runner_groups_item_repositories_get_response.go b/pkg/github/orgs/item_actions_runner_groups_item_repositories_get_response.go new file mode 100644 index 00000000..34828128 --- /dev/null +++ b/pkg/github/orgs/item_actions_runner_groups_item_repositories_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnerGroupsItemRepositoriesGetResponse 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 repositories property + repositories []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable + // The total_count property + total_count *float64 +} +// NewItemActionsRunnerGroupsItemRepositoriesGetResponse instantiates a new ItemActionsRunnerGroupsItemRepositoriesGetResponse and sets the default values. +func NewItemActionsRunnerGroupsItemRepositoriesGetResponse()(*ItemActionsRunnerGroupsItemRepositoriesGetResponse) { + m := &ItemActionsRunnerGroupsItemRepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnerGroupsItemRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnerGroupsItemRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnerGroupsItemRepositoriesGetResponse(), 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 *ItemActionsRunnerGroupsItemRepositoriesGetResponse) 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 *ItemActionsRunnerGroupsItemRepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []MinimalRepositoryable when successful +func (m *ItemActionsRunnerGroupsItemRepositoriesGetResponse) GetRepositories()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) { + return m.repositories +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *float64 when successful +func (m *ItemActionsRunnerGroupsItemRepositoriesGetResponse) GetTotalCount()(*float64) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnerGroupsItemRepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("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 *ItemActionsRunnerGroupsItemRepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *ItemActionsRunnerGroupsItemRepositoriesGetResponse) SetRepositories(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable)() { + m.repositories = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnerGroupsItemRepositoriesGetResponse) SetTotalCount(value *float64)() { + m.total_count = value +} +type ItemActionsRunnerGroupsItemRepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + GetTotalCount()(*float64) + SetRepositories(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable)() + SetTotalCount(value *float64)() +} diff --git a/pkg/github/orgs/item_actions_runner_groups_item_repositories_put_request_body.go b/pkg/github/orgs/item_actions_runner_groups_item_repositories_put_request_body.go new file mode 100644 index 00000000..2a09f1ad --- /dev/null +++ b/pkg/github/orgs/item_actions_runner_groups_item_repositories_put_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnerGroupsItemRepositoriesPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // List of repository IDs that can access the runner group. + selected_repository_ids []int32 +} +// NewItemActionsRunnerGroupsItemRepositoriesPutRequestBody instantiates a new ItemActionsRunnerGroupsItemRepositoriesPutRequestBody and sets the default values. +func NewItemActionsRunnerGroupsItemRepositoriesPutRequestBody()(*ItemActionsRunnerGroupsItemRepositoriesPutRequestBody) { + m := &ItemActionsRunnerGroupsItemRepositoriesPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnerGroupsItemRepositoriesPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnerGroupsItemRepositoriesPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnerGroupsItemRepositoriesPutRequestBody(), 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 *ItemActionsRunnerGroupsItemRepositoriesPutRequestBody) 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 *ItemActionsRunnerGroupsItemRepositoriesPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 + } + return res +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. List of repository IDs that can access the runner group. +// returns a []int32 when successful +func (m *ItemActionsRunnerGroupsItemRepositoriesPutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemActionsRunnerGroupsItemRepositoriesPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *ItemActionsRunnerGroupsItemRepositoriesPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. List of repository IDs that can access the runner group. +func (m *ItemActionsRunnerGroupsItemRepositoriesPutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type ItemActionsRunnerGroupsItemRepositoriesPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedRepositoryIds()([]int32) + SetSelectedRepositoryIds(value []int32)() +} diff --git a/pkg/github/orgs/item_actions_runner_groups_item_repositories_request_builder.go b/pkg/github/orgs/item_actions_runner_groups_item_repositories_request_builder.go new file mode 100644 index 00000000..3f0ab827 --- /dev/null +++ b/pkg/github/orgs/item_actions_runner_groups_item_repositories_request_builder.go @@ -0,0 +1,100 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsRunnerGroupsItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runner-groups\{runner_group_id}\repositories +type ItemActionsRunnerGroupsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsRunnerGroupsItemRepositoriesRequestBuilderGetQueryParameters lists the repositories with access to a self-hosted runner group configured in an organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemActionsRunnerGroupsItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRepository_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.actions.runnerGroups.item.repositories.item collection +// returns a *ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemActionsRunnerGroupsItemRepositoriesRequestBuilder) ByRepository_id(repository_id int32)(*ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["repository_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(repository_id), 10) + return NewItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRunnerGroupsItemRepositoriesRequestBuilderInternal instantiates a new ItemActionsRunnerGroupsItemRepositoriesRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemRepositoriesRequestBuilder) { + m := &ItemActionsRunnerGroupsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsRunnerGroupsItemRepositoriesRequestBuilder instantiates a new ItemActionsRunnerGroupsItemRepositoriesRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnerGroupsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the repositories with access to a self-hosted runner group configured in an organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemActionsRunnerGroupsItemRepositoriesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#list-repository-access-to-a-self-hosted-runner-group-in-an-organization +func (m *ItemActionsRunnerGroupsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnerGroupsItemRepositoriesRequestBuilderGetQueryParameters])(ItemActionsRunnerGroupsItemRepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnerGroupsItemRepositoriesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnerGroupsItemRepositoriesGetResponseable), nil +} +// Put replaces the list of repositories that have access to a self-hosted runner group configured in an organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#set-repository-access-for-a-self-hosted-runner-group-in-an-organization +func (m *ItemActionsRunnerGroupsItemRepositoriesRequestBuilder) Put(ctx context.Context, body ItemActionsRunnerGroupsItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists the repositories with access to a self-hosted runner group configured in an organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnerGroupsItemRepositoriesRequestBuilderGetQueryParameters])(*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 +} +// ToPutRequestInformation replaces the list of repositories that have access to a self-hosted runner group configured in an organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemRepositoriesRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsRunnerGroupsItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsRunnerGroupsItemRepositoriesRequestBuilder when successful +func (m *ItemActionsRunnerGroupsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnerGroupsItemRepositoriesRequestBuilder) { + return NewItemActionsRunnerGroupsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_runner_groups_item_repositories_with_repository_escaped_item_request_builder.go b/pkg/github/orgs/item_actions_runner_groups_item_repositories_with_repository_escaped_item_request_builder.go new file mode 100644 index 00000000..26efc070 --- /dev/null +++ b/pkg/github/orgs/item_actions_runner_groups_item_repositories_with_repository_escaped_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runner-groups\{runner_group_id}\repositories\{repository_id} +type ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilderInternal instantiates a new ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder) { + m := &ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_id}/repositories/{repository_id}", pathParameters), + } + return m +} +// NewItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder instantiates a new ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#remove-repository-access-to-a-self-hosted-runner-group-in-an-organization +func (m *ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#add-repository-access-to-a-self-hosted-runner-group-in-an-organization +func (m *ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a repository from the list of selected repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)."OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemRepositoriesWithRepository_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) + return requestInfo, nil +} +// ToPutRequestInformation adds a repository to the list of repositories that can access a self-hosted runner group. The runner group must have `visibility` set to `selected`. For more information, see "[Create a self-hosted runner group for an organization](#create-a-self-hosted-runner-group-for-an-organization)."OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder) { + return NewItemActionsRunnerGroupsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_runner_groups_item_runners_get_response.go b/pkg/github/orgs/item_actions_runner_groups_item_runners_get_response.go new file mode 100644 index 00000000..33fd73f0 --- /dev/null +++ b/pkg/github/orgs/item_actions_runner_groups_item_runners_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnerGroupsItemRunnersGetResponse 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 runners property + runners []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable + // The total_count property + total_count *float64 +} +// NewItemActionsRunnerGroupsItemRunnersGetResponse instantiates a new ItemActionsRunnerGroupsItemRunnersGetResponse and sets the default values. +func NewItemActionsRunnerGroupsItemRunnersGetResponse()(*ItemActionsRunnerGroupsItemRunnersGetResponse) { + m := &ItemActionsRunnerGroupsItemRunnersGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnerGroupsItemRunnersGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnerGroupsItemRunnersGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnerGroupsItemRunnersGetResponse(), 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 *ItemActionsRunnerGroupsItemRunnersGetResponse) 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 *ItemActionsRunnerGroupsItemRunnersGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["runners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) + } + } + m.SetRunners(res) + } + return nil + } + res["total_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetFloat64Value() + if err != nil { + return err + } + if val != nil { + m.SetTotalCount(val) + } + return nil + } + return res +} +// GetRunners gets the runners property value. The runners property +// returns a []Runnerable when successful +func (m *ItemActionsRunnerGroupsItemRunnersGetResponse) GetRunners()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) { + return m.runners +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *float64 when successful +func (m *ItemActionsRunnerGroupsItemRunnersGetResponse) GetTotalCount()(*float64) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnerGroupsItemRunnersGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRunners() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRunners())) + for i, v := range m.GetRunners() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("runners", cast) + if err != nil { + return err + } + } + { + err := writer.WriteFloat64Value("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 *ItemActionsRunnerGroupsItemRunnersGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRunners sets the runners property value. The runners property +func (m *ItemActionsRunnerGroupsItemRunnersGetResponse) SetRunners(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() { + m.runners = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnerGroupsItemRunnersGetResponse) SetTotalCount(value *float64)() { + m.total_count = value +} +type ItemActionsRunnerGroupsItemRunnersGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRunners()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) + GetTotalCount()(*float64) + SetRunners(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() + SetTotalCount(value *float64)() +} diff --git a/pkg/github/orgs/item_actions_runner_groups_item_runners_put_request_body.go b/pkg/github/orgs/item_actions_runner_groups_item_runners_put_request_body.go new file mode 100644 index 00000000..6d7ca4cc --- /dev/null +++ b/pkg/github/orgs/item_actions_runner_groups_item_runners_put_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnerGroupsItemRunnersPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // List of runner IDs to add to the runner group. + runners []int32 +} +// NewItemActionsRunnerGroupsItemRunnersPutRequestBody instantiates a new ItemActionsRunnerGroupsItemRunnersPutRequestBody and sets the default values. +func NewItemActionsRunnerGroupsItemRunnersPutRequestBody()(*ItemActionsRunnerGroupsItemRunnersPutRequestBody) { + m := &ItemActionsRunnerGroupsItemRunnersPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnerGroupsItemRunnersPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnerGroupsItemRunnersPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnerGroupsItemRunnersPutRequestBody(), 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 *ItemActionsRunnerGroupsItemRunnersPutRequestBody) 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 *ItemActionsRunnerGroupsItemRunnersPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["runners"] = 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.SetRunners(res) + } + return nil + } + return res +} +// GetRunners gets the runners property value. List of runner IDs to add to the runner group. +// returns a []int32 when successful +func (m *ItemActionsRunnerGroupsItemRunnersPutRequestBody) GetRunners()([]int32) { + return m.runners +} +// Serialize serializes information the current object +func (m *ItemActionsRunnerGroupsItemRunnersPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRunners() != nil { + err := writer.WriteCollectionOfInt32Values("runners", m.GetRunners()) + 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 *ItemActionsRunnerGroupsItemRunnersPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRunners sets the runners property value. List of runner IDs to add to the runner group. +func (m *ItemActionsRunnerGroupsItemRunnersPutRequestBody) SetRunners(value []int32)() { + m.runners = value +} +type ItemActionsRunnerGroupsItemRunnersPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRunners()([]int32) + SetRunners(value []int32)() +} diff --git a/pkg/github/orgs/item_actions_runner_groups_item_runners_request_builder.go b/pkg/github/orgs/item_actions_runner_groups_item_runners_request_builder.go new file mode 100644 index 00000000..ab2e2275 --- /dev/null +++ b/pkg/github/orgs/item_actions_runner_groups_item_runners_request_builder.go @@ -0,0 +1,100 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsRunnerGroupsItemRunnersRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runner-groups\{runner_group_id}\runners +type ItemActionsRunnerGroupsItemRunnersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsRunnerGroupsItemRunnersRequestBuilderGetQueryParameters lists self-hosted runners that are in a specific organization group.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemActionsRunnerGroupsItemRunnersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRunner_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.actions.runnerGroups.item.runners.item collection +// returns a *ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder when successful +func (m *ItemActionsRunnerGroupsItemRunnersRequestBuilder) ByRunner_id(runner_id int32)(*ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["runner_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(runner_id), 10) + return NewItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRunnerGroupsItemRunnersRequestBuilderInternal instantiates a new ItemActionsRunnerGroupsItemRunnersRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemRunnersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemRunnersRequestBuilder) { + m := &ItemActionsRunnerGroupsItemRunnersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_id}/runners{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsRunnerGroupsItemRunnersRequestBuilder instantiates a new ItemActionsRunnerGroupsItemRunnersRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemRunnersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemRunnersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnerGroupsItemRunnersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists self-hosted runners that are in a specific organization group.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemActionsRunnerGroupsItemRunnersGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#list-self-hosted-runners-in-a-group-for-an-organization +func (m *ItemActionsRunnerGroupsItemRunnersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnerGroupsItemRunnersRequestBuilderGetQueryParameters])(ItemActionsRunnerGroupsItemRunnersGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnerGroupsItemRunnersGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnerGroupsItemRunnersGetResponseable), nil +} +// Put replaces the list of self-hosted runners that are part of an organization runner group.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#set-self-hosted-runners-in-a-group-for-an-organization +func (m *ItemActionsRunnerGroupsItemRunnersRequestBuilder) Put(ctx context.Context, body ItemActionsRunnerGroupsItemRunnersPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists self-hosted runners that are in a specific organization group.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemRunnersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnerGroupsItemRunnersRequestBuilderGetQueryParameters])(*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 +} +// ToPutRequestInformation replaces the list of self-hosted runners that are part of an organization runner group.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemRunnersRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsRunnerGroupsItemRunnersPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsRunnerGroupsItemRunnersRequestBuilder when successful +func (m *ItemActionsRunnerGroupsItemRunnersRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnerGroupsItemRunnersRequestBuilder) { + return NewItemActionsRunnerGroupsItemRunnersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_runner_groups_item_runners_with_runner_escaped_item_request_builder.go b/pkg/github/orgs/item_actions_runner_groups_item_runners_with_runner_escaped_item_request_builder.go new file mode 100644 index 00000000..3759d452 --- /dev/null +++ b/pkg/github/orgs/item_actions_runner_groups_item_runners_with_runner_escaped_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runner-groups\{runner_group_id}\runners\{runner_id} +type ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilderInternal instantiates a new ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) { + m := &ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_id}/runners/{runner_id}", pathParameters), + } + return m +} +// NewItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder instantiates a new ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#remove-a-self-hosted-runner-from-a-group-for-an-organization +func (m *ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put adds a self-hosted runner to a runner group configured in an organization.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#add-a-self-hosted-runner-to-a-group-for-an-organization +func (m *ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a self-hosted runner from a group configured in an organization. The runner is then returned to the default group.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemRunnersWithRunner_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) + return requestInfo, nil +} +// ToPutRequestInformation adds a self-hosted runner to a runner group configured in an organization.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder when successful +func (m *ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder) { + return NewItemActionsRunnerGroupsItemRunnersWithRunner_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_runner_groups_item_with_runner_escaped_group_escaped_patch_request_body.go b/pkg/github/orgs/item_actions_runner_groups_item_with_runner_escaped_group_escaped_patch_request_body.go new file mode 100644 index 00000000..2d8bdc63 --- /dev/null +++ b/pkg/github/orgs/item_actions_runner_groups_item_with_runner_escaped_group_escaped_patch_request_body.go @@ -0,0 +1,173 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody 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 the runner group can be used by `public` repositories. + allows_public_repositories *bool + // Name of the runner group. + name *string + // If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + restricted_to_workflows *bool + // List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + selected_workflows []string +} +// NewItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody instantiates a new ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody and sets the default values. +func NewItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody()(*ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) { + m := &ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody(), 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 *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowsPublicRepositories gets the allows_public_repositories property value. Whether the runner group can be used by `public` repositories. +// returns a *bool when successful +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) GetAllowsPublicRepositories()(*bool) { + return m.allows_public_repositories +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allows_public_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowsPublicRepositories(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["restricted_to_workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRestrictedToWorkflows(val) + } + return nil + } + res["selected_workflows"] = 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.SetSelectedWorkflows(res) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the runner group. +// returns a *string when successful +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) GetName()(*string) { + return m.name +} +// GetRestrictedToWorkflows gets the restricted_to_workflows property value. If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. +// returns a *bool when successful +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) GetRestrictedToWorkflows()(*bool) { + return m.restricted_to_workflows +} +// GetSelectedWorkflows gets the selected_workflows property value. List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +// returns a []string when successful +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) GetSelectedWorkflows()([]string) { + return m.selected_workflows +} +// Serialize serializes information the current object +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allows_public_repositories", m.GetAllowsPublicRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("restricted_to_workflows", m.GetRestrictedToWorkflows()) + if err != nil { + return err + } + } + if m.GetSelectedWorkflows() != nil { + err := writer.WriteCollectionOfStringValues("selected_workflows", m.GetSelectedWorkflows()) + 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 *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowsPublicRepositories sets the allows_public_repositories property value. Whether the runner group can be used by `public` repositories. +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) SetAllowsPublicRepositories(value *bool)() { + m.allows_public_repositories = value +} +// SetName sets the name property value. Name of the runner group. +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetRestrictedToWorkflows sets the restricted_to_workflows property value. If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) SetRestrictedToWorkflows(value *bool)() { + m.restricted_to_workflows = value +} +// SetSelectedWorkflows sets the selected_workflows property value. List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +func (m *ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBody) SetSelectedWorkflows(value []string)() { + m.selected_workflows = value +} +type ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowsPublicRepositories()(*bool) + GetName()(*string) + GetRestrictedToWorkflows()(*bool) + GetSelectedWorkflows()([]string) + SetAllowsPublicRepositories(value *bool)() + SetName(value *string)() + SetRestrictedToWorkflows(value *bool)() + SetSelectedWorkflows(value []string)() +} diff --git a/pkg/github/orgs/item_actions_runner_groups_post_request_body.go b/pkg/github/orgs/item_actions_runner_groups_post_request_body.go new file mode 100644 index 00000000..08f38317 --- /dev/null +++ b/pkg/github/orgs/item_actions_runner_groups_post_request_body.go @@ -0,0 +1,243 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnerGroupsPostRequestBody 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 the runner group can be used by `public` repositories. + allows_public_repositories *bool + // Name of the runner group. + name *string + // If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. + restricted_to_workflows *bool + // List of runner IDs to add to the runner group. + runners []int32 + // List of repository IDs that can access the runner group. + selected_repository_ids []int32 + // List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. + selected_workflows []string +} +// NewItemActionsRunnerGroupsPostRequestBody instantiates a new ItemActionsRunnerGroupsPostRequestBody and sets the default values. +func NewItemActionsRunnerGroupsPostRequestBody()(*ItemActionsRunnerGroupsPostRequestBody) { + m := &ItemActionsRunnerGroupsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnerGroupsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnerGroupsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnerGroupsPostRequestBody(), 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 *ItemActionsRunnerGroupsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowsPublicRepositories gets the allows_public_repositories property value. Whether the runner group can be used by `public` repositories. +// returns a *bool when successful +func (m *ItemActionsRunnerGroupsPostRequestBody) GetAllowsPublicRepositories()(*bool) { + return m.allows_public_repositories +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnerGroupsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allows_public_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowsPublicRepositories(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["restricted_to_workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRestrictedToWorkflows(val) + } + return nil + } + res["runners"] = 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.SetRunners(res) + } + 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["selected_workflows"] = 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.SetSelectedWorkflows(res) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the runner group. +// returns a *string when successful +func (m *ItemActionsRunnerGroupsPostRequestBody) GetName()(*string) { + return m.name +} +// GetRestrictedToWorkflows gets the restricted_to_workflows property value. If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. +// returns a *bool when successful +func (m *ItemActionsRunnerGroupsPostRequestBody) GetRestrictedToWorkflows()(*bool) { + return m.restricted_to_workflows +} +// GetRunners gets the runners property value. List of runner IDs to add to the runner group. +// returns a []int32 when successful +func (m *ItemActionsRunnerGroupsPostRequestBody) GetRunners()([]int32) { + return m.runners +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. List of repository IDs that can access the runner group. +// returns a []int32 when successful +func (m *ItemActionsRunnerGroupsPostRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// GetSelectedWorkflows gets the selected_workflows property value. List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +// returns a []string when successful +func (m *ItemActionsRunnerGroupsPostRequestBody) GetSelectedWorkflows()([]string) { + return m.selected_workflows +} +// Serialize serializes information the current object +func (m *ItemActionsRunnerGroupsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allows_public_repositories", m.GetAllowsPublicRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("restricted_to_workflows", m.GetRestrictedToWorkflows()) + if err != nil { + return err + } + } + if m.GetRunners() != nil { + err := writer.WriteCollectionOfInt32Values("runners", m.GetRunners()) + if err != nil { + return err + } + } + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + if err != nil { + return err + } + } + if m.GetSelectedWorkflows() != nil { + err := writer.WriteCollectionOfStringValues("selected_workflows", m.GetSelectedWorkflows()) + 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 *ItemActionsRunnerGroupsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowsPublicRepositories sets the allows_public_repositories property value. Whether the runner group can be used by `public` repositories. +func (m *ItemActionsRunnerGroupsPostRequestBody) SetAllowsPublicRepositories(value *bool)() { + m.allows_public_repositories = value +} +// SetName sets the name property value. Name of the runner group. +func (m *ItemActionsRunnerGroupsPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetRestrictedToWorkflows sets the restricted_to_workflows property value. If `true`, the runner group will be restricted to running only the workflows specified in the `selected_workflows` array. +func (m *ItemActionsRunnerGroupsPostRequestBody) SetRestrictedToWorkflows(value *bool)() { + m.restricted_to_workflows = value +} +// SetRunners sets the runners property value. List of runner IDs to add to the runner group. +func (m *ItemActionsRunnerGroupsPostRequestBody) SetRunners(value []int32)() { + m.runners = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. List of repository IDs that can access the runner group. +func (m *ItemActionsRunnerGroupsPostRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +// SetSelectedWorkflows sets the selected_workflows property value. List of workflows the runner group should be allowed to run. This setting will be ignored unless `restricted_to_workflows` is set to `true`. +func (m *ItemActionsRunnerGroupsPostRequestBody) SetSelectedWorkflows(value []string)() { + m.selected_workflows = value +} +type ItemActionsRunnerGroupsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowsPublicRepositories()(*bool) + GetName()(*string) + GetRestrictedToWorkflows()(*bool) + GetRunners()([]int32) + GetSelectedRepositoryIds()([]int32) + GetSelectedWorkflows()([]string) + SetAllowsPublicRepositories(value *bool)() + SetName(value *string)() + SetRestrictedToWorkflows(value *bool)() + SetRunners(value []int32)() + SetSelectedRepositoryIds(value []int32)() + SetSelectedWorkflows(value []string)() +} diff --git a/pkg/github/orgs/item_actions_runner_groups_request_builder.go b/pkg/github/orgs/item_actions_runner_groups_request_builder.go new file mode 100644 index 00000000..b86de9b7 --- /dev/null +++ b/pkg/github/orgs/item_actions_runner_groups_request_builder.go @@ -0,0 +1,108 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnerGroupsRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runner-groups +type ItemActionsRunnerGroupsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsRunnerGroupsRequestBuilderGetQueryParameters lists all self-hosted runner groups configured in an organization and inherited from an enterprise.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemActionsRunnerGroupsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only return runner groups that are allowed to be used by this repository. + Visible_to_repository *string `uriparametername:"visible_to_repository"` +} +// ByRunner_group_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.actions.runnerGroups.item collection +// returns a *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder when successful +func (m *ItemActionsRunnerGroupsRequestBuilder) ByRunner_group_id(runner_group_id int32)(*ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["runner_group_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(runner_group_id), 10) + return NewItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRunnerGroupsRequestBuilderInternal instantiates a new ItemActionsRunnerGroupsRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsRequestBuilder) { + m := &ItemActionsRunnerGroupsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups{?page*,per_page*,visible_to_repository*}", pathParameters), + } + return m +} +// NewItemActionsRunnerGroupsRequestBuilder instantiates a new ItemActionsRunnerGroupsRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnerGroupsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all self-hosted runner groups configured in an organization and inherited from an enterprise.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemActionsRunnerGroupsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#list-self-hosted-runner-groups-for-an-organization +func (m *ItemActionsRunnerGroupsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnerGroupsRequestBuilderGetQueryParameters])(ItemActionsRunnerGroupsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnerGroupsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnerGroupsGetResponseable), nil +} +// Post creates a new self-hosted runner group for an organization.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a RunnerGroupsOrgable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#create-a-self-hosted-runner-group-for-an-organization +func (m *ItemActionsRunnerGroupsRequestBuilder) Post(ctx context.Context, body ItemActionsRunnerGroupsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsOrgable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerGroupsOrgFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsOrgable), nil +} +// ToGetRequestInformation lists all self-hosted runner groups configured in an organization and inherited from an enterprise.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnerGroupsRequestBuilderGetQueryParameters])(*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 new self-hosted runner group for an organization.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemActionsRunnerGroupsPostRequestBodyable, 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 *ItemActionsRunnerGroupsRequestBuilder when successful +func (m *ItemActionsRunnerGroupsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnerGroupsRequestBuilder) { + return NewItemActionsRunnerGroupsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_runner_groups_with_runner_escaped_group_escaped_item_request_builder.go b/pkg/github/orgs/item_actions_runner_groups_with_runner_escaped_group_escaped_item_request_builder.go new file mode 100644 index 00000000..4d519278 --- /dev/null +++ b/pkg/github/orgs/item_actions_runner_groups_with_runner_escaped_group_escaped_item_request_builder.go @@ -0,0 +1,120 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runner-groups\{runner_group_id} +type ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilderInternal instantiates a new ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) { + m := &ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runner-groups/{runner_group_id}", pathParameters), + } + return m +} +// NewItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder instantiates a new ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a self-hosted runner group for an organization.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#delete-a-self-hosted-runner-group-from-an-organization +func (m *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific self-hosted runner group for an organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a RunnerGroupsOrgable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#get-a-self-hosted-runner-group-for-an-organization +func (m *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsOrgable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerGroupsOrgFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsOrgable), nil +} +// Patch updates the `name` and `visibility` of a self-hosted runner group in an organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a RunnerGroupsOrgable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runner-groups#update-a-self-hosted-runner-group-for-an-organization +func (m *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) Patch(ctx context.Context, body ItemActionsRunnerGroupsItemWithRunner_group_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsOrgable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerGroupsOrgFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerGroupsOrgable), nil +} +// Repositories the repositories property +// returns a *ItemActionsRunnerGroupsItemRepositoriesRequestBuilder when successful +func (m *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) Repositories()(*ItemActionsRunnerGroupsItemRepositoriesRequestBuilder) { + return NewItemActionsRunnerGroupsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Runners the runners property +// returns a *ItemActionsRunnerGroupsItemRunnersRequestBuilder when successful +func (m *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) Runners()(*ItemActionsRunnerGroupsItemRunnersRequestBuilder) { + return NewItemActionsRunnerGroupsItemRunnersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a self-hosted runner group for an organization.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsWithRunner_group_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific self-hosted runner group for an organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsWithRunner_group_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 the `name` and `visibility` of a self-hosted runner group in an organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemActionsRunnerGroupsItemWithRunner_group_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 *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder when successful +func (m *ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder) { + return NewItemActionsRunnerGroupsWithRunner_group_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_runners_downloads_request_builder.go b/pkg/github/orgs/item_actions_runners_downloads_request_builder.go new file mode 100644 index 00000000..9c2b8ffe --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_downloads_request_builder.go @@ -0,0 +1,60 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnersDownloadsRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners\downloads +type ItemActionsRunnersDownloadsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersDownloadsRequestBuilderInternal instantiates a new ItemActionsRunnersDownloadsRequestBuilder and sets the default values. +func NewItemActionsRunnersDownloadsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersDownloadsRequestBuilder) { + m := &ItemActionsRunnersDownloadsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners/downloads", pathParameters), + } + return m +} +// NewItemActionsRunnersDownloadsRequestBuilder instantiates a new ItemActionsRunnersDownloadsRequestBuilder and sets the default values. +func NewItemActionsRunnersDownloadsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersDownloadsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersDownloadsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists binaries for the runner application that you can download and run.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a []RunnerApplicationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#list-runner-applications-for-an-organization +func (m *ItemActionsRunnersDownloadsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerApplicationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerApplicationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerApplicationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerApplicationable) + } + } + return val, nil +} +// ToGetRequestInformation lists binaries for the runner application that you can download and run.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersDownloadsRequestBuilder) 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 *ItemActionsRunnersDownloadsRequestBuilder when successful +func (m *ItemActionsRunnersDownloadsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersDownloadsRequestBuilder) { + return NewItemActionsRunnersDownloadsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_runners_generate_jitconfig_post_request_body.go b/pkg/github/orgs/item_actions_runners_generate_jitconfig_post_request_body.go new file mode 100644 index 00000000..a7fec12e --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_generate_jitconfig_post_request_body.go @@ -0,0 +1,175 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnersGenerateJitconfigPostRequestBody 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 names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. + labels []string + // The name of the new runner. + name *string + // The ID of the runner group to register the runner to. + runner_group_id *int32 + // The working directory to be used for job execution, relative to the runner install directory. + work_folder *string +} +// NewItemActionsRunnersGenerateJitconfigPostRequestBody instantiates a new ItemActionsRunnersGenerateJitconfigPostRequestBody and sets the default values. +func NewItemActionsRunnersGenerateJitconfigPostRequestBody()(*ItemActionsRunnersGenerateJitconfigPostRequestBody) { + m := &ItemActionsRunnersGenerateJitconfigPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + work_folderValue := "_work" + m.SetWorkFolder(&work_folderValue) + return m +} +// CreateItemActionsRunnersGenerateJitconfigPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersGenerateJitconfigPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersGenerateJitconfigPostRequestBody(), 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 *ItemActionsRunnersGenerateJitconfigPostRequestBody) 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 *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = 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.SetLabels(res) + } + 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["runner_group_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunnerGroupId(val) + } + return nil + } + res["work_folder"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkFolder(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. +// returns a []string when successful +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetLabels()([]string) { + return m.labels +} +// GetName gets the name property value. The name of the new runner. +// returns a *string when successful +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetName()(*string) { + return m.name +} +// GetRunnerGroupId gets the runner_group_id property value. The ID of the runner group to register the runner to. +// returns a *int32 when successful +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetRunnerGroupId()(*int32) { + return m.runner_group_id +} +// GetWorkFolder gets the work_folder property value. The working directory to be used for job execution, relative to the runner install directory. +// returns a *string when successful +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) GetWorkFolder()(*string) { + return m.work_folder +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("runner_group_id", m.GetRunnerGroupId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("work_folder", m.GetWorkFolder()) + 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 *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetLabels(value []string)() { + m.labels = value +} +// SetName sets the name property value. The name of the new runner. +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetRunnerGroupId sets the runner_group_id property value. The ID of the runner group to register the runner to. +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetRunnerGroupId(value *int32)() { + m.runner_group_id = value +} +// SetWorkFolder sets the work_folder property value. The working directory to be used for job execution, relative to the runner install directory. +func (m *ItemActionsRunnersGenerateJitconfigPostRequestBody) SetWorkFolder(value *string)() { + m.work_folder = value +} +type ItemActionsRunnersGenerateJitconfigPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + GetName()(*string) + GetRunnerGroupId()(*int32) + GetWorkFolder()(*string) + SetLabels(value []string)() + SetName(value *string)() + SetRunnerGroupId(value *int32)() + SetWorkFolder(value *string)() +} diff --git a/pkg/github/orgs/item_actions_runners_generate_jitconfig_post_response.go b/pkg/github/orgs/item_actions_runners_generate_jitconfig_post_response.go new file mode 100644 index 00000000..4ea6ca9e --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_generate_jitconfig_post_response.go @@ -0,0 +1,110 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnersGenerateJitconfigPostResponse 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 runner configuration. + encoded_jit_config *string + // A self hosted runner + runner ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable +} +// NewItemActionsRunnersGenerateJitconfigPostResponse instantiates a new ItemActionsRunnersGenerateJitconfigPostResponse and sets the default values. +func NewItemActionsRunnersGenerateJitconfigPostResponse()(*ItemActionsRunnersGenerateJitconfigPostResponse) { + m := &ItemActionsRunnersGenerateJitconfigPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersGenerateJitconfigPostResponse(), 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 *ItemActionsRunnersGenerateJitconfigPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncodedJitConfig gets the encoded_jit_config property value. The base64 encoded runner configuration. +// returns a *string when successful +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) GetEncodedJitConfig()(*string) { + return m.encoded_jit_config +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encoded_jit_config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncodedJitConfig(val) + } + return nil + } + res["runner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRunner(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)) + } + return nil + } + return res +} +// GetRunner gets the runner property value. A self hosted runner +// returns a Runnerable when successful +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) GetRunner()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) { + return m.runner +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encoded_jit_config", m.GetEncodedJitConfig()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("runner", m.GetRunner()) + 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 *ItemActionsRunnersGenerateJitconfigPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncodedJitConfig sets the encoded_jit_config property value. The base64 encoded runner configuration. +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) SetEncodedJitConfig(value *string)() { + m.encoded_jit_config = value +} +// SetRunner sets the runner property value. A self hosted runner +func (m *ItemActionsRunnersGenerateJitconfigPostResponse) SetRunner(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() { + m.runner = value +} +type ItemActionsRunnersGenerateJitconfigPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncodedJitConfig()(*string) + GetRunner()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) + SetEncodedJitConfig(value *string)() + SetRunner(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() +} diff --git a/pkg/github/orgs/item_actions_runners_generate_jitconfig_request_builder.go b/pkg/github/orgs/item_actions_runners_generate_jitconfig_request_builder.go new file mode 100644 index 00000000..7c35b606 --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_generate_jitconfig_request_builder.go @@ -0,0 +1,67 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnersGenerateJitconfigRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners\generate-jitconfig +type ItemActionsRunnersGenerateJitconfigRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersGenerateJitconfigRequestBuilderInternal instantiates a new ItemActionsRunnersGenerateJitconfigRequestBuilder and sets the default values. +func NewItemActionsRunnersGenerateJitconfigRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersGenerateJitconfigRequestBuilder) { + m := &ItemActionsRunnersGenerateJitconfigRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners/generate-jitconfig", pathParameters), + } + return m +} +// NewItemActionsRunnersGenerateJitconfigRequestBuilder instantiates a new ItemActionsRunnersGenerateJitconfigRequestBuilder and sets the default values. +func NewItemActionsRunnersGenerateJitconfigRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersGenerateJitconfigRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersGenerateJitconfigRequestBuilderInternal(urlParams, requestAdapter) +} +// Post generates a configuration that can be passed to the runner application at startup.The authenticated user must have admin access to the organization.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemActionsRunnersGenerateJitconfigPostResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-an-organization +func (m *ItemActionsRunnersGenerateJitconfigRequestBuilder) Post(ctx context.Context, body ItemActionsRunnersGenerateJitconfigPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersGenerateJitconfigPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersGenerateJitconfigPostResponseable), nil +} +// ToPostRequestInformation generates a configuration that can be passed to the runner application at startup.The authenticated user must have admin access to the organization.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersGenerateJitconfigRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemActionsRunnersGenerateJitconfigPostRequestBodyable, 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 *ItemActionsRunnersGenerateJitconfigRequestBuilder when successful +func (m *ItemActionsRunnersGenerateJitconfigRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersGenerateJitconfigRequestBuilder) { + return NewItemActionsRunnersGenerateJitconfigRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_runners_get_response.go b/pkg/github/orgs/item_actions_runners_get_response.go new file mode 100644 index 00000000..d542d908 --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnersGetResponse 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 runners property + runners []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersGetResponse instantiates a new ItemActionsRunnersGetResponse and sets the default values. +func NewItemActionsRunnersGetResponse()(*ItemActionsRunnersGetResponse) { + m := &ItemActionsRunnersGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersGetResponse(), 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 *ItemActionsRunnersGetResponse) 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 *ItemActionsRunnersGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["runners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) + } + } + m.SetRunners(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 +} +// GetRunners gets the runners property value. The runners property +// returns a []Runnerable when successful +func (m *ItemActionsRunnersGetResponse) GetRunners()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) { + return m.runners +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRunners() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRunners())) + for i, v := range m.GetRunners() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("runners", 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 *ItemActionsRunnersGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRunners sets the runners property value. The runners property +func (m *ItemActionsRunnersGetResponse) SetRunners(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() { + m.runners = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRunners()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) + GetTotalCount()(*int32) + SetRunners(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_actions_runners_item_labels_delete_response.go b/pkg/github/orgs/item_actions_runners_item_labels_delete_response.go new file mode 100644 index 00000000..ade65e9b --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_item_labels_delete_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsDeleteResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsDeleteResponse instantiates a new ItemActionsRunnersItemLabelsDeleteResponse and sets the default values. +func NewItemActionsRunnersItemLabelsDeleteResponse()(*ItemActionsRunnersItemLabelsDeleteResponse) { + m := &ItemActionsRunnersItemLabelsDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsDeleteResponse(), 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 *ItemActionsRunnersItemLabelsDeleteResponse) 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 *ItemActionsRunnersItemLabelsDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsDeleteResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsDeleteResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemActionsRunnersItemLabelsDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsDeleteResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsDeleteResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_actions_runners_item_labels_get_response.go b/pkg/github/orgs/item_actions_runners_item_labels_get_response.go new file mode 100644 index 00000000..681736cd --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_item_labels_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsGetResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsGetResponse instantiates a new ItemActionsRunnersItemLabelsGetResponse and sets the default values. +func NewItemActionsRunnersItemLabelsGetResponse()(*ItemActionsRunnersItemLabelsGetResponse) { + m := &ItemActionsRunnersItemLabelsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsGetResponse(), 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 *ItemActionsRunnersItemLabelsGetResponse) 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 *ItemActionsRunnersItemLabelsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsGetResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemActionsRunnersItemLabelsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsGetResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_actions_runners_item_labels_item_with_name_delete_response.go b/pkg/github/orgs/item_actions_runners_item_labels_item_with_name_delete_response.go new file mode 100644 index 00000000..3c8b4667 --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_item_labels_item_with_name_delete_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsItemWithNameDeleteResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsItemWithNameDeleteResponse instantiates a new ItemActionsRunnersItemLabelsItemWithNameDeleteResponse and sets the default values. +func NewItemActionsRunnersItemLabelsItemWithNameDeleteResponse()(*ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) { + m := &ItemActionsRunnersItemLabelsItemWithNameDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsItemWithNameDeleteResponse(), 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 *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) 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 *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsItemWithNameDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_actions_runners_item_labels_post_request_body.go b/pkg/github/orgs/item_actions_runners_item_labels_post_request_body.go new file mode 100644 index 00000000..9a05259a --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_item_labels_post_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnersItemLabelsPostRequestBody 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 names of the custom labels to add to the runner. + labels []string +} +// NewItemActionsRunnersItemLabelsPostRequestBody instantiates a new ItemActionsRunnersItemLabelsPostRequestBody and sets the default values. +func NewItemActionsRunnersItemLabelsPostRequestBody()(*ItemActionsRunnersItemLabelsPostRequestBody) { + m := &ItemActionsRunnersItemLabelsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsPostRequestBody(), 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 *ItemActionsRunnersItemLabelsPostRequestBody) 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 *ItemActionsRunnersItemLabelsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = 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.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to add to the runner. +// returns a []string when successful +func (m *ItemActionsRunnersItemLabelsPostRequestBody) GetLabels()([]string) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + 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 *ItemActionsRunnersItemLabelsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to add to the runner. +func (m *ItemActionsRunnersItemLabelsPostRequestBody) SetLabels(value []string)() { + m.labels = value +} +type ItemActionsRunnersItemLabelsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + SetLabels(value []string)() +} diff --git a/pkg/github/orgs/item_actions_runners_item_labels_post_response.go b/pkg/github/orgs/item_actions_runners_item_labels_post_response.go new file mode 100644 index 00000000..2d2aa7b7 --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_item_labels_post_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsPostResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsPostResponse instantiates a new ItemActionsRunnersItemLabelsPostResponse and sets the default values. +func NewItemActionsRunnersItemLabelsPostResponse()(*ItemActionsRunnersItemLabelsPostResponse) { + m := &ItemActionsRunnersItemLabelsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsPostResponse(), 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 *ItemActionsRunnersItemLabelsPostResponse) 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 *ItemActionsRunnersItemLabelsPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsPostResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsPostResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemActionsRunnersItemLabelsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsPostResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsPostResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_actions_runners_item_labels_put_request_body.go b/pkg/github/orgs/item_actions_runners_item_labels_put_request_body.go new file mode 100644 index 00000000..7ceebb53 --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_item_labels_put_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsRunnersItemLabelsPutRequestBody 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 names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. + labels []string +} +// NewItemActionsRunnersItemLabelsPutRequestBody instantiates a new ItemActionsRunnersItemLabelsPutRequestBody and sets the default values. +func NewItemActionsRunnersItemLabelsPutRequestBody()(*ItemActionsRunnersItemLabelsPutRequestBody) { + m := &ItemActionsRunnersItemLabelsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsPutRequestBody(), 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 *ItemActionsRunnersItemLabelsPutRequestBody) 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 *ItemActionsRunnersItemLabelsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = 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.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. +// returns a []string when successful +func (m *ItemActionsRunnersItemLabelsPutRequestBody) GetLabels()([]string) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + 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 *ItemActionsRunnersItemLabelsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. +func (m *ItemActionsRunnersItemLabelsPutRequestBody) SetLabels(value []string)() { + m.labels = value +} +type ItemActionsRunnersItemLabelsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + SetLabels(value []string)() +} diff --git a/pkg/github/orgs/item_actions_runners_item_labels_put_response.go b/pkg/github/orgs/item_actions_runners_item_labels_put_response.go new file mode 100644 index 00000000..20de8d40 --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_item_labels_put_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsRunnersItemLabelsPutResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemActionsRunnersItemLabelsPutResponse instantiates a new ItemActionsRunnersItemLabelsPutResponse and sets the default values. +func NewItemActionsRunnersItemLabelsPutResponse()(*ItemActionsRunnersItemLabelsPutResponse) { + m := &ItemActionsRunnersItemLabelsPutResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsRunnersItemLabelsPutResponse(), 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 *ItemActionsRunnersItemLabelsPutResponse) 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 *ItemActionsRunnersItemLabelsPutResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemActionsRunnersItemLabelsPutResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsRunnersItemLabelsPutResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsRunnersItemLabelsPutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemActionsRunnersItemLabelsPutResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemActionsRunnersItemLabelsPutResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsRunnersItemLabelsPutResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsRunnersItemLabelsPutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_actions_runners_item_labels_request_builder.go b/pkg/github/orgs/item_actions_runners_item_labels_request_builder.go new file mode 100644 index 00000000..2e53ad6c --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_item_labels_request_builder.go @@ -0,0 +1,178 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnersItemLabelsRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners\{runner_id}\labels +type ItemActionsRunnersItemLabelsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByName gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.actions.runners.item.labels.item collection +// returns a *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) ByName(name string)(*ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRunnersItemLabelsRequestBuilderInternal instantiates a new ItemActionsRunnersItemLabelsRequestBuilder and sets the default values. +func NewItemActionsRunnersItemLabelsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersItemLabelsRequestBuilder) { + m := &ItemActionsRunnersItemLabelsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners/{runner_id}/labels", pathParameters), + } + return m +} +// NewItemActionsRunnersItemLabelsRequestBuilder instantiates a new ItemActionsRunnersItemLabelsRequestBuilder and sets the default values. +func NewItemActionsRunnersItemLabelsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersItemLabelsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersItemLabelsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete remove all custom labels from a self-hosted runner configured in anorganization. Returns the remaining read-only labels from the runner.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsRunnersItemLabelsDeleteResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-an-organization +func (m *ItemActionsRunnersItemLabelsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsDeleteResponseable), nil +} +// Get lists all labels for a self-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsRunnersItemLabelsGetResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-an-organization +func (m *ItemActionsRunnersItemLabelsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsGetResponseable), nil +} +// Post adds custom labels to a self-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemActionsRunnersItemLabelsPostResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-an-organization +func (m *ItemActionsRunnersItemLabelsRequestBuilder) Post(ctx context.Context, body ItemActionsRunnersItemLabelsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsPostResponseable), nil +} +// Put remove all previous custom labels and set the new custom labels for a specificself-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsRunnersItemLabelsPutResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-an-organization +func (m *ItemActionsRunnersItemLabelsRequestBuilder) Put(ctx context.Context, body ItemActionsRunnersItemLabelsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsPutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsPutResponseable), nil +} +// ToDeleteRequestInformation remove all custom labels from a self-hosted runner configured in anorganization. Returns the remaining read-only labels from the runner.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation lists all labels for a self-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) 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 adds custom labels to a self-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemActionsRunnersItemLabelsPostRequestBodyable, 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 +} +// ToPutRequestInformation remove all previous custom labels and set the new custom labels for a specificself-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsRunnersItemLabelsPutRequestBodyable, 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 *ItemActionsRunnersItemLabelsRequestBuilder when successful +func (m *ItemActionsRunnersItemLabelsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersItemLabelsRequestBuilder) { + return NewItemActionsRunnersItemLabelsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_runners_item_labels_with_name_item_request_builder.go b/pkg/github/orgs/item_actions_runners_item_labels_with_name_item_request_builder.go new file mode 100644 index 00000000..a8e22883 --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_item_labels_with_name_item_request_builder.go @@ -0,0 +1,63 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnersItemLabelsWithNameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners\{runner_id}\labels\{name} +type ItemActionsRunnersItemLabelsWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal instantiates a new ItemActionsRunnersItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + m := &ItemActionsRunnersItemLabelsWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners/{runner_id}/labels/{name}", pathParameters), + } + return m +} +// NewItemActionsRunnersItemLabelsWithNameItemRequestBuilder instantiates a new ItemActionsRunnersItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemActionsRunnersItemLabelsWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete remove a custom label from a self-hosted runner configuredin an organization. Returns the remaining labels from the runner.This endpoint returns a `404 Not Found` status if the custom label is notpresent on the runner.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsRunnersItemLabelsItemWithNameDeleteResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-an-organization +func (m *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemActionsRunnersItemLabelsItemWithNameDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersItemLabelsItemWithNameDeleteResponseable), nil +} +// ToDeleteRequestInformation remove a custom label from a self-hosted runner configuredin an organization. Returns the remaining labels from the runner.This endpoint returns a `404 Not Found` status if the custom label is notpresent on the runner.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) 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") + 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 *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + return NewItemActionsRunnersItemLabelsWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_runners_registration_token_request_builder.go b/pkg/github/orgs/item_actions_runners_registration_token_request_builder.go new file mode 100644 index 00000000..82b23e27 --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_registration_token_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnersRegistrationTokenRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners\registration-token +type ItemActionsRunnersRegistrationTokenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersRegistrationTokenRequestBuilderInternal instantiates a new ItemActionsRunnersRegistrationTokenRequestBuilder and sets the default values. +func NewItemActionsRunnersRegistrationTokenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRegistrationTokenRequestBuilder) { + m := &ItemActionsRunnersRegistrationTokenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners/registration-token", pathParameters), + } + return m +} +// NewItemActionsRunnersRegistrationTokenRequestBuilder instantiates a new ItemActionsRunnersRegistrationTokenRequestBuilder and sets the default values. +func NewItemActionsRunnersRegistrationTokenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRegistrationTokenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersRegistrationTokenRequestBuilderInternal(urlParams, requestAdapter) +} +// Post returns a token that you can pass to the `config` script. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner:```./config.sh --url https://github.com/octo-org --token TOKEN```Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a AuthenticationTokenable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#create-a-registration-token-for-an-organization +func (m *ItemActionsRunnersRegistrationTokenRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuthenticationTokenable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthenticationTokenFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuthenticationTokenable), nil +} +// ToPostRequestInformation returns a token that you can pass to the `config` script. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner:```./config.sh --url https://github.com/octo-org --token TOKEN```Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersRegistrationTokenRequestBuilder) 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 *ItemActionsRunnersRegistrationTokenRequestBuilder when successful +func (m *ItemActionsRunnersRegistrationTokenRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersRegistrationTokenRequestBuilder) { + return NewItemActionsRunnersRegistrationTokenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_runners_remove_token_request_builder.go b/pkg/github/orgs/item_actions_runners_remove_token_request_builder.go new file mode 100644 index 00000000..e24091c2 --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_remove_token_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnersRemoveTokenRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners\remove-token +type ItemActionsRunnersRemoveTokenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersRemoveTokenRequestBuilderInternal instantiates a new ItemActionsRunnersRemoveTokenRequestBuilder and sets the default values. +func NewItemActionsRunnersRemoveTokenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRemoveTokenRequestBuilder) { + m := &ItemActionsRunnersRemoveTokenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners/remove-token", pathParameters), + } + return m +} +// NewItemActionsRunnersRemoveTokenRequestBuilder instantiates a new ItemActionsRunnersRemoveTokenRequestBuilder and sets the default values. +func NewItemActionsRunnersRemoveTokenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRemoveTokenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersRemoveTokenRequestBuilderInternal(urlParams, requestAdapter) +} +// Post returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:```./config.sh remove --token TOKEN```Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a AuthenticationTokenable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#create-a-remove-token-for-an-organization +func (m *ItemActionsRunnersRemoveTokenRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuthenticationTokenable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthenticationTokenFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuthenticationTokenable), nil +} +// ToPostRequestInformation returns a token that you can pass to the `config` script to remove a self-hosted runner from an organization. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:```./config.sh remove --token TOKEN```Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersRemoveTokenRequestBuilder) 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 *ItemActionsRunnersRemoveTokenRequestBuilder when successful +func (m *ItemActionsRunnersRemoveTokenRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersRemoveTokenRequestBuilder) { + return NewItemActionsRunnersRemoveTokenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_runners_request_builder.go b/pkg/github/orgs/item_actions_runners_request_builder.go new file mode 100644 index 00000000..5746ee30 --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_request_builder.go @@ -0,0 +1,96 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsRunnersRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners +type ItemActionsRunnersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsRunnersRequestBuilderGetQueryParameters lists all self-hosted runners configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +type ItemActionsRunnersRequestBuilderGetQueryParameters struct { + // The name of a self-hosted runner. + Name *string `uriparametername:"name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRunner_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.actions.runners.item collection +// returns a *ItemActionsRunnersWithRunner_ItemRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) ByRunner_id(runner_id int32)(*ItemActionsRunnersWithRunner_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["runner_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(runner_id), 10) + return NewItemActionsRunnersWithRunner_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsRunnersRequestBuilderInternal instantiates a new ItemActionsRunnersRequestBuilder and sets the default values. +func NewItemActionsRunnersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRequestBuilder) { + m := &ItemActionsRunnersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners{?name*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsRunnersRequestBuilder instantiates a new ItemActionsRunnersRequestBuilder and sets the default values. +func NewItemActionsRunnersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersRequestBuilderInternal(urlParams, requestAdapter) +} +// Downloads the downloads property +// returns a *ItemActionsRunnersDownloadsRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) Downloads()(*ItemActionsRunnersDownloadsRequestBuilder) { + return NewItemActionsRunnersDownloadsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// GenerateJitconfig the generateJitconfig property +// returns a *ItemActionsRunnersGenerateJitconfigRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) GenerateJitconfig()(*ItemActionsRunnersGenerateJitconfigRequestBuilder) { + return NewItemActionsRunnersGenerateJitconfigRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get lists all self-hosted runners configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsRunnersGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#list-self-hosted-runners-for-an-organization +func (m *ItemActionsRunnersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnersRequestBuilderGetQueryParameters])(ItemActionsRunnersGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsRunnersGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsRunnersGetResponseable), nil +} +// RegistrationToken the registrationToken property +// returns a *ItemActionsRunnersRegistrationTokenRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) RegistrationToken()(*ItemActionsRunnersRegistrationTokenRequestBuilder) { + return NewItemActionsRunnersRegistrationTokenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// RemoveToken the removeToken property +// returns a *ItemActionsRunnersRemoveTokenRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) RemoveToken()(*ItemActionsRunnersRemoveTokenRequestBuilder) { + return NewItemActionsRunnersRemoveTokenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all self-hosted runners configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsRunnersRequestBuilderGetQueryParameters])(*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 *ItemActionsRunnersRequestBuilder when successful +func (m *ItemActionsRunnersRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersRequestBuilder) { + return NewItemActionsRunnersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_runners_with_runner_escaped_item_request_builder.go b/pkg/github/orgs/item_actions_runners_with_runner_escaped_item_request_builder.go new file mode 100644 index 00000000..0fae3791 --- /dev/null +++ b/pkg/github/orgs/item_actions_runners_with_runner_escaped_item_request_builder.go @@ -0,0 +1,84 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsRunnersWithRunner_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\runners\{runner_id} +type ItemActionsRunnersWithRunner_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsRunnersWithRunner_ItemRequestBuilderInternal instantiates a new ItemActionsRunnersWithRunner_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnersWithRunner_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersWithRunner_ItemRequestBuilder) { + m := &ItemActionsRunnersWithRunner_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/runners/{runner_id}", pathParameters), + } + return m +} +// NewItemActionsRunnersWithRunner_ItemRequestBuilder instantiates a new ItemActionsRunnersWithRunner_ItemRequestBuilder and sets the default values. +func NewItemActionsRunnersWithRunner_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsRunnersWithRunner_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsRunnersWithRunner_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-an-organization +func (m *ItemActionsRunnersWithRunner_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific self-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a Runnerable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-an-organization +func (m *ItemActionsRunnersWithRunner_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable), nil +} +// Labels the labels property +// returns a *ItemActionsRunnersItemLabelsRequestBuilder when successful +func (m *ItemActionsRunnersWithRunner_ItemRequestBuilder) Labels()(*ItemActionsRunnersItemLabelsRequestBuilder) { + return NewItemActionsRunnersItemLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation forces the removal of a self-hosted runner from an organization. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersWithRunner_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific self-hosted runner configured in an organization.Authenticated users must have admin access to the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsRunnersWithRunner_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemActionsRunnersWithRunner_ItemRequestBuilder when successful +func (m *ItemActionsRunnersWithRunner_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsRunnersWithRunner_ItemRequestBuilder) { + return NewItemActionsRunnersWithRunner_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_secrets_get_response.go b/pkg/github/orgs/item_actions_secrets_get_response.go new file mode 100644 index 00000000..2076e7ba --- /dev/null +++ b/pkg/github/orgs/item_actions_secrets_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsSecretsGetResponse 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 secrets property + secrets []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsSecretable + // The total_count property + total_count *int32 +} +// NewItemActionsSecretsGetResponse instantiates a new ItemActionsSecretsGetResponse and sets the default values. +func NewItemActionsSecretsGetResponse()(*ItemActionsSecretsGetResponse) { + m := &ItemActionsSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsSecretsGetResponse(), 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 *ItemActionsSecretsGetResponse) 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 *ItemActionsSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationActionsSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsSecretable) + } + } + m.SetSecrets(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 +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []OrganizationActionsSecretable when successful +func (m *ItemActionsSecretsGetResponse) GetSecrets()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", 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 *ItemActionsSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemActionsSecretsGetResponse) SetSecrets(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsSecretable) + GetTotalCount()(*int32) + SetSecrets(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsSecretable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_actions_secrets_item_repositories_get_response.go b/pkg/github/orgs/item_actions_secrets_item_repositories_get_response.go new file mode 100644 index 00000000..f0a457e8 --- /dev/null +++ b/pkg/github/orgs/item_actions_secrets_item_repositories_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsSecretsItemRepositoriesGetResponse 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 repositories property + repositories []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable + // The total_count property + total_count *int32 +} +// NewItemActionsSecretsItemRepositoriesGetResponse instantiates a new ItemActionsSecretsItemRepositoriesGetResponse and sets the default values. +func NewItemActionsSecretsItemRepositoriesGetResponse()(*ItemActionsSecretsItemRepositoriesGetResponse) { + m := &ItemActionsSecretsItemRepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsSecretsItemRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsSecretsItemRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsSecretsItemRepositoriesGetResponse(), 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 *ItemActionsSecretsItemRepositoriesGetResponse) 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 *ItemActionsSecretsItemRepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + m.SetRepositories(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 +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []MinimalRepositoryable when successful +func (m *ItemActionsSecretsItemRepositoriesGetResponse) GetRepositories()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) { + return m.repositories +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsSecretsItemRepositoriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsSecretsItemRepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", 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 *ItemActionsSecretsItemRepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *ItemActionsSecretsItemRepositoriesGetResponse) SetRepositories(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable)() { + m.repositories = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsSecretsItemRepositoriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsSecretsItemRepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + GetTotalCount()(*int32) + SetRepositories(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_actions_secrets_item_repositories_put_request_body.go b/pkg/github/orgs/item_actions_secrets_item_repositories_put_request_body.go new file mode 100644 index 00000000..68415ce7 --- /dev/null +++ b/pkg/github/orgs/item_actions_secrets_item_repositories_put_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsSecretsItemRepositoriesPutRequestBody 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 array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#add-selected-repository-to-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + selected_repository_ids []int32 +} +// NewItemActionsSecretsItemRepositoriesPutRequestBody instantiates a new ItemActionsSecretsItemRepositoriesPutRequestBody and sets the default values. +func NewItemActionsSecretsItemRepositoriesPutRequestBody()(*ItemActionsSecretsItemRepositoriesPutRequestBody) { + m := &ItemActionsSecretsItemRepositoriesPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsSecretsItemRepositoriesPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsSecretsItemRepositoriesPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsSecretsItemRepositoriesPutRequestBody(), 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 *ItemActionsSecretsItemRepositoriesPutRequestBody) 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 *ItemActionsSecretsItemRepositoriesPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 + } + return res +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#add-selected-repository-to-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +// returns a []int32 when successful +func (m *ItemActionsSecretsItemRepositoriesPutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemActionsSecretsItemRepositoriesPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *ItemActionsSecretsItemRepositoriesPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Add selected repository to an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#add-selected-repository-to-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +func (m *ItemActionsSecretsItemRepositoriesPutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type ItemActionsSecretsItemRepositoriesPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedRepositoryIds()([]int32) + SetSelectedRepositoryIds(value []int32)() +} diff --git a/pkg/github/orgs/item_actions_secrets_item_repositories_request_builder.go b/pkg/github/orgs/item_actions_secrets_item_repositories_request_builder.go new file mode 100644 index 00000000..783adbf9 --- /dev/null +++ b/pkg/github/orgs/item_actions_secrets_item_repositories_request_builder.go @@ -0,0 +1,100 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsSecretsItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\secrets\{secret_name}\repositories +type ItemActionsSecretsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsSecretsItemRepositoriesRequestBuilderGetQueryParameters lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +type ItemActionsSecretsItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRepository_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.actions.secrets.item.repositories.item collection +// returns a *ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemActionsSecretsItemRepositoriesRequestBuilder) ByRepository_id(repository_id int32)(*ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["repository_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(repository_id), 10) + return NewItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsSecretsItemRepositoriesRequestBuilderInternal instantiates a new ItemActionsSecretsItemRepositoriesRequestBuilder and sets the default values. +func NewItemActionsSecretsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsItemRepositoriesRequestBuilder) { + m := &ItemActionsSecretsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/secrets/{secret_name}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsSecretsItemRepositoriesRequestBuilder instantiates a new ItemActionsSecretsItemRepositoriesRequestBuilder and sets the default values. +func NewItemActionsSecretsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsSecretsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsSecretsItemRepositoriesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#list-selected-repositories-for-an-organization-secret +func (m *ItemActionsSecretsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsSecretsItemRepositoriesRequestBuilderGetQueryParameters])(ItemActionsSecretsItemRepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsSecretsItemRepositoriesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsSecretsItemRepositoriesGetResponseable), nil +} +// Put replaces all repositories for an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#create-or-update-an-organization-secret).Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#set-selected-repositories-for-an-organization-secret +func (m *ItemActionsSecretsItemRepositoriesRequestBuilder) Put(ctx context.Context, body ItemActionsSecretsItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsSecretsItemRepositoriesRequestBuilderGetQueryParameters])(*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 +} +// ToPutRequestInformation replaces all repositories for an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#create-or-update-an-organization-secret).Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsItemRepositoriesRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsSecretsItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsSecretsItemRepositoriesRequestBuilder when successful +func (m *ItemActionsSecretsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemActionsSecretsItemRepositoriesRequestBuilder) { + return NewItemActionsSecretsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_secrets_item_repositories_with_repository_escaped_item_request_builder.go b/pkg/github/orgs/item_actions_secrets_item_repositories_with_repository_escaped_item_request_builder.go new file mode 100644 index 00000000..3d8e05b3 --- /dev/null +++ b/pkg/github/orgs/item_actions_secrets_item_repositories_with_repository_escaped_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\secrets\{secret_name}\repositories\{repository_id} +type ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal instantiates a new ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + m := &ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/secrets/{secret_name}/repositories/{repository_id}", pathParameters), + } + return m +} +// NewItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder instantiates a new ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a repository from an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#create-or-update-an-organization-secret).Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#remove-selected-repository-from-an-organization-secret +func (m *ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put adds a repository to an organization secret when the `visibility` forrepository access is set to `selected`. For more information about setting the visibility, see [Create orupdate an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#create-or-update-an-organization-secret).Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#add-selected-repository-to-an-organization-secret +func (m *ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a repository from an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#create-or-update-an-organization-secret).Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsItemRepositoriesWithRepository_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) + return requestInfo, nil +} +// ToPutRequestInformation adds a repository to an organization secret when the `visibility` forrepository access is set to `selected`. For more information about setting the visibility, see [Create orupdate an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#create-or-update-an-organization-secret).Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + return NewItemActionsSecretsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_secrets_item_with_secret_escaped_name_put_request_body.go b/pkg/github/orgs/item_actions_secrets_item_with_secret_escaped_name_put_request_body.go new file mode 100644 index 00000000..ce5da337 --- /dev/null +++ b/pkg/github/orgs/item_actions_secrets_item_with_secret_escaped_name_put_request_body.go @@ -0,0 +1,144 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsSecretsItemWithSecret_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 + // Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-an-organization-public-key) endpoint. + encrypted_value *string + // ID of the key you used to encrypt the secret. + key_id *string + // An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + selected_repository_ids []int32 +} +// NewItemActionsSecretsItemWithSecret_namePutRequestBody instantiates a new ItemActionsSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewItemActionsSecretsItemWithSecret_namePutRequestBody()(*ItemActionsSecretsItemWithSecret_namePutRequestBody) { + m := &ItemActionsSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsSecretsItemWithSecret_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 *ItemActionsSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-an-organization-public-key) endpoint. +// returns a *string when successful +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) 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 *ItemActionsSecretsItemWithSecret_namePutRequestBody) 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 + } + return res +} +// GetKeyId gets the key_id property value. ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +// returns a []int32 when successful +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) 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.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 *ItemActionsSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-an-organization-public-key) endpoint. +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. ID of the key you used to encrypt the secret. +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) 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 secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +func (m *ItemActionsSecretsItemWithSecret_namePutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type ItemActionsSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + GetSelectedRepositoryIds()([]int32) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() + SetSelectedRepositoryIds(value []int32)() +} diff --git a/pkg/github/orgs/item_actions_secrets_public_key_request_builder.go b/pkg/github/orgs/item_actions_secrets_public_key_request_builder.go new file mode 100644 index 00000000..e4cfd586 --- /dev/null +++ b/pkg/github/orgs/item_actions_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsSecretsPublicKeyRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\secrets\public-key +type ItemActionsSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsSecretsPublicKeyRequestBuilderInternal instantiates a new ItemActionsSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemActionsSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsPublicKeyRequestBuilder) { + m := &ItemActionsSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/secrets/public-key", pathParameters), + } + return m +} +// NewItemActionsSecretsPublicKeyRequestBuilder instantiates a new ItemActionsSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemActionsSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets.The authenticated user must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-an-organization-public-key +func (m *ItemActionsSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsPublicKeyable), nil +} +// ToGetRequestInformation gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets.The authenticated user must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsPublicKeyRequestBuilder) 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 *ItemActionsSecretsPublicKeyRequestBuilder when successful +func (m *ItemActionsSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemActionsSecretsPublicKeyRequestBuilder) { + return NewItemActionsSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_secrets_request_builder.go b/pkg/github/orgs/item_actions_secrets_request_builder.go new file mode 100644 index 00000000..08325389 --- /dev/null +++ b/pkg/github/orgs/item_actions_secrets_request_builder.go @@ -0,0 +1,80 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsSecretsRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\secrets +type ItemActionsSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsSecretsRequestBuilderGetQueryParameters lists all secrets available in an organization without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +type ItemActionsSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/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-enterprise-server/pkg/github.orgs.item.actions.secrets.item collection +// returns a *ItemActionsSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemActionsSecretsRequestBuilder) BySecret_name(secret_name string)(*ItemActionsSecretsWithSecret_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 NewItemActionsSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsSecretsRequestBuilderInternal instantiates a new ItemActionsSecretsRequestBuilder and sets the default values. +func NewItemActionsSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsRequestBuilder) { + m := &ItemActionsSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsSecretsRequestBuilder instantiates a new ItemActionsSecretsRequestBuilder and sets the default values. +func NewItemActionsSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all secrets available in an organization without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#list-organization-secrets +func (m *ItemActionsSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsSecretsRequestBuilderGetQueryParameters])(ItemActionsSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *ItemActionsSecretsPublicKeyRequestBuilder when successful +func (m *ItemActionsSecretsRequestBuilder) PublicKey()(*ItemActionsSecretsPublicKeyRequestBuilder) { + return NewItemActionsSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all secrets available in an organization without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsSecretsRequestBuilderGetQueryParameters])(*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 *ItemActionsSecretsRequestBuilder when successful +func (m *ItemActionsSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemActionsSecretsRequestBuilder) { + return NewItemActionsSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_secrets_with_secret_escaped_name_item_request_builder.go b/pkg/github/orgs/item_actions_secrets_with_secret_escaped_name_item_request_builder.go new file mode 100644 index 00000000..35e14ccc --- /dev/null +++ b/pkg/github/orgs/item_actions_secrets_with_secret_escaped_name_item_request_builder.go @@ -0,0 +1,115 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\secrets\{secret_name} +type ItemActionsSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new ItemActionsSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemActionsSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsWithSecret_nameItemRequestBuilder) { + m := &ItemActionsSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/secrets/{secret_name}", pathParameters), + } + return m +} +// NewItemActionsSecretsWithSecret_nameItemRequestBuilder instantiates a new ItemActionsSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemActionsSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a secret in an organization using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#delete-an-organization-secret +func (m *ItemActionsSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a single organization secret without revealing its encrypted value.The authenticated user must have collaborator access to a repository to create, update, or read secretsOAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a OrganizationActionsSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-an-organization-secret +func (m *ItemActionsSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationActionsSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsSecretable), nil +} +// Put creates or updates an organization secret with an encrypted value. 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/enterprise-server@3.14/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#create-or-update-an-organization-secret +func (m *ItemActionsSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body ItemActionsSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// Repositories the repositories property +// returns a *ItemActionsSecretsItemRepositoriesRequestBuilder when successful +func (m *ItemActionsSecretsWithSecret_nameItemRequestBuilder) Repositories()(*ItemActionsSecretsItemRepositoriesRequestBuilder) { + return NewItemActionsSecretsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a secret in an organization using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsWithSecret_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a single organization secret without revealing its encrypted value.The authenticated user must have collaborator access to a repository to create, update, or read secretsOAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsWithSecret_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 +} +// ToPutRequestInformation creates or updates an organization secret with an encrypted value. 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/enterprise-server@3.14/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsSecretsItemWithSecret_namePutRequestBodyable, 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 *ItemActionsSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemActionsSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsSecretsWithSecret_nameItemRequestBuilder) { + return NewItemActionsSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_variables_get_response.go b/pkg/github/orgs/item_actions_variables_get_response.go new file mode 100644 index 00000000..09753824 --- /dev/null +++ b/pkg/github/orgs/item_actions_variables_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsVariablesGetResponse 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 total_count property + total_count *int32 + // The variables property + variables []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsVariableable +} +// NewItemActionsVariablesGetResponse instantiates a new ItemActionsVariablesGetResponse and sets the default values. +func NewItemActionsVariablesGetResponse()(*ItemActionsVariablesGetResponse) { + m := &ItemActionsVariablesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsVariablesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsVariablesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsVariablesGetResponse(), 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 *ItemActionsVariablesGetResponse) 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 *ItemActionsVariablesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 + } + res["variables"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationActionsVariableFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsVariableable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsVariableable) + } + } + m.SetVariables(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsVariablesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetVariables gets the variables property value. The variables property +// returns a []OrganizationActionsVariableable when successful +func (m *ItemActionsVariablesGetResponse) GetVariables()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsVariableable) { + return m.variables +} +// Serialize serializes information the current object +func (m *ItemActionsVariablesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetVariables() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVariables())) + for i, v := range m.GetVariables() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("variables", 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 *ItemActionsVariablesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsVariablesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetVariables sets the variables property value. The variables property +func (m *ItemActionsVariablesGetResponse) SetVariables(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsVariableable)() { + m.variables = value +} +type ItemActionsVariablesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetVariables()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsVariableable) + SetTotalCount(value *int32)() + SetVariables(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsVariableable)() +} diff --git a/pkg/github/orgs/item_actions_variables_item_repositories_get_response.go b/pkg/github/orgs/item_actions_variables_item_repositories_get_response.go new file mode 100644 index 00000000..04042277 --- /dev/null +++ b/pkg/github/orgs/item_actions_variables_item_repositories_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemActionsVariablesItemRepositoriesGetResponse 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 repositories property + repositories []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable + // The total_count property + total_count *int32 +} +// NewItemActionsVariablesItemRepositoriesGetResponse instantiates a new ItemActionsVariablesItemRepositoriesGetResponse and sets the default values. +func NewItemActionsVariablesItemRepositoriesGetResponse()(*ItemActionsVariablesItemRepositoriesGetResponse) { + m := &ItemActionsVariablesItemRepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsVariablesItemRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsVariablesItemRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsVariablesItemRepositoriesGetResponse(), 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 *ItemActionsVariablesItemRepositoriesGetResponse) 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 *ItemActionsVariablesItemRepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + m.SetRepositories(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 +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []MinimalRepositoryable when successful +func (m *ItemActionsVariablesItemRepositoriesGetResponse) GetRepositories()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) { + return m.repositories +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemActionsVariablesItemRepositoriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemActionsVariablesItemRepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", 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 *ItemActionsVariablesItemRepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *ItemActionsVariablesItemRepositoriesGetResponse) SetRepositories(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable)() { + m.repositories = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemActionsVariablesItemRepositoriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemActionsVariablesItemRepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + GetTotalCount()(*int32) + SetRepositories(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_actions_variables_item_repositories_put_request_body.go b/pkg/github/orgs/item_actions_variables_item_repositories_put_request_body.go new file mode 100644 index 00000000..98eebbe2 --- /dev/null +++ b/pkg/github/orgs/item_actions_variables_item_repositories_put_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsVariablesItemRepositoriesPutRequestBody 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 IDs of the repositories that can access the organization variable. + selected_repository_ids []int32 +} +// NewItemActionsVariablesItemRepositoriesPutRequestBody instantiates a new ItemActionsVariablesItemRepositoriesPutRequestBody and sets the default values. +func NewItemActionsVariablesItemRepositoriesPutRequestBody()(*ItemActionsVariablesItemRepositoriesPutRequestBody) { + m := &ItemActionsVariablesItemRepositoriesPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsVariablesItemRepositoriesPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsVariablesItemRepositoriesPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsVariablesItemRepositoriesPutRequestBody(), 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 *ItemActionsVariablesItemRepositoriesPutRequestBody) 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 *ItemActionsVariablesItemRepositoriesPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 + } + return res +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. The IDs of the repositories that can access the organization variable. +// returns a []int32 when successful +func (m *ItemActionsVariablesItemRepositoriesPutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemActionsVariablesItemRepositoriesPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *ItemActionsVariablesItemRepositoriesPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. The IDs of the repositories that can access the organization variable. +func (m *ItemActionsVariablesItemRepositoriesPutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type ItemActionsVariablesItemRepositoriesPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedRepositoryIds()([]int32) + SetSelectedRepositoryIds(value []int32)() +} diff --git a/pkg/github/orgs/item_actions_variables_item_repositories_request_builder.go b/pkg/github/orgs/item_actions_variables_item_repositories_request_builder.go new file mode 100644 index 00000000..0119e81b --- /dev/null +++ b/pkg/github/orgs/item_actions_variables_item_repositories_request_builder.go @@ -0,0 +1,100 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsVariablesItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\variables\{name}\repositories +type ItemActionsVariablesItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsVariablesItemRepositoriesRequestBuilderGetQueryParameters lists all repositories that can access an organization variablethat is available to selected repositories.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +type ItemActionsVariablesItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRepository_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.actions.variables.item.repositories.item collection +// returns a *ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemActionsVariablesItemRepositoriesRequestBuilder) ByRepository_id(repository_id int32)(*ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["repository_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(repository_id), 10) + return NewItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsVariablesItemRepositoriesRequestBuilderInternal instantiates a new ItemActionsVariablesItemRepositoriesRequestBuilder and sets the default values. +func NewItemActionsVariablesItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesItemRepositoriesRequestBuilder) { + m := &ItemActionsVariablesItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/variables/{name}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsVariablesItemRepositoriesRequestBuilder instantiates a new ItemActionsVariablesItemRepositoriesRequestBuilder and sets the default values. +func NewItemActionsVariablesItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsVariablesItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all repositories that can access an organization variablethat is available to selected repositories.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsVariablesItemRepositoriesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#list-selected-repositories-for-an-organization-variable +func (m *ItemActionsVariablesItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsVariablesItemRepositoriesRequestBuilderGetQueryParameters])(ItemActionsVariablesItemRepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsVariablesItemRepositoriesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsVariablesItemRepositoriesGetResponseable), nil +} +// Put replaces all repositories for an organization variable that is availableto selected repositories. Organization variables that are available to selectedrepositories have their `visibility` field set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#set-selected-repositories-for-an-organization-variable +func (m *ItemActionsVariablesItemRepositoriesRequestBuilder) Put(ctx context.Context, body ItemActionsVariablesItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists all repositories that can access an organization variablethat is available to selected repositories.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsVariablesItemRepositoriesRequestBuilderGetQueryParameters])(*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 +} +// ToPutRequestInformation replaces all repositories for an organization variable that is availableto selected repositories. Organization variables that are available to selectedrepositories have their `visibility` field set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesItemRepositoriesRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemActionsVariablesItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsVariablesItemRepositoriesRequestBuilder when successful +func (m *ItemActionsVariablesItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemActionsVariablesItemRepositoriesRequestBuilder) { + return NewItemActionsVariablesItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_variables_item_repositories_with_repository_escaped_item_request_builder.go b/pkg/github/orgs/item_actions_variables_item_repositories_with_repository_escaped_item_request_builder.go new file mode 100644 index 00000000..fc015dd2 --- /dev/null +++ b/pkg/github/orgs/item_actions_variables_item_repositories_with_repository_escaped_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\variables\{name}\repositories\{repository_id} +type ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilderInternal instantiates a new ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) { + m := &ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/variables/{name}/repositories/{repository_id}", pathParameters), + } + return m +} +// NewItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder instantiates a new ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a repository from an organization variable that isavailable to selected repositories. Organization variables that are available toselected repositories have their `visibility` field set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#remove-selected-repository-from-an-organization-variable +func (m *ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put adds a repository to an organization variable that is available to selected repositories.Organization variables that are available to selected repositories have their `visibility` field set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#add-selected-repository-to-an-organization-variable +func (m *ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a repository from an organization variable that isavailable to selected repositories. Organization variables that are available toselected repositories have their `visibility` field set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesItemRepositoriesWithRepository_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) + return requestInfo, nil +} +// ToPutRequestInformation adds a repository to an organization variable that is available to selected repositories.Organization variables that are available to selected repositories have their `visibility` field set to `selected`.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder) { + return NewItemActionsVariablesItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_variables_item_with_name_patch_request_body.go b/pkg/github/orgs/item_actions_variables_item_with_name_patch_request_body.go new file mode 100644 index 00000000..02ae1c52 --- /dev/null +++ b/pkg/github/orgs/item_actions_variables_item_with_name_patch_request_body.go @@ -0,0 +1,144 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsVariablesItemWithNamePatchRequestBody 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 name of the variable. + name *string + // An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. + selected_repository_ids []int32 + // The value of the variable. + value *string +} +// NewItemActionsVariablesItemWithNamePatchRequestBody instantiates a new ItemActionsVariablesItemWithNamePatchRequestBody and sets the default values. +func NewItemActionsVariablesItemWithNamePatchRequestBody()(*ItemActionsVariablesItemWithNamePatchRequestBody) { + m := &ItemActionsVariablesItemWithNamePatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsVariablesItemWithNamePatchRequestBody(), 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 *ItemActionsVariablesItemWithNamePatchRequestBody) 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 *ItemActionsVariablesItemWithNamePatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["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["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) GetName()(*string) { + return m.name +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. +// returns a []int32 when successful +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + 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("value", m.GetValue()) + 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 *ItemActionsVariablesItemWithNamePatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemActionsVariablesItemWithNamePatchRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemActionsVariablesItemWithNamePatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetSelectedRepositoryIds()([]int32) + GetValue()(*string) + SetName(value *string)() + SetSelectedRepositoryIds(value []int32)() + SetValue(value *string)() +} diff --git a/pkg/github/orgs/item_actions_variables_post_request_body.go b/pkg/github/orgs/item_actions_variables_post_request_body.go new file mode 100644 index 00000000..50106417 --- /dev/null +++ b/pkg/github/orgs/item_actions_variables_post_request_body.go @@ -0,0 +1,144 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemActionsVariablesPostRequestBody 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 name of the variable. + name *string + // An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. + selected_repository_ids []int32 + // The value of the variable. + value *string +} +// NewItemActionsVariablesPostRequestBody instantiates a new ItemActionsVariablesPostRequestBody and sets the default values. +func NewItemActionsVariablesPostRequestBody()(*ItemActionsVariablesPostRequestBody) { + m := &ItemActionsVariablesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemActionsVariablesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemActionsVariablesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemActionsVariablesPostRequestBody(), 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 *ItemActionsVariablesPostRequestBody) 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 *ItemActionsVariablesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["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["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemActionsVariablesPostRequestBody) GetName()(*string) { + return m.name +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. +// returns a []int32 when successful +func (m *ItemActionsVariablesPostRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemActionsVariablesPostRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemActionsVariablesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + 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("value", m.GetValue()) + 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 *ItemActionsVariablesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemActionsVariablesPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository ids that can access the organization variable. You can only provide a list of repository ids when the `visibility` is set to `selected`. +func (m *ItemActionsVariablesPostRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemActionsVariablesPostRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemActionsVariablesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetSelectedRepositoryIds()([]int32) + GetValue()(*string) + SetName(value *string)() + SetSelectedRepositoryIds(value []int32)() + SetValue(value *string)() +} diff --git a/pkg/github/orgs/item_actions_variables_request_builder.go b/pkg/github/orgs/item_actions_variables_request_builder.go new file mode 100644 index 00000000..b70d7a0b --- /dev/null +++ b/pkg/github/orgs/item_actions_variables_request_builder.go @@ -0,0 +1,107 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsVariablesRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\variables +type ItemActionsVariablesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemActionsVariablesRequestBuilderGetQueryParameters lists all organization variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +type ItemActionsVariablesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 30). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByName gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.actions.variables.item collection +// returns a *ItemActionsVariablesWithNameItemRequestBuilder when successful +func (m *ItemActionsVariablesRequestBuilder) ByName(name string)(*ItemActionsVariablesWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemActionsVariablesWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemActionsVariablesRequestBuilderInternal instantiates a new ItemActionsVariablesRequestBuilder and sets the default values. +func NewItemActionsVariablesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesRequestBuilder) { + m := &ItemActionsVariablesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/variables{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemActionsVariablesRequestBuilder instantiates a new ItemActionsVariablesRequestBuilder and sets the default values. +func NewItemActionsVariablesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsVariablesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all organization variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a ItemActionsVariablesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#list-organization-variables +func (m *ItemActionsVariablesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsVariablesRequestBuilderGetQueryParameters])(ItemActionsVariablesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemActionsVariablesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemActionsVariablesGetResponseable), nil +} +// Post creates an organization variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#create-an-organization-variable +func (m *ItemActionsVariablesRequestBuilder) Post(ctx context.Context, body ItemActionsVariablesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToGetRequestInformation lists all organization variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemActionsVariablesRequestBuilderGetQueryParameters])(*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 organization variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemActionsVariablesPostRequestBodyable, 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 *ItemActionsVariablesRequestBuilder when successful +func (m *ItemActionsVariablesRequestBuilder) WithUrl(rawUrl string)(*ItemActionsVariablesRequestBuilder) { + return NewItemActionsVariablesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_actions_variables_with_name_item_request_builder.go b/pkg/github/orgs/item_actions_variables_with_name_item_request_builder.go new file mode 100644 index 00000000..f127ba9c --- /dev/null +++ b/pkg/github/orgs/item_actions_variables_with_name_item_request_builder.go @@ -0,0 +1,110 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemActionsVariablesWithNameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\actions\variables\{name} +type ItemActionsVariablesWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemActionsVariablesWithNameItemRequestBuilderInternal instantiates a new ItemActionsVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemActionsVariablesWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesWithNameItemRequestBuilder) { + m := &ItemActionsVariablesWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/actions/variables/{name}", pathParameters), + } + return m +} +// NewItemActionsVariablesWithNameItemRequestBuilder instantiates a new ItemActionsVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemActionsVariablesWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemActionsVariablesWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemActionsVariablesWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an organization variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#delete-an-organization-variable +func (m *ItemActionsVariablesWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific variable in an organization.The authenticated user must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a OrganizationActionsVariableable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#get-an-organization-variable +func (m *ItemActionsVariablesWithNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsVariableable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationActionsVariableFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationActionsVariableable), nil +} +// Patch updates an organization variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#update-an-organization-variable +func (m *ItemActionsVariablesWithNameItemRequestBuilder) Patch(ctx context.Context, body ItemActionsVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Repositories the repositories property +// returns a *ItemActionsVariablesItemRepositoriesRequestBuilder when successful +func (m *ItemActionsVariablesWithNameItemRequestBuilder) Repositories()(*ItemActionsVariablesItemRepositoriesRequestBuilder) { + return NewItemActionsVariablesItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes an organization variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesWithNameItemRequestBuilder) 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 +} +// ToGetRequestInformation gets a specific variable in an organization.The authenticated user must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the`admin:org` scope to use this endpoint. If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesWithNameItemRequestBuilder) 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 an organization variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. If the repository is private, the `repo` scope is also required. +// returns a *RequestInformation when successful +func (m *ItemActionsVariablesWithNameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemActionsVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemActionsVariablesWithNameItemRequestBuilder when successful +func (m *ItemActionsVariablesWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemActionsVariablesWithNameItemRequestBuilder) { + return NewItemActionsVariablesWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_announcement_request_builder.go b/pkg/github/orgs/item_announcement_request_builder.go new file mode 100644 index 00000000..ff1c678d --- /dev/null +++ b/pkg/github/orgs/item_announcement_request_builder.go @@ -0,0 +1,110 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemAnnouncementRequestBuilder builds and executes requests for operations under \orgs\{org}\announcement +type ItemAnnouncementRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemAnnouncementRequestBuilderInternal instantiates a new ItemAnnouncementRequestBuilder and sets the default values. +func NewItemAnnouncementRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAnnouncementRequestBuilder) { + m := &ItemAnnouncementRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/announcement", pathParameters), + } + return m +} +// NewItemAnnouncementRequestBuilder instantiates a new ItemAnnouncementRequestBuilder and sets the default values. +func NewItemAnnouncementRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAnnouncementRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemAnnouncementRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes the announcement banner currently set for the organization. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/announcement-banners/organizations#remove-announcement-banner-from-organization +func (m *ItemAnnouncementRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets the announcement banner currently set for the organization. Only returns the announcement banner set at theorganization level. Organization members may also see an enterprise-level announcement banner. To get anannouncement banner displayed at the enterprise level, use the enterprise-level endpoint. +// returns a AnnouncementBannerable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/announcement-banners/organizations#get-announcement-banner-for-organization +func (m *ItemAnnouncementRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AnnouncementBannerable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAnnouncementBannerFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AnnouncementBannerable), nil +} +// Patch sets the announcement banner to display for the organization. +// returns a AnnouncementBannerable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/announcement-banners/organizations#set-announcement-banner-for-organization +func (m *ItemAnnouncementRequestBuilder) Patch(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Announcementable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AnnouncementBannerable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAnnouncementBannerFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AnnouncementBannerable), nil +} +// ToDeleteRequestInformation removes the announcement banner currently set for the organization. +// returns a *RequestInformation when successful +func (m *ItemAnnouncementRequestBuilder) 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 +} +// ToGetRequestInformation gets the announcement banner currently set for the organization. Only returns the announcement banner set at theorganization level. Organization members may also see an enterprise-level announcement banner. To get anannouncement banner displayed at the enterprise level, use the enterprise-level endpoint. +// returns a *RequestInformation when successful +func (m *ItemAnnouncementRequestBuilder) 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 sets the announcement banner to display for the organization. +// returns a *RequestInformation when successful +func (m *ItemAnnouncementRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Announcementable, 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 *ItemAnnouncementRequestBuilder when successful +func (m *ItemAnnouncementRequestBuilder) WithUrl(rawUrl string)(*ItemAnnouncementRequestBuilder) { + return NewItemAnnouncementRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_audit_log_request_builder.go b/pkg/github/orgs/item_audit_log_request_builder.go new file mode 100644 index 00000000..4f9d86fc --- /dev/null +++ b/pkg/github/orgs/item_audit_log_request_builder.go @@ -0,0 +1,78 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i04c7f8edd3ef0430be0ce276abb9cda61c930cab4b366211c818d045ff72b2ab "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/auditlog" +) + +// ItemAuditLogRequestBuilder builds and executes requests for operations under \orgs\{org}\audit-log +type ItemAuditLogRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemAuditLogRequestBuilderGetQueryParameters gets the audit log for an organization. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization)."By default, the response includes up to 30 events from the past three months. Use the `phrase` parameter to filter results and retrieve older events. For example, use the `phrase` parameter with the `created` qualifier to filter events based on when the events occurred. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/enterprise-server@3.14/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/reviewing-the-audit-log-for-your-organization#searching-the-audit-log)."Use pagination to retrieve fewer or more than 30 events. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api)."The authenticated user must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:audit_log` scope to use this endpoint. +type ItemAuditLogRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events before this cursor. + Before *string `uriparametername:"before"` + // The event types to include:- `web` - returns web (non-Git) events.- `git` - returns Git events.- `all` - returns both web and Git events.The default is `web`. + Include *i04c7f8edd3ef0430be0ce276abb9cda61c930cab4b366211c818d045ff72b2ab.GetIncludeQueryParameterType `uriparametername:"include"` + // The order of audit log events. To list newest events first, specify `desc`. To list oldest events first, specify `asc`.The default is `desc`. + Order *i04c7f8edd3ef0430be0ce276abb9cda61c930cab4b366211c818d045ff72b2ab.GetOrderQueryParameterType `uriparametername:"order"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // A search phrase. For more information, see [Searching the audit log](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization#searching-the-audit-log). + Phrase *string `uriparametername:"phrase"` +} +// NewItemAuditLogRequestBuilderInternal instantiates a new ItemAuditLogRequestBuilder and sets the default values. +func NewItemAuditLogRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAuditLogRequestBuilder) { + m := &ItemAuditLogRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/audit-log{?after*,before*,include*,order*,page*,per_page*,phrase*}", pathParameters), + } + return m +} +// NewItemAuditLogRequestBuilder instantiates a new ItemAuditLogRequestBuilder and sets the default values. +func NewItemAuditLogRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemAuditLogRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemAuditLogRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the audit log for an organization. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization)."By default, the response includes up to 30 events from the past three months. Use the `phrase` parameter to filter results and retrieve older events. For example, use the `phrase` parameter with the `created` qualifier to filter events based on when the events occurred. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/enterprise-server@3.14/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/reviewing-the-audit-log-for-your-organization#searching-the-audit-log)."Use pagination to retrieve fewer or more than 30 events. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api)."The authenticated user must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:audit_log` scope to use this endpoint. +// returns a []AuditLogEventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/orgs#get-the-audit-log-for-an-organization +func (m *ItemAuditLogRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemAuditLogRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuditLogEventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuditLogEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuditLogEventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuditLogEventable) + } + } + return val, nil +} +// ToGetRequestInformation gets the audit log for an organization. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization)."By default, the response includes up to 30 events from the past three months. Use the `phrase` parameter to filter results and retrieve older events. For example, use the `phrase` parameter with the `created` qualifier to filter events based on when the events occurred. For more information, see "[Reviewing the audit log for your organization](https://docs.github.com/enterprise-server@3.14/organizations/keeping-your-organization-secure/managing-security-settings-for-your-organization/reviewing-the-audit-log-for-your-organization#searching-the-audit-log)."Use pagination to retrieve fewer or more than 30 events. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api)."The authenticated user must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:audit_log` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemAuditLogRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemAuditLogRequestBuilderGetQueryParameters])(*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 *ItemAuditLogRequestBuilder when successful +func (m *ItemAuditLogRequestBuilder) WithUrl(rawUrl string)(*ItemAuditLogRequestBuilder) { + return NewItemAuditLogRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_code_scanning_alerts_request_builder.go b/pkg/github/orgs/item_code_scanning_alerts_request_builder.go new file mode 100644 index 00000000..f2fe1e69 --- /dev/null +++ b/pkg/github/orgs/item_code_scanning_alerts_request_builder.go @@ -0,0 +1,90 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i1e97532633c35959774d6dec446f118e7a655cf7dc39b9ee2611dab6a379a957 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/codescanning/alerts" +) + +// ItemCodeScanningAlertsRequestBuilder builds and executes requests for operations under \orgs\{org}\code-scanning\alerts +type ItemCodeScanningAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCodeScanningAlertsRequestBuilderGetQueryParameters lists code scanning alerts for the default branch for all eligible repositories in an organization. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` or `repo`s cope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +type ItemCodeScanningAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *i1e97532633c35959774d6dec446f118e7a655cf7dc39b9ee2611dab6a379a957.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // If specified, only code scanning alerts with this severity will be returned. + Severity *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertSeverity `uriparametername:"severity"` + // The property by which to sort the results. + Sort *i1e97532633c35959774d6dec446f118e7a655cf7dc39b9ee2611dab6a379a957.GetSortQueryParameterType `uriparametername:"sort"` + // If specified, only code scanning alerts with this state will be returned. + State *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertStateQuery `uriparametername:"state"` + // The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. + Tool_guid *string `uriparametername:"tool_guid"` + // The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. + Tool_name *string `uriparametername:"tool_name"` +} +// NewItemCodeScanningAlertsRequestBuilderInternal instantiates a new ItemCodeScanningAlertsRequestBuilder and sets the default values. +func NewItemCodeScanningAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeScanningAlertsRequestBuilder) { + m := &ItemCodeScanningAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/code-scanning/alerts{?after*,before*,direction*,page*,per_page*,severity*,sort*,state*,tool_guid*,tool_name*}", pathParameters), + } + return m +} +// NewItemCodeScanningAlertsRequestBuilder instantiates a new ItemCodeScanningAlertsRequestBuilder and sets the default values. +func NewItemCodeScanningAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeScanningAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeScanningAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists code scanning alerts for the default branch for all eligible repositories in an organization. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` or `repo`s cope to use this endpoint with private or public repositories, or the `public_repo` scope to use this endpoint with only public repositories. +// returns a []CodeScanningOrganizationAlertItemsable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a Alerts503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-an-organization +func (m *ItemCodeScanningAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodeScanningAlertsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningOrganizationAlertItemsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAlerts503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningOrganizationAlertItemsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningOrganizationAlertItemsable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningOrganizationAlertItemsable) + } + } + return val, nil +} +// ToGetRequestInformation lists code scanning alerts for the default branch for all eligible repositories in an organization. Eligible repositories are repositories that are owned by organizations that you own or for which you are a security manager. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` or `repo`s cope 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 *ItemCodeScanningAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCodeScanningAlertsRequestBuilderGetQueryParameters])(*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 *ItemCodeScanningAlertsRequestBuilder when successful +func (m *ItemCodeScanningAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemCodeScanningAlertsRequestBuilder) { + return NewItemCodeScanningAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_code_scanning_request_builder.go b/pkg/github/orgs/item_code_scanning_request_builder.go new file mode 100644 index 00000000..be8d7425 --- /dev/null +++ b/pkg/github/orgs/item_code_scanning_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemCodeScanningRequestBuilder builds and executes requests for operations under \orgs\{org}\code-scanning +type ItemCodeScanningRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemCodeScanningAlertsRequestBuilder when successful +func (m *ItemCodeScanningRequestBuilder) Alerts()(*ItemCodeScanningAlertsRequestBuilder) { + return NewItemCodeScanningAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCodeScanningRequestBuilderInternal instantiates a new ItemCodeScanningRequestBuilder and sets the default values. +func NewItemCodeScanningRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeScanningRequestBuilder) { + m := &ItemCodeScanningRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/code-scanning", pathParameters), + } + return m +} +// NewItemCodeScanningRequestBuilder instantiates a new ItemCodeScanningRequestBuilder and sets the default values. +func NewItemCodeScanningRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCodeScanningRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCodeScanningRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/item_custom_repository_roles_get_response.go b/pkg/github/orgs/item_custom_repository_roles_get_response.go new file mode 100644 index 00000000..5648f1c5 --- /dev/null +++ b/pkg/github/orgs/item_custom_repository_roles_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemCustomRepositoryRolesGetResponse 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 custom_roles property + custom_roles []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable + // The number of custom roles in this organization + total_count *int32 +} +// NewItemCustomRepositoryRolesGetResponse instantiates a new ItemCustomRepositoryRolesGetResponse and sets the default values. +func NewItemCustomRepositoryRolesGetResponse()(*ItemCustomRepositoryRolesGetResponse) { + m := &ItemCustomRepositoryRolesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCustomRepositoryRolesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCustomRepositoryRolesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCustomRepositoryRolesGetResponse(), 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 *ItemCustomRepositoryRolesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCustomRoles gets the custom_roles property value. The custom_roles property +// returns a []OrganizationCustomRepositoryRoleable when successful +func (m *ItemCustomRepositoryRolesGetResponse) GetCustomRoles()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable) { + return m.custom_roles +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemCustomRepositoryRolesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["custom_roles"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationCustomRepositoryRoleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable) + } + } + m.SetCustomRoles(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 number of custom roles in this organization +// returns a *int32 when successful +func (m *ItemCustomRepositoryRolesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemCustomRepositoryRolesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCustomRoles() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCustomRoles())) + for i, v := range m.GetCustomRoles() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("custom_roles", 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 *ItemCustomRepositoryRolesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCustomRoles sets the custom_roles property value. The custom_roles property +func (m *ItemCustomRepositoryRolesGetResponse) SetCustomRoles(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable)() { + m.custom_roles = value +} +// SetTotalCount sets the total_count property value. The number of custom roles in this organization +func (m *ItemCustomRepositoryRolesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemCustomRepositoryRolesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCustomRoles()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable) + GetTotalCount()(*int32) + SetCustomRoles(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_custom_repository_roles_request_builder.go b/pkg/github/orgs/item_custom_repository_roles_request_builder.go new file mode 100644 index 00000000..a7c6bf85 --- /dev/null +++ b/pkg/github/orgs/item_custom_repository_roles_request_builder.go @@ -0,0 +1,105 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemCustomRepositoryRolesRequestBuilder builds and executes requests for operations under \orgs\{org}\custom-repository-roles +type ItemCustomRepositoryRolesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRole_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.customRepositoryRoles.item collection +// returns a *ItemCustomRepositoryRolesWithRole_ItemRequestBuilder when successful +func (m *ItemCustomRepositoryRolesRequestBuilder) ByRole_id(role_id int32)(*ItemCustomRepositoryRolesWithRole_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["role_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(role_id), 10) + return NewItemCustomRepositoryRolesWithRole_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCustomRepositoryRolesRequestBuilderInternal instantiates a new ItemCustomRepositoryRolesRequestBuilder and sets the default values. +func NewItemCustomRepositoryRolesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCustomRepositoryRolesRequestBuilder) { + m := &ItemCustomRepositoryRolesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/custom-repository-roles", pathParameters), + } + return m +} +// NewItemCustomRepositoryRolesRequestBuilder instantiates a new ItemCustomRepositoryRolesRequestBuilder and sets the default values. +func NewItemCustomRepositoryRolesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCustomRepositoryRolesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCustomRepositoryRolesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the custom repository roles available in this organization. For more information on custom repository roles, see "[About custom repository roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-repository-roles)."The authenticated user must be an administrator of the organization or of a repository of the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. +// returns a ItemCustomRepositoryRolesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/custom-roles#list-custom-repository-roles-in-an-organization +func (m *ItemCustomRepositoryRolesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemCustomRepositoryRolesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemCustomRepositoryRolesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemCustomRepositoryRolesGetResponseable), nil +} +// Post creates a custom repository role that can be used by all repositories owned by the organization. For more information on custom repository roles, see "[About custom repository roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-repository-roles)."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. +// returns a OrganizationCustomRepositoryRoleable 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/enterprise-server@3.14/rest/orgs/custom-roles#create-a-custom-repository-role +func (m *ItemCustomRepositoryRolesRequestBuilder) Post(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleCreateSchemaable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationCustomRepositoryRoleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable), nil +} +// ToGetRequestInformation list the custom repository roles available in this organization. For more information on custom repository roles, see "[About custom repository roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-repository-roles)."The authenticated user must be an administrator of the organization or of a repository of the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCustomRepositoryRolesRequestBuilder) 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 a custom repository role that can be used by all repositories owned by the organization. For more information on custom repository roles, see "[About custom repository roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-repository-roles)."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. +// returns a *RequestInformation when successful +func (m *ItemCustomRepositoryRolesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleCreateSchemaable, 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 *ItemCustomRepositoryRolesRequestBuilder when successful +func (m *ItemCustomRepositoryRolesRequestBuilder) WithUrl(rawUrl string)(*ItemCustomRepositoryRolesRequestBuilder) { + return NewItemCustomRepositoryRolesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_custom_repository_roles_with_role_escaped_item_request_builder.go b/pkg/github/orgs/item_custom_repository_roles_with_role_escaped_item_request_builder.go new file mode 100644 index 00000000..2a084152 --- /dev/null +++ b/pkg/github/orgs/item_custom_repository_roles_with_role_escaped_item_request_builder.go @@ -0,0 +1,120 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemCustomRepositoryRolesWithRole_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\custom-repository-roles\{role_id} +type ItemCustomRepositoryRolesWithRole_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCustomRepositoryRolesWithRole_ItemRequestBuilderInternal instantiates a new ItemCustomRepositoryRolesWithRole_ItemRequestBuilder and sets the default values. +func NewItemCustomRepositoryRolesWithRole_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCustomRepositoryRolesWithRole_ItemRequestBuilder) { + m := &ItemCustomRepositoryRolesWithRole_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/custom-repository-roles/{role_id}", pathParameters), + } + return m +} +// NewItemCustomRepositoryRolesWithRole_ItemRequestBuilder instantiates a new ItemCustomRepositoryRolesWithRole_ItemRequestBuilder and sets the default values. +func NewItemCustomRepositoryRolesWithRole_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCustomRepositoryRolesWithRole_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCustomRepositoryRolesWithRole_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a custom role from an organization. Once the custom role has been deleted, anyuser, team, or invitation with the deleted custom role will be reassigned the inherited role. For more information about custom repository roles, see "[About custom repository roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-repository-roles)."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. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/custom-roles#delete-a-custom-repository-role +func (m *ItemCustomRepositoryRolesWithRole_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a custom repository role that is available to all repositories owned by the organization. For more information on custom repository roles, see "[About custom repository roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-repository-roles)."The authenticated user must be an administrator of the organization or of a repository of the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. +// returns a OrganizationCustomRepositoryRoleable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/custom-roles#get-a-custom-repository-role +func (m *ItemCustomRepositoryRolesWithRole_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationCustomRepositoryRoleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable), nil +} +// Patch updates a custom repository role that can be used by all repositories owned by the organization. For more information about custom repository roles, see "[About custom repository roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-repository-roles)."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. +// returns a OrganizationCustomRepositoryRoleable 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/enterprise-server@3.14/rest/orgs/custom-roles#update-a-custom-repository-role +func (m *ItemCustomRepositoryRolesWithRole_ItemRequestBuilder) Patch(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleUpdateSchemaable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationCustomRepositoryRoleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleable), nil +} +// ToDeleteRequestInformation deletes a custom role from an organization. Once the custom role has been deleted, anyuser, team, or invitation with the deleted custom role will be reassigned the inherited role. For more information about custom repository roles, see "[About custom repository roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-repository-roles)."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. +// returns a *RequestInformation when successful +func (m *ItemCustomRepositoryRolesWithRole_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a custom repository role that is available to all repositories owned by the organization. For more information on custom repository roles, see "[About custom repository roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-repository-roles)."The authenticated user must be an administrator of the organization or of a repository of the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemCustomRepositoryRolesWithRole_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 custom repository role that can be used by all repositories owned by the organization. For more information about custom repository roles, see "[About custom repository roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-repository-roles)."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. +// returns a *RequestInformation when successful +func (m *ItemCustomRepositoryRolesWithRole_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomRepositoryRoleUpdateSchemaable, 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 *ItemCustomRepositoryRolesWithRole_ItemRequestBuilder when successful +func (m *ItemCustomRepositoryRolesWithRole_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemCustomRepositoryRolesWithRole_ItemRequestBuilder) { + return NewItemCustomRepositoryRolesWithRole_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_dependabot_alerts_request_builder.go b/pkg/github/orgs/item_dependabot_alerts_request_builder.go new file mode 100644 index 00000000..19cb9cce --- /dev/null +++ b/pkg/github/orgs/item_dependabot_alerts_request_builder.go @@ -0,0 +1,98 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i2a9b242c816cd3407964bab8573864203d494f3b0754df96c1843fd975098c4a "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/dependabot/alerts" +) + +// ItemDependabotAlertsRequestBuilder builds and executes requests for operations under \orgs\{org}\dependabot\alerts +type ItemDependabotAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDependabotAlertsRequestBuilderGetQueryParameters lists Dependabot alerts for an organization.The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +type ItemDependabotAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *i2a9b242c816cd3407964bab8573864203d494f3b0754df96c1843fd975098c4a.GetDirectionQueryParameterType `uriparametername:"direction"` + // A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned.Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust` + Ecosystem *string `uriparametername:"ecosystem"` + // **Deprecated**. The number of results per page (max 100), starting from the first matching result.This parameter must not be used in combination with `last`.Instead, use `per_page` in combination with `after` to fetch the first page of results. + First *int32 `uriparametername:"first"` + // **Deprecated**. The number of results per page (max 100), starting from the last matching result.This parameter must not be used in combination with `first`.Instead, use `per_page` in combination with `before` to fetch the last page of results. + Last *int32 `uriparametername:"last"` + // A comma-separated list of package names. If specified, only alerts for these packages will be returned. + Package *string `uriparametername:"package"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. + Scope *i2a9b242c816cd3407964bab8573864203d494f3b0754df96c1843fd975098c4a.GetScopeQueryParameterType `uriparametername:"scope"` + // A comma-separated list of severities. If specified, only alerts with these severities will be returned.Can be: `low`, `medium`, `high`, `critical` + Severity *string `uriparametername:"severity"` + // The property by which to sort the results.`created` means when the alert was created.`updated` means when the alert's state last changed. + Sort *i2a9b242c816cd3407964bab8573864203d494f3b0754df96c1843fd975098c4a.GetSortQueryParameterType `uriparametername:"sort"` + // A comma-separated list of states. If specified, only alerts with these states will be returned.Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` + State *string `uriparametername:"state"` +} +// NewItemDependabotAlertsRequestBuilderInternal instantiates a new ItemDependabotAlertsRequestBuilder and sets the default values. +func NewItemDependabotAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotAlertsRequestBuilder) { + m := &ItemDependabotAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/dependabot/alerts{?after*,before*,direction*,ecosystem*,first*,last*,package*,per_page*,scope*,severity*,sort*,state*}", pathParameters), + } + return m +} +// NewItemDependabotAlertsRequestBuilder instantiates a new ItemDependabotAlertsRequestBuilder and sets the default values. +func NewItemDependabotAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists Dependabot alerts for an organization.The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a []DependabotAlertWithRepositoryable 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 ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/alerts#list-dependabot-alerts-for-an-organization +func (m *ItemDependabotAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotAlertsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotAlertWithRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDependabotAlertWithRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotAlertWithRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotAlertWithRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists Dependabot alerts for an organization.The authenticated user must be an owner or security manager for the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemDependabotAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotAlertsRequestBuilderGetQueryParameters])(*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 *ItemDependabotAlertsRequestBuilder when successful +func (m *ItemDependabotAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemDependabotAlertsRequestBuilder) { + return NewItemDependabotAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_dependabot_request_builder.go b/pkg/github/orgs/item_dependabot_request_builder.go new file mode 100644 index 00000000..3b6682e8 --- /dev/null +++ b/pkg/github/orgs/item_dependabot_request_builder.go @@ -0,0 +1,33 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemDependabotRequestBuilder builds and executes requests for operations under \orgs\{org}\dependabot +type ItemDependabotRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemDependabotAlertsRequestBuilder when successful +func (m *ItemDependabotRequestBuilder) Alerts()(*ItemDependabotAlertsRequestBuilder) { + return NewItemDependabotAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDependabotRequestBuilderInternal instantiates a new ItemDependabotRequestBuilder and sets the default values. +func NewItemDependabotRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotRequestBuilder) { + m := &ItemDependabotRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/dependabot", pathParameters), + } + return m +} +// NewItemDependabotRequestBuilder instantiates a new ItemDependabotRequestBuilder and sets the default values. +func NewItemDependabotRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotRequestBuilderInternal(urlParams, requestAdapter) +} +// Secrets the secrets property +// returns a *ItemDependabotSecretsRequestBuilder when successful +func (m *ItemDependabotRequestBuilder) Secrets()(*ItemDependabotSecretsRequestBuilder) { + return NewItemDependabotSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/orgs/item_dependabot_secrets_get_response.go b/pkg/github/orgs/item_dependabot_secrets_get_response.go new file mode 100644 index 00000000..49e5791c --- /dev/null +++ b/pkg/github/orgs/item_dependabot_secrets_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemDependabotSecretsGetResponse 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 secrets property + secrets []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationDependabotSecretable + // The total_count property + total_count *int32 +} +// NewItemDependabotSecretsGetResponse instantiates a new ItemDependabotSecretsGetResponse and sets the default values. +func NewItemDependabotSecretsGetResponse()(*ItemDependabotSecretsGetResponse) { + m := &ItemDependabotSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDependabotSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDependabotSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDependabotSecretsGetResponse(), 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 *ItemDependabotSecretsGetResponse) 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 *ItemDependabotSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationDependabotSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationDependabotSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationDependabotSecretable) + } + } + m.SetSecrets(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 +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []OrganizationDependabotSecretable when successful +func (m *ItemDependabotSecretsGetResponse) GetSecrets()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationDependabotSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemDependabotSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemDependabotSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", 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 *ItemDependabotSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemDependabotSecretsGetResponse) SetSecrets(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationDependabotSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemDependabotSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemDependabotSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationDependabotSecretable) + GetTotalCount()(*int32) + SetSecrets(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationDependabotSecretable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_dependabot_secrets_item_repositories_get_response.go b/pkg/github/orgs/item_dependabot_secrets_item_repositories_get_response.go new file mode 100644 index 00000000..8f35c996 --- /dev/null +++ b/pkg/github/orgs/item_dependabot_secrets_item_repositories_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemDependabotSecretsItemRepositoriesGetResponse 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 repositories property + repositories []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable + // The total_count property + total_count *int32 +} +// NewItemDependabotSecretsItemRepositoriesGetResponse instantiates a new ItemDependabotSecretsItemRepositoriesGetResponse and sets the default values. +func NewItemDependabotSecretsItemRepositoriesGetResponse()(*ItemDependabotSecretsItemRepositoriesGetResponse) { + m := &ItemDependabotSecretsItemRepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDependabotSecretsItemRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDependabotSecretsItemRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDependabotSecretsItemRepositoriesGetResponse(), 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 *ItemDependabotSecretsItemRepositoriesGetResponse) 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 *ItemDependabotSecretsItemRepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + m.SetRepositories(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 +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []MinimalRepositoryable when successful +func (m *ItemDependabotSecretsItemRepositoriesGetResponse) GetRepositories()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) { + return m.repositories +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemDependabotSecretsItemRepositoriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemDependabotSecretsItemRepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", 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 *ItemDependabotSecretsItemRepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *ItemDependabotSecretsItemRepositoriesGetResponse) SetRepositories(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable)() { + m.repositories = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemDependabotSecretsItemRepositoriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemDependabotSecretsItemRepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + GetTotalCount()(*int32) + SetRepositories(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_dependabot_secrets_item_repositories_put_request_body.go b/pkg/github/orgs/item_dependabot_secrets_item_repositories_put_request_body.go new file mode 100644 index 00000000..8596546a --- /dev/null +++ b/pkg/github/orgs/item_dependabot_secrets_item_repositories_put_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDependabotSecretsItemRepositoriesPutRequestBody 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 array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + selected_repository_ids []int32 +} +// NewItemDependabotSecretsItemRepositoriesPutRequestBody instantiates a new ItemDependabotSecretsItemRepositoriesPutRequestBody and sets the default values. +func NewItemDependabotSecretsItemRepositoriesPutRequestBody()(*ItemDependabotSecretsItemRepositoriesPutRequestBody) { + m := &ItemDependabotSecretsItemRepositoriesPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDependabotSecretsItemRepositoriesPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDependabotSecretsItemRepositoriesPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDependabotSecretsItemRepositoriesPutRequestBody(), 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 *ItemDependabotSecretsItemRepositoriesPutRequestBody) 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 *ItemDependabotSecretsItemRepositoriesPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 + } + return res +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +// returns a []int32 when successful +func (m *ItemDependabotSecretsItemRepositoriesPutRequestBody) GetSelectedRepositoryIds()([]int32) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemDependabotSecretsItemRepositoriesPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSelectedRepositoryIds() != nil { + err := writer.WriteCollectionOfInt32Values("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *ItemDependabotSecretsItemRepositoriesPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSelectedRepositoryIds sets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can add and remove individual repositories using the [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret) and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +func (m *ItemDependabotSecretsItemRepositoriesPutRequestBody) SetSelectedRepositoryIds(value []int32)() { + m.selected_repository_ids = value +} +type ItemDependabotSecretsItemRepositoriesPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSelectedRepositoryIds()([]int32) + SetSelectedRepositoryIds(value []int32)() +} diff --git a/pkg/github/orgs/item_dependabot_secrets_item_repositories_request_builder.go b/pkg/github/orgs/item_dependabot_secrets_item_repositories_request_builder.go new file mode 100644 index 00000000..6fde6350 --- /dev/null +++ b/pkg/github/orgs/item_dependabot_secrets_item_repositories_request_builder.go @@ -0,0 +1,100 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemDependabotSecretsItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\dependabot\secrets\{secret_name}\repositories +type ItemDependabotSecretsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDependabotSecretsItemRepositoriesRequestBuilderGetQueryParameters lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemDependabotSecretsItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRepository_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.dependabot.secrets.item.repositories.item collection +// returns a *ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemDependabotSecretsItemRepositoriesRequestBuilder) ByRepository_id(repository_id int32)(*ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["repository_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(repository_id), 10) + return NewItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDependabotSecretsItemRepositoriesRequestBuilderInternal instantiates a new ItemDependabotSecretsItemRepositoriesRequestBuilder and sets the default values. +func NewItemDependabotSecretsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsItemRepositoriesRequestBuilder) { + m := &ItemDependabotSecretsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/dependabot/secrets/{secret_name}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemDependabotSecretsItemRepositoriesRequestBuilder instantiates a new ItemDependabotSecretsItemRepositoriesRequestBuilder and sets the default values. +func NewItemDependabotSecretsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotSecretsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemDependabotSecretsItemRepositoriesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret +func (m *ItemDependabotSecretsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotSecretsItemRepositoriesRequestBuilderGetQueryParameters])(ItemDependabotSecretsItemRepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemDependabotSecretsItemRepositoriesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemDependabotSecretsItemRepositoriesGetResponseable), nil +} +// Put replaces all repositories for an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret +func (m *ItemDependabotSecretsItemRepositoriesRequestBuilder) Put(ctx context.Context, body ItemDependabotSecretsItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists all repositories that have been selected when the `visibility`for repository access to a secret is set to `selected`.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotSecretsItemRepositoriesRequestBuilderGetQueryParameters])(*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 +} +// ToPutRequestInformation replaces all repositories for an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsItemRepositoriesRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemDependabotSecretsItemRepositoriesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemDependabotSecretsItemRepositoriesRequestBuilder when successful +func (m *ItemDependabotSecretsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemDependabotSecretsItemRepositoriesRequestBuilder) { + return NewItemDependabotSecretsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_dependabot_secrets_item_repositories_with_repository_escaped_item_request_builder.go b/pkg/github/orgs/item_dependabot_secrets_item_repositories_with_repository_escaped_item_request_builder.go new file mode 100644 index 00000000..1626fa94 --- /dev/null +++ b/pkg/github/orgs/item_dependabot_secrets_item_repositories_with_repository_escaped_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\dependabot\secrets\{secret_name}\repositories\{repository_id} +type ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal instantiates a new ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + m := &ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/dependabot/secrets/{secret_name}/repositories/{repository_id}", pathParameters), + } + return m +} +// NewItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder instantiates a new ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a repository from an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret +func (m *ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put adds a repository to an organization secret when the `visibility` forrepository access is set to `selected`. The visibility is set when you [Create orupdate an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#add-selected-repository-to-an-organization-secret +func (m *ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a repository from an organization secret when the `visibility`for repository access is set to `selected`. The visibility is set when you [Createor update an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsItemRepositoriesWithRepository_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) + return requestInfo, nil +} +// ToPutRequestInformation adds a repository to an organization secret when the `visibility` forrepository access is set to `selected`. The visibility is set when you [Create orupdate an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#create-or-update-an-organization-secret).OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder) { + return NewItemDependabotSecretsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_dependabot_secrets_item_with_secret_escaped_name_put_request_body.go b/pkg/github/orgs/item_dependabot_secrets_item_with_secret_escaped_name_put_request_body.go new file mode 100644 index 00000000..dc30fb17 --- /dev/null +++ b/pkg/github/orgs/item_dependabot_secrets_item_with_secret_escaped_name_put_request_body.go @@ -0,0 +1,144 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDependabotSecretsItemWithSecret_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 + // Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#get-an-organization-public-key) endpoint. + encrypted_value *string + // ID of the key you used to encrypt the secret. + key_id *string + // An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. + selected_repository_ids []string +} +// NewItemDependabotSecretsItemWithSecret_namePutRequestBody instantiates a new ItemDependabotSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewItemDependabotSecretsItemWithSecret_namePutRequestBody()(*ItemDependabotSecretsItemWithSecret_namePutRequestBody) { + m := &ItemDependabotSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDependabotSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDependabotSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDependabotSecretsItemWithSecret_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 *ItemDependabotSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#get-an-organization-public-key) endpoint. +// returns a *string when successful +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) 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 *ItemDependabotSecretsItemWithSecret_namePutRequestBody) 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("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.SetSelectedRepositoryIds(res) + } + return nil + } + return res +} +// GetKeyId gets the key_id property value. ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// GetSelectedRepositoryIds gets the selected_repository_ids property value. An array of repository ids that can access the organization secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +// returns a []string when successful +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) GetSelectedRepositoryIds()([]string) { + return m.selected_repository_ids +} +// Serialize serializes information the current object +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) 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.WriteCollectionOfStringValues("selected_repository_ids", m.GetSelectedRepositoryIds()) + 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 *ItemDependabotSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an organization public key](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#get-an-organization-public-key) endpoint. +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. ID of the key you used to encrypt the secret. +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) 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 secret. You can only provide a list of repository ids when the `visibility` is set to `selected`. You can manage the list of selected repositories using the [List selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#list-selected-repositories-for-an-organization-secret), [Set selected repositories for an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#set-selected-repositories-for-an-organization-secret), and [Remove selected repository from an organization secret](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#remove-selected-repository-from-an-organization-secret) endpoints. +func (m *ItemDependabotSecretsItemWithSecret_namePutRequestBody) SetSelectedRepositoryIds(value []string)() { + m.selected_repository_ids = value +} +type ItemDependabotSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + GetSelectedRepositoryIds()([]string) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() + SetSelectedRepositoryIds(value []string)() +} diff --git a/pkg/github/orgs/item_dependabot_secrets_public_key_request_builder.go b/pkg/github/orgs/item_dependabot_secrets_public_key_request_builder.go new file mode 100644 index 00000000..f3e38971 --- /dev/null +++ b/pkg/github/orgs/item_dependabot_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemDependabotSecretsPublicKeyRequestBuilder builds and executes requests for operations under \orgs\{org}\dependabot\secrets\public-key +type ItemDependabotSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemDependabotSecretsPublicKeyRequestBuilderInternal instantiates a new ItemDependabotSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemDependabotSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsPublicKeyRequestBuilder) { + m := &ItemDependabotSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/dependabot/secrets/public-key", pathParameters), + } + return m +} +// NewItemDependabotSecretsPublicKeyRequestBuilder instantiates a new ItemDependabotSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemDependabotSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a DependabotPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#get-an-organization-public-key +func (m *ItemDependabotSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDependabotPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotPublicKeyable), nil +} +// ToGetRequestInformation gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsPublicKeyRequestBuilder) 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 *ItemDependabotSecretsPublicKeyRequestBuilder when successful +func (m *ItemDependabotSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemDependabotSecretsPublicKeyRequestBuilder) { + return NewItemDependabotSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_dependabot_secrets_request_builder.go b/pkg/github/orgs/item_dependabot_secrets_request_builder.go new file mode 100644 index 00000000..101e62d8 --- /dev/null +++ b/pkg/github/orgs/item_dependabot_secrets_request_builder.go @@ -0,0 +1,80 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemDependabotSecretsRequestBuilder builds and executes requests for operations under \orgs\{org}\dependabot\secrets +type ItemDependabotSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDependabotSecretsRequestBuilderGetQueryParameters lists all secrets available in an organization without revealing theirencrypted values.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemDependabotSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/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-enterprise-server/pkg/github.orgs.item.dependabot.secrets.item collection +// returns a *ItemDependabotSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemDependabotSecretsRequestBuilder) BySecret_name(secret_name string)(*ItemDependabotSecretsWithSecret_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 NewItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDependabotSecretsRequestBuilderInternal instantiates a new ItemDependabotSecretsRequestBuilder and sets the default values. +func NewItemDependabotSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsRequestBuilder) { + m := &ItemDependabotSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/dependabot/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemDependabotSecretsRequestBuilder instantiates a new ItemDependabotSecretsRequestBuilder and sets the default values. +func NewItemDependabotSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all secrets available in an organization without revealing theirencrypted values.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemDependabotSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#list-organization-secrets +func (m *ItemDependabotSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotSecretsRequestBuilderGetQueryParameters])(ItemDependabotSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemDependabotSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemDependabotSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *ItemDependabotSecretsPublicKeyRequestBuilder when successful +func (m *ItemDependabotSecretsRequestBuilder) PublicKey()(*ItemDependabotSecretsPublicKeyRequestBuilder) { + return NewItemDependabotSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all secrets available in an organization without revealing theirencrypted values.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDependabotSecretsRequestBuilderGetQueryParameters])(*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 *ItemDependabotSecretsRequestBuilder when successful +func (m *ItemDependabotSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemDependabotSecretsRequestBuilder) { + return NewItemDependabotSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_dependabot_secrets_with_secret_escaped_name_item_request_builder.go b/pkg/github/orgs/item_dependabot_secrets_with_secret_escaped_name_item_request_builder.go new file mode 100644 index 00000000..18ff3ec8 --- /dev/null +++ b/pkg/github/orgs/item_dependabot_secrets_with_secret_escaped_name_item_request_builder.go @@ -0,0 +1,115 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemDependabotSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\dependabot\secrets\{secret_name} +type ItemDependabotSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new ItemDependabotSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsWithSecret_nameItemRequestBuilder) { + m := &ItemDependabotSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/dependabot/secrets/{secret_name}", pathParameters), + } + return m +} +// NewItemDependabotSecretsWithSecret_nameItemRequestBuilder instantiates a new ItemDependabotSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemDependabotSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDependabotSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a secret in an organization using the secret name.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#delete-an-organization-secret +func (m *ItemDependabotSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a single organization secret without revealing its encrypted value.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a OrganizationDependabotSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#get-an-organization-secret +func (m *ItemDependabotSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationDependabotSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationDependabotSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationDependabotSecretable), nil +} +// Put creates or updates an organization secret with an encrypted value. 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/enterprise-server@3.14/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 EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#create-or-update-an-organization-secret +func (m *ItemDependabotSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body ItemDependabotSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// Repositories the repositories property +// returns a *ItemDependabotSecretsItemRepositoriesRequestBuilder when successful +func (m *ItemDependabotSecretsWithSecret_nameItemRequestBuilder) Repositories()(*ItemDependabotSecretsItemRepositoriesRequestBuilder) { + return NewItemDependabotSecretsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a secret in an organization using the secret name.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDependabotSecretsWithSecret_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a single organization secret without revealing 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 *ItemDependabotSecretsWithSecret_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 +} +// ToPutRequestInformation creates or updates an organization secret with an encrypted value. 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/enterprise-server@3.14/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 *ItemDependabotSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemDependabotSecretsItemWithSecret_namePutRequestBodyable, 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 *ItemDependabotSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemDependabotSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemDependabotSecretsWithSecret_nameItemRequestBuilder) { + return NewItemDependabotSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_docker_conflicts_request_builder.go b/pkg/github/orgs/item_docker_conflicts_request_builder.go new file mode 100644 index 00000000..d904fbb6 --- /dev/null +++ b/pkg/github/orgs/item_docker_conflicts_request_builder.go @@ -0,0 +1,66 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemDockerConflictsRequestBuilder builds and executes requests for operations under \orgs\{org}\docker\conflicts +type ItemDockerConflictsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemDockerConflictsRequestBuilderInternal instantiates a new ItemDockerConflictsRequestBuilder and sets the default values. +func NewItemDockerConflictsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerConflictsRequestBuilder) { + m := &ItemDockerConflictsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/docker/conflicts", pathParameters), + } + return m +} +// NewItemDockerConflictsRequestBuilder instantiates a new ItemDockerConflictsRequestBuilder and sets the default values. +func NewItemDockerConflictsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerConflictsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDockerConflictsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all packages that are in a specific organization, are readable by the requesting user, and that encountered a conflict during a Docker migration.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. +// returns a []PackageEscapedable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-organization +func (m *ItemDockerConflictsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageEscapedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable) + } + } + return val, nil +} +// ToGetRequestInformation lists all packages that are in a specific organization, are readable by the requesting user, and that encountered a conflict during a Docker migration.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDockerConflictsRequestBuilder) 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 *ItemDockerConflictsRequestBuilder when successful +func (m *ItemDockerConflictsRequestBuilder) WithUrl(rawUrl string)(*ItemDockerConflictsRequestBuilder) { + return NewItemDockerConflictsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_docker_request_builder.go b/pkg/github/orgs/item_docker_request_builder.go new file mode 100644 index 00000000..31f37911 --- /dev/null +++ b/pkg/github/orgs/item_docker_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemDockerRequestBuilder builds and executes requests for operations under \orgs\{org}\docker +type ItemDockerRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Conflicts the conflicts property +// returns a *ItemDockerConflictsRequestBuilder when successful +func (m *ItemDockerRequestBuilder) Conflicts()(*ItemDockerConflictsRequestBuilder) { + return NewItemDockerConflictsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDockerRequestBuilderInternal instantiates a new ItemDockerRequestBuilder and sets the default values. +func NewItemDockerRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerRequestBuilder) { + m := &ItemDockerRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/docker", pathParameters), + } + return m +} +// NewItemDockerRequestBuilder instantiates a new ItemDockerRequestBuilder and sets the default values. +func NewItemDockerRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDockerRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/item_events_request_builder.go b/pkg/github/orgs/item_events_request_builder.go new file mode 100644 index 00000000..bc4fcfde --- /dev/null +++ b/pkg/github/orgs/item_events_request_builder.go @@ -0,0 +1,67 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemEventsRequestBuilder builds and executes requests for operations under \orgs\{org}\events +type ItemEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemEventsRequestBuilderGetQueryParameters > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +type ItemEventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemEventsRequestBuilderInternal instantiates a new ItemEventsRequestBuilder and sets the default values. +func NewItemEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsRequestBuilder) { + m := &ItemEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/events{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemEventsRequestBuilder instantiates a new ItemEventsRequestBuilder and sets the default values. +func NewItemEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a []Eventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/events#list-public-organization-events +func (m *ItemEventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable) + } + } + return val, nil +} +// ToGetRequestInformation > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a *RequestInformation when successful +func (m *ItemEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsRequestBuilderGetQueryParameters])(*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 *ItemEventsRequestBuilder when successful +func (m *ItemEventsRequestBuilder) WithUrl(rawUrl string)(*ItemEventsRequestBuilder) { + return NewItemEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_external_group_request_builder.go b/pkg/github/orgs/item_external_group_request_builder.go new file mode 100644 index 00000000..e460a203 --- /dev/null +++ b/pkg/github/orgs/item_external_group_request_builder.go @@ -0,0 +1,34 @@ +package orgs + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemExternalGroupRequestBuilder builds and executes requests for operations under \orgs\{org}\external-group +type ItemExternalGroupRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByGroup_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.externalGroup.item collection +// returns a *ItemExternalGroupWithGroup_ItemRequestBuilder when successful +func (m *ItemExternalGroupRequestBuilder) ByGroup_id(group_id int32)(*ItemExternalGroupWithGroup_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["group_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(group_id), 10) + return NewItemExternalGroupWithGroup_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemExternalGroupRequestBuilderInternal instantiates a new ItemExternalGroupRequestBuilder and sets the default values. +func NewItemExternalGroupRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemExternalGroupRequestBuilder) { + m := &ItemExternalGroupRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/external-group", pathParameters), + } + return m +} +// NewItemExternalGroupRequestBuilder instantiates a new ItemExternalGroupRequestBuilder and sets the default values. +func NewItemExternalGroupRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemExternalGroupRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemExternalGroupRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/item_external_group_with_group_escaped_item_request_builder.go b/pkg/github/orgs/item_external_group_with_group_escaped_item_request_builder.go new file mode 100644 index 00000000..a60476e1 --- /dev/null +++ b/pkg/github/orgs/item_external_group_with_group_escaped_item_request_builder.go @@ -0,0 +1,64 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemExternalGroupWithGroup_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\external-group\{group_id} +type ItemExternalGroupWithGroup_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemExternalGroupWithGroup_ItemRequestBuilderGetQueryParameters displays information about the specific group's usage. Provides a list of the group's external members as well as a list of teams that this group is connected to.You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products)" in the GitHub Help documentation. +type ItemExternalGroupWithGroup_ItemRequestBuilderGetQueryParameters struct { + // The page number of the "members" array results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page for the "members" array (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemExternalGroupWithGroup_ItemRequestBuilderInternal instantiates a new ItemExternalGroupWithGroup_ItemRequestBuilder and sets the default values. +func NewItemExternalGroupWithGroup_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemExternalGroupWithGroup_ItemRequestBuilder) { + m := &ItemExternalGroupWithGroup_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/external-group/{group_id}{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemExternalGroupWithGroup_ItemRequestBuilder instantiates a new ItemExternalGroupWithGroup_ItemRequestBuilder and sets the default values. +func NewItemExternalGroupWithGroup_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemExternalGroupWithGroup_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemExternalGroupWithGroup_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get displays information about the specific group's usage. Provides a list of the group's external members as well as a list of teams that this group is connected to.You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products)" in the GitHub Help documentation. +// returns a ExternalGroupable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/external-groups#get-an-external-group +func (m *ItemExternalGroupWithGroup_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemExternalGroupWithGroup_ItemRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ExternalGroupable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateExternalGroupFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ExternalGroupable), nil +} +// ToGetRequestInformation displays information about the specific group's usage. Provides a list of the group's external members as well as a list of teams that this group is connected to.You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products)" in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemExternalGroupWithGroup_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemExternalGroupWithGroup_ItemRequestBuilderGetQueryParameters])(*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 *ItemExternalGroupWithGroup_ItemRequestBuilder when successful +func (m *ItemExternalGroupWithGroup_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemExternalGroupWithGroup_ItemRequestBuilder) { + return NewItemExternalGroupWithGroup_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_external_groups_request_builder.go b/pkg/github/orgs/item_external_groups_request_builder.go new file mode 100644 index 00000000..5fcf75c5 --- /dev/null +++ b/pkg/github/orgs/item_external_groups_request_builder.go @@ -0,0 +1,66 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemExternalGroupsRequestBuilder builds and executes requests for operations under \orgs\{org}\external-groups +type ItemExternalGroupsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemExternalGroupsRequestBuilderGetQueryParameters lists external groups available in an organization. You can query the groups using the `display_name` parameter, only groups with a `group_name` containing the text provided in the `display_name` parameter will be returned. You can also limit your page results using the `per_page` parameter. GitHub Enterprise Server generates a url-encoded `page` token using a cursor value for where the next page begins. For more information on cursor pagination, see "[Offset and Cursor Pagination explained](https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89)."You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products)" in the GitHub Help documentation. +type ItemExternalGroupsRequestBuilderGetQueryParameters struct { + // Limits the list to groups containing the text in the group name + Display_name *string `uriparametername:"display_name"` + // Page token + 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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemExternalGroupsRequestBuilderInternal instantiates a new ItemExternalGroupsRequestBuilder and sets the default values. +func NewItemExternalGroupsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemExternalGroupsRequestBuilder) { + m := &ItemExternalGroupsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/external-groups{?display_name*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemExternalGroupsRequestBuilder instantiates a new ItemExternalGroupsRequestBuilder and sets the default values. +func NewItemExternalGroupsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemExternalGroupsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemExternalGroupsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists external groups available in an organization. You can query the groups using the `display_name` parameter, only groups with a `group_name` containing the text provided in the `display_name` parameter will be returned. You can also limit your page results using the `per_page` parameter. GitHub Enterprise Server generates a url-encoded `page` token using a cursor value for where the next page begins. For more information on cursor pagination, see "[Offset and Cursor Pagination explained](https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89)."You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products)" in the GitHub Help documentation. +// returns a ExternalGroupsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/external-groups#list-external-groups-in-an-organization +func (m *ItemExternalGroupsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemExternalGroupsRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ExternalGroupsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateExternalGroupsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ExternalGroupsable), nil +} +// ToGetRequestInformation lists external groups available in an organization. You can query the groups using the `display_name` parameter, only groups with a `group_name` containing the text provided in the `display_name` parameter will be returned. You can also limit your page results using the `per_page` parameter. GitHub Enterprise Server generates a url-encoded `page` token using a cursor value for where the next page begins. For more information on cursor pagination, see "[Offset and Cursor Pagination explained](https://dev.to/jackmarchant/offset-and-cursor-pagination-explained-b89)."You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products)" in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemExternalGroupsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemExternalGroupsRequestBuilderGetQueryParameters])(*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 *ItemExternalGroupsRequestBuilder when successful +func (m *ItemExternalGroupsRequestBuilder) WithUrl(rawUrl string)(*ItemExternalGroupsRequestBuilder) { + return NewItemExternalGroupsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_hooks_item_config_patch_request_body.go b/pkg/github/orgs/item_hooks_item_config_patch_request_body.go new file mode 100644 index 00000000..c354739b --- /dev/null +++ b/pkg/github/orgs/item_hooks_item_config_patch_request_body.go @@ -0,0 +1,168 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemHooksItemConfigPatchRequestBody 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 media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewItemHooksItemConfigPatchRequestBody instantiates a new ItemHooksItemConfigPatchRequestBody and sets the default values. +func NewItemHooksItemConfigPatchRequestBody()(*ItemHooksItemConfigPatchRequestBody) { + m := &ItemHooksItemConfigPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemHooksItemConfigPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemHooksItemConfigPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemHooksItemConfigPatchRequestBody(), 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 *ItemHooksItemConfigPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *ItemHooksItemConfigPatchRequestBody) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemHooksItemConfigPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a WebhookConfigInsecureSslable when successful +func (m *ItemHooksItemConfigPatchRequestBody) GetInsecureSsl()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). +// returns a *string when successful +func (m *ItemHooksItemConfigPatchRequestBody) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *ItemHooksItemConfigPatchRequestBody) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ItemHooksItemConfigPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ItemHooksItemConfigPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *ItemHooksItemConfigPatchRequestBody) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *ItemHooksItemConfigPatchRequestBody) SetInsecureSsl(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). +func (m *ItemHooksItemConfigPatchRequestBody) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *ItemHooksItemConfigPatchRequestBody) SetUrl(value *string)() { + m.url = value +} +type ItemHooksItemConfigPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/orgs/item_hooks_item_config_request_builder.go b/pkg/github/orgs/item_hooks_item_config_request_builder.go new file mode 100644 index 00000000..4dba787e --- /dev/null +++ b/pkg/github/orgs/item_hooks_item_config_request_builder.go @@ -0,0 +1,88 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemHooksItemConfigRequestBuilder builds and executes requests for operations under \orgs\{org}\hooks\{hook_id}\config +type ItemHooksItemConfigRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemHooksItemConfigRequestBuilderInternal instantiates a new ItemHooksItemConfigRequestBuilder and sets the default values. +func NewItemHooksItemConfigRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemConfigRequestBuilder) { + m := &ItemHooksItemConfigRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/hooks/{hook_id}/config", pathParameters), + } + return m +} +// NewItemHooksItemConfigRequestBuilder instantiates a new ItemHooksItemConfigRequestBuilder and sets the default values. +func NewItemHooksItemConfigRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemConfigRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemHooksItemConfigRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)."You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a WebhookConfigable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization +func (m *ItemHooksItemConfigRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWebhookConfigFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable), nil +} +// Patch updates the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)."You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a WebhookConfigable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization +func (m *ItemHooksItemConfigRequestBuilder) Patch(ctx context.Context, body ItemHooksItemConfigPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWebhookConfigFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable), nil +} +// ToGetRequestInformation returns the webhook configuration for an organization. To get more information about the webhook, including the `active` state and `events`, use "[Get an organization webhook ](/rest/orgs/webhooks#get-an-organization-webhook)."You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a *RequestInformation when successful +func (m *ItemHooksItemConfigRequestBuilder) 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 the webhook configuration for an organization. To update more information about the webhook, including the `active` state and `events`, use "[Update an organization webhook ](/rest/orgs/webhooks#update-an-organization-webhook)."You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a *RequestInformation when successful +func (m *ItemHooksItemConfigRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemHooksItemConfigPatchRequestBodyable, 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 *ItemHooksItemConfigRequestBuilder when successful +func (m *ItemHooksItemConfigRequestBuilder) WithUrl(rawUrl string)(*ItemHooksItemConfigRequestBuilder) { + return NewItemHooksItemConfigRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_post_response.go b/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_post_response.go new file mode 100644 index 00000000..f8282972 --- /dev/null +++ b/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_post_response.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemHooksItemDeliveriesItemAttemptsPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemHooksItemDeliveriesItemAttemptsPostResponse instantiates a new ItemHooksItemDeliveriesItemAttemptsPostResponse and sets the default values. +func NewItemHooksItemDeliveriesItemAttemptsPostResponse()(*ItemHooksItemDeliveriesItemAttemptsPostResponse) { + m := &ItemHooksItemDeliveriesItemAttemptsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemHooksItemDeliveriesItemAttemptsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemHooksItemDeliveriesItemAttemptsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemHooksItemDeliveriesItemAttemptsPostResponse(), 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 *ItemHooksItemDeliveriesItemAttemptsPostResponse) 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 *ItemHooksItemDeliveriesItemAttemptsPostResponse) 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 *ItemHooksItemDeliveriesItemAttemptsPostResponse) 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 *ItemHooksItemDeliveriesItemAttemptsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemHooksItemDeliveriesItemAttemptsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_request_builder.go b/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_request_builder.go new file mode 100644 index 00000000..547b124a --- /dev/null +++ b/pkg/github/orgs/item_hooks_item_deliveries_item_attempts_request_builder.go @@ -0,0 +1,63 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemHooksItemDeliveriesItemAttemptsRequestBuilder builds and executes requests for operations under \orgs\{org}\hooks\{hook_id}\deliveries\{delivery_id}\attempts +type ItemHooksItemDeliveriesItemAttemptsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal instantiates a new ItemHooksItemDeliveriesItemAttemptsRequestBuilder and sets the default values. +func NewItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + m := &ItemHooksItemDeliveriesItemAttemptsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}/attempts", pathParameters), + } + return m +} +// NewItemHooksItemDeliveriesItemAttemptsRequestBuilder instantiates a new ItemHooksItemDeliveriesItemAttemptsRequestBuilder and sets the default values. +func NewItemHooksItemDeliveriesItemAttemptsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post redeliver a delivery for a webhook configured in an organization.You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a ItemHooksItemDeliveriesItemAttemptsPostResponseable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/webhooks#redeliver-a-delivery-for-an-organization-webhook +func (m *ItemHooksItemDeliveriesItemAttemptsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemHooksItemDeliveriesItemAttemptsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemHooksItemDeliveriesItemAttemptsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemHooksItemDeliveriesItemAttemptsPostResponseable), nil +} +// ToPostRequestInformation redeliver a delivery for a webhook configured in an organization.You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a *RequestInformation when successful +func (m *ItemHooksItemDeliveriesItemAttemptsRequestBuilder) 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 *ItemHooksItemDeliveriesItemAttemptsRequestBuilder when successful +func (m *ItemHooksItemDeliveriesItemAttemptsRequestBuilder) WithUrl(rawUrl string)(*ItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + return NewItemHooksItemDeliveriesItemAttemptsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_hooks_item_deliveries_request_builder.go b/pkg/github/orgs/item_hooks_item_deliveries_request_builder.go new file mode 100644 index 00000000..57908185 --- /dev/null +++ b/pkg/github/orgs/item_hooks_item_deliveries_request_builder.go @@ -0,0 +1,85 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemHooksItemDeliveriesRequestBuilder builds and executes requests for operations under \orgs\{org}\hooks\{hook_id}\deliveries +type ItemHooksItemDeliveriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemHooksItemDeliveriesRequestBuilderGetQueryParameters returns a list of webhook deliveries for a webhook configured in an organization.You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +type ItemHooksItemDeliveriesRequestBuilderGetQueryParameters struct { + // Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + Cursor *string `uriparametername:"cursor"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + Redelivery *bool `uriparametername:"redelivery"` +} +// ByDelivery_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.hooks.item.deliveries.item collection +// returns a *ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder when successful +func (m *ItemHooksItemDeliveriesRequestBuilder) ByDelivery_id(delivery_id int32)(*ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["delivery_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(delivery_id), 10) + return NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemHooksItemDeliveriesRequestBuilderInternal instantiates a new ItemHooksItemDeliveriesRequestBuilder and sets the default values. +func NewItemHooksItemDeliveriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemDeliveriesRequestBuilder) { + m := &ItemHooksItemDeliveriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/hooks/{hook_id}/deliveries{?cursor*,per_page*,redelivery*}", pathParameters), + } + return m +} +// NewItemHooksItemDeliveriesRequestBuilder instantiates a new ItemHooksItemDeliveriesRequestBuilder and sets the default values. +func NewItemHooksItemDeliveriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemDeliveriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemHooksItemDeliveriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a list of webhook deliveries for a webhook configured in an organization.You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a []HookDeliveryItemable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/webhooks#list-deliveries-for-an-organization-webhook +func (m *ItemHooksItemDeliveriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemHooksItemDeliveriesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryItemable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateHookDeliveryItemFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryItemable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryItemable) + } + } + return val, nil +} +// ToGetRequestInformation returns a list of webhook deliveries for a webhook configured in an organization.You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a *RequestInformation when successful +func (m *ItemHooksItemDeliveriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemHooksItemDeliveriesRequestBuilderGetQueryParameters])(*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 *ItemHooksItemDeliveriesRequestBuilder when successful +func (m *ItemHooksItemDeliveriesRequestBuilder) WithUrl(rawUrl string)(*ItemHooksItemDeliveriesRequestBuilder) { + return NewItemHooksItemDeliveriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_hooks_item_deliveries_with_delivery_escaped_item_request_builder.go b/pkg/github/orgs/item_hooks_item_deliveries_with_delivery_escaped_item_request_builder.go new file mode 100644 index 00000000..f66f8105 --- /dev/null +++ b/pkg/github/orgs/item_hooks_item_deliveries_with_delivery_escaped_item_request_builder.go @@ -0,0 +1,68 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\hooks\{hook_id}\deliveries\{delivery_id} +type ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Attempts the attempts property +// returns a *ItemHooksItemDeliveriesItemAttemptsRequestBuilder when successful +func (m *ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) Attempts()(*ItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + return NewItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal instantiates a new ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder and sets the default values. +func NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + m := &ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/hooks/{hook_id}/deliveries/{delivery_id}", pathParameters), + } + return m +} +// NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder instantiates a new ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder and sets the default values. +func NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a delivery for a webhook configured in an organization.You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a HookDeliveryable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/webhooks#get-a-webhook-delivery-for-an-organization-webhook +func (m *ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateHookDeliveryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryable), nil +} +// ToGetRequestInformation returns a delivery for a webhook configured in an organization.You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a *RequestInformation when successful +func (m *ItemHooksItemDeliveriesWithDelivery_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder when successful +func (m *ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + return NewItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_hooks_item_pings_request_builder.go b/pkg/github/orgs/item_hooks_item_pings_request_builder.go new file mode 100644 index 00000000..00d1f024 --- /dev/null +++ b/pkg/github/orgs/item_hooks_item_pings_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemHooksItemPingsRequestBuilder builds and executes requests for operations under \orgs\{org}\hooks\{hook_id}\pings +type ItemHooksItemPingsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemHooksItemPingsRequestBuilderInternal instantiates a new ItemHooksItemPingsRequestBuilder and sets the default values. +func NewItemHooksItemPingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemPingsRequestBuilder) { + m := &ItemHooksItemPingsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/hooks/{hook_id}/pings", pathParameters), + } + return m +} +// NewItemHooksItemPingsRequestBuilder instantiates a new ItemHooksItemPingsRequestBuilder and sets the default values. +func NewItemHooksItemPingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksItemPingsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemHooksItemPingsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post this will trigger a [ping event](https://docs.github.com/enterprise-server@3.14/webhooks/#ping-event)to be sent to the hook.You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/webhooks#ping-an-organization-webhook +func (m *ItemHooksItemPingsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation this will trigger a [ping event](https://docs.github.com/enterprise-server@3.14/webhooks/#ping-event)to be sent to the hook.You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a *RequestInformation when successful +func (m *ItemHooksItemPingsRequestBuilder) 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 *ItemHooksItemPingsRequestBuilder when successful +func (m *ItemHooksItemPingsRequestBuilder) WithUrl(rawUrl string)(*ItemHooksItemPingsRequestBuilder) { + return NewItemHooksItemPingsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_hooks_item_with_hook_escaped_patch_request_body.go b/pkg/github/orgs/item_hooks_item_with_hook_escaped_patch_request_body.go new file mode 100644 index 00000000..29ff82aa --- /dev/null +++ b/pkg/github/orgs/item_hooks_item_with_hook_escaped_patch_request_body.go @@ -0,0 +1,173 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemHooksItemWithHook_PatchRequestBody struct { + // Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + active *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Key/value pairs to provide settings for this webhook. + config ItemHooksItemWithHook_PatchRequestBody_configable + // Determines what [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) the hook is triggered for. + events []string + // The name property + name *string +} +// NewItemHooksItemWithHook_PatchRequestBody instantiates a new ItemHooksItemWithHook_PatchRequestBody and sets the default values. +func NewItemHooksItemWithHook_PatchRequestBody()(*ItemHooksItemWithHook_PatchRequestBody) { + m := &ItemHooksItemWithHook_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemHooksItemWithHook_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemHooksItemWithHook_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemHooksItemWithHook_PatchRequestBody(), nil +} +// GetActive gets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +// returns a *bool when successful +func (m *ItemHooksItemWithHook_PatchRequestBody) GetActive()(*bool) { + return m.active +} +// 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 *ItemHooksItemWithHook_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfig gets the config property value. Key/value pairs to provide settings for this webhook. +// returns a ItemHooksItemWithHook_PatchRequestBody_configable when successful +func (m *ItemHooksItemWithHook_PatchRequestBody) GetConfig()(ItemHooksItemWithHook_PatchRequestBody_configable) { + return m.config +} +// GetEvents gets the events property value. Determines what [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) the hook is triggered for. +// returns a []string when successful +func (m *ItemHooksItemWithHook_PatchRequestBody) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemHooksItemWithHook_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemHooksItemWithHook_PatchRequestBody_configFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(ItemHooksItemWithHook_PatchRequestBody_configable)) + } + return nil + } + res["events"] = 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.SetEvents(res) + } + 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 property +// returns a *string when successful +func (m *ItemHooksItemWithHook_PatchRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemHooksItemWithHook_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +func (m *ItemHooksItemWithHook_PatchRequestBody) SetActive(value *bool)() { + m.active = 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 *ItemHooksItemWithHook_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfig sets the config property value. Key/value pairs to provide settings for this webhook. +func (m *ItemHooksItemWithHook_PatchRequestBody) SetConfig(value ItemHooksItemWithHook_PatchRequestBody_configable)() { + m.config = value +} +// SetEvents sets the events property value. Determines what [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) the hook is triggered for. +func (m *ItemHooksItemWithHook_PatchRequestBody) SetEvents(value []string)() { + m.events = value +} +// SetName sets the name property value. The name property +func (m *ItemHooksItemWithHook_PatchRequestBody) SetName(value *string)() { + m.name = value +} +type ItemHooksItemWithHook_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetConfig()(ItemHooksItemWithHook_PatchRequestBody_configable) + GetEvents()([]string) + GetName()(*string) + SetActive(value *bool)() + SetConfig(value ItemHooksItemWithHook_PatchRequestBody_configable)() + SetEvents(value []string)() + SetName(value *string)() +} diff --git a/pkg/github/orgs/item_hooks_item_with_hook_escaped_patch_request_body_escaped_config.go b/pkg/github/orgs/item_hooks_item_with_hook_escaped_patch_request_body_escaped_config.go new file mode 100644 index 00000000..10d31a46 --- /dev/null +++ b/pkg/github/orgs/item_hooks_item_with_hook_escaped_patch_request_body_escaped_config.go @@ -0,0 +1,169 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemHooksItemWithHook_PatchRequestBody_config key/value pairs to provide settings for this webhook. +type ItemHooksItemWithHook_PatchRequestBody_config 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 media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewItemHooksItemWithHook_PatchRequestBody_config instantiates a new ItemHooksItemWithHook_PatchRequestBody_config and sets the default values. +func NewItemHooksItemWithHook_PatchRequestBody_config()(*ItemHooksItemWithHook_PatchRequestBody_config) { + m := &ItemHooksItemWithHook_PatchRequestBody_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemHooksItemWithHook_PatchRequestBody_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemHooksItemWithHook_PatchRequestBody_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemHooksItemWithHook_PatchRequestBody_config(), 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 *ItemHooksItemWithHook_PatchRequestBody_config) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *ItemHooksItemWithHook_PatchRequestBody_config) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemHooksItemWithHook_PatchRequestBody_config) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a WebhookConfigInsecureSslable when successful +func (m *ItemHooksItemWithHook_PatchRequestBody_config) GetInsecureSsl()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). +// returns a *string when successful +func (m *ItemHooksItemWithHook_PatchRequestBody_config) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *ItemHooksItemWithHook_PatchRequestBody_config) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ItemHooksItemWithHook_PatchRequestBody_config) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ItemHooksItemWithHook_PatchRequestBody_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *ItemHooksItemWithHook_PatchRequestBody_config) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *ItemHooksItemWithHook_PatchRequestBody_config) SetInsecureSsl(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). +func (m *ItemHooksItemWithHook_PatchRequestBody_config) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *ItemHooksItemWithHook_PatchRequestBody_config) SetUrl(value *string)() { + m.url = value +} +type ItemHooksItemWithHook_PatchRequestBody_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/orgs/item_hooks_post_request_body.go b/pkg/github/orgs/item_hooks_post_request_body.go new file mode 100644 index 00000000..fe0ecfd2 --- /dev/null +++ b/pkg/github/orgs/item_hooks_post_request_body.go @@ -0,0 +1,173 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemHooksPostRequestBody struct { + // Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + active *bool + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Key/value pairs to provide settings for this webhook. + config ItemHooksPostRequestBody_configable + // Determines what [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. + events []string + // Must be passed as "web". + name *string +} +// NewItemHooksPostRequestBody instantiates a new ItemHooksPostRequestBody and sets the default values. +func NewItemHooksPostRequestBody()(*ItemHooksPostRequestBody) { + m := &ItemHooksPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemHooksPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemHooksPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemHooksPostRequestBody(), nil +} +// GetActive gets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +// returns a *bool when successful +func (m *ItemHooksPostRequestBody) GetActive()(*bool) { + return m.active +} +// 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 *ItemHooksPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfig gets the config property value. Key/value pairs to provide settings for this webhook. +// returns a ItemHooksPostRequestBody_configable when successful +func (m *ItemHooksPostRequestBody) GetConfig()(ItemHooksPostRequestBody_configable) { + return m.config +} +// GetEvents gets the events property value. Determines what [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. +// returns a []string when successful +func (m *ItemHooksPostRequestBody) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemHooksPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemHooksPostRequestBody_configFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(ItemHooksPostRequestBody_configable)) + } + return nil + } + res["events"] = 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.SetEvents(res) + } + 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. Must be passed as "web". +// returns a *string when successful +func (m *ItemHooksPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemHooksPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +func (m *ItemHooksPostRequestBody) SetActive(value *bool)() { + m.active = 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 *ItemHooksPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfig sets the config property value. Key/value pairs to provide settings for this webhook. +func (m *ItemHooksPostRequestBody) SetConfig(value ItemHooksPostRequestBody_configable)() { + m.config = value +} +// SetEvents sets the events property value. Determines what [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) the hook is triggered for. Set to `["*"]` to receive all possible events. +func (m *ItemHooksPostRequestBody) SetEvents(value []string)() { + m.events = value +} +// SetName sets the name property value. Must be passed as "web". +func (m *ItemHooksPostRequestBody) SetName(value *string)() { + m.name = value +} +type ItemHooksPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetConfig()(ItemHooksPostRequestBody_configable) + GetEvents()([]string) + GetName()(*string) + SetActive(value *bool)() + SetConfig(value ItemHooksPostRequestBody_configable)() + SetEvents(value []string)() + SetName(value *string)() +} diff --git a/pkg/github/orgs/item_hooks_post_request_body_escaped_config.go b/pkg/github/orgs/item_hooks_post_request_body_escaped_config.go new file mode 100644 index 00000000..9082cbd3 --- /dev/null +++ b/pkg/github/orgs/item_hooks_post_request_body_escaped_config.go @@ -0,0 +1,227 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemHooksPostRequestBody_config key/value pairs to provide settings for this webhook. +type ItemHooksPostRequestBody_config 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 media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable + // The password property + password *string + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string + // The username property + username *string +} +// NewItemHooksPostRequestBody_config instantiates a new ItemHooksPostRequestBody_config and sets the default values. +func NewItemHooksPostRequestBody_config()(*ItemHooksPostRequestBody_config) { + m := &ItemHooksPostRequestBody_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemHooksPostRequestBody_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemHooksPostRequestBody_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemHooksPostRequestBody_config(), 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 *ItemHooksPostRequestBody_config) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *ItemHooksPostRequestBody_config) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemHooksPostRequestBody_config) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)) + } + return nil + } + res["password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPassword(val) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + res["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 +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a WebhookConfigInsecureSslable when successful +func (m *ItemHooksPostRequestBody_config) GetInsecureSsl()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetPassword gets the password property value. The password property +// returns a *string when successful +func (m *ItemHooksPostRequestBody_config) GetPassword()(*string) { + return m.password +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). +// returns a *string when successful +func (m *ItemHooksPostRequestBody_config) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *ItemHooksPostRequestBody_config) GetUrl()(*string) { + return m.url +} +// GetUsername gets the username property value. The username property +// returns a *string when successful +func (m *ItemHooksPostRequestBody_config) GetUsername()(*string) { + return m.username +} +// Serialize serializes information the current object +func (m *ItemHooksPostRequestBody_config) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("password", m.GetPassword()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ItemHooksPostRequestBody_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *ItemHooksPostRequestBody_config) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *ItemHooksPostRequestBody_config) SetInsecureSsl(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetPassword sets the password property value. The password property +func (m *ItemHooksPostRequestBody_config) SetPassword(value *string)() { + m.password = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). +func (m *ItemHooksPostRequestBody_config) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *ItemHooksPostRequestBody_config) SetUrl(value *string)() { + m.url = value +} +// SetUsername sets the username property value. The username property +func (m *ItemHooksPostRequestBody_config) SetUsername(value *string)() { + m.username = value +} +type ItemHooksPostRequestBody_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable) + GetPassword()(*string) + GetSecret()(*string) + GetUrl()(*string) + GetUsername()(*string) + SetContentType(value *string)() + SetInsecureSsl(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)() + SetPassword(value *string)() + SetSecret(value *string)() + SetUrl(value *string)() + SetUsername(value *string)() +} diff --git a/pkg/github/orgs/item_hooks_request_builder.go b/pkg/github/orgs/item_hooks_request_builder.go new file mode 100644 index 00000000..03719750 --- /dev/null +++ b/pkg/github/orgs/item_hooks_request_builder.go @@ -0,0 +1,119 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemHooksRequestBuilder builds and executes requests for operations under \orgs\{org}\hooks +type ItemHooksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemHooksRequestBuilderGetQueryParameters you must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +type ItemHooksRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByHook_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.hooks.item collection +// returns a *ItemHooksWithHook_ItemRequestBuilder when successful +func (m *ItemHooksRequestBuilder) ByHook_id(hook_id int32)(*ItemHooksWithHook_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["hook_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(hook_id), 10) + return NewItemHooksWithHook_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemHooksRequestBuilderInternal instantiates a new ItemHooksRequestBuilder and sets the default values. +func NewItemHooksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksRequestBuilder) { + m := &ItemHooksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/hooks{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemHooksRequestBuilder instantiates a new ItemHooksRequestBuilder and sets the default values. +func NewItemHooksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemHooksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get you must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a []OrgHookable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/webhooks#list-organization-webhooks +func (m *ItemHooksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemHooksRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgHookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgHookable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgHookable) + } + } + return val, nil +} +// Post create a hook that posts payloads in JSON format.You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, oredit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a OrgHookable 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/enterprise-server@3.14/rest/orgs/webhooks#create-an-organization-webhook +func (m *ItemHooksRequestBuilder) Post(ctx context.Context, body ItemHooksPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgHookable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgHookable), nil +} +// ToGetRequestInformation you must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a *RequestInformation when successful +func (m *ItemHooksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemHooksRequestBuilderGetQueryParameters])(*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 create a hook that posts payloads in JSON format.You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, oredit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a *RequestInformation when successful +func (m *ItemHooksRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemHooksPostRequestBodyable, 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 *ItemHooksRequestBuilder when successful +func (m *ItemHooksRequestBuilder) WithUrl(rawUrl string)(*ItemHooksRequestBuilder) { + return NewItemHooksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_hooks_with_hook_escaped_item_request_builder.go b/pkg/github/orgs/item_hooks_with_hook_escaped_item_request_builder.go new file mode 100644 index 00000000..48ec56a2 --- /dev/null +++ b/pkg/github/orgs/item_hooks_with_hook_escaped_item_request_builder.go @@ -0,0 +1,140 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemHooksWithHook_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\hooks\{hook_id} +type ItemHooksWithHook_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Config the config property +// returns a *ItemHooksItemConfigRequestBuilder when successful +func (m *ItemHooksWithHook_ItemRequestBuilder) Config()(*ItemHooksItemConfigRequestBuilder) { + return NewItemHooksItemConfigRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemHooksWithHook_ItemRequestBuilderInternal instantiates a new ItemHooksWithHook_ItemRequestBuilder and sets the default values. +func NewItemHooksWithHook_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksWithHook_ItemRequestBuilder) { + m := &ItemHooksWithHook_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/hooks/{hook_id}", pathParameters), + } + return m +} +// NewItemHooksWithHook_ItemRequestBuilder instantiates a new ItemHooksWithHook_ItemRequestBuilder and sets the default values. +func NewItemHooksWithHook_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHooksWithHook_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemHooksWithHook_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete you must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/webhooks#delete-an-organization-webhook +func (m *ItemHooksWithHook_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 { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Deliveries the deliveries property +// returns a *ItemHooksItemDeliveriesRequestBuilder when successful +func (m *ItemHooksWithHook_ItemRequestBuilder) Deliveries()(*ItemHooksItemDeliveriesRequestBuilder) { + return NewItemHooksItemDeliveriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get returns a webhook configured in an organization. To get only the webhook`config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization).You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a OrgHookable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/webhooks#get-an-organization-webhook +func (m *ItemHooksWithHook_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgHookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgHookable), nil +} +// Patch updates a webhook configured in an organization. When you update a webhook,the `secret` will be overwritten. If you previously had a `secret` set, you mustprovide the same `secret` or set a new `secret` or the secret will be removed. Ifyou are only updating individual webhook `config` properties, use "[Update a webhookconfiguration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)".You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a OrgHookable 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/enterprise-server@3.14/rest/orgs/webhooks#update-an-organization-webhook +func (m *ItemHooksWithHook_ItemRequestBuilder) Patch(ctx context.Context, body ItemHooksItemWithHook_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgHookable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgHookable), nil +} +// Pings the pings property +// returns a *ItemHooksItemPingsRequestBuilder when successful +func (m *ItemHooksWithHook_ItemRequestBuilder) Pings()(*ItemHooksItemPingsRequestBuilder) { + return NewItemHooksItemPingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation you must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a *RequestInformation when successful +func (m *ItemHooksWithHook_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") + return requestInfo, nil +} +// ToGetRequestInformation returns a webhook configured in an organization. To get only the webhook`config` properties, see "[Get a webhook configuration for an organization](/rest/orgs/webhooks#get-a-webhook-configuration-for-an-organization).You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a *RequestInformation when successful +func (m *ItemHooksWithHook_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 webhook configured in an organization. When you update a webhook,the `secret` will be overwritten. If you previously had a `secret` set, you mustprovide the same `secret` or set a new `secret` or the secret will be removed. Ifyou are only updating individual webhook `config` properties, use "[Update a webhookconfiguration for an organization](/rest/orgs/webhooks#update-a-webhook-configuration-for-an-organization)".You must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need `admin:org_hook` scope. OAuth apps cannot list, view, or editwebhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps. +// returns a *RequestInformation when successful +func (m *ItemHooksWithHook_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemHooksItemWithHook_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 *ItemHooksWithHook_ItemRequestBuilder when successful +func (m *ItemHooksWithHook_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemHooksWithHook_ItemRequestBuilder) { + return NewItemHooksWithHook_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_installation_request_builder.go b/pkg/github/orgs/item_installation_request_builder.go new file mode 100644 index 00000000..7834fd03 --- /dev/null +++ b/pkg/github/orgs/item_installation_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemInstallationRequestBuilder builds and executes requests for operations under \orgs\{org}\installation +type ItemInstallationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemInstallationRequestBuilderInternal instantiates a new ItemInstallationRequestBuilder and sets the default values. +func NewItemInstallationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInstallationRequestBuilder) { + m := &ItemInstallationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/installation", pathParameters), + } + return m +} +// NewItemInstallationRequestBuilder instantiates a new ItemInstallationRequestBuilder and sets the default values. +func NewItemInstallationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInstallationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemInstallationRequestBuilderInternal(urlParams, requestAdapter) +} +// Get enables an authenticated GitHub App to find the organization's installation information.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a Installationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/apps#get-an-organization-installation-for-the-authenticated-app +func (m *ItemInstallationRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateInstallationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable), nil +} +// ToGetRequestInformation enables an authenticated GitHub App to find the organization's installation information.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *ItemInstallationRequestBuilder) 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 *ItemInstallationRequestBuilder when successful +func (m *ItemInstallationRequestBuilder) WithUrl(rawUrl string)(*ItemInstallationRequestBuilder) { + return NewItemInstallationRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_installations_get_response.go b/pkg/github/orgs/item_installations_get_response.go new file mode 100644 index 00000000..8b3cf567 --- /dev/null +++ b/pkg/github/orgs/item_installations_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemInstallationsGetResponse 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 installations property + installations []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable + // The total_count property + total_count *int32 +} +// NewItemInstallationsGetResponse instantiates a new ItemInstallationsGetResponse and sets the default values. +func NewItemInstallationsGetResponse()(*ItemInstallationsGetResponse) { + m := &ItemInstallationsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemInstallationsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemInstallationsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemInstallationsGetResponse(), 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 *ItemInstallationsGetResponse) 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 *ItemInstallationsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["installations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateInstallationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable) + } + } + m.SetInstallations(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 +} +// GetInstallations gets the installations property value. The installations property +// returns a []Installationable when successful +func (m *ItemInstallationsGetResponse) GetInstallations()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable) { + return m.installations +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemInstallationsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemInstallationsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInstallations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetInstallations())) + for i, v := range m.GetInstallations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("installations", 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 *ItemInstallationsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetInstallations sets the installations property value. The installations property +func (m *ItemInstallationsGetResponse) SetInstallations(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable)() { + m.installations = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemInstallationsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemInstallationsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInstallations()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable) + GetTotalCount()(*int32) + SetInstallations(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_installations_request_builder.go b/pkg/github/orgs/item_installations_request_builder.go new file mode 100644 index 00000000..aee0a4d5 --- /dev/null +++ b/pkg/github/orgs/item_installations_request_builder.go @@ -0,0 +1,63 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemInstallationsRequestBuilder builds and executes requests for operations under \orgs\{org}\installations +type ItemInstallationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemInstallationsRequestBuilderGetQueryParameters lists all GitHub Apps in an organization. The installation count includesall GitHub Apps installed on repositories in the organization.The authenticated user must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint. +type ItemInstallationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemInstallationsRequestBuilderInternal instantiates a new ItemInstallationsRequestBuilder and sets the default values. +func NewItemInstallationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInstallationsRequestBuilder) { + m := &ItemInstallationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/installations{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemInstallationsRequestBuilder instantiates a new ItemInstallationsRequestBuilder and sets the default values. +func NewItemInstallationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInstallationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemInstallationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all GitHub Apps in an organization. The installation count includesall GitHub Apps installed on repositories in the organization.The authenticated user must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint. +// returns a ItemInstallationsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/orgs#list-app-installations-for-an-organization +func (m *ItemInstallationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemInstallationsRequestBuilderGetQueryParameters])(ItemInstallationsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemInstallationsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemInstallationsGetResponseable), nil +} +// ToGetRequestInformation lists all GitHub Apps in an organization. The installation count includesall GitHub Apps installed on repositories in the organization.The authenticated user must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:read` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemInstallationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemInstallationsRequestBuilderGetQueryParameters])(*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 *ItemInstallationsRequestBuilder when successful +func (m *ItemInstallationsRequestBuilder) WithUrl(rawUrl string)(*ItemInstallationsRequestBuilder) { + return NewItemInstallationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_issues_request_builder.go b/pkg/github/orgs/item_issues_request_builder.go new file mode 100644 index 00000000..217e49f6 --- /dev/null +++ b/pkg/github/orgs/item_issues_request_builder.go @@ -0,0 +1,85 @@ +package orgs + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i3083f94f4be18e64320f8760210b4acf15c4d28ef8f71a290d3f94effb959392 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/issues" +) + +// ItemIssuesRequestBuilder builds and executes requests for operations under \orgs\{org}\issues +type ItemIssuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemIssuesRequestBuilderGetQueryParameters list issues in an organization assigned to the authenticated user.> [!NOTE]> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemIssuesRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i3083f94f4be18e64320f8760210b4acf15c4d28ef8f71a290d3f94effb959392.GetDirectionQueryParameterType `uriparametername:"direction"` + // Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. + Filter *i3083f94f4be18e64320f8760210b4acf15c4d28ef8f71a290d3f94effb959392.GetFilterQueryParameterType `uriparametername:"filter"` + // A list of comma separated label names. Example: `bug,ui,@high` + Labels *string `uriparametername:"labels"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // What to sort results by. + Sort *i3083f94f4be18e64320f8760210b4acf15c4d28ef8f71a290d3f94effb959392.GetSortQueryParameterType `uriparametername:"sort"` + // Indicates the state of the issues to return. + State *i3083f94f4be18e64320f8760210b4acf15c4d28ef8f71a290d3f94effb959392.GetStateQueryParameterType `uriparametername:"state"` +} +// NewItemIssuesRequestBuilderInternal instantiates a new ItemIssuesRequestBuilder and sets the default values. +func NewItemIssuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemIssuesRequestBuilder) { + m := &ItemIssuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/issues{?direction*,filter*,labels*,page*,per_page*,since*,sort*,state*}", pathParameters), + } + return m +} +// NewItemIssuesRequestBuilder instantiates a new ItemIssuesRequestBuilder and sets the default values. +func NewItemIssuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemIssuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemIssuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list issues in an organization assigned to the authenticated user.> [!NOTE]> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []Issueable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/issues#list-organization-issues-assigned-to-the-authenticated-user +func (m *ItemIssuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemIssuesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable) + } + } + return val, nil +} +// ToGetRequestInformation list issues in an organization assigned to the authenticated user.> [!NOTE]> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemIssuesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemIssuesRequestBuilderGetQueryParameters])(*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 *ItemIssuesRequestBuilder when successful +func (m *ItemIssuesRequestBuilder) WithUrl(rawUrl string)(*ItemIssuesRequestBuilder) { + return NewItemIssuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_item_item_with_enablement_post_request_body.go b/pkg/github/orgs/item_item_item_with_enablement_post_request_body.go new file mode 100644 index 00000000..cdf3c70a --- /dev/null +++ b/pkg/github/orgs/item_item_item_with_enablement_post_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemItemWithEnablementPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemItemWithEnablementPostRequestBody instantiates a new ItemItemItemWithEnablementPostRequestBody and sets the default values. +func NewItemItemItemWithEnablementPostRequestBody()(*ItemItemItemWithEnablementPostRequestBody) { + m := &ItemItemItemWithEnablementPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemItemWithEnablementPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemItemWithEnablementPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemItemWithEnablementPostRequestBody(), 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 *ItemItemItemWithEnablementPostRequestBody) 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 *ItemItemItemWithEnablementPostRequestBody) 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 *ItemItemItemWithEnablementPostRequestBody) 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 *ItemItemItemWithEnablementPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemItemWithEnablementPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/orgs/item_item_with_enablement_item_request_builder.go b/pkg/github/orgs/item_item_with_enablement_item_request_builder.go new file mode 100644 index 00000000..27e93241 --- /dev/null +++ b/pkg/github/orgs/item_item_with_enablement_item_request_builder.go @@ -0,0 +1,58 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemWithEnablementItemRequestBuilder builds and executes requests for operations under \orgs\{org}\{security_product}\{enablement} +type ItemItemWithEnablementItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemWithEnablementItemRequestBuilderInternal instantiates a new ItemItemWithEnablementItemRequestBuilder and sets the default values. +func NewItemItemWithEnablementItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemWithEnablementItemRequestBuilder) { + m := &ItemItemWithEnablementItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/{security_product}/{enablement}", pathParameters), + } + return m +} +// NewItemItemWithEnablementItemRequestBuilder instantiates a new ItemItemWithEnablementItemRequestBuilder and sets the default values. +func NewItemItemWithEnablementItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemWithEnablementItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemWithEnablementItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Post > [!WARNING]> **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// Deprecated: +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/orgs#enable-or-disable-a-security-feature-for-an-organization +func (m *ItemItemWithEnablementItemRequestBuilder) Post(ctx context.Context, body ItemItemItemWithEnablementPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation > [!WARNING]> **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemWithEnablementItemRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemItemWithEnablementPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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. +// Deprecated: +// returns a *ItemItemWithEnablementItemRequestBuilder when successful +func (m *ItemItemWithEnablementItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemWithEnablementItemRequestBuilder) { + return NewItemItemWithEnablementItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_members_request_builder.go b/pkg/github/orgs/item_members_request_builder.go new file mode 100644 index 00000000..5475c0bf --- /dev/null +++ b/pkg/github/orgs/item_members_request_builder.go @@ -0,0 +1,88 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i8b389933a1f14fb5f1d8ffa67d6b9f883a5d1c3d09aece2a562db359efa77244 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/members" +) + +// ItemMembersRequestBuilder builds and executes requests for operations under \orgs\{org}\members +type ItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemMembersRequestBuilderGetQueryParameters list all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. +type ItemMembersRequestBuilderGetQueryParameters struct { + // Filter members returned in the list. `2fa_disabled` means that only members without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. This options is only available for organization owners. + Filter *i8b389933a1f14fb5f1d8ffa67d6b9f883a5d1c3d09aece2a562db359efa77244.GetFilterQueryParameterType `uriparametername:"filter"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Filter members returned by their role. + Role *i8b389933a1f14fb5f1d8ffa67d6b9f883a5d1c3d09aece2a562db359efa77244.GetRoleQueryParameterType `uriparametername:"role"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.members.item collection +// returns a *ItemMembersWithUsernameItemRequestBuilder when successful +func (m *ItemMembersRequestBuilder) ByUsername(username string)(*ItemMembersWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemMembersWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMembersRequestBuilderInternal instantiates a new ItemMembersRequestBuilder and sets the default values. +func NewItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersRequestBuilder) { + m := &ItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/members{?filter*,page*,per_page*,role*}", pathParameters), + } + return m +} +// NewItemMembersRequestBuilder instantiates a new ItemMembersRequestBuilder and sets the default values. +func NewItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. +// returns a []SimpleUserable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/members#list-organization-members +func (m *ItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMembersRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation list all users who are members of an organization. If the authenticated user is also a member of this organization then both concealed and public members will be returned. +// returns a *RequestInformation when successful +func (m *ItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMembersRequestBuilderGetQueryParameters])(*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 *ItemMembersRequestBuilder when successful +func (m *ItemMembersRequestBuilder) WithUrl(rawUrl string)(*ItemMembersRequestBuilder) { + return NewItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_members_with_username_item_request_builder.go b/pkg/github/orgs/item_members_with_username_item_request_builder.go new file mode 100644 index 00000000..683254f8 --- /dev/null +++ b/pkg/github/orgs/item_members_with_username_item_request_builder.go @@ -0,0 +1,79 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemMembersWithUsernameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\members\{username} +type ItemMembersWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMembersWithUsernameItemRequestBuilderInternal instantiates a new ItemMembersWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembersWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersWithUsernameItemRequestBuilder) { + m := &ItemMembersWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/members/{username}", pathParameters), + } + return m +} +// NewItemMembersWithUsernameItemRequestBuilder instantiates a new ItemMembersWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembersWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembersWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/members#remove-an-organization-member +func (m *ItemMembersWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get check if a user is, publicly or privately, a member of the organization. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/members#check-organization-membership-for-a-user +func (m *ItemMembersWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removing a user from this list will remove them from all teams and they will no longer have any access to the organization's repositories. +// returns a *RequestInformation when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation check if a user is, publicly or privately, a member of the organization. +// returns a *RequestInformation when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) 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) + 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 *ItemMembersWithUsernameItemRequestBuilder when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemMembersWithUsernameItemRequestBuilder) { + return NewItemMembersWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_memberships_item_with_username_put_request_body.go b/pkg/github/orgs/item_memberships_item_with_username_put_request_body.go new file mode 100644 index 00000000..4110b5cc --- /dev/null +++ b/pkg/github/orgs/item_memberships_item_with_username_put_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemMembershipsItemWithUsernamePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemMembershipsItemWithUsernamePutRequestBody instantiates a new ItemMembershipsItemWithUsernamePutRequestBody and sets the default values. +func NewItemMembershipsItemWithUsernamePutRequestBody()(*ItemMembershipsItemWithUsernamePutRequestBody) { + m := &ItemMembershipsItemWithUsernamePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemMembershipsItemWithUsernamePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemMembershipsItemWithUsernamePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemMembershipsItemWithUsernamePutRequestBody(), 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 *ItemMembershipsItemWithUsernamePutRequestBody) 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 *ItemMembershipsItemWithUsernamePutRequestBody) 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 *ItemMembershipsItemWithUsernamePutRequestBody) 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 *ItemMembershipsItemWithUsernamePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemMembershipsItemWithUsernamePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/orgs/item_memberships_request_builder.go b/pkg/github/orgs/item_memberships_request_builder.go new file mode 100644 index 00000000..f63b44d4 --- /dev/null +++ b/pkg/github/orgs/item_memberships_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemMembershipsRequestBuilder builds and executes requests for operations under \orgs\{org}\memberships +type ItemMembershipsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByUsername gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.memberships.item collection +// returns a *ItemMembershipsWithUsernameItemRequestBuilder when successful +func (m *ItemMembershipsRequestBuilder) ByUsername(username string)(*ItemMembershipsWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemMembershipsWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMembershipsRequestBuilderInternal instantiates a new ItemMembershipsRequestBuilder and sets the default values. +func NewItemMembershipsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsRequestBuilder) { + m := &ItemMembershipsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/memberships", pathParameters), + } + return m +} +// NewItemMembershipsRequestBuilder instantiates a new ItemMembershipsRequestBuilder and sets the default values. +func NewItemMembershipsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembershipsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/item_memberships_with_username_item_request_builder.go b/pkg/github/orgs/item_memberships_with_username_item_request_builder.go new file mode 100644 index 00000000..25278cd3 --- /dev/null +++ b/pkg/github/orgs/item_memberships_with_username_item_request_builder.go @@ -0,0 +1,129 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemMembershipsWithUsernameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\memberships\{username} +type ItemMembershipsWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMembershipsWithUsernameItemRequestBuilderInternal instantiates a new ItemMembershipsWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembershipsWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsWithUsernameItemRequestBuilder) { + m := &ItemMembershipsWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/memberships/{username}", pathParameters), + } + return m +} +// NewItemMembershipsWithUsernameItemRequestBuilder instantiates a new ItemMembershipsWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembershipsWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembershipsWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete in order to remove a user's membership with an organization, the authenticated user must be an organization owner.If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. +// 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/enterprise-server@3.14/rest/orgs/members#remove-organization-membership-for-a-user +func (m *ItemMembershipsWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get in order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. +// returns a OrgMembershipable 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/enterprise-server@3.14/rest/orgs/members#get-organization-membership-for-a-user +func (m *ItemMembershipsWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgMembershipable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgMembershipFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgMembershipable), nil +} +// Put only authenticated organization owners can add a member to the organization or update the member's role.* If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/enterprise-server@3.14/rest/orgs/members#get-organization-membership-for-a-user) will be `pending` until they accept the invitation. * Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent.**Rate limits**To prevent abuse, organization owners are limited to creating 50 organization invitations for an organization within a 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. +// returns a OrgMembershipable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/members#set-organization-membership-for-a-user +func (m *ItemMembershipsWithUsernameItemRequestBuilder) Put(ctx context.Context, body ItemMembershipsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgMembershipable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgMembershipFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgMembershipable), nil +} +// ToDeleteRequestInformation in order to remove a user's membership with an organization, the authenticated user must be an organization owner.If the specified user is an active member of the organization, this will remove them from the organization. If the specified user has been invited to the organization, this will cancel their invitation. The specified user will receive an email notification in both cases. +// returns a *RequestInformation when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation in order to get a user's membership with an organization, the authenticated user must be an organization member. The `state` parameter in the response can be used to identify the user's membership status. +// returns a *RequestInformation when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) 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 +} +// ToPutRequestInformation only authenticated organization owners can add a member to the organization or update the member's role.* If the authenticated user is _adding_ a member to the organization, the invited user will receive an email inviting them to the organization. The user's [membership status](https://docs.github.com/enterprise-server@3.14/rest/orgs/members#get-organization-membership-for-a-user) will be `pending` until they accept the invitation. * Authenticated users can _update_ a user's membership by passing the `role` parameter. If the authenticated user changes a member's role to `admin`, the affected user will receive an email notifying them that they've been made an organization owner. If the authenticated user changes an owner's role to `member`, no email will be sent.**Rate limits**To prevent abuse, organization owners are limited to creating 50 organization invitations for an organization within a 24 hour period. If the organization is more than one month old or on a paid plan, the limit is 500 invitations per 24 hour period. +// returns a *RequestInformation when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemMembershipsItemWithUsernamePutRequestBodyable, 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 *ItemMembershipsWithUsernameItemRequestBuilder when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemMembershipsWithUsernameItemRequestBuilder) { + return NewItemMembershipsWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_migrations_item_archive_request_builder.go b/pkg/github/orgs/item_migrations_item_archive_request_builder.go new file mode 100644 index 00000000..375f294b --- /dev/null +++ b/pkg/github/orgs/item_migrations_item_archive_request_builder.go @@ -0,0 +1,84 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemMigrationsItemArchiveRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations\{migration_id}\archive +type ItemMigrationsItemArchiveRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMigrationsItemArchiveRequestBuilderInternal instantiates a new ItemMigrationsItemArchiveRequestBuilder and sets the default values. +func NewItemMigrationsItemArchiveRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemArchiveRequestBuilder) { + m := &ItemMigrationsItemArchiveRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/migrations/{migration_id}/archive", pathParameters), + } + return m +} +// NewItemMigrationsItemArchiveRequestBuilder instantiates a new ItemMigrationsItemArchiveRequestBuilder and sets the default values. +func NewItemMigrationsItemArchiveRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemArchiveRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMigrationsItemArchiveRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a previous migration archive. Migration archives are automatically deleted after seven days. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/migrations/orgs#delete-an-organization-migration-archive +func (m *ItemMigrationsItemArchiveRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get fetches the URL to a migration archive. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/migrations/orgs#download-an-organization-migration-archive +func (m *ItemMigrationsItemArchiveRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation deletes a previous migration archive. Migration archives are automatically deleted after seven days. +// returns a *RequestInformation when successful +func (m *ItemMigrationsItemArchiveRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation fetches the URL to a migration archive. +// returns a *RequestInformation when successful +func (m *ItemMigrationsItemArchiveRequestBuilder) 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 *ItemMigrationsItemArchiveRequestBuilder when successful +func (m *ItemMigrationsItemArchiveRequestBuilder) WithUrl(rawUrl string)(*ItemMigrationsItemArchiveRequestBuilder) { + return NewItemMigrationsItemArchiveRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_migrations_item_repos_item_lock_request_builder.go b/pkg/github/orgs/item_migrations_item_repos_item_lock_request_builder.go new file mode 100644 index 00000000..d2f256bd --- /dev/null +++ b/pkg/github/orgs/item_migrations_item_repos_item_lock_request_builder.go @@ -0,0 +1,57 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemMigrationsItemReposItemLockRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations\{migration_id}\repos\{repo_name}\lock +type ItemMigrationsItemReposItemLockRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMigrationsItemReposItemLockRequestBuilderInternal instantiates a new ItemMigrationsItemReposItemLockRequestBuilder and sets the default values. +func NewItemMigrationsItemReposItemLockRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemReposItemLockRequestBuilder) { + m := &ItemMigrationsItemReposItemLockRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock", pathParameters), + } + return m +} +// NewItemMigrationsItemReposItemLockRequestBuilder instantiates a new ItemMigrationsItemReposItemLockRequestBuilder and sets the default values. +func NewItemMigrationsItemReposItemLockRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemReposItemLockRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMigrationsItemReposItemLockRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/enterprise-server@3.14/rest/repos/repos#delete-a-repository) when the migration is complete and you no longer need the source data. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/migrations/orgs#unlock-an-organization-repository +func (m *ItemMigrationsItemReposItemLockRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation unlocks a repository that was locked for migration. You should unlock each migrated repository and [delete them](https://docs.github.com/enterprise-server@3.14/rest/repos/repos#delete-a-repository) when the migration is complete and you no longer need the source data. +// returns a *RequestInformation when successful +func (m *ItemMigrationsItemReposItemLockRequestBuilder) 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") + 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 *ItemMigrationsItemReposItemLockRequestBuilder when successful +func (m *ItemMigrationsItemReposItemLockRequestBuilder) WithUrl(rawUrl string)(*ItemMigrationsItemReposItemLockRequestBuilder) { + return NewItemMigrationsItemReposItemLockRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_migrations_item_repos_request_builder.go b/pkg/github/orgs/item_migrations_item_repos_request_builder.go new file mode 100644 index 00000000..322b58bf --- /dev/null +++ b/pkg/github/orgs/item_migrations_item_repos_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemMigrationsItemReposRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations\{migration_id}\repos +type ItemMigrationsItemReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepo_name gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.migrations.item.repos.item collection +// returns a *ItemMigrationsItemReposWithRepo_nameItemRequestBuilder when successful +func (m *ItemMigrationsItemReposRequestBuilder) ByRepo_name(repo_name string)(*ItemMigrationsItemReposWithRepo_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repo_name != "" { + urlTplParams["repo_name"] = repo_name + } + return NewItemMigrationsItemReposWithRepo_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMigrationsItemReposRequestBuilderInternal instantiates a new ItemMigrationsItemReposRequestBuilder and sets the default values. +func NewItemMigrationsItemReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemReposRequestBuilder) { + m := &ItemMigrationsItemReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/migrations/{migration_id}/repos", pathParameters), + } + return m +} +// NewItemMigrationsItemReposRequestBuilder instantiates a new ItemMigrationsItemReposRequestBuilder and sets the default values. +func NewItemMigrationsItemReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMigrationsItemReposRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/item_migrations_item_repos_with_repo_escaped_name_item_request_builder.go b/pkg/github/orgs/item_migrations_item_repos_with_repo_escaped_name_item_request_builder.go new file mode 100644 index 00000000..a19a0362 --- /dev/null +++ b/pkg/github/orgs/item_migrations_item_repos_with_repo_escaped_name_item_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemMigrationsItemReposWithRepo_nameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations\{migration_id}\repos\{repo_name} +type ItemMigrationsItemReposWithRepo_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMigrationsItemReposWithRepo_nameItemRequestBuilderInternal instantiates a new ItemMigrationsItemReposWithRepo_nameItemRequestBuilder and sets the default values. +func NewItemMigrationsItemReposWithRepo_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemReposWithRepo_nameItemRequestBuilder) { + m := &ItemMigrationsItemReposWithRepo_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/migrations/{migration_id}/repos/{repo_name}", pathParameters), + } + return m +} +// NewItemMigrationsItemReposWithRepo_nameItemRequestBuilder instantiates a new ItemMigrationsItemReposWithRepo_nameItemRequestBuilder and sets the default values. +func NewItemMigrationsItemReposWithRepo_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemReposWithRepo_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMigrationsItemReposWithRepo_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Lock the lock property +// returns a *ItemMigrationsItemReposItemLockRequestBuilder when successful +func (m *ItemMigrationsItemReposWithRepo_nameItemRequestBuilder) Lock()(*ItemMigrationsItemReposItemLockRequestBuilder) { + return NewItemMigrationsItemReposItemLockRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/orgs/item_migrations_item_repositories_request_builder.go b/pkg/github/orgs/item_migrations_item_repositories_request_builder.go new file mode 100644 index 00000000..dfacb0f8 --- /dev/null +++ b/pkg/github/orgs/item_migrations_item_repositories_request_builder.go @@ -0,0 +1,71 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemMigrationsItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations\{migration_id}\repositories +type ItemMigrationsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemMigrationsItemRepositoriesRequestBuilderGetQueryParameters list all the repositories for this organization migration. +type ItemMigrationsItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemMigrationsItemRepositoriesRequestBuilderInternal instantiates a new ItemMigrationsItemRepositoriesRequestBuilder and sets the default values. +func NewItemMigrationsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemRepositoriesRequestBuilder) { + m := &ItemMigrationsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/migrations/{migration_id}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemMigrationsItemRepositoriesRequestBuilder instantiates a new ItemMigrationsItemRepositoriesRequestBuilder and sets the default values. +func NewItemMigrationsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMigrationsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all the repositories for this organization migration. +// returns a []MinimalRepositoryable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/migrations/orgs#list-repositories-in-an-organization-migration +func (m *ItemMigrationsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMigrationsItemRepositoriesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation list all the repositories for this organization migration. +// returns a *RequestInformation when successful +func (m *ItemMigrationsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMigrationsItemRepositoriesRequestBuilderGetQueryParameters])(*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 *ItemMigrationsItemRepositoriesRequestBuilder when successful +func (m *ItemMigrationsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemMigrationsItemRepositoriesRequestBuilder) { + return NewItemMigrationsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_migrations_post_request_body.go b/pkg/github/orgs/item_migrations_post_request_body.go new file mode 100644 index 00000000..ce2837a8 --- /dev/null +++ b/pkg/github/orgs/item_migrations_post_request_body.go @@ -0,0 +1,289 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemMigrationsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). + exclude_attachments *bool + // Indicates whether the repository git data should be excluded from the migration. + exclude_git_data *bool + // Indicates whether metadata should be excluded and only git source should be included for the migration. + exclude_metadata *bool + // Indicates whether projects owned by the organization or users should be excluded. from the migration. + exclude_owner_projects *bool + // Indicates whether releases should be excluded from the migration (to reduce migration archive file size). + exclude_releases *bool + // Indicates whether repositories should be locked (to prevent manipulation) while migrating data. + lock_repositories *bool + // Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags). + org_metadata_only *bool + // A list of arrays indicating which repositories should be migrated. + repositories []string +} +// NewItemMigrationsPostRequestBody instantiates a new ItemMigrationsPostRequestBody and sets the default values. +func NewItemMigrationsPostRequestBody()(*ItemMigrationsPostRequestBody) { + m := &ItemMigrationsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemMigrationsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemMigrationsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemMigrationsPostRequestBody(), 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 *ItemMigrationsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExcludeAttachments gets the exclude_attachments property value. Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). +// returns a *bool when successful +func (m *ItemMigrationsPostRequestBody) GetExcludeAttachments()(*bool) { + return m.exclude_attachments +} +// GetExcludeGitData gets the exclude_git_data property value. Indicates whether the repository git data should be excluded from the migration. +// returns a *bool when successful +func (m *ItemMigrationsPostRequestBody) GetExcludeGitData()(*bool) { + return m.exclude_git_data +} +// GetExcludeMetadata gets the exclude_metadata property value. Indicates whether metadata should be excluded and only git source should be included for the migration. +// returns a *bool when successful +func (m *ItemMigrationsPostRequestBody) GetExcludeMetadata()(*bool) { + return m.exclude_metadata +} +// GetExcludeOwnerProjects gets the exclude_owner_projects property value. Indicates whether projects owned by the organization or users should be excluded. from the migration. +// returns a *bool when successful +func (m *ItemMigrationsPostRequestBody) GetExcludeOwnerProjects()(*bool) { + return m.exclude_owner_projects +} +// GetExcludeReleases gets the exclude_releases property value. Indicates whether releases should be excluded from the migration (to reduce migration archive file size). +// returns a *bool when successful +func (m *ItemMigrationsPostRequestBody) GetExcludeReleases()(*bool) { + return m.exclude_releases +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemMigrationsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["exclude_attachments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeAttachments(val) + } + return nil + } + res["exclude_git_data"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeGitData(val) + } + return nil + } + res["exclude_metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeMetadata(val) + } + return nil + } + res["exclude_owner_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeOwnerProjects(val) + } + return nil + } + res["exclude_releases"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeReleases(val) + } + return nil + } + res["lock_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLockRepositories(val) + } + return nil + } + res["org_metadata_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetOrgMetadataOnly(val) + } + return nil + } + res["repositories"] = 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.SetRepositories(res) + } + return nil + } + return res +} +// GetLockRepositories gets the lock_repositories property value. Indicates whether repositories should be locked (to prevent manipulation) while migrating data. +// returns a *bool when successful +func (m *ItemMigrationsPostRequestBody) GetLockRepositories()(*bool) { + return m.lock_repositories +} +// GetOrgMetadataOnly gets the org_metadata_only property value. Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags). +// returns a *bool when successful +func (m *ItemMigrationsPostRequestBody) GetOrgMetadataOnly()(*bool) { + return m.org_metadata_only +} +// GetRepositories gets the repositories property value. A list of arrays indicating which repositories should be migrated. +// returns a []string when successful +func (m *ItemMigrationsPostRequestBody) GetRepositories()([]string) { + return m.repositories +} +// Serialize serializes information the current object +func (m *ItemMigrationsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("exclude_attachments", m.GetExcludeAttachments()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_git_data", m.GetExcludeGitData()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_metadata", m.GetExcludeMetadata()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_owner_projects", m.GetExcludeOwnerProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_releases", m.GetExcludeReleases()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("lock_repositories", m.GetLockRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("org_metadata_only", m.GetOrgMetadataOnly()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + err := writer.WriteCollectionOfStringValues("repositories", m.GetRepositories()) + 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 *ItemMigrationsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExcludeAttachments sets the exclude_attachments property value. Indicates whether attachments should be excluded from the migration (to reduce migration archive file size). +func (m *ItemMigrationsPostRequestBody) SetExcludeAttachments(value *bool)() { + m.exclude_attachments = value +} +// SetExcludeGitData sets the exclude_git_data property value. Indicates whether the repository git data should be excluded from the migration. +func (m *ItemMigrationsPostRequestBody) SetExcludeGitData(value *bool)() { + m.exclude_git_data = value +} +// SetExcludeMetadata sets the exclude_metadata property value. Indicates whether metadata should be excluded and only git source should be included for the migration. +func (m *ItemMigrationsPostRequestBody) SetExcludeMetadata(value *bool)() { + m.exclude_metadata = value +} +// SetExcludeOwnerProjects sets the exclude_owner_projects property value. Indicates whether projects owned by the organization or users should be excluded. from the migration. +func (m *ItemMigrationsPostRequestBody) SetExcludeOwnerProjects(value *bool)() { + m.exclude_owner_projects = value +} +// SetExcludeReleases sets the exclude_releases property value. Indicates whether releases should be excluded from the migration (to reduce migration archive file size). +func (m *ItemMigrationsPostRequestBody) SetExcludeReleases(value *bool)() { + m.exclude_releases = value +} +// SetLockRepositories sets the lock_repositories property value. Indicates whether repositories should be locked (to prevent manipulation) while migrating data. +func (m *ItemMigrationsPostRequestBody) SetLockRepositories(value *bool)() { + m.lock_repositories = value +} +// SetOrgMetadataOnly sets the org_metadata_only property value. Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags). +func (m *ItemMigrationsPostRequestBody) SetOrgMetadataOnly(value *bool)() { + m.org_metadata_only = value +} +// SetRepositories sets the repositories property value. A list of arrays indicating which repositories should be migrated. +func (m *ItemMigrationsPostRequestBody) SetRepositories(value []string)() { + m.repositories = value +} +type ItemMigrationsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExcludeAttachments()(*bool) + GetExcludeGitData()(*bool) + GetExcludeMetadata()(*bool) + GetExcludeOwnerProjects()(*bool) + GetExcludeReleases()(*bool) + GetLockRepositories()(*bool) + GetOrgMetadataOnly()(*bool) + GetRepositories()([]string) + SetExcludeAttachments(value *bool)() + SetExcludeGitData(value *bool)() + SetExcludeMetadata(value *bool)() + SetExcludeOwnerProjects(value *bool)() + SetExcludeReleases(value *bool)() + SetLockRepositories(value *bool)() + SetOrgMetadataOnly(value *bool)() + SetRepositories(value []string)() +} diff --git a/pkg/github/orgs/item_migrations_request_builder.go b/pkg/github/orgs/item_migrations_request_builder.go new file mode 100644 index 00000000..e71eac0b --- /dev/null +++ b/pkg/github/orgs/item_migrations_request_builder.go @@ -0,0 +1,118 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + idb852d204b27766a976dad5566589007cf8893c473cc1a1115d9a28c8fa10fc1 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/migrations" +) + +// ItemMigrationsRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations +type ItemMigrationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemMigrationsRequestBuilderGetQueryParameters lists the most recent migrations, including both exports (which can be started through the REST API) and imports (which cannot be started using the REST API).A list of `repositories` is only returned for export migrations. +type ItemMigrationsRequestBuilderGetQueryParameters struct { + // Exclude attributes from the API response to improve performance + Exclude []idb852d204b27766a976dad5566589007cf8893c473cc1a1115d9a28c8fa10fc1.GetExcludeQueryParameterType `uriparametername:"exclude"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByMigration_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.migrations.item collection +// returns a *ItemMigrationsWithMigration_ItemRequestBuilder when successful +func (m *ItemMigrationsRequestBuilder) ByMigration_id(migration_id int32)(*ItemMigrationsWithMigration_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["migration_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(migration_id), 10) + return NewItemMigrationsWithMigration_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMigrationsRequestBuilderInternal instantiates a new ItemMigrationsRequestBuilder and sets the default values. +func NewItemMigrationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsRequestBuilder) { + m := &ItemMigrationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/migrations{?exclude*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemMigrationsRequestBuilder instantiates a new ItemMigrationsRequestBuilder and sets the default values. +func NewItemMigrationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMigrationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the most recent migrations, including both exports (which can be started through the REST API) and imports (which cannot be started using the REST API).A list of `repositories` is only returned for export migrations. +// returns a []Migrationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/migrations/orgs#list-organization-migrations +func (m *ItemMigrationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMigrationsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Migrationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMigrationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Migrationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Migrationable) + } + } + return val, nil +} +// Post initiates the generation of a migration archive.Before you can use this endpoint, you must configure a blob storage provider in the "Migrations" section in the Management Console. For more details, see "[Migrating repositories from GitHub Enterprise Server to GitHub Enterprise Cloud](https://docs.github.com/enterprise-server@3.14/migrations/using-github-enterprise-importer/migrating-repositories-with-github-enterprise-importer/migrating-repositories-from-github-enterprise-server-to-github-enterprise-cloud#step-4-set-up-blob-storage)." +// returns a Migrationable 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/enterprise-server@3.14/rest/migrations/orgs#start-an-organization-migration +func (m *ItemMigrationsRequestBuilder) Post(ctx context.Context, body ItemMigrationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Migrationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMigrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Migrationable), nil +} +// ToGetRequestInformation lists the most recent migrations, including both exports (which can be started through the REST API) and imports (which cannot be started using the REST API).A list of `repositories` is only returned for export migrations. +// returns a *RequestInformation when successful +func (m *ItemMigrationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMigrationsRequestBuilderGetQueryParameters])(*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 initiates the generation of a migration archive.Before you can use this endpoint, you must configure a blob storage provider in the "Migrations" section in the Management Console. For more details, see "[Migrating repositories from GitHub Enterprise Server to GitHub Enterprise Cloud](https://docs.github.com/enterprise-server@3.14/migrations/using-github-enterprise-importer/migrating-repositories-with-github-enterprise-importer/migrating-repositories-from-github-enterprise-server-to-github-enterprise-cloud#step-4-set-up-blob-storage)." +// returns a *RequestInformation when successful +func (m *ItemMigrationsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemMigrationsPostRequestBodyable, 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 *ItemMigrationsRequestBuilder when successful +func (m *ItemMigrationsRequestBuilder) WithUrl(rawUrl string)(*ItemMigrationsRequestBuilder) { + return NewItemMigrationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_migrations_with_migration_escaped_item_request_builder.go b/pkg/github/orgs/item_migrations_with_migration_escaped_item_request_builder.go new file mode 100644 index 00000000..5f807851 --- /dev/null +++ b/pkg/github/orgs/item_migrations_with_migration_escaped_item_request_builder.go @@ -0,0 +1,82 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i7a91ea74f2deba6b335ad5bbe66db0cec71081509fc6c3dbd5e355320d656839 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/migrations/item" +) + +// ItemMigrationsWithMigration_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\migrations\{migration_id} +type ItemMigrationsWithMigration_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemMigrationsWithMigration_ItemRequestBuilderGetQueryParameters fetches the status of a migration.The `state` of a migration can be one of the following values:* `pending`, which means the migration hasn't started yet.* `exporting`, which means the migration is in progress.* `exported`, which means the migration finished successfully.* `failed`, which means the migration failed. +type ItemMigrationsWithMigration_ItemRequestBuilderGetQueryParameters struct { + // Exclude attributes from the API response to improve performance + Exclude []i7a91ea74f2deba6b335ad5bbe66db0cec71081509fc6c3dbd5e355320d656839.GetExcludeQueryParameterType `uriparametername:"exclude"` +} +// Archive the archive property +// returns a *ItemMigrationsItemArchiveRequestBuilder when successful +func (m *ItemMigrationsWithMigration_ItemRequestBuilder) Archive()(*ItemMigrationsItemArchiveRequestBuilder) { + return NewItemMigrationsItemArchiveRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMigrationsWithMigration_ItemRequestBuilderInternal instantiates a new ItemMigrationsWithMigration_ItemRequestBuilder and sets the default values. +func NewItemMigrationsWithMigration_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsWithMigration_ItemRequestBuilder) { + m := &ItemMigrationsWithMigration_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/migrations/{migration_id}{?exclude*}", pathParameters), + } + return m +} +// NewItemMigrationsWithMigration_ItemRequestBuilder instantiates a new ItemMigrationsWithMigration_ItemRequestBuilder and sets the default values. +func NewItemMigrationsWithMigration_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMigrationsWithMigration_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMigrationsWithMigration_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get fetches the status of a migration.The `state` of a migration can be one of the following values:* `pending`, which means the migration hasn't started yet.* `exporting`, which means the migration is in progress.* `exported`, which means the migration finished successfully.* `failed`, which means the migration failed. +// returns a Migrationable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/migrations/orgs#get-an-organization-migration-status +func (m *ItemMigrationsWithMigration_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMigrationsWithMigration_ItemRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Migrationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMigrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Migrationable), nil +} +// Repos the repos property +// returns a *ItemMigrationsItemReposRequestBuilder when successful +func (m *ItemMigrationsWithMigration_ItemRequestBuilder) Repos()(*ItemMigrationsItemReposRequestBuilder) { + return NewItemMigrationsItemReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repositories the repositories property +// returns a *ItemMigrationsItemRepositoriesRequestBuilder when successful +func (m *ItemMigrationsWithMigration_ItemRequestBuilder) Repositories()(*ItemMigrationsItemRepositoriesRequestBuilder) { + return NewItemMigrationsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation fetches the status of a migration.The `state` of a migration can be one of the following values:* `pending`, which means the migration hasn't started yet.* `exporting`, which means the migration is in progress.* `exported`, which means the migration finished successfully.* `failed`, which means the migration failed. +// returns a *RequestInformation when successful +func (m *ItemMigrationsWithMigration_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMigrationsWithMigration_ItemRequestBuilderGetQueryParameters])(*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 *ItemMigrationsWithMigration_ItemRequestBuilder when successful +func (m *ItemMigrationsWithMigration_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemMigrationsWithMigration_ItemRequestBuilder) { + return NewItemMigrationsWithMigration_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_organization_fine_grained_permissions_request_builder.go b/pkg/github/orgs/item_organization_fine_grained_permissions_request_builder.go new file mode 100644 index 00000000..01261866 --- /dev/null +++ b/pkg/github/orgs/item_organization_fine_grained_permissions_request_builder.go @@ -0,0 +1,66 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemOrganizationFineGrainedPermissionsRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-fine-grained-permissions +type ItemOrganizationFineGrainedPermissionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemOrganizationFineGrainedPermissionsRequestBuilderInternal instantiates a new ItemOrganizationFineGrainedPermissionsRequestBuilder and sets the default values. +func NewItemOrganizationFineGrainedPermissionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationFineGrainedPermissionsRequestBuilder) { + m := &ItemOrganizationFineGrainedPermissionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-fine-grained-permissions", pathParameters), + } + return m +} +// NewItemOrganizationFineGrainedPermissionsRequestBuilder instantiates a new ItemOrganizationFineGrainedPermissionsRequestBuilder and sets the default values. +func NewItemOrganizationFineGrainedPermissionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationFineGrainedPermissionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationFineGrainedPermissionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the fine-grained permissions that can be used in custom organization roles for an organization. For more information, see "[Managing people's access to your organization with roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To list the fine-grained permissions that can be used in custom repository roles for an organization, see "[List repository fine-grained permissions for an organization](https://docs.github.com/enterprise-server@3.14/rest/orgs/organization-roles#list-repository-fine-grained-permissions-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 permissions of `read_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a []OrganizationFineGrainedPermissionable 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/enterprise-server@3.14/rest/orgs/organization-roles#list-organization-fine-grained-permissions-for-an-organization +func (m *ItemOrganizationFineGrainedPermissionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationFineGrainedPermissionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationFineGrainedPermissionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationFineGrainedPermissionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationFineGrainedPermissionable) + } + } + return val, nil +} +// ToGetRequestInformation lists the fine-grained permissions that can be used in custom organization roles for an organization. For more information, see "[Managing people's access to your organization with roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."To list the fine-grained permissions that can be used in custom repository roles for an organization, see "[List repository fine-grained permissions for an organization](https://docs.github.com/enterprise-server@3.14/rest/orgs/organization-roles#list-repository-fine-grained-permissions-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 permissions of `read_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationFineGrainedPermissionsRequestBuilder) 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 *ItemOrganizationFineGrainedPermissionsRequestBuilder when successful +func (m *ItemOrganizationFineGrainedPermissionsRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationFineGrainedPermissionsRequestBuilder) { + return NewItemOrganizationFineGrainedPermissionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_organization_roles_get_response.go b/pkg/github/orgs/item_organization_roles_get_response.go new file mode 100644 index 00000000..f659d2d2 --- /dev/null +++ b/pkg/github/orgs/item_organization_roles_get_response.go @@ -0,0 +1,122 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemOrganizationRolesGetResponse 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 list of organization roles available to the organization. + roles []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationRoleable + // The total number of organization roles available to the organization. + total_count *int32 +} +// NewItemOrganizationRolesGetResponse instantiates a new ItemOrganizationRolesGetResponse and sets the default values. +func NewItemOrganizationRolesGetResponse()(*ItemOrganizationRolesGetResponse) { + m := &ItemOrganizationRolesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemOrganizationRolesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemOrganizationRolesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemOrganizationRolesGetResponse(), 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 *ItemOrganizationRolesGetResponse) 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 *ItemOrganizationRolesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["roles"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationRoleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationRoleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationRoleable) + } + } + m.SetRoles(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 +} +// GetRoles gets the roles property value. The list of organization roles available to the organization. +// returns a []OrganizationRoleable when successful +func (m *ItemOrganizationRolesGetResponse) GetRoles()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationRoleable) { + return m.roles +} +// GetTotalCount gets the total_count property value. The total number of organization roles available to the organization. +// returns a *int32 when successful +func (m *ItemOrganizationRolesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemOrganizationRolesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRoles() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRoles())) + for i, v := range m.GetRoles() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("roles", 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 *ItemOrganizationRolesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRoles sets the roles property value. The list of organization roles available to the organization. +func (m *ItemOrganizationRolesGetResponse) SetRoles(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationRoleable)() { + m.roles = value +} +// SetTotalCount sets the total_count property value. The total number of organization roles available to the organization. +func (m *ItemOrganizationRolesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemOrganizationRolesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRoles()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationRoleable) + GetTotalCount()(*int32) + SetRoles(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationRoleable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/orgs/item_organization_roles_item_teams_request_builder.go b/pkg/github/orgs/item_organization_roles_item_teams_request_builder.go new file mode 100644 index 00000000..793796e0 --- /dev/null +++ b/pkg/github/orgs/item_organization_roles_item_teams_request_builder.go @@ -0,0 +1,67 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemOrganizationRolesItemTeamsRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\{role_id}\teams +type ItemOrganizationRolesItemTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemOrganizationRolesItemTeamsRequestBuilderGetQueryParameters lists the teams that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."To use this endpoint, you must be an administrator for the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemOrganizationRolesItemTeamsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemOrganizationRolesItemTeamsRequestBuilderInternal instantiates a new ItemOrganizationRolesItemTeamsRequestBuilder and sets the default values. +func NewItemOrganizationRolesItemTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesItemTeamsRequestBuilder) { + m := &ItemOrganizationRolesItemTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/{role_id}/teams{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemOrganizationRolesItemTeamsRequestBuilder instantiates a new ItemOrganizationRolesItemTeamsRequestBuilder and sets the default values. +func NewItemOrganizationRolesItemTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesItemTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesItemTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the teams that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."To use this endpoint, you must be an administrator for the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a []TeamRoleAssignmentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/organization-roles#list-teams-that-are-assigned-to-an-organization-role +func (m *ItemOrganizationRolesItemTeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOrganizationRolesItemTeamsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamRoleAssignmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamRoleAssignmentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamRoleAssignmentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamRoleAssignmentable) + } + } + return val, nil +} +// ToGetRequestInformation lists the teams that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."To use this endpoint, you must be an administrator for the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesItemTeamsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOrganizationRolesItemTeamsRequestBuilderGetQueryParameters])(*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 *ItemOrganizationRolesItemTeamsRequestBuilder when successful +func (m *ItemOrganizationRolesItemTeamsRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesItemTeamsRequestBuilder) { + return NewItemOrganizationRolesItemTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_organization_roles_item_users_request_builder.go b/pkg/github/orgs/item_organization_roles_item_users_request_builder.go new file mode 100644 index 00000000..93128933 --- /dev/null +++ b/pkg/github/orgs/item_organization_roles_item_users_request_builder.go @@ -0,0 +1,67 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemOrganizationRolesItemUsersRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\{role_id}\users +type ItemOrganizationRolesItemUsersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemOrganizationRolesItemUsersRequestBuilderGetQueryParameters lists organization members that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."To use this endpoint, you must be an administrator for the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +type ItemOrganizationRolesItemUsersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemOrganizationRolesItemUsersRequestBuilderInternal instantiates a new ItemOrganizationRolesItemUsersRequestBuilder and sets the default values. +func NewItemOrganizationRolesItemUsersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesItemUsersRequestBuilder) { + m := &ItemOrganizationRolesItemUsersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/{role_id}/users{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemOrganizationRolesItemUsersRequestBuilder instantiates a new ItemOrganizationRolesItemUsersRequestBuilder and sets the default values. +func NewItemOrganizationRolesItemUsersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesItemUsersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesItemUsersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists organization members that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."To use this endpoint, you must be an administrator for the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a []UserRoleAssignmentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/organization-roles#list-users-that-are-assigned-to-an-organization-role +func (m *ItemOrganizationRolesItemUsersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOrganizationRolesItemUsersRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.UserRoleAssignmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateUserRoleAssignmentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.UserRoleAssignmentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.UserRoleAssignmentable) + } + } + return val, nil +} +// ToGetRequestInformation lists organization members that are assigned to an organization role. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."To use this endpoint, you must be an administrator for the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesItemUsersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOrganizationRolesItemUsersRequestBuilderGetQueryParameters])(*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 *ItemOrganizationRolesItemUsersRequestBuilder when successful +func (m *ItemOrganizationRolesItemUsersRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesItemUsersRequestBuilder) { + return NewItemOrganizationRolesItemUsersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_organization_roles_request_builder.go b/pkg/github/orgs/item_organization_roles_request_builder.go new file mode 100644 index 00000000..d682d3b4 --- /dev/null +++ b/pkg/github/orgs/item_organization_roles_request_builder.go @@ -0,0 +1,123 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemOrganizationRolesRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles +type ItemOrganizationRolesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRole_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.organizationRoles.item collection +// returns a *ItemOrganizationRolesWithRole_ItemRequestBuilder when successful +func (m *ItemOrganizationRolesRequestBuilder) ByRole_id(role_id int32)(*ItemOrganizationRolesWithRole_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["role_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(role_id), 10) + return NewItemOrganizationRolesWithRole_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemOrganizationRolesRequestBuilderInternal instantiates a new ItemOrganizationRolesRequestBuilder and sets the default values. +func NewItemOrganizationRolesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesRequestBuilder) { + m := &ItemOrganizationRolesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles", pathParameters), + } + return m +} +// NewItemOrganizationRolesRequestBuilder instantiates a new ItemOrganizationRolesRequestBuilder and sets the default values. +func NewItemOrganizationRolesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the organization roles available in this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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 permissions of `read_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a ItemOrganizationRolesGetResponseable 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/enterprise-server@3.14/rest/orgs/organization-roles#get-all-organization-roles-for-an-organization +func (m *ItemOrganizationRolesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemOrganizationRolesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemOrganizationRolesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemOrganizationRolesGetResponseable), nil +} +// Post creates a custom organization role that can be assigned to users and teams, granting them specificpermissions over the organization and optionally across all repositories in the organization. Formore information on custom organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."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 permissions of `write_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a OrganizationRoleable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/organization-roles#create-a-custom-organization-role +func (m *ItemOrganizationRolesRequestBuilder) Post(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomOrganizationRoleCreateSchemaable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationRoleable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationRoleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationRoleable), nil +} +// Teams the teams property +// returns a *ItemOrganizationRolesTeamsRequestBuilder when successful +func (m *ItemOrganizationRolesRequestBuilder) Teams()(*ItemOrganizationRolesTeamsRequestBuilder) { + return NewItemOrganizationRolesTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists the organization roles available in this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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 permissions of `read_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesRequestBuilder) 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 a custom organization role that can be assigned to users and teams, granting them specificpermissions over the organization and optionally across all repositories in the organization. Formore information on custom organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."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 permissions of `write_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomOrganizationRoleCreateSchemaable, 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 +} +// Users the users property +// returns a *ItemOrganizationRolesUsersRequestBuilder when successful +func (m *ItemOrganizationRolesRequestBuilder) Users()(*ItemOrganizationRolesUsersRequestBuilder) { + return NewItemOrganizationRolesUsersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOrganizationRolesRequestBuilder when successful +func (m *ItemOrganizationRolesRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesRequestBuilder) { + return NewItemOrganizationRolesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_organization_roles_teams_item_with_role_escaped_item_request_builder.go b/pkg/github/orgs/item_organization_roles_teams_item_with_role_escaped_item_request_builder.go new file mode 100644 index 00000000..99014f2d --- /dev/null +++ b/pkg/github/orgs/item_organization_roles_teams_item_with_role_escaped_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\teams\{team_slug}\{role_id} +type ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilderInternal instantiates a new ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) { + m := &ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/teams/{team_slug}/{role_id}", pathParameters), + } + return m +} +// NewItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder instantiates a new ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes an organization role from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/organization-roles#remove-an-organization-role-from-a-team +func (m *ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/organization-roles#assign-an-organization-role-to-a-team +func (m *ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes an organization role from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesTeamsItemWithRole_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) + return requestInfo, nil +} +// ToPutRequestInformation assigns an organization role to a team in an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder when successful +func (m *ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) { + return NewItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_organization_roles_teams_request_builder.go b/pkg/github/orgs/item_organization_roles_teams_request_builder.go new file mode 100644 index 00000000..3061f8b9 --- /dev/null +++ b/pkg/github/orgs/item_organization_roles_teams_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemOrganizationRolesTeamsRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\teams +type ItemOrganizationRolesTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTeam_slug gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.organizationRoles.teams.item collection +// returns a *ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder when successful +func (m *ItemOrganizationRolesTeamsRequestBuilder) ByTeam_slug(team_slug string)(*ItemOrganizationRolesTeamsWithTeam_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 NewItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemOrganizationRolesTeamsRequestBuilderInternal instantiates a new ItemOrganizationRolesTeamsRequestBuilder and sets the default values. +func NewItemOrganizationRolesTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesTeamsRequestBuilder) { + m := &ItemOrganizationRolesTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/teams", pathParameters), + } + return m +} +// NewItemOrganizationRolesTeamsRequestBuilder instantiates a new ItemOrganizationRolesTeamsRequestBuilder and sets the default values. +func NewItemOrganizationRolesTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesTeamsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/item_organization_roles_teams_with_team_escaped_slug_item_request_builder.go b/pkg/github/orgs/item_organization_roles_teams_with_team_escaped_slug_item_request_builder.go new file mode 100644 index 00000000..dccc2eb4 --- /dev/null +++ b/pkg/github/orgs/item_organization_roles_teams_with_team_escaped_slug_item_request_builder.go @@ -0,0 +1,62 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\teams\{team_slug} +type ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRole_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.organizationRoles.teams.item.item collection +// returns a *ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder when successful +func (m *ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder) ByRole_id(role_id int32)(*ItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["role_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(role_id), 10) + return NewItemOrganizationRolesTeamsItemWithRole_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilderInternal instantiates a new ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder) { + m := &ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/teams/{team_slug}", pathParameters), + } + return m +} +// NewItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder instantiates a new ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes all assigned organization roles from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/organization-roles#remove-all-organization-roles-for-a-team +func (m *ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes all assigned organization roles from a team. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesTeamsWithTeam_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder when successful +func (m *ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder) { + return NewItemOrganizationRolesTeamsWithTeam_slugItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_organization_roles_users_item_with_role_escaped_item_request_builder.go b/pkg/github/orgs/item_organization_roles_users_item_with_role_escaped_item_request_builder.go new file mode 100644 index 00000000..6e1d9aae --- /dev/null +++ b/pkg/github/orgs/item_organization_roles_users_item_with_role_escaped_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\users\{username}\{role_id} +type ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemOrganizationRolesUsersItemWithRole_ItemRequestBuilderInternal instantiates a new ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesUsersItemWithRole_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) { + m := &ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/users/{username}/{role_id}", pathParameters), + } + return m +} +// NewItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder instantiates a new ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesUsersItemWithRole_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete remove an organization role from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/organization-roles#remove-an-organization-role-from-a-user +func (m *ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/organization-roles#assign-an-organization-role-to-a-user +func (m *ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation remove an organization role from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesUsersItemWithRole_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) + return requestInfo, nil +} +// ToPutRequestInformation assigns an organization role to a member of an organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder when successful +func (m *ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) { + return NewItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_organization_roles_users_request_builder.go b/pkg/github/orgs/item_organization_roles_users_request_builder.go new file mode 100644 index 00000000..d4eaee7a --- /dev/null +++ b/pkg/github/orgs/item_organization_roles_users_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemOrganizationRolesUsersRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\users +type ItemOrganizationRolesUsersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByUsername gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.organizationRoles.users.item collection +// returns a *ItemOrganizationRolesUsersWithUsernameItemRequestBuilder when successful +func (m *ItemOrganizationRolesUsersRequestBuilder) ByUsername(username string)(*ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemOrganizationRolesUsersWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemOrganizationRolesUsersRequestBuilderInternal instantiates a new ItemOrganizationRolesUsersRequestBuilder and sets the default values. +func NewItemOrganizationRolesUsersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesUsersRequestBuilder) { + m := &ItemOrganizationRolesUsersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/users", pathParameters), + } + return m +} +// NewItemOrganizationRolesUsersRequestBuilder instantiates a new ItemOrganizationRolesUsersRequestBuilder and sets the default values. +func NewItemOrganizationRolesUsersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesUsersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesUsersRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/item_organization_roles_users_with_username_item_request_builder.go b/pkg/github/orgs/item_organization_roles_users_with_username_item_request_builder.go new file mode 100644 index 00000000..a80390d4 --- /dev/null +++ b/pkg/github/orgs/item_organization_roles_users_with_username_item_request_builder.go @@ -0,0 +1,62 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemOrganizationRolesUsersWithUsernameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\users\{username} +type ItemOrganizationRolesUsersWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRole_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.organizationRoles.users.item.item collection +// returns a *ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder when successful +func (m *ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) ByRole_id(role_id int32)(*ItemOrganizationRolesUsersItemWithRole_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["role_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(role_id), 10) + return NewItemOrganizationRolesUsersItemWithRole_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemOrganizationRolesUsersWithUsernameItemRequestBuilderInternal instantiates a new ItemOrganizationRolesUsersWithUsernameItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesUsersWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) { + m := &ItemOrganizationRolesUsersWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/users/{username}", pathParameters), + } + return m +} +// NewItemOrganizationRolesUsersWithUsernameItemRequestBuilder instantiates a new ItemOrganizationRolesUsersWithUsernameItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesUsersWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesUsersWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete revokes all assigned organization roles from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/organization-roles#remove-all-organization-roles-for-a-user +func (m *ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation revokes all assigned organization roles from a user. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) 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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOrganizationRolesUsersWithUsernameItemRequestBuilder when successful +func (m *ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesUsersWithUsernameItemRequestBuilder) { + return NewItemOrganizationRolesUsersWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_organization_roles_with_role_escaped_item_request_builder.go b/pkg/github/orgs/item_organization_roles_with_role_escaped_item_request_builder.go new file mode 100644 index 00000000..047f2fc7 --- /dev/null +++ b/pkg/github/orgs/item_organization_roles_with_role_escaped_item_request_builder.go @@ -0,0 +1,134 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemOrganizationRolesWithRole_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\organization-roles\{role_id} +type ItemOrganizationRolesWithRole_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemOrganizationRolesWithRole_ItemRequestBuilderInternal instantiates a new ItemOrganizationRolesWithRole_ItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesWithRole_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesWithRole_ItemRequestBuilder) { + m := &ItemOrganizationRolesWithRole_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/organization-roles/{role_id}", pathParameters), + } + return m +} +// NewItemOrganizationRolesWithRole_ItemRequestBuilder instantiates a new ItemOrganizationRolesWithRole_ItemRequestBuilder and sets the default values. +func NewItemOrganizationRolesWithRole_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrganizationRolesWithRole_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrganizationRolesWithRole_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a custom organization role. For more information on custom organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."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 permissions of `write_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/organization-roles#delete-a-custom-organization-role +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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 permissions of `read_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a OrganizationRoleable 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/enterprise-server@3.14/rest/orgs/organization-roles#get-an-organization-role +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationRoleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationRoleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationRoleable), nil +} +// Patch updates an existing custom organization role. Permission changes will apply to all assignees. For more information on custom organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."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 permissions of `write_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a OrganizationRoleable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/organization-roles#update-a-custom-organization-role +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) Patch(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomOrganizationRoleUpdateSchemaable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationRoleable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationRoleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationRoleable), nil +} +// Teams the teams property +// returns a *ItemOrganizationRolesItemTeamsRequestBuilder when successful +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) Teams()(*ItemOrganizationRolesItemTeamsRequestBuilder) { + return NewItemOrganizationRolesItemTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a custom organization role. For more information on custom organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."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 permissions of `write_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesWithRole_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) + return requestInfo, nil +} +// ToGetRequestInformation gets an organization role that is available to this organization. For more information on organization roles, see "[Using organization roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/using-organization-roles)."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 permissions of `read_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesWithRole_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 an existing custom organization role. Permission changes will apply to all assignees. For more information on custom organization roles, see "[Managing people's access to your organization with roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-organization-roles)."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 permissions of `write_organization_custom_org_role` in the organization.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationCustomOrganizationRoleUpdateSchemaable, 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 +} +// Users the users property +// returns a *ItemOrganizationRolesItemUsersRequestBuilder when successful +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) Users()(*ItemOrganizationRolesItemUsersRequestBuilder) { + return NewItemOrganizationRolesItemUsersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemOrganizationRolesWithRole_ItemRequestBuilder when successful +func (m *ItemOrganizationRolesWithRole_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemOrganizationRolesWithRole_ItemRequestBuilder) { + return NewItemOrganizationRolesWithRole_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_outside_escaped_collaborators_item_with_username422_error.go b/pkg/github/orgs/item_outside_escaped_collaborators_item_with_username422_error.go new file mode 100644 index 00000000..8e903282 --- /dev/null +++ b/pkg/github/orgs/item_outside_escaped_collaborators_item_with_username422_error.go @@ -0,0 +1,117 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemOutside_collaboratorsItemWithUsername422Error 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 documentation_url property + documentation_url *string + // The message property + message *string +} +// NewItemOutside_collaboratorsItemWithUsername422Error instantiates a new ItemOutside_collaboratorsItemWithUsername422Error and sets the default values. +func NewItemOutside_collaboratorsItemWithUsername422Error()(*ItemOutside_collaboratorsItemWithUsername422Error) { + m := &ItemOutside_collaboratorsItemWithUsername422Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemOutside_collaboratorsItemWithUsername422ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemOutside_collaboratorsItemWithUsername422ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemOutside_collaboratorsItemWithUsername422Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemOutside_collaboratorsItemWithUsername422Error) 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 *ItemOutside_collaboratorsItemWithUsername422Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemOutside_collaboratorsItemWithUsername422Error) 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 *ItemOutside_collaboratorsItemWithUsername422Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 *ItemOutside_collaboratorsItemWithUsername422Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemOutside_collaboratorsItemWithUsername422Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemOutside_collaboratorsItemWithUsername422Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemOutside_collaboratorsItemWithUsername422Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ItemOutside_collaboratorsItemWithUsername422Error) SetMessage(value *string)() { + m.message = value +} +type ItemOutside_collaboratorsItemWithUsername422Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/pkg/github/orgs/item_outside_escaped_collaborators_item_with_username_put_request_body.go b/pkg/github/orgs/item_outside_escaped_collaborators_item_with_username_put_request_body.go new file mode 100644 index 00000000..b6641078 --- /dev/null +++ b/pkg/github/orgs/item_outside_escaped_collaborators_item_with_username_put_request_body.go @@ -0,0 +1,80 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemOutside_collaboratorsItemWithUsernamePutRequestBody 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 set to `true`, the request will be performed asynchronously. Returns a 202 status code when the job is successfully queued. + async *bool +} +// NewItemOutside_collaboratorsItemWithUsernamePutRequestBody instantiates a new ItemOutside_collaboratorsItemWithUsernamePutRequestBody and sets the default values. +func NewItemOutside_collaboratorsItemWithUsernamePutRequestBody()(*ItemOutside_collaboratorsItemWithUsernamePutRequestBody) { + m := &ItemOutside_collaboratorsItemWithUsernamePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemOutside_collaboratorsItemWithUsernamePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemOutside_collaboratorsItemWithUsernamePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemOutside_collaboratorsItemWithUsernamePutRequestBody(), 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 *ItemOutside_collaboratorsItemWithUsernamePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAsync gets the async property value. When set to `true`, the request will be performed asynchronously. Returns a 202 status code when the job is successfully queued. +// returns a *bool when successful +func (m *ItemOutside_collaboratorsItemWithUsernamePutRequestBody) GetAsync()(*bool) { + return m.async +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemOutside_collaboratorsItemWithUsernamePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["async"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAsync(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemOutside_collaboratorsItemWithUsernamePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("async", m.GetAsync()) + 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 *ItemOutside_collaboratorsItemWithUsernamePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAsync sets the async property value. When set to `true`, the request will be performed asynchronously. Returns a 202 status code when the job is successfully queued. +func (m *ItemOutside_collaboratorsItemWithUsernamePutRequestBody) SetAsync(value *bool)() { + m.async = value +} +type ItemOutside_collaboratorsItemWithUsernamePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAsync()(*bool) + SetAsync(value *bool)() +} diff --git a/pkg/github/orgs/item_outside_escaped_collaborators_item_with_username_put_response.go b/pkg/github/orgs/item_outside_escaped_collaborators_item_with_username_put_response.go new file mode 100644 index 00000000..c00c2ff4 --- /dev/null +++ b/pkg/github/orgs/item_outside_escaped_collaborators_item_with_username_put_response.go @@ -0,0 +1,32 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemOutside_collaboratorsItemWithUsernamePutResponse struct { +} +// NewItemOutside_collaboratorsItemWithUsernamePutResponse instantiates a new ItemOutside_collaboratorsItemWithUsernamePutResponse and sets the default values. +func NewItemOutside_collaboratorsItemWithUsernamePutResponse()(*ItemOutside_collaboratorsItemWithUsernamePutResponse) { + m := &ItemOutside_collaboratorsItemWithUsernamePutResponse{ + } + return m +} +// CreateItemOutside_collaboratorsItemWithUsernamePutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemOutside_collaboratorsItemWithUsernamePutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemOutside_collaboratorsItemWithUsernamePutResponse(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemOutside_collaboratorsItemWithUsernamePutResponse) 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 *ItemOutside_collaboratorsItemWithUsernamePutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +type ItemOutside_collaboratorsItemWithUsernamePutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/orgs/item_outside_escaped_collaborators_request_builder.go b/pkg/github/orgs/item_outside_escaped_collaborators_request_builder.go new file mode 100644 index 00000000..b72c3aeb --- /dev/null +++ b/pkg/github/orgs/item_outside_escaped_collaborators_request_builder.go @@ -0,0 +1,82 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ifbb2525b91b33f74fabab35be58dac78b55a1bf7037d270547b37be2dbfcaa5f "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/outside_collaborators" +) + +// ItemOutside_collaboratorsRequestBuilder builds and executes requests for operations under \orgs\{org}\outside_collaborators +type ItemOutside_collaboratorsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemOutside_collaboratorsRequestBuilderGetQueryParameters list all users who are outside collaborators of an organization. +type ItemOutside_collaboratorsRequestBuilderGetQueryParameters struct { + // Filter the list of outside collaborators. `2fa_disabled` means that only outside collaborators without [two-factor authentication](https://github.com/blog/1614-two-factor-authentication) enabled will be returned. + Filter *ifbb2525b91b33f74fabab35be58dac78b55a1bf7037d270547b37be2dbfcaa5f.GetFilterQueryParameterType `uriparametername:"filter"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.outside_collaborators.item collection +// returns a *ItemOutside_collaboratorsWithUsernameItemRequestBuilder when successful +func (m *ItemOutside_collaboratorsRequestBuilder) ByUsername(username string)(*ItemOutside_collaboratorsWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemOutside_collaboratorsWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemOutside_collaboratorsRequestBuilderInternal instantiates a new ItemOutside_collaboratorsRequestBuilder and sets the default values. +func NewItemOutside_collaboratorsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutside_collaboratorsRequestBuilder) { + m := &ItemOutside_collaboratorsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/outside_collaborators{?filter*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemOutside_collaboratorsRequestBuilder instantiates a new ItemOutside_collaboratorsRequestBuilder and sets the default values. +func NewItemOutside_collaboratorsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutside_collaboratorsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOutside_collaboratorsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all users who are outside collaborators of an organization. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/outside-collaborators#list-outside-collaborators-for-an-organization +func (m *ItemOutside_collaboratorsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOutside_collaboratorsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation list all users who are outside collaborators of an organization. +// returns a *RequestInformation when successful +func (m *ItemOutside_collaboratorsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOutside_collaboratorsRequestBuilderGetQueryParameters])(*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 *ItemOutside_collaboratorsRequestBuilder when successful +func (m *ItemOutside_collaboratorsRequestBuilder) WithUrl(rawUrl string)(*ItemOutside_collaboratorsRequestBuilder) { + return NewItemOutside_collaboratorsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_outside_escaped_collaborators_with_username_item_request_builder.go b/pkg/github/orgs/item_outside_escaped_collaborators_with_username_item_request_builder.go new file mode 100644 index 00000000..59fefe85 --- /dev/null +++ b/pkg/github/orgs/item_outside_escaped_collaborators_with_username_item_request_builder.go @@ -0,0 +1,92 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemOutside_collaboratorsWithUsernameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\outside_collaborators\{username} +type ItemOutside_collaboratorsWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemOutside_collaboratorsWithUsernameItemRequestBuilderInternal instantiates a new ItemOutside_collaboratorsWithUsernameItemRequestBuilder and sets the default values. +func NewItemOutside_collaboratorsWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutside_collaboratorsWithUsernameItemRequestBuilder) { + m := &ItemOutside_collaboratorsWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/outside_collaborators/{username}", pathParameters), + } + return m +} +// NewItemOutside_collaboratorsWithUsernameItemRequestBuilder instantiates a new ItemOutside_collaboratorsWithUsernameItemRequestBuilder and sets the default values. +func NewItemOutside_collaboratorsWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOutside_collaboratorsWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOutside_collaboratorsWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removing a user from this list will remove them from all the organization's repositories. +// returns a ItemOutside_collaboratorsItemWithUsername422Error error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/outside-collaborators#remove-outside-collaborator-from-an-organization +func (m *ItemOutside_collaboratorsWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": CreateItemOutside_collaboratorsItemWithUsername422ErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put when an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/enterprise-server@3.14/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/enterprise-server@3.14/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." +// returns a ItemOutside_collaboratorsItemWithUsernamePutResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/outside-collaborators#convert-an-organization-member-to-outside-collaborator +func (m *ItemOutside_collaboratorsWithUsernameItemRequestBuilder) Put(ctx context.Context, body ItemOutside_collaboratorsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemOutside_collaboratorsItemWithUsernamePutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemOutside_collaboratorsItemWithUsernamePutResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemOutside_collaboratorsItemWithUsernamePutResponseable), nil +} +// ToDeleteRequestInformation removing a user from this list will remove them from all the organization's repositories. +// returns a *RequestInformation when successful +func (m *ItemOutside_collaboratorsWithUsernameItemRequestBuilder) 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") + return requestInfo, nil +} +// ToPutRequestInformation when an organization member is converted to an outside collaborator, they'll only have access to the repositories that their current team membership allows. The user will no longer be a member of the organization. For more information, see "[Converting an organization member to an outside collaborator](https://docs.github.com/enterprise-server@3.14/articles/converting-an-organization-member-to-an-outside-collaborator/)". Converting an organization member to an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/enterprise-server@3.14/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)." +// returns a *RequestInformation when successful +func (m *ItemOutside_collaboratorsWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemOutside_collaboratorsItemWithUsernamePutRequestBodyable, 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 *ItemOutside_collaboratorsWithUsernameItemRequestBuilder when successful +func (m *ItemOutside_collaboratorsWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemOutside_collaboratorsWithUsernameItemRequestBuilder) { + return NewItemOutside_collaboratorsWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_packages_item_item_restore_request_builder.go b/pkg/github/orgs/item_packages_item_item_restore_request_builder.go new file mode 100644 index 00000000..eb587a45 --- /dev/null +++ b/pkg/github/orgs/item_packages_item_item_restore_request_builder.go @@ -0,0 +1,66 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPackagesItemItemRestoreRequestBuilder builds and executes requests for operations under \orgs\{org}\packages\{package_type}\{package_name}\restore +type ItemPackagesItemItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters restores an entire package in an organization.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters struct { + // package token + Token *string `uriparametername:"token"` +} +// NewItemPackagesItemItemRestoreRequestBuilderInternal instantiates a new ItemPackagesItemItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemRestoreRequestBuilder) { + m := &ItemPackagesItemItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/packages/{package_type}/{package_name}/restore{?token*}", pathParameters), + } + return m +} +// NewItemPackagesItemItemRestoreRequestBuilder instantiates a new ItemPackagesItemItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemRestoreRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} +// Post restores an entire package in an organization.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#restore-a-package-for-an-organization +func (m *ItemPackagesItemItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation restores an entire package in an organization.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters])(*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 *ItemPackagesItemItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemItemRestoreRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemRestoreRequestBuilder) { + return NewItemPackagesItemItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_packages_item_item_versions_item_restore_request_builder.go b/pkg/github/orgs/item_packages_item_item_versions_item_restore_request_builder.go new file mode 100644 index 00000000..87a011e6 --- /dev/null +++ b/pkg/github/orgs/item_packages_item_item_versions_item_restore_request_builder.go @@ -0,0 +1,61 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPackagesItemItemVersionsItemRestoreRequestBuilder builds and executes requests for operations under \orgs\{org}\packages\{package_type}\{package_name}\versions\{package_version_id}\restore +type ItemPackagesItemItemVersionsItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal instantiates a new ItemPackagesItemItemVersionsItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + m := &ItemPackagesItemItemVersionsItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore", pathParameters), + } + return m +} +// NewItemPackagesItemItemVersionsItemRestoreRequestBuilder instantiates a new ItemPackagesItemItemVersionsItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} +// Post restores a specific package version in an organization.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#restore-package-version-for-an-organization +func (m *ItemPackagesItemItemVersionsItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation restores a specific package version in an organization.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsItemRestoreRequestBuilder) 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 *ItemPackagesItemItemVersionsItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsItemRestoreRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + return NewItemPackagesItemItemVersionsItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_packages_item_item_versions_request_builder.go b/pkg/github/orgs/item_packages_item_item_versions_request_builder.go new file mode 100644 index 00000000..77f7c0bc --- /dev/null +++ b/pkg/github/orgs/item_packages_item_item_versions_request_builder.go @@ -0,0 +1,89 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i27ca9f1306203de0014a14c5b800bc93688c4f937a4b58db0e439daf32ecc11d "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/packages/item/item/versions" +) + +// ItemPackagesItemItemVersionsRequestBuilder builds and executes requests for operations under \orgs\{org}\packages\{package_type}\{package_name}\versions +type ItemPackagesItemItemVersionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPackagesItemItemVersionsRequestBuilderGetQueryParameters lists package versions for a package owned by an organization.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type ItemPackagesItemItemVersionsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The state of the package, either active or deleted. + State *i27ca9f1306203de0014a14c5b800bc93688c4f937a4b58db0e439daf32ecc11d.GetStateQueryParameterType `uriparametername:"state"` +} +// ByPackage_version_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.packages.item.item.versions.item collection +// returns a *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsRequestBuilder) ByPackage_version_id(package_version_id int32)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["package_version_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(package_version_id), 10) + return NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPackagesItemItemVersionsRequestBuilderInternal instantiates a new ItemPackagesItemItemVersionsRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsRequestBuilder) { + m := &ItemPackagesItemItemVersionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/packages/{package_type}/{package_name}/versions{?page*,per_page*,state*}", pathParameters), + } + return m +} +// NewItemPackagesItemItemVersionsRequestBuilder instantiates a new ItemPackagesItemItemVersionsRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemVersionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists package versions for a package owned by an organization.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a []PackageVersionable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#list-package-versions-for-a-package-owned-by-an-organization +func (m *ItemPackagesItemItemVersionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesItemItemVersionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable) + } + } + return val, nil +} +// ToGetRequestInformation lists package versions for a package owned by an organization.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesItemItemVersionsRequestBuilderGetQueryParameters])(*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 *ItemPackagesItemItemVersionsRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemVersionsRequestBuilder) { + return NewItemPackagesItemItemVersionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_packages_item_item_versions_with_package_escaped_version_escaped_item_request_builder.go b/pkg/github/orgs/item_packages_item_item_versions_with_package_escaped_version_escaped_item_request_builder.go new file mode 100644 index 00000000..fb4a6234 --- /dev/null +++ b/pkg/github/orgs/item_packages_item_item_versions_with_package_escaped_version_escaped_item_request_builder.go @@ -0,0 +1,93 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\packages\{package_type}\{package_name}\versions\{package_version_id} +type ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal instantiates a new ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + m := &ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/packages/{package_type}/{package_name}/versions/{package_version_id}", pathParameters), + } + return m +} +// NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder instantiates a new ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a specific package version in an organization. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#delete-package-version-for-an-organization +func (m *ItemPackagesItemItemVersionsWithPackage_version_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 { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a specific package version in an organization.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a PackageVersionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#get-a-package-version-for-an-organization +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageVersionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable), nil +} +// Restore the restore property +// returns a *ItemPackagesItemItemVersionsItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Restore()(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + return NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a specific package version in an organization. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_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") + return requestInfo, nil +} +// ToGetRequestInformation gets a specific package version in an organization.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + return NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_packages_item_with_package_escaped_name_item_request_builder.go b/pkg/github/orgs/item_packages_item_with_package_escaped_name_item_request_builder.go new file mode 100644 index 00000000..89e052f5 --- /dev/null +++ b/pkg/github/orgs/item_packages_item_with_package_escaped_name_item_request_builder.go @@ -0,0 +1,98 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPackagesItemWithPackage_nameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\packages\{package_type}\{package_name} +type ItemPackagesItemWithPackage_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal instantiates a new ItemPackagesItemWithPackage_nameItemRequestBuilder and sets the default values. +func NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + m := &ItemPackagesItemWithPackage_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/packages/{package_type}/{package_name}", pathParameters), + } + return m +} +// NewItemPackagesItemWithPackage_nameItemRequestBuilder instantiates a new ItemPackagesItemWithPackage_nameItemRequestBuilder and sets the default values. +func NewItemPackagesItemWithPackage_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#delete-a-package-for-an-organization +func (m *ItemPackagesItemWithPackage_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 { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a specific package in an organization.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a PackageEscapedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#get-a-package-for-an-organization +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageEscapedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable), nil +} +// Restore the restore property +// returns a *ItemPackagesItemItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) Restore()(*ItemPackagesItemItemRestoreRequestBuilder) { + return NewItemPackagesItemItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes an entire package in an organization. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.The authenticated user must have admin permissions in the organization to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must also have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemWithPackage_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") + return requestInfo, nil +} +// ToGetRequestInformation gets a specific package in an organization.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemWithPackage_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 +} +// Versions the versions property +// returns a *ItemPackagesItemItemVersionsRequestBuilder when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) Versions()(*ItemPackagesItemItemVersionsRequestBuilder) { + return NewItemPackagesItemItemVersionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesItemWithPackage_nameItemRequestBuilder when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + return NewItemPackagesItemWithPackage_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_packages_request_builder.go b/pkg/github/orgs/item_packages_request_builder.go new file mode 100644 index 00000000..66f8fda3 --- /dev/null +++ b/pkg/github/orgs/item_packages_request_builder.go @@ -0,0 +1,90 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i74d223953fc64b1e576ea2b85c365b4b0df42293ddedc4b606f1591dab226768 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/packages" +) + +// ItemPackagesRequestBuilder builds and executes requests for operations under \orgs\{org}\packages +type ItemPackagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPackagesRequestBuilderGetQueryParameters lists packages in an organization readable by the user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type ItemPackagesRequestBuilderGetQueryParameters struct { + // The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. + Package_type *i74d223953fc64b1e576ea2b85c365b4b0df42293ddedc4b606f1591dab226768.GetPackage_typeQueryParameterType `uriparametername:"package_type"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The selected visibility of the packages. This parameter is optional and only filters an existing result set.The `internal` visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystems `internal` is synonymous with `private`.For the list of GitHub Packages registries that support granular permissions, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." + Visibility *i74d223953fc64b1e576ea2b85c365b4b0df42293ddedc4b606f1591dab226768.GetVisibilityQueryParameterType `uriparametername:"visibility"` +} +// ByPackage_type gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.packages.item collection +// returns a *ItemPackagesWithPackage_typeItemRequestBuilder when successful +func (m *ItemPackagesRequestBuilder) ByPackage_type(package_type string)(*ItemPackagesWithPackage_typeItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if package_type != "" { + urlTplParams["package_type"] = package_type + } + return NewItemPackagesWithPackage_typeItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPackagesRequestBuilderInternal instantiates a new ItemPackagesRequestBuilder and sets the default values. +func NewItemPackagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesRequestBuilder) { + m := &ItemPackagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/packages?package_type={package_type}{&page*,per_page*,visibility*}", pathParameters), + } + return m +} +// NewItemPackagesRequestBuilder instantiates a new ItemPackagesRequestBuilder and sets the default values. +func NewItemPackagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists packages in an organization readable by the user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a []PackageEscapedable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#list-packages-for-an-organization +func (m *ItemPackagesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageEscapedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable) + } + } + return val, nil +} +// ToGetRequestInformation lists packages in an organization readable by the user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesRequestBuilderGetQueryParameters])(*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 *ItemPackagesRequestBuilder when successful +func (m *ItemPackagesRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesRequestBuilder) { + return NewItemPackagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_packages_with_package_escaped_type_item_request_builder.go b/pkg/github/orgs/item_packages_with_package_escaped_type_item_request_builder.go new file mode 100644 index 00000000..b64b8100 --- /dev/null +++ b/pkg/github/orgs/item_packages_with_package_escaped_type_item_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemPackagesWithPackage_typeItemRequestBuilder builds and executes requests for operations under \orgs\{org}\packages\{package_type} +type ItemPackagesWithPackage_typeItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByPackage_name gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.packages.item.item collection +// returns a *ItemPackagesItemWithPackage_nameItemRequestBuilder when successful +func (m *ItemPackagesWithPackage_typeItemRequestBuilder) ByPackage_name(package_name string)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if package_name != "" { + urlTplParams["package_name"] = package_name + } + return NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPackagesWithPackage_typeItemRequestBuilderInternal instantiates a new ItemPackagesWithPackage_typeItemRequestBuilder and sets the default values. +func NewItemPackagesWithPackage_typeItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesWithPackage_typeItemRequestBuilder) { + m := &ItemPackagesWithPackage_typeItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/packages/{package_type}", pathParameters), + } + return m +} +// NewItemPackagesWithPackage_typeItemRequestBuilder instantiates a new ItemPackagesWithPackage_typeItemRequestBuilder and sets the default values. +func NewItemPackagesWithPackage_typeItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesWithPackage_typeItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesWithPackage_typeItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/item_personal_access_token_requests_item_repositories_request_builder.go b/pkg/github/orgs/item_personal_access_token_requests_item_repositories_request_builder.go new file mode 100644 index 00000000..eb8370bd --- /dev/null +++ b/pkg/github/orgs/item_personal_access_token_requests_item_repositories_request_builder.go @@ -0,0 +1,75 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\personal-access-token-requests\{pat_request_id}\repositories +type ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderGetQueryParameters lists the repositories a fine-grained personal access token request is requesting access to.Only GitHub Apps can use this endpoint. +type ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderInternal instantiates a new ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder and sets the default values. +func NewItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder) { + m := &ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/personal-access-token-requests/{pat_request_id}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder instantiates a new ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder and sets the default values. +func NewItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the repositories a fine-grained personal access token request is requesting access to.Only GitHub Apps can use this endpoint. +// returns a []MinimalRepositoryable 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 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/personal-access-tokens#list-repositories-requested-to-be-accessed-by-a-fine-grained-personal-access-token +func (m *ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists the repositories a fine-grained personal access token request is requesting access to.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderGetQueryParameters])(*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 *ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder when successful +func (m *ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder) { + return NewItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_personal_access_token_requests_item_with_pat_escaped_request_escaped_post_request_body.go b/pkg/github/orgs/item_personal_access_token_requests_item_with_pat_escaped_request_escaped_post_request_body.go new file mode 100644 index 00000000..f6bef394 --- /dev/null +++ b/pkg/github/orgs/item_personal_access_token_requests_item_with_pat_escaped_request_escaped_post_request_body.go @@ -0,0 +1,80 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Reason for approving or denying the request. Max 1024 characters. + reason *string +} +// NewItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody instantiates a new ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody and sets the default values. +func NewItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody()(*ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody) { + m := &ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody(), 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 *ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody) 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 *ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + return res +} +// GetReason gets the reason property value. Reason for approving or denying the request. Max 1024 characters. +// returns a *string when successful +func (m *ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody) GetReason()(*string) { + return m.reason +} +// Serialize serializes information the current object +func (m *ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("reason", m.GetReason()) + 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 *ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetReason sets the reason property value. Reason for approving or denying the request. Max 1024 characters. +func (m *ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBody) SetReason(value *string)() { + m.reason = value +} +type ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetReason()(*string) + SetReason(value *string)() +} diff --git a/pkg/github/orgs/item_personal_access_token_requests_post_request_body.go b/pkg/github/orgs/item_personal_access_token_requests_post_request_body.go new file mode 100644 index 00000000..41fc7db9 --- /dev/null +++ b/pkg/github/orgs/item_personal_access_token_requests_post_request_body.go @@ -0,0 +1,115 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPersonalAccessTokenRequestsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Unique identifiers of the requests for access via fine-grained personal access token. Must be formed of between 1 and 100 `pat_request_id` values. + pat_request_ids []int32 + // Reason for approving or denying the requests. Max 1024 characters. + reason *string +} +// NewItemPersonalAccessTokenRequestsPostRequestBody instantiates a new ItemPersonalAccessTokenRequestsPostRequestBody and sets the default values. +func NewItemPersonalAccessTokenRequestsPostRequestBody()(*ItemPersonalAccessTokenRequestsPostRequestBody) { + m := &ItemPersonalAccessTokenRequestsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPersonalAccessTokenRequestsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPersonalAccessTokenRequestsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPersonalAccessTokenRequestsPostRequestBody(), 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 *ItemPersonalAccessTokenRequestsPostRequestBody) 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 *ItemPersonalAccessTokenRequestsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pat_request_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.SetPatRequestIds(res) + } + return nil + } + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + return res +} +// GetPatRequestIds gets the pat_request_ids property value. Unique identifiers of the requests for access via fine-grained personal access token. Must be formed of between 1 and 100 `pat_request_id` values. +// returns a []int32 when successful +func (m *ItemPersonalAccessTokenRequestsPostRequestBody) GetPatRequestIds()([]int32) { + return m.pat_request_ids +} +// GetReason gets the reason property value. Reason for approving or denying the requests. Max 1024 characters. +// returns a *string when successful +func (m *ItemPersonalAccessTokenRequestsPostRequestBody) GetReason()(*string) { + return m.reason +} +// Serialize serializes information the current object +func (m *ItemPersonalAccessTokenRequestsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetPatRequestIds() != nil { + err := writer.WriteCollectionOfInt32Values("pat_request_ids", m.GetPatRequestIds()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("reason", m.GetReason()) + 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 *ItemPersonalAccessTokenRequestsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPatRequestIds sets the pat_request_ids property value. Unique identifiers of the requests for access via fine-grained personal access token. Must be formed of between 1 and 100 `pat_request_id` values. +func (m *ItemPersonalAccessTokenRequestsPostRequestBody) SetPatRequestIds(value []int32)() { + m.pat_request_ids = value +} +// SetReason sets the reason property value. Reason for approving or denying the requests. Max 1024 characters. +func (m *ItemPersonalAccessTokenRequestsPostRequestBody) SetReason(value *string)() { + m.reason = value +} +type ItemPersonalAccessTokenRequestsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPatRequestIds()([]int32) + GetReason()(*string) + SetPatRequestIds(value []int32)() + SetReason(value *string)() +} diff --git a/pkg/github/orgs/item_personal_access_token_requests_post_response.go b/pkg/github/orgs/item_personal_access_token_requests_post_response.go new file mode 100644 index 00000000..46e95440 --- /dev/null +++ b/pkg/github/orgs/item_personal_access_token_requests_post_response.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPersonalAccessTokenRequestsPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemPersonalAccessTokenRequestsPostResponse instantiates a new ItemPersonalAccessTokenRequestsPostResponse and sets the default values. +func NewItemPersonalAccessTokenRequestsPostResponse()(*ItemPersonalAccessTokenRequestsPostResponse) { + m := &ItemPersonalAccessTokenRequestsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPersonalAccessTokenRequestsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPersonalAccessTokenRequestsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPersonalAccessTokenRequestsPostResponse(), 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 *ItemPersonalAccessTokenRequestsPostResponse) 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 *ItemPersonalAccessTokenRequestsPostResponse) 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 *ItemPersonalAccessTokenRequestsPostResponse) 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 *ItemPersonalAccessTokenRequestsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemPersonalAccessTokenRequestsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/orgs/item_personal_access_token_requests_request_builder.go b/pkg/github/orgs/item_personal_access_token_requests_request_builder.go new file mode 100644 index 00000000..ad915bc5 --- /dev/null +++ b/pkg/github/orgs/item_personal_access_token_requests_request_builder.go @@ -0,0 +1,145 @@ +package orgs + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ic2d2af54d4fdbd8dd58f2cc717ad5443364b2cc8ac34267bee4289799f9e52a2 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/personalaccesstokenrequests" +) + +// ItemPersonalAccessTokenRequestsRequestBuilder builds and executes requests for operations under \orgs\{org}\personal-access-token-requests +type ItemPersonalAccessTokenRequestsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPersonalAccessTokenRequestsRequestBuilderGetQueryParameters lists requests from organization members to access organization resources with a fine-grained personal access token.Only GitHub Apps can use this endpoint. +type ItemPersonalAccessTokenRequestsRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *ic2d2af54d4fdbd8dd58f2cc717ad5443364b2cc8ac34267bee4289799f9e52a2.GetDirectionQueryParameterType `uriparametername:"direction"` + // Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Last_used_after *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"last_used_after"` + // Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Last_used_before *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"last_used_before"` + // A list of owner usernames to use to filter the results. + Owner []string `uriparametername:"owner"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The permission to use to filter the results. + Permission *string `uriparametername:"permission"` + // The name of the repository to use to filter the results. + Repository *string `uriparametername:"repository"` + // The property by which to sort the results. + Sort *ic2d2af54d4fdbd8dd58f2cc717ad5443364b2cc8ac34267bee4289799f9e52a2.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByPat_request_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.personalAccessTokenRequests.item collection +// returns a *ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder when successful +func (m *ItemPersonalAccessTokenRequestsRequestBuilder) ByPat_request_id(pat_request_id int32)(*ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["pat_request_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(pat_request_id), 10) + return NewItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPersonalAccessTokenRequestsRequestBuilderInternal instantiates a new ItemPersonalAccessTokenRequestsRequestBuilder and sets the default values. +func NewItemPersonalAccessTokenRequestsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokenRequestsRequestBuilder) { + m := &ItemPersonalAccessTokenRequestsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/personal-access-token-requests{?direction*,last_used_after*,last_used_before*,owner*,page*,per_page*,permission*,repository*,sort*}", pathParameters), + } + return m +} +// NewItemPersonalAccessTokenRequestsRequestBuilder instantiates a new ItemPersonalAccessTokenRequestsRequestBuilder and sets the default values. +func NewItemPersonalAccessTokenRequestsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokenRequestsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPersonalAccessTokenRequestsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists requests from organization members to access organization resources with a fine-grained personal access token.Only GitHub Apps can use this endpoint. +// returns a []OrganizationProgrammaticAccessGrantRequestable 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 ValidationError 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/enterprise-server@3.14/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens +func (m *ItemPersonalAccessTokenRequestsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokenRequestsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationProgrammaticAccessGrantRequestable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationProgrammaticAccessGrantRequestFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationProgrammaticAccessGrantRequestable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationProgrammaticAccessGrantRequestable) + } + } + return val, nil +} +// Post approves or denies multiple pending requests to access organization resources via a fine-grained personal access token.Only GitHub Apps can use this endpoint. +// returns a ItemPersonalAccessTokenRequestsPostResponseable 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 ValidationError 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/enterprise-server@3.14/rest/orgs/personal-access-tokens#review-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens +func (m *ItemPersonalAccessTokenRequestsRequestBuilder) Post(ctx context.Context, body ItemPersonalAccessTokenRequestsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemPersonalAccessTokenRequestsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemPersonalAccessTokenRequestsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemPersonalAccessTokenRequestsPostResponseable), nil +} +// ToGetRequestInformation lists requests from organization members to access organization resources with a fine-grained personal access token.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokenRequestsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokenRequestsRequestBuilderGetQueryParameters])(*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 approves or denies multiple pending requests to access organization resources via a fine-grained personal access token.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokenRequestsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemPersonalAccessTokenRequestsPostRequestBodyable, 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 *ItemPersonalAccessTokenRequestsRequestBuilder when successful +func (m *ItemPersonalAccessTokenRequestsRequestBuilder) WithUrl(rawUrl string)(*ItemPersonalAccessTokenRequestsRequestBuilder) { + return NewItemPersonalAccessTokenRequestsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_personal_access_token_requests_with_pat_escaped_request_escaped_item_request_builder.go b/pkg/github/orgs/item_personal_access_token_requests_with_pat_escaped_request_escaped_item_request_builder.go new file mode 100644 index 00000000..0b7a24bd --- /dev/null +++ b/pkg/github/orgs/item_personal_access_token_requests_with_pat_escaped_request_escaped_item_request_builder.go @@ -0,0 +1,72 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\personal-access-token-requests\{pat_request_id} +type ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilderInternal instantiates a new ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder and sets the default values. +func NewItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) { + m := &ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/personal-access-token-requests/{pat_request_id}", pathParameters), + } + return m +} +// NewItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder instantiates a new ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder and sets the default values. +func NewItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Post approves or denies a pending request to access organization resources via a fine-grained personal access token.Only GitHub Apps can use this endpoint. +// 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 ValidationError 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/enterprise-server@3.14/rest/orgs/personal-access-tokens#review-a-request-to-access-organization-resources-with-a-fine-grained-personal-access-token +func (m *ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) Post(ctx context.Context, body ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Repositories the repositories property +// returns a *ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder when successful +func (m *ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) Repositories()(*ItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilder) { + return NewItemPersonalAccessTokenRequestsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToPostRequestInformation approves or denies a pending request to access organization resources via a fine-grained personal access token.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemPersonalAccessTokenRequestsItemWithPat_request_PostRequestBodyable, 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 *ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder when successful +func (m *ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder) { + return NewItemPersonalAccessTokenRequestsWithPat_request_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_personal_access_tokens_item_repositories_request_builder.go b/pkg/github/orgs/item_personal_access_tokens_item_repositories_request_builder.go new file mode 100644 index 00000000..a7054388 --- /dev/null +++ b/pkg/github/orgs/item_personal_access_tokens_item_repositories_request_builder.go @@ -0,0 +1,75 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPersonalAccessTokensItemRepositoriesRequestBuilder builds and executes requests for operations under \orgs\{org}\personal-access-tokens\{pat_id}\repositories +type ItemPersonalAccessTokensItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPersonalAccessTokensItemRepositoriesRequestBuilderGetQueryParameters lists the repositories a fine-grained personal access token has access to.Only GitHub Apps can use this endpoint. +type ItemPersonalAccessTokensItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemPersonalAccessTokensItemRepositoriesRequestBuilderInternal instantiates a new ItemPersonalAccessTokensItemRepositoriesRequestBuilder and sets the default values. +func NewItemPersonalAccessTokensItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokensItemRepositoriesRequestBuilder) { + m := &ItemPersonalAccessTokensItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/personal-access-tokens/{pat_id}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemPersonalAccessTokensItemRepositoriesRequestBuilder instantiates a new ItemPersonalAccessTokensItemRepositoriesRequestBuilder and sets the default values. +func NewItemPersonalAccessTokensItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokensItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPersonalAccessTokensItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the repositories a fine-grained personal access token has access to.Only GitHub Apps can use this endpoint. +// returns a []MinimalRepositoryable 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 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/personal-access-tokens#list-repositories-a-fine-grained-personal-access-token-has-access-to +func (m *ItemPersonalAccessTokensItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokensItemRepositoriesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists the repositories a fine-grained personal access token has access to.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokensItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokensItemRepositoriesRequestBuilderGetQueryParameters])(*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 *ItemPersonalAccessTokensItemRepositoriesRequestBuilder when successful +func (m *ItemPersonalAccessTokensItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*ItemPersonalAccessTokensItemRepositoriesRequestBuilder) { + return NewItemPersonalAccessTokensItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_personal_access_tokens_item_with_pat_escaped_post_request_body.go b/pkg/github/orgs/item_personal_access_tokens_item_with_pat_escaped_post_request_body.go new file mode 100644 index 00000000..4aba84f7 --- /dev/null +++ b/pkg/github/orgs/item_personal_access_tokens_item_with_pat_escaped_post_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPersonalAccessTokensItemWithPat_PostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemPersonalAccessTokensItemWithPat_PostRequestBody instantiates a new ItemPersonalAccessTokensItemWithPat_PostRequestBody and sets the default values. +func NewItemPersonalAccessTokensItemWithPat_PostRequestBody()(*ItemPersonalAccessTokensItemWithPat_PostRequestBody) { + m := &ItemPersonalAccessTokensItemWithPat_PostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPersonalAccessTokensItemWithPat_PostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPersonalAccessTokensItemWithPat_PostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPersonalAccessTokensItemWithPat_PostRequestBody(), 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 *ItemPersonalAccessTokensItemWithPat_PostRequestBody) 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 *ItemPersonalAccessTokensItemWithPat_PostRequestBody) 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 *ItemPersonalAccessTokensItemWithPat_PostRequestBody) 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 *ItemPersonalAccessTokensItemWithPat_PostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemPersonalAccessTokensItemWithPat_PostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/orgs/item_personal_access_tokens_post_request_body.go b/pkg/github/orgs/item_personal_access_tokens_post_request_body.go new file mode 100644 index 00000000..0b802b32 --- /dev/null +++ b/pkg/github/orgs/item_personal_access_tokens_post_request_body.go @@ -0,0 +1,86 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPersonalAccessTokensPostRequestBody 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 IDs of the fine-grained personal access tokens. + pat_ids []int32 +} +// NewItemPersonalAccessTokensPostRequestBody instantiates a new ItemPersonalAccessTokensPostRequestBody and sets the default values. +func NewItemPersonalAccessTokensPostRequestBody()(*ItemPersonalAccessTokensPostRequestBody) { + m := &ItemPersonalAccessTokensPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPersonalAccessTokensPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPersonalAccessTokensPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPersonalAccessTokensPostRequestBody(), 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 *ItemPersonalAccessTokensPostRequestBody) 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 *ItemPersonalAccessTokensPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pat_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.SetPatIds(res) + } + return nil + } + return res +} +// GetPatIds gets the pat_ids property value. The IDs of the fine-grained personal access tokens. +// returns a []int32 when successful +func (m *ItemPersonalAccessTokensPostRequestBody) GetPatIds()([]int32) { + return m.pat_ids +} +// Serialize serializes information the current object +func (m *ItemPersonalAccessTokensPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetPatIds() != nil { + err := writer.WriteCollectionOfInt32Values("pat_ids", m.GetPatIds()) + 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 *ItemPersonalAccessTokensPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPatIds sets the pat_ids property value. The IDs of the fine-grained personal access tokens. +func (m *ItemPersonalAccessTokensPostRequestBody) SetPatIds(value []int32)() { + m.pat_ids = value +} +type ItemPersonalAccessTokensPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPatIds()([]int32) + SetPatIds(value []int32)() +} diff --git a/pkg/github/orgs/item_personal_access_tokens_post_response.go b/pkg/github/orgs/item_personal_access_tokens_post_response.go new file mode 100644 index 00000000..1bc4138b --- /dev/null +++ b/pkg/github/orgs/item_personal_access_tokens_post_response.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPersonalAccessTokensPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemPersonalAccessTokensPostResponse instantiates a new ItemPersonalAccessTokensPostResponse and sets the default values. +func NewItemPersonalAccessTokensPostResponse()(*ItemPersonalAccessTokensPostResponse) { + m := &ItemPersonalAccessTokensPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPersonalAccessTokensPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPersonalAccessTokensPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPersonalAccessTokensPostResponse(), 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 *ItemPersonalAccessTokensPostResponse) 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 *ItemPersonalAccessTokensPostResponse) 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 *ItemPersonalAccessTokensPostResponse) 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 *ItemPersonalAccessTokensPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemPersonalAccessTokensPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/orgs/item_personal_access_tokens_request_builder.go b/pkg/github/orgs/item_personal_access_tokens_request_builder.go new file mode 100644 index 00000000..8e70464e --- /dev/null +++ b/pkg/github/orgs/item_personal_access_tokens_request_builder.go @@ -0,0 +1,145 @@ +package orgs + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i35d4823030433975c3e5f1527c43a1c35b7c5b72c6dceda49af227fe074cff4d "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/personalaccesstokens" +) + +// ItemPersonalAccessTokensRequestBuilder builds and executes requests for operations under \orgs\{org}\personal-access-tokens +type ItemPersonalAccessTokensRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPersonalAccessTokensRequestBuilderGetQueryParameters lists approved fine-grained personal access tokens owned by organization members that can access organization resources.Only GitHub Apps can use this endpoint. +type ItemPersonalAccessTokensRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i35d4823030433975c3e5f1527c43a1c35b7c5b72c6dceda49af227fe074cff4d.GetDirectionQueryParameterType `uriparametername:"direction"` + // Only show fine-grained personal access tokens used after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Last_used_after *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"last_used_after"` + // Only show fine-grained personal access tokens used before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Last_used_before *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"last_used_before"` + // A list of owner usernames to use to filter the results. + Owner []string `uriparametername:"owner"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The permission to use to filter the results. + Permission *string `uriparametername:"permission"` + // The name of the repository to use to filter the results. + Repository *string `uriparametername:"repository"` + // The property by which to sort the results. + Sort *i35d4823030433975c3e5f1527c43a1c35b7c5b72c6dceda49af227fe074cff4d.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByPat_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.personalAccessTokens.item collection +// returns a *ItemPersonalAccessTokensWithPat_ItemRequestBuilder when successful +func (m *ItemPersonalAccessTokensRequestBuilder) ByPat_id(pat_id int32)(*ItemPersonalAccessTokensWithPat_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["pat_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(pat_id), 10) + return NewItemPersonalAccessTokensWithPat_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPersonalAccessTokensRequestBuilderInternal instantiates a new ItemPersonalAccessTokensRequestBuilder and sets the default values. +func NewItemPersonalAccessTokensRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokensRequestBuilder) { + m := &ItemPersonalAccessTokensRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/personal-access-tokens{?direction*,last_used_after*,last_used_before*,owner*,page*,per_page*,permission*,repository*,sort*}", pathParameters), + } + return m +} +// NewItemPersonalAccessTokensRequestBuilder instantiates a new ItemPersonalAccessTokensRequestBuilder and sets the default values. +func NewItemPersonalAccessTokensRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokensRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPersonalAccessTokensRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists approved fine-grained personal access tokens owned by organization members that can access organization resources.Only GitHub Apps can use this endpoint. +// returns a []OrganizationProgrammaticAccessGrantable 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 ValidationError 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/enterprise-server@3.14/rest/orgs/personal-access-tokens#list-fine-grained-personal-access-tokens-with-access-to-organization-resources +func (m *ItemPersonalAccessTokensRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokensRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationProgrammaticAccessGrantable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationProgrammaticAccessGrantFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationProgrammaticAccessGrantable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationProgrammaticAccessGrantable) + } + } + return val, nil +} +// Post updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access.Only GitHub Apps can use this endpoint. +// returns a ItemPersonalAccessTokensPostResponseable 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 ValidationError 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/enterprise-server@3.14/rest/orgs/personal-access-tokens#update-the-access-to-organization-resources-via-fine-grained-personal-access-tokens +func (m *ItemPersonalAccessTokensRequestBuilder) Post(ctx context.Context, body ItemPersonalAccessTokensPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemPersonalAccessTokensPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemPersonalAccessTokensPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemPersonalAccessTokensPostResponseable), nil +} +// ToGetRequestInformation lists approved fine-grained personal access tokens owned by organization members that can access organization resources.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokensRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPersonalAccessTokensRequestBuilderGetQueryParameters])(*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 updates the access organization members have to organization resources via fine-grained personal access tokens. Limited to revoking a token's existing access.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokensRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemPersonalAccessTokensPostRequestBodyable, 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 *ItemPersonalAccessTokensRequestBuilder when successful +func (m *ItemPersonalAccessTokensRequestBuilder) WithUrl(rawUrl string)(*ItemPersonalAccessTokensRequestBuilder) { + return NewItemPersonalAccessTokensRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_personal_access_tokens_with_pat_escaped_item_request_builder.go b/pkg/github/orgs/item_personal_access_tokens_with_pat_escaped_item_request_builder.go new file mode 100644 index 00000000..c3d721ec --- /dev/null +++ b/pkg/github/orgs/item_personal_access_tokens_with_pat_escaped_item_request_builder.go @@ -0,0 +1,72 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPersonalAccessTokensWithPat_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\personal-access-tokens\{pat_id} +type ItemPersonalAccessTokensWithPat_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPersonalAccessTokensWithPat_ItemRequestBuilderInternal instantiates a new ItemPersonalAccessTokensWithPat_ItemRequestBuilder and sets the default values. +func NewItemPersonalAccessTokensWithPat_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokensWithPat_ItemRequestBuilder) { + m := &ItemPersonalAccessTokensWithPat_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/personal-access-tokens/{pat_id}", pathParameters), + } + return m +} +// NewItemPersonalAccessTokensWithPat_ItemRequestBuilder instantiates a new ItemPersonalAccessTokensWithPat_ItemRequestBuilder and sets the default values. +func NewItemPersonalAccessTokensWithPat_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPersonalAccessTokensWithPat_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPersonalAccessTokensWithPat_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Post updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access.Only GitHub Apps can use this endpoint. +// 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 ValidationError 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/enterprise-server@3.14/rest/orgs/personal-access-tokens#update-the-access-a-fine-grained-personal-access-token-has-to-organization-resources +func (m *ItemPersonalAccessTokensWithPat_ItemRequestBuilder) Post(ctx context.Context, body ItemPersonalAccessTokensItemWithPat_PostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Repositories the repositories property +// returns a *ItemPersonalAccessTokensItemRepositoriesRequestBuilder when successful +func (m *ItemPersonalAccessTokensWithPat_ItemRequestBuilder) Repositories()(*ItemPersonalAccessTokensItemRepositoriesRequestBuilder) { + return NewItemPersonalAccessTokensItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToPostRequestInformation updates the access an organization member has to organization resources via a fine-grained personal access token. Limited to revoking the token's existing access. Limited to revoking a token's existing access.Only GitHub Apps can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemPersonalAccessTokensWithPat_ItemRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemPersonalAccessTokensItemWithPat_PostRequestBodyable, 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 *ItemPersonalAccessTokensWithPat_ItemRequestBuilder when successful +func (m *ItemPersonalAccessTokensWithPat_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemPersonalAccessTokensWithPat_ItemRequestBuilder) { + return NewItemPersonalAccessTokensWithPat_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_pre_receive_hooks_item_with_pre_escaped_receive_escaped_hook_escaped_patch_request_body.go b/pkg/github/orgs/item_pre_receive_hooks_item_with_pre_escaped_receive_escaped_hook_escaped_patch_request_body.go new file mode 100644 index 00000000..54f210e3 --- /dev/null +++ b/pkg/github/orgs/item_pre_receive_hooks_item_with_pre_escaped_receive_escaped_hook_escaped_patch_request_body.go @@ -0,0 +1,109 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody 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 repositories can override enforcement. + allow_downstream_configuration *bool + // The state of enforcement for the hook on this repository. + enforcement *string +} +// NewItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody instantiates a new ItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody and sets the default values. +func NewItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody()(*ItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) { + m := &ItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody(), 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 *ItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowDownstreamConfiguration gets the allow_downstream_configuration property value. Whether repositories can override enforcement. +// returns a *bool when successful +func (m *ItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) GetAllowDownstreamConfiguration()(*bool) { + return m.allow_downstream_configuration +} +// GetEnforcement gets the enforcement property value. The state of enforcement for the hook on this repository. +// returns a *string when successful +func (m *ItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) GetEnforcement()(*string) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_downstream_configuration"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowDownstreamConfiguration(val) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_downstream_configuration", m.GetAllowDownstreamConfiguration()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("enforcement", m.GetEnforcement()) + 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 *ItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowDownstreamConfiguration sets the allow_downstream_configuration property value. Whether repositories can override enforcement. +func (m *ItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) SetAllowDownstreamConfiguration(value *bool)() { + m.allow_downstream_configuration = value +} +// SetEnforcement sets the enforcement property value. The state of enforcement for the hook on this repository. +func (m *ItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) SetEnforcement(value *string)() { + m.enforcement = value +} +type ItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowDownstreamConfiguration()(*bool) + GetEnforcement()(*string) + SetAllowDownstreamConfiguration(value *bool)() + SetEnforcement(value *string)() +} diff --git a/pkg/github/orgs/item_pre_receive_hooks_request_builder.go b/pkg/github/orgs/item_pre_receive_hooks_request_builder.go new file mode 100644 index 00000000..41c87f67 --- /dev/null +++ b/pkg/github/orgs/item_pre_receive_hooks_request_builder.go @@ -0,0 +1,83 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + id2409d36c7b20f4f264b157e026cce9c1d36ffdde31f38521d5d3f2e2562a94c "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/prereceivehooks" +) + +// ItemPreReceiveHooksRequestBuilder builds and executes requests for operations under \orgs\{org}\pre-receive-hooks +type ItemPreReceiveHooksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPreReceiveHooksRequestBuilderGetQueryParameters list all pre-receive hooks that are enabled or testing for this organization as well as any disabled hooks that can be configured at the organization level. Globally disabled pre-receive hooks that do not allow downstream configuration are not listed. +type ItemPreReceiveHooksRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *id2409d36c7b20f4f264b157e026cce9c1d36ffdde31f38521d5d3f2e2562a94c.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The sort order for the response collection. + Sort *id2409d36c7b20f4f264b157e026cce9c1d36ffdde31f38521d5d3f2e2562a94c.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByPre_receive_hook_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.preReceiveHooks.item collection +// returns a *ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder when successful +func (m *ItemPreReceiveHooksRequestBuilder) ByPre_receive_hook_id(pre_receive_hook_id int32)(*ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["pre_receive_hook_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(pre_receive_hook_id), 10) + return NewItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPreReceiveHooksRequestBuilderInternal instantiates a new ItemPreReceiveHooksRequestBuilder and sets the default values. +func NewItemPreReceiveHooksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPreReceiveHooksRequestBuilder) { + m := &ItemPreReceiveHooksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/pre-receive-hooks{?direction*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewItemPreReceiveHooksRequestBuilder instantiates a new ItemPreReceiveHooksRequestBuilder and sets the default values. +func NewItemPreReceiveHooksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPreReceiveHooksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPreReceiveHooksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all pre-receive hooks that are enabled or testing for this organization as well as any disabled hooks that can be configured at the organization level. Globally disabled pre-receive hooks that do not allow downstream configuration are not listed. +// returns a []OrgPreReceiveHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/org-pre-receive-hooks#list-pre-receive-hooks-for-an-organization +func (m *ItemPreReceiveHooksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPreReceiveHooksRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgPreReceiveHookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgPreReceiveHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgPreReceiveHookable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgPreReceiveHookable) + } + } + return val, nil +} +// ToGetRequestInformation list all pre-receive hooks that are enabled or testing for this organization as well as any disabled hooks that can be configured at the organization level. Globally disabled pre-receive hooks that do not allow downstream configuration are not listed. +// returns a *RequestInformation when successful +func (m *ItemPreReceiveHooksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPreReceiveHooksRequestBuilderGetQueryParameters])(*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 *ItemPreReceiveHooksRequestBuilder when successful +func (m *ItemPreReceiveHooksRequestBuilder) WithUrl(rawUrl string)(*ItemPreReceiveHooksRequestBuilder) { + return NewItemPreReceiveHooksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_pre_receive_hooks_with_pre_escaped_receive_escaped_hook_escaped_item_request_builder.go b/pkg/github/orgs/item_pre_receive_hooks_with_pre_escaped_receive_escaped_hook_escaped_item_request_builder.go new file mode 100644 index 00000000..3e43caf9 --- /dev/null +++ b/pkg/github/orgs/item_pre_receive_hooks_with_pre_escaped_receive_escaped_hook_escaped_item_request_builder.go @@ -0,0 +1,114 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\pre-receive-hooks\{pre_receive_hook_id} +type ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilderInternal instantiates a new ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder and sets the default values. +func NewItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) { + m := &ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/pre-receive-hooks/{pre_receive_hook_id}", pathParameters), + } + return m +} +// NewItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder instantiates a new ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder and sets the default values. +func NewItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes any overrides for this hook at the org level for this org. +// returns a OrgPreReceiveHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/org-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-an-organization +func (m *ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgPreReceiveHookable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgPreReceiveHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgPreReceiveHookable), nil +} +// Get get a pre-receive hook for an organization +// returns a OrgPreReceiveHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/org-pre-receive-hooks#get-a-pre-receive-hook-for-an-organization +func (m *ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgPreReceiveHookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgPreReceiveHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgPreReceiveHookable), nil +} +// Patch for pre-receive hooks which are allowed to be configured at the org level, you can set `enforcement` and `allow_downstream_configuration` +// returns a OrgPreReceiveHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/org-pre-receive-hooks#update-pre-receive-hook-enforcement-for-an-organization +func (m *ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) Patch(ctx context.Context, body ItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgPreReceiveHookable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgPreReceiveHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgPreReceiveHookable), nil +} +// ToDeleteRequestInformation removes any overrides for this hook at the org level for this org. +// returns a *RequestInformation when successful +func (m *ItemPreReceiveHooksWithPre_receive_hook_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") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ItemPreReceiveHooksWithPre_receive_hook_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 for pre-receive hooks which are allowed to be configured at the org level, you can set `enforcement` and `allow_downstream_configuration` +// returns a *RequestInformation when successful +func (m *ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemPreReceiveHooksItemWithPre_receive_hook_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 *ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder when successful +func (m *ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) { + return NewItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_projects_post_request_body.go b/pkg/github/orgs/item_projects_post_request_body.go new file mode 100644 index 00000000..32b64945 --- /dev/null +++ b/pkg/github/orgs/item_projects_post_request_body.go @@ -0,0 +1,109 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemProjectsPostRequestBody 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 the project. + body *string + // The name of the project. + name *string +} +// NewItemProjectsPostRequestBody instantiates a new ItemProjectsPostRequestBody and sets the default values. +func NewItemProjectsPostRequestBody()(*ItemProjectsPostRequestBody) { + m := &ItemProjectsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemProjectsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemProjectsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemProjectsPostRequestBody(), 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 *ItemProjectsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The description of the project. +// returns a *string when successful +func (m *ItemProjectsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemProjectsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(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 project. +// returns a *string when successful +func (m *ItemProjectsPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemProjectsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemProjectsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The description of the project. +func (m *ItemProjectsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetName sets the name property value. The name of the project. +func (m *ItemProjectsPostRequestBody) SetName(value *string)() { + m.name = value +} +type ItemProjectsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetName()(*string) + SetBody(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/orgs/item_projects_request_builder.go b/pkg/github/orgs/item_projects_request_builder.go new file mode 100644 index 00000000..9318ec50 --- /dev/null +++ b/pkg/github/orgs/item_projects_request_builder.go @@ -0,0 +1,117 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i72f0ad6a09212453aaf5465a82a242c7afffb9c252603fd187a4ef02a6c44b63 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/projects" +) + +// ItemProjectsRequestBuilder builds and executes requests for operations under \orgs\{org}\projects +type ItemProjectsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemProjectsRequestBuilderGetQueryParameters lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +type ItemProjectsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Indicates the state of the projects to return. + State *i72f0ad6a09212453aaf5465a82a242c7afffb9c252603fd187a4ef02a6c44b63.GetStateQueryParameterType `uriparametername:"state"` +} +// NewItemProjectsRequestBuilderInternal instantiates a new ItemProjectsRequestBuilder and sets the default values. +func NewItemProjectsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsRequestBuilder) { + m := &ItemProjectsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/projects{?page*,per_page*,state*}", pathParameters), + } + return m +} +// NewItemProjectsRequestBuilder instantiates a new ItemProjectsRequestBuilder and sets the default values. +func NewItemProjectsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemProjectsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a []Projectable when successful +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/projects#list-organization-projects +func (m *ItemProjectsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemProjectsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable) + } + } + return val, nil +} +// Post creates an organization project board. Returns a `410 Gone` status if projects are disabled in the organization or if the organization does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a Projectable 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 410 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/projects#create-an-organization-project +func (m *ItemProjectsRequestBuilder) Post(ctx context.Context, body ItemProjectsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable), nil +} +// ToGetRequestInformation lists the projects in an organization. Returns a `404 Not Found` status if projects are disabled in the organization. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a *RequestInformation when successful +func (m *ItemProjectsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemProjectsRequestBuilderGetQueryParameters])(*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 organization project board. Returns a `410 Gone` status if projects are disabled in the organization or if the organization does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a *RequestInformation when successful +func (m *ItemProjectsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemProjectsPostRequestBodyable, 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 *ItemProjectsRequestBuilder when successful +func (m *ItemProjectsRequestBuilder) WithUrl(rawUrl string)(*ItemProjectsRequestBuilder) { + return NewItemProjectsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_properties_request_builder.go b/pkg/github/orgs/item_properties_request_builder.go new file mode 100644 index 00000000..25a021a8 --- /dev/null +++ b/pkg/github/orgs/item_properties_request_builder.go @@ -0,0 +1,33 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemPropertiesRequestBuilder builds and executes requests for operations under \orgs\{org}\properties +type ItemPropertiesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPropertiesRequestBuilderInternal instantiates a new ItemPropertiesRequestBuilder and sets the default values. +func NewItemPropertiesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesRequestBuilder) { + m := &ItemPropertiesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/properties", pathParameters), + } + return m +} +// NewItemPropertiesRequestBuilder instantiates a new ItemPropertiesRequestBuilder and sets the default values. +func NewItemPropertiesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPropertiesRequestBuilderInternal(urlParams, requestAdapter) +} +// Schema the schema property +// returns a *ItemPropertiesSchemaRequestBuilder when successful +func (m *ItemPropertiesRequestBuilder) Schema()(*ItemPropertiesSchemaRequestBuilder) { + return NewItemPropertiesSchemaRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Values the values property +// returns a *ItemPropertiesValuesRequestBuilder when successful +func (m *ItemPropertiesRequestBuilder) Values()(*ItemPropertiesValuesRequestBuilder) { + return NewItemPropertiesValuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, 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 new file mode 100644 index 00000000..de3b7982 --- /dev/null +++ b/pkg/github/orgs/item_properties_schema_item_with_custom_escaped_property_escaped_name_put_request_body.go @@ -0,0 +1,244 @@ +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 +type ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value struct { + // Composed type representation for type string + string *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.SetString(val) + } + 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 +} +// Serialize serializes information the current object +func (m *ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_value) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetString() != nil { + err := writer.WriteStringValue("", 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 +} +type ItemPropertiesSchemaItemWithCustom_property_namePutRequestBody_WithCustom_property_namePutRequestBody_default_valueable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetString()(*string) + SetString(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_patch_request_body.go b/pkg/github/orgs/item_properties_schema_patch_request_body.go new file mode 100644 index 00000000..d126ac23 --- /dev/null +++ b/pkg/github/orgs/item_properties_schema_patch_request_body.go @@ -0,0 +1,93 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemPropertiesSchemaPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The array of custom properties to create or update. + properties []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable +} +// NewItemPropertiesSchemaPatchRequestBody instantiates a new ItemPropertiesSchemaPatchRequestBody and sets the default values. +func NewItemPropertiesSchemaPatchRequestBody()(*ItemPropertiesSchemaPatchRequestBody) { + m := &ItemPropertiesSchemaPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPropertiesSchemaPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPropertiesSchemaPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPropertiesSchemaPatchRequestBody(), 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 *ItemPropertiesSchemaPatchRequestBody) 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 *ItemPropertiesSchemaPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCustomPropertyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable) + } + } + m.SetProperties(res) + } + return nil + } + return res +} +// GetProperties gets the properties property value. The array of custom properties to create or update. +// returns a []CustomPropertyable when successful +func (m *ItemPropertiesSchemaPatchRequestBody) GetProperties()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable) { + return m.properties +} +// Serialize serializes information the current object +func (m *ItemPropertiesSchemaPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetProperties() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetProperties())) + for i, v := range m.GetProperties() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("properties", 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 *ItemPropertiesSchemaPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetProperties sets the properties property value. The array of custom properties to create or update. +func (m *ItemPropertiesSchemaPatchRequestBody) SetProperties(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable)() { + m.properties = value +} +type ItemPropertiesSchemaPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetProperties()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable) + SetProperties(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable)() +} diff --git a/pkg/github/orgs/item_properties_schema_request_builder.go b/pkg/github/orgs/item_properties_schema_request_builder.go new file mode 100644 index 00000000..4231f0a9 --- /dev/null +++ b/pkg/github/orgs/item_properties_schema_request_builder.go @@ -0,0 +1,118 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPropertiesSchemaRequestBuilder builds and executes requests for operations under \orgs\{org}\properties\schema +type ItemPropertiesSchemaRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByCustom_property_name gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.properties.schema.item collection +// returns a *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder when successful +func (m *ItemPropertiesSchemaRequestBuilder) ByCustom_property_name(custom_property_name string)(*ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if custom_property_name != "" { + urlTplParams["custom_property_name"] = custom_property_name + } + return NewItemPropertiesSchemaWithCustom_property_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPropertiesSchemaRequestBuilderInternal instantiates a new ItemPropertiesSchemaRequestBuilder and sets the default values. +func NewItemPropertiesSchemaRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesSchemaRequestBuilder) { + m := &ItemPropertiesSchemaRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/properties/schema", pathParameters), + } + return m +} +// NewItemPropertiesSchemaRequestBuilder instantiates a new ItemPropertiesSchemaRequestBuilder and sets the default values. +func NewItemPropertiesSchemaRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesSchemaRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPropertiesSchemaRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets all custom properties defined for an organization.Organization members can read these properties. +// returns a []CustomPropertyable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/custom-properties#get-all-custom-properties-for-an-organization +func (m *ItemPropertiesSchemaRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCustomPropertyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable) + } + } + return val, nil +} +// Patch creates new or updates existing custom properties defined for an organization in a batch.To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. +// returns a []CustomPropertyable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/custom-properties#create-or-update-custom-properties-for-an-organization +func (m *ItemPropertiesSchemaRequestBuilder) Patch(ctx context.Context, body ItemPropertiesSchemaPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCustomPropertyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable) + } + } + return val, nil +} +// ToGetRequestInformation gets all custom properties defined for an organization.Organization members can read these properties. +// returns a *RequestInformation when successful +func (m *ItemPropertiesSchemaRequestBuilder) 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 creates new or updates existing custom properties defined for an organization in a batch.To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. +// returns a *RequestInformation when successful +func (m *ItemPropertiesSchemaRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemPropertiesSchemaPatchRequestBodyable, 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 *ItemPropertiesSchemaRequestBuilder when successful +func (m *ItemPropertiesSchemaRequestBuilder) WithUrl(rawUrl string)(*ItemPropertiesSchemaRequestBuilder) { + return NewItemPropertiesSchemaRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} 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 new file mode 100644 index 00000000..b91e8dbc --- /dev/null +++ b/pkg/github/orgs/item_properties_schema_with_custom_escaped_property_escaped_name_item_request_builder.go @@ -0,0 +1,129 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\properties\schema\{custom_property_name} +type ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPropertiesSchemaWithCustom_property_nameItemRequestBuilderInternal instantiates a new ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder and sets the default values. +func NewItemPropertiesSchemaWithCustom_property_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) { + m := &ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/properties/schema/{custom_property_name}", pathParameters), + } + return m +} +// NewItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder instantiates a new ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder and sets the default values. +func NewItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPropertiesSchemaWithCustom_property_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a custom property that is defined for an organization.To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. +// returns a 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/enterprise-server@3.14/rest/orgs/custom-properties#remove-a-custom-property-for-an-organization +func (m *ItemPropertiesSchemaWithCustom_property_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 { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a custom property that is defined for an organization.Organization members can read these properties. +// returns a CustomPropertyable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/custom-properties#get-a-custom-property-for-an-organization +func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCustomPropertyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable), nil +} +// Put creates a new or updates an existing custom property that is defined for an organization.To use this endpoint, the authenticated user must be one of:- An administrator for the organization.- A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. +// returns a CustomPropertyable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/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])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCustomPropertyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyable), nil +} +// ToDeleteRequestInformation removes a custom property that is defined for an organization.To use this endpoint, the authenticated user must be one of: - An administrator for the organization. - A user, or a user on a team, with the fine-grained permission of `custom_properties_org_definitions_manager` in the organization. +// returns a *RequestInformation when successful +func (m *ItemPropertiesSchemaWithCustom_property_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") + return requestInfo, nil +} +// ToGetRequestInformation gets a custom property that is defined for an organization.Organization members can read these properties. +// returns a *RequestInformation when successful +func (m *ItemPropertiesSchemaWithCustom_property_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 +} +// 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) { + 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 *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder when successful +func (m *ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder) { + return NewItemPropertiesSchemaWithCustom_property_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_properties_values_patch_request_body.go b/pkg/github/orgs/item_properties_values_patch_request_body.go new file mode 100644 index 00000000..e9a0c992 --- /dev/null +++ b/pkg/github/orgs/item_properties_values_patch_request_body.go @@ -0,0 +1,128 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemPropertiesValuesPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // List of custom property names and associated values to apply to the repositories. + properties []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable + // The names of repositories that the custom property values will be applied to. + repository_names []string +} +// NewItemPropertiesValuesPatchRequestBody instantiates a new ItemPropertiesValuesPatchRequestBody and sets the default values. +func NewItemPropertiesValuesPatchRequestBody()(*ItemPropertiesValuesPatchRequestBody) { + m := &ItemPropertiesValuesPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemPropertiesValuesPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemPropertiesValuesPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemPropertiesValuesPatchRequestBody(), 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 *ItemPropertiesValuesPatchRequestBody) 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 *ItemPropertiesValuesPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCustomPropertyValueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable) + } + } + m.SetProperties(res) + } + return nil + } + res["repository_names"] = 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.SetRepositoryNames(res) + } + return nil + } + return res +} +// GetProperties gets the properties property value. List of custom property names and associated values to apply to the repositories. +// returns a []CustomPropertyValueable when successful +func (m *ItemPropertiesValuesPatchRequestBody) GetProperties()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable) { + return m.properties +} +// GetRepositoryNames gets the repository_names property value. The names of repositories that the custom property values will be applied to. +// returns a []string when successful +func (m *ItemPropertiesValuesPatchRequestBody) GetRepositoryNames()([]string) { + return m.repository_names +} +// Serialize serializes information the current object +func (m *ItemPropertiesValuesPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetProperties() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetProperties())) + for i, v := range m.GetProperties() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("properties", cast) + if err != nil { + return err + } + } + if m.GetRepositoryNames() != nil { + err := writer.WriteCollectionOfStringValues("repository_names", m.GetRepositoryNames()) + 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 *ItemPropertiesValuesPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetProperties sets the properties property value. List of custom property names and associated values to apply to the repositories. +func (m *ItemPropertiesValuesPatchRequestBody) SetProperties(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable)() { + m.properties = value +} +// SetRepositoryNames sets the repository_names property value. The names of repositories that the custom property values will be applied to. +func (m *ItemPropertiesValuesPatchRequestBody) SetRepositoryNames(value []string)() { + m.repository_names = value +} +type ItemPropertiesValuesPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetProperties()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable) + GetRepositoryNames()([]string) + SetProperties(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable)() + SetRepositoryNames(value []string)() +} diff --git a/pkg/github/orgs/item_properties_values_request_builder.go b/pkg/github/orgs/item_properties_values_request_builder.go new file mode 100644 index 00000000..8dc99b58 --- /dev/null +++ b/pkg/github/orgs/item_properties_values_request_builder.go @@ -0,0 +1,110 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPropertiesValuesRequestBuilder builds and executes requests for operations under \orgs\{org}\properties\values +type ItemPropertiesValuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPropertiesValuesRequestBuilderGetQueryParameters lists organization repositories with all of their custom property values.Organization members can read these properties. +type ItemPropertiesValuesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Finds repositories in the organization with a query containing one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub Enterprise Server. The REST API supports the same qualifiers as the web interface for GitHub Enterprise Server. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.14/rest/search/search#constructing-a-search-query). See "[Searching for repositories](https://docs.github.com/enterprise-server@3.14/articles/searching-for-repositories/)" for a detailed list of qualifiers. + Repository_query *string `uriparametername:"repository_query"` +} +// NewItemPropertiesValuesRequestBuilderInternal instantiates a new ItemPropertiesValuesRequestBuilder and sets the default values. +func NewItemPropertiesValuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesValuesRequestBuilder) { + m := &ItemPropertiesValuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/properties/values{?page*,per_page*,repository_query*}", pathParameters), + } + return m +} +// NewItemPropertiesValuesRequestBuilder instantiates a new ItemPropertiesValuesRequestBuilder and sets the default values. +func NewItemPropertiesValuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPropertiesValuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPropertiesValuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists organization repositories with all of their custom property values.Organization members can read these properties. +// returns a []OrgRepoCustomPropertyValuesable 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/enterprise-server@3.14/rest/orgs/custom-properties#list-custom-property-values-for-organization-repositories +func (m *ItemPropertiesValuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPropertiesValuesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgRepoCustomPropertyValuesable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgRepoCustomPropertyValuesFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgRepoCustomPropertyValuesable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgRepoCustomPropertyValuesable) + } + } + return val, nil +} +// Patch create new or update existing custom property values for repositories in a batch that belong to an organization.Each target repository will have its custom property values updated to match the values provided in the request.A maximum of 30 repositories can be updated in a single request.Using a value of `null` for a custom property will remove or 'unset' the property value from the repository.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_values_editor` in the organization. +// 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/custom-properties#create-or-update-custom-property-values-for-organization-repositories +func (m *ItemPropertiesValuesRequestBuilder) Patch(ctx context.Context, body ItemPropertiesValuesPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation lists organization repositories with all of their custom property values.Organization members can read these properties. +// returns a *RequestInformation when successful +func (m *ItemPropertiesValuesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPropertiesValuesRequestBuilderGetQueryParameters])(*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 create new or update existing custom property values for repositories in a batch that belong to an organization.Each target repository will have its custom property values updated to match the values provided in the request.A maximum of 30 repositories can be updated in a single request.Using a value of `null` for a custom property will remove or 'unset' the property value from the repository.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_values_editor` in the organization. +// returns a *RequestInformation when successful +func (m *ItemPropertiesValuesRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemPropertiesValuesPatchRequestBodyable, 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 *ItemPropertiesValuesRequestBuilder when successful +func (m *ItemPropertiesValuesRequestBuilder) WithUrl(rawUrl string)(*ItemPropertiesValuesRequestBuilder) { + return NewItemPropertiesValuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_public_escaped_members_request_builder.go b/pkg/github/orgs/item_public_escaped_members_request_builder.go new file mode 100644 index 00000000..326b37c6 --- /dev/null +++ b/pkg/github/orgs/item_public_escaped_members_request_builder.go @@ -0,0 +1,79 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPublic_membersRequestBuilder builds and executes requests for operations under \orgs\{org}\public_members +type ItemPublic_membersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPublic_membersRequestBuilderGetQueryParameters members of an organization can choose to have their membership publicized or not. +type ItemPublic_membersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.public_members.item collection +// returns a *ItemPublic_membersWithUsernameItemRequestBuilder when successful +func (m *ItemPublic_membersRequestBuilder) ByUsername(username string)(*ItemPublic_membersWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemPublic_membersWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPublic_membersRequestBuilderInternal instantiates a new ItemPublic_membersRequestBuilder and sets the default values. +func NewItemPublic_membersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPublic_membersRequestBuilder) { + m := &ItemPublic_membersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/public_members{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemPublic_membersRequestBuilder instantiates a new ItemPublic_membersRequestBuilder and sets the default values. +func NewItemPublic_membersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPublic_membersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPublic_membersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get members of an organization can choose to have their membership publicized or not. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/members#list-public-organization-members +func (m *ItemPublic_membersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPublic_membersRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation members of an organization can choose to have their membership publicized or not. +// returns a *RequestInformation when successful +func (m *ItemPublic_membersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPublic_membersRequestBuilderGetQueryParameters])(*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 *ItemPublic_membersRequestBuilder when successful +func (m *ItemPublic_membersRequestBuilder) WithUrl(rawUrl string)(*ItemPublic_membersRequestBuilder) { + return NewItemPublic_membersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_public_escaped_members_with_username_item_request_builder.go b/pkg/github/orgs/item_public_escaped_members_with_username_item_request_builder.go new file mode 100644 index 00000000..f918fb05 --- /dev/null +++ b/pkg/github/orgs/item_public_escaped_members_with_username_item_request_builder.go @@ -0,0 +1,101 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPublic_membersWithUsernameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\public_members\{username} +type ItemPublic_membersWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPublic_membersWithUsernameItemRequestBuilderInternal instantiates a new ItemPublic_membersWithUsernameItemRequestBuilder and sets the default values. +func NewItemPublic_membersWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPublic_membersWithUsernameItemRequestBuilder) { + m := &ItemPublic_membersWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/public_members/{username}", pathParameters), + } + return m +} +// NewItemPublic_membersWithUsernameItemRequestBuilder instantiates a new ItemPublic_membersWithUsernameItemRequestBuilder and sets the default values. +func NewItemPublic_membersWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPublic_membersWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPublic_membersWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/members#remove-public-organization-membership-for-the-authenticated-user +func (m *ItemPublic_membersWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get check if the provided user is a public member of the organization. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/members#check-public-organization-membership-for-a-user +func (m *ItemPublic_membersWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put the user can publicize their own membership. (A user cannot publicize the membership for another user.)Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/members#set-public-organization-membership-for-the-authenticated-user +func (m *ItemPublic_membersWithUsernameItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes the public membership for the authenticated user from the specified organization, unless public visibility is enforced by default. +// returns a *RequestInformation when successful +func (m *ItemPublic_membersWithUsernameItemRequestBuilder) 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 +} +// ToGetRequestInformation check if the provided user is a public member of the organization. +// returns a *RequestInformation when successful +func (m *ItemPublic_membersWithUsernameItemRequestBuilder) 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) + return requestInfo, nil +} +// ToPutRequestInformation the user can publicize their own membership. (A user cannot publicize the membership for another user.)Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a *RequestInformation when successful +func (m *ItemPublic_membersWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, 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") + 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 *ItemPublic_membersWithUsernameItemRequestBuilder when successful +func (m *ItemPublic_membersWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemPublic_membersWithUsernameItemRequestBuilder) { + return NewItemPublic_membersWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_repos_post_request_body.go b/pkg/github/orgs/item_repos_post_request_body.go new file mode 100644 index 00000000..587e3491 --- /dev/null +++ b/pkg/github/orgs/item_repos_post_request_body.go @@ -0,0 +1,634 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemReposPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. + allow_auto_merge *bool + // Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. + allow_merge_commit *bool + // Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. + allow_rebase_merge *bool + // Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. + allow_squash_merge *bool + // Pass `true` to create an initial commit with empty README. + auto_init *bool + // The custom properties for the new repository. The keys are the custom property names, and the values are the corresponding custom property values. + custom_properties ItemReposPostRequestBody_custom_propertiesable + // Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. **The authenticated user must be an organization owner to set this property to `true`.** + delete_branch_on_merge *bool + // A short description of the repository. + description *string + // Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, "Haskell". + gitignore_template *string + // Whether downloads are enabled. + has_downloads *bool + // Either `true` to enable issues for this repository or `false` to disable them. + has_issues *bool + // Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. + has_projects *bool + // Either `true` to enable the wiki for this repository or `false` to disable it. + has_wiki *bool + // A URL with more information about the repository. + homepage *string + // Either `true` to make this repo available as a template repository or `false` to prevent it. + is_template *bool + // Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://docs.github.com/enterprise-server@3.14/articles/licensing-a-repository/#searching-github-by-license-type) as the `license_template` string. For example, "mit" or "mpl-2.0". + license_template *string + // The name of the repository. + name *string + // Whether the repository is private. + private *bool + // The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. + team_id *int32 + // Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + // Deprecated: + use_squash_pr_title_as_default *bool +} +// NewItemReposPostRequestBody instantiates a new ItemReposPostRequestBody and sets the default values. +func NewItemReposPostRequestBody()(*ItemReposPostRequestBody) { + m := &ItemReposPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemReposPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemReposPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemReposPostRequestBody(), 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 *ItemReposPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowMergeCommit gets the allow_merge_commit property value. Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAutoInit gets the auto_init property value. Pass `true` to create an initial commit with empty README. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetAutoInit()(*bool) { + return m.auto_init +} +// GetCustomProperties gets the custom_properties property value. The custom properties for the new repository. The keys are the custom property names, and the values are the corresponding custom property values. +// returns a ItemReposPostRequestBody_custom_propertiesable when successful +func (m *ItemReposPostRequestBody) GetCustomProperties()(ItemReposPostRequestBody_custom_propertiesable) { + return m.custom_properties +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. **The authenticated user must be an organization owner to set this property to `true`.** +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDescription gets the description property value. A short description of the repository. +// returns a *string when successful +func (m *ItemReposPostRequestBody) 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 *ItemReposPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["auto_init"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAutoInit(val) + } + return nil + } + res["custom_properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemReposPostRequestBody_custom_propertiesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCustomProperties(val.(ItemReposPostRequestBody_custom_propertiesable)) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + 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["gitignore_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitignoreTemplate(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["license_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicenseTemplate(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["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["team_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTeamId(val) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + return res +} +// GetGitignoreTemplate gets the gitignore_template property value. Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, "Haskell". +// returns a *string when successful +func (m *ItemReposPostRequestBody) GetGitignoreTemplate()(*string) { + return m.gitignore_template +} +// GetHasDownloads gets the has_downloads property value. Whether downloads are enabled. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. Either `true` to enable issues for this repository or `false` to disable them. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasProjects gets the has_projects property value. Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. Either `true` to enable the wiki for this repository or `false` to disable it. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. A URL with more information about the repository. +// returns a *string when successful +func (m *ItemReposPostRequestBody) GetHomepage()(*string) { + return m.homepage +} +// GetIsTemplate gets the is_template property value. Either `true` to make this repo available as a template repository or `false` to prevent it. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetIsTemplate()(*bool) { + return m.is_template +} +// GetLicenseTemplate gets the license_template property value. Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://docs.github.com/enterprise-server@3.14/articles/licensing-a-repository/#searching-github-by-license-type) as the `license_template` string. For example, "mit" or "mpl-2.0". +// returns a *string when successful +func (m *ItemReposPostRequestBody) GetLicenseTemplate()(*string) { + return m.license_template +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *ItemReposPostRequestBody) GetName()(*string) { + return m.name +} +// GetPrivate gets the private property value. Whether the repository is private. +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetPrivate()(*bool) { + return m.private +} +// GetTeamId gets the team_id property value. The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. +// returns a *int32 when successful +func (m *ItemReposPostRequestBody) GetTeamId()(*int32) { + return m.team_id +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +// returns a *bool when successful +func (m *ItemReposPostRequestBody) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// Serialize serializes information the current object +func (m *ItemReposPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("auto_init", m.GetAutoInit()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("custom_properties", m.GetCustomProperties()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gitignore_template", m.GetGitignoreTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("license_template", m.GetLicenseTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("team_id", m.GetTeamId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + 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 *ItemReposPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Either `true` to allow auto-merge on pull requests, or `false` to disallow auto-merge. +func (m *ItemReposPostRequestBody) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. +func (m *ItemReposPostRequestBody) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. +func (m *ItemReposPostRequestBody) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. +func (m *ItemReposPostRequestBody) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAutoInit sets the auto_init property value. Pass `true` to create an initial commit with empty README. +func (m *ItemReposPostRequestBody) SetAutoInit(value *bool)() { + m.auto_init = value +} +// SetCustomProperties sets the custom_properties property value. The custom properties for the new repository. The keys are the custom property names, and the values are the corresponding custom property values. +func (m *ItemReposPostRequestBody) SetCustomProperties(value ItemReposPostRequestBody_custom_propertiesable)() { + m.custom_properties = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. **The authenticated user must be an organization owner to set this property to `true`.** +func (m *ItemReposPostRequestBody) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDescription sets the description property value. A short description of the repository. +func (m *ItemReposPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetGitignoreTemplate sets the gitignore_template property value. Desired language or platform [.gitignore template](https://github.com/github/gitignore) to apply. Use the name of the template without the extension. For example, "Haskell". +func (m *ItemReposPostRequestBody) SetGitignoreTemplate(value *string)() { + m.gitignore_template = value +} +// SetHasDownloads sets the has_downloads property value. Whether downloads are enabled. +func (m *ItemReposPostRequestBody) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. Either `true` to enable issues for this repository or `false` to disable them. +func (m *ItemReposPostRequestBody) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasProjects sets the has_projects property value. Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. +func (m *ItemReposPostRequestBody) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. Either `true` to enable the wiki for this repository or `false` to disable it. +func (m *ItemReposPostRequestBody) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. A URL with more information about the repository. +func (m *ItemReposPostRequestBody) SetHomepage(value *string)() { + m.homepage = value +} +// SetIsTemplate sets the is_template property value. Either `true` to make this repo available as a template repository or `false` to prevent it. +func (m *ItemReposPostRequestBody) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetLicenseTemplate sets the license_template property value. Choose an [open source license template](https://choosealicense.com/) that best suits your needs, and then use the [license keyword](https://docs.github.com/enterprise-server@3.14/articles/licensing-a-repository/#searching-github-by-license-type) as the `license_template` string. For example, "mit" or "mpl-2.0". +func (m *ItemReposPostRequestBody) SetLicenseTemplate(value *string)() { + m.license_template = value +} +// SetName sets the name property value. The name of the repository. +func (m *ItemReposPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrivate sets the private property value. Whether the repository is private. +func (m *ItemReposPostRequestBody) SetPrivate(value *bool)() { + m.private = value +} +// SetTeamId sets the team_id property value. The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. +func (m *ItemReposPostRequestBody) SetTeamId(value *int32)() { + m.team_id = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +func (m *ItemReposPostRequestBody) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +type ItemReposPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAutoInit()(*bool) + GetCustomProperties()(ItemReposPostRequestBody_custom_propertiesable) + GetDeleteBranchOnMerge()(*bool) + GetDescription()(*string) + GetGitignoreTemplate()(*string) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetIsTemplate()(*bool) + GetLicenseTemplate()(*string) + GetName()(*string) + GetPrivate()(*bool) + GetTeamId()(*int32) + GetUseSquashPrTitleAsDefault()(*bool) + SetAllowAutoMerge(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAutoInit(value *bool)() + SetCustomProperties(value ItemReposPostRequestBody_custom_propertiesable)() + SetDeleteBranchOnMerge(value *bool)() + SetDescription(value *string)() + SetGitignoreTemplate(value *string)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetIsTemplate(value *bool)() + SetLicenseTemplate(value *string)() + SetName(value *string)() + SetPrivate(value *bool)() + SetTeamId(value *int32)() + SetUseSquashPrTitleAsDefault(value *bool)() +} diff --git a/pkg/github/orgs/item_repos_post_request_body_escaped_custom_escaped_properties.go b/pkg/github/orgs/item_repos_post_request_body_escaped_custom_escaped_properties.go new file mode 100644 index 00000000..17425c23 --- /dev/null +++ b/pkg/github/orgs/item_repos_post_request_body_escaped_custom_escaped_properties.go @@ -0,0 +1,52 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemReposPostRequestBody_custom_properties the custom properties for the new repository. The keys are the custom property names, and the values are the corresponding custom property values. +type ItemReposPostRequestBody_custom_properties struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemReposPostRequestBody_custom_properties instantiates a new ItemReposPostRequestBody_custom_properties and sets the default values. +func NewItemReposPostRequestBody_custom_properties()(*ItemReposPostRequestBody_custom_properties) { + m := &ItemReposPostRequestBody_custom_properties{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemReposPostRequestBody_custom_propertiesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemReposPostRequestBody_custom_propertiesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemReposPostRequestBody_custom_properties(), 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 *ItemReposPostRequestBody_custom_properties) 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 *ItemReposPostRequestBody_custom_properties) 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 *ItemReposPostRequestBody_custom_properties) 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 *ItemReposPostRequestBody_custom_properties) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemReposPostRequestBody_custom_propertiesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/orgs/item_repos_request_builder.go b/pkg/github/orgs/item_repos_request_builder.go new file mode 100644 index 00000000..225465d8 --- /dev/null +++ b/pkg/github/orgs/item_repos_request_builder.go @@ -0,0 +1,111 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i9ecb84079df076f924af6743ca904bedb15108a1a15be3735b58ed8f46e9cb20 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/repos" +) + +// ItemReposRequestBuilder builds and executes requests for operations under \orgs\{org}\repos +type ItemReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemReposRequestBuilderGetQueryParameters lists repositories for the specified organization.> [!NOTE]> In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." +type ItemReposRequestBuilderGetQueryParameters struct { + // The order to sort by. Default: `asc` when using `full_name`, otherwise `desc`. + Direction *i9ecb84079df076f924af6743ca904bedb15108a1a15be3735b58ed8f46e9cb20.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The property to sort the results by. + Sort *i9ecb84079df076f924af6743ca904bedb15108a1a15be3735b58ed8f46e9cb20.GetSortQueryParameterType `uriparametername:"sort"` + // Specifies the types of repositories you want returned. `internal` is not yet supported when a GitHub App calls this endpoint with an installation access token. + Type *i9ecb84079df076f924af6743ca904bedb15108a1a15be3735b58ed8f46e9cb20.GetTypeQueryParameterType `uriparametername:"type"` +} +// NewItemReposRequestBuilderInternal instantiates a new ItemReposRequestBuilder and sets the default values. +func NewItemReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposRequestBuilder) { + m := &ItemReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/repos{?direction*,page*,per_page*,sort*,type*}", pathParameters), + } + return m +} +// NewItemReposRequestBuilder instantiates a new ItemReposRequestBuilder and sets the default values. +func NewItemReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemReposRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repositories for the specified organization.> [!NOTE]> In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." +// returns a []MinimalRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#list-organization-repositories +func (m *ItemReposRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReposRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + return val, nil +} +// Post creates a new repository in the specified organization. The authenticated user must be a member of the organization.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository. +// returns a FullRepositoryable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#create-an-organization-repository +func (m *ItemReposRequestBuilder) Post(ctx context.Context, body ItemReposPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FullRepositoryable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FullRepositoryable), nil +} +// ToGetRequestInformation lists repositories for the specified organization.> [!NOTE]> In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." +// returns a *RequestInformation when successful +func (m *ItemReposRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReposRequestBuilderGetQueryParameters])(*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 new repository in the specified organization. The authenticated user must be a member of the organization.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository. +// returns a *RequestInformation when successful +func (m *ItemReposRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemReposPostRequestBodyable, 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 *ItemReposRequestBuilder when successful +func (m *ItemReposRequestBuilder) WithUrl(rawUrl string)(*ItemReposRequestBuilder) { + return NewItemReposRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_repository_fine_grained_permissions_request_builder.go b/pkg/github/orgs/item_repository_fine_grained_permissions_request_builder.go new file mode 100644 index 00000000..6c640237 --- /dev/null +++ b/pkg/github/orgs/item_repository_fine_grained_permissions_request_builder.go @@ -0,0 +1,60 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemRepositoryFineGrainedPermissionsRequestBuilder builds and executes requests for operations under \orgs\{org}\repository-fine-grained-permissions +type ItemRepositoryFineGrainedPermissionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemRepositoryFineGrainedPermissionsRequestBuilderInternal instantiates a new ItemRepositoryFineGrainedPermissionsRequestBuilder and sets the default values. +func NewItemRepositoryFineGrainedPermissionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRepositoryFineGrainedPermissionsRequestBuilder) { + m := &ItemRepositoryFineGrainedPermissionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/repository-fine-grained-permissions", pathParameters), + } + return m +} +// NewItemRepositoryFineGrainedPermissionsRequestBuilder instantiates a new ItemRepositoryFineGrainedPermissionsRequestBuilder and sets the default values. +func NewItemRepositoryFineGrainedPermissionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRepositoryFineGrainedPermissionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemRepositoryFineGrainedPermissionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the fine-grained permissions that can be used in custom repository roles for an organization. For more information, see "[About custom repository roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-repository-roles)."The authenticated user must be an administrator of the organization or of a repository of the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. +// returns a []RepositoryFineGrainedPermissionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/custom-roles#list-repository-fine-grained-permissions-for-an-organization +func (m *ItemRepositoryFineGrainedPermissionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryFineGrainedPermissionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryFineGrainedPermissionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryFineGrainedPermissionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryFineGrainedPermissionable) + } + } + return val, nil +} +// ToGetRequestInformation lists the fine-grained permissions that can be used in custom repository roles for an organization. For more information, see "[About custom repository roles](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/about-custom-repository-roles)."The authenticated user must be an administrator of the organization or of a repository of the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemRepositoryFineGrainedPermissionsRequestBuilder) 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 *ItemRepositoryFineGrainedPermissionsRequestBuilder when successful +func (m *ItemRepositoryFineGrainedPermissionsRequestBuilder) WithUrl(rawUrl string)(*ItemRepositoryFineGrainedPermissionsRequestBuilder) { + return NewItemRepositoryFineGrainedPermissionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} 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 new file mode 100644 index 00000000..5c178e55 --- /dev/null +++ b/pkg/github/orgs/item_rulesets_item_with_ruleset_escaped_put_request_body.go @@ -0,0 +1,222 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemRulesetsItemWithRuleset_PutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The actors that can bypass the rules in this ruleset + bypass_actors []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable + // Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. + conditions ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.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. + enforcement *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement + // The name of the ruleset. + name *string + // An array of rules within the ruleset. + rules []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable +} +// NewItemRulesetsItemWithRuleset_PutRequestBody instantiates a new ItemRulesetsItemWithRuleset_PutRequestBody and sets the default values. +func NewItemRulesetsItemWithRuleset_PutRequestBody()(*ItemRulesetsItemWithRuleset_PutRequestBody) { + m := &ItemRulesetsItemWithRuleset_PutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemRulesetsItemWithRuleset_PutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemRulesetsItemWithRuleset_PutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemRulesetsItemWithRuleset_PutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassActors gets the bypass_actors property value. The actors that can bypass the rules in this ruleset +// returns a []RepositoryRulesetBypassActorable when successful +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetBypassActors()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable) { + return m.bypass_actors +} +// GetConditions gets the conditions property value. Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. +// returns a OrgRulesetConditionsable when successful +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetConditions()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgRulesetConditionsable) { + return m.conditions +} +// GetEnforcement gets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page. +// returns a *RepositoryRuleEnforcement when successful +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetEnforcement()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_actors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRulesetBypassActorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable) + } + } + m.SetBypassActors(res) + } + return nil + } + res["conditions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgRulesetConditionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConditions(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgRulesetConditionsable)) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParseRepositoryRuleEnforcement) + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val.(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["rules"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable) + } + } + m.SetRules(res) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the ruleset. +// returns a *string when successful +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetName()(*string) { + return m.name +} +// GetRules gets the rules property value. An array of rules within the ruleset. +// returns a []RepositoryRuleable when successful +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) GetRules()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable) { + return m.rules +} +// Serialize serializes information the current object +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBypassActors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetBypassActors())) + for i, v := range m.GetBypassActors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("bypass_actors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("conditions", m.GetConditions()) + if err != nil { + return err + } + } + if m.GetEnforcement() != nil { + cast := (*m.GetEnforcement()).String() + err := writer.WriteStringValue("enforcement", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetRules() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRules())) + for i, v := range m.GetRules() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("rules", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassActors sets the bypass_actors property value. The actors that can bypass the rules in this ruleset +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetBypassActors(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable)() { + m.bypass_actors = value +} +// SetConditions sets the conditions property value. Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetConditions(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgRulesetConditionsable)() { + m.conditions = value +} +// SetEnforcement sets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page. +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetEnforcement(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement)() { + m.enforcement = value +} +// SetName sets the name property value. The name of the ruleset. +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetName(value *string)() { + m.name = value +} +// SetRules sets the rules property value. An array of rules within the ruleset. +func (m *ItemRulesetsItemWithRuleset_PutRequestBody) SetRules(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable)() { + m.rules = value +} +type ItemRulesetsItemWithRuleset_PutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassActors()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable) + GetConditions()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgRulesetConditionsable) + GetEnforcement()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement) + GetName()(*string) + GetRules()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable) + SetBypassActors(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable)() + SetConditions(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgRulesetConditionsable)() + SetEnforcement(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement)() + SetName(value *string)() + SetRules(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable)() +} diff --git a/pkg/github/orgs/item_rulesets_post_request_body.go b/pkg/github/orgs/item_rulesets_post_request_body.go new file mode 100644 index 00000000..51b92bf2 --- /dev/null +++ b/pkg/github/orgs/item_rulesets_post_request_body.go @@ -0,0 +1,222 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemRulesetsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The actors that can bypass the rules in this ruleset + bypass_actors []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable + // Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. + conditions ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.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. + enforcement *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement + // The name of the ruleset. + name *string + // An array of rules within the ruleset. + rules []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable +} +// NewItemRulesetsPostRequestBody instantiates a new ItemRulesetsPostRequestBody and sets the default values. +func NewItemRulesetsPostRequestBody()(*ItemRulesetsPostRequestBody) { + m := &ItemRulesetsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemRulesetsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemRulesetsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemRulesetsPostRequestBody(), 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 *ItemRulesetsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassActors gets the bypass_actors property value. The actors that can bypass the rules in this ruleset +// returns a []RepositoryRulesetBypassActorable when successful +func (m *ItemRulesetsPostRequestBody) GetBypassActors()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable) { + return m.bypass_actors +} +// GetConditions gets the conditions property value. Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. +// returns a OrgRulesetConditionsable when successful +func (m *ItemRulesetsPostRequestBody) GetConditions()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgRulesetConditionsable) { + return m.conditions +} +// GetEnforcement gets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page. +// returns a *RepositoryRuleEnforcement when successful +func (m *ItemRulesetsPostRequestBody) GetEnforcement()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemRulesetsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_actors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRulesetBypassActorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable) + } + } + m.SetBypassActors(res) + } + return nil + } + res["conditions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgRulesetConditionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConditions(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgRulesetConditionsable)) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParseRepositoryRuleEnforcement) + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val.(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["rules"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable) + } + } + m.SetRules(res) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the ruleset. +// returns a *string when successful +func (m *ItemRulesetsPostRequestBody) GetName()(*string) { + return m.name +} +// GetRules gets the rules property value. An array of rules within the ruleset. +// returns a []RepositoryRuleable when successful +func (m *ItemRulesetsPostRequestBody) GetRules()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable) { + return m.rules +} +// Serialize serializes information the current object +func (m *ItemRulesetsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBypassActors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetBypassActors())) + for i, v := range m.GetBypassActors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("bypass_actors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("conditions", m.GetConditions()) + if err != nil { + return err + } + } + if m.GetEnforcement() != nil { + cast := (*m.GetEnforcement()).String() + err := writer.WriteStringValue("enforcement", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetRules() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRules())) + for i, v := range m.GetRules() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("rules", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemRulesetsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassActors sets the bypass_actors property value. The actors that can bypass the rules in this ruleset +func (m *ItemRulesetsPostRequestBody) SetBypassActors(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable)() { + m.bypass_actors = value +} +// SetConditions sets the conditions property value. Conditions for an organization ruleset. The conditions object should contain both `repository_name` and `ref_name` properties or both `repository_id` and `ref_name` properties. +func (m *ItemRulesetsPostRequestBody) SetConditions(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgRulesetConditionsable)() { + m.conditions = value +} +// SetEnforcement sets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page. +func (m *ItemRulesetsPostRequestBody) SetEnforcement(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement)() { + m.enforcement = value +} +// SetName sets the name property value. The name of the ruleset. +func (m *ItemRulesetsPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetRules sets the rules property value. An array of rules within the ruleset. +func (m *ItemRulesetsPostRequestBody) SetRules(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable)() { + m.rules = value +} +type ItemRulesetsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassActors()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable) + GetConditions()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgRulesetConditionsable) + GetEnforcement()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement) + GetName()(*string) + GetRules()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable) + SetBypassActors(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable)() + SetConditions(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgRulesetConditionsable)() + SetEnforcement(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement)() + SetName(value *string)() + SetRules(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable)() +} diff --git a/pkg/github/orgs/item_rulesets_request_builder.go b/pkg/github/orgs/item_rulesets_request_builder.go new file mode 100644 index 00000000..2346d139 --- /dev/null +++ b/pkg/github/orgs/item_rulesets_request_builder.go @@ -0,0 +1,126 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemRulesetsRequestBuilder builds and executes requests for operations under \orgs\{org}\rulesets +type ItemRulesetsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemRulesetsRequestBuilderGetQueryParameters get all the repository rulesets for an organization. +type ItemRulesetsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRuleset_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.rulesets.item collection +// returns a *ItemRulesetsWithRuleset_ItemRequestBuilder when successful +func (m *ItemRulesetsRequestBuilder) ByRuleset_id(ruleset_id int32)(*ItemRulesetsWithRuleset_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["ruleset_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(ruleset_id), 10) + return NewItemRulesetsWithRuleset_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemRulesetsRequestBuilderInternal instantiates a new ItemRulesetsRequestBuilder and sets the default values. +func NewItemRulesetsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsRequestBuilder) { + m := &ItemRulesetsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/rulesets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemRulesetsRequestBuilder instantiates a new ItemRulesetsRequestBuilder and sets the default values. +func NewItemRulesetsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemRulesetsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get all the repository rulesets for an organization. +// returns a []RepositoryRulesetable when successful +// 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/enterprise-server@3.14/rest/orgs/rules#get-all-organization-repository-rulesets +func (m *ItemRulesetsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemRulesetsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable) + } + } + return val, nil +} +// Post create a repository ruleset for an organization. +// returns a RepositoryRulesetable when successful +// 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/enterprise-server@3.14/rest/orgs/rules#create-an-organization-repository-ruleset +func (m *ItemRulesetsRequestBuilder) Post(ctx context.Context, body ItemRulesetsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable), nil +} +// RuleSuites the ruleSuites property +// returns a *ItemRulesetsRuleSuitesRequestBuilder when successful +func (m *ItemRulesetsRequestBuilder) RuleSuites()(*ItemRulesetsRuleSuitesRequestBuilder) { + return NewItemRulesetsRuleSuitesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation get all the repository rulesets for an organization. +// returns a *RequestInformation when successful +func (m *ItemRulesetsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemRulesetsRequestBuilderGetQueryParameters])(*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 create a repository ruleset for an organization. +// returns a *RequestInformation when successful +func (m *ItemRulesetsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemRulesetsPostRequestBodyable, 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 *ItemRulesetsRequestBuilder when successful +func (m *ItemRulesetsRequestBuilder) WithUrl(rawUrl string)(*ItemRulesetsRequestBuilder) { + return NewItemRulesetsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_rulesets_rule_suites_request_builder.go b/pkg/github/orgs/item_rulesets_rule_suites_request_builder.go new file mode 100644 index 00000000..564d3372 --- /dev/null +++ b/pkg/github/orgs/item_rulesets_rule_suites_request_builder.go @@ -0,0 +1,95 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i31c30ddb6562bcb87dda14919ea43ceb1ab0722affb3dc558b9a6559aaa54f67 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/rulesets/rulesuites" +) + +// ItemRulesetsRuleSuitesRequestBuilder builds and executes requests for operations under \orgs\{org}\rulesets\rule-suites +type ItemRulesetsRuleSuitesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemRulesetsRuleSuitesRequestBuilderGetQueryParameters lists suites of rule evaluations at the organization level.For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets)." +type ItemRulesetsRuleSuitesRequestBuilderGetQueryParameters struct { + // The handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned. + Actor_name *string `uriparametername:"actor_name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The name of the ref. Cannot contain wildcard characters. When specified, only rule evaluations triggered for this ref will be returned. + Ref *string `uriparametername:"ref"` + // The name of the repository to filter on. When specified, only rule evaluations from this repository will be returned. + Repository_name *int32 `uriparametername:"repository_name"` + // The rule results to filter on. When specified, only suites with this result will be returned. + Rule_suite_result *i31c30ddb6562bcb87dda14919ea43ceb1ab0722affb3dc558b9a6559aaa54f67.GetRule_suite_resultQueryParameterType `uriparametername:"rule_suite_result"` + // The time period to filter by.For example, `day` will filter for rule suites that occurred in the past 24 hours, and `week` will filter for insights that occurred in the past 7 days (168 hours). + Time_period *i31c30ddb6562bcb87dda14919ea43ceb1ab0722affb3dc558b9a6559aaa54f67.GetTime_periodQueryParameterType `uriparametername:"time_period"` +} +// ByRule_suite_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.rulesets.ruleSuites.item collection +// returns a *ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder when successful +func (m *ItemRulesetsRuleSuitesRequestBuilder) ByRule_suite_id(rule_suite_id int32)(*ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["rule_suite_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(rule_suite_id), 10) + return NewItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemRulesetsRuleSuitesRequestBuilderInternal instantiates a new ItemRulesetsRuleSuitesRequestBuilder and sets the default values. +func NewItemRulesetsRuleSuitesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsRuleSuitesRequestBuilder) { + m := &ItemRulesetsRuleSuitesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/rulesets/rule-suites{?actor_name*,page*,per_page*,ref*,repository_name*,rule_suite_result*,time_period*}", pathParameters), + } + return m +} +// NewItemRulesetsRuleSuitesRequestBuilder instantiates a new ItemRulesetsRuleSuitesRequestBuilder and sets the default values. +func NewItemRulesetsRuleSuitesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsRuleSuitesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemRulesetsRuleSuitesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists suites of rule evaluations at the organization level.For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets)." +// returns a []RuleSuitesable when successful +// 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/enterprise-server@3.14/rest/orgs/rule-suites#list-organization-rule-suites +func (m *ItemRulesetsRuleSuitesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemRulesetsRuleSuitesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RuleSuitesable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRuleSuitesFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RuleSuitesable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RuleSuitesable) + } + } + return val, nil +} +// ToGetRequestInformation lists suites of rule evaluations at the organization level.For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets)." +// returns a *RequestInformation when successful +func (m *ItemRulesetsRuleSuitesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemRulesetsRuleSuitesRequestBuilderGetQueryParameters])(*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 *ItemRulesetsRuleSuitesRequestBuilder when successful +func (m *ItemRulesetsRuleSuitesRequestBuilder) WithUrl(rawUrl string)(*ItemRulesetsRuleSuitesRequestBuilder) { + return NewItemRulesetsRuleSuitesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_rulesets_rule_suites_with_rule_escaped_suite_escaped_item_request_builder.go b/pkg/github/orgs/item_rulesets_rule_suites_with_rule_escaped_suite_escaped_item_request_builder.go new file mode 100644 index 00000000..6b4f545e --- /dev/null +++ b/pkg/github/orgs/item_rulesets_rule_suites_with_rule_escaped_suite_escaped_item_request_builder.go @@ -0,0 +1,63 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\rulesets\rule-suites\{rule_suite_id} +type ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal instantiates a new ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder and sets the default values. +func NewItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + m := &ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/rulesets/rule-suites/{rule_suite_id}", pathParameters), + } + return m +} +// NewItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder instantiates a new ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder and sets the default values. +func NewItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets information about a suite of rule evaluations from within an organization.For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets)." +// returns a RuleSuiteable when successful +// 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/enterprise-server@3.14/rest/orgs/rule-suites#get-an-organization-rule-suite +func (m *ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RuleSuiteable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRuleSuiteFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RuleSuiteable), nil +} +// ToGetRequestInformation gets information about a suite of rule evaluations from within an organization.For more information, see "[Managing rulesets for repositories in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-organization-settings/managing-rulesets-for-repositories-in-your-organization#viewing-insights-for-rulesets)." +// returns a *RequestInformation when successful +func (m *ItemRulesetsRuleSuitesWithRule_suite_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder when successful +func (m *ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + return NewItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_rulesets_with_ruleset_escaped_item_request_builder.go b/pkg/github/orgs/item_rulesets_with_ruleset_escaped_item_request_builder.go new file mode 100644 index 00000000..487f12c7 --- /dev/null +++ b/pkg/github/orgs/item_rulesets_with_ruleset_escaped_item_request_builder.go @@ -0,0 +1,129 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemRulesetsWithRuleset_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\rulesets\{ruleset_id} +type ItemRulesetsWithRuleset_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemRulesetsWithRuleset_ItemRequestBuilderInternal instantiates a new ItemRulesetsWithRuleset_ItemRequestBuilder and sets the default values. +func NewItemRulesetsWithRuleset_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsWithRuleset_ItemRequestBuilder) { + m := &ItemRulesetsWithRuleset_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/rulesets/{ruleset_id}", pathParameters), + } + return m +} +// NewItemRulesetsWithRuleset_ItemRequestBuilder instantiates a new ItemRulesetsWithRuleset_ItemRequestBuilder and sets the default values. +func NewItemRulesetsWithRuleset_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRulesetsWithRuleset_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemRulesetsWithRuleset_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a ruleset for an organization. +// 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/enterprise-server@3.14/rest/orgs/rules#delete-an-organization-repository-ruleset +func (m *ItemRulesetsWithRuleset_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 { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get get a repository ruleset for an organization.**Note:** To prevent leaking sensitive information, the `bypass_actors` property is only returned if the usermaking the API request has write access to the ruleset. +// returns a RepositoryRulesetable when successful +// 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/enterprise-server@3.14/rest/orgs/rules#get-an-organization-repository-ruleset +func (m *ItemRulesetsWithRuleset_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable), nil +} +// Put update a ruleset for an organization. +// returns a RepositoryRulesetable when successful +// 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/enterprise-server@3.14/rest/orgs/rules#update-an-organization-repository-ruleset +func (m *ItemRulesetsWithRuleset_ItemRequestBuilder) Put(ctx context.Context, body ItemRulesetsItemWithRuleset_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable), nil +} +// ToDeleteRequestInformation delete a ruleset for an organization. +// returns a *RequestInformation when successful +func (m *ItemRulesetsWithRuleset_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") + return requestInfo, nil +} +// ToGetRequestInformation get a repository ruleset for an organization.**Note:** To prevent leaking sensitive information, the `bypass_actors` property is only returned if the usermaking the API request has write access to the ruleset. +// returns a *RequestInformation when successful +func (m *ItemRulesetsWithRuleset_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 +} +// ToPutRequestInformation update a ruleset for an organization. +// returns a *RequestInformation when successful +func (m *ItemRulesetsWithRuleset_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemRulesetsItemWithRuleset_PutRequestBodyable, 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 *ItemRulesetsWithRuleset_ItemRequestBuilder when successful +func (m *ItemRulesetsWithRuleset_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemRulesetsWithRuleset_ItemRequestBuilder) { + return NewItemRulesetsWithRuleset_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_secret_scanning_alerts_request_builder.go b/pkg/github/orgs/item_secret_scanning_alerts_request_builder.go new file mode 100644 index 00000000..7dd0e363 --- /dev/null +++ b/pkg/github/orgs/item_secret_scanning_alerts_request_builder.go @@ -0,0 +1,90 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i7424a7e7ed210907f3a1fcdf8aa90dffa3a9669350059ae8849bd2aba37a1b90 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/secretscanning/alerts" +) + +// ItemSecretScanningAlertsRequestBuilder builds and executes requests for operations under \orgs\{org}\secret-scanning\alerts +type ItemSecretScanningAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemSecretScanningAlertsRequestBuilderGetQueryParameters lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.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 `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +type ItemSecretScanningAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *i7424a7e7ed210907f3a1fcdf8aa90dffa3a9669350059ae8849bd2aba37a1b90.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + 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/enterprise-server@3.14/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 *i7424a7e7ed210907f3a1fcdf8aa90dffa3a9669350059ae8849bd2aba37a1b90.GetSortQueryParameterType `uriparametername:"sort"` + // Set to `open` or `resolved` to only list secret scanning alerts in a specific state. + State *i7424a7e7ed210907f3a1fcdf8aa90dffa3a9669350059ae8849bd2aba37a1b90.GetStateQueryParameterType `uriparametername:"state"` + // A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. + Validity *string `uriparametername:"validity"` +} +// NewItemSecretScanningAlertsRequestBuilderInternal instantiates a new ItemSecretScanningAlertsRequestBuilder and sets the default values. +func NewItemSecretScanningAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningAlertsRequestBuilder) { + m := &ItemSecretScanningAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/secret-scanning/alerts{?after*,before*,direction*,page*,per_page*,resolution*,secret_type*,sort*,state*,validity*}", pathParameters), + } + return m +} +// NewItemSecretScanningAlertsRequestBuilder instantiates a new ItemSecretScanningAlertsRequestBuilder and sets the default values. +func NewItemSecretScanningAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSecretScanningAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.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 `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a []OrganizationSecretScanningAlertable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a Alerts503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-an-organization +func (m *ItemSecretScanningAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSecretScanningAlertsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSecretScanningAlertable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAlerts503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationSecretScanningAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSecretScanningAlertable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSecretScanningAlertable) + } + } + return val, nil +} +// ToGetRequestInformation lists secret scanning alerts for eligible repositories in an organization, from newest to oldest.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 `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemSecretScanningAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSecretScanningAlertsRequestBuilderGetQueryParameters])(*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 *ItemSecretScanningAlertsRequestBuilder when successful +func (m *ItemSecretScanningAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemSecretScanningAlertsRequestBuilder) { + return NewItemSecretScanningAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_secret_scanning_request_builder.go b/pkg/github/orgs/item_secret_scanning_request_builder.go new file mode 100644 index 00000000..2ffa92c4 --- /dev/null +++ b/pkg/github/orgs/item_secret_scanning_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSecretScanningRequestBuilder builds and executes requests for operations under \orgs\{org}\secret-scanning +type ItemSecretScanningRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemSecretScanningAlertsRequestBuilder when successful +func (m *ItemSecretScanningRequestBuilder) Alerts()(*ItemSecretScanningAlertsRequestBuilder) { + return NewItemSecretScanningAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemSecretScanningRequestBuilderInternal instantiates a new ItemSecretScanningRequestBuilder and sets the default values. +func NewItemSecretScanningRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningRequestBuilder) { + m := &ItemSecretScanningRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/secret-scanning", pathParameters), + } + return m +} +// NewItemSecretScanningRequestBuilder instantiates a new ItemSecretScanningRequestBuilder and sets the default values. +func NewItemSecretScanningRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecretScanningRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSecretScanningRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/item_security_managers_request_builder.go b/pkg/github/orgs/item_security_managers_request_builder.go new file mode 100644 index 00000000..244cc3b0 --- /dev/null +++ b/pkg/github/orgs/item_security_managers_request_builder.go @@ -0,0 +1,65 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemSecurityManagersRequestBuilder builds and executes requests for operations under \orgs\{org}\security-managers +type ItemSecurityManagersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemSecurityManagersRequestBuilderInternal instantiates a new ItemSecurityManagersRequestBuilder and sets the default values. +func NewItemSecurityManagersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecurityManagersRequestBuilder) { + m := &ItemSecurityManagersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/security-managers", pathParameters), + } + return m +} +// NewItemSecurityManagersRequestBuilder instantiates a new ItemSecurityManagersRequestBuilder and sets the default values. +func NewItemSecurityManagersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecurityManagersRequestBuilder) { + urlParams := make(map[string]string) + 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/enterprise-server@3.14/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. +// returns a []TeamSimpleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/security-managers#list-security-manager-teams +func (m *ItemSecurityManagersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamSimpleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamSimpleable) + } + } + return val, nil +} +// Teams the teams property +// returns a *ItemSecurityManagersTeamsRequestBuilder when successful +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/enterprise-server@3.14/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. +// 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) + 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 *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 new file mode 100644 index 00000000..5118ef2d --- /dev/null +++ b/pkg/github/orgs/item_security_managers_teams_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSecurityManagersTeamsRequestBuilder builds and executes requests for operations under \orgs\{org}\security-managers\teams +type ItemSecurityManagersTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTeam_slug gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.securityManagers.teams.item collection +// returns a *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder when successful +func (m *ItemSecurityManagersTeamsRequestBuilder) ByTeam_slug(team_slug string)(*ItemSecurityManagersTeamsWithTeam_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 NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemSecurityManagersTeamsRequestBuilderInternal instantiates a new ItemSecurityManagersTeamsRequestBuilder and sets the default values. +func NewItemSecurityManagersTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecurityManagersTeamsRequestBuilder) { + m := &ItemSecurityManagersTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/security-managers/teams", pathParameters), + } + return m +} +// NewItemSecurityManagersTeamsRequestBuilder instantiates a new ItemSecurityManagersTeamsRequestBuilder and sets the default values. +func NewItemSecurityManagersTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecurityManagersTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSecurityManagersTeamsRequestBuilderInternal(urlParams, requestAdapter) +} 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 new file mode 100644 index 00000000..48b9ae6c --- /dev/null +++ b/pkg/github/orgs/item_security_managers_teams_with_team_escaped_slug_item_request_builder.go @@ -0,0 +1,73 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder builds and executes requests for operations under \orgs\{org}\security-managers\teams\{team_slug} +type ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilderInternal instantiates a new ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder and sets the default values. +func NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) { + m := &ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/security-managers/teams/{team_slug}", pathParameters), + } + return m +} +// NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder instantiates a new ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder and sets the default values. +func NewItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) { + urlParams := make(map[string]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/enterprise-server@3.14/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. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/security-managers#remove-a-security-manager-team +func (m *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + 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/enterprise-server@3.14/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. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/security-managers#add-a-security-manager-team +func (m *ItemSecurityManagersTeamsWithTeam_slugItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + 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/enterprise-server@3.14/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. +// 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/enterprise-server@3.14/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. +// 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) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *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/item_settings_billing_advanced_security_request_builder.go b/pkg/github/orgs/item_settings_billing_advanced_security_request_builder.go new file mode 100644 index 00000000..88be0c97 --- /dev/null +++ b/pkg/github/orgs/item_settings_billing_advanced_security_request_builder.go @@ -0,0 +1,64 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemSettingsBillingAdvancedSecurityRequestBuilder builds and executes requests for operations under \orgs\{org}\settings\billing\advanced-security +type ItemSettingsBillingAdvancedSecurityRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemSettingsBillingAdvancedSecurityRequestBuilderGetQueryParameters gets the GitHub Advanced Security active committers for an organization per repository.Each distinct user login across all repositories is counted as a single Advanced Security seat, so the `total_advanced_security_committers` is not the sum of advanced_security_committers for each repository.If this organization defers to an enterprise for billing, the `total_advanced_security_committers` returned from the organization API may include some users that are in more than one organization, so they will only consume a single Advanced Security seat at the enterprise level.The total number of repositories with committer information is tracked by the `total_count` field. +type ItemSettingsBillingAdvancedSecurityRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemSettingsBillingAdvancedSecurityRequestBuilderInternal instantiates a new ItemSettingsBillingAdvancedSecurityRequestBuilder and sets the default values. +func NewItemSettingsBillingAdvancedSecurityRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingAdvancedSecurityRequestBuilder) { + m := &ItemSettingsBillingAdvancedSecurityRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/settings/billing/advanced-security{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemSettingsBillingAdvancedSecurityRequestBuilder instantiates a new ItemSettingsBillingAdvancedSecurityRequestBuilder and sets the default values. +func NewItemSettingsBillingAdvancedSecurityRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingAdvancedSecurityRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsBillingAdvancedSecurityRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the GitHub Advanced Security active committers for an organization per repository.Each distinct user login across all repositories is counted as a single Advanced Security seat, so the `total_advanced_security_committers` is not the sum of advanced_security_committers for each repository.If this organization defers to an enterprise for billing, the `total_advanced_security_committers` returned from the organization API may include some users that are in more than one organization, so they will only consume a single Advanced Security seat at the enterprise level.The total number of repositories with committer information is tracked by the `total_count` field. +// returns a AdvancedSecurityActiveCommittersable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/billing/billing#get-github-advanced-security-active-committers-for-an-organization +func (m *ItemSettingsBillingAdvancedSecurityRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSettingsBillingAdvancedSecurityRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AdvancedSecurityActiveCommittersable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAdvancedSecurityActiveCommittersFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AdvancedSecurityActiveCommittersable), nil +} +// ToGetRequestInformation gets the GitHub Advanced Security active committers for an organization per repository.Each distinct user login across all repositories is counted as a single Advanced Security seat, so the `total_advanced_security_committers` is not the sum of advanced_security_committers for each repository.If this organization defers to an enterprise for billing, the `total_advanced_security_committers` returned from the organization API may include some users that are in more than one organization, so they will only consume a single Advanced Security seat at the enterprise level.The total number of repositories with committer information is tracked by the `total_count` field. +// returns a *RequestInformation when successful +func (m *ItemSettingsBillingAdvancedSecurityRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSettingsBillingAdvancedSecurityRequestBuilderGetQueryParameters])(*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 *ItemSettingsBillingAdvancedSecurityRequestBuilder when successful +func (m *ItemSettingsBillingAdvancedSecurityRequestBuilder) WithUrl(rawUrl string)(*ItemSettingsBillingAdvancedSecurityRequestBuilder) { + return NewItemSettingsBillingAdvancedSecurityRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_settings_billing_request_builder.go b/pkg/github/orgs/item_settings_billing_request_builder.go new file mode 100644 index 00000000..02ebfe7e --- /dev/null +++ b/pkg/github/orgs/item_settings_billing_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSettingsBillingRequestBuilder builds and executes requests for operations under \orgs\{org}\settings\billing +type ItemSettingsBillingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// AdvancedSecurity the advancedSecurity property +// returns a *ItemSettingsBillingAdvancedSecurityRequestBuilder when successful +func (m *ItemSettingsBillingRequestBuilder) AdvancedSecurity()(*ItemSettingsBillingAdvancedSecurityRequestBuilder) { + return NewItemSettingsBillingAdvancedSecurityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemSettingsBillingRequestBuilderInternal instantiates a new ItemSettingsBillingRequestBuilder and sets the default values. +func NewItemSettingsBillingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingRequestBuilder) { + m := &ItemSettingsBillingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/settings/billing", pathParameters), + } + return m +} +// NewItemSettingsBillingRequestBuilder instantiates a new ItemSettingsBillingRequestBuilder and sets the default values. +func NewItemSettingsBillingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsBillingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsBillingRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/item_settings_request_builder.go b/pkg/github/orgs/item_settings_request_builder.go new file mode 100644 index 00000000..8939a225 --- /dev/null +++ b/pkg/github/orgs/item_settings_request_builder.go @@ -0,0 +1,28 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSettingsRequestBuilder builds and executes requests for operations under \orgs\{org}\settings +type ItemSettingsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Billing the billing property +// returns a *ItemSettingsBillingRequestBuilder when successful +func (m *ItemSettingsRequestBuilder) Billing()(*ItemSettingsBillingRequestBuilder) { + return NewItemSettingsBillingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemSettingsRequestBuilderInternal instantiates a new ItemSettingsRequestBuilder and sets the default values. +func NewItemSettingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsRequestBuilder) { + m := &ItemSettingsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/settings", pathParameters), + } + return m +} +// NewItemSettingsRequestBuilder instantiates a new ItemSettingsRequestBuilder and sets the default values. +func NewItemSettingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSettingsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSettingsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_post_request_body.go b/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_post_request_body.go new file mode 100644 index 00000000..10212070 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody instantiates a new ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody()(*ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody) { + m := &ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody(), 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 *ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody) 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 *ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody) 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 *ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody) 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 *ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_request_builder.go b/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_request_builder.go new file mode 100644 index 00000000..cfbb2075 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_request_builder.go @@ -0,0 +1,112 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i0c9a6d40bbcd88da4dddec9efef21a8133634385e5986dbe4d94ac414d7e5888 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/teams/item/discussions/item/comments/item/reactions" +) + +// ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions\{discussion_number}\comments\{comment_number}\reactions +type ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters list the reactions to a [team discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment).> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion comment. + Content *i0c9a6d40bbcd88da4dddec9efef21a8133634385e5986dbe4d94ac414d7e5888.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReaction_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.teams.item.discussions.item.comments.item.reactions.item collection +// returns a *ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) ByReaction_id(reaction_id int32)(*ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["reaction_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(reaction_id), 10) + return NewItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + m := &ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder instantiates a new ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the reactions to a [team discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment).> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a []Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable) + } + } + return val, nil +} +// Post create a reaction to a [team discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment).A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) Post(ctx context.Context, body ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable), nil +} +// ToGetRequestInformation list the reactions to a [team discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment).> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters])(*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 create a reaction to a [team discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment).A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTeamsItemDiscussionsItemCommentsItemReactionsPostRequestBodyable, 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 *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + return NewItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_with_reaction_escaped_item_request_builder.go b/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_with_reaction_escaped_item_request_builder.go new file mode 100644 index 00000000..4ed4b92c --- /dev/null +++ b/pkg/github/orgs/item_teams_item_discussions_item_comments_item_reactions_with_reaction_escaped_item_request_builder.go @@ -0,0 +1,51 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions\{discussion_number}\comments\{comment_number}\reactions\{reaction_id} +type ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + m := &ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}/reactions/{reaction_id}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder instantiates a new ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!NOTE]> You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`.Delete a reaction to a [team discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment).OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#delete-team-discussion-comment-reaction +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation > [!NOTE]> You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/comments/:comment_number/reactions/:reaction_id`.Delete a reaction to a [team discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment).OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_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) + 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 *ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + return NewItemTeamsItemDiscussionsItemCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_discussions_item_comments_item_with_comment_escaped_number_patch_request_body.go b/pkg/github/orgs/item_teams_item_discussions_item_comments_item_with_comment_escaped_number_patch_request_body.go new file mode 100644 index 00000000..c43bf70d --- /dev/null +++ b/pkg/github/orgs/item_teams_item_discussions_item_comments_item_with_comment_escaped_number_patch_request_body.go @@ -0,0 +1,80 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody 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 discussion comment's body text. + body *string +} +// NewItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody instantiates a new ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody()(*ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) { + m := &ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody(), 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 *ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion comment's body text. +// returns a *string when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion comment's body text. +func (m *ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/pkg/github/orgs/item_teams_item_discussions_item_comments_post_request_body.go b/pkg/github/orgs/item_teams_item_discussions_item_comments_post_request_body.go new file mode 100644 index 00000000..adc08739 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_discussions_item_comments_post_request_body.go @@ -0,0 +1,80 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemDiscussionsItemCommentsPostRequestBody 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 discussion comment's body text. + body *string +} +// NewItemTeamsItemDiscussionsItemCommentsPostRequestBody instantiates a new ItemTeamsItemDiscussionsItemCommentsPostRequestBody and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsPostRequestBody()(*ItemTeamsItemDiscussionsItemCommentsPostRequestBody) { + m := &ItemTeamsItemDiscussionsItemCommentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemDiscussionsItemCommentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemDiscussionsItemCommentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemDiscussionsItemCommentsPostRequestBody(), 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 *ItemTeamsItemDiscussionsItemCommentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion comment's body text. +// returns a *string when successful +func (m *ItemTeamsItemDiscussionsItemCommentsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemDiscussionsItemCommentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemTeamsItemDiscussionsItemCommentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemTeamsItemDiscussionsItemCommentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion comment's body text. +func (m *ItemTeamsItemDiscussionsItemCommentsPostRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemTeamsItemDiscussionsItemCommentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/pkg/github/orgs/item_teams_item_discussions_item_comments_request_builder.go b/pkg/github/orgs/item_teams_item_discussions_item_comments_request_builder.go new file mode 100644 index 00000000..a14aff7e --- /dev/null +++ b/pkg/github/orgs/item_teams_item_discussions_item_comments_request_builder.go @@ -0,0 +1,112 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i506241ca18d8ab7a848642012907263dc692e3e2bf03b77d94c968ee563897f7 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/teams/item/discussions/item/comments" +) + +// ItemTeamsItemDiscussionsItemCommentsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions\{discussion_number}\comments +type ItemTeamsItemDiscussionsItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemDiscussionsItemCommentsRequestBuilderGetQueryParameters list all comments on a team discussion.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemTeamsItemDiscussionsItemCommentsRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i506241ca18d8ab7a848642012907263dc692e3e2bf03b77d94c968ee563897f7.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByComment_number gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.teams.item.discussions.item.comments.item collection +// returns a *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemCommentsRequestBuilder) ByComment_number(comment_number int32)(*ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["comment_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(comment_number), 10) + return NewItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemDiscussionsItemCommentsRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsItemCommentsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsRequestBuilder) { + m := &ItemTeamsItemDiscussionsItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments{?direction*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsItemCommentsRequestBuilder instantiates a new ItemTeamsItemDiscussionsItemCommentsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all comments on a team discussion.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a []TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#list-discussion-comments +func (m *ItemTeamsItemDiscussionsItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsItemCommentsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable) + } + } + return val, nil +} +// Post creates a new comment on a team discussion.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#create-a-discussion-comment +func (m *ItemTeamsItemDiscussionsItemCommentsRequestBuilder) Post(ctx context.Context, body ItemTeamsItemDiscussionsItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable), nil +} +// ToGetRequestInformation list all comments on a team discussion.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsItemCommentsRequestBuilderGetQueryParameters])(*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 new comment on a team discussion.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTeamsItemDiscussionsItemCommentsPostRequestBodyable, 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 *ItemTeamsItemDiscussionsItemCommentsRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsItemCommentsRequestBuilder) { + return NewItemTeamsItemDiscussionsItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_discussions_item_comments_with_comment_escaped_number_item_request_builder.go b/pkg/github/orgs/item_teams_item_discussions_item_comments_with_comment_escaped_number_item_request_builder.go new file mode 100644 index 00000000..9fc4d3ee --- /dev/null +++ b/pkg/github/orgs/item_teams_item_discussions_item_comments_with_comment_escaped_number_item_request_builder.go @@ -0,0 +1,115 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions\{discussion_number}\comments\{comment_number} +type ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + m := &ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/comments/{comment_number}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder instantiates a new ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a comment on a team discussion.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#delete-a-discussion-comment +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get get a specific comment on a team discussion.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable), nil +} +// Patch edits the body text of a discussion comment.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#update-a-discussion-comment +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Patch(ctx context.Context, body ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable), nil +} +// Reactions the reactions property +// returns a *ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Reactions()(*ItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + return NewItemTeamsItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a comment on a team discussion.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) 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 +} +// ToGetRequestInformation get a specific comment on a team discussion.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) 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 edits the body text of a discussion comment.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}/comments/{comment_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemTeamsItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyable, 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 *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + return NewItemTeamsItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_discussions_item_reactions_post_request_body.go b/pkg/github/orgs/item_teams_item_discussions_item_reactions_post_request_body.go new file mode 100644 index 00000000..6efa3384 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_discussions_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemDiscussionsItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemTeamsItemDiscussionsItemReactionsPostRequestBody instantiates a new ItemTeamsItemDiscussionsItemReactionsPostRequestBody and sets the default values. +func NewItemTeamsItemDiscussionsItemReactionsPostRequestBody()(*ItemTeamsItemDiscussionsItemReactionsPostRequestBody) { + m := &ItemTeamsItemDiscussionsItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemDiscussionsItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemDiscussionsItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemDiscussionsItemReactionsPostRequestBody(), 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 *ItemTeamsItemDiscussionsItemReactionsPostRequestBody) 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 *ItemTeamsItemDiscussionsItemReactionsPostRequestBody) 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 *ItemTeamsItemDiscussionsItemReactionsPostRequestBody) 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 *ItemTeamsItemDiscussionsItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemTeamsItemDiscussionsItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/orgs/item_teams_item_discussions_item_reactions_request_builder.go b/pkg/github/orgs/item_teams_item_discussions_item_reactions_request_builder.go new file mode 100644 index 00000000..58267b89 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_discussions_item_reactions_request_builder.go @@ -0,0 +1,112 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i1a9fb7066804ddd6361dee05921db7500642f81a9bc16110ee3d166a9255e363 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/teams/item/discussions/item/reactions" +) + +// ItemTeamsItemDiscussionsItemReactionsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions\{discussion_number}\reactions +type ItemTeamsItemDiscussionsItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemDiscussionsItemReactionsRequestBuilderGetQueryParameters list the reactions to a [team discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion).> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemTeamsItemDiscussionsItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion. + Content *i1a9fb7066804ddd6361dee05921db7500642f81a9bc16110ee3d166a9255e363.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReaction_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.teams.item.discussions.item.reactions.item collection +// returns a *ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemReactionsRequestBuilder) ByReaction_id(reaction_id int32)(*ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["reaction_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(reaction_id), 10) + return NewItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemDiscussionsItemReactionsRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsItemReactionsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemReactionsRequestBuilder) { + m := &ItemTeamsItemDiscussionsItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsItemReactionsRequestBuilder instantiates a new ItemTeamsItemDiscussionsItemReactionsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the reactions to a [team discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion).> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a []Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-a-team-discussion +func (m *ItemTeamsItemDiscussionsItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsItemReactionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable) + } + } + return val, nil +} +// Post create a reaction to a [team discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion).A response with an HTTP `200` status means that you already added the reaction type to this team discussion.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#create-reaction-for-a-team-discussion +func (m *ItemTeamsItemDiscussionsItemReactionsRequestBuilder) Post(ctx context.Context, body ItemTeamsItemDiscussionsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable), nil +} +// ToGetRequestInformation list the reactions to a [team discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion).> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsItemReactionsRequestBuilderGetQueryParameters])(*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 create a reaction to a [team discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion).A response with an HTTP `200` status means that you already added the reaction type to this team discussion.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTeamsItemDiscussionsItemReactionsPostRequestBodyable, 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 *ItemTeamsItemDiscussionsItemReactionsRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsItemReactionsRequestBuilder) { + return NewItemTeamsItemDiscussionsItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_discussions_item_reactions_with_reaction_escaped_item_request_builder.go b/pkg/github/orgs/item_teams_item_discussions_item_reactions_with_reaction_escaped_item_request_builder.go new file mode 100644 index 00000000..c099a13b --- /dev/null +++ b/pkg/github/orgs/item_teams_item_discussions_item_reactions_with_reaction_escaped_item_request_builder.go @@ -0,0 +1,51 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions\{discussion_number}\reactions\{reaction_id} +type ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder) { + m := &ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}/reactions/{reaction_id}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder instantiates a new ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!NOTE]> You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`.Delete a reaction to a [team discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion).OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#delete-team-discussion-reaction +func (m *ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation > [!NOTE]> You can also specify a team or organization with `team_id` and `org_id` using the route `DELETE /organizations/:org_id/team/:team_id/discussions/:discussion_number/reactions/:reaction_id`.Delete a reaction to a [team discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion).OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsItemReactionsWithReaction_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) + 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 *ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder) { + return NewItemTeamsItemDiscussionsItemReactionsWithReaction_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_discussions_item_with_discussion_escaped_number_patch_request_body.go b/pkg/github/orgs/item_teams_item_discussions_item_with_discussion_escaped_number_patch_request_body.go new file mode 100644 index 00000000..b36c827c --- /dev/null +++ b/pkg/github/orgs/item_teams_item_discussions_item_with_discussion_escaped_number_patch_request_body.go @@ -0,0 +1,109 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody 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 discussion post's body text. + body *string + // The discussion post's title. + title *string +} +// NewItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody instantiates a new ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody and sets the default values. +func NewItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody()(*ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) { + m := &ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody(), 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 *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion post's body text. +// returns a *string when successful +func (m *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetTitle gets the title property value. The discussion post's title. +// returns a *string when successful +func (m *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion post's body text. +func (m *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) SetBody(value *string)() { + m.body = value +} +// SetTitle sets the title property value. The discussion post's title. +func (m *ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetTitle()(*string) + SetBody(value *string)() + SetTitle(value *string)() +} diff --git a/pkg/github/orgs/item_teams_item_discussions_post_request_body.go b/pkg/github/orgs/item_teams_item_discussions_post_request_body.go new file mode 100644 index 00000000..cdc27b36 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_discussions_post_request_body.go @@ -0,0 +1,138 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemDiscussionsPostRequestBody 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 discussion post's body text. + body *string + // Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. + private *bool + // The discussion post's title. + title *string +} +// NewItemTeamsItemDiscussionsPostRequestBody instantiates a new ItemTeamsItemDiscussionsPostRequestBody and sets the default values. +func NewItemTeamsItemDiscussionsPostRequestBody()(*ItemTeamsItemDiscussionsPostRequestBody) { + m := &ItemTeamsItemDiscussionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemDiscussionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemDiscussionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemDiscussionsPostRequestBody(), 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 *ItemTeamsItemDiscussionsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion post's body text. +// returns a *string when successful +func (m *ItemTeamsItemDiscussionsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemTeamsItemDiscussionsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetPrivate gets the private property value. Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. +// returns a *bool when successful +func (m *ItemTeamsItemDiscussionsPostRequestBody) GetPrivate()(*bool) { + return m.private +} +// GetTitle gets the title property value. The discussion post's title. +// returns a *string when successful +func (m *ItemTeamsItemDiscussionsPostRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemTeamsItemDiscussionsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemTeamsItemDiscussionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion post's body text. +func (m *ItemTeamsItemDiscussionsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetPrivate sets the private property value. Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. +func (m *ItemTeamsItemDiscussionsPostRequestBody) SetPrivate(value *bool)() { + m.private = value +} +// SetTitle sets the title property value. The discussion post's title. +func (m *ItemTeamsItemDiscussionsPostRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemTeamsItemDiscussionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetPrivate()(*bool) + GetTitle()(*string) + SetBody(value *string)() + SetPrivate(value *bool)() + SetTitle(value *string)() +} diff --git a/pkg/github/orgs/item_teams_item_discussions_request_builder.go b/pkg/github/orgs/item_teams_item_discussions_request_builder.go new file mode 100644 index 00000000..02ea753a --- /dev/null +++ b/pkg/github/orgs/item_teams_item_discussions_request_builder.go @@ -0,0 +1,114 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + icdf812eda581f55cb72c7533e83f29e577570623131e307cc6b27c25eb256a7b "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/teams/item/discussions" +) + +// ItemTeamsItemDiscussionsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions +type ItemTeamsItemDiscussionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemDiscussionsRequestBuilderGetQueryParameters list all discussions on a team's page.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemTeamsItemDiscussionsRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *icdf812eda581f55cb72c7533e83f29e577570623131e307cc6b27c25eb256a7b.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Pinned discussions only filter + Pinned *string `uriparametername:"pinned"` +} +// ByDiscussion_number gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.teams.item.discussions.item collection +// returns a *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsRequestBuilder) ByDiscussion_number(discussion_number int32)(*ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["discussion_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(discussion_number), 10) + return NewItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemDiscussionsRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsRequestBuilder) { + m := &ItemTeamsItemDiscussionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions{?direction*,page*,per_page*,pinned*}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsRequestBuilder instantiates a new ItemTeamsItemDiscussionsRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all discussions on a team's page.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a []TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#list-discussions +func (m *ItemTeamsItemDiscussionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable) + } + } + return val, nil +} +// Post creates a new discussion post on a team's page.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#create-a-discussion +func (m *ItemTeamsItemDiscussionsRequestBuilder) Post(ctx context.Context, body ItemTeamsItemDiscussionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable), nil +} +// ToGetRequestInformation list all discussions on a team's page.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemDiscussionsRequestBuilderGetQueryParameters])(*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 new discussion post on a team's page.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `POST /organizations/{org_id}/team/{team_id}/discussions`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTeamsItemDiscussionsPostRequestBodyable, 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 *ItemTeamsItemDiscussionsRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsRequestBuilder) { + return NewItemTeamsItemDiscussionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_discussions_with_discussion_escaped_number_item_request_builder.go b/pkg/github/orgs/item_teams_item_discussions_with_discussion_escaped_number_item_request_builder.go new file mode 100644 index 00000000..2298ac3c --- /dev/null +++ b/pkg/github/orgs/item_teams_item_discussions_with_discussion_escaped_number_item_request_builder.go @@ -0,0 +1,120 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\discussions\{discussion_number} +type ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Comments the comments property +// returns a *ItemTeamsItemDiscussionsItemCommentsRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) Comments()(*ItemTeamsItemDiscussionsItemCommentsRequestBuilder) { + return NewItemTeamsItemDiscussionsItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal instantiates a new ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + m := &ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/discussions/{discussion_number}", pathParameters), + } + return m +} +// NewItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder instantiates a new ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder and sets the default values. +func NewItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a discussion from a team's page.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#delete-a-discussion +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get get a specific discussion on a team's page.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable), nil +} +// Patch edits the title and body text of a discussion post. Only the parameters you provide are updated.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#update-a-discussion +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) Patch(ctx context.Context, body ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable), nil +} +// Reactions the reactions property +// returns a *ItemTeamsItemDiscussionsItemReactionsRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) Reactions()(*ItemTeamsItemDiscussionsItemReactionsRequestBuilder) { + return NewItemTeamsItemDiscussionsItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation delete a discussion from a team's page.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) 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 +} +// ToGetRequestInformation get a specific discussion on a team's page.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) 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 edits the title and body text of a discussion post. Only the parameters you provide are updated.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}/discussions/{discussion_number}`.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemTeamsItemDiscussionsItemWithDiscussion_numberPatchRequestBodyable, 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 *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder when successful +func (m *ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + return NewItemTeamsItemDiscussionsWithDiscussion_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_external_groups_patch_request_body.go b/pkg/github/orgs/item_teams_item_external_groups_patch_request_body.go new file mode 100644 index 00000000..270bcf2d --- /dev/null +++ b/pkg/github/orgs/item_teams_item_external_groups_patch_request_body.go @@ -0,0 +1,80 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemExternalGroupsPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // External Group Id + group_id *int32 +} +// NewItemTeamsItemExternalGroupsPatchRequestBody instantiates a new ItemTeamsItemExternalGroupsPatchRequestBody and sets the default values. +func NewItemTeamsItemExternalGroupsPatchRequestBody()(*ItemTeamsItemExternalGroupsPatchRequestBody) { + m := &ItemTeamsItemExternalGroupsPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemExternalGroupsPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemExternalGroupsPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemExternalGroupsPatchRequestBody(), 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 *ItemTeamsItemExternalGroupsPatchRequestBody) 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 *ItemTeamsItemExternalGroupsPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["group_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetGroupId(val) + } + return nil + } + return res +} +// GetGroupId gets the group_id property value. External Group Id +// returns a *int32 when successful +func (m *ItemTeamsItemExternalGroupsPatchRequestBody) GetGroupId()(*int32) { + return m.group_id +} +// Serialize serializes information the current object +func (m *ItemTeamsItemExternalGroupsPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("group_id", m.GetGroupId()) + 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 *ItemTeamsItemExternalGroupsPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGroupId sets the group_id property value. External Group Id +func (m *ItemTeamsItemExternalGroupsPatchRequestBody) SetGroupId(value *int32)() { + m.group_id = value +} +type ItemTeamsItemExternalGroupsPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGroupId()(*int32) + SetGroupId(value *int32)() +} diff --git a/pkg/github/orgs/item_teams_item_external_groups_request_builder.go b/pkg/github/orgs/item_teams_item_external_groups_request_builder.go new file mode 100644 index 00000000..6f1c87c9 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_external_groups_request_builder.go @@ -0,0 +1,110 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemTeamsItemExternalGroupsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\external-groups +type ItemTeamsItemExternalGroupsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsItemExternalGroupsRequestBuilderInternal instantiates a new ItemTeamsItemExternalGroupsRequestBuilder and sets the default values. +func NewItemTeamsItemExternalGroupsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemExternalGroupsRequestBuilder) { + m := &ItemTeamsItemExternalGroupsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/external-groups", pathParameters), + } + return m +} +// NewItemTeamsItemExternalGroupsRequestBuilder instantiates a new ItemTeamsItemExternalGroupsRequestBuilder and sets the default values. +func NewItemTeamsItemExternalGroupsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemExternalGroupsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemExternalGroupsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a connection between a team and an external group.You can manage team membership with your IdP using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/external-groups#remove-the-connection-between-an-external-group-and-a-team +func (m *ItemTeamsItemExternalGroupsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get lists a connection between a team and an external group.You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products)" in the GitHub Help documentation. +// returns a ExternalGroupsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/external-groups#list-a-connection-between-an-external-group-and-a-team +func (m *ItemTeamsItemExternalGroupsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ExternalGroupsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateExternalGroupsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ExternalGroupsable), nil +} +// Patch creates a connection between a team and an external group. Only one external group can be linked to a team.You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products)" in the GitHub Help documentation. +// returns a ExternalGroupable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/external-groups#update-the-connection-between-an-external-group-and-a-team +func (m *ItemTeamsItemExternalGroupsRequestBuilder) Patch(ctx context.Context, body ItemTeamsItemExternalGroupsPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ExternalGroupable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateExternalGroupFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ExternalGroupable), nil +} +// ToDeleteRequestInformation deletes a connection between a team and an external group.You can manage team membership with your IdP using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemExternalGroupsRequestBuilder) 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 +} +// ToGetRequestInformation lists a connection between a team and an external group.You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products)" in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemExternalGroupsRequestBuilder) 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 creates a connection between a team and an external group. Only one external group can be linked to a team.You can manage team membership with your identity provider using Enterprise Managed Users for GitHub Enterprise Cloud. For more information, see "[GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products)" in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemExternalGroupsRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemTeamsItemExternalGroupsPatchRequestBodyable, 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 *ItemTeamsItemExternalGroupsRequestBuilder when successful +func (m *ItemTeamsItemExternalGroupsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemExternalGroupsRequestBuilder) { + return NewItemTeamsItemExternalGroupsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_members_request_builder.go b/pkg/github/orgs/item_teams_item_members_request_builder.go new file mode 100644 index 00000000..123fa9fb --- /dev/null +++ b/pkg/github/orgs/item_teams_item_members_request_builder.go @@ -0,0 +1,70 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ibb541096b0cd5e4f7f3d82e5f4b24b4e6d5814285c679a01f9f2e799627a9431 "github.com/octokit/go-sdk-enterprise-server/pkg/github/orgs/item/teams/item/members" +) + +// ItemTeamsItemMembersRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\members +type ItemTeamsItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemMembersRequestBuilderGetQueryParameters team members will include the members of child teams.To list members in a team, the team must be visible to the authenticated user. +type ItemTeamsItemMembersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Filters members returned by their role in the team. + Role *ibb541096b0cd5e4f7f3d82e5f4b24b4e6d5814285c679a01f9f2e799627a9431.GetRoleQueryParameterType `uriparametername:"role"` +} +// NewItemTeamsItemMembersRequestBuilderInternal instantiates a new ItemTeamsItemMembersRequestBuilder and sets the default values. +func NewItemTeamsItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemMembersRequestBuilder) { + m := &ItemTeamsItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/members{?page*,per_page*,role*}", pathParameters), + } + return m +} +// NewItemTeamsItemMembersRequestBuilder instantiates a new ItemTeamsItemMembersRequestBuilder and sets the default values. +func NewItemTeamsItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemMembersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get team members will include the members of child teams.To list members in a team, the team must be visible to the authenticated user. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/members#list-team-members +func (m *ItemTeamsItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemMembersRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation team members will include the members of child teams.To list members in a team, the team must be visible to the authenticated user. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemMembersRequestBuilderGetQueryParameters])(*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 *ItemTeamsItemMembersRequestBuilder when successful +func (m *ItemTeamsItemMembersRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemMembersRequestBuilder) { + return NewItemTeamsItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_memberships_item_with_username_put_request_body.go b/pkg/github/orgs/item_teams_item_memberships_item_with_username_put_request_body.go new file mode 100644 index 00000000..fa876a47 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_memberships_item_with_username_put_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemMembershipsItemWithUsernamePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemTeamsItemMembershipsItemWithUsernamePutRequestBody instantiates a new ItemTeamsItemMembershipsItemWithUsernamePutRequestBody and sets the default values. +func NewItemTeamsItemMembershipsItemWithUsernamePutRequestBody()(*ItemTeamsItemMembershipsItemWithUsernamePutRequestBody) { + m := &ItemTeamsItemMembershipsItemWithUsernamePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemMembershipsItemWithUsernamePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemMembershipsItemWithUsernamePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemMembershipsItemWithUsernamePutRequestBody(), 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 *ItemTeamsItemMembershipsItemWithUsernamePutRequestBody) 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 *ItemTeamsItemMembershipsItemWithUsernamePutRequestBody) 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 *ItemTeamsItemMembershipsItemWithUsernamePutRequestBody) 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 *ItemTeamsItemMembershipsItemWithUsernamePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemTeamsItemMembershipsItemWithUsernamePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/orgs/item_teams_item_memberships_request_builder.go b/pkg/github/orgs/item_teams_item_memberships_request_builder.go new file mode 100644 index 00000000..50627c7e --- /dev/null +++ b/pkg/github/orgs/item_teams_item_memberships_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemTeamsItemMembershipsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\memberships +type ItemTeamsItemMembershipsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByUsername gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.teams.item.memberships.item collection +// returns a *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder when successful +func (m *ItemTeamsItemMembershipsRequestBuilder) ByUsername(username string)(*ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemTeamsItemMembershipsWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemMembershipsRequestBuilderInternal instantiates a new ItemTeamsItemMembershipsRequestBuilder and sets the default values. +func NewItemTeamsItemMembershipsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemMembershipsRequestBuilder) { + m := &ItemTeamsItemMembershipsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/memberships", pathParameters), + } + return m +} +// NewItemTeamsItemMembershipsRequestBuilder instantiates a new ItemTeamsItemMembershipsRequestBuilder and sets the default values. +func NewItemTeamsItemMembershipsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemMembershipsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemMembershipsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/item_teams_item_memberships_with_username_item_request_builder.go b/pkg/github/orgs/item_teams_item_memberships_with_username_item_request_builder.go new file mode 100644 index 00000000..ee638a3f --- /dev/null +++ b/pkg/github/orgs/item_teams_item_memberships_with_username_item_request_builder.go @@ -0,0 +1,110 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemTeamsItemMembershipsWithUsernameItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\memberships\{username} +type ItemTeamsItemMembershipsWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsItemMembershipsWithUsernameItemRequestBuilderInternal instantiates a new ItemTeamsItemMembershipsWithUsernameItemRequestBuilder and sets the default values. +func NewItemTeamsItemMembershipsWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) { + m := &ItemTeamsItemMembershipsWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/memberships/{username}", pathParameters), + } + return m +} +// NewItemTeamsItemMembershipsWithUsernameItemRequestBuilder instantiates a new ItemTeamsItemMembershipsWithUsernameItemRequestBuilder and sets the default values. +func NewItemTeamsItemMembershipsWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemMembershipsWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete to remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.> [!NOTE]> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/enterprise-server@3.14/articles/synchronizing-teams-between-your-identity-provider-and-github/)."> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/members#remove-team-membership-for-a-user +func (m *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get team members will include the members of child teams.To get a user's membership with a team, the team must be visible to the authenticated user.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`.> [!NOTE]> The response contains the `state` of the membership and the member's `role`.The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#create-a-team). +// returns a TeamMembershipable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/members#get-team-membership-for-a-user +func (m *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamMembershipable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamMembershipFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamMembershipable), nil +} +// Put adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.> [!NOTE]> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/enterprise-server@3.14/articles/synchronizing-teams-between-your-identity-provider-and-github/)."An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team.If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`. +// returns a TeamMembershipable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/members#add-or-update-team-membership-for-a-user +func (m *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) Put(ctx context.Context, body ItemTeamsItemMembershipsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamMembershipable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamMembershipFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamMembershipable), nil +} +// ToDeleteRequestInformation to remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.> [!NOTE]> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/enterprise-server@3.14/articles/synchronizing-teams-between-your-identity-provider-and-github/)."> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/memberships/{username}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) 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 +} +// ToGetRequestInformation team members will include the members of child teams.To get a user's membership with a team, the team must be visible to the authenticated user.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/memberships/{username}`.> [!NOTE]> The response contains the `state` of the membership and the member's `role`.The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#create-a-team). +// returns a *RequestInformation when successful +func (m *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) 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 +} +// ToPutRequestInformation adds an organization member to a team. An authenticated organization owner or team maintainer can add organization members to a team.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.> [!NOTE]> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/enterprise-server@3.14/articles/synchronizing-teams-between-your-identity-provider-and-github/)."An organization owner can add someone who is not part of the team's organization to a team. When an organization owner adds someone to a team who is not an organization member, this endpoint will send an invitation to the person via email. This newly-created membership will be in the "pending" state until the person accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team.If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/memberships/{username}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemTeamsItemMembershipsItemWithUsernamePutRequestBodyable, 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 *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder when successful +func (m *ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemMembershipsWithUsernameItemRequestBuilder) { + return NewItemTeamsItemMembershipsWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_projects_item_with_project_escaped_403_error.go b/pkg/github/orgs/item_teams_item_projects_item_with_project_escaped_403_error.go new file mode 100644 index 00000000..0806159d --- /dev/null +++ b/pkg/github/orgs/item_teams_item_projects_item_with_project_escaped_403_error.go @@ -0,0 +1,117 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemProjectsItemWithProject_403Error 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 documentation_url property + documentation_url *string + // The message property + message *string +} +// NewItemTeamsItemProjectsItemWithProject_403Error instantiates a new ItemTeamsItemProjectsItemWithProject_403Error and sets the default values. +func NewItemTeamsItemProjectsItemWithProject_403Error()(*ItemTeamsItemProjectsItemWithProject_403Error) { + m := &ItemTeamsItemProjectsItemWithProject_403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemProjectsItemWithProject_403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemProjectsItemWithProject_403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemProjectsItemWithProject_403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemTeamsItemProjectsItemWithProject_403Error) 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 *ItemTeamsItemProjectsItemWithProject_403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemTeamsItemProjectsItemWithProject_403Error) 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 *ItemTeamsItemProjectsItemWithProject_403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 *ItemTeamsItemProjectsItemWithProject_403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemTeamsItemProjectsItemWithProject_403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemTeamsItemProjectsItemWithProject_403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemTeamsItemProjectsItemWithProject_403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ItemTeamsItemProjectsItemWithProject_403Error) SetMessage(value *string)() { + m.message = value +} +type ItemTeamsItemProjectsItemWithProject_403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/pkg/github/orgs/item_teams_item_projects_item_with_project_escaped_put_request_body.go b/pkg/github/orgs/item_teams_item_projects_item_with_project_escaped_put_request_body.go new file mode 100644 index 00000000..9fd0aad8 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_projects_item_with_project_escaped_put_request_body.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemProjectsItemWithProject_PutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemTeamsItemProjectsItemWithProject_PutRequestBody instantiates a new ItemTeamsItemProjectsItemWithProject_PutRequestBody and sets the default values. +func NewItemTeamsItemProjectsItemWithProject_PutRequestBody()(*ItemTeamsItemProjectsItemWithProject_PutRequestBody) { + m := &ItemTeamsItemProjectsItemWithProject_PutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemProjectsItemWithProject_PutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemProjectsItemWithProject_PutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemProjectsItemWithProject_PutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemTeamsItemProjectsItemWithProject_PutRequestBody) 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 *ItemTeamsItemProjectsItemWithProject_PutRequestBody) 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 *ItemTeamsItemProjectsItemWithProject_PutRequestBody) 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 *ItemTeamsItemProjectsItemWithProject_PutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemTeamsItemProjectsItemWithProject_PutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/orgs/item_teams_item_projects_request_builder.go b/pkg/github/orgs/item_teams_item_projects_request_builder.go new file mode 100644 index 00000000..01984be8 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_projects_request_builder.go @@ -0,0 +1,78 @@ +package orgs + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemTeamsItemProjectsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\projects +type ItemTeamsItemProjectsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemProjectsRequestBuilderGetQueryParameters lists the organization projects for a team.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`. +type ItemTeamsItemProjectsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByProject_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.teams.item.projects.item collection +// returns a *ItemTeamsItemProjectsWithProject_ItemRequestBuilder when successful +func (m *ItemTeamsItemProjectsRequestBuilder) ByProject_id(project_id int32)(*ItemTeamsItemProjectsWithProject_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["project_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(project_id), 10) + return NewItemTeamsItemProjectsWithProject_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemProjectsRequestBuilderInternal instantiates a new ItemTeamsItemProjectsRequestBuilder and sets the default values. +func NewItemTeamsItemProjectsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemProjectsRequestBuilder) { + m := &ItemTeamsItemProjectsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/projects{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsItemProjectsRequestBuilder instantiates a new ItemTeamsItemProjectsRequestBuilder and sets the default values. +func NewItemTeamsItemProjectsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemProjectsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemProjectsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the organization projects for a team.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`. +// returns a []TeamProjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-team-projects +func (m *ItemTeamsItemProjectsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemProjectsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamProjectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamProjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamProjectable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamProjectable) + } + } + return val, nil +} +// ToGetRequestInformation lists the organization projects for a team.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemProjectsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemProjectsRequestBuilderGetQueryParameters])(*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 *ItemTeamsItemProjectsRequestBuilder when successful +func (m *ItemTeamsItemProjectsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemProjectsRequestBuilder) { + return NewItemTeamsItemProjectsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_projects_with_project_escaped_item_request_builder.go b/pkg/github/orgs/item_teams_item_projects_with_project_escaped_item_request_builder.go new file mode 100644 index 00000000..cf3bea37 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_projects_with_project_escaped_item_request_builder.go @@ -0,0 +1,110 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemTeamsItemProjectsWithProject_ItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\projects\{project_id} +type ItemTeamsItemProjectsWithProject_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsItemProjectsWithProject_ItemRequestBuilderInternal instantiates a new ItemTeamsItemProjectsWithProject_ItemRequestBuilder and sets the default values. +func NewItemTeamsItemProjectsWithProject_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemProjectsWithProject_ItemRequestBuilder) { + m := &ItemTeamsItemProjectsWithProject_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/projects/{project_id}", pathParameters), + } + return m +} +// NewItemTeamsItemProjectsWithProject_ItemRequestBuilder instantiates a new ItemTeamsItemProjectsWithProject_ItemRequestBuilder and sets the default values. +func NewItemTeamsItemProjectsWithProject_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemProjectsWithProject_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemProjectsWithProject_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. This endpoint removes the project from the team, but does not delete the project.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#remove-a-project-from-a-team +func (m *ItemTeamsItemProjectsWithProject_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`. +// returns a TeamProjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#check-team-permissions-for-a-project +func (m *ItemTeamsItemProjectsWithProject_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamProjectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamProjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamProjectable), nil +} +// Put adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`. +// returns a ItemTeamsItemProjectsItemWithProject_403Error error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#add-or-update-team-project-permissions +func (m *ItemTeamsItemProjectsWithProject_ItemRequestBuilder) Put(ctx context.Context, body ItemTeamsItemProjectsItemWithProject_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": CreateItemTeamsItemProjectsItemWithProject_403ErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. This endpoint removes the project from the team, but does not delete the project.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/projects/{project_id}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemProjectsWithProject_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) + return requestInfo, nil +} +// ToGetRequestInformation checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/projects/{project_id}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemProjectsWithProject_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 +} +// ToPutRequestInformation adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/projects/{project_id}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemProjectsWithProject_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemTeamsItemProjectsItemWithProject_PutRequestBodyable, 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 *ItemTeamsItemProjectsWithProject_ItemRequestBuilder when successful +func (m *ItemTeamsItemProjectsWithProject_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemProjectsWithProject_ItemRequestBuilder) { + return NewItemTeamsItemProjectsWithProject_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_repos_item_item_with_repo_put_request_body.go b/pkg/github/orgs/item_teams_item_repos_item_item_with_repo_put_request_body.go new file mode 100644 index 00000000..fe822716 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_repos_item_item_with_repo_put_request_body.go @@ -0,0 +1,80 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemReposItemItemWithRepoPutRequestBody 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 permission to grant the team on this repository. We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. + permission *string +} +// NewItemTeamsItemReposItemItemWithRepoPutRequestBody instantiates a new ItemTeamsItemReposItemItemWithRepoPutRequestBody and sets the default values. +func NewItemTeamsItemReposItemItemWithRepoPutRequestBody()(*ItemTeamsItemReposItemItemWithRepoPutRequestBody) { + m := &ItemTeamsItemReposItemItemWithRepoPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemReposItemItemWithRepoPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemReposItemItemWithRepoPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemReposItemItemWithRepoPutRequestBody(), 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 *ItemTeamsItemReposItemItemWithRepoPutRequestBody) 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 *ItemTeamsItemReposItemItemWithRepoPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + return res +} +// GetPermission gets the permission property value. The permission to grant the team on this repository. We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. +// returns a *string when successful +func (m *ItemTeamsItemReposItemItemWithRepoPutRequestBody) GetPermission()(*string) { + return m.permission +} +// Serialize serializes information the current object +func (m *ItemTeamsItemReposItemItemWithRepoPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("permission", m.GetPermission()) + 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 *ItemTeamsItemReposItemItemWithRepoPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPermission sets the permission property value. The permission to grant the team on this repository. We accept the following permissions to be set: `pull`, `triage`, `push`, `maintain`, `admin` and you can also specify a custom repository role name, if the owning organization has defined any. If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. +func (m *ItemTeamsItemReposItemItemWithRepoPutRequestBody) SetPermission(value *string)() { + m.permission = value +} +type ItemTeamsItemReposItemItemWithRepoPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPermission()(*string) + SetPermission(value *string)() +} diff --git a/pkg/github/orgs/item_teams_item_repos_item_with_repo_item_request_builder.go b/pkg/github/orgs/item_teams_item_repos_item_with_repo_item_request_builder.go new file mode 100644 index 00000000..bc110552 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_repos_item_with_repo_item_request_builder.go @@ -0,0 +1,105 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemTeamsItemReposItemWithRepoItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\repos\{owner}\{repo} +type ItemTeamsItemReposItemWithRepoItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsItemReposItemWithRepoItemRequestBuilderInternal instantiates a new ItemTeamsItemReposItemWithRepoItemRequestBuilder and sets the default values. +func NewItemTeamsItemReposItemWithRepoItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemReposItemWithRepoItemRequestBuilder) { + m := &ItemTeamsItemReposItemWithRepoItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/repos/{owner}/{repo}", pathParameters), + } + return m +} +// NewItemTeamsItemReposItemWithRepoItemRequestBuilder instantiates a new ItemTeamsItemReposItemWithRepoItemRequestBuilder and sets the default values. +func NewItemTeamsItemReposItemWithRepoItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemReposItemWithRepoItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemReposItemWithRepoItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete if the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#remove-a-repository-from-a-team +func (m *ItemTeamsItemReposItemWithRepoItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked.You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `application/vnd.github.v3.repository+json` accept header.If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status.If the repository is private, you must have at least `read` permission for that repository, and your token must have the `repo` or `admin:org` scope. Otherwise, you will receive a `404 Not Found` response status.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. +// returns a TeamRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#check-team-permissions-for-a-repository +func (m *ItemTeamsItemReposItemWithRepoItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamRepositoryable), nil +} +// Put to add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)."> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.For more information about the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#add-or-update-team-repository-permissions +func (m *ItemTeamsItemReposItemWithRepoItemRequestBuilder) Put(ctx context.Context, body ItemTeamsItemReposItemItemWithRepoPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation if the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. This does not delete the repository, it just removes it from the team.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemReposItemWithRepoItemRequestBuilder) 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 +} +// ToGetRequestInformation checks whether a team has `admin`, `push`, `maintain`, `triage`, or `pull` permission for a repository. Repositories inherited through a parent team will also be checked.You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `application/vnd.github.v3.repository+json` accept header.If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status.If the repository is private, you must have at least `read` permission for that repository, and your token must have the `repo` or `admin:org` scope. Otherwise, you will receive a `404 Not Found` response status.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemReposItemWithRepoItemRequestBuilder) 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 +} +// ToPutRequestInformation to add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)."> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `PUT /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.For more information about the permission levels, see "[Repository permission levels for an organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". +// returns a *RequestInformation when successful +func (m *ItemTeamsItemReposItemWithRepoItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemTeamsItemReposItemItemWithRepoPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemTeamsItemReposItemWithRepoItemRequestBuilder when successful +func (m *ItemTeamsItemReposItemWithRepoItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemReposItemWithRepoItemRequestBuilder) { + return NewItemTeamsItemReposItemWithRepoItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_repos_request_builder.go b/pkg/github/orgs/item_teams_item_repos_request_builder.go new file mode 100644 index 00000000..e717f700 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_repos_request_builder.go @@ -0,0 +1,79 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemTeamsItemReposRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\repos +type ItemTeamsItemReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemReposRequestBuilderGetQueryParameters lists a team's repositories visible to the authenticated user.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. +type ItemTeamsItemReposRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByOwner gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.teams.item.repos.item collection +// returns a *ItemTeamsItemReposWithOwnerItemRequestBuilder when successful +func (m *ItemTeamsItemReposRequestBuilder) ByOwner(owner string)(*ItemTeamsItemReposWithOwnerItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if owner != "" { + urlTplParams["owner"] = owner + } + return NewItemTeamsItemReposWithOwnerItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemReposRequestBuilderInternal instantiates a new ItemTeamsItemReposRequestBuilder and sets the default values. +func NewItemTeamsItemReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemReposRequestBuilder) { + m := &ItemTeamsItemReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/repos{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsItemReposRequestBuilder instantiates a new ItemTeamsItemReposRequestBuilder and sets the default values. +func NewItemTeamsItemReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemReposRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists a team's repositories visible to the authenticated user.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. +// returns a []MinimalRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-team-repositories +func (m *ItemTeamsItemReposRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemReposRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists a team's repositories visible to the authenticated user.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemReposRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemReposRequestBuilderGetQueryParameters])(*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 *ItemTeamsItemReposRequestBuilder when successful +func (m *ItemTeamsItemReposRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemReposRequestBuilder) { + return NewItemTeamsItemReposRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_repos_with_owner_item_request_builder.go b/pkg/github/orgs/item_teams_item_repos_with_owner_item_request_builder.go new file mode 100644 index 00000000..9fadcf74 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_repos_with_owner_item_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemTeamsItemReposWithOwnerItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\repos\{owner} +type ItemTeamsItemReposWithOwnerItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepo gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.teams.item.repos.item.item collection +// returns a *ItemTeamsItemReposItemWithRepoItemRequestBuilder when successful +func (m *ItemTeamsItemReposWithOwnerItemRequestBuilder) ByRepo(repo string)(*ItemTeamsItemReposItemWithRepoItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repo != "" { + urlTplParams["repo"] = repo + } + return NewItemTeamsItemReposItemWithRepoItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsItemReposWithOwnerItemRequestBuilderInternal instantiates a new ItemTeamsItemReposWithOwnerItemRequestBuilder and sets the default values. +func NewItemTeamsItemReposWithOwnerItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemReposWithOwnerItemRequestBuilder) { + m := &ItemTeamsItemReposWithOwnerItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/repos/{owner}", pathParameters), + } + return m +} +// NewItemTeamsItemReposWithOwnerItemRequestBuilder instantiates a new ItemTeamsItemReposWithOwnerItemRequestBuilder and sets the default values. +func NewItemTeamsItemReposWithOwnerItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemReposWithOwnerItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemReposWithOwnerItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/item_teams_item_teams_request_builder.go b/pkg/github/orgs/item_teams_item_teams_request_builder.go new file mode 100644 index 00000000..faa8f49b --- /dev/null +++ b/pkg/github/orgs/item_teams_item_teams_request_builder.go @@ -0,0 +1,67 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemTeamsItemTeamsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug}\teams +type ItemTeamsItemTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsItemTeamsRequestBuilderGetQueryParameters lists the child teams of the team specified by `{team_slug}`.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. +type ItemTeamsItemTeamsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemTeamsItemTeamsRequestBuilderInternal instantiates a new ItemTeamsItemTeamsRequestBuilder and sets the default values. +func NewItemTeamsItemTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemTeamsRequestBuilder) { + m := &ItemTeamsItemTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}/teams{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsItemTeamsRequestBuilder instantiates a new ItemTeamsItemTeamsRequestBuilder and sets the default values. +func NewItemTeamsItemTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsItemTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsItemTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the child teams of the team specified by `{team_slug}`.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. +// returns a []Teamable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-child-teams +func (m *ItemTeamsItemTeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemTeamsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable) + } + } + return val, nil +} +// ToGetRequestInformation lists the child teams of the team specified by `{team_slug}`.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/teams`. +// returns a *RequestInformation when successful +func (m *ItemTeamsItemTeamsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsItemTeamsRequestBuilderGetQueryParameters])(*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 *ItemTeamsItemTeamsRequestBuilder when successful +func (m *ItemTeamsItemTeamsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsItemTeamsRequestBuilder) { + return NewItemTeamsItemTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_item_with_team_escaped_slug_patch_request_body.go b/pkg/github/orgs/item_teams_item_with_team_escaped_slug_patch_request_body.go new file mode 100644 index 00000000..ec54c705 --- /dev/null +++ b/pkg/github/orgs/item_teams_item_with_team_escaped_slug_patch_request_body.go @@ -0,0 +1,138 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsItemWithTeam_slugPatchRequestBody 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 the team. + description *string + // The name of the team. + name *string + // The ID of a team to set as the parent team. + parent_team_id *int32 +} +// NewItemTeamsItemWithTeam_slugPatchRequestBody instantiates a new ItemTeamsItemWithTeam_slugPatchRequestBody and sets the default values. +func NewItemTeamsItemWithTeam_slugPatchRequestBody()(*ItemTeamsItemWithTeam_slugPatchRequestBody) { + m := &ItemTeamsItemWithTeam_slugPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsItemWithTeam_slugPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsItemWithTeam_slugPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsItemWithTeam_slugPatchRequestBody(), 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 *ItemTeamsItemWithTeam_slugPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description of the team. +// returns a *string when successful +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) 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 *ItemTeamsItemWithTeam_slugPatchRequestBody) 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["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["parent_team_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetParentTeamId(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the team. +// returns a *string when successful +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) GetName()(*string) { + return m.name +} +// GetParentTeamId gets the parent_team_id property value. The ID of a team to set as the parent team. +// returns a *int32 when successful +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) GetParentTeamId()(*int32) { + return m.parent_team_id +} +// Serialize serializes information the current object +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("parent_team_id", m.GetParentTeamId()) + 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 *ItemTeamsItemWithTeam_slugPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description of the team. +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name of the team. +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetParentTeamId sets the parent_team_id property value. The ID of a team to set as the parent team. +func (m *ItemTeamsItemWithTeam_slugPatchRequestBody) SetParentTeamId(value *int32)() { + m.parent_team_id = value +} +type ItemTeamsItemWithTeam_slugPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetName()(*string) + GetParentTeamId()(*int32) + SetDescription(value *string)() + SetName(value *string)() + SetParentTeamId(value *int32)() +} diff --git a/pkg/github/orgs/item_teams_post_request_body.go b/pkg/github/orgs/item_teams_post_request_body.go new file mode 100644 index 00000000..ed9df468 --- /dev/null +++ b/pkg/github/orgs/item_teams_post_request_body.go @@ -0,0 +1,237 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemTeamsPostRequestBody 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 the team. + description *string + // The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. LDAP synchronization must be enabled to map LDAP entries to a team. Use the "[Update LDAP mapping for a team](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team)" endpoint to change the LDAP DN. For more information, see "[Using LDAP](https://docs.github.com/enterprise-server@3.14/admin/identity-and-access-management/authenticating-users-for-your-github-enterprise-server-instance/using-ldap#enabling-ldap-sync)." + ldap_dn *string + // List GitHub IDs for organization members who will become team maintainers. + maintainers []string + // The name of the team. + name *string + // The ID of a team to set as the parent team. + parent_team_id *int32 + // The full name (e.g., "organization-name/repository-name") of repositories to add the team to. + repo_names []string +} +// NewItemTeamsPostRequestBody instantiates a new ItemTeamsPostRequestBody and sets the default values. +func NewItemTeamsPostRequestBody()(*ItemTeamsPostRequestBody) { + m := &ItemTeamsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemTeamsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemTeamsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemTeamsPostRequestBody(), 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 *ItemTeamsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description of the team. +// returns a *string when successful +func (m *ItemTeamsPostRequestBody) 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 *ItemTeamsPostRequestBody) 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["ldap_dn"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLdapDn(val) + } + return nil + } + res["maintainers"] = 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.SetMaintainers(res) + } + 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["parent_team_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetParentTeamId(val) + } + return nil + } + res["repo_names"] = 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.SetRepoNames(res) + } + return nil + } + return res +} +// GetLdapDn gets the ldap_dn property value. The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. LDAP synchronization must be enabled to map LDAP entries to a team. Use the "[Update LDAP mapping for a team](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team)" endpoint to change the LDAP DN. For more information, see "[Using LDAP](https://docs.github.com/enterprise-server@3.14/admin/identity-and-access-management/authenticating-users-for-your-github-enterprise-server-instance/using-ldap#enabling-ldap-sync)." +// returns a *string when successful +func (m *ItemTeamsPostRequestBody) GetLdapDn()(*string) { + return m.ldap_dn +} +// GetMaintainers gets the maintainers property value. List GitHub IDs for organization members who will become team maintainers. +// returns a []string when successful +func (m *ItemTeamsPostRequestBody) GetMaintainers()([]string) { + return m.maintainers +} +// GetName gets the name property value. The name of the team. +// returns a *string when successful +func (m *ItemTeamsPostRequestBody) GetName()(*string) { + return m.name +} +// GetParentTeamId gets the parent_team_id property value. The ID of a team to set as the parent team. +// returns a *int32 when successful +func (m *ItemTeamsPostRequestBody) GetParentTeamId()(*int32) { + return m.parent_team_id +} +// GetRepoNames gets the repo_names property value. The full name (e.g., "organization-name/repository-name") of repositories to add the team to. +// returns a []string when successful +func (m *ItemTeamsPostRequestBody) GetRepoNames()([]string) { + return m.repo_names +} +// Serialize serializes information the current object +func (m *ItemTeamsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ldap_dn", m.GetLdapDn()) + if err != nil { + return err + } + } + if m.GetMaintainers() != nil { + err := writer.WriteCollectionOfStringValues("maintainers", m.GetMaintainers()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("parent_team_id", m.GetParentTeamId()) + if err != nil { + return err + } + } + if m.GetRepoNames() != nil { + err := writer.WriteCollectionOfStringValues("repo_names", m.GetRepoNames()) + 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 *ItemTeamsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description of the team. +func (m *ItemTeamsPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetLdapDn sets the ldap_dn property value. The [distinguished name](https://www.ldap.com/ldap-dns-and-rdns) (DN) of the LDAP entry to map to a team. LDAP synchronization must be enabled to map LDAP entries to a team. Use the "[Update LDAP mapping for a team](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/ldap#update-ldap-mapping-for-a-team)" endpoint to change the LDAP DN. For more information, see "[Using LDAP](https://docs.github.com/enterprise-server@3.14/admin/identity-and-access-management/authenticating-users-for-your-github-enterprise-server-instance/using-ldap#enabling-ldap-sync)." +func (m *ItemTeamsPostRequestBody) SetLdapDn(value *string)() { + m.ldap_dn = value +} +// SetMaintainers sets the maintainers property value. List GitHub IDs for organization members who will become team maintainers. +func (m *ItemTeamsPostRequestBody) SetMaintainers(value []string)() { + m.maintainers = value +} +// SetName sets the name property value. The name of the team. +func (m *ItemTeamsPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetParentTeamId sets the parent_team_id property value. The ID of a team to set as the parent team. +func (m *ItemTeamsPostRequestBody) SetParentTeamId(value *int32)() { + m.parent_team_id = value +} +// SetRepoNames sets the repo_names property value. The full name (e.g., "organization-name/repository-name") of repositories to add the team to. +func (m *ItemTeamsPostRequestBody) SetRepoNames(value []string)() { + m.repo_names = value +} +type ItemTeamsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetLdapDn()(*string) + GetMaintainers()([]string) + GetName()(*string) + GetParentTeamId()(*int32) + GetRepoNames()([]string) + SetDescription(value *string)() + SetLdapDn(value *string)() + SetMaintainers(value []string)() + SetName(value *string)() + SetParentTeamId(value *int32)() + SetRepoNames(value []string)() +} diff --git a/pkg/github/orgs/item_teams_request_builder.go b/pkg/github/orgs/item_teams_request_builder.go new file mode 100644 index 00000000..805ece33 --- /dev/null +++ b/pkg/github/orgs/item_teams_request_builder.go @@ -0,0 +1,120 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemTeamsRequestBuilder builds and executes requests for operations under \orgs\{org}\teams +type ItemTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsRequestBuilderGetQueryParameters lists all teams in an organization that are visible to the authenticated user. +type ItemTeamsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByTeam_slug gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.teams.item collection +// returns a *ItemTeamsWithTeam_slugItemRequestBuilder when successful +func (m *ItemTeamsRequestBuilder) ByTeam_slug(team_slug string)(*ItemTeamsWithTeam_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 NewItemTeamsWithTeam_slugItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemTeamsRequestBuilderInternal instantiates a new ItemTeamsRequestBuilder and sets the default values. +func NewItemTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsRequestBuilder) { + m := &ItemTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsRequestBuilder instantiates a new ItemTeamsRequestBuilder and sets the default values. +func NewItemTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all teams in an organization that are visible to the authenticated user. +// returns a []Teamable when successful +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-teams +func (m *ItemTeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable) + } + } + return val, nil +} +// Post to create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://docs.github.com/enterprise-server@3.14/articles/setting-team-creation-permissions-in-your-organization)."When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see "[About teams](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/about-teams)". +// returns a TeamFullable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#create-a-team +func (m *ItemTeamsRequestBuilder) Post(ctx context.Context, body ItemTeamsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamFullable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamFullable), nil +} +// ToGetRequestInformation lists all teams in an organization that are visible to the authenticated user. +// returns a *RequestInformation when successful +func (m *ItemTeamsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsRequestBuilderGetQueryParameters])(*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 to create a team, the authenticated user must be a member or owner of `{org}`. By default, organization members can create teams. Organization owners can limit team creation to organization owners. For more information, see "[Setting team creation permissions](https://docs.github.com/enterprise-server@3.14/articles/setting-team-creation-permissions-in-your-organization)."When you create a new team, you automatically become a team maintainer without explicitly adding yourself to the optional array of `maintainers`. For more information, see "[About teams](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/about-teams)". +// returns a *RequestInformation when successful +func (m *ItemTeamsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemTeamsPostRequestBodyable, 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 *ItemTeamsRequestBuilder when successful +func (m *ItemTeamsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsRequestBuilder) { + return NewItemTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_teams_with_team_escaped_slug_item_request_builder.go b/pkg/github/orgs/item_teams_with_team_escaped_slug_item_request_builder.go new file mode 100644 index 00000000..eae63837 --- /dev/null +++ b/pkg/github/orgs/item_teams_with_team_escaped_slug_item_request_builder.go @@ -0,0 +1,157 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemTeamsWithTeam_slugItemRequestBuilder builds and executes requests for operations under \orgs\{org}\teams\{team_slug} +type ItemTeamsWithTeam_slugItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemTeamsWithTeam_slugItemRequestBuilderInternal instantiates a new ItemTeamsWithTeam_slugItemRequestBuilder and sets the default values. +func NewItemTeamsWithTeam_slugItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsWithTeam_slugItemRequestBuilder) { + m := &ItemTeamsWithTeam_slugItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/teams/{team_slug}", pathParameters), + } + return m +} +// NewItemTeamsWithTeam_slugItemRequestBuilder instantiates a new ItemTeamsWithTeam_slugItemRequestBuilder and sets the default values. +func NewItemTeamsWithTeam_slugItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsWithTeam_slugItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsWithTeam_slugItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete to delete a team, the authenticated user must be an organization owner or team maintainer.If you are an organization owner, deleting a parent team will delete all of its child teams as well.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}`. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#delete-a-team +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Discussions the discussions property +// returns a *ItemTeamsItemDiscussionsRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Discussions()(*ItemTeamsItemDiscussionsRequestBuilder) { + return NewItemTeamsItemDiscussionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ExternalGroups the externalGroups property +// returns a *ItemTeamsItemExternalGroupsRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) ExternalGroups()(*ItemTeamsItemExternalGroupsRequestBuilder) { + return NewItemTeamsItemExternalGroupsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get gets a team using the team's `slug`. To create the `slug`, GitHub Enterprise Server replaces special characters in the `name` string, changes all words to lowercase, and replaces spaces with a `-` separator. For example, `"My TEam Näme"` would become `my-team-name`.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}`. +// returns a TeamFullable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#get-a-team-by-name +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamFullable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamFullable), nil +} +// Members the members property +// returns a *ItemTeamsItemMembersRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Members()(*ItemTeamsItemMembersRequestBuilder) { + return NewItemTeamsItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Memberships the memberships property +// returns a *ItemTeamsItemMembershipsRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Memberships()(*ItemTeamsItemMembershipsRequestBuilder) { + return NewItemTeamsItemMembershipsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch to edit a team, the authenticated user must either be an organization owner or a team maintainer.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}`. +// returns a TeamFullable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#update-a-team +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Patch(ctx context.Context, body ItemTeamsItemWithTeam_slugPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamFullable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamFullable), nil +} +// Projects the projects property +// returns a *ItemTeamsItemProjectsRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Projects()(*ItemTeamsItemProjectsRequestBuilder) { + return NewItemTeamsItemProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repos the repos property +// returns a *ItemTeamsItemReposRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Repos()(*ItemTeamsItemReposRequestBuilder) { + return NewItemTeamsItemReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Teams the teams property +// returns a *ItemTeamsItemTeamsRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) Teams()(*ItemTeamsItemTeamsRequestBuilder) { + return NewItemTeamsItemTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation to delete a team, the authenticated user must be an organization owner or team maintainer.If you are an organization owner, deleting a parent team will delete all of its child teams as well.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `DELETE /organizations/{org_id}/team/{team_id}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsWithTeam_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 +} +// ToGetRequestInformation gets a team using the team's `slug`. To create the `slug`, GitHub Enterprise Server replaces special characters in the `name` string, changes all words to lowercase, and replaces spaces with a `-` separator. For example, `"My TEam Näme"` would become `my-team-name`.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) 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 to edit a team, the authenticated user must either be an organization owner or a team maintainer.> [!NOTE]> You can also specify a team by `org_id` and `team_id` using the route `PATCH /organizations/{org_id}/team/{team_id}`. +// returns a *RequestInformation when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemTeamsItemWithTeam_slugPatchRequestBodyable, 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 *ItemTeamsWithTeam_slugItemRequestBuilder when successful +func (m *ItemTeamsWithTeam_slugItemRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsWithTeam_slugItemRequestBuilder) { + return NewItemTeamsWithTeam_slugItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/orgs/item_with_org_delete_response.go b/pkg/github/orgs/item_with_org_delete_response.go new file mode 100644 index 00000000..5bb0436a --- /dev/null +++ b/pkg/github/orgs/item_with_org_delete_response.go @@ -0,0 +1,51 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemWithOrgDeleteResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemWithOrgDeleteResponse instantiates a new ItemWithOrgDeleteResponse and sets the default values. +func NewItemWithOrgDeleteResponse()(*ItemWithOrgDeleteResponse) { + m := &ItemWithOrgDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithOrgDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithOrgDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithOrgDeleteResponse(), 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 *ItemWithOrgDeleteResponse) 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 *ItemWithOrgDeleteResponse) 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 *ItemWithOrgDeleteResponse) 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 *ItemWithOrgDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemWithOrgDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/orgs/item_with_org_patch_request_body.go b/pkg/github/orgs/item_with_org_patch_request_body.go new file mode 100644 index 00000000..0398c192 --- /dev/null +++ b/pkg/github/orgs/item_with_org_patch_request_body.go @@ -0,0 +1,794 @@ +package orgs + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemWithOrgPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + // Deprecated: + advanced_security_enabled_for_new_repositories *bool + // Billing email address. This address is not publicized. + billing_email *string + // The blog property + blog *string + // The company name. + company *string + // **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + // Deprecated: + dependabot_alerts_enabled_for_new_repositories *bool + // **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + // Deprecated: + dependabot_security_updates_enabled_for_new_repositories *bool + // **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + // Deprecated: + dependency_graph_enabled_for_new_repositories *bool + // The description of the company. The maximum size is 160 characters. + description *string + // The publicly visible email address. + email *string + // Whether an organization can use organization projects. + has_organization_projects *bool + // Whether repositories that belong to the organization can use repository projects. + has_repository_projects *bool + // The location. + location *string + // Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + members_can_create_internal_repositories *bool + // Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. + members_can_create_pages *bool + // Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + members_can_create_private_repositories *bool + // Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. + members_can_create_public_repositories *bool + // Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. + members_can_create_repositories *bool + // Whether organization members can fork private organization repositories. + members_can_fork_private_repositories *bool + // The shorthand name of the company. + name *string + // **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + // Deprecated: + secret_scanning_enabled_for_new_repositories *bool + // If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. + secret_scanning_push_protection_custom_link *string + // Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. + secret_scanning_push_protection_custom_link_enabled *bool + // **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. + // Deprecated: + secret_scanning_push_protection_enabled_for_new_repositories *bool + // The Twitter username of the company. + twitter_username *string + // Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. + web_commit_signoff_required *bool +} +// NewItemWithOrgPatchRequestBody instantiates a new ItemWithOrgPatchRequestBody and sets the default values. +func NewItemWithOrgPatchRequestBody()(*ItemWithOrgPatchRequestBody) { + m := &ItemWithOrgPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithOrgPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithOrgPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithOrgPatchRequestBody(), 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 *ItemWithOrgPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurityEnabledForNewRepositories gets the advanced_security_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// Deprecated: +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetAdvancedSecurityEnabledForNewRepositories()(*bool) { + return m.advanced_security_enabled_for_new_repositories +} +// GetBillingEmail gets the billing_email property value. Billing email address. This address is not publicized. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetBillingEmail()(*string) { + return m.billing_email +} +// GetBlog gets the blog property value. The blog property +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetBlog()(*string) { + return m.blog +} +// GetCompany gets the company property value. The company name. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetCompany()(*string) { + return m.company +} +// GetDependabotAlertsEnabledForNewRepositories gets the dependabot_alerts_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// Deprecated: +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetDependabotAlertsEnabledForNewRepositories()(*bool) { + return m.dependabot_alerts_enabled_for_new_repositories +} +// GetDependabotSecurityUpdatesEnabledForNewRepositories gets the dependabot_security_updates_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// Deprecated: +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetDependabotSecurityUpdatesEnabledForNewRepositories()(*bool) { + return m.dependabot_security_updates_enabled_for_new_repositories +} +// GetDependencyGraphEnabledForNewRepositories gets the dependency_graph_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// Deprecated: +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetDependencyGraphEnabledForNewRepositories()(*bool) { + return m.dependency_graph_enabled_for_new_repositories +} +// GetDescription gets the description property value. The description of the company. The maximum size is 160 characters. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetDescription()(*string) { + return m.description +} +// GetEmail gets the email property value. The publicly visible email address. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemWithOrgPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advanced_security_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurityEnabledForNewRepositories(val) + } + return nil + } + res["billing_email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBillingEmail(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + res["dependabot_alerts_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDependabotAlertsEnabledForNewRepositories(val) + } + return nil + } + res["dependabot_security_updates_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDependabotSecurityUpdatesEnabledForNewRepositories(val) + } + return nil + } + res["dependency_graph_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDependencyGraphEnabledForNewRepositories(val) + } + 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["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["has_organization_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasOrganizationProjects(val) + } + return nil + } + res["has_repository_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasRepositoryProjects(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + res["members_can_create_internal_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreateInternalRepositories(val) + } + return nil + } + res["members_can_create_pages"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePages(val) + } + return nil + } + res["members_can_create_private_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePrivateRepositories(val) + } + return nil + } + res["members_can_create_public_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreatePublicRepositories(val) + } + return nil + } + res["members_can_create_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanCreateRepositories(val) + } + return nil + } + res["members_can_fork_private_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMembersCanForkPrivateRepositories(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["secret_scanning_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningEnabledForNewRepositories(val) + } + return nil + } + res["secret_scanning_push_protection_custom_link"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionCustomLink(val) + } + return nil + } + res["secret_scanning_push_protection_custom_link_enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionCustomLinkEnabled(val) + } + return nil + } + res["secret_scanning_push_protection_enabled_for_new_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtectionEnabledForNewRepositories(val) + } + return nil + } + res["twitter_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTwitterUsername(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetHasOrganizationProjects gets the has_organization_projects property value. Whether an organization can use organization projects. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetHasOrganizationProjects()(*bool) { + return m.has_organization_projects +} +// GetHasRepositoryProjects gets the has_repository_projects property value. Whether repositories that belong to the organization can use repository projects. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetHasRepositoryProjects()(*bool) { + return m.has_repository_projects +} +// GetLocation gets the location property value. The location. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetLocation()(*string) { + return m.location +} +// GetMembersCanCreateInternalRepositories gets the members_can_create_internal_repositories property value. Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetMembersCanCreateInternalRepositories()(*bool) { + return m.members_can_create_internal_repositories +} +// GetMembersCanCreatePages gets the members_can_create_pages property value. Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetMembersCanCreatePages()(*bool) { + return m.members_can_create_pages +} +// GetMembersCanCreatePrivateRepositories gets the members_can_create_private_repositories property value. Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetMembersCanCreatePrivateRepositories()(*bool) { + return m.members_can_create_private_repositories +} +// GetMembersCanCreatePublicRepositories gets the members_can_create_public_repositories property value. Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetMembersCanCreatePublicRepositories()(*bool) { + return m.members_can_create_public_repositories +} +// GetMembersCanCreateRepositories gets the members_can_create_repositories property value. Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetMembersCanCreateRepositories()(*bool) { + return m.members_can_create_repositories +} +// GetMembersCanForkPrivateRepositories gets the members_can_fork_private_repositories property value. Whether organization members can fork private organization repositories. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetMembersCanForkPrivateRepositories()(*bool) { + return m.members_can_fork_private_repositories +} +// GetName gets the name property value. The shorthand name of the company. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetName()(*string) { + return m.name +} +// GetSecretScanningEnabledForNewRepositories gets the secret_scanning_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// Deprecated: +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetSecretScanningEnabledForNewRepositories()(*bool) { + return m.secret_scanning_enabled_for_new_repositories +} +// GetSecretScanningPushProtectionCustomLink gets the secret_scanning_push_protection_custom_link property value. If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetSecretScanningPushProtectionCustomLink()(*string) { + return m.secret_scanning_push_protection_custom_link +} +// GetSecretScanningPushProtectionCustomLinkEnabled gets the secret_scanning_push_protection_custom_link_enabled property value. Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetSecretScanningPushProtectionCustomLinkEnabled()(*bool) { + return m.secret_scanning_push_protection_custom_link_enabled +} +// GetSecretScanningPushProtectionEnabledForNewRepositories gets the secret_scanning_push_protection_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// Deprecated: +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetSecretScanningPushProtectionEnabledForNewRepositories()(*bool) { + return m.secret_scanning_push_protection_enabled_for_new_repositories +} +// GetTwitterUsername gets the twitter_username property value. The Twitter username of the company. +// returns a *string when successful +func (m *ItemWithOrgPatchRequestBody) GetTwitterUsername()(*string) { + return m.twitter_username +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. +// returns a *bool when successful +func (m *ItemWithOrgPatchRequestBody) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *ItemWithOrgPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("advanced_security_enabled_for_new_repositories", m.GetAdvancedSecurityEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("billing_email", m.GetBillingEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dependabot_alerts_enabled_for_new_repositories", m.GetDependabotAlertsEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dependabot_security_updates_enabled_for_new_repositories", m.GetDependabotSecurityUpdatesEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dependency_graph_enabled_for_new_repositories", m.GetDependencyGraphEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_organization_projects", m.GetHasOrganizationProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_repository_projects", m.GetHasRepositoryProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_internal_repositories", m.GetMembersCanCreateInternalRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_pages", m.GetMembersCanCreatePages()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_private_repositories", m.GetMembersCanCreatePrivateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_public_repositories", m.GetMembersCanCreatePublicRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_create_repositories", m.GetMembersCanCreateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("members_can_fork_private_repositories", m.GetMembersCanForkPrivateRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_enabled_for_new_repositories", m.GetSecretScanningEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret_scanning_push_protection_custom_link", m.GetSecretScanningPushProtectionCustomLink()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_push_protection_custom_link_enabled", m.GetSecretScanningPushProtectionCustomLinkEnabled()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("secret_scanning_push_protection_enabled_for_new_repositories", m.GetSecretScanningPushProtectionEnabledForNewRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("twitter_username", m.GetTwitterUsername()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *ItemWithOrgPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurityEnabledForNewRepositories sets the advanced_security_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether GitHub Advanced Security is automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// Deprecated: +func (m *ItemWithOrgPatchRequestBody) SetAdvancedSecurityEnabledForNewRepositories(value *bool)() { + m.advanced_security_enabled_for_new_repositories = value +} +// SetBillingEmail sets the billing_email property value. Billing email address. This address is not publicized. +func (m *ItemWithOrgPatchRequestBody) SetBillingEmail(value *string)() { + m.billing_email = value +} +// SetBlog sets the blog property value. The blog property +func (m *ItemWithOrgPatchRequestBody) SetBlog(value *string)() { + m.blog = value +} +// SetCompany sets the company property value. The company name. +func (m *ItemWithOrgPatchRequestBody) SetCompany(value *string)() { + m.company = value +} +// SetDependabotAlertsEnabledForNewRepositories sets the dependabot_alerts_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether Dependabot alerts are automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// Deprecated: +func (m *ItemWithOrgPatchRequestBody) SetDependabotAlertsEnabledForNewRepositories(value *bool)() { + m.dependabot_alerts_enabled_for_new_repositories = value +} +// SetDependabotSecurityUpdatesEnabledForNewRepositories sets the dependabot_security_updates_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether Dependabot security updates are automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// Deprecated: +func (m *ItemWithOrgPatchRequestBody) SetDependabotSecurityUpdatesEnabledForNewRepositories(value *bool)() { + m.dependabot_security_updates_enabled_for_new_repositories = value +} +// SetDependencyGraphEnabledForNewRepositories sets the dependency_graph_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether dependency graph is automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// Deprecated: +func (m *ItemWithOrgPatchRequestBody) SetDependencyGraphEnabledForNewRepositories(value *bool)() { + m.dependency_graph_enabled_for_new_repositories = value +} +// SetDescription sets the description property value. The description of the company. The maximum size is 160 characters. +func (m *ItemWithOrgPatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetEmail sets the email property value. The publicly visible email address. +func (m *ItemWithOrgPatchRequestBody) SetEmail(value *string)() { + m.email = value +} +// SetHasOrganizationProjects sets the has_organization_projects property value. Whether an organization can use organization projects. +func (m *ItemWithOrgPatchRequestBody) SetHasOrganizationProjects(value *bool)() { + m.has_organization_projects = value +} +// SetHasRepositoryProjects sets the has_repository_projects property value. Whether repositories that belong to the organization can use repository projects. +func (m *ItemWithOrgPatchRequestBody) SetHasRepositoryProjects(value *bool)() { + m.has_repository_projects = value +} +// SetLocation sets the location property value. The location. +func (m *ItemWithOrgPatchRequestBody) SetLocation(value *string)() { + m.location = value +} +// SetMembersCanCreateInternalRepositories sets the members_can_create_internal_repositories property value. Whether organization members can create internal repositories, which are visible to all enterprise members. You can only allow members to create internal repositories if your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. +func (m *ItemWithOrgPatchRequestBody) SetMembersCanCreateInternalRepositories(value *bool)() { + m.members_can_create_internal_repositories = value +} +// SetMembersCanCreatePages sets the members_can_create_pages property value. Whether organization members can create GitHub Pages sites. Existing published sites will not be impacted. +func (m *ItemWithOrgPatchRequestBody) SetMembersCanCreatePages(value *bool)() { + m.members_can_create_pages = value +} +// SetMembersCanCreatePrivateRepositories sets the members_can_create_private_repositories property value. Whether organization members can create private repositories, which are visible to organization members with permission. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. +func (m *ItemWithOrgPatchRequestBody) SetMembersCanCreatePrivateRepositories(value *bool)() { + m.members_can_create_private_repositories = value +} +// SetMembersCanCreatePublicRepositories sets the members_can_create_public_repositories property value. Whether organization members can create public repositories, which are visible to anyone. For more information, see "[Restricting repository creation in your organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/restricting-repository-creation-in-your-organization)" in the GitHub Help documentation. +func (m *ItemWithOrgPatchRequestBody) SetMembersCanCreatePublicRepositories(value *bool)() { + m.members_can_create_public_repositories = value +} +// SetMembersCanCreateRepositories sets the members_can_create_repositories property value. Whether of non-admin organization members can create repositories. **Note:** A parameter can override this parameter. See `members_allowed_repository_creation_type` in this table for details. +func (m *ItemWithOrgPatchRequestBody) SetMembersCanCreateRepositories(value *bool)() { + m.members_can_create_repositories = value +} +// SetMembersCanForkPrivateRepositories sets the members_can_fork_private_repositories property value. Whether organization members can fork private organization repositories. +func (m *ItemWithOrgPatchRequestBody) SetMembersCanForkPrivateRepositories(value *bool)() { + m.members_can_fork_private_repositories = value +} +// SetName sets the name property value. The shorthand name of the company. +func (m *ItemWithOrgPatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetSecretScanningEnabledForNewRepositories sets the secret_scanning_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether secret scanning is automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// Deprecated: +func (m *ItemWithOrgPatchRequestBody) SetSecretScanningEnabledForNewRepositories(value *bool)() { + m.secret_scanning_enabled_for_new_repositories = value +} +// SetSecretScanningPushProtectionCustomLink sets the secret_scanning_push_protection_custom_link property value. If `secret_scanning_push_protection_custom_link_enabled` is true, the URL that will be displayed to contributors who are blocked from pushing a secret. +func (m *ItemWithOrgPatchRequestBody) SetSecretScanningPushProtectionCustomLink(value *string)() { + m.secret_scanning_push_protection_custom_link = value +} +// SetSecretScanningPushProtectionCustomLinkEnabled sets the secret_scanning_push_protection_custom_link_enabled property value. Whether a custom link is shown to contributors who are blocked from pushing a secret by push protection. +func (m *ItemWithOrgPatchRequestBody) SetSecretScanningPushProtectionCustomLinkEnabled(value *bool)() { + m.secret_scanning_push_protection_custom_link_enabled = value +} +// SetSecretScanningPushProtectionEnabledForNewRepositories sets the secret_scanning_push_protection_enabled_for_new_repositories property value. **Deprecated.** Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead.Whether secret scanning push protection is automatically enabled for new repositories and repositories transferred to this organization.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."You can check which security and analysis features are currently enabled by using a `GET /orgs/{org}` request. +// Deprecated: +func (m *ItemWithOrgPatchRequestBody) SetSecretScanningPushProtectionEnabledForNewRepositories(value *bool)() { + m.secret_scanning_push_protection_enabled_for_new_repositories = value +} +// SetTwitterUsername sets the twitter_username property value. The Twitter username of the company. +func (m *ItemWithOrgPatchRequestBody) SetTwitterUsername(value *string)() { + m.twitter_username = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. Whether contributors to organization repositories are required to sign off on commits they make through GitHub's web interface. +func (m *ItemWithOrgPatchRequestBody) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type ItemWithOrgPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurityEnabledForNewRepositories()(*bool) + GetBillingEmail()(*string) + GetBlog()(*string) + GetCompany()(*string) + GetDependabotAlertsEnabledForNewRepositories()(*bool) + GetDependabotSecurityUpdatesEnabledForNewRepositories()(*bool) + GetDependencyGraphEnabledForNewRepositories()(*bool) + GetDescription()(*string) + GetEmail()(*string) + GetHasOrganizationProjects()(*bool) + GetHasRepositoryProjects()(*bool) + GetLocation()(*string) + GetMembersCanCreateInternalRepositories()(*bool) + GetMembersCanCreatePages()(*bool) + GetMembersCanCreatePrivateRepositories()(*bool) + GetMembersCanCreatePublicRepositories()(*bool) + GetMembersCanCreateRepositories()(*bool) + GetMembersCanForkPrivateRepositories()(*bool) + GetName()(*string) + GetSecretScanningEnabledForNewRepositories()(*bool) + GetSecretScanningPushProtectionCustomLink()(*string) + GetSecretScanningPushProtectionCustomLinkEnabled()(*bool) + GetSecretScanningPushProtectionEnabledForNewRepositories()(*bool) + GetTwitterUsername()(*string) + GetWebCommitSignoffRequired()(*bool) + SetAdvancedSecurityEnabledForNewRepositories(value *bool)() + SetBillingEmail(value *string)() + SetBlog(value *string)() + SetCompany(value *string)() + SetDependabotAlertsEnabledForNewRepositories(value *bool)() + SetDependabotSecurityUpdatesEnabledForNewRepositories(value *bool)() + SetDependencyGraphEnabledForNewRepositories(value *bool)() + SetDescription(value *string)() + SetEmail(value *string)() + SetHasOrganizationProjects(value *bool)() + SetHasRepositoryProjects(value *bool)() + SetLocation(value *string)() + SetMembersCanCreateInternalRepositories(value *bool)() + SetMembersCanCreatePages(value *bool)() + SetMembersCanCreatePrivateRepositories(value *bool)() + SetMembersCanCreatePublicRepositories(value *bool)() + SetMembersCanCreateRepositories(value *bool)() + SetMembersCanForkPrivateRepositories(value *bool)() + SetName(value *string)() + SetSecretScanningEnabledForNewRepositories(value *bool)() + SetSecretScanningPushProtectionCustomLink(value *string)() + SetSecretScanningPushProtectionCustomLinkEnabled(value *bool)() + SetSecretScanningPushProtectionEnabledForNewRepositories(value *bool)() + SetTwitterUsername(value *string)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/pkg/github/orgs/item_with_security_escaped_product_item_request_builder.go b/pkg/github/orgs/item_with_security_escaped_product_item_request_builder.go new file mode 100644 index 00000000..fd86d423 --- /dev/null +++ b/pkg/github/orgs/item_with_security_escaped_product_item_request_builder.go @@ -0,0 +1,36 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemWithSecurity_productItemRequestBuilder builds and executes requests for operations under \orgs\{org}\{security_product} +type ItemWithSecurity_productItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByEnablement gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.item.item collection +// Deprecated: +// returns a *ItemItemWithEnablementItemRequestBuilder when successful +func (m *ItemWithSecurity_productItemRequestBuilder) ByEnablement(enablement string)(*ItemItemWithEnablementItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if enablement != "" { + urlTplParams["enablement"] = enablement + } + return NewItemItemWithEnablementItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemWithSecurity_productItemRequestBuilderInternal instantiates a new ItemWithSecurity_productItemRequestBuilder and sets the default values. +func NewItemWithSecurity_productItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithSecurity_productItemRequestBuilder) { + m := &ItemWithSecurity_productItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}/{security_product}", pathParameters), + } + return m +} +// NewItemWithSecurity_productItemRequestBuilder instantiates a new ItemWithSecurity_productItemRequestBuilder and sets the default values. +func NewItemWithSecurity_productItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemWithSecurity_productItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemWithSecurity_productItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/orgs_request_builder.go b/pkg/github/orgs/orgs_request_builder.go new file mode 100644 index 00000000..9d380567 --- /dev/null +++ b/pkg/github/orgs/orgs_request_builder.go @@ -0,0 +1,35 @@ +package orgs + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// OrgsRequestBuilder builds and executes requests for operations under \orgs +type OrgsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByOrg gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item collection +// returns a *WithOrgItemRequestBuilder when successful +func (m *OrgsRequestBuilder) ByOrg(org string)(*WithOrgItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if org != "" { + urlTplParams["org"] = org + } + return NewWithOrgItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewOrgsRequestBuilderInternal instantiates a new OrgsRequestBuilder and sets the default values. +func NewOrgsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrgsRequestBuilder) { + m := &OrgsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs", pathParameters), + } + return m +} +// NewOrgsRequestBuilder instantiates a new OrgsRequestBuilder and sets the default values. +func NewOrgsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrgsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewOrgsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/orgs/with_org_item_request_builder.go b/pkg/github/orgs/with_org_item_request_builder.go new file mode 100644 index 00000000..4c13c198 --- /dev/null +++ b/pkg/github/orgs/with_org_item_request_builder.go @@ -0,0 +1,311 @@ +package orgs + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// WithOrgItemRequestBuilder builds and executes requests for operations under \orgs\{org} +type WithOrgItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Actions the actions property +// returns a *ItemActionsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Actions()(*ItemActionsRequestBuilder) { + return NewItemActionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Announcement the announcement property +// returns a *ItemAnnouncementRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Announcement()(*ItemAnnouncementRequestBuilder) { + return NewItemAnnouncementRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// AuditLog the auditLog property +// returns a *ItemAuditLogRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) AuditLog()(*ItemAuditLogRequestBuilder) { + return NewItemAuditLogRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// BySecurity_product gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.orgs.item.item collection +// returns a *ItemWithSecurity_productItemRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) BySecurity_product(security_product string)(*ItemWithSecurity_productItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if security_product != "" { + urlTplParams["security_product"] = security_product + } + return NewItemWithSecurity_productItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// CodeScanning the codeScanning property +// returns a *ItemCodeScanningRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) CodeScanning()(*ItemCodeScanningRequestBuilder) { + return NewItemCodeScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewWithOrgItemRequestBuilderInternal instantiates a new WithOrgItemRequestBuilder and sets the default values. +func NewWithOrgItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithOrgItemRequestBuilder) { + m := &WithOrgItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/orgs/{org}", pathParameters), + } + return m +} +// NewWithOrgItemRequestBuilder instantiates a new WithOrgItemRequestBuilder and sets the default values. +func NewWithOrgItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithOrgItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithOrgItemRequestBuilderInternal(urlParams, requestAdapter) +} +// CustomRepositoryRoles the customRepositoryRoles property +// returns a *ItemCustomRepositoryRolesRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) CustomRepositoryRoles()(*ItemCustomRepositoryRolesRequestBuilder) { + return NewItemCustomRepositoryRolesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Delete deletes an organization and all its repositories.The organization login will be unavailable for 90 days after deletion.Please review the Terms of Service regarding account deletion before using this endpoint:https://docs.github.com/enterprise-server@3.14/site-policy/github-terms/github-terms-of-service +// returns a ItemWithOrgDeleteResponseable 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/enterprise-server@3.14/rest/orgs/orgs#delete-an-organization +func (m *WithOrgItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemWithOrgDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemWithOrgDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemWithOrgDeleteResponseable), nil +} +// Dependabot the dependabot property +// returns a *ItemDependabotRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Dependabot()(*ItemDependabotRequestBuilder) { + return NewItemDependabotRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Docker the docker property +// returns a *ItemDockerRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Docker()(*ItemDockerRequestBuilder) { + return NewItemDockerRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Events the events property +// returns a *ItemEventsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Events()(*ItemEventsRequestBuilder) { + return NewItemEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ExternalGroup the externalGroup property +// returns a *ItemExternalGroupRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) ExternalGroup()(*ItemExternalGroupRequestBuilder) { + return NewItemExternalGroupRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ExternalGroups the externalGroups property +// returns a *ItemExternalGroupsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) ExternalGroups()(*ItemExternalGroupsRequestBuilder) { + return NewItemExternalGroupsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get gets information about an organization.When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/enterprise-server@3.14/articles/securing-your-account-with-two-factor-authentication-2fa/).To see the full details about an organization, the authenticated user must be an organization owner.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization.To see information about an organization's GitHub Enterprise Server plan, GitHub Apps need the `Organization plan` permission. +// returns a OrganizationFullable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/orgs#get-an-organization +func (m *WithOrgItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationFullable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationFullable), nil +} +// Hooks the hooks property +// returns a *ItemHooksRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Hooks()(*ItemHooksRequestBuilder) { + return NewItemHooksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installation the installation property +// returns a *ItemInstallationRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Installation()(*ItemInstallationRequestBuilder) { + return NewItemInstallationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installations the installations property +// returns a *ItemInstallationsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Installations()(*ItemInstallationsRequestBuilder) { + return NewItemInstallationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Issues the issues property +// returns a *ItemIssuesRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Issues()(*ItemIssuesRequestBuilder) { + return NewItemIssuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Members the members property +// returns a *ItemMembersRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Members()(*ItemMembersRequestBuilder) { + return NewItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Memberships the memberships property +// returns a *ItemMembershipsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Memberships()(*ItemMembershipsRequestBuilder) { + return NewItemMembershipsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Migrations the migrations property +// returns a *ItemMigrationsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Migrations()(*ItemMigrationsRequestBuilder) { + return NewItemMigrationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// OrganizationFineGrainedPermissions the organizationFineGrainedPermissions property +// returns a *ItemOrganizationFineGrainedPermissionsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) OrganizationFineGrainedPermissions()(*ItemOrganizationFineGrainedPermissionsRequestBuilder) { + return NewItemOrganizationFineGrainedPermissionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// OrganizationRoles the organizationRoles property +// returns a *ItemOrganizationRolesRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) OrganizationRoles()(*ItemOrganizationRolesRequestBuilder) { + return NewItemOrganizationRolesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Outside_collaborators the outside_collaborators property +// returns a *ItemOutside_collaboratorsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Outside_collaborators()(*ItemOutside_collaboratorsRequestBuilder) { + return NewItemOutside_collaboratorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Packages the packages property +// returns a *ItemPackagesRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Packages()(*ItemPackagesRequestBuilder) { + return NewItemPackagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch > [!WARNING]> **Parameter deprecation notice:** GitHub Enterprise Server will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes).> [!WARNING]> **Parameter deprecation notice:** Code security product enablement for new repositories through the organization API is deprecated and will be replaced with code security configurations in a future GitHub Enterprise Server version.Updates the organization's profile and member privileges.The authenticated user must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. +// returns a OrganizationFullable when successful +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/orgs#update-an-organization +func (m *WithOrgItemRequestBuilder) Patch(ctx context.Context, body ItemWithOrgPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationFullable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationFullable), nil +} +// PersonalAccessTokenRequests the personalAccessTokenRequests property +// returns a *ItemPersonalAccessTokenRequestsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) PersonalAccessTokenRequests()(*ItemPersonalAccessTokenRequestsRequestBuilder) { + return NewItemPersonalAccessTokenRequestsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// PersonalAccessTokens the personalAccessTokens property +// returns a *ItemPersonalAccessTokensRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) PersonalAccessTokens()(*ItemPersonalAccessTokensRequestBuilder) { + return NewItemPersonalAccessTokensRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// PreReceiveHooks the preReceiveHooks property +// returns a *ItemPreReceiveHooksRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) PreReceiveHooks()(*ItemPreReceiveHooksRequestBuilder) { + return NewItemPreReceiveHooksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Projects the projects property +// returns a *ItemProjectsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Projects()(*ItemProjectsRequestBuilder) { + return NewItemProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Properties the properties property +// returns a *ItemPropertiesRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Properties()(*ItemPropertiesRequestBuilder) { + return NewItemPropertiesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Public_members the public_members property +// returns a *ItemPublic_membersRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Public_members()(*ItemPublic_membersRequestBuilder) { + return NewItemPublic_membersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repos the repos property +// returns a *ItemReposRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Repos()(*ItemReposRequestBuilder) { + return NewItemReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// RepositoryFineGrainedPermissions the repositoryFineGrainedPermissions property +// returns a *ItemRepositoryFineGrainedPermissionsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) RepositoryFineGrainedPermissions()(*ItemRepositoryFineGrainedPermissionsRequestBuilder) { + return NewItemRepositoryFineGrainedPermissionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rulesets the rulesets property +// returns a *ItemRulesetsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Rulesets()(*ItemRulesetsRequestBuilder) { + return NewItemRulesetsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecretScanning the secretScanning property +// returns a *ItemSecretScanningRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) SecretScanning()(*ItemSecretScanningRequestBuilder) { + return NewItemSecretScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecurityManagers the securityManagers property +// returns a *ItemSecurityManagersRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) SecurityManagers()(*ItemSecurityManagersRequestBuilder) { + return NewItemSecurityManagersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Settings the settings property +// returns a *ItemSettingsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Settings()(*ItemSettingsRequestBuilder) { + return NewItemSettingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Teams the teams property +// returns a *ItemTeamsRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) Teams()(*ItemTeamsRequestBuilder) { + return NewItemTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes an organization and all its repositories.The organization login will be unavailable for 90 days after deletion.Please review the Terms of Service regarding account deletion before using this endpoint:https://docs.github.com/enterprise-server@3.14/site-policy/github-terms/github-terms-of-service +// returns a *RequestInformation when successful +func (m *WithOrgItemRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation gets information about an organization.When the value of `two_factor_requirement_enabled` is `true`, the organization requires all members, billing managers, and outside collaborators to enable [two-factor authentication](https://docs.github.com/enterprise-server@3.14/articles/securing-your-account-with-two-factor-authentication-2fa/).To see the full details about an organization, the authenticated user must be an organization owner.OAuth app tokens and personal access tokens (classic) need the `admin:org` scope to see the full details about an organization.To see information about an organization's GitHub Enterprise Server plan, GitHub Apps need the `Organization plan` permission. +// returns a *RequestInformation when successful +func (m *WithOrgItemRequestBuilder) 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 > [!WARNING]> **Parameter deprecation notice:** GitHub Enterprise Server will replace and discontinue `members_allowed_repository_creation_type` in favor of more granular permissions. The new input parameters are `members_can_create_public_repositories`, `members_can_create_private_repositories` for all organizations and `members_can_create_internal_repositories` for organizations associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+. For more information, see the [blog post](https://developer.github.com/changes/2019-12-03-internal-visibility-changes).> [!WARNING]> **Parameter deprecation notice:** Code security product enablement for new repositories through the organization API is deprecated and will be replaced with code security configurations in a future GitHub Enterprise Server version.Updates the organization's profile and member privileges.The authenticated user must be an organization owner to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org` or `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *WithOrgItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemWithOrgPatchRequestBodyable, 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 *WithOrgItemRequestBuilder when successful +func (m *WithOrgItemRequestBuilder) WithUrl(rawUrl string)(*WithOrgItemRequestBuilder) { + return NewWithOrgItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/projects/columns/item/cards/get_archived_escaped_state_query_parameter_type.go b/pkg/github/projects/columns/item/cards/get_archived_escaped_state_query_parameter_type.go new file mode 100644 index 00000000..5eedb54d --- /dev/null +++ b/pkg/github/projects/columns/item/cards/get_archived_escaped_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package cards +type GetArchived_stateQueryParameterType int + +const ( + ALL_GETARCHIVED_STATEQUERYPARAMETERTYPE GetArchived_stateQueryParameterType = iota + ARCHIVED_GETARCHIVED_STATEQUERYPARAMETERTYPE + NOT_ARCHIVED_GETARCHIVED_STATEQUERYPARAMETERTYPE +) + +func (i GetArchived_stateQueryParameterType) String() string { + return []string{"all", "archived", "not_archived"}[i] +} +func ParseGetArchived_stateQueryParameterType(v string) (any, error) { + result := ALL_GETARCHIVED_STATEQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETARCHIVED_STATEQUERYPARAMETERTYPE + case "archived": + result = ARCHIVED_GETARCHIVED_STATEQUERYPARAMETERTYPE + case "not_archived": + result = NOT_ARCHIVED_GETARCHIVED_STATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetArchived_stateQueryParameterType(values []GetArchived_stateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetArchived_stateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/projects/columns_cards_item_moves403_error.go b/pkg/github/projects/columns_cards_item_moves403_error.go new file mode 100644 index 00000000..19ed6200 --- /dev/null +++ b/pkg/github/projects/columns_cards_item_moves403_error.go @@ -0,0 +1,158 @@ +package projects + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemMoves403Error 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 documentation_url property + documentation_url *string + // The errors property + errors []ColumnsCardsItemMoves403Error_errorsable + // The message property + message *string +} +// NewColumnsCardsItemMoves403Error instantiates a new ColumnsCardsItemMoves403Error and sets the default values. +func NewColumnsCardsItemMoves403Error()(*ColumnsCardsItemMoves403Error) { + m := &ColumnsCardsItemMoves403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsCardsItemMoves403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemMoves403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemMoves403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ColumnsCardsItemMoves403Error) 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 *ColumnsCardsItemMoves403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ColumnsCardsItemMoves403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []ColumnsCardsItemMoves403Error_errorsable when successful +func (m *ColumnsCardsItemMoves403Error) GetErrors()([]ColumnsCardsItemMoves403Error_errorsable) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemMoves403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateColumnsCardsItemMoves403Error_errorsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ColumnsCardsItemMoves403Error_errorsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ColumnsCardsItemMoves403Error_errorsable) + } + } + m.SetErrors(res) + } + 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 *ColumnsCardsItemMoves403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemMoves403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + if m.GetErrors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetErrors())) + for i, v := range m.GetErrors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("errors", cast) + 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 *ColumnsCardsItemMoves403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ColumnsCardsItemMoves403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ColumnsCardsItemMoves403Error) SetErrors(value []ColumnsCardsItemMoves403Error_errorsable)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ColumnsCardsItemMoves403Error) SetMessage(value *string)() { + m.message = value +} +type ColumnsCardsItemMoves403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetErrors()([]ColumnsCardsItemMoves403Error_errorsable) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetErrors(value []ColumnsCardsItemMoves403Error_errorsable)() + SetMessage(value *string)() +} diff --git a/pkg/github/projects/columns_cards_item_moves403_error_escaped_errors.go b/pkg/github/projects/columns_cards_item_moves403_error_escaped_errors.go new file mode 100644 index 00000000..a4a3d665 --- /dev/null +++ b/pkg/github/projects/columns_cards_item_moves403_error_escaped_errors.go @@ -0,0 +1,167 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemMoves403Error_errors 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 code property + code *string + // The field property + field *string + // The message property + message *string + // The resource property + resource *string +} +// NewColumnsCardsItemMoves403Error_errors instantiates a new ColumnsCardsItemMoves403Error_errors and sets the default values. +func NewColumnsCardsItemMoves403Error_errors()(*ColumnsCardsItemMoves403Error_errors) { + m := &ColumnsCardsItemMoves403Error_errors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsCardsItemMoves403Error_errorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemMoves403Error_errorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemMoves403Error_errors(), 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 *ColumnsCardsItemMoves403Error_errors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *ColumnsCardsItemMoves403Error_errors) GetCode()(*string) { + return m.code +} +// GetField gets the field property value. The field property +// returns a *string when successful +func (m *ColumnsCardsItemMoves403Error_errors) GetField()(*string) { + return m.field +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemMoves403Error_errors) 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["field"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetField(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 + } + res["resource"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResource(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ColumnsCardsItemMoves403Error_errors) GetMessage()(*string) { + return m.message +} +// GetResource gets the resource property value. The resource property +// returns a *string when successful +func (m *ColumnsCardsItemMoves403Error_errors) GetResource()(*string) { + return m.resource +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemMoves403Error_errors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("field", m.GetField()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resource", m.GetResource()) + 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 *ColumnsCardsItemMoves403Error_errors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *ColumnsCardsItemMoves403Error_errors) SetCode(value *string)() { + m.code = value +} +// SetField sets the field property value. The field property +func (m *ColumnsCardsItemMoves403Error_errors) SetField(value *string)() { + m.field = value +} +// SetMessage sets the message property value. The message property +func (m *ColumnsCardsItemMoves403Error_errors) SetMessage(value *string)() { + m.message = value +} +// SetResource sets the resource property value. The resource property +func (m *ColumnsCardsItemMoves403Error_errors) SetResource(value *string)() { + m.resource = value +} +type ColumnsCardsItemMoves403Error_errorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetField()(*string) + GetMessage()(*string) + GetResource()(*string) + SetCode(value *string)() + SetField(value *string)() + SetMessage(value *string)() + SetResource(value *string)() +} diff --git a/pkg/github/projects/columns_cards_item_moves503_error.go b/pkg/github/projects/columns_cards_item_moves503_error.go new file mode 100644 index 00000000..e8e956b1 --- /dev/null +++ b/pkg/github/projects/columns_cards_item_moves503_error.go @@ -0,0 +1,187 @@ +package projects + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemMoves503Error 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 errors property + errors []ColumnsCardsItemMoves503Error_errorsable + // The message property + message *string +} +// NewColumnsCardsItemMoves503Error instantiates a new ColumnsCardsItemMoves503Error and sets the default values. +func NewColumnsCardsItemMoves503Error()(*ColumnsCardsItemMoves503Error) { + m := &ColumnsCardsItemMoves503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsCardsItemMoves503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemMoves503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemMoves503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ColumnsCardsItemMoves503Error) 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 *ColumnsCardsItemMoves503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *ColumnsCardsItemMoves503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ColumnsCardsItemMoves503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []ColumnsCardsItemMoves503Error_errorsable when successful +func (m *ColumnsCardsItemMoves503Error) GetErrors()([]ColumnsCardsItemMoves503Error_errorsable) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemMoves503Error) 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["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateColumnsCardsItemMoves503Error_errorsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ColumnsCardsItemMoves503Error_errorsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ColumnsCardsItemMoves503Error_errorsable) + } + } + m.SetErrors(res) + } + 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 *ColumnsCardsItemMoves503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemMoves503Error) 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 + } + } + if m.GetErrors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetErrors())) + for i, v := range m.GetErrors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("errors", cast) + 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 *ColumnsCardsItemMoves503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *ColumnsCardsItemMoves503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ColumnsCardsItemMoves503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ColumnsCardsItemMoves503Error) SetErrors(value []ColumnsCardsItemMoves503Error_errorsable)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ColumnsCardsItemMoves503Error) SetMessage(value *string)() { + m.message = value +} +type ColumnsCardsItemMoves503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetErrors()([]ColumnsCardsItemMoves503Error_errorsable) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetErrors(value []ColumnsCardsItemMoves503Error_errorsable)() + SetMessage(value *string)() +} diff --git a/pkg/github/projects/columns_cards_item_moves503_error_escaped_errors.go b/pkg/github/projects/columns_cards_item_moves503_error_escaped_errors.go new file mode 100644 index 00000000..fde626e4 --- /dev/null +++ b/pkg/github/projects/columns_cards_item_moves503_error_escaped_errors.go @@ -0,0 +1,109 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemMoves503Error_errors 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 code property + code *string + // The message property + message *string +} +// NewColumnsCardsItemMoves503Error_errors instantiates a new ColumnsCardsItemMoves503Error_errors and sets the default values. +func NewColumnsCardsItemMoves503Error_errors()(*ColumnsCardsItemMoves503Error_errors) { + m := &ColumnsCardsItemMoves503Error_errors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsCardsItemMoves503Error_errorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemMoves503Error_errorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemMoves503Error_errors(), 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 *ColumnsCardsItemMoves503Error_errors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *ColumnsCardsItemMoves503Error_errors) GetCode()(*string) { + return m.code +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemMoves503Error_errors) 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["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 *ColumnsCardsItemMoves503Error_errors) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemMoves503Error_errors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + 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 *ColumnsCardsItemMoves503Error_errors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *ColumnsCardsItemMoves503Error_errors) SetCode(value *string)() { + m.code = value +} +// SetMessage sets the message property value. The message property +func (m *ColumnsCardsItemMoves503Error_errors) SetMessage(value *string)() { + m.message = value +} +type ColumnsCardsItemMoves503Error_errorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetMessage(value *string)() +} diff --git a/pkg/github/projects/columns_cards_item_moves_post_request_body.go b/pkg/github/projects/columns_cards_item_moves_post_request_body.go new file mode 100644 index 00000000..5d29836c --- /dev/null +++ b/pkg/github/projects/columns_cards_item_moves_post_request_body.go @@ -0,0 +1,109 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemMovesPostRequestBody 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 unique identifier of the column the card should be moved to + column_id *int32 + // The position of the card in a column. Can be one of: `top`, `bottom`, or `after:` to place after the specified card. + position *string +} +// NewColumnsCardsItemMovesPostRequestBody instantiates a new ColumnsCardsItemMovesPostRequestBody and sets the default values. +func NewColumnsCardsItemMovesPostRequestBody()(*ColumnsCardsItemMovesPostRequestBody) { + m := &ColumnsCardsItemMovesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsCardsItemMovesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemMovesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemMovesPostRequestBody(), 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 *ColumnsCardsItemMovesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColumnId gets the column_id property value. The unique identifier of the column the card should be moved to +// returns a *int32 when successful +func (m *ColumnsCardsItemMovesPostRequestBody) GetColumnId()(*int32) { + return m.column_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemMovesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["column_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetColumnId(val) + } + return nil + } + res["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + return res +} +// GetPosition gets the position property value. The position of the card in a column. Can be one of: `top`, `bottom`, or `after:` to place after the specified card. +// returns a *string when successful +func (m *ColumnsCardsItemMovesPostRequestBody) GetPosition()(*string) { + return m.position +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemMovesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("column_id", m.GetColumnId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("position", m.GetPosition()) + 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 *ColumnsCardsItemMovesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColumnId sets the column_id property value. The unique identifier of the column the card should be moved to +func (m *ColumnsCardsItemMovesPostRequestBody) SetColumnId(value *int32)() { + m.column_id = value +} +// SetPosition sets the position property value. The position of the card in a column. Can be one of: `top`, `bottom`, or `after:` to place after the specified card. +func (m *ColumnsCardsItemMovesPostRequestBody) SetPosition(value *string)() { + m.position = value +} +type ColumnsCardsItemMovesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColumnId()(*int32) + GetPosition()(*string) + SetColumnId(value *int32)() + SetPosition(value *string)() +} diff --git a/pkg/github/projects/columns_cards_item_moves_post_response.go b/pkg/github/projects/columns_cards_item_moves_post_response.go new file mode 100644 index 00000000..2e5c6378 --- /dev/null +++ b/pkg/github/projects/columns_cards_item_moves_post_response.go @@ -0,0 +1,32 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemMovesPostResponse struct { +} +// NewColumnsCardsItemMovesPostResponse instantiates a new ColumnsCardsItemMovesPostResponse and sets the default values. +func NewColumnsCardsItemMovesPostResponse()(*ColumnsCardsItemMovesPostResponse) { + m := &ColumnsCardsItemMovesPostResponse{ + } + return m +} +// CreateColumnsCardsItemMovesPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemMovesPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemMovesPostResponse(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemMovesPostResponse) 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 *ColumnsCardsItemMovesPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +type ColumnsCardsItemMovesPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/projects/columns_cards_item_moves_request_builder.go b/pkg/github/projects/columns_cards_item_moves_request_builder.go new file mode 100644 index 00000000..c6943349 --- /dev/null +++ b/pkg/github/projects/columns_cards_item_moves_request_builder.go @@ -0,0 +1,70 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ColumnsCardsItemMovesRequestBuilder builds and executes requests for operations under \projects\columns\cards\{card_id}\moves +type ColumnsCardsItemMovesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewColumnsCardsItemMovesRequestBuilderInternal instantiates a new ColumnsCardsItemMovesRequestBuilder and sets the default values. +func NewColumnsCardsItemMovesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsCardsItemMovesRequestBuilder) { + m := &ColumnsCardsItemMovesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/columns/cards/{card_id}/moves", pathParameters), + } + return m +} +// NewColumnsCardsItemMovesRequestBuilder instantiates a new ColumnsCardsItemMovesRequestBuilder and sets the default values. +func NewColumnsCardsItemMovesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsCardsItemMovesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewColumnsCardsItemMovesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post move a project card +// returns a ColumnsCardsItemMovesPostResponseable when successful +// returns a BasicError error when the service returns a 401 status code +// returns a ColumnsCardsItemMoves403Error error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a ColumnsCardsItemMoves503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/cards#move-a-project-card +func (m *ColumnsCardsItemMovesRequestBuilder) Post(ctx context.Context, body ColumnsCardsItemMovesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ColumnsCardsItemMovesPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": CreateColumnsCardsItemMoves403ErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "503": CreateColumnsCardsItemMoves503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateColumnsCardsItemMovesPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ColumnsCardsItemMovesPostResponseable), nil +} +// returns a *RequestInformation when successful +func (m *ColumnsCardsItemMovesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ColumnsCardsItemMovesPostRequestBodyable, 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 *ColumnsCardsItemMovesRequestBuilder when successful +func (m *ColumnsCardsItemMovesRequestBuilder) WithUrl(rawUrl string)(*ColumnsCardsItemMovesRequestBuilder) { + return NewColumnsCardsItemMovesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/projects/columns_cards_item_with_card_escaped_403_error.go b/pkg/github/projects/columns_cards_item_with_card_escaped_403_error.go new file mode 100644 index 00000000..569b0a03 --- /dev/null +++ b/pkg/github/projects/columns_cards_item_with_card_escaped_403_error.go @@ -0,0 +1,152 @@ +package projects + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemWithCard_403Error 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 documentation_url property + documentation_url *string + // The errors property + errors []string + // The message property + message *string +} +// NewColumnsCardsItemWithCard_403Error instantiates a new ColumnsCardsItemWithCard_403Error and sets the default values. +func NewColumnsCardsItemWithCard_403Error()(*ColumnsCardsItemWithCard_403Error) { + m := &ColumnsCardsItemWithCard_403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsCardsItemWithCard_403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemWithCard_403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemWithCard_403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ColumnsCardsItemWithCard_403Error) 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 *ColumnsCardsItemWithCard_403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ColumnsCardsItemWithCard_403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []string when successful +func (m *ColumnsCardsItemWithCard_403Error) GetErrors()([]string) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemWithCard_403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["errors"] = 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.SetErrors(res) + } + 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 *ColumnsCardsItemWithCard_403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemWithCard_403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + if m.GetErrors() != nil { + err := writer.WriteCollectionOfStringValues("errors", m.GetErrors()) + 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 *ColumnsCardsItemWithCard_403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ColumnsCardsItemWithCard_403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ColumnsCardsItemWithCard_403Error) SetErrors(value []string)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ColumnsCardsItemWithCard_403Error) SetMessage(value *string)() { + m.message = value +} +type ColumnsCardsItemWithCard_403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetErrors()([]string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetErrors(value []string)() + SetMessage(value *string)() +} diff --git a/pkg/github/projects/columns_cards_item_with_card_escaped_patch_request_body.go b/pkg/github/projects/columns_cards_item_with_card_escaped_patch_request_body.go new file mode 100644 index 00000000..d95f1144 --- /dev/null +++ b/pkg/github/projects/columns_cards_item_with_card_escaped_patch_request_body.go @@ -0,0 +1,109 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsCardsItemWithCard_PatchRequestBody 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 or not the card is archived + archived *bool + // The project card's note + note *string +} +// NewColumnsCardsItemWithCard_PatchRequestBody instantiates a new ColumnsCardsItemWithCard_PatchRequestBody and sets the default values. +func NewColumnsCardsItemWithCard_PatchRequestBody()(*ColumnsCardsItemWithCard_PatchRequestBody) { + m := &ColumnsCardsItemWithCard_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsCardsItemWithCard_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsCardsItemWithCard_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsCardsItemWithCard_PatchRequestBody(), 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 *ColumnsCardsItemWithCard_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArchived gets the archived property value. Whether or not the card is archived +// returns a *bool when successful +func (m *ColumnsCardsItemWithCard_PatchRequestBody) GetArchived()(*bool) { + return m.archived +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsCardsItemWithCard_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["note"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNote(val) + } + return nil + } + return res +} +// GetNote gets the note property value. The project card's note +// returns a *string when successful +func (m *ColumnsCardsItemWithCard_PatchRequestBody) GetNote()(*string) { + return m.note +} +// Serialize serializes information the current object +func (m *ColumnsCardsItemWithCard_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("note", m.GetNote()) + 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 *ColumnsCardsItemWithCard_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArchived sets the archived property value. Whether or not the card is archived +func (m *ColumnsCardsItemWithCard_PatchRequestBody) SetArchived(value *bool)() { + m.archived = value +} +// SetNote sets the note property value. The project card's note +func (m *ColumnsCardsItemWithCard_PatchRequestBody) SetNote(value *string)() { + m.note = value +} +type ColumnsCardsItemWithCard_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArchived()(*bool) + GetNote()(*string) + SetArchived(value *bool)() + SetNote(value *string)() +} diff --git a/pkg/github/projects/columns_cards_request_builder.go b/pkg/github/projects/columns_cards_request_builder.go new file mode 100644 index 00000000..c0febb6f --- /dev/null +++ b/pkg/github/projects/columns_cards_request_builder.go @@ -0,0 +1,34 @@ +package projects + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ColumnsCardsRequestBuilder builds and executes requests for operations under \projects\columns\cards +type ColumnsCardsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByCard_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.projects.columns.cards.item collection +// returns a *ColumnsCardsWithCard_ItemRequestBuilder when successful +func (m *ColumnsCardsRequestBuilder) ByCard_id(card_id int32)(*ColumnsCardsWithCard_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["card_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(card_id), 10) + return NewColumnsCardsWithCard_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewColumnsCardsRequestBuilderInternal instantiates a new ColumnsCardsRequestBuilder and sets the default values. +func NewColumnsCardsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsCardsRequestBuilder) { + m := &ColumnsCardsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/columns/cards", pathParameters), + } + return m +} +// NewColumnsCardsRequestBuilder instantiates a new ColumnsCardsRequestBuilder and sets the default values. +func NewColumnsCardsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsCardsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewColumnsCardsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/projects/columns_cards_with_card_escaped_item_request_builder.go b/pkg/github/projects/columns_cards_with_card_escaped_item_request_builder.go new file mode 100644 index 00000000..77e08cb1 --- /dev/null +++ b/pkg/github/projects/columns_cards_with_card_escaped_item_request_builder.go @@ -0,0 +1,141 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ColumnsCardsWithCard_ItemRequestBuilder builds and executes requests for operations under \projects\columns\cards\{card_id} +type ColumnsCardsWithCard_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewColumnsCardsWithCard_ItemRequestBuilderInternal instantiates a new ColumnsCardsWithCard_ItemRequestBuilder and sets the default values. +func NewColumnsCardsWithCard_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsCardsWithCard_ItemRequestBuilder) { + m := &ColumnsCardsWithCard_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/columns/cards/{card_id}", pathParameters), + } + return m +} +// NewColumnsCardsWithCard_ItemRequestBuilder instantiates a new ColumnsCardsWithCard_ItemRequestBuilder and sets the default values. +func NewColumnsCardsWithCard_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsCardsWithCard_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewColumnsCardsWithCard_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a project card +// returns a BasicError error when the service returns a 401 status code +// returns a ColumnsCardsItemWithCard_403Error 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/enterprise-server@3.14/rest/projects/cards#delete-a-project-card +func (m *ColumnsCardsWithCard_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 { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": CreateColumnsCardsItemWithCard_403ErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets information about a project card. +// returns a ProjectCardable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/cards#get-a-project-card +func (m *ColumnsCardsWithCard_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectCardable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectCardFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectCardable), nil +} +// Moves the moves property +// returns a *ColumnsCardsItemMovesRequestBuilder when successful +func (m *ColumnsCardsWithCard_ItemRequestBuilder) Moves()(*ColumnsCardsItemMovesRequestBuilder) { + return NewColumnsCardsItemMovesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch update an existing project card +// returns a ProjectCardable 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 ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/cards#update-an-existing-project-card +func (m *ColumnsCardsWithCard_ItemRequestBuilder) Patch(ctx context.Context, body ColumnsCardsItemWithCard_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectCardable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectCardFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectCardable), nil +} +// ToDeleteRequestInformation deletes a project card +// returns a *RequestInformation when successful +func (m *ColumnsCardsWithCard_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") + return requestInfo, nil +} +// ToGetRequestInformation gets information about a project card. +// returns a *RequestInformation when successful +func (m *ColumnsCardsWithCard_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 +} +// returns a *RequestInformation when successful +func (m *ColumnsCardsWithCard_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ColumnsCardsItemWithCard_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 *ColumnsCardsWithCard_ItemRequestBuilder when successful +func (m *ColumnsCardsWithCard_ItemRequestBuilder) WithUrl(rawUrl string)(*ColumnsCardsWithCard_ItemRequestBuilder) { + return NewColumnsCardsWithCard_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/projects/columns_item_cards_post_request_body_member1.go b/pkg/github/projects/columns_item_cards_post_request_body_member1.go new file mode 100644 index 00000000..75070557 --- /dev/null +++ b/pkg/github/projects/columns_item_cards_post_request_body_member1.go @@ -0,0 +1,80 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsItemCardsPostRequestBodyMember1 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 project card's note + note *string +} +// NewColumnsItemCardsPostRequestBodyMember1 instantiates a new ColumnsItemCardsPostRequestBodyMember1 and sets the default values. +func NewColumnsItemCardsPostRequestBodyMember1()(*ColumnsItemCardsPostRequestBodyMember1) { + m := &ColumnsItemCardsPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsItemCardsPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsItemCardsPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemCardsPostRequestBodyMember1(), 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 *ColumnsItemCardsPostRequestBodyMember1) 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 *ColumnsItemCardsPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["note"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNote(val) + } + return nil + } + return res +} +// GetNote gets the note property value. The project card's note +// returns a *string when successful +func (m *ColumnsItemCardsPostRequestBodyMember1) GetNote()(*string) { + return m.note +} +// Serialize serializes information the current object +func (m *ColumnsItemCardsPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("note", m.GetNote()) + 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 *ColumnsItemCardsPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNote sets the note property value. The project card's note +func (m *ColumnsItemCardsPostRequestBodyMember1) SetNote(value *string)() { + m.note = value +} +type ColumnsItemCardsPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNote()(*string) + SetNote(value *string)() +} diff --git a/pkg/github/projects/columns_item_cards_post_request_body_member2.go b/pkg/github/projects/columns_item_cards_post_request_body_member2.go new file mode 100644 index 00000000..78f5d786 --- /dev/null +++ b/pkg/github/projects/columns_item_cards_post_request_body_member2.go @@ -0,0 +1,109 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsItemCardsPostRequestBodyMember2 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 unique identifier of the content associated with the card + content_id *int32 + // The piece of content associated with the card + content_type *string +} +// NewColumnsItemCardsPostRequestBodyMember2 instantiates a new ColumnsItemCardsPostRequestBodyMember2 and sets the default values. +func NewColumnsItemCardsPostRequestBodyMember2()(*ColumnsItemCardsPostRequestBodyMember2) { + m := &ColumnsItemCardsPostRequestBodyMember2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsItemCardsPostRequestBodyMember2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsItemCardsPostRequestBodyMember2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemCardsPostRequestBodyMember2(), 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 *ColumnsItemCardsPostRequestBodyMember2) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentId gets the content_id property value. The unique identifier of the content associated with the card +// returns a *int32 when successful +func (m *ColumnsItemCardsPostRequestBodyMember2) GetContentId()(*int32) { + return m.content_id +} +// GetContentType gets the content_type property value. The piece of content associated with the card +// returns a *string when successful +func (m *ColumnsItemCardsPostRequestBodyMember2) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsItemCardsPostRequestBodyMember2) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetContentId(val) + } + return nil + } + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ColumnsItemCardsPostRequestBodyMember2) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("content_id", m.GetContentId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + 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 *ColumnsItemCardsPostRequestBodyMember2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentId sets the content_id property value. The unique identifier of the content associated with the card +func (m *ColumnsItemCardsPostRequestBodyMember2) SetContentId(value *int32)() { + m.content_id = value +} +// SetContentType sets the content_type property value. The piece of content associated with the card +func (m *ColumnsItemCardsPostRequestBodyMember2) SetContentType(value *string)() { + m.content_type = value +} +type ColumnsItemCardsPostRequestBodyMember2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentId()(*int32) + GetContentType()(*string) + SetContentId(value *int32)() + SetContentType(value *string)() +} diff --git a/pkg/github/projects/columns_item_cards_project_card503_error.go b/pkg/github/projects/columns_item_cards_project_card503_error.go new file mode 100644 index 00000000..6b7083df --- /dev/null +++ b/pkg/github/projects/columns_item_cards_project_card503_error.go @@ -0,0 +1,187 @@ +package projects + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsItemCardsProjectCard503Error 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 errors property + errors []ColumnsItemCardsProjectCard503Error_errorsable + // The message property + message *string +} +// NewColumnsItemCardsProjectCard503Error instantiates a new ColumnsItemCardsProjectCard503Error and sets the default values. +func NewColumnsItemCardsProjectCard503Error()(*ColumnsItemCardsProjectCard503Error) { + m := &ColumnsItemCardsProjectCard503Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsItemCardsProjectCard503ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsItemCardsProjectCard503ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemCardsProjectCard503Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ColumnsItemCardsProjectCard503Error) 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 *ColumnsItemCardsProjectCard503Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *ColumnsItemCardsProjectCard503Error) GetCode()(*string) { + return m.code +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ColumnsItemCardsProjectCard503Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []ColumnsItemCardsProjectCard503Error_errorsable when successful +func (m *ColumnsItemCardsProjectCard503Error) GetErrors()([]ColumnsItemCardsProjectCard503Error_errorsable) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsItemCardsProjectCard503Error) 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["errors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateColumnsItemCardsProjectCard503Error_errorsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ColumnsItemCardsProjectCard503Error_errorsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ColumnsItemCardsProjectCard503Error_errorsable) + } + } + m.SetErrors(res) + } + 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 *ColumnsItemCardsProjectCard503Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ColumnsItemCardsProjectCard503Error) 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 + } + } + if m.GetErrors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetErrors())) + for i, v := range m.GetErrors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("errors", cast) + 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 *ColumnsItemCardsProjectCard503Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *ColumnsItemCardsProjectCard503Error) SetCode(value *string)() { + m.code = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ColumnsItemCardsProjectCard503Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ColumnsItemCardsProjectCard503Error) SetErrors(value []ColumnsItemCardsProjectCard503Error_errorsable)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ColumnsItemCardsProjectCard503Error) SetMessage(value *string)() { + m.message = value +} +type ColumnsItemCardsProjectCard503Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetDocumentationUrl()(*string) + GetErrors()([]ColumnsItemCardsProjectCard503Error_errorsable) + GetMessage()(*string) + SetCode(value *string)() + SetDocumentationUrl(value *string)() + SetErrors(value []ColumnsItemCardsProjectCard503Error_errorsable)() + SetMessage(value *string)() +} diff --git a/pkg/github/projects/columns_item_cards_project_card503_error_escaped_errors.go b/pkg/github/projects/columns_item_cards_project_card503_error_escaped_errors.go new file mode 100644 index 00000000..e0e18865 --- /dev/null +++ b/pkg/github/projects/columns_item_cards_project_card503_error_escaped_errors.go @@ -0,0 +1,109 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsItemCardsProjectCard503Error_errors 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 code property + code *string + // The message property + message *string +} +// NewColumnsItemCardsProjectCard503Error_errors instantiates a new ColumnsItemCardsProjectCard503Error_errors and sets the default values. +func NewColumnsItemCardsProjectCard503Error_errors()(*ColumnsItemCardsProjectCard503Error_errors) { + m := &ColumnsItemCardsProjectCard503Error_errors{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsItemCardsProjectCard503Error_errorsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsItemCardsProjectCard503Error_errorsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemCardsProjectCard503Error_errors(), 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 *ColumnsItemCardsProjectCard503Error_errors) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCode gets the code property value. The code property +// returns a *string when successful +func (m *ColumnsItemCardsProjectCard503Error_errors) GetCode()(*string) { + return m.code +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsItemCardsProjectCard503Error_errors) 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["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 *ColumnsItemCardsProjectCard503Error_errors) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ColumnsItemCardsProjectCard503Error_errors) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("code", m.GetCode()) + 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 *ColumnsItemCardsProjectCard503Error_errors) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCode sets the code property value. The code property +func (m *ColumnsItemCardsProjectCard503Error_errors) SetCode(value *string)() { + m.code = value +} +// SetMessage sets the message property value. The message property +func (m *ColumnsItemCardsProjectCard503Error_errors) SetMessage(value *string)() { + m.message = value +} +type ColumnsItemCardsProjectCard503Error_errorsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCode()(*string) + GetMessage()(*string) + SetCode(value *string)() + SetMessage(value *string)() +} diff --git a/pkg/github/projects/columns_item_cards_request_builder.go b/pkg/github/projects/columns_item_cards_request_builder.go new file mode 100644 index 00000000..7df2be95 --- /dev/null +++ b/pkg/github/projects/columns_item_cards_request_builder.go @@ -0,0 +1,234 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i08da0c53b72492e2f5e6fbf28989af08fb10cadb406714cdeb825125f9cdeaff "github.com/octokit/go-sdk-enterprise-server/pkg/github/projects/columns/item/cards" +) + +// ColumnsItemCardsRequestBuilder builds and executes requests for operations under \projects\columns\{column_id}\cards +type ColumnsItemCardsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// CardsPostRequestBody composed type wrapper for classes ColumnsItemCardsPostRequestBodyMember1able, ColumnsItemCardsPostRequestBodyMember2able +type CardsPostRequestBody struct { + // Composed type representation for type ColumnsItemCardsPostRequestBodyMember1able + cardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1 ColumnsItemCardsPostRequestBodyMember1able + // Composed type representation for type ColumnsItemCardsPostRequestBodyMember2able + cardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2 ColumnsItemCardsPostRequestBodyMember2able + // Composed type representation for type ColumnsItemCardsPostRequestBodyMember1able + columnsItemCardsPostRequestBodyMember1 ColumnsItemCardsPostRequestBodyMember1able + // Composed type representation for type ColumnsItemCardsPostRequestBodyMember2able + columnsItemCardsPostRequestBodyMember2 ColumnsItemCardsPostRequestBodyMember2able +} +// NewCardsPostRequestBody instantiates a new CardsPostRequestBody and sets the default values. +func NewCardsPostRequestBody()(*CardsPostRequestBody) { + m := &CardsPostRequestBody{ + } + return m +} +// CreateCardsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCardsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewCardsPostRequestBody() + 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 { + } + } + } + return result, nil +} +// GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1 gets the ColumnsItemCardsPostRequestBodyMember1 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember1able +// returns a ColumnsItemCardsPostRequestBodyMember1able when successful +func (m *CardsPostRequestBody) GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1()(ColumnsItemCardsPostRequestBodyMember1able) { + return m.cardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1 +} +// GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2 gets the ColumnsItemCardsPostRequestBodyMember2 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember2able +// returns a ColumnsItemCardsPostRequestBodyMember2able when successful +func (m *CardsPostRequestBody) GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2()(ColumnsItemCardsPostRequestBodyMember2able) { + return m.cardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2 +} +// GetColumnsItemCardsPostRequestBodyMember1 gets the ColumnsItemCardsPostRequestBodyMember1 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember1able +// returns a ColumnsItemCardsPostRequestBodyMember1able when successful +func (m *CardsPostRequestBody) GetColumnsItemCardsPostRequestBodyMember1()(ColumnsItemCardsPostRequestBodyMember1able) { + return m.columnsItemCardsPostRequestBodyMember1 +} +// GetColumnsItemCardsPostRequestBodyMember2 gets the ColumnsItemCardsPostRequestBodyMember2 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember2able +// returns a ColumnsItemCardsPostRequestBodyMember2able when successful +func (m *CardsPostRequestBody) GetColumnsItemCardsPostRequestBodyMember2()(ColumnsItemCardsPostRequestBodyMember2able) { + return m.columnsItemCardsPostRequestBodyMember2 +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CardsPostRequestBody) 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 *CardsPostRequestBody) GetIsComposedType()(bool) { + return true +} +// Serialize serializes information the current object +func (m *CardsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetColumnsItemCardsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetColumnsItemCardsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetColumnsItemCardsPostRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetColumnsItemCardsPostRequestBodyMember2()) + if err != nil { + return err + } + } + return nil +} +// SetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1 sets the ColumnsItemCardsPostRequestBodyMember1 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember1able +func (m *CardsPostRequestBody) SetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1(value ColumnsItemCardsPostRequestBodyMember1able)() { + m.cardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1 = value +} +// SetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2 sets the ColumnsItemCardsPostRequestBodyMember2 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember2able +func (m *CardsPostRequestBody) SetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2(value ColumnsItemCardsPostRequestBodyMember2able)() { + m.cardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2 = value +} +// SetColumnsItemCardsPostRequestBodyMember1 sets the ColumnsItemCardsPostRequestBodyMember1 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember1able +func (m *CardsPostRequestBody) SetColumnsItemCardsPostRequestBodyMember1(value ColumnsItemCardsPostRequestBodyMember1able)() { + m.columnsItemCardsPostRequestBodyMember1 = value +} +// SetColumnsItemCardsPostRequestBodyMember2 sets the ColumnsItemCardsPostRequestBodyMember2 property value. Composed type representation for type ColumnsItemCardsPostRequestBodyMember2able +func (m *CardsPostRequestBody) SetColumnsItemCardsPostRequestBodyMember2(value ColumnsItemCardsPostRequestBodyMember2able)() { + m.columnsItemCardsPostRequestBodyMember2 = value +} +// ColumnsItemCardsRequestBuilderGetQueryParameters lists the project cards in a project. +type ColumnsItemCardsRequestBuilderGetQueryParameters struct { + // Filters the project cards that are returned by the card's state. + Archived_state *i08da0c53b72492e2f5e6fbf28989af08fb10cadb406714cdeb825125f9cdeaff.GetArchived_stateQueryParameterType `uriparametername:"archived_state"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +type CardsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1()(ColumnsItemCardsPostRequestBodyMember1able) + GetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2()(ColumnsItemCardsPostRequestBodyMember2able) + GetColumnsItemCardsPostRequestBodyMember1()(ColumnsItemCardsPostRequestBodyMember1able) + GetColumnsItemCardsPostRequestBodyMember2()(ColumnsItemCardsPostRequestBodyMember2able) + SetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember1(value ColumnsItemCardsPostRequestBodyMember1able)() + SetCardsPostRequestBodyColumnsItemCardsPostRequestBodyMember2(value ColumnsItemCardsPostRequestBodyMember2able)() + SetColumnsItemCardsPostRequestBodyMember1(value ColumnsItemCardsPostRequestBodyMember1able)() + SetColumnsItemCardsPostRequestBodyMember2(value ColumnsItemCardsPostRequestBodyMember2able)() +} +// NewColumnsItemCardsRequestBuilderInternal instantiates a new ColumnsItemCardsRequestBuilder and sets the default values. +func NewColumnsItemCardsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsItemCardsRequestBuilder) { + m := &ColumnsItemCardsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/columns/{column_id}/cards{?archived_state*,page*,per_page*}", pathParameters), + } + return m +} +// NewColumnsItemCardsRequestBuilder instantiates a new ColumnsItemCardsRequestBuilder and sets the default values. +func NewColumnsItemCardsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsItemCardsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewColumnsItemCardsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the project cards in a project. +// returns a []ProjectCardable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/cards#list-project-cards +func (m *ColumnsItemCardsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ColumnsItemCardsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectCardable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectCardFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectCardable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectCardable) + } + } + return val, nil +} +// Post create a project card +// returns a ProjectCardable 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 ColumnsItemCardsProjectCard503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/cards#create-a-project-card +func (m *ColumnsItemCardsRequestBuilder) Post(ctx context.Context, body CardsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectCardable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": CreateColumnsItemCardsProjectCard503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectCardFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectCardable), nil +} +// ToGetRequestInformation lists the project cards in a project. +// returns a *RequestInformation when successful +func (m *ColumnsItemCardsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ColumnsItemCardsRequestBuilderGetQueryParameters])(*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 +} +// returns a *RequestInformation when successful +func (m *ColumnsItemCardsRequestBuilder) ToPostRequestInformation(ctx context.Context, body CardsPostRequestBodyable, 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 *ColumnsItemCardsRequestBuilder when successful +func (m *ColumnsItemCardsRequestBuilder) WithUrl(rawUrl string)(*ColumnsItemCardsRequestBuilder) { + return NewColumnsItemCardsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/projects/columns_item_moves_post_request_body.go b/pkg/github/projects/columns_item_moves_post_request_body.go new file mode 100644 index 00000000..ec742605 --- /dev/null +++ b/pkg/github/projects/columns_item_moves_post_request_body.go @@ -0,0 +1,80 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsItemMovesPostRequestBody 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 position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. + position *string +} +// NewColumnsItemMovesPostRequestBody instantiates a new ColumnsItemMovesPostRequestBody and sets the default values. +func NewColumnsItemMovesPostRequestBody()(*ColumnsItemMovesPostRequestBody) { + m := &ColumnsItemMovesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsItemMovesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsItemMovesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemMovesPostRequestBody(), 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 *ColumnsItemMovesPostRequestBody) 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 *ColumnsItemMovesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + return res +} +// GetPosition gets the position property value. The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. +// returns a *string when successful +func (m *ColumnsItemMovesPostRequestBody) GetPosition()(*string) { + return m.position +} +// Serialize serializes information the current object +func (m *ColumnsItemMovesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("position", m.GetPosition()) + 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 *ColumnsItemMovesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPosition sets the position property value. The position of the column in a project. Can be one of: `first`, `last`, or `after:` to place after the specified column. +func (m *ColumnsItemMovesPostRequestBody) SetPosition(value *string)() { + m.position = value +} +type ColumnsItemMovesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPosition()(*string) + SetPosition(value *string)() +} diff --git a/pkg/github/projects/columns_item_moves_post_response.go b/pkg/github/projects/columns_item_moves_post_response.go new file mode 100644 index 00000000..62f06636 --- /dev/null +++ b/pkg/github/projects/columns_item_moves_post_response.go @@ -0,0 +1,32 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsItemMovesPostResponse struct { +} +// NewColumnsItemMovesPostResponse instantiates a new ColumnsItemMovesPostResponse and sets the default values. +func NewColumnsItemMovesPostResponse()(*ColumnsItemMovesPostResponse) { + m := &ColumnsItemMovesPostResponse{ + } + return m +} +// CreateColumnsItemMovesPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsItemMovesPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemMovesPostResponse(), nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ColumnsItemMovesPostResponse) 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 *ColumnsItemMovesPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + return nil +} +type ColumnsItemMovesPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/projects/columns_item_moves_request_builder.go b/pkg/github/projects/columns_item_moves_request_builder.go new file mode 100644 index 00000000..52c61526 --- /dev/null +++ b/pkg/github/projects/columns_item_moves_request_builder.go @@ -0,0 +1,68 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ColumnsItemMovesRequestBuilder builds and executes requests for operations under \projects\columns\{column_id}\moves +type ColumnsItemMovesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewColumnsItemMovesRequestBuilderInternal instantiates a new ColumnsItemMovesRequestBuilder and sets the default values. +func NewColumnsItemMovesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsItemMovesRequestBuilder) { + m := &ColumnsItemMovesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/columns/{column_id}/moves", pathParameters), + } + return m +} +// NewColumnsItemMovesRequestBuilder instantiates a new ColumnsItemMovesRequestBuilder and sets the default values. +func NewColumnsItemMovesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsItemMovesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewColumnsItemMovesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post move a project column +// returns a ColumnsItemMovesPostResponseable 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 ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/columns#move-a-project-column +func (m *ColumnsItemMovesRequestBuilder) Post(ctx context.Context, body ColumnsItemMovesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ColumnsItemMovesPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateColumnsItemMovesPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ColumnsItemMovesPostResponseable), nil +} +// returns a *RequestInformation when successful +func (m *ColumnsItemMovesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ColumnsItemMovesPostRequestBodyable, 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 *ColumnsItemMovesRequestBuilder when successful +func (m *ColumnsItemMovesRequestBuilder) WithUrl(rawUrl string)(*ColumnsItemMovesRequestBuilder) { + return NewColumnsItemMovesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/projects/columns_item_with_column_escaped_patch_request_body.go b/pkg/github/projects/columns_item_with_column_escaped_patch_request_body.go new file mode 100644 index 00000000..ebd123d2 --- /dev/null +++ b/pkg/github/projects/columns_item_with_column_escaped_patch_request_body.go @@ -0,0 +1,80 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ColumnsItemWithColumn_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Name of the project column + name *string +} +// NewColumnsItemWithColumn_PatchRequestBody instantiates a new ColumnsItemWithColumn_PatchRequestBody and sets the default values. +func NewColumnsItemWithColumn_PatchRequestBody()(*ColumnsItemWithColumn_PatchRequestBody) { + m := &ColumnsItemWithColumn_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateColumnsItemWithColumn_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateColumnsItemWithColumn_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewColumnsItemWithColumn_PatchRequestBody(), 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 *ColumnsItemWithColumn_PatchRequestBody) 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 *ColumnsItemWithColumn_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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. Name of the project column +// returns a *string when successful +func (m *ColumnsItemWithColumn_PatchRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ColumnsItemWithColumn_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ColumnsItemWithColumn_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. Name of the project column +func (m *ColumnsItemWithColumn_PatchRequestBody) SetName(value *string)() { + m.name = value +} +type ColumnsItemWithColumn_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + SetName(value *string)() +} diff --git a/pkg/github/projects/columns_request_builder.go b/pkg/github/projects/columns_request_builder.go new file mode 100644 index 00000000..cbdf1fe4 --- /dev/null +++ b/pkg/github/projects/columns_request_builder.go @@ -0,0 +1,39 @@ +package projects + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ColumnsRequestBuilder builds and executes requests for operations under \projects\columns +type ColumnsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByColumn_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.projects.columns.item collection +// returns a *ColumnsWithColumn_ItemRequestBuilder when successful +func (m *ColumnsRequestBuilder) ByColumn_id(column_id int32)(*ColumnsWithColumn_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["column_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(column_id), 10) + return NewColumnsWithColumn_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// Cards the cards property +// returns a *ColumnsCardsRequestBuilder when successful +func (m *ColumnsRequestBuilder) Cards()(*ColumnsCardsRequestBuilder) { + return NewColumnsCardsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewColumnsRequestBuilderInternal instantiates a new ColumnsRequestBuilder and sets the default values. +func NewColumnsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsRequestBuilder) { + m := &ColumnsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/columns", pathParameters), + } + return m +} +// NewColumnsRequestBuilder instantiates a new ColumnsRequestBuilder and sets the default values. +func NewColumnsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewColumnsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/projects/columns_with_column_escaped_item_request_builder.go b/pkg/github/projects/columns_with_column_escaped_item_request_builder.go new file mode 100644 index 00000000..7c213f96 --- /dev/null +++ b/pkg/github/projects/columns_with_column_escaped_item_request_builder.go @@ -0,0 +1,140 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ColumnsWithColumn_ItemRequestBuilder builds and executes requests for operations under \projects\columns\{column_id} +type ColumnsWithColumn_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Cards the cards property +// returns a *ColumnsItemCardsRequestBuilder when successful +func (m *ColumnsWithColumn_ItemRequestBuilder) Cards()(*ColumnsItemCardsRequestBuilder) { + return NewColumnsItemCardsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewColumnsWithColumn_ItemRequestBuilderInternal instantiates a new ColumnsWithColumn_ItemRequestBuilder and sets the default values. +func NewColumnsWithColumn_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsWithColumn_ItemRequestBuilder) { + m := &ColumnsWithColumn_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/columns/{column_id}", pathParameters), + } + return m +} +// NewColumnsWithColumn_ItemRequestBuilder instantiates a new ColumnsWithColumn_ItemRequestBuilder and sets the default values. +func NewColumnsWithColumn_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ColumnsWithColumn_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewColumnsWithColumn_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a project column. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/columns#delete-a-project-column +func (m *ColumnsWithColumn_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 { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets information about a project column. +// returns a ProjectColumnable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/columns#get-a-project-column +func (m *ColumnsWithColumn_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectColumnable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectColumnFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectColumnable), nil +} +// Moves the moves property +// returns a *ColumnsItemMovesRequestBuilder when successful +func (m *ColumnsWithColumn_ItemRequestBuilder) Moves()(*ColumnsItemMovesRequestBuilder) { + return NewColumnsItemMovesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch update an existing project column +// returns a ProjectColumnable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/columns#update-an-existing-project-column +func (m *ColumnsWithColumn_ItemRequestBuilder) Patch(ctx context.Context, body ColumnsItemWithColumn_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectColumnable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectColumnFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectColumnable), nil +} +// ToDeleteRequestInformation deletes a project column. +// returns a *RequestInformation when successful +func (m *ColumnsWithColumn_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") + return requestInfo, nil +} +// ToGetRequestInformation gets information about a project column. +// returns a *RequestInformation when successful +func (m *ColumnsWithColumn_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 +} +// returns a *RequestInformation when successful +func (m *ColumnsWithColumn_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ColumnsItemWithColumn_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 *ColumnsWithColumn_ItemRequestBuilder when successful +func (m *ColumnsWithColumn_ItemRequestBuilder) WithUrl(rawUrl string)(*ColumnsWithColumn_ItemRequestBuilder) { + return NewColumnsWithColumn_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/projects/item/collaborators/get_affiliation_query_parameter_type.go b/pkg/github/projects/item/collaborators/get_affiliation_query_parameter_type.go new file mode 100644 index 00000000..b4840b8d --- /dev/null +++ b/pkg/github/projects/item/collaborators/get_affiliation_query_parameter_type.go @@ -0,0 +1,36 @@ +package collaborators +type GetAffiliationQueryParameterType int + +const ( + OUTSIDE_GETAFFILIATIONQUERYPARAMETERTYPE GetAffiliationQueryParameterType = iota + DIRECT_GETAFFILIATIONQUERYPARAMETERTYPE + ALL_GETAFFILIATIONQUERYPARAMETERTYPE +) + +func (i GetAffiliationQueryParameterType) String() string { + return []string{"outside", "direct", "all"}[i] +} +func ParseGetAffiliationQueryParameterType(v string) (any, error) { + result := OUTSIDE_GETAFFILIATIONQUERYPARAMETERTYPE + switch v { + case "outside": + result = OUTSIDE_GETAFFILIATIONQUERYPARAMETERTYPE + case "direct": + result = DIRECT_GETAFFILIATIONQUERYPARAMETERTYPE + case "all": + result = ALL_GETAFFILIATIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetAffiliationQueryParameterType(values []GetAffiliationQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetAffiliationQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/projects/item/collaborators/item/with_username_put_request_body_escaped_permission.go b/pkg/github/projects/item/collaborators/item/with_username_put_request_body_escaped_permission.go new file mode 100644 index 00000000..e9c5ff5a --- /dev/null +++ b/pkg/github/projects/item/collaborators/item/with_username_put_request_body_escaped_permission.go @@ -0,0 +1,37 @@ +package item +// The permission to grant the collaborator. +type WithUsernamePutRequestBody_permission int + +const ( + READ_WITHUSERNAMEPUTREQUESTBODY_PERMISSION WithUsernamePutRequestBody_permission = iota + WRITE_WITHUSERNAMEPUTREQUESTBODY_PERMISSION + ADMIN_WITHUSERNAMEPUTREQUESTBODY_PERMISSION +) + +func (i WithUsernamePutRequestBody_permission) String() string { + return []string{"read", "write", "admin"}[i] +} +func ParseWithUsernamePutRequestBody_permission(v string) (any, error) { + result := READ_WITHUSERNAMEPUTREQUESTBODY_PERMISSION + switch v { + case "read": + result = READ_WITHUSERNAMEPUTREQUESTBODY_PERMISSION + case "write": + result = WRITE_WITHUSERNAMEPUTREQUESTBODY_PERMISSION + case "admin": + result = ADMIN_WITHUSERNAMEPUTREQUESTBODY_PERMISSION + default: + return nil, nil + } + return &result, nil +} +func SerializeWithUsernamePutRequestBody_permission(values []WithUsernamePutRequestBody_permission) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithUsernamePutRequestBody_permission) isMultiValue() bool { + return false +} diff --git a/pkg/github/projects/item/with_project_escaped_patch_request_body_escaped_organization_escaped_permission.go b/pkg/github/projects/item/with_project_escaped_patch_request_body_escaped_organization_escaped_permission.go new file mode 100644 index 00000000..27c80d6d --- /dev/null +++ b/pkg/github/projects/item/with_project_escaped_patch_request_body_escaped_organization_escaped_permission.go @@ -0,0 +1,40 @@ +package item +// The baseline permission that all organization members have on this project +type WithProject_PatchRequestBody_organization_permission int + +const ( + READ_WITHPROJECT_PATCHREQUESTBODY_ORGANIZATION_PERMISSION WithProject_PatchRequestBody_organization_permission = iota + WRITE_WITHPROJECT_PATCHREQUESTBODY_ORGANIZATION_PERMISSION + ADMIN_WITHPROJECT_PATCHREQUESTBODY_ORGANIZATION_PERMISSION + NONE_WITHPROJECT_PATCHREQUESTBODY_ORGANIZATION_PERMISSION +) + +func (i WithProject_PatchRequestBody_organization_permission) String() string { + return []string{"read", "write", "admin", "none"}[i] +} +func ParseWithProject_PatchRequestBody_organization_permission(v string) (any, error) { + result := READ_WITHPROJECT_PATCHREQUESTBODY_ORGANIZATION_PERMISSION + switch v { + case "read": + result = READ_WITHPROJECT_PATCHREQUESTBODY_ORGANIZATION_PERMISSION + case "write": + result = WRITE_WITHPROJECT_PATCHREQUESTBODY_ORGANIZATION_PERMISSION + case "admin": + result = ADMIN_WITHPROJECT_PATCHREQUESTBODY_ORGANIZATION_PERMISSION + case "none": + result = NONE_WITHPROJECT_PATCHREQUESTBODY_ORGANIZATION_PERMISSION + default: + return nil, nil + } + return &result, nil +} +func SerializeWithProject_PatchRequestBody_organization_permission(values []WithProject_PatchRequestBody_organization_permission) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithProject_PatchRequestBody_organization_permission) isMultiValue() bool { + return false +} diff --git a/pkg/github/projects/item_collaborators_item_permission_request_builder.go b/pkg/github/projects/item_collaborators_item_permission_request_builder.go new file mode 100644 index 00000000..a7e1d224 --- /dev/null +++ b/pkg/github/projects/item_collaborators_item_permission_request_builder.go @@ -0,0 +1,67 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemCollaboratorsItemPermissionRequestBuilder builds and executes requests for operations under \projects\{project_id}\collaborators\{username}\permission +type ItemCollaboratorsItemPermissionRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCollaboratorsItemPermissionRequestBuilderInternal instantiates a new ItemCollaboratorsItemPermissionRequestBuilder and sets the default values. +func NewItemCollaboratorsItemPermissionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCollaboratorsItemPermissionRequestBuilder) { + m := &ItemCollaboratorsItemPermissionRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/{project_id}/collaborators/{username}/permission", pathParameters), + } + return m +} +// NewItemCollaboratorsItemPermissionRequestBuilder instantiates a new ItemCollaboratorsItemPermissionRequestBuilder and sets the default values. +func NewItemCollaboratorsItemPermissionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCollaboratorsItemPermissionRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCollaboratorsItemPermissionRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level. +// returns a ProjectCollaboratorPermissionable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/collaborators#get-project-permission-for-a-user +func (m *ItemCollaboratorsItemPermissionRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectCollaboratorPermissionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectCollaboratorPermissionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectCollaboratorPermissionable), nil +} +// ToGetRequestInformation returns the collaborator's permission level for an organization project. Possible values for the `permission` key: `admin`, `write`, `read`, `none`. You must be an organization owner or a project `admin` to review a user's permission level. +// returns a *RequestInformation when successful +func (m *ItemCollaboratorsItemPermissionRequestBuilder) 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 *ItemCollaboratorsItemPermissionRequestBuilder when successful +func (m *ItemCollaboratorsItemPermissionRequestBuilder) WithUrl(rawUrl string)(*ItemCollaboratorsItemPermissionRequestBuilder) { + return NewItemCollaboratorsItemPermissionRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/projects/item_collaborators_item_with_username_put_request_body.go b/pkg/github/projects/item_collaborators_item_with_username_put_request_body.go new file mode 100644 index 00000000..52163f61 --- /dev/null +++ b/pkg/github/projects/item_collaborators_item_with_username_put_request_body.go @@ -0,0 +1,51 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemCollaboratorsItemWithUsernamePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemCollaboratorsItemWithUsernamePutRequestBody instantiates a new ItemCollaboratorsItemWithUsernamePutRequestBody and sets the default values. +func NewItemCollaboratorsItemWithUsernamePutRequestBody()(*ItemCollaboratorsItemWithUsernamePutRequestBody) { + m := &ItemCollaboratorsItemWithUsernamePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemCollaboratorsItemWithUsernamePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemCollaboratorsItemWithUsernamePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemCollaboratorsItemWithUsernamePutRequestBody(), 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 *ItemCollaboratorsItemWithUsernamePutRequestBody) 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 *ItemCollaboratorsItemWithUsernamePutRequestBody) 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 *ItemCollaboratorsItemWithUsernamePutRequestBody) 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 *ItemCollaboratorsItemWithUsernamePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemCollaboratorsItemWithUsernamePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/projects/item_collaborators_request_builder.go b/pkg/github/projects/item_collaborators_request_builder.go new file mode 100644 index 00000000..acce2651 --- /dev/null +++ b/pkg/github/projects/item_collaborators_request_builder.go @@ -0,0 +1,92 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ib1fe385fd8da2d50ecb088338f0cc2de21dd0ebdc643d14bbcff13e8bf00d9ef "github.com/octokit/go-sdk-enterprise-server/pkg/github/projects/item/collaborators" +) + +// ItemCollaboratorsRequestBuilder builds and executes requests for operations under \projects\{project_id}\collaborators +type ItemCollaboratorsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemCollaboratorsRequestBuilderGetQueryParameters lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators. +type ItemCollaboratorsRequestBuilderGetQueryParameters struct { + // Filters the collaborators by their affiliation. `outside` means outside collaborators of a project that are not a member of the project's organization. `direct` means collaborators with permissions to a project, regardless of organization membership status. `all` means all collaborators the authenticated user can see. + Affiliation *ib1fe385fd8da2d50ecb088338f0cc2de21dd0ebdc643d14bbcff13e8bf00d9ef.GetAffiliationQueryParameterType `uriparametername:"affiliation"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.projects.item.collaborators.item collection +// returns a *ItemCollaboratorsWithUsernameItemRequestBuilder when successful +func (m *ItemCollaboratorsRequestBuilder) ByUsername(username string)(*ItemCollaboratorsWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemCollaboratorsWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemCollaboratorsRequestBuilderInternal instantiates a new ItemCollaboratorsRequestBuilder and sets the default values. +func NewItemCollaboratorsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCollaboratorsRequestBuilder) { + m := &ItemCollaboratorsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/{project_id}/collaborators{?affiliation*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemCollaboratorsRequestBuilder instantiates a new ItemCollaboratorsRequestBuilder and sets the default values. +func NewItemCollaboratorsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCollaboratorsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCollaboratorsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators. +// returns a []SimpleUserable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/collaborators#list-project-collaborators +func (m *ItemCollaboratorsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCollaboratorsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists the collaborators for an organization project. For a project, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners. You must be an organization owner or a project `admin` to list collaborators. +// returns a *RequestInformation when successful +func (m *ItemCollaboratorsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemCollaboratorsRequestBuilderGetQueryParameters])(*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 *ItemCollaboratorsRequestBuilder when successful +func (m *ItemCollaboratorsRequestBuilder) WithUrl(rawUrl string)(*ItemCollaboratorsRequestBuilder) { + return NewItemCollaboratorsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/projects/item_collaborators_with_username_item_request_builder.go b/pkg/github/projects/item_collaborators_with_username_item_request_builder.go new file mode 100644 index 00000000..25df6164 --- /dev/null +++ b/pkg/github/projects/item_collaborators_with_username_item_request_builder.go @@ -0,0 +1,105 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemCollaboratorsWithUsernameItemRequestBuilder builds and executes requests for operations under \projects\{project_id}\collaborators\{username} +type ItemCollaboratorsWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemCollaboratorsWithUsernameItemRequestBuilderInternal instantiates a new ItemCollaboratorsWithUsernameItemRequestBuilder and sets the default values. +func NewItemCollaboratorsWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCollaboratorsWithUsernameItemRequestBuilder) { + m := &ItemCollaboratorsWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/{project_id}/collaborators/{username}", pathParameters), + } + return m +} +// NewItemCollaboratorsWithUsernameItemRequestBuilder instantiates a new ItemCollaboratorsWithUsernameItemRequestBuilder and sets the default values. +func NewItemCollaboratorsWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemCollaboratorsWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemCollaboratorsWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator. +// 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/collaborators#remove-user-as-a-collaborator +func (m *ItemCollaboratorsWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Permission the permission property +// returns a *ItemCollaboratorsItemPermissionRequestBuilder when successful +func (m *ItemCollaboratorsWithUsernameItemRequestBuilder) Permission()(*ItemCollaboratorsItemPermissionRequestBuilder) { + return NewItemCollaboratorsItemPermissionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Put adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator. +// 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/collaborators#add-project-collaborator +func (m *ItemCollaboratorsWithUsernameItemRequestBuilder) Put(ctx context.Context, body ItemCollaboratorsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a collaborator from an organization project. You must be an organization owner or a project `admin` to remove a collaborator. +// returns a *RequestInformation when successful +func (m *ItemCollaboratorsWithUsernameItemRequestBuilder) 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") + return requestInfo, nil +} +// ToPutRequestInformation adds a collaborator to an organization project and sets their permission level. You must be an organization owner or a project `admin` to add a collaborator. +// returns a *RequestInformation when successful +func (m *ItemCollaboratorsWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemCollaboratorsItemWithUsernamePutRequestBodyable, 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 *ItemCollaboratorsWithUsernameItemRequestBuilder when successful +func (m *ItemCollaboratorsWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemCollaboratorsWithUsernameItemRequestBuilder) { + return NewItemCollaboratorsWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/projects/item_columns_post_request_body.go b/pkg/github/projects/item_columns_post_request_body.go new file mode 100644 index 00000000..92913912 --- /dev/null +++ b/pkg/github/projects/item_columns_post_request_body.go @@ -0,0 +1,80 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemColumnsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Name of the project column + name *string +} +// NewItemColumnsPostRequestBody instantiates a new ItemColumnsPostRequestBody and sets the default values. +func NewItemColumnsPostRequestBody()(*ItemColumnsPostRequestBody) { + m := &ItemColumnsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemColumnsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemColumnsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemColumnsPostRequestBody(), 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 *ItemColumnsPostRequestBody) 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 *ItemColumnsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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. Name of the project column +// returns a *string when successful +func (m *ItemColumnsPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemColumnsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemColumnsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. Name of the project column +func (m *ItemColumnsPostRequestBody) SetName(value *string)() { + m.name = value +} +type ItemColumnsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + SetName(value *string)() +} diff --git a/pkg/github/projects/item_columns_request_builder.go b/pkg/github/projects/item_columns_request_builder.go new file mode 100644 index 00000000..35e999b4 --- /dev/null +++ b/pkg/github/projects/item_columns_request_builder.go @@ -0,0 +1,112 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemColumnsRequestBuilder builds and executes requests for operations under \projects\{project_id}\columns +type ItemColumnsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemColumnsRequestBuilderGetQueryParameters lists the project columns in a project. +type ItemColumnsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemColumnsRequestBuilderInternal instantiates a new ItemColumnsRequestBuilder and sets the default values. +func NewItemColumnsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemColumnsRequestBuilder) { + m := &ItemColumnsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/{project_id}/columns{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemColumnsRequestBuilder instantiates a new ItemColumnsRequestBuilder and sets the default values. +func NewItemColumnsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemColumnsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemColumnsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the project columns in a project. +// returns a []ProjectColumnable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/columns#list-project-columns +func (m *ItemColumnsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemColumnsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectColumnable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectColumnFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectColumnable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectColumnable) + } + } + return val, nil +} +// Post creates a new project column. +// returns a ProjectColumnable 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 ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/columns#create-a-project-column +func (m *ItemColumnsRequestBuilder) Post(ctx context.Context, body ItemColumnsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectColumnable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectColumnFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProjectColumnable), nil +} +// ToGetRequestInformation lists the project columns in a project. +// returns a *RequestInformation when successful +func (m *ItemColumnsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemColumnsRequestBuilderGetQueryParameters])(*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 new project column. +// returns a *RequestInformation when successful +func (m *ItemColumnsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemColumnsPostRequestBodyable, 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 *ItemColumnsRequestBuilder when successful +func (m *ItemColumnsRequestBuilder) WithUrl(rawUrl string)(*ItemColumnsRequestBuilder) { + return NewItemColumnsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/projects/item_project403_error.go b/pkg/github/projects/item_project403_error.go new file mode 100644 index 00000000..20954ab3 --- /dev/null +++ b/pkg/github/projects/item_project403_error.go @@ -0,0 +1,152 @@ +package projects + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemProject403Error 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 documentation_url property + documentation_url *string + // The errors property + errors []string + // The message property + message *string +} +// NewItemProject403Error instantiates a new ItemProject403Error and sets the default values. +func NewItemProject403Error()(*ItemProject403Error) { + m := &ItemProject403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemProject403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemProject403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemProject403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemProject403Error) 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 *ItemProject403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemProject403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []string when successful +func (m *ItemProject403Error) GetErrors()([]string) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemProject403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["errors"] = 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.SetErrors(res) + } + 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 *ItemProject403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemProject403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + if m.GetErrors() != nil { + err := writer.WriteCollectionOfStringValues("errors", m.GetErrors()) + 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 *ItemProject403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemProject403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ItemProject403Error) SetErrors(value []string)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ItemProject403Error) SetMessage(value *string)() { + m.message = value +} +type ItemProject403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetErrors()([]string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetErrors(value []string)() + SetMessage(value *string)() +} diff --git a/pkg/github/projects/item_with_project_escaped_403_error.go b/pkg/github/projects/item_with_project_escaped_403_error.go new file mode 100644 index 00000000..94e53c87 --- /dev/null +++ b/pkg/github/projects/item_with_project_escaped_403_error.go @@ -0,0 +1,152 @@ +package projects + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemWithProject_403Error 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 documentation_url property + documentation_url *string + // The errors property + errors []string + // The message property + message *string +} +// NewItemWithProject_403Error instantiates a new ItemWithProject_403Error and sets the default values. +func NewItemWithProject_403Error()(*ItemWithProject_403Error) { + m := &ItemWithProject_403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithProject_403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithProject_403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithProject_403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemWithProject_403Error) 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 *ItemWithProject_403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemWithProject_403Error) GetDocumentationUrl()(*string) { + return m.documentation_url +} +// GetErrors gets the errors property value. The errors property +// returns a []string when successful +func (m *ItemWithProject_403Error) GetErrors()([]string) { + return m.errors +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemWithProject_403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["errors"] = 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.SetErrors(res) + } + 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 *ItemWithProject_403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemWithProject_403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("documentation_url", m.GetDocumentationUrl()) + if err != nil { + return err + } + } + if m.GetErrors() != nil { + err := writer.WriteCollectionOfStringValues("errors", m.GetErrors()) + 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 *ItemWithProject_403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemWithProject_403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetErrors sets the errors property value. The errors property +func (m *ItemWithProject_403Error) SetErrors(value []string)() { + m.errors = value +} +// SetMessage sets the message property value. The message property +func (m *ItemWithProject_403Error) SetMessage(value *string)() { + m.message = value +} +type ItemWithProject_403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetErrors()([]string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetErrors(value []string)() + SetMessage(value *string)() +} diff --git a/pkg/github/projects/item_with_project_escaped_patch_request_body.go b/pkg/github/projects/item_with_project_escaped_patch_request_body.go new file mode 100644 index 00000000..140a19bf --- /dev/null +++ b/pkg/github/projects/item_with_project_escaped_patch_request_body.go @@ -0,0 +1,167 @@ +package projects + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemWithProject_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Body of the project + body *string + // Name of the project + name *string + // Whether or not this project can be seen by everyone. + private *bool + // State of the project; either 'open' or 'closed' + state *string +} +// NewItemWithProject_PatchRequestBody instantiates a new ItemWithProject_PatchRequestBody and sets the default values. +func NewItemWithProject_PatchRequestBody()(*ItemWithProject_PatchRequestBody) { + m := &ItemWithProject_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithProject_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithProject_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithProject_PatchRequestBody(), 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 *ItemWithProject_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. Body of the project +// returns a *string when successful +func (m *ItemWithProject_PatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemWithProject_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(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["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + return res +} +// GetName gets the name property value. Name of the project +// returns a *string when successful +func (m *ItemWithProject_PatchRequestBody) GetName()(*string) { + return m.name +} +// GetPrivate gets the private property value. Whether or not this project can be seen by everyone. +// returns a *bool when successful +func (m *ItemWithProject_PatchRequestBody) GetPrivate()(*bool) { + return m.private +} +// GetState gets the state property value. State of the project; either 'open' or 'closed' +// returns a *string when successful +func (m *ItemWithProject_PatchRequestBody) GetState()(*string) { + return m.state +} +// Serialize serializes information the current object +func (m *ItemWithProject_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + 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 *ItemWithProject_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. Body of the project +func (m *ItemWithProject_PatchRequestBody) SetBody(value *string)() { + m.body = value +} +// SetName sets the name property value. Name of the project +func (m *ItemWithProject_PatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrivate sets the private property value. Whether or not this project can be seen by everyone. +func (m *ItemWithProject_PatchRequestBody) SetPrivate(value *bool)() { + m.private = value +} +// SetState sets the state property value. State of the project; either 'open' or 'closed' +func (m *ItemWithProject_PatchRequestBody) SetState(value *string)() { + m.state = value +} +type ItemWithProject_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetName()(*string) + GetPrivate()(*bool) + GetState()(*string) + SetBody(value *string)() + SetName(value *string)() + SetPrivate(value *bool)() + SetState(value *string)() +} diff --git a/pkg/github/projects/projects_request_builder.go b/pkg/github/projects/projects_request_builder.go new file mode 100644 index 00000000..36d6aacf --- /dev/null +++ b/pkg/github/projects/projects_request_builder.go @@ -0,0 +1,39 @@ +package projects + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ProjectsRequestBuilder builds and executes requests for operations under \projects +type ProjectsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByProject_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.projects.item collection +// returns a *WithProject_ItemRequestBuilder when successful +func (m *ProjectsRequestBuilder) ByProject_id(project_id int32)(*WithProject_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["project_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(project_id), 10) + return NewWithProject_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// Columns the columns property +// returns a *ColumnsRequestBuilder when successful +func (m *ProjectsRequestBuilder) Columns()(*ColumnsRequestBuilder) { + return NewColumnsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewProjectsRequestBuilderInternal instantiates a new ProjectsRequestBuilder and sets the default values. +func NewProjectsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ProjectsRequestBuilder) { + m := &ProjectsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects", pathParameters), + } + return m +} +// NewProjectsRequestBuilder instantiates a new ProjectsRequestBuilder and sets the default values. +func NewProjectsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ProjectsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewProjectsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/projects/with_project_escaped_item_request_builder.go b/pkg/github/projects/with_project_escaped_item_request_builder.go new file mode 100644 index 00000000..a67a3446 --- /dev/null +++ b/pkg/github/projects/with_project_escaped_item_request_builder.go @@ -0,0 +1,147 @@ +package projects + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// WithProject_ItemRequestBuilder builds and executes requests for operations under \projects\{project_id} +type WithProject_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Collaborators the collaborators property +// returns a *ItemCollaboratorsRequestBuilder when successful +func (m *WithProject_ItemRequestBuilder) Collaborators()(*ItemCollaboratorsRequestBuilder) { + return NewItemCollaboratorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Columns the columns property +// returns a *ItemColumnsRequestBuilder when successful +func (m *WithProject_ItemRequestBuilder) Columns()(*ItemColumnsRequestBuilder) { + return NewItemColumnsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewWithProject_ItemRequestBuilderInternal instantiates a new WithProject_ItemRequestBuilder and sets the default values. +func NewWithProject_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithProject_ItemRequestBuilder) { + m := &WithProject_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/projects/{project_id}", pathParameters), + } + return m +} +// NewWithProject_ItemRequestBuilder instantiates a new WithProject_ItemRequestBuilder and sets the default values. +func NewWithProject_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithProject_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithProject_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a project board. Returns a `404 Not Found` status if projects are disabled. +// returns a BasicError error when the service returns a 401 status code +// returns a ItemWithProject_403Error 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 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/projects#delete-a-project +func (m *WithProject_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 { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": CreateItemWithProject_403ErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a Projectable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/projects#get-a-project +func (m *WithProject_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable), nil +} +// Patch updates a project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a Projectable when successful +// returns a BasicError error when the service returns a 401 status code +// returns a ItemProject403Error error when the service returns a 403 status code +// returns a BasicError error when the service returns a 410 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/projects#update-a-project +func (m *WithProject_ItemRequestBuilder) Patch(ctx context.Context, body ItemWithProject_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": CreateItemProject403ErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable), nil +} +// ToDeleteRequestInformation deletes a project board. Returns a `404 Not Found` status if projects are disabled. +// returns a *RequestInformation when successful +func (m *WithProject_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") + return requestInfo, nil +} +// ToGetRequestInformation gets a project by its `id`. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a *RequestInformation when successful +func (m *WithProject_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 project board's information. Returns a `404 Not Found` status if projects are disabled. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a *RequestInformation when successful +func (m *WithProject_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemWithProject_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 *WithProject_ItemRequestBuilder when successful +func (m *WithProject_ItemRequestBuilder) WithUrl(rawUrl string)(*WithProject_ItemRequestBuilder) { + return NewWithProject_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/rate_limit/rate_escaped_limit_request_builder.go b/pkg/github/rate_limit/rate_escaped_limit_request_builder.go new file mode 100644 index 00000000..850b6464 --- /dev/null +++ b/pkg/github/rate_limit/rate_escaped_limit_request_builder.go @@ -0,0 +1,61 @@ +package rate_limit + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// Rate_limitRequestBuilder builds and executes requests for operations under \rate_limit +type Rate_limitRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewRate_limitRequestBuilderInternal instantiates a new Rate_limitRequestBuilder and sets the default values. +func NewRate_limitRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Rate_limitRequestBuilder) { + m := &Rate_limitRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/rate_limit", pathParameters), + } + return m +} +// NewRate_limitRequestBuilder instantiates a new Rate_limitRequestBuilder and sets the default values. +func NewRate_limitRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Rate_limitRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewRate_limitRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!NOTE]> Accessing this endpoint does not count against your REST API rate limit.Some categories of endpoints have custom rate limits that are separate from the rate limit governing the other REST API endpoints. For this reason, the API response categorizes your rate limit. Under `resources`, you'll see objects relating to different categories:* The `core` object provides your rate limit status for all non-search-related resources in the REST API.* The `search` object provides your rate limit status for the REST API for searching (excluding code searches). For more information, see "[Search](https://docs.github.com/enterprise-server@3.14/rest/search/search)."* The `code_search` object provides your rate limit status for the REST API for searching code. For more information, see "[Search code](https://docs.github.com/enterprise-server@3.14/rest/search/search#search-code)."* The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/enterprise-server@3.14/graphql/overview/resource-limitations#rate-limit)."* The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/enterprise-server@3.14/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)."* The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/enterprise-server@3.14/rest/dependency-graph)."* The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/enterprise-server@3.14/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)."* The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners)."* The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/enterprise-server@3.14/rest/about-the-rest-api/api-versions)."> [!NOTE]> The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. +// returns a RateLimitOverviewable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/rate-limit/rate-limit#get-rate-limit-status-for-the-authenticated-user +func (m *Rate_limitRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RateLimitOverviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRateLimitOverviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RateLimitOverviewable), nil +} +// ToGetRequestInformation > [!NOTE]> Accessing this endpoint does not count against your REST API rate limit.Some categories of endpoints have custom rate limits that are separate from the rate limit governing the other REST API endpoints. For this reason, the API response categorizes your rate limit. Under `resources`, you'll see objects relating to different categories:* The `core` object provides your rate limit status for all non-search-related resources in the REST API.* The `search` object provides your rate limit status for the REST API for searching (excluding code searches). For more information, see "[Search](https://docs.github.com/enterprise-server@3.14/rest/search/search)."* The `code_search` object provides your rate limit status for the REST API for searching code. For more information, see "[Search code](https://docs.github.com/enterprise-server@3.14/rest/search/search#search-code)."* The `graphql` object provides your rate limit status for the GraphQL API. For more information, see "[Resource limitations](https://docs.github.com/enterprise-server@3.14/graphql/overview/resource-limitations#rate-limit)."* The `integration_manifest` object provides your rate limit status for the `POST /app-manifests/{code}/conversions` operation. For more information, see "[Creating a GitHub App from a manifest](https://docs.github.com/enterprise-server@3.14/apps/creating-github-apps/setting-up-a-github-app/creating-a-github-app-from-a-manifest#3-you-exchange-the-temporary-code-to-retrieve-the-app-configuration)."* The `dependency_snapshots` object provides your rate limit status for submitting snapshots to the dependency graph. For more information, see "[Dependency graph](https://docs.github.com/enterprise-server@3.14/rest/dependency-graph)."* The `code_scanning_upload` object provides your rate limit status for uploading SARIF results to code scanning. For more information, see "[Uploading a SARIF file to GitHub](https://docs.github.com/enterprise-server@3.14/code-security/code-scanning/integrating-with-code-scanning/uploading-a-sarif-file-to-github)."* The `actions_runner_registration` object provides your rate limit status for registering self-hosted runners in GitHub Actions. For more information, see "[Self-hosted runners](https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners)."* The `source_import` object is no longer in use for any API endpoints, and it will be removed in the next API version. For more information about API versions, see "[API Versions](https://docs.github.com/enterprise-server@3.14/rest/about-the-rest-api/api-versions)."> [!NOTE]> The `rate` object is deprecated. If you're writing new API client code or updating existing code, you should use the `core` object instead of the `rate` object. The `core` object contains the same information that is present in the `rate` object. +// returns a *RequestInformation when successful +func (m *Rate_limitRequestBuilder) 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 *Rate_limitRequestBuilder when successful +func (m *Rate_limitRequestBuilder) WithUrl(rawUrl string)(*Rate_limitRequestBuilder) { + return NewRate_limitRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/01a44ffe4153188df22529fd24ee9f3904b12838161aef08329acd1d15433341.go b/pkg/github/repos/01a44ffe4153188df22529fd24ee9f3904b12838161aef08329acd1d15433341.go new file mode 100644 index 00000000..90425c0f --- /dev/null +++ b/pkg/github/repos/01a44ffe4153188df22529fd24ee9f3904b12838161aef08329acd1d15433341.go @@ -0,0 +1,157 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances allow specific users, teams, or apps to bypass pull request requirements. +type ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances 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 list of app `slug`s allowed to bypass pull request requirements. + apps []string + // The list of team `slug`s allowed to bypass pull request requirements. + teams []string + // The list of user `login`s allowed to bypass pull request requirements. + users []string +} +// NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances instantiates a new ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances and sets the default values. +func NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances()(*ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) { + m := &ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances(), 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 *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The list of app `slug`s allowed to bypass pull request requirements. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = 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.SetApps(res) + } + return nil + } + res["teams"] = 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.SetTeams(res) + } + return nil + } + res["users"] = 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.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The list of team `slug`s allowed to bypass pull request requirements. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) GetTeams()([]string) { + return m.teams +} +// GetUsers gets the users property value. The list of user `login`s allowed to bypass pull request requirements. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The list of app `slug`s allowed to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) SetApps(value []string)() { + m.apps = value +} +// SetTeams sets the teams property value. The list of team `slug`s allowed to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) SetTeams(value []string)() { + m.teams = value +} +// SetUsers sets the users property value. The list of user `login`s allowed to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowances) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + GetTeams()([]string) + GetUsers()([]string) + SetApps(value []string)() + SetTeams(value []string)() + SetUsers(value []string)() +} diff --git a/pkg/github/repos/0367740d114f7df6844bfac9b20b0d29734964bd8cf755677e5074aa3595ed1f.go b/pkg/github/repos/0367740d114f7df6844bfac9b20b0d29734964bd8cf755677e5074aa3595ed1f.go new file mode 100644 index 00000000..4ca543e7 --- /dev/null +++ b/pkg/github/repos/0367740d114f7df6844bfac9b20b0d29734964bd8cf755677e5074aa3595ed1f.go @@ -0,0 +1,157 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. +type ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions 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 list of app `slug`s with dismissal access + apps []string + // The list of team `slug`s with dismissal access + teams []string + // The list of user `login`s with dismissal access + users []string +} +// NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions instantiates a new ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions and sets the default values. +func NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions()(*ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) { + m := &ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions(), 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 *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The list of app `slug`s with dismissal access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = 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.SetApps(res) + } + return nil + } + res["teams"] = 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.SetTeams(res) + } + return nil + } + res["users"] = 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.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The list of team `slug`s with dismissal access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) GetTeams()([]string) { + return m.teams +} +// GetUsers gets the users property value. The list of user `login`s with dismissal access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The list of app `slug`s with dismissal access +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) SetApps(value []string)() { + m.apps = value +} +// SetTeams sets the teams property value. The list of team `slug`s with dismissal access +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) SetTeams(value []string)() { + m.teams = value +} +// SetUsers sets the users property value. The list of user `login`s with dismissal access +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictions) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + GetTeams()([]string) + GetUsers()([]string) + SetApps(value []string)() + SetTeams(value []string)() + SetUsers(value []string)() +} diff --git a/pkg/github/repos/1bdffa8d6eddd2724ceae2800884cd55a3b6e7fe81a9cd2b998f1b1909634428.go b/pkg/github/repos/1bdffa8d6eddd2724ceae2800884cd55a3b6e7fe81a9cd2b998f1b1909634428.go new file mode 100644 index 00000000..8edee3f5 --- /dev/null +++ b/pkg/github/repos/1bdffa8d6eddd2724ceae2800884cd55a3b6e7fe81a9cd2b998f1b1909634428.go @@ -0,0 +1,110 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\deployment-branch-policies\{branch_policy_id} +type ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) { + m := &ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/deployment-branch-policies/{branch_policy_id}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder instantiates a new ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a deployment branch or tag policy for an environment.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/branch-policies#delete-a-deployment-branch-policy +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a deployment branch or tag policy for an environment.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a DeploymentBranchPolicyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/branch-policies#get-a-deployment-branch-policy +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentBranchPolicyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyable), nil +} +// Put updates a deployment branch or tag policy for an environment.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a DeploymentBranchPolicyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/branch-policies#update-a-deployment-branch-policy +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) Put(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyNamePatternable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentBranchPolicyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyable), nil +} +// ToDeleteRequestInformation deletes a deployment branch or tag policy for an environment.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a deployment branch or tag policy for an environment.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_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 +} +// ToPutRequestInformation updates a deployment branch or tag policy for an environment.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyNamePatternable, 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 *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) { + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/28e6b6a51b1b1282278ea3990f10daa17df7d6492a6bc9d7b42e609850615c1b.go b/pkg/github/repos/28e6b6a51b1b1282278ea3990f10daa17df7d6492a6bc9d7b42e609850615c1b.go new file mode 100644 index 00000000..e12b9ac9 --- /dev/null +++ b/pkg/github/repos/28e6b6a51b1b1282278ea3990f10daa17df7d6492a6bc9d7b42e609850615c1b.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." +type ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Can be `enabled` or `disabled`. + status *string +} +// NewItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning instantiates a new ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning and sets the default values. +func NewItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning()(*ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning) { + m := &ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning(), 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 *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning) 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 *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. Can be `enabled` or `disabled`. +// returns a *string when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning) SetStatus(value *string)() { + m.status = value +} +type ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + SetStatus(value *string)() +} diff --git a/pkg/github/repos/4380cf32ec38d8910d515b439bc2e02facbf46789676a4dc678fbfc0c7285cc0.go b/pkg/github/repos/4380cf32ec38d8910d515b439bc2e02facbf46789676a4dc678fbfc0c7285cc0.go new file mode 100644 index 00000000..bc27734a --- /dev/null +++ b/pkg/github/repos/4380cf32ec38d8910d515b439bc2e02facbf46789676a4dc678fbfc0c7285cc0.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 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 name of the status checks + contexts []string +} +// NewItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1()(*ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContexts gets the contexts property value. The name of the status checks +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1) GetContexts()([]string) { + return m.contexts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["contexts"] = 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.SetContexts(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContexts() != nil { + err := writer.WriteCollectionOfStringValues("contexts", m.GetContexts()) + 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 *ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContexts sets the contexts property value. The name of the status checks +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1) SetContexts(value []string)() { + m.contexts = value +} +type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContexts()([]string) + SetContexts(value []string)() +} diff --git a/pkg/github/repos/45842715654374f346d333620787cc369718434019f4ba4eb3b1ea1ef4d38f08.go b/pkg/github/repos/45842715654374f346d333620787cc369718434019f4ba4eb3b1ea1ef4d38f08.go new file mode 100644 index 00000000..cb99264c --- /dev/null +++ b/pkg/github/repos/45842715654374f346d333620787cc369718434019f4ba4eb3b1ea1ef4d38f08.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 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 name of the status checks + contexts []string +} +// NewItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1()(*ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContexts gets the contexts property value. The name of the status checks +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1) GetContexts()([]string) { + return m.contexts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["contexts"] = 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.SetContexts(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContexts() != nil { + err := writer.WriteCollectionOfStringValues("contexts", m.GetContexts()) + 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 *ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContexts sets the contexts property value. The name of the status checks +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1) SetContexts(value []string)() { + m.contexts = value +} +type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContexts()([]string) + SetContexts(value []string)() +} diff --git a/pkg/github/repos/541d302c6d6b28965ef8197195ae1715beca9efd14c0e545568b62a18c27233f.go b/pkg/github/repos/541d302c6d6b28965ef8197195ae1715beca9efd14c0e545568b62a18c27233f.go new file mode 100644 index 00000000..eb8ce01d --- /dev/null +++ b/pkg/github/repos/541d302c6d6b28965ef8197195ae1715beca9efd14c0e545568b62a18c27233f.go @@ -0,0 +1,226 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews require at least one approving review on a pull request, before merging. Set to `null` to disable. +type ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Allow specific users, teams, or apps to bypass pull request requirements. + bypass_pull_request_allowances ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable + // Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. + dismiss_stale_reviews *bool + // Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. + dismissal_restrictions ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable + // Blocks merging pull requests until [code owners](https://docs.github.com/enterprise-server@3.14/articles/about-code-owners/) review them. + require_code_owner_reviews *bool + // Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false`. + require_last_push_approval *bool + // Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. + required_approving_review_count *int32 +} +// NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews instantiates a new ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews and sets the default values. +func NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews()(*ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) { + m := &ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews(), 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 *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassPullRequestAllowances gets the bypass_pull_request_allowances property value. Allow specific users, teams, or apps to bypass pull request requirements. +// returns a ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetBypassPullRequestAllowances()(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable) { + return m.bypass_pull_request_allowances +} +// GetDismissalRestrictions gets the dismissal_restrictions property value. Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. +// returns a ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetDismissalRestrictions()(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable) { + return m.dismissal_restrictions +} +// GetDismissStaleReviews gets the dismiss_stale_reviews property value. Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetDismissStaleReviews()(*bool) { + return m.dismiss_stale_reviews +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_pull_request_allowances"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBypassPullRequestAllowances(val.(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable)) + } + return nil + } + res["dismiss_stale_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissStaleReviews(val) + } + return nil + } + res["dismissal_restrictions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissalRestrictions(val.(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable)) + } + return nil + } + res["require_code_owner_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireCodeOwnerReviews(val) + } + return nil + } + res["require_last_push_approval"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireLastPushApproval(val) + } + return nil + } + res["required_approving_review_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRequiredApprovingReviewCount(val) + } + return nil + } + return res +} +// GetRequireCodeOwnerReviews gets the require_code_owner_reviews property value. Blocks merging pull requests until [code owners](https://docs.github.com/enterprise-server@3.14/articles/about-code-owners/) review them. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetRequireCodeOwnerReviews()(*bool) { + return m.require_code_owner_reviews +} +// GetRequiredApprovingReviewCount gets the required_approving_review_count property value. Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. +// returns a *int32 when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetRequiredApprovingReviewCount()(*int32) { + return m.required_approving_review_count +} +// GetRequireLastPushApproval gets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false`. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) GetRequireLastPushApproval()(*bool) { + return m.require_last_push_approval +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("bypass_pull_request_allowances", m.GetBypassPullRequestAllowances()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dismissal_restrictions", m.GetDismissalRestrictions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dismiss_stale_reviews", m.GetDismissStaleReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("required_approving_review_count", m.GetRequiredApprovingReviewCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_code_owner_reviews", m.GetRequireCodeOwnerReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_last_push_approval", m.GetRequireLastPushApproval()) + 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 *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassPullRequestAllowances sets the bypass_pull_request_allowances property value. Allow specific users, teams, or apps to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) SetBypassPullRequestAllowances(value ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable)() { + m.bypass_pull_request_allowances = value +} +// SetDismissalRestrictions sets the dismissal_restrictions property value. Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) SetDismissalRestrictions(value ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable)() { + m.dismissal_restrictions = value +} +// SetDismissStaleReviews sets the dismiss_stale_reviews property value. Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) SetDismissStaleReviews(value *bool)() { + m.dismiss_stale_reviews = value +} +// SetRequireCodeOwnerReviews sets the require_code_owner_reviews property value. Blocks merging pull requests until [code owners](https://docs.github.com/enterprise-server@3.14/articles/about-code-owners/) review them. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) SetRequireCodeOwnerReviews(value *bool)() { + m.require_code_owner_reviews = value +} +// SetRequiredApprovingReviewCount sets the required_approving_review_count property value. Specify the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) SetRequiredApprovingReviewCount(value *int32)() { + m.required_approving_review_count = value +} +// SetRequireLastPushApproval sets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false`. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews) SetRequireLastPushApproval(value *bool)() { + m.require_last_push_approval = value +} +type ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassPullRequestAllowances()(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable) + GetDismissalRestrictions()(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable) + GetDismissStaleReviews()(*bool) + GetRequireCodeOwnerReviews()(*bool) + GetRequiredApprovingReviewCount()(*int32) + GetRequireLastPushApproval()(*bool) + SetBypassPullRequestAllowances(value ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable)() + SetDismissalRestrictions(value ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_dismissal_restrictionsable)() + SetDismissStaleReviews(value *bool)() + SetRequireCodeOwnerReviews(value *bool)() + SetRequiredApprovingReviewCount(value *int32)() + SetRequireLastPushApproval(value *bool)() +} diff --git a/pkg/github/repos/56259561f2530d481ddd9f21a9290735bf63c4cd1ecace89ae78b4eeb7f2f21d.go b/pkg/github/repos/56259561f2530d481ddd9f21a9290735bf63c4cd1ecace89ae78b4eeb7f2f21d.go new file mode 100644 index 00000000..c7e1a36a --- /dev/null +++ b/pkg/github/repos/56259561f2530d481ddd9f21a9290735bf63c4cd1ecace89ae78b4eeb7f2f21d.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status. + app_id *int32 + // The name of the required check + context *string +} +// NewItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks instantiates a new ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks()(*ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) { + m := &ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks(), 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 *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAppId gets the app_id property value. The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status. +// returns a *int32 when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) GetAppId()(*int32) { + return m.app_id +} +// GetContext gets the context property value. The name of the required check +// returns a *string when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) GetContext()(*string) { + return m.context +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("app_id", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("context", m.GetContext()) + 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 *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAppId sets the app_id property value. The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status. +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) SetAppId(value *int32)() { + m.app_id = value +} +// SetContext sets the context property value. The name of the required check +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checks) SetContext(value *string)() { + m.context = value +} +type ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId()(*int32) + GetContext()(*string) + SetAppId(value *int32)() + SetContext(value *string)() +} diff --git a/pkg/github/repos/5716bbaab370064fc35315d70724ec633f98e8881fefccfc0b6561eaac582274.go b/pkg/github/repos/5716bbaab370064fc35315d70724ec633f98e8881fefccfc0b6561eaac582274.go new file mode 100644 index 00000000..23d5bc3d --- /dev/null +++ b/pkg/github/repos/5716bbaab370064fc35315d70724ec633f98e8881fefccfc0b6561eaac582274.go @@ -0,0 +1,157 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. +type ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions 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 list of app `slug`s with dismissal access + apps []string + // The list of team `slug`s with dismissal access + teams []string + // The list of user `login`s with dismissal access + users []string +} +// NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions instantiates a new ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions and sets the default values. +func NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions()(*ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) { + m := &ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions(), 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 *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The list of app `slug`s with dismissal access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = 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.SetApps(res) + } + return nil + } + res["teams"] = 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.SetTeams(res) + } + return nil + } + res["users"] = 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.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The list of team `slug`s with dismissal access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) GetTeams()([]string) { + return m.teams +} +// GetUsers gets the users property value. The list of user `login`s with dismissal access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The list of app `slug`s with dismissal access +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) SetApps(value []string)() { + m.apps = value +} +// SetTeams sets the teams property value. The list of team `slug`s with dismissal access +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) SetTeams(value []string)() { + m.teams = value +} +// SetUsers sets the users property value. The list of user `login`s with dismissal access +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictions) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + GetTeams()([]string) + GetUsers()([]string) + SetApps(value []string)() + SetTeams(value []string)() + SetUsers(value []string)() +} diff --git a/pkg/github/repos/5ffbe0a4d1b645f842955ddf87128090717488ce8d132dca34aa5a2475cb9e75.go b/pkg/github/repos/5ffbe0a4d1b645f842955ddf87128090717488ce8d132dca34aa5a2475cb9e75.go new file mode 100644 index 00000000..0d086a9d --- /dev/null +++ b/pkg/github/repos/5ffbe0a4d1b645f842955ddf87128090717488ce8d132dca34aa5a2475cb9e75.go @@ -0,0 +1,79 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\deployment_protection_rules\{protection_rule_id} +type ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) { + m := &ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/deployment_protection_rules/{protection_rule_id}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete disables a custom deployment protection rule for an environment.The authenticated user must have admin or owner permissions to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/protection-rules#disable-a-custom-protection-rule-for-an-environment +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets an enabled custom deployment protection rule for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see "[Using environments for deployment](https://docs.github.com/enterprise-server@3.14/actions/deployment/targeting-different-environments/using-environments-for-deployment)."For more information about the app that is providing this custom deployment rule, see [`GET /apps/{app_slug}`](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#get-an-app).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a DeploymentProtectionRuleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/protection-rules#get-a-custom-deployment-protection-rule +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentProtectionRuleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentProtectionRuleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentProtectionRuleable), nil +} +// ToDeleteRequestInformation disables a custom deployment protection rule for an environment.The authenticated user must have admin or owner permissions to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_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) + return requestInfo, nil +} +// ToGetRequestInformation gets an enabled custom deployment protection rule for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see "[Using environments for deployment](https://docs.github.com/enterprise-server@3.14/actions/deployment/targeting-different-environments/using-environments-for-deployment)."For more information about the app that is providing this custom deployment rule, see [`GET /apps/{app_slug}`](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#get-an-app).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/7a371aff602cbaa0e7806bc10fdfbe23849e2fae5c8ca4d195f9213af56dfa48.go b/pkg/github/repos/7a371aff602cbaa0e7806bc10fdfbe23849e2fae5c8ca4d195f9213af56dfa48.go new file mode 100644 index 00000000..064955b3 --- /dev/null +++ b/pkg/github/repos/7a371aff602cbaa0e7806bc10fdfbe23849e2fae5c8ca4d195f9213af56dfa48.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." +type ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Can be `enabled` or `disabled`. + status *string +} +// NewItemItemRepoPatchRequestBody_security_and_analysis_advanced_security instantiates a new ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security and sets the default values. +func NewItemItemRepoPatchRequestBody_security_and_analysis_advanced_security()(*ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security) { + m := &ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRepoPatchRequestBody_security_and_analysis_advanced_security(), 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 *ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security) 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 *ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. Can be `enabled` or `disabled`. +// returns a *string when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_advanced_security) SetStatus(value *string)() { + m.status = value +} +type ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + SetStatus(value *string)() +} diff --git a/pkg/github/repos/98b68b8af011ad874c57befae99b96bdcce4f6039e3e2d90db46a68255a69ed0.go b/pkg/github/repos/98b68b8af011ad874c57befae99b96bdcce4f6039e3e2d90db46a68255a69ed0.go new file mode 100644 index 00000000..dfa7b90a --- /dev/null +++ b/pkg/github/repos/98b68b8af011ad874c57befae99b96bdcce4f6039e3e2d90db46a68255a69ed0.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status. + app_id *int32 + // The name of the required check + context *string +} +// NewItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks instantiates a new ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks and sets the default values. +func NewItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks()(*ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) { + m := &ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks(), 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 *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAppId gets the app_id property value. The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status. +// returns a *int32 when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) GetAppId()(*int32) { + return m.app_id +} +// GetContext gets the context property value. The name of the required check +// returns a *string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) GetContext()(*string) { + return m.context +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("app_id", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("context", m.GetContext()) + 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 *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAppId sets the app_id property value. The ID of the GitHub App that must provide this check. Omit this field to automatically select the GitHub App that has recently provided this check, or any app if it was not set by a GitHub App. Pass -1 to explicitly allow any app to set the status. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) SetAppId(value *int32)() { + m.app_id = value +} +// SetContext sets the context property value. The name of the required check +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checks) SetContext(value *string)() { + m.context = value +} +type ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId()(*int32) + GetContext()(*string) + SetAppId(value *int32)() + SetContext(value *string)() +} diff --git a/pkg/github/repos/c2ced4f7f11b2d4ec4933e4e7737cf27d616e0818052d67c9dbb80855e1eb59d.go b/pkg/github/repos/c2ced4f7f11b2d4ec4933e4e7737cf27d616e0818052d67c9dbb80855e1eb59d.go new file mode 100644 index 00000000..da569ebf --- /dev/null +++ b/pkg/github/repos/c2ced4f7f11b2d4ec4933e4e7737cf27d616e0818052d67c9dbb80855e1eb59d.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." +type ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Can be `enabled` or `disabled`. + status *string +} +// NewItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection instantiates a new ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection and sets the default values. +func NewItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection()(*ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) { + m := &ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection(), 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 *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) 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 *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["status"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStatus(val) + } + return nil + } + return res +} +// GetStatus gets the status property value. Can be `enabled` or `disabled`. +// returns a *string when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) GetStatus()(*string) { + return m.status +} +// Serialize serializes information the current object +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("status", m.GetStatus()) + 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 *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetStatus sets the status property value. Can be `enabled` or `disabled`. +func (m *ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protection) SetStatus(value *string)() { + m.status = value +} +type ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetStatus()(*string) + SetStatus(value *string)() +} diff --git a/pkg/github/repos/cae48b44e47feb1c02e5eef34639b41e606e1e0fc5e4f49ee0a9dcea3560f2f7.go b/pkg/github/repos/cae48b44e47feb1c02e5eef34639b41e606e1e0fc5e4f49ee0a9dcea3560f2f7.go new file mode 100644 index 00000000..c4d8ce9b --- /dev/null +++ b/pkg/github/repos/cae48b44e47feb1c02e5eef34639b41e606e1e0fc5e4f49ee0a9dcea3560f2f7.go @@ -0,0 +1,225 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Allow specific users, teams, or apps to bypass pull request requirements. + bypass_pull_request_allowances ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable + // Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. + dismiss_stale_reviews *bool + // Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. + dismissal_restrictions ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable + // Blocks merging pull requests until [code owners](https://docs.github.com/enterprise-server@3.14/articles/about-code-owners/) have reviewed. + require_code_owner_reviews *bool + // Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false` + require_last_push_approval *bool + // Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. + required_approving_review_count *int32 +} +// NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody instantiates a new ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody and sets the default values. +func NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody()(*ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) { + m := &ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody(), 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 *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassPullRequestAllowances gets the bypass_pull_request_allowances property value. Allow specific users, teams, or apps to bypass pull request requirements. +// returns a ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetBypassPullRequestAllowances()(ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable) { + return m.bypass_pull_request_allowances +} +// GetDismissalRestrictions gets the dismissal_restrictions property value. Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. +// returns a ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetDismissalRestrictions()(ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable) { + return m.dismissal_restrictions +} +// GetDismissStaleReviews gets the dismiss_stale_reviews property value. Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetDismissStaleReviews()(*bool) { + return m.dismiss_stale_reviews +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_pull_request_allowances"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetBypassPullRequestAllowances(val.(ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable)) + } + return nil + } + res["dismiss_stale_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissStaleReviews(val) + } + return nil + } + res["dismissal_restrictions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDismissalRestrictions(val.(ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable)) + } + return nil + } + res["require_code_owner_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireCodeOwnerReviews(val) + } + return nil + } + res["require_last_push_approval"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequireLastPushApproval(val) + } + return nil + } + res["required_approving_review_count"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRequiredApprovingReviewCount(val) + } + return nil + } + return res +} +// GetRequireCodeOwnerReviews gets the require_code_owner_reviews property value. Blocks merging pull requests until [code owners](https://docs.github.com/enterprise-server@3.14/articles/about-code-owners/) have reviewed. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetRequireCodeOwnerReviews()(*bool) { + return m.require_code_owner_reviews +} +// GetRequiredApprovingReviewCount gets the required_approving_review_count property value. Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. +// returns a *int32 when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetRequiredApprovingReviewCount()(*int32) { + return m.required_approving_review_count +} +// GetRequireLastPushApproval gets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false` +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) GetRequireLastPushApproval()(*bool) { + return m.require_last_push_approval +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("bypass_pull_request_allowances", m.GetBypassPullRequestAllowances()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("dismissal_restrictions", m.GetDismissalRestrictions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("dismiss_stale_reviews", m.GetDismissStaleReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("required_approving_review_count", m.GetRequiredApprovingReviewCount()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_code_owner_reviews", m.GetRequireCodeOwnerReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("require_last_push_approval", m.GetRequireLastPushApproval()) + 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 *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassPullRequestAllowances sets the bypass_pull_request_allowances property value. Allow specific users, teams, or apps to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) SetBypassPullRequestAllowances(value ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable)() { + m.bypass_pull_request_allowances = value +} +// SetDismissalRestrictions sets the dismissal_restrictions property value. Specify which users, teams, and apps can dismiss pull request reviews. Pass an empty `dismissal_restrictions` object to disable. User and team `dismissal_restrictions` are only available for organization-owned repositories. Omit this parameter for personal repositories. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) SetDismissalRestrictions(value ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable)() { + m.dismissal_restrictions = value +} +// SetDismissStaleReviews sets the dismiss_stale_reviews property value. Set to `true` if you want to automatically dismiss approving reviews when someone pushes a new commit. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) SetDismissStaleReviews(value *bool)() { + m.dismiss_stale_reviews = value +} +// SetRequireCodeOwnerReviews sets the require_code_owner_reviews property value. Blocks merging pull requests until [code owners](https://docs.github.com/enterprise-server@3.14/articles/about-code-owners/) have reviewed. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) SetRequireCodeOwnerReviews(value *bool)() { + m.require_code_owner_reviews = value +} +// SetRequiredApprovingReviewCount sets the required_approving_review_count property value. Specifies the number of reviewers required to approve pull requests. Use a number between 1 and 6 or 0 to not require reviewers. +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) SetRequiredApprovingReviewCount(value *int32)() { + m.required_approving_review_count = value +} +// SetRequireLastPushApproval sets the require_last_push_approval property value. Whether the most recent push must be approved by someone other than the person who pushed it. Default: `false` +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody) SetRequireLastPushApproval(value *bool)() { + m.require_last_push_approval = value +} +type ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassPullRequestAllowances()(ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable) + GetDismissalRestrictions()(ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable) + GetDismissStaleReviews()(*bool) + GetRequireCodeOwnerReviews()(*bool) + GetRequiredApprovingReviewCount()(*int32) + GetRequireLastPushApproval()(*bool) + SetBypassPullRequestAllowances(value ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_bypass_pull_request_allowancesable)() + SetDismissalRestrictions(value ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBody_dismissal_restrictionsable)() + SetDismissStaleReviews(value *bool)() + SetRequireCodeOwnerReviews(value *bool)() + SetRequiredApprovingReviewCount(value *int32)() + SetRequireLastPushApproval(value *bool)() +} diff --git a/pkg/github/repos/d3902909c3cf1832865514c8e154d728e1e845e4d4f0daf2fad2e64d0814e2fd.go b/pkg/github/repos/d3902909c3cf1832865514c8e154d728e1e845e4d4f0daf2fad2e64d0814e2fd.go new file mode 100644 index 00000000..82fb6012 --- /dev/null +++ b/pkg/github/repos/d3902909c3cf1832865514c8e154d728e1e845e4d4f0daf2fad2e64d0814e2fd.go @@ -0,0 +1,157 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances allow specific users, teams, or apps to bypass pull request requirements. +type ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances 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 list of app `slug`s allowed to bypass pull request requirements. + apps []string + // The list of team `slug`s allowed to bypass pull request requirements. + teams []string + // The list of user `login`s allowed to bypass pull request requirements. + users []string +} +// NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances instantiates a new ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances and sets the default values. +func NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances()(*ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) { + m := &ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances(), 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 *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The list of app `slug`s allowed to bypass pull request requirements. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = 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.SetApps(res) + } + return nil + } + res["teams"] = 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.SetTeams(res) + } + return nil + } + res["users"] = 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.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The list of team `slug`s allowed to bypass pull request requirements. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) GetTeams()([]string) { + return m.teams +} +// GetUsers gets the users property value. The list of user `login`s allowed to bypass pull request requirements. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The list of app `slug`s allowed to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) SetApps(value []string)() { + m.apps = value +} +// SetTeams sets the teams property value. The list of team `slug`s allowed to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) SetTeams(value []string)() { + m.teams = value +} +// SetUsers sets the users property value. The list of user `login`s allowed to bypass pull request requirements. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowances) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviews_bypass_pull_request_allowancesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + GetTeams()([]string) + GetUsers()([]string) + SetApps(value []string)() + SetTeams(value []string)() + SetUsers(value []string)() +} diff --git a/pkg/github/repos/d4a0f505268ca74b4bdfce6a70996157dffa969b443e6484fca873747b165c64.go b/pkg/github/repos/d4a0f505268ca74b4bdfce6a70996157dffa969b443e6484fca873747b165c64.go new file mode 100644 index 00000000..d0a5e69f --- /dev/null +++ b/pkg/github/repos/d4a0f505268ca74b4bdfce6a70996157dffa969b443e6484fca873747b165c64.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 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 name of the status checks + contexts []string +} +// NewItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1()(*ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContexts gets the contexts property value. The name of the status checks +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1) GetContexts()([]string) { + return m.contexts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["contexts"] = 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.SetContexts(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContexts() != nil { + err := writer.WriteCollectionOfStringValues("contexts", m.GetContexts()) + 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 *ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContexts sets the contexts property value. The name of the status checks +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1) SetContexts(value []string)() { + m.contexts = value +} +type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContexts()([]string) + SetContexts(value []string)() +} diff --git a/pkg/github/repos/ebaafbcdca770d94734922c3c8ad594e1b68c871877fd14056bab410d7362ac8.go b/pkg/github/repos/ebaafbcdca770d94734922c3c8ad594e1b68c871877fd14056bab410d7362ac8.go new file mode 100644 index 00000000..7961e604 --- /dev/null +++ b/pkg/github/repos/ebaafbcdca770d94734922c3c8ad594e1b68c871877fd14056bab410d7362ac8.go @@ -0,0 +1,119 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\required_pull_request_reviews +type ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) { + m := &ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/required_pull_request_reviews", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder instantiates a new ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#delete-pull-request-review-protection +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a ProtectedBranchPullRequestReviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#get-pull-request-review-protection +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProtectedBranchPullRequestReviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProtectedBranchPullRequestReviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProtectedBranchPullRequestReviewable), nil +} +// Patch protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled.> [!NOTE]> Passing new arrays of `users` and `teams` replaces their previous values. +// returns a ProtectedBranchPullRequestReviewable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#update-pull-request-review-protection +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) Patch(ctx context.Context, body ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProtectedBranchPullRequestReviewable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProtectedBranchPullRequestReviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProtectedBranchPullRequestReviewable), nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) 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 protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Updating pull request review enforcement requires admin or owner permissions to the repository and branch protection to be enabled.> [!NOTE]> Passing new arrays of `users` and `teams` replaces their previous values. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemBranchesItemProtectionRequired_pull_request_reviewsPatchRequestBodyable, 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 *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item/item/actions/caches/get_direction_query_parameter_type.go b/pkg/github/repos/item/item/actions/caches/get_direction_query_parameter_type.go new file mode 100644 index 00000000..ce5c64a9 --- /dev/null +++ b/pkg/github/repos/item/item/actions/caches/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package caches +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/actions/caches/get_sort_query_parameter_type.go b/pkg/github/repos/item/item/actions/caches/get_sort_query_parameter_type.go new file mode 100644 index 00000000..85075674 --- /dev/null +++ b/pkg/github/repos/item/item/actions/caches/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package caches +type GetSortQueryParameterType int + +const ( + CREATED_AT_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + LAST_ACCESSED_AT_GETSORTQUERYPARAMETERTYPE + SIZE_IN_BYTES_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created_at", "last_accessed_at", "size_in_bytes"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_AT_GETSORTQUERYPARAMETERTYPE + switch v { + case "created_at": + result = CREATED_AT_GETSORTQUERYPARAMETERTYPE + case "last_accessed_at": + result = LAST_ACCESSED_AT_GETSORTQUERYPARAMETERTYPE + case "size_in_bytes": + result = SIZE_IN_BYTES_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/actions/runs/get_status_query_parameter_type.go b/pkg/github/repos/item/item/actions/runs/get_status_query_parameter_type.go new file mode 100644 index 00000000..701adba1 --- /dev/null +++ b/pkg/github/repos/item/item/actions/runs/get_status_query_parameter_type.go @@ -0,0 +1,69 @@ +package runs +type GetStatusQueryParameterType int + +const ( + COMPLETED_GETSTATUSQUERYPARAMETERTYPE GetStatusQueryParameterType = iota + ACTION_REQUIRED_GETSTATUSQUERYPARAMETERTYPE + CANCELLED_GETSTATUSQUERYPARAMETERTYPE + FAILURE_GETSTATUSQUERYPARAMETERTYPE + NEUTRAL_GETSTATUSQUERYPARAMETERTYPE + SKIPPED_GETSTATUSQUERYPARAMETERTYPE + STALE_GETSTATUSQUERYPARAMETERTYPE + SUCCESS_GETSTATUSQUERYPARAMETERTYPE + TIMED_OUT_GETSTATUSQUERYPARAMETERTYPE + IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + QUEUED_GETSTATUSQUERYPARAMETERTYPE + REQUESTED_GETSTATUSQUERYPARAMETERTYPE + WAITING_GETSTATUSQUERYPARAMETERTYPE + PENDING_GETSTATUSQUERYPARAMETERTYPE +) + +func (i GetStatusQueryParameterType) String() string { + return []string{"completed", "action_required", "cancelled", "failure", "neutral", "skipped", "stale", "success", "timed_out", "in_progress", "queued", "requested", "waiting", "pending"}[i] +} +func ParseGetStatusQueryParameterType(v string) (any, error) { + result := COMPLETED_GETSTATUSQUERYPARAMETERTYPE + switch v { + case "completed": + result = COMPLETED_GETSTATUSQUERYPARAMETERTYPE + case "action_required": + result = ACTION_REQUIRED_GETSTATUSQUERYPARAMETERTYPE + case "cancelled": + result = CANCELLED_GETSTATUSQUERYPARAMETERTYPE + case "failure": + result = FAILURE_GETSTATUSQUERYPARAMETERTYPE + case "neutral": + result = NEUTRAL_GETSTATUSQUERYPARAMETERTYPE + case "skipped": + result = SKIPPED_GETSTATUSQUERYPARAMETERTYPE + case "stale": + result = STALE_GETSTATUSQUERYPARAMETERTYPE + case "success": + result = SUCCESS_GETSTATUSQUERYPARAMETERTYPE + case "timed_out": + result = TIMED_OUT_GETSTATUSQUERYPARAMETERTYPE + case "in_progress": + result = IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + case "queued": + result = QUEUED_GETSTATUSQUERYPARAMETERTYPE + case "requested": + result = REQUESTED_GETSTATUSQUERYPARAMETERTYPE + case "waiting": + result = WAITING_GETSTATUSQUERYPARAMETERTYPE + case "pending": + result = PENDING_GETSTATUSQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStatusQueryParameterType(values []GetStatusQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStatusQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/actions/runs/item/jobs/get_filter_query_parameter_type.go b/pkg/github/repos/item/item/actions/runs/item/jobs/get_filter_query_parameter_type.go new file mode 100644 index 00000000..b1a10d22 --- /dev/null +++ b/pkg/github/repos/item/item/actions/runs/item/jobs/get_filter_query_parameter_type.go @@ -0,0 +1,33 @@ +package jobs +type GetFilterQueryParameterType int + +const ( + LATEST_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"latest", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := LATEST_GETFILTERQUERYPARAMETERTYPE + switch v { + case "latest": + result = LATEST_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/actions/runs/item/pending_deployments/pending_escaped_deployments_post_request_body_escaped_state.go b/pkg/github/repos/item/item/actions/runs/item/pending_deployments/pending_escaped_deployments_post_request_body_escaped_state.go new file mode 100644 index 00000000..1a1cbf45 --- /dev/null +++ b/pkg/github/repos/item/item/actions/runs/item/pending_deployments/pending_escaped_deployments_post_request_body_escaped_state.go @@ -0,0 +1,34 @@ +package pending_deployments +// Whether to approve or reject deployment to the specified environments. +type Pending_deploymentsPostRequestBody_state int + +const ( + APPROVED_PENDING_DEPLOYMENTSPOSTREQUESTBODY_STATE Pending_deploymentsPostRequestBody_state = iota + REJECTED_PENDING_DEPLOYMENTSPOSTREQUESTBODY_STATE +) + +func (i Pending_deploymentsPostRequestBody_state) String() string { + return []string{"approved", "rejected"}[i] +} +func ParsePending_deploymentsPostRequestBody_state(v string) (any, error) { + result := APPROVED_PENDING_DEPLOYMENTSPOSTREQUESTBODY_STATE + switch v { + case "approved": + result = APPROVED_PENDING_DEPLOYMENTSPOSTREQUESTBODY_STATE + case "rejected": + result = REJECTED_PENDING_DEPLOYMENTSPOSTREQUESTBODY_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializePending_deploymentsPostRequestBody_state(values []Pending_deploymentsPostRequestBody_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Pending_deploymentsPostRequestBody_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/actions/workflows/item/runs/get_status_query_parameter_type.go b/pkg/github/repos/item/item/actions/workflows/item/runs/get_status_query_parameter_type.go new file mode 100644 index 00000000..701adba1 --- /dev/null +++ b/pkg/github/repos/item/item/actions/workflows/item/runs/get_status_query_parameter_type.go @@ -0,0 +1,69 @@ +package runs +type GetStatusQueryParameterType int + +const ( + COMPLETED_GETSTATUSQUERYPARAMETERTYPE GetStatusQueryParameterType = iota + ACTION_REQUIRED_GETSTATUSQUERYPARAMETERTYPE + CANCELLED_GETSTATUSQUERYPARAMETERTYPE + FAILURE_GETSTATUSQUERYPARAMETERTYPE + NEUTRAL_GETSTATUSQUERYPARAMETERTYPE + SKIPPED_GETSTATUSQUERYPARAMETERTYPE + STALE_GETSTATUSQUERYPARAMETERTYPE + SUCCESS_GETSTATUSQUERYPARAMETERTYPE + TIMED_OUT_GETSTATUSQUERYPARAMETERTYPE + IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + QUEUED_GETSTATUSQUERYPARAMETERTYPE + REQUESTED_GETSTATUSQUERYPARAMETERTYPE + WAITING_GETSTATUSQUERYPARAMETERTYPE + PENDING_GETSTATUSQUERYPARAMETERTYPE +) + +func (i GetStatusQueryParameterType) String() string { + return []string{"completed", "action_required", "cancelled", "failure", "neutral", "skipped", "stale", "success", "timed_out", "in_progress", "queued", "requested", "waiting", "pending"}[i] +} +func ParseGetStatusQueryParameterType(v string) (any, error) { + result := COMPLETED_GETSTATUSQUERYPARAMETERTYPE + switch v { + case "completed": + result = COMPLETED_GETSTATUSQUERYPARAMETERTYPE + case "action_required": + result = ACTION_REQUIRED_GETSTATUSQUERYPARAMETERTYPE + case "cancelled": + result = CANCELLED_GETSTATUSQUERYPARAMETERTYPE + case "failure": + result = FAILURE_GETSTATUSQUERYPARAMETERTYPE + case "neutral": + result = NEUTRAL_GETSTATUSQUERYPARAMETERTYPE + case "skipped": + result = SKIPPED_GETSTATUSQUERYPARAMETERTYPE + case "stale": + result = STALE_GETSTATUSQUERYPARAMETERTYPE + case "success": + result = SUCCESS_GETSTATUSQUERYPARAMETERTYPE + case "timed_out": + result = TIMED_OUT_GETSTATUSQUERYPARAMETERTYPE + case "in_progress": + result = IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + case "queued": + result = QUEUED_GETSTATUSQUERYPARAMETERTYPE + case "requested": + result = REQUESTED_GETSTATUSQUERYPARAMETERTYPE + case "waiting": + result = WAITING_GETSTATUSQUERYPARAMETERTYPE + case "pending": + result = PENDING_GETSTATUSQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStatusQueryParameterType(values []GetStatusQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStatusQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/activity/get_activity_escaped_type_query_parameter_type.go b/pkg/github/repos/item/item/activity/get_activity_escaped_type_query_parameter_type.go new file mode 100644 index 00000000..928f20f1 --- /dev/null +++ b/pkg/github/repos/item/item/activity/get_activity_escaped_type_query_parameter_type.go @@ -0,0 +1,45 @@ +package activity +type GetActivity_typeQueryParameterType int + +const ( + PUSH_GETACTIVITY_TYPEQUERYPARAMETERTYPE GetActivity_typeQueryParameterType = iota + FORCE_PUSH_GETACTIVITY_TYPEQUERYPARAMETERTYPE + BRANCH_CREATION_GETACTIVITY_TYPEQUERYPARAMETERTYPE + BRANCH_DELETION_GETACTIVITY_TYPEQUERYPARAMETERTYPE + PR_MERGE_GETACTIVITY_TYPEQUERYPARAMETERTYPE + MERGE_QUEUE_MERGE_GETACTIVITY_TYPEQUERYPARAMETERTYPE +) + +func (i GetActivity_typeQueryParameterType) String() string { + return []string{"push", "force_push", "branch_creation", "branch_deletion", "pr_merge", "merge_queue_merge"}[i] +} +func ParseGetActivity_typeQueryParameterType(v string) (any, error) { + result := PUSH_GETACTIVITY_TYPEQUERYPARAMETERTYPE + switch v { + case "push": + result = PUSH_GETACTIVITY_TYPEQUERYPARAMETERTYPE + case "force_push": + result = FORCE_PUSH_GETACTIVITY_TYPEQUERYPARAMETERTYPE + case "branch_creation": + result = BRANCH_CREATION_GETACTIVITY_TYPEQUERYPARAMETERTYPE + case "branch_deletion": + result = BRANCH_DELETION_GETACTIVITY_TYPEQUERYPARAMETERTYPE + case "pr_merge": + result = PR_MERGE_GETACTIVITY_TYPEQUERYPARAMETERTYPE + case "merge_queue_merge": + result = MERGE_QUEUE_MERGE_GETACTIVITY_TYPEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetActivity_typeQueryParameterType(values []GetActivity_typeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetActivity_typeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/activity/get_direction_query_parameter_type.go b/pkg/github/repos/item/item/activity/get_direction_query_parameter_type.go new file mode 100644 index 00000000..33689c97 --- /dev/null +++ b/pkg/github/repos/item/item/activity/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package activity +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/activity/get_time_escaped_period_query_parameter_type.go b/pkg/github/repos/item/item/activity/get_time_escaped_period_query_parameter_type.go new file mode 100644 index 00000000..f44010c0 --- /dev/null +++ b/pkg/github/repos/item/item/activity/get_time_escaped_period_query_parameter_type.go @@ -0,0 +1,42 @@ +package activity +type GetTime_periodQueryParameterType int + +const ( + DAY_GETTIME_PERIODQUERYPARAMETERTYPE GetTime_periodQueryParameterType = iota + WEEK_GETTIME_PERIODQUERYPARAMETERTYPE + MONTH_GETTIME_PERIODQUERYPARAMETERTYPE + QUARTER_GETTIME_PERIODQUERYPARAMETERTYPE + YEAR_GETTIME_PERIODQUERYPARAMETERTYPE +) + +func (i GetTime_periodQueryParameterType) String() string { + return []string{"day", "week", "month", "quarter", "year"}[i] +} +func ParseGetTime_periodQueryParameterType(v string) (any, error) { + result := DAY_GETTIME_PERIODQUERYPARAMETERTYPE + switch v { + case "day": + result = DAY_GETTIME_PERIODQUERYPARAMETERTYPE + case "week": + result = WEEK_GETTIME_PERIODQUERYPARAMETERTYPE + case "month": + result = MONTH_GETTIME_PERIODQUERYPARAMETERTYPE + case "quarter": + result = QUARTER_GETTIME_PERIODQUERYPARAMETERTYPE + case "year": + result = YEAR_GETTIME_PERIODQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetTime_periodQueryParameterType(values []GetTime_periodQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTime_periodQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/checkruns/check_runs_post_request_body_member1_escaped_status.go b/pkg/github/repos/item/item/checkruns/check_runs_post_request_body_member1_escaped_status.go new file mode 100644 index 00000000..9ee18385 --- /dev/null +++ b/pkg/github/repos/item/item/checkruns/check_runs_post_request_body_member1_escaped_status.go @@ -0,0 +1,30 @@ +package checkruns +type CheckRunsPostRequestBodyMember1_status int + +const ( + COMPLETED_CHECKRUNSPOSTREQUESTBODYMEMBER1_STATUS CheckRunsPostRequestBodyMember1_status = iota +) + +func (i CheckRunsPostRequestBodyMember1_status) String() string { + return []string{"completed"}[i] +} +func ParseCheckRunsPostRequestBodyMember1_status(v string) (any, error) { + result := COMPLETED_CHECKRUNSPOSTREQUESTBODYMEMBER1_STATUS + switch v { + case "completed": + result = COMPLETED_CHECKRUNSPOSTREQUESTBODYMEMBER1_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeCheckRunsPostRequestBodyMember1_status(values []CheckRunsPostRequestBodyMember1_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CheckRunsPostRequestBodyMember1_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/checkruns/check_runs_post_request_body_member2_escaped_status.go b/pkg/github/repos/item/item/checkruns/check_runs_post_request_body_member2_escaped_status.go new file mode 100644 index 00000000..1bdf3890 --- /dev/null +++ b/pkg/github/repos/item/item/checkruns/check_runs_post_request_body_member2_escaped_status.go @@ -0,0 +1,33 @@ +package checkruns +type CheckRunsPostRequestBodyMember2_status int + +const ( + QUEUED_CHECKRUNSPOSTREQUESTBODYMEMBER2_STATUS CheckRunsPostRequestBodyMember2_status = iota + IN_PROGRESS_CHECKRUNSPOSTREQUESTBODYMEMBER2_STATUS +) + +func (i CheckRunsPostRequestBodyMember2_status) String() string { + return []string{"queued", "in_progress"}[i] +} +func ParseCheckRunsPostRequestBodyMember2_status(v string) (any, error) { + result := QUEUED_CHECKRUNSPOSTREQUESTBODYMEMBER2_STATUS + switch v { + case "queued": + result = QUEUED_CHECKRUNSPOSTREQUESTBODYMEMBER2_STATUS + case "in_progress": + result = IN_PROGRESS_CHECKRUNSPOSTREQUESTBODYMEMBER2_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeCheckRunsPostRequestBodyMember2_status(values []CheckRunsPostRequestBodyMember2_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CheckRunsPostRequestBodyMember2_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/checkruns/item/with_check_escaped_run_escaped_patch_request_body_member1_escaped_status.go b/pkg/github/repos/item/item/checkruns/item/with_check_escaped_run_escaped_patch_request_body_member1_escaped_status.go new file mode 100644 index 00000000..4d59d916 --- /dev/null +++ b/pkg/github/repos/item/item/checkruns/item/with_check_escaped_run_escaped_patch_request_body_member1_escaped_status.go @@ -0,0 +1,30 @@ +package item +type WithCheck_run_PatchRequestBodyMember1_status int + +const ( + COMPLETED_WITHCHECK_RUN_PATCHREQUESTBODYMEMBER1_STATUS WithCheck_run_PatchRequestBodyMember1_status = iota +) + +func (i WithCheck_run_PatchRequestBodyMember1_status) String() string { + return []string{"completed"}[i] +} +func ParseWithCheck_run_PatchRequestBodyMember1_status(v string) (any, error) { + result := COMPLETED_WITHCHECK_RUN_PATCHREQUESTBODYMEMBER1_STATUS + switch v { + case "completed": + result = COMPLETED_WITHCHECK_RUN_PATCHREQUESTBODYMEMBER1_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeWithCheck_run_PatchRequestBodyMember1_status(values []WithCheck_run_PatchRequestBodyMember1_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithCheck_run_PatchRequestBodyMember1_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/checkruns/item/with_check_escaped_run_escaped_patch_request_body_member2_escaped_status.go b/pkg/github/repos/item/item/checkruns/item/with_check_escaped_run_escaped_patch_request_body_member2_escaped_status.go new file mode 100644 index 00000000..0c6a0e07 --- /dev/null +++ b/pkg/github/repos/item/item/checkruns/item/with_check_escaped_run_escaped_patch_request_body_member2_escaped_status.go @@ -0,0 +1,33 @@ +package item +type WithCheck_run_PatchRequestBodyMember2_status int + +const ( + QUEUED_WITHCHECK_RUN_PATCHREQUESTBODYMEMBER2_STATUS WithCheck_run_PatchRequestBodyMember2_status = iota + IN_PROGRESS_WITHCHECK_RUN_PATCHREQUESTBODYMEMBER2_STATUS +) + +func (i WithCheck_run_PatchRequestBodyMember2_status) String() string { + return []string{"queued", "in_progress"}[i] +} +func ParseWithCheck_run_PatchRequestBodyMember2_status(v string) (any, error) { + result := QUEUED_WITHCHECK_RUN_PATCHREQUESTBODYMEMBER2_STATUS + switch v { + case "queued": + result = QUEUED_WITHCHECK_RUN_PATCHREQUESTBODYMEMBER2_STATUS + case "in_progress": + result = IN_PROGRESS_WITHCHECK_RUN_PATCHREQUESTBODYMEMBER2_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeWithCheck_run_PatchRequestBodyMember2_status(values []WithCheck_run_PatchRequestBodyMember2_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithCheck_run_PatchRequestBodyMember2_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/checksuites/item/checkruns/get_filter_query_parameter_type.go b/pkg/github/repos/item/item/checksuites/item/checkruns/get_filter_query_parameter_type.go new file mode 100644 index 00000000..6cab081f --- /dev/null +++ b/pkg/github/repos/item/item/checksuites/item/checkruns/get_filter_query_parameter_type.go @@ -0,0 +1,33 @@ +package checkruns +type GetFilterQueryParameterType int + +const ( + LATEST_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"latest", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := LATEST_GETFILTERQUERYPARAMETERTYPE + switch v { + case "latest": + result = LATEST_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/checksuites/item/checkruns/get_status_query_parameter_type.go b/pkg/github/repos/item/item/checksuites/item/checkruns/get_status_query_parameter_type.go new file mode 100644 index 00000000..895d452b --- /dev/null +++ b/pkg/github/repos/item/item/checksuites/item/checkruns/get_status_query_parameter_type.go @@ -0,0 +1,36 @@ +package checkruns +type GetStatusQueryParameterType int + +const ( + QUEUED_GETSTATUSQUERYPARAMETERTYPE GetStatusQueryParameterType = iota + IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + COMPLETED_GETSTATUSQUERYPARAMETERTYPE +) + +func (i GetStatusQueryParameterType) String() string { + return []string{"queued", "in_progress", "completed"}[i] +} +func ParseGetStatusQueryParameterType(v string) (any, error) { + result := QUEUED_GETSTATUSQUERYPARAMETERTYPE + switch v { + case "queued": + result = QUEUED_GETSTATUSQUERYPARAMETERTYPE + case "in_progress": + result = IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + case "completed": + result = COMPLETED_GETSTATUSQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStatusQueryParameterType(values []GetStatusQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStatusQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/codescanning/alerts/get_direction_query_parameter_type.go b/pkg/github/repos/item/item/codescanning/alerts/get_direction_query_parameter_type.go new file mode 100644 index 00000000..0606c6d4 --- /dev/null +++ b/pkg/github/repos/item/item/codescanning/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/codescanning/alerts/get_sort_query_parameter_type.go b/pkg/github/repos/item/item/codescanning/alerts/get_sort_query_parameter_type.go new file mode 100644 index 00000000..719c5fb3 --- /dev/null +++ b/pkg/github/repos/item/item/codescanning/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/codescanning/analyses/get_direction_query_parameter_type.go b/pkg/github/repos/item/item/codescanning/analyses/get_direction_query_parameter_type.go new file mode 100644 index 00000000..a6995a73 --- /dev/null +++ b/pkg/github/repos/item/item/codescanning/analyses/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package analyses +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/codescanning/analyses/get_sort_query_parameter_type.go b/pkg/github/repos/item/item/codescanning/analyses/get_sort_query_parameter_type.go new file mode 100644 index 00000000..d6c55314 --- /dev/null +++ b/pkg/github/repos/item/item/codescanning/analyses/get_sort_query_parameter_type.go @@ -0,0 +1,30 @@ +package analyses +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/collaborators/get_affiliation_query_parameter_type.go b/pkg/github/repos/item/item/collaborators/get_affiliation_query_parameter_type.go new file mode 100644 index 00000000..b4840b8d --- /dev/null +++ b/pkg/github/repos/item/item/collaborators/get_affiliation_query_parameter_type.go @@ -0,0 +1,36 @@ +package collaborators +type GetAffiliationQueryParameterType int + +const ( + OUTSIDE_GETAFFILIATIONQUERYPARAMETERTYPE GetAffiliationQueryParameterType = iota + DIRECT_GETAFFILIATIONQUERYPARAMETERTYPE + ALL_GETAFFILIATIONQUERYPARAMETERTYPE +) + +func (i GetAffiliationQueryParameterType) String() string { + return []string{"outside", "direct", "all"}[i] +} +func ParseGetAffiliationQueryParameterType(v string) (any, error) { + result := OUTSIDE_GETAFFILIATIONQUERYPARAMETERTYPE + switch v { + case "outside": + result = OUTSIDE_GETAFFILIATIONQUERYPARAMETERTYPE + case "direct": + result = DIRECT_GETAFFILIATIONQUERYPARAMETERTYPE + case "all": + result = ALL_GETAFFILIATIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetAffiliationQueryParameterType(values []GetAffiliationQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetAffiliationQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/collaborators/get_permission_query_parameter_type.go b/pkg/github/repos/item/item/collaborators/get_permission_query_parameter_type.go new file mode 100644 index 00000000..90dc54a8 --- /dev/null +++ b/pkg/github/repos/item/item/collaborators/get_permission_query_parameter_type.go @@ -0,0 +1,42 @@ +package collaborators +type GetPermissionQueryParameterType int + +const ( + PULL_GETPERMISSIONQUERYPARAMETERTYPE GetPermissionQueryParameterType = iota + TRIAGE_GETPERMISSIONQUERYPARAMETERTYPE + PUSH_GETPERMISSIONQUERYPARAMETERTYPE + MAINTAIN_GETPERMISSIONQUERYPARAMETERTYPE + ADMIN_GETPERMISSIONQUERYPARAMETERTYPE +) + +func (i GetPermissionQueryParameterType) String() string { + return []string{"pull", "triage", "push", "maintain", "admin"}[i] +} +func ParseGetPermissionQueryParameterType(v string) (any, error) { + result := PULL_GETPERMISSIONQUERYPARAMETERTYPE + switch v { + case "pull": + result = PULL_GETPERMISSIONQUERYPARAMETERTYPE + case "triage": + result = TRIAGE_GETPERMISSIONQUERYPARAMETERTYPE + case "push": + result = PUSH_GETPERMISSIONQUERYPARAMETERTYPE + case "maintain": + result = MAINTAIN_GETPERMISSIONQUERYPARAMETERTYPE + case "admin": + result = ADMIN_GETPERMISSIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetPermissionQueryParameterType(values []GetPermissionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetPermissionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/comments/item/reactions/get_content_query_parameter_type.go b/pkg/github/repos/item/item/comments/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 00000000..f3e64542 --- /dev/null +++ b/pkg/github/repos/item/item/comments/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,51 @@ +package reactions +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/comments/item/reactions/reactions_post_request_body_escaped_content.go b/pkg/github/repos/item/item/comments/item/reactions/reactions_post_request_body_escaped_content.go new file mode 100644 index 00000000..3f1e2455 --- /dev/null +++ b/pkg/github/repos/item/item/comments/item/reactions/reactions_post_request_body_escaped_content.go @@ -0,0 +1,52 @@ +package reactions +// The [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions) to add to the commit comment. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return nil, nil + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/commits/item/checkruns/get_filter_query_parameter_type.go b/pkg/github/repos/item/item/commits/item/checkruns/get_filter_query_parameter_type.go new file mode 100644 index 00000000..6cab081f --- /dev/null +++ b/pkg/github/repos/item/item/commits/item/checkruns/get_filter_query_parameter_type.go @@ -0,0 +1,33 @@ +package checkruns +type GetFilterQueryParameterType int + +const ( + LATEST_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"latest", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := LATEST_GETFILTERQUERYPARAMETERTYPE + switch v { + case "latest": + result = LATEST_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/commits/item/checkruns/get_status_query_parameter_type.go b/pkg/github/repos/item/item/commits/item/checkruns/get_status_query_parameter_type.go new file mode 100644 index 00000000..895d452b --- /dev/null +++ b/pkg/github/repos/item/item/commits/item/checkruns/get_status_query_parameter_type.go @@ -0,0 +1,36 @@ +package checkruns +type GetStatusQueryParameterType int + +const ( + QUEUED_GETSTATUSQUERYPARAMETERTYPE GetStatusQueryParameterType = iota + IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + COMPLETED_GETSTATUSQUERYPARAMETERTYPE +) + +func (i GetStatusQueryParameterType) String() string { + return []string{"queued", "in_progress", "completed"}[i] +} +func ParseGetStatusQueryParameterType(v string) (any, error) { + result := QUEUED_GETSTATUSQUERYPARAMETERTYPE + switch v { + case "queued": + result = QUEUED_GETSTATUSQUERYPARAMETERTYPE + case "in_progress": + result = IN_PROGRESS_GETSTATUSQUERYPARAMETERTYPE + case "completed": + result = COMPLETED_GETSTATUSQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStatusQueryParameterType(values []GetStatusQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStatusQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/dependabot/alerts/get_direction_query_parameter_type.go b/pkg/github/repos/item/item/dependabot/alerts/get_direction_query_parameter_type.go new file mode 100644 index 00000000..0606c6d4 --- /dev/null +++ b/pkg/github/repos/item/item/dependabot/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/dependabot/alerts/get_scope_query_parameter_type.go b/pkg/github/repos/item/item/dependabot/alerts/get_scope_query_parameter_type.go new file mode 100644 index 00000000..5d3e9a31 --- /dev/null +++ b/pkg/github/repos/item/item/dependabot/alerts/get_scope_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetScopeQueryParameterType int + +const ( + DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE GetScopeQueryParameterType = iota + RUNTIME_GETSCOPEQUERYPARAMETERTYPE +) + +func (i GetScopeQueryParameterType) String() string { + return []string{"development", "runtime"}[i] +} +func ParseGetScopeQueryParameterType(v string) (any, error) { + result := DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE + switch v { + case "development": + result = DEVELOPMENT_GETSCOPEQUERYPARAMETERTYPE + case "runtime": + result = RUNTIME_GETSCOPEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetScopeQueryParameterType(values []GetScopeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetScopeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/dependabot/alerts/get_sort_query_parameter_type.go b/pkg/github/repos/item/item/dependabot/alerts/get_sort_query_parameter_type.go new file mode 100644 index 00000000..719c5fb3 --- /dev/null +++ b/pkg/github/repos/item/item/dependabot/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/dependabot/alerts/item/with_alert_escaped_number_patch_request_body_escaped_dismissed_escaped_reason.go b/pkg/github/repos/item/item/dependabot/alerts/item/with_alert_escaped_number_patch_request_body_escaped_dismissed_escaped_reason.go new file mode 100644 index 00000000..caad02d7 --- /dev/null +++ b/pkg/github/repos/item/item/dependabot/alerts/item/with_alert_escaped_number_patch_request_body_escaped_dismissed_escaped_reason.go @@ -0,0 +1,43 @@ +package item +// **Required when `state` is `dismissed`.** A reason for dismissing the alert. +type WithAlert_numberPatchRequestBody_dismissed_reason int + +const ( + FIX_STARTED_WITHALERT_NUMBERPATCHREQUESTBODY_DISMISSED_REASON WithAlert_numberPatchRequestBody_dismissed_reason = iota + INACCURATE_WITHALERT_NUMBERPATCHREQUESTBODY_DISMISSED_REASON + NO_BANDWIDTH_WITHALERT_NUMBERPATCHREQUESTBODY_DISMISSED_REASON + NOT_USED_WITHALERT_NUMBERPATCHREQUESTBODY_DISMISSED_REASON + TOLERABLE_RISK_WITHALERT_NUMBERPATCHREQUESTBODY_DISMISSED_REASON +) + +func (i WithAlert_numberPatchRequestBody_dismissed_reason) String() string { + return []string{"fix_started", "inaccurate", "no_bandwidth", "not_used", "tolerable_risk"}[i] +} +func ParseWithAlert_numberPatchRequestBody_dismissed_reason(v string) (any, error) { + result := FIX_STARTED_WITHALERT_NUMBERPATCHREQUESTBODY_DISMISSED_REASON + switch v { + case "fix_started": + result = FIX_STARTED_WITHALERT_NUMBERPATCHREQUESTBODY_DISMISSED_REASON + case "inaccurate": + result = INACCURATE_WITHALERT_NUMBERPATCHREQUESTBODY_DISMISSED_REASON + case "no_bandwidth": + result = NO_BANDWIDTH_WITHALERT_NUMBERPATCHREQUESTBODY_DISMISSED_REASON + case "not_used": + result = NOT_USED_WITHALERT_NUMBERPATCHREQUESTBODY_DISMISSED_REASON + case "tolerable_risk": + result = TOLERABLE_RISK_WITHALERT_NUMBERPATCHREQUESTBODY_DISMISSED_REASON + default: + return nil, nil + } + return &result, nil +} +func SerializeWithAlert_numberPatchRequestBody_dismissed_reason(values []WithAlert_numberPatchRequestBody_dismissed_reason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithAlert_numberPatchRequestBody_dismissed_reason) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/dependabot/alerts/item/with_alert_escaped_number_patch_request_body_escaped_state.go b/pkg/github/repos/item/item/dependabot/alerts/item/with_alert_escaped_number_patch_request_body_escaped_state.go new file mode 100644 index 00000000..54cbbe8b --- /dev/null +++ b/pkg/github/repos/item/item/dependabot/alerts/item/with_alert_escaped_number_patch_request_body_escaped_state.go @@ -0,0 +1,34 @@ +package item +// The state of the Dependabot alert.A `dismissed_reason` must be provided when setting the state to `dismissed`. +type WithAlert_numberPatchRequestBody_state int + +const ( + DISMISSED_WITHALERT_NUMBERPATCHREQUESTBODY_STATE WithAlert_numberPatchRequestBody_state = iota + OPEN_WITHALERT_NUMBERPATCHREQUESTBODY_STATE +) + +func (i WithAlert_numberPatchRequestBody_state) String() string { + return []string{"dismissed", "open"}[i] +} +func ParseWithAlert_numberPatchRequestBody_state(v string) (any, error) { + result := DISMISSED_WITHALERT_NUMBERPATCHREQUESTBODY_STATE + switch v { + case "dismissed": + result = DISMISSED_WITHALERT_NUMBERPATCHREQUESTBODY_STATE + case "open": + result = OPEN_WITHALERT_NUMBERPATCHREQUESTBODY_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeWithAlert_numberPatchRequestBody_state(values []WithAlert_numberPatchRequestBody_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithAlert_numberPatchRequestBody_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/deployments/item/statuses/statuses_post_request_body_escaped_state.go b/pkg/github/repos/item/item/deployments/item/statuses/statuses_post_request_body_escaped_state.go new file mode 100644 index 00000000..18bc5c88 --- /dev/null +++ b/pkg/github/repos/item/item/deployments/item/statuses/statuses_post_request_body_escaped_state.go @@ -0,0 +1,49 @@ +package statuses +// The state of the status. When you set a transient deployment to `inactive`, the deployment will be shown as `destroyed` in GitHub. +type StatusesPostRequestBody_state int + +const ( + ERROR_STATUSESPOSTREQUESTBODY_STATE StatusesPostRequestBody_state = iota + FAILURE_STATUSESPOSTREQUESTBODY_STATE + INACTIVE_STATUSESPOSTREQUESTBODY_STATE + IN_PROGRESS_STATUSESPOSTREQUESTBODY_STATE + QUEUED_STATUSESPOSTREQUESTBODY_STATE + PENDING_STATUSESPOSTREQUESTBODY_STATE + SUCCESS_STATUSESPOSTREQUESTBODY_STATE +) + +func (i StatusesPostRequestBody_state) String() string { + return []string{"error", "failure", "inactive", "in_progress", "queued", "pending", "success"}[i] +} +func ParseStatusesPostRequestBody_state(v string) (any, error) { + result := ERROR_STATUSESPOSTREQUESTBODY_STATE + switch v { + case "error": + result = ERROR_STATUSESPOSTREQUESTBODY_STATE + case "failure": + result = FAILURE_STATUSESPOSTREQUESTBODY_STATE + case "inactive": + result = INACTIVE_STATUSESPOSTREQUESTBODY_STATE + case "in_progress": + result = IN_PROGRESS_STATUSESPOSTREQUESTBODY_STATE + case "queued": + result = QUEUED_STATUSESPOSTREQUESTBODY_STATE + case "pending": + result = PENDING_STATUSESPOSTREQUESTBODY_STATE + case "success": + result = SUCCESS_STATUSESPOSTREQUESTBODY_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeStatusesPostRequestBody_state(values []StatusesPostRequestBody_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i StatusesPostRequestBody_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/forks/get_sort_query_parameter_type.go b/pkg/github/repos/item/item/forks/get_sort_query_parameter_type.go new file mode 100644 index 00000000..9ca668e4 --- /dev/null +++ b/pkg/github/repos/item/item/forks/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package forks +type GetSortQueryParameterType int + +const ( + NEWEST_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + OLDEST_GETSORTQUERYPARAMETERTYPE + STARGAZERS_GETSORTQUERYPARAMETERTYPE + WATCHERS_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"newest", "oldest", "stargazers", "watchers"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := NEWEST_GETSORTQUERYPARAMETERTYPE + switch v { + case "newest": + result = NEWEST_GETSORTQUERYPARAMETERTYPE + case "oldest": + result = OLDEST_GETSORTQUERYPARAMETERTYPE + case "stargazers": + result = STARGAZERS_GETSORTQUERYPARAMETERTYPE + case "watchers": + result = WATCHERS_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/git/tags/tags_post_request_body_escaped_type.go b/pkg/github/repos/item/item/git/tags/tags_post_request_body_escaped_type.go new file mode 100644 index 00000000..d4ef1483 --- /dev/null +++ b/pkg/github/repos/item/item/git/tags/tags_post_request_body_escaped_type.go @@ -0,0 +1,37 @@ +package tags +// The type of the object we're tagging. Normally this is a `commit` but it can also be a `tree` or a `blob`. +type TagsPostRequestBody_type int + +const ( + COMMIT_TAGSPOSTREQUESTBODY_TYPE TagsPostRequestBody_type = iota + TREE_TAGSPOSTREQUESTBODY_TYPE + BLOB_TAGSPOSTREQUESTBODY_TYPE +) + +func (i TagsPostRequestBody_type) String() string { + return []string{"commit", "tree", "blob"}[i] +} +func ParseTagsPostRequestBody_type(v string) (any, error) { + result := COMMIT_TAGSPOSTREQUESTBODY_TYPE + switch v { + case "commit": + result = COMMIT_TAGSPOSTREQUESTBODY_TYPE + case "tree": + result = TREE_TAGSPOSTREQUESTBODY_TYPE + case "blob": + result = BLOB_TAGSPOSTREQUESTBODY_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeTagsPostRequestBody_type(values []TagsPostRequestBody_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i TagsPostRequestBody_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/git/trees/trees_post_request_body_escaped_tree_escaped_mode.go b/pkg/github/repos/item/item/git/trees/trees_post_request_body_escaped_tree_escaped_mode.go new file mode 100644 index 00000000..389f0fe6 --- /dev/null +++ b/pkg/github/repos/item/item/git/trees/trees_post_request_body_escaped_tree_escaped_mode.go @@ -0,0 +1,43 @@ +package trees +// The file mode; one of `100644` for file (blob), `100755` for executable (blob), `040000` for subdirectory (tree), `160000` for submodule (commit), or `120000` for a blob that specifies the path of a symlink. +type TreesPostRequestBody_tree_mode int + +const ( + ONEZEROZEROSIXFOURFOUR_TREESPOSTREQUESTBODY_TREE_MODE TreesPostRequestBody_tree_mode = iota + ONEZEROZEROSEVENFIVEFIVE_TREESPOSTREQUESTBODY_TREE_MODE + ZEROFOURZEROZEROZEROZERO_TREESPOSTREQUESTBODY_TREE_MODE + ONESIXZEROZEROZEROZERO_TREESPOSTREQUESTBODY_TREE_MODE + ONETWOZEROZEROZEROZERO_TREESPOSTREQUESTBODY_TREE_MODE +) + +func (i TreesPostRequestBody_tree_mode) String() string { + return []string{"100644", "100755", "040000", "160000", "120000"}[i] +} +func ParseTreesPostRequestBody_tree_mode(v string) (any, error) { + result := ONEZEROZEROSIXFOURFOUR_TREESPOSTREQUESTBODY_TREE_MODE + switch v { + case "100644": + result = ONEZEROZEROSIXFOURFOUR_TREESPOSTREQUESTBODY_TREE_MODE + case "100755": + result = ONEZEROZEROSEVENFIVEFIVE_TREESPOSTREQUESTBODY_TREE_MODE + case "040000": + result = ZEROFOURZEROZEROZEROZERO_TREESPOSTREQUESTBODY_TREE_MODE + case "160000": + result = ONESIXZEROZEROZEROZERO_TREESPOSTREQUESTBODY_TREE_MODE + case "120000": + result = ONETWOZEROZEROZEROZERO_TREESPOSTREQUESTBODY_TREE_MODE + default: + return nil, nil + } + return &result, nil +} +func SerializeTreesPostRequestBody_tree_mode(values []TreesPostRequestBody_tree_mode) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i TreesPostRequestBody_tree_mode) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/git/trees/trees_post_request_body_escaped_tree_escaped_type.go b/pkg/github/repos/item/item/git/trees/trees_post_request_body_escaped_tree_escaped_type.go new file mode 100644 index 00000000..ff3383e2 --- /dev/null +++ b/pkg/github/repos/item/item/git/trees/trees_post_request_body_escaped_tree_escaped_type.go @@ -0,0 +1,37 @@ +package trees +// Either `blob`, `tree`, or `commit`. +type TreesPostRequestBody_tree_type int + +const ( + BLOB_TREESPOSTREQUESTBODY_TREE_TYPE TreesPostRequestBody_tree_type = iota + TREE_TREESPOSTREQUESTBODY_TREE_TYPE + COMMIT_TREESPOSTREQUESTBODY_TREE_TYPE +) + +func (i TreesPostRequestBody_tree_type) String() string { + return []string{"blob", "tree", "commit"}[i] +} +func ParseTreesPostRequestBody_tree_type(v string) (any, error) { + result := BLOB_TREESPOSTREQUESTBODY_TREE_TYPE + switch v { + case "blob": + result = BLOB_TREESPOSTREQUESTBODY_TREE_TYPE + case "tree": + result = TREE_TREESPOSTREQUESTBODY_TREE_TYPE + case "commit": + result = COMMIT_TREESPOSTREQUESTBODY_TREE_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeTreesPostRequestBody_tree_type(values []TreesPostRequestBody_tree_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i TreesPostRequestBody_tree_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/invitations/item/with_invitation_escaped_patch_request_body_escaped_permissions.go b/pkg/github/repos/item/item/invitations/item/with_invitation_escaped_patch_request_body_escaped_permissions.go new file mode 100644 index 00000000..f72b677b --- /dev/null +++ b/pkg/github/repos/item/item/invitations/item/with_invitation_escaped_patch_request_body_escaped_permissions.go @@ -0,0 +1,43 @@ +package item +// The permissions that the associated user will have on the repository. Valid values are `read`, `write`, `maintain`, `triage`, and `admin`. +type WithInvitation_PatchRequestBody_permissions int + +const ( + READ_WITHINVITATION_PATCHREQUESTBODY_PERMISSIONS WithInvitation_PatchRequestBody_permissions = iota + WRITE_WITHINVITATION_PATCHREQUESTBODY_PERMISSIONS + MAINTAIN_WITHINVITATION_PATCHREQUESTBODY_PERMISSIONS + TRIAGE_WITHINVITATION_PATCHREQUESTBODY_PERMISSIONS + ADMIN_WITHINVITATION_PATCHREQUESTBODY_PERMISSIONS +) + +func (i WithInvitation_PatchRequestBody_permissions) String() string { + return []string{"read", "write", "maintain", "triage", "admin"}[i] +} +func ParseWithInvitation_PatchRequestBody_permissions(v string) (any, error) { + result := READ_WITHINVITATION_PATCHREQUESTBODY_PERMISSIONS + switch v { + case "read": + result = READ_WITHINVITATION_PATCHREQUESTBODY_PERMISSIONS + case "write": + result = WRITE_WITHINVITATION_PATCHREQUESTBODY_PERMISSIONS + case "maintain": + result = MAINTAIN_WITHINVITATION_PATCHREQUESTBODY_PERMISSIONS + case "triage": + result = TRIAGE_WITHINVITATION_PATCHREQUESTBODY_PERMISSIONS + case "admin": + result = ADMIN_WITHINVITATION_PATCHREQUESTBODY_PERMISSIONS + default: + return nil, nil + } + return &result, nil +} +func SerializeWithInvitation_PatchRequestBody_permissions(values []WithInvitation_PatchRequestBody_permissions) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithInvitation_PatchRequestBody_permissions) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/issues/comments/get_direction_query_parameter_type.go b/pkg/github/repos/item/item/issues/comments/get_direction_query_parameter_type.go new file mode 100644 index 00000000..6561eb6a --- /dev/null +++ b/pkg/github/repos/item/item/issues/comments/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package comments +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/issues/comments/get_sort_query_parameter_type.go b/pkg/github/repos/item/item/issues/comments/get_sort_query_parameter_type.go new file mode 100644 index 00000000..34ad7acd --- /dev/null +++ b/pkg/github/repos/item/item/issues/comments/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package comments +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/issues/comments/item/reactions/get_content_query_parameter_type.go b/pkg/github/repos/item/item/issues/comments/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 00000000..f3e64542 --- /dev/null +++ b/pkg/github/repos/item/item/issues/comments/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,51 @@ +package reactions +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/issues/comments/item/reactions/reactions_post_request_body_escaped_content.go b/pkg/github/repos/item/item/issues/comments/item/reactions/reactions_post_request_body_escaped_content.go new file mode 100644 index 00000000..abd0db22 --- /dev/null +++ b/pkg/github/repos/item/item/issues/comments/item/reactions/reactions_post_request_body_escaped_content.go @@ -0,0 +1,52 @@ +package reactions +// The [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions) to add to the issue comment. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return nil, nil + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/issues/get_direction_query_parameter_type.go b/pkg/github/repos/item/item/issues/get_direction_query_parameter_type.go new file mode 100644 index 00000000..f176c1cc --- /dev/null +++ b/pkg/github/repos/item/item/issues/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package issues +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/issues/get_sort_query_parameter_type.go b/pkg/github/repos/item/item/issues/get_sort_query_parameter_type.go new file mode 100644 index 00000000..10b7912a --- /dev/null +++ b/pkg/github/repos/item/item/issues/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package issues +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + COMMENTS_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "comments"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "comments": + result = COMMENTS_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/issues/get_state_query_parameter_type.go b/pkg/github/repos/item/item/issues/get_state_query_parameter_type.go new file mode 100644 index 00000000..065faf93 --- /dev/null +++ b/pkg/github/repos/item/item/issues/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package issues +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/issues/item/lock/lock_put_request_body_escaped_lock_escaped_reason.go b/pkg/github/repos/item/item/issues/item/lock/lock_put_request_body_escaped_lock_escaped_reason.go new file mode 100644 index 00000000..64e085f3 --- /dev/null +++ b/pkg/github/repos/item/item/issues/item/lock/lock_put_request_body_escaped_lock_escaped_reason.go @@ -0,0 +1,40 @@ +package lock +// The reason for locking the issue or pull request conversation. Lock will fail if you don't use one of these reasons: * `off-topic` * `too heated` * `resolved` * `spam` +type LockPutRequestBody_lock_reason int + +const ( + OFFTOPIC_LOCKPUTREQUESTBODY_LOCK_REASON LockPutRequestBody_lock_reason = iota + TOOHEATED_LOCKPUTREQUESTBODY_LOCK_REASON + RESOLVED_LOCKPUTREQUESTBODY_LOCK_REASON + SPAM_LOCKPUTREQUESTBODY_LOCK_REASON +) + +func (i LockPutRequestBody_lock_reason) String() string { + return []string{"off-topic", "too heated", "resolved", "spam"}[i] +} +func ParseLockPutRequestBody_lock_reason(v string) (any, error) { + result := OFFTOPIC_LOCKPUTREQUESTBODY_LOCK_REASON + switch v { + case "off-topic": + result = OFFTOPIC_LOCKPUTREQUESTBODY_LOCK_REASON + case "too heated": + result = TOOHEATED_LOCKPUTREQUESTBODY_LOCK_REASON + case "resolved": + result = RESOLVED_LOCKPUTREQUESTBODY_LOCK_REASON + case "spam": + result = SPAM_LOCKPUTREQUESTBODY_LOCK_REASON + default: + return nil, nil + } + return &result, nil +} +func SerializeLockPutRequestBody_lock_reason(values []LockPutRequestBody_lock_reason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i LockPutRequestBody_lock_reason) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/issues/item/reactions/get_content_query_parameter_type.go b/pkg/github/repos/item/item/issues/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 00000000..f3e64542 --- /dev/null +++ b/pkg/github/repos/item/item/issues/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,51 @@ +package reactions +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/issues/item/reactions/reactions_post_request_body_escaped_content.go b/pkg/github/repos/item/item/issues/item/reactions/reactions_post_request_body_escaped_content.go new file mode 100644 index 00000000..a6a47f4e --- /dev/null +++ b/pkg/github/repos/item/item/issues/item/reactions/reactions_post_request_body_escaped_content.go @@ -0,0 +1,52 @@ +package reactions +// The [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions) to add to the issue. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return nil, nil + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/issues/item/with_issue_escaped_number_patch_request_body_escaped_state.go b/pkg/github/repos/item/item/issues/item/with_issue_escaped_number_patch_request_body_escaped_state.go new file mode 100644 index 00000000..69e63ff5 --- /dev/null +++ b/pkg/github/repos/item/item/issues/item/with_issue_escaped_number_patch_request_body_escaped_state.go @@ -0,0 +1,34 @@ +package item +// The open or closed state of the issue. +type WithIssue_numberPatchRequestBody_state int + +const ( + OPEN_WITHISSUE_NUMBERPATCHREQUESTBODY_STATE WithIssue_numberPatchRequestBody_state = iota + CLOSED_WITHISSUE_NUMBERPATCHREQUESTBODY_STATE +) + +func (i WithIssue_numberPatchRequestBody_state) String() string { + return []string{"open", "closed"}[i] +} +func ParseWithIssue_numberPatchRequestBody_state(v string) (any, error) { + result := OPEN_WITHISSUE_NUMBERPATCHREQUESTBODY_STATE + switch v { + case "open": + result = OPEN_WITHISSUE_NUMBERPATCHREQUESTBODY_STATE + case "closed": + result = CLOSED_WITHISSUE_NUMBERPATCHREQUESTBODY_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeWithIssue_numberPatchRequestBody_state(values []WithIssue_numberPatchRequestBody_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithIssue_numberPatchRequestBody_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/issues/item/with_issue_escaped_number_patch_request_body_escaped_state_escaped_reason.go b/pkg/github/repos/item/item/issues/item/with_issue_escaped_number_patch_request_body_escaped_state_escaped_reason.go new file mode 100644 index 00000000..7c6b63b0 --- /dev/null +++ b/pkg/github/repos/item/item/issues/item/with_issue_escaped_number_patch_request_body_escaped_state_escaped_reason.go @@ -0,0 +1,37 @@ +package item +// The reason for the state change. Ignored unless `state` is changed. +type WithIssue_numberPatchRequestBody_state_reason int + +const ( + COMPLETED_WITHISSUE_NUMBERPATCHREQUESTBODY_STATE_REASON WithIssue_numberPatchRequestBody_state_reason = iota + NOT_PLANNED_WITHISSUE_NUMBERPATCHREQUESTBODY_STATE_REASON + REOPENED_WITHISSUE_NUMBERPATCHREQUESTBODY_STATE_REASON +) + +func (i WithIssue_numberPatchRequestBody_state_reason) String() string { + return []string{"completed", "not_planned", "reopened"}[i] +} +func ParseWithIssue_numberPatchRequestBody_state_reason(v string) (any, error) { + result := COMPLETED_WITHISSUE_NUMBERPATCHREQUESTBODY_STATE_REASON + switch v { + case "completed": + result = COMPLETED_WITHISSUE_NUMBERPATCHREQUESTBODY_STATE_REASON + case "not_planned": + result = NOT_PLANNED_WITHISSUE_NUMBERPATCHREQUESTBODY_STATE_REASON + case "reopened": + result = REOPENED_WITHISSUE_NUMBERPATCHREQUESTBODY_STATE_REASON + default: + return nil, nil + } + return &result, nil +} +func SerializeWithIssue_numberPatchRequestBody_state_reason(values []WithIssue_numberPatchRequestBody_state_reason) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithIssue_numberPatchRequestBody_state_reason) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/milestones/get_direction_query_parameter_type.go b/pkg/github/repos/item/item/milestones/get_direction_query_parameter_type.go new file mode 100644 index 00000000..e719f3b6 --- /dev/null +++ b/pkg/github/repos/item/item/milestones/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package milestones +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/milestones/get_sort_query_parameter_type.go b/pkg/github/repos/item/item/milestones/get_sort_query_parameter_type.go new file mode 100644 index 00000000..038a8e8d --- /dev/null +++ b/pkg/github/repos/item/item/milestones/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package milestones +type GetSortQueryParameterType int + +const ( + DUE_ON_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + COMPLETENESS_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"due_on", "completeness"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := DUE_ON_GETSORTQUERYPARAMETERTYPE + switch v { + case "due_on": + result = DUE_ON_GETSORTQUERYPARAMETERTYPE + case "completeness": + result = COMPLETENESS_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/milestones/get_state_query_parameter_type.go b/pkg/github/repos/item/item/milestones/get_state_query_parameter_type.go new file mode 100644 index 00000000..7519c97f --- /dev/null +++ b/pkg/github/repos/item/item/milestones/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package milestones +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/milestones/item/with_milestone_escaped_number_patch_request_body_escaped_state.go b/pkg/github/repos/item/item/milestones/item/with_milestone_escaped_number_patch_request_body_escaped_state.go new file mode 100644 index 00000000..7a67c0df --- /dev/null +++ b/pkg/github/repos/item/item/milestones/item/with_milestone_escaped_number_patch_request_body_escaped_state.go @@ -0,0 +1,34 @@ +package item +// The state of the milestone. Either `open` or `closed`. +type WithMilestone_numberPatchRequestBody_state int + +const ( + OPEN_WITHMILESTONE_NUMBERPATCHREQUESTBODY_STATE WithMilestone_numberPatchRequestBody_state = iota + CLOSED_WITHMILESTONE_NUMBERPATCHREQUESTBODY_STATE +) + +func (i WithMilestone_numberPatchRequestBody_state) String() string { + return []string{"open", "closed"}[i] +} +func ParseWithMilestone_numberPatchRequestBody_state(v string) (any, error) { + result := OPEN_WITHMILESTONE_NUMBERPATCHREQUESTBODY_STATE + switch v { + case "open": + result = OPEN_WITHMILESTONE_NUMBERPATCHREQUESTBODY_STATE + case "closed": + result = CLOSED_WITHMILESTONE_NUMBERPATCHREQUESTBODY_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeWithMilestone_numberPatchRequestBody_state(values []WithMilestone_numberPatchRequestBody_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithMilestone_numberPatchRequestBody_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/milestones/milestones_post_request_body_escaped_state.go b/pkg/github/repos/item/item/milestones/milestones_post_request_body_escaped_state.go new file mode 100644 index 00000000..f05193ed --- /dev/null +++ b/pkg/github/repos/item/item/milestones/milestones_post_request_body_escaped_state.go @@ -0,0 +1,34 @@ +package milestones +// The state of the milestone. Either `open` or `closed`. +type MilestonesPostRequestBody_state int + +const ( + OPEN_MILESTONESPOSTREQUESTBODY_STATE MilestonesPostRequestBody_state = iota + CLOSED_MILESTONESPOSTREQUESTBODY_STATE +) + +func (i MilestonesPostRequestBody_state) String() string { + return []string{"open", "closed"}[i] +} +func ParseMilestonesPostRequestBody_state(v string) (any, error) { + result := OPEN_MILESTONESPOSTREQUESTBODY_STATE + switch v { + case "open": + result = OPEN_MILESTONESPOSTREQUESTBODY_STATE + case "closed": + result = CLOSED_MILESTONESPOSTREQUESTBODY_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeMilestonesPostRequestBody_state(values []MilestonesPostRequestBody_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i MilestonesPostRequestBody_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pages/pages_post_request_body_escaped_build_escaped_type.go b/pkg/github/repos/item/item/pages/pages_post_request_body_escaped_build_escaped_type.go new file mode 100644 index 00000000..914ccf8c --- /dev/null +++ b/pkg/github/repos/item/item/pages/pages_post_request_body_escaped_build_escaped_type.go @@ -0,0 +1,34 @@ +package pages +// The process in which the Page will be built. Possible values are `"legacy"` and `"workflow"`. +type PagesPostRequestBody_build_type int + +const ( + LEGACY_PAGESPOSTREQUESTBODY_BUILD_TYPE PagesPostRequestBody_build_type = iota + WORKFLOW_PAGESPOSTREQUESTBODY_BUILD_TYPE +) + +func (i PagesPostRequestBody_build_type) String() string { + return []string{"legacy", "workflow"}[i] +} +func ParsePagesPostRequestBody_build_type(v string) (any, error) { + result := LEGACY_PAGESPOSTREQUESTBODY_BUILD_TYPE + switch v { + case "legacy": + result = LEGACY_PAGESPOSTREQUESTBODY_BUILD_TYPE + case "workflow": + result = WORKFLOW_PAGESPOSTREQUESTBODY_BUILD_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializePagesPostRequestBody_build_type(values []PagesPostRequestBody_build_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PagesPostRequestBody_build_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pages/pages_post_request_body_escaped_source_escaped_path.go b/pkg/github/repos/item/item/pages/pages_post_request_body_escaped_source_escaped_path.go new file mode 100644 index 00000000..cb6fcbee --- /dev/null +++ b/pkg/github/repos/item/item/pages/pages_post_request_body_escaped_source_escaped_path.go @@ -0,0 +1,34 @@ +package pages +// The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`. Default: `/` +type PagesPostRequestBody_source_path int + +const ( + SLASH_PAGESPOSTREQUESTBODY_SOURCE_PATH PagesPostRequestBody_source_path = iota + DOCS_PAGESPOSTREQUESTBODY_SOURCE_PATH +) + +func (i PagesPostRequestBody_source_path) String() string { + return []string{"/", "/docs"}[i] +} +func ParsePagesPostRequestBody_source_path(v string) (any, error) { + result := SLASH_PAGESPOSTREQUESTBODY_SOURCE_PATH + switch v { + case "/": + result = SLASH_PAGESPOSTREQUESTBODY_SOURCE_PATH + case "/docs": + result = DOCS_PAGESPOSTREQUESTBODY_SOURCE_PATH + default: + return nil, nil + } + return &result, nil +} +func SerializePagesPostRequestBody_source_path(values []PagesPostRequestBody_source_path) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PagesPostRequestBody_source_path) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pages/pages_put_request_body_escaped_build_escaped_type.go b/pkg/github/repos/item/item/pages/pages_put_request_body_escaped_build_escaped_type.go new file mode 100644 index 00000000..163d12cc --- /dev/null +++ b/pkg/github/repos/item/item/pages/pages_put_request_body_escaped_build_escaped_type.go @@ -0,0 +1,34 @@ +package pages +// The process by which the GitHub Pages site will be built. `workflow` means that the site is built by a custom GitHub Actions workflow. `legacy` means that the site is built by GitHub when changes are pushed to a specific branch. +type PagesPutRequestBody_build_type int + +const ( + LEGACY_PAGESPUTREQUESTBODY_BUILD_TYPE PagesPutRequestBody_build_type = iota + WORKFLOW_PAGESPUTREQUESTBODY_BUILD_TYPE +) + +func (i PagesPutRequestBody_build_type) String() string { + return []string{"legacy", "workflow"}[i] +} +func ParsePagesPutRequestBody_build_type(v string) (any, error) { + result := LEGACY_PAGESPUTREQUESTBODY_BUILD_TYPE + switch v { + case "legacy": + result = LEGACY_PAGESPUTREQUESTBODY_BUILD_TYPE + case "workflow": + result = WORKFLOW_PAGESPUTREQUESTBODY_BUILD_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializePagesPutRequestBody_build_type(values []PagesPutRequestBody_build_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PagesPutRequestBody_build_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pages/pages_put_request_body_escaped_source_member1_escaped_path.go b/pkg/github/repos/item/item/pages/pages_put_request_body_escaped_source_member1_escaped_path.go new file mode 100644 index 00000000..402c5ce1 --- /dev/null +++ b/pkg/github/repos/item/item/pages/pages_put_request_body_escaped_source_member1_escaped_path.go @@ -0,0 +1,34 @@ +package pages +// The repository directory that includes the source files for the Pages site. Allowed paths are `/` or `/docs`. +type PagesPutRequestBody_sourceMember1_path int + +const ( + SLASH_PAGESPUTREQUESTBODY_SOURCEMEMBER1_PATH PagesPutRequestBody_sourceMember1_path = iota + DOCS_PAGESPUTREQUESTBODY_SOURCEMEMBER1_PATH +) + +func (i PagesPutRequestBody_sourceMember1_path) String() string { + return []string{"/", "/docs"}[i] +} +func ParsePagesPutRequestBody_sourceMember1_path(v string) (any, error) { + result := SLASH_PAGESPUTREQUESTBODY_SOURCEMEMBER1_PATH + switch v { + case "/": + result = SLASH_PAGESPUTREQUESTBODY_SOURCEMEMBER1_PATH + case "/docs": + result = DOCS_PAGESPUTREQUESTBODY_SOURCEMEMBER1_PATH + default: + return nil, nil + } + return &result, nil +} +func SerializePagesPutRequestBody_sourceMember1_path(values []PagesPutRequestBody_sourceMember1_path) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i PagesPutRequestBody_sourceMember1_path) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/prereceivehooks/get_direction_query_parameter_type.go b/pkg/github/repos/item/item/prereceivehooks/get_direction_query_parameter_type.go new file mode 100644 index 00000000..cf3c4186 --- /dev/null +++ b/pkg/github/repos/item/item/prereceivehooks/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package prereceivehooks +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/prereceivehooks/get_sort_query_parameter_type.go b/pkg/github/repos/item/item/prereceivehooks/get_sort_query_parameter_type.go new file mode 100644 index 00000000..ea9591b1 --- /dev/null +++ b/pkg/github/repos/item/item/prereceivehooks/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package prereceivehooks +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + NAME_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "name"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "name": + result = NAME_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/prereceivehooks/item/with_pre_escaped_receive_escaped_hook_escaped_patch_request_body_escaped_enforcement.go b/pkg/github/repos/item/item/prereceivehooks/item/with_pre_escaped_receive_escaped_hook_escaped_patch_request_body_escaped_enforcement.go new file mode 100644 index 00000000..a3655e86 --- /dev/null +++ b/pkg/github/repos/item/item/prereceivehooks/item/with_pre_escaped_receive_escaped_hook_escaped_patch_request_body_escaped_enforcement.go @@ -0,0 +1,37 @@ +package item +// The state of enforcement for the hook on this repository. +type WithPre_receive_hook_PatchRequestBody_enforcement int + +const ( + ENABLED_WITHPRE_RECEIVE_HOOK_PATCHREQUESTBODY_ENFORCEMENT WithPre_receive_hook_PatchRequestBody_enforcement = iota + DISABLED_WITHPRE_RECEIVE_HOOK_PATCHREQUESTBODY_ENFORCEMENT + TESTING_WITHPRE_RECEIVE_HOOK_PATCHREQUESTBODY_ENFORCEMENT +) + +func (i WithPre_receive_hook_PatchRequestBody_enforcement) String() string { + return []string{"enabled", "disabled", "testing"}[i] +} +func ParseWithPre_receive_hook_PatchRequestBody_enforcement(v string) (any, error) { + result := ENABLED_WITHPRE_RECEIVE_HOOK_PATCHREQUESTBODY_ENFORCEMENT + switch v { + case "enabled": + result = ENABLED_WITHPRE_RECEIVE_HOOK_PATCHREQUESTBODY_ENFORCEMENT + case "disabled": + result = DISABLED_WITHPRE_RECEIVE_HOOK_PATCHREQUESTBODY_ENFORCEMENT + case "testing": + result = TESTING_WITHPRE_RECEIVE_HOOK_PATCHREQUESTBODY_ENFORCEMENT + default: + return nil, nil + } + return &result, nil +} +func SerializeWithPre_receive_hook_PatchRequestBody_enforcement(values []WithPre_receive_hook_PatchRequestBody_enforcement) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithPre_receive_hook_PatchRequestBody_enforcement) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/projects/get_state_query_parameter_type.go b/pkg/github/repos/item/item/projects/get_state_query_parameter_type.go new file mode 100644 index 00000000..2c9bc230 --- /dev/null +++ b/pkg/github/repos/item/item/projects/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package projects +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/comments/get_direction_query_parameter_type.go b/pkg/github/repos/item/item/pulls/comments/get_direction_query_parameter_type.go new file mode 100644 index 00000000..6561eb6a --- /dev/null +++ b/pkg/github/repos/item/item/pulls/comments/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package comments +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/comments/get_sort_query_parameter_type.go b/pkg/github/repos/item/item/pulls/comments/get_sort_query_parameter_type.go new file mode 100644 index 00000000..75f87778 --- /dev/null +++ b/pkg/github/repos/item/item/pulls/comments/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package comments +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + CREATED_AT_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "created_at"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "created_at": + result = CREATED_AT_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/comments/item/reactions/get_content_query_parameter_type.go b/pkg/github/repos/item/item/pulls/comments/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 00000000..f3e64542 --- /dev/null +++ b/pkg/github/repos/item/item/pulls/comments/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,51 @@ +package reactions +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/comments/item/reactions/reactions_post_request_body_escaped_content.go b/pkg/github/repos/item/item/pulls/comments/item/reactions/reactions_post_request_body_escaped_content.go new file mode 100644 index 00000000..7e0e75ec --- /dev/null +++ b/pkg/github/repos/item/item/pulls/comments/item/reactions/reactions_post_request_body_escaped_content.go @@ -0,0 +1,52 @@ +package reactions +// The [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions) to add to the pull request review comment. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return nil, nil + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/get_direction_query_parameter_type.go b/pkg/github/repos/item/item/pulls/get_direction_query_parameter_type.go new file mode 100644 index 00000000..5747f491 --- /dev/null +++ b/pkg/github/repos/item/item/pulls/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package pulls +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/get_sort_query_parameter_type.go b/pkg/github/repos/item/item/pulls/get_sort_query_parameter_type.go new file mode 100644 index 00000000..b32896c8 --- /dev/null +++ b/pkg/github/repos/item/item/pulls/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package pulls +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + POPULARITY_GETSORTQUERYPARAMETERTYPE + LONGRUNNING_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "popularity", "long-running"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "popularity": + result = POPULARITY_GETSORTQUERYPARAMETERTYPE + case "long-running": + result = LONGRUNNING_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/get_state_query_parameter_type.go b/pkg/github/repos/item/item/pulls/get_state_query_parameter_type.go new file mode 100644 index 00000000..0597a61a --- /dev/null +++ b/pkg/github/repos/item/item/pulls/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package pulls +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_escaped_side.go b/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_escaped_side.go new file mode 100644 index 00000000..7062b77d --- /dev/null +++ b/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_escaped_side.go @@ -0,0 +1,34 @@ +package comments +// In a split diff view, the side of the diff that the pull request's changes appear on. Can be `LEFT` or `RIGHT`. Use `LEFT` for deletions that appear in red. Use `RIGHT` for additions that appear in green or unchanged lines that appear in white and are shown for context. For a multi-line comment, side represents whether the last line of the comment range is a deletion or addition. For more information, see "[Diff view options](https://docs.github.com/enterprise-server@3.14/articles/about-comparing-branches-in-pull-requests#diff-view-options)" in the GitHub Help documentation. +type CommentsPostRequestBody_side int + +const ( + LEFT_COMMENTSPOSTREQUESTBODY_SIDE CommentsPostRequestBody_side = iota + RIGHT_COMMENTSPOSTREQUESTBODY_SIDE +) + +func (i CommentsPostRequestBody_side) String() string { + return []string{"LEFT", "RIGHT"}[i] +} +func ParseCommentsPostRequestBody_side(v string) (any, error) { + result := LEFT_COMMENTSPOSTREQUESTBODY_SIDE + switch v { + case "LEFT": + result = LEFT_COMMENTSPOSTREQUESTBODY_SIDE + case "RIGHT": + result = RIGHT_COMMENTSPOSTREQUESTBODY_SIDE + default: + return nil, nil + } + return &result, nil +} +func SerializeCommentsPostRequestBody_side(values []CommentsPostRequestBody_side) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CommentsPostRequestBody_side) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_escaped_start_escaped_side.go b/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_escaped_start_escaped_side.go new file mode 100644 index 00000000..9a258b09 --- /dev/null +++ b/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_escaped_start_escaped_side.go @@ -0,0 +1,37 @@ +package comments +// **Required when using multi-line comments unless using `in_reply_to`**. The `start_side` is the starting side of the diff that the comment applies to. Can be `LEFT` or `RIGHT`. To learn more about multi-line comments, see "[Commenting on a pull request](https://docs.github.com/enterprise-server@3.14/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. See `side` in this table for additional context. +type CommentsPostRequestBody_start_side int + +const ( + LEFT_COMMENTSPOSTREQUESTBODY_START_SIDE CommentsPostRequestBody_start_side = iota + RIGHT_COMMENTSPOSTREQUESTBODY_START_SIDE + SIDE_COMMENTSPOSTREQUESTBODY_START_SIDE +) + +func (i CommentsPostRequestBody_start_side) String() string { + return []string{"LEFT", "RIGHT", "side"}[i] +} +func ParseCommentsPostRequestBody_start_side(v string) (any, error) { + result := LEFT_COMMENTSPOSTREQUESTBODY_START_SIDE + switch v { + case "LEFT": + result = LEFT_COMMENTSPOSTREQUESTBODY_START_SIDE + case "RIGHT": + result = RIGHT_COMMENTSPOSTREQUESTBODY_START_SIDE + case "side": + result = SIDE_COMMENTSPOSTREQUESTBODY_START_SIDE + default: + return nil, nil + } + return &result, nil +} +func SerializeCommentsPostRequestBody_start_side(values []CommentsPostRequestBody_start_side) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CommentsPostRequestBody_start_side) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_escaped_subject_escaped_type.go b/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_escaped_subject_escaped_type.go new file mode 100644 index 00000000..b9077a6b --- /dev/null +++ b/pkg/github/repos/item/item/pulls/item/comments/comments_post_request_body_escaped_subject_escaped_type.go @@ -0,0 +1,34 @@ +package comments +// The level at which the comment is targeted. +type CommentsPostRequestBody_subject_type int + +const ( + LINE_COMMENTSPOSTREQUESTBODY_SUBJECT_TYPE CommentsPostRequestBody_subject_type = iota + FILE_COMMENTSPOSTREQUESTBODY_SUBJECT_TYPE +) + +func (i CommentsPostRequestBody_subject_type) String() string { + return []string{"line", "file"}[i] +} +func ParseCommentsPostRequestBody_subject_type(v string) (any, error) { + result := LINE_COMMENTSPOSTREQUESTBODY_SUBJECT_TYPE + switch v { + case "line": + result = LINE_COMMENTSPOSTREQUESTBODY_SUBJECT_TYPE + case "file": + result = FILE_COMMENTSPOSTREQUESTBODY_SUBJECT_TYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeCommentsPostRequestBody_subject_type(values []CommentsPostRequestBody_subject_type) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i CommentsPostRequestBody_subject_type) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/item/comments/get_direction_query_parameter_type.go b/pkg/github/repos/item/item/pulls/item/comments/get_direction_query_parameter_type.go new file mode 100644 index 00000000..6561eb6a --- /dev/null +++ b/pkg/github/repos/item/item/pulls/item/comments/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package comments +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/item/comments/get_sort_query_parameter_type.go b/pkg/github/repos/item/item/pulls/item/comments/get_sort_query_parameter_type.go new file mode 100644 index 00000000..34ad7acd --- /dev/null +++ b/pkg/github/repos/item/item/pulls/item/comments/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package comments +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/item/merge/merge_put_request_body_escaped_merge_escaped_method.go b/pkg/github/repos/item/item/pulls/item/merge/merge_put_request_body_escaped_merge_escaped_method.go new file mode 100644 index 00000000..552f913a --- /dev/null +++ b/pkg/github/repos/item/item/pulls/item/merge/merge_put_request_body_escaped_merge_escaped_method.go @@ -0,0 +1,37 @@ +package merge +// The merge method to use. +type MergePutRequestBody_merge_method int + +const ( + MERGE_MERGEPUTREQUESTBODY_MERGE_METHOD MergePutRequestBody_merge_method = iota + SQUASH_MERGEPUTREQUESTBODY_MERGE_METHOD + REBASE_MERGEPUTREQUESTBODY_MERGE_METHOD +) + +func (i MergePutRequestBody_merge_method) String() string { + return []string{"merge", "squash", "rebase"}[i] +} +func ParseMergePutRequestBody_merge_method(v string) (any, error) { + result := MERGE_MERGEPUTREQUESTBODY_MERGE_METHOD + switch v { + case "merge": + result = MERGE_MERGEPUTREQUESTBODY_MERGE_METHOD + case "squash": + result = SQUASH_MERGEPUTREQUESTBODY_MERGE_METHOD + case "rebase": + result = REBASE_MERGEPUTREQUESTBODY_MERGE_METHOD + default: + return nil, nil + } + return &result, nil +} +func SerializeMergePutRequestBody_merge_method(values []MergePutRequestBody_merge_method) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i MergePutRequestBody_merge_method) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/item/reviews/item/dismissals/dismissals_put_request_body_escaped_event.go b/pkg/github/repos/item/item/pulls/item/reviews/item/dismissals/dismissals_put_request_body_escaped_event.go new file mode 100644 index 00000000..c02df651 --- /dev/null +++ b/pkg/github/repos/item/item/pulls/item/reviews/item/dismissals/dismissals_put_request_body_escaped_event.go @@ -0,0 +1,30 @@ +package dismissals +type DismissalsPutRequestBody_event int + +const ( + DISMISS_DISMISSALSPUTREQUESTBODY_EVENT DismissalsPutRequestBody_event = iota +) + +func (i DismissalsPutRequestBody_event) String() string { + return []string{"DISMISS"}[i] +} +func ParseDismissalsPutRequestBody_event(v string) (any, error) { + result := DISMISS_DISMISSALSPUTREQUESTBODY_EVENT + switch v { + case "DISMISS": + result = DISMISS_DISMISSALSPUTREQUESTBODY_EVENT + default: + return nil, nil + } + return &result, nil +} +func SerializeDismissalsPutRequestBody_event(values []DismissalsPutRequestBody_event) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i DismissalsPutRequestBody_event) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/item/reviews/item/events/events_post_request_body_escaped_event.go b/pkg/github/repos/item/item/pulls/item/reviews/item/events/events_post_request_body_escaped_event.go new file mode 100644 index 00000000..53b26d8d --- /dev/null +++ b/pkg/github/repos/item/item/pulls/item/reviews/item/events/events_post_request_body_escaped_event.go @@ -0,0 +1,37 @@ +package events +// The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. When you leave this blank, the API returns _HTTP 422 (Unrecognizable entity)_ and sets the review action state to `PENDING`, which means you will need to re-submit the pull request review using a review action. +type EventsPostRequestBody_event int + +const ( + APPROVE_EVENTSPOSTREQUESTBODY_EVENT EventsPostRequestBody_event = iota + REQUEST_CHANGES_EVENTSPOSTREQUESTBODY_EVENT + COMMENT_EVENTSPOSTREQUESTBODY_EVENT +) + +func (i EventsPostRequestBody_event) String() string { + return []string{"APPROVE", "REQUEST_CHANGES", "COMMENT"}[i] +} +func ParseEventsPostRequestBody_event(v string) (any, error) { + result := APPROVE_EVENTSPOSTREQUESTBODY_EVENT + switch v { + case "APPROVE": + result = APPROVE_EVENTSPOSTREQUESTBODY_EVENT + case "REQUEST_CHANGES": + result = REQUEST_CHANGES_EVENTSPOSTREQUESTBODY_EVENT + case "COMMENT": + result = COMMENT_EVENTSPOSTREQUESTBODY_EVENT + default: + return nil, nil + } + return &result, nil +} +func SerializeEventsPostRequestBody_event(values []EventsPostRequestBody_event) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i EventsPostRequestBody_event) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/item/reviews/reviews_post_request_body_escaped_event.go b/pkg/github/repos/item/item/pulls/item/reviews/reviews_post_request_body_escaped_event.go new file mode 100644 index 00000000..9d8461c5 --- /dev/null +++ b/pkg/github/repos/item/item/pulls/item/reviews/reviews_post_request_body_escaped_event.go @@ -0,0 +1,37 @@ +package reviews +// The review action you want to perform. The review actions include: `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`. By leaving this blank, you set the review action state to `PENDING`, which means you will need to [submit the pull request review](https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#submit-a-review-for-a-pull-request) when you are ready. +type ReviewsPostRequestBody_event int + +const ( + APPROVE_REVIEWSPOSTREQUESTBODY_EVENT ReviewsPostRequestBody_event = iota + REQUEST_CHANGES_REVIEWSPOSTREQUESTBODY_EVENT + COMMENT_REVIEWSPOSTREQUESTBODY_EVENT +) + +func (i ReviewsPostRequestBody_event) String() string { + return []string{"APPROVE", "REQUEST_CHANGES", "COMMENT"}[i] +} +func ParseReviewsPostRequestBody_event(v string) (any, error) { + result := APPROVE_REVIEWSPOSTREQUESTBODY_EVENT + switch v { + case "APPROVE": + result = APPROVE_REVIEWSPOSTREQUESTBODY_EVENT + case "REQUEST_CHANGES": + result = REQUEST_CHANGES_REVIEWSPOSTREQUESTBODY_EVENT + case "COMMENT": + result = COMMENT_REVIEWSPOSTREQUESTBODY_EVENT + default: + return nil, nil + } + return &result, nil +} +func SerializeReviewsPostRequestBody_event(values []ReviewsPostRequestBody_event) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReviewsPostRequestBody_event) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/pulls/item/with_pull_escaped_number_patch_request_body_escaped_state.go b/pkg/github/repos/item/item/pulls/item/with_pull_escaped_number_patch_request_body_escaped_state.go new file mode 100644 index 00000000..a78a3850 --- /dev/null +++ b/pkg/github/repos/item/item/pulls/item/with_pull_escaped_number_patch_request_body_escaped_state.go @@ -0,0 +1,34 @@ +package item +// State of this Pull Request. Either `open` or `closed`. +type WithPull_numberPatchRequestBody_state int + +const ( + OPEN_WITHPULL_NUMBERPATCHREQUESTBODY_STATE WithPull_numberPatchRequestBody_state = iota + CLOSED_WITHPULL_NUMBERPATCHREQUESTBODY_STATE +) + +func (i WithPull_numberPatchRequestBody_state) String() string { + return []string{"open", "closed"}[i] +} +func ParseWithPull_numberPatchRequestBody_state(v string) (any, error) { + result := OPEN_WITHPULL_NUMBERPATCHREQUESTBODY_STATE + switch v { + case "open": + result = OPEN_WITHPULL_NUMBERPATCHREQUESTBODY_STATE + case "closed": + result = CLOSED_WITHPULL_NUMBERPATCHREQUESTBODY_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeWithPull_numberPatchRequestBody_state(values []WithPull_numberPatchRequestBody_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithPull_numberPatchRequestBody_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/releases/item/reactions/get_content_query_parameter_type.go b/pkg/github/repos/item/item/releases/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 00000000..15c4c7e1 --- /dev/null +++ b/pkg/github/repos/item/item/releases/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,45 @@ +package reactions +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + LAUGH_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "laugh", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/releases/item/reactions/reactions_post_request_body_escaped_content.go b/pkg/github/repos/item/item/releases/item/reactions/reactions_post_request_body_escaped_content.go new file mode 100644 index 00000000..a12d2330 --- /dev/null +++ b/pkg/github/repos/item/item/releases/item/reactions/reactions_post_request_body_escaped_content.go @@ -0,0 +1,46 @@ +package reactions +// The [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions) to add to the release. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "laugh", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return nil, nil + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/releases/item/with_release_escaped_patch_request_body_escaped_make_escaped_latest.go b/pkg/github/repos/item/item/releases/item/with_release_escaped_patch_request_body_escaped_make_escaped_latest.go new file mode 100644 index 00000000..53ef3fa4 --- /dev/null +++ b/pkg/github/repos/item/item/releases/item/with_release_escaped_patch_request_body_escaped_make_escaped_latest.go @@ -0,0 +1,37 @@ +package item +// Specifies whether this release should be set as the latest release for the repository. Drafts and prereleases cannot be set as latest. Defaults to `true` for newly published releases. `legacy` specifies that the latest release should be determined based on the release creation date and higher semantic version. +type WithRelease_PatchRequestBody_make_latest int + +const ( + TRUE_WITHRELEASE_PATCHREQUESTBODY_MAKE_LATEST WithRelease_PatchRequestBody_make_latest = iota + FALSE_WITHRELEASE_PATCHREQUESTBODY_MAKE_LATEST + LEGACY_WITHRELEASE_PATCHREQUESTBODY_MAKE_LATEST +) + +func (i WithRelease_PatchRequestBody_make_latest) String() string { + return []string{"true", "false", "legacy"}[i] +} +func ParseWithRelease_PatchRequestBody_make_latest(v string) (any, error) { + result := TRUE_WITHRELEASE_PATCHREQUESTBODY_MAKE_LATEST + switch v { + case "true": + result = TRUE_WITHRELEASE_PATCHREQUESTBODY_MAKE_LATEST + case "false": + result = FALSE_WITHRELEASE_PATCHREQUESTBODY_MAKE_LATEST + case "legacy": + result = LEGACY_WITHRELEASE_PATCHREQUESTBODY_MAKE_LATEST + default: + return nil, nil + } + return &result, nil +} +func SerializeWithRelease_PatchRequestBody_make_latest(values []WithRelease_PatchRequestBody_make_latest) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithRelease_PatchRequestBody_make_latest) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/releases/releases_post_request_body_escaped_make_escaped_latest.go b/pkg/github/repos/item/item/releases/releases_post_request_body_escaped_make_escaped_latest.go new file mode 100644 index 00000000..c2b56d8b --- /dev/null +++ b/pkg/github/repos/item/item/releases/releases_post_request_body_escaped_make_escaped_latest.go @@ -0,0 +1,37 @@ +package releases +// Specifies whether this release should be set as the latest release for the repository. Drafts and prereleases cannot be set as latest. Defaults to `true` for newly published releases. `legacy` specifies that the latest release should be determined based on the release creation date and higher semantic version. +type ReleasesPostRequestBody_make_latest int + +const ( + TRUE_RELEASESPOSTREQUESTBODY_MAKE_LATEST ReleasesPostRequestBody_make_latest = iota + FALSE_RELEASESPOSTREQUESTBODY_MAKE_LATEST + LEGACY_RELEASESPOSTREQUESTBODY_MAKE_LATEST +) + +func (i ReleasesPostRequestBody_make_latest) String() string { + return []string{"true", "false", "legacy"}[i] +} +func ParseReleasesPostRequestBody_make_latest(v string) (any, error) { + result := TRUE_RELEASESPOSTREQUESTBODY_MAKE_LATEST + switch v { + case "true": + result = TRUE_RELEASESPOSTREQUESTBODY_MAKE_LATEST + case "false": + result = FALSE_RELEASESPOSTREQUESTBODY_MAKE_LATEST + case "legacy": + result = LEGACY_RELEASESPOSTREQUESTBODY_MAKE_LATEST + default: + return nil, nil + } + return &result, nil +} +func SerializeReleasesPostRequestBody_make_latest(values []ReleasesPostRequestBody_make_latest) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReleasesPostRequestBody_make_latest) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/replicas/caches/caches_escaped_git_escaped_sync_escaped_status.go b/pkg/github/repos/item/item/replicas/caches/caches_escaped_git_escaped_sync_escaped_status.go new file mode 100644 index 00000000..07f94386 --- /dev/null +++ b/pkg/github/repos/item/item/replicas/caches/caches_escaped_git_escaped_sync_escaped_status.go @@ -0,0 +1,39 @@ +package caches +type Caches_git_sync_status int + +const ( + OFFLINE_CACHES_GIT_SYNC_STATUS Caches_git_sync_status = iota + INACTIVE_CACHES_GIT_SYNC_STATUS + IN_SYNC_CACHES_GIT_SYNC_STATUS + NOT_IN_SYNC_CACHES_GIT_SYNC_STATUS +) + +func (i Caches_git_sync_status) String() string { + return []string{"offline", "inactive", "in_sync", "not_in_sync"}[i] +} +func ParseCaches_git_sync_status(v string) (any, error) { + result := OFFLINE_CACHES_GIT_SYNC_STATUS + switch v { + case "offline": + result = OFFLINE_CACHES_GIT_SYNC_STATUS + case "inactive": + result = INACTIVE_CACHES_GIT_SYNC_STATUS + case "in_sync": + result = IN_SYNC_CACHES_GIT_SYNC_STATUS + case "not_in_sync": + result = NOT_IN_SYNC_CACHES_GIT_SYNC_STATUS + default: + return nil, nil + } + return &result, nil +} +func SerializeCaches_git_sync_status(values []Caches_git_sync_status) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i Caches_git_sync_status) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/repo_patch_request_body_escaped_merge_escaped_commit_escaped_message.go b/pkg/github/repos/item/item/repo_patch_request_body_escaped_merge_escaped_commit_escaped_message.go new file mode 100644 index 00000000..d5e2d191 --- /dev/null +++ b/pkg/github/repos/item/item/repo_patch_request_body_escaped_merge_escaped_commit_escaped_message.go @@ -0,0 +1,37 @@ +package item +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type RepoPatchRequestBody_merge_commit_message int + +const ( + PR_BODY_REPOPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE RepoPatchRequestBody_merge_commit_message = iota + PR_TITLE_REPOPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE + BLANK_REPOPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE +) + +func (i RepoPatchRequestBody_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParseRepoPatchRequestBody_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_REPOPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOPATCHREQUESTBODY_MERGE_COMMIT_MESSAGE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepoPatchRequestBody_merge_commit_message(values []RepoPatchRequestBody_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepoPatchRequestBody_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/repo_patch_request_body_escaped_merge_escaped_commit_escaped_title.go b/pkg/github/repos/item/item/repo_patch_request_body_escaped_merge_escaped_commit_escaped_title.go new file mode 100644 index 00000000..f9dbbca4 --- /dev/null +++ b/pkg/github/repos/item/item/repo_patch_request_body_escaped_merge_escaped_commit_escaped_title.go @@ -0,0 +1,34 @@ +package item +// Required when using `merge_commit_message`.The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +type RepoPatchRequestBody_merge_commit_title int + +const ( + PR_TITLE_REPOPATCHREQUESTBODY_MERGE_COMMIT_TITLE RepoPatchRequestBody_merge_commit_title = iota + MERGE_MESSAGE_REPOPATCHREQUESTBODY_MERGE_COMMIT_TITLE +) + +func (i RepoPatchRequestBody_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParseRepoPatchRequestBody_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOPATCHREQUESTBODY_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOPATCHREQUESTBODY_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_REPOPATCHREQUESTBODY_MERGE_COMMIT_TITLE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepoPatchRequestBody_merge_commit_title(values []RepoPatchRequestBody_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepoPatchRequestBody_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/repo_patch_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_message.go b/pkg/github/repos/item/item/repo_patch_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_message.go new file mode 100644 index 00000000..8a96cc65 --- /dev/null +++ b/pkg/github/repos/item/item/repo_patch_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_message.go @@ -0,0 +1,37 @@ +package item +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type RepoPatchRequestBody_squash_merge_commit_message int + +const ( + PR_BODY_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE RepoPatchRequestBody_squash_merge_commit_message = iota + COMMIT_MESSAGES_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i RepoPatchRequestBody_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParseRepoPatchRequestBody_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepoPatchRequestBody_squash_merge_commit_message(values []RepoPatchRequestBody_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepoPatchRequestBody_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/repo_patch_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_title.go b/pkg/github/repos/item/item/repo_patch_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_title.go new file mode 100644 index 00000000..54081b59 --- /dev/null +++ b/pkg/github/repos/item/item/repo_patch_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_title.go @@ -0,0 +1,34 @@ +package item +// Required when using `squash_merge_commit_message`.The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type RepoPatchRequestBody_squash_merge_commit_title int + +const ( + PR_TITLE_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE RepoPatchRequestBody_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE +) + +func (i RepoPatchRequestBody_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParseRepoPatchRequestBody_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_REPOPATCHREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + default: + return nil, nil + } + return &result, nil +} +func SerializeRepoPatchRequestBody_squash_merge_commit_title(values []RepoPatchRequestBody_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepoPatchRequestBody_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/repo_patch_request_body_escaped_visibility.go b/pkg/github/repos/item/item/repo_patch_request_body_escaped_visibility.go new file mode 100644 index 00000000..bcac7b88 --- /dev/null +++ b/pkg/github/repos/item/item/repo_patch_request_body_escaped_visibility.go @@ -0,0 +1,37 @@ +package item +// The visibility of the repository. +type RepoPatchRequestBody_visibility int + +const ( + PUBLIC_REPOPATCHREQUESTBODY_VISIBILITY RepoPatchRequestBody_visibility = iota + PRIVATE_REPOPATCHREQUESTBODY_VISIBILITY + INTERNAL_REPOPATCHREQUESTBODY_VISIBILITY +) + +func (i RepoPatchRequestBody_visibility) String() string { + return []string{"public", "private", "internal"}[i] +} +func ParseRepoPatchRequestBody_visibility(v string) (any, error) { + result := PUBLIC_REPOPATCHREQUESTBODY_VISIBILITY + switch v { + case "public": + result = PUBLIC_REPOPATCHREQUESTBODY_VISIBILITY + case "private": + result = PRIVATE_REPOPATCHREQUESTBODY_VISIBILITY + case "internal": + result = INTERNAL_REPOPATCHREQUESTBODY_VISIBILITY + default: + return nil, nil + } + return &result, nil +} +func SerializeRepoPatchRequestBody_visibility(values []RepoPatchRequestBody_visibility) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RepoPatchRequestBody_visibility) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/rulesets/item/with_ruleset_escaped_put_request_body_escaped_target.go b/pkg/github/repos/item/item/rulesets/item/with_ruleset_escaped_put_request_body_escaped_target.go new file mode 100644 index 00000000..5ec257fb --- /dev/null +++ b/pkg/github/repos/item/item/rulesets/item/with_ruleset_escaped_put_request_body_escaped_target.go @@ -0,0 +1,37 @@ +package item +// The target of the ruleset +type WithRuleset_PutRequestBody_target int + +const ( + BRANCH_WITHRULESET_PUTREQUESTBODY_TARGET WithRuleset_PutRequestBody_target = iota + TAG_WITHRULESET_PUTREQUESTBODY_TARGET + PUSH_WITHRULESET_PUTREQUESTBODY_TARGET +) + +func (i WithRuleset_PutRequestBody_target) String() string { + return []string{"branch", "tag", "push"}[i] +} +func ParseWithRuleset_PutRequestBody_target(v string) (any, error) { + result := BRANCH_WITHRULESET_PUTREQUESTBODY_TARGET + switch v { + case "branch": + result = BRANCH_WITHRULESET_PUTREQUESTBODY_TARGET + case "tag": + result = TAG_WITHRULESET_PUTREQUESTBODY_TARGET + case "push": + result = PUSH_WITHRULESET_PUTREQUESTBODY_TARGET + default: + return nil, nil + } + return &result, nil +} +func SerializeWithRuleset_PutRequestBody_target(values []WithRuleset_PutRequestBody_target) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithRuleset_PutRequestBody_target) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/rulesets/rulesets_post_request_body_escaped_target.go b/pkg/github/repos/item/item/rulesets/rulesets_post_request_body_escaped_target.go new file mode 100644 index 00000000..bba7d001 --- /dev/null +++ b/pkg/github/repos/item/item/rulesets/rulesets_post_request_body_escaped_target.go @@ -0,0 +1,37 @@ +package rulesets +// The target of the ruleset +type RulesetsPostRequestBody_target int + +const ( + BRANCH_RULESETSPOSTREQUESTBODY_TARGET RulesetsPostRequestBody_target = iota + TAG_RULESETSPOSTREQUESTBODY_TARGET + PUSH_RULESETSPOSTREQUESTBODY_TARGET +) + +func (i RulesetsPostRequestBody_target) String() string { + return []string{"branch", "tag", "push"}[i] +} +func ParseRulesetsPostRequestBody_target(v string) (any, error) { + result := BRANCH_RULESETSPOSTREQUESTBODY_TARGET + switch v { + case "branch": + result = BRANCH_RULESETSPOSTREQUESTBODY_TARGET + case "tag": + result = TAG_RULESETSPOSTREQUESTBODY_TARGET + case "push": + result = PUSH_RULESETSPOSTREQUESTBODY_TARGET + default: + return nil, nil + } + return &result, nil +} +func SerializeRulesetsPostRequestBody_target(values []RulesetsPostRequestBody_target) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i RulesetsPostRequestBody_target) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/rulesets/rulesuites/get_rule_escaped_suite_escaped_result_query_parameter_type.go b/pkg/github/repos/item/item/rulesets/rulesuites/get_rule_escaped_suite_escaped_result_query_parameter_type.go new file mode 100644 index 00000000..8665bcb0 --- /dev/null +++ b/pkg/github/repos/item/item/rulesets/rulesuites/get_rule_escaped_suite_escaped_result_query_parameter_type.go @@ -0,0 +1,39 @@ +package rulesuites +type GetRule_suite_resultQueryParameterType int + +const ( + PASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE GetRule_suite_resultQueryParameterType = iota + FAIL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + BYPASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + ALL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE +) + +func (i GetRule_suite_resultQueryParameterType) String() string { + return []string{"pass", "fail", "bypass", "all"}[i] +} +func ParseGetRule_suite_resultQueryParameterType(v string) (any, error) { + result := PASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + switch v { + case "pass": + result = PASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + case "fail": + result = FAIL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + case "bypass": + result = BYPASS_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + case "all": + result = ALL_GETRULE_SUITE_RESULTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetRule_suite_resultQueryParameterType(values []GetRule_suite_resultQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetRule_suite_resultQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/rulesets/rulesuites/get_time_escaped_period_query_parameter_type.go b/pkg/github/repos/item/item/rulesets/rulesuites/get_time_escaped_period_query_parameter_type.go new file mode 100644 index 00000000..ae408634 --- /dev/null +++ b/pkg/github/repos/item/item/rulesets/rulesuites/get_time_escaped_period_query_parameter_type.go @@ -0,0 +1,39 @@ +package rulesuites +type GetTime_periodQueryParameterType int + +const ( + HOUR_GETTIME_PERIODQUERYPARAMETERTYPE GetTime_periodQueryParameterType = iota + DAY_GETTIME_PERIODQUERYPARAMETERTYPE + WEEK_GETTIME_PERIODQUERYPARAMETERTYPE + MONTH_GETTIME_PERIODQUERYPARAMETERTYPE +) + +func (i GetTime_periodQueryParameterType) String() string { + return []string{"hour", "day", "week", "month"}[i] +} +func ParseGetTime_periodQueryParameterType(v string) (any, error) { + result := HOUR_GETTIME_PERIODQUERYPARAMETERTYPE + switch v { + case "hour": + result = HOUR_GETTIME_PERIODQUERYPARAMETERTYPE + case "day": + result = DAY_GETTIME_PERIODQUERYPARAMETERTYPE + case "week": + result = WEEK_GETTIME_PERIODQUERYPARAMETERTYPE + case "month": + result = MONTH_GETTIME_PERIODQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetTime_periodQueryParameterType(values []GetTime_periodQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTime_periodQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/secretscanning/alerts/get_direction_query_parameter_type.go b/pkg/github/repos/item/item/secretscanning/alerts/get_direction_query_parameter_type.go new file mode 100644 index 00000000..0606c6d4 --- /dev/null +++ b/pkg/github/repos/item/item/secretscanning/alerts/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/secretscanning/alerts/get_sort_query_parameter_type.go b/pkg/github/repos/item/item/secretscanning/alerts/get_sort_query_parameter_type.go new file mode 100644 index 00000000..719c5fb3 --- /dev/null +++ b/pkg/github/repos/item/item/secretscanning/alerts/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/secretscanning/alerts/get_state_query_parameter_type.go b/pkg/github/repos/item/item/secretscanning/alerts/get_state_query_parameter_type.go new file mode 100644 index 00000000..ae552fb1 --- /dev/null +++ b/pkg/github/repos/item/item/secretscanning/alerts/get_state_query_parameter_type.go @@ -0,0 +1,33 @@ +package alerts +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + RESOLVED_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "resolved"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "resolved": + result = RESOLVED_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item/item/statuses/item/with_sha_post_request_body_escaped_state.go b/pkg/github/repos/item/item/statuses/item/with_sha_post_request_body_escaped_state.go new file mode 100644 index 00000000..9dfb1f70 --- /dev/null +++ b/pkg/github/repos/item/item/statuses/item/with_sha_post_request_body_escaped_state.go @@ -0,0 +1,40 @@ +package item +// The state of the status. +type WithShaPostRequestBody_state int + +const ( + ERROR_WITHSHAPOSTREQUESTBODY_STATE WithShaPostRequestBody_state = iota + FAILURE_WITHSHAPOSTREQUESTBODY_STATE + PENDING_WITHSHAPOSTREQUESTBODY_STATE + SUCCESS_WITHSHAPOSTREQUESTBODY_STATE +) + +func (i WithShaPostRequestBody_state) String() string { + return []string{"error", "failure", "pending", "success"}[i] +} +func ParseWithShaPostRequestBody_state(v string) (any, error) { + result := ERROR_WITHSHAPOSTREQUESTBODY_STATE + switch v { + case "error": + result = ERROR_WITHSHAPOSTREQUESTBODY_STATE + case "failure": + result = FAILURE_WITHSHAPOSTREQUESTBODY_STATE + case "pending": + result = PENDING_WITHSHAPOSTREQUESTBODY_STATE + case "success": + result = SUCCESS_WITHSHAPOSTREQUESTBODY_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeWithShaPostRequestBody_state(values []WithShaPostRequestBody_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithShaPostRequestBody_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/repos/item_item_actions_artifacts_get_response.go b/pkg/github/repos/item_item_actions_artifacts_get_response.go new file mode 100644 index 00000000..61300fb3 --- /dev/null +++ b/pkg/github/repos/item_item_actions_artifacts_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsArtifactsGetResponse 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 artifacts property + artifacts []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable + // The total_count property + total_count *int32 +} +// NewItemItemActionsArtifactsGetResponse instantiates a new ItemItemActionsArtifactsGetResponse and sets the default values. +func NewItemItemActionsArtifactsGetResponse()(*ItemItemActionsArtifactsGetResponse) { + m := &ItemItemActionsArtifactsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsArtifactsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsArtifactsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsArtifactsGetResponse(), 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 *ItemItemActionsArtifactsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArtifacts gets the artifacts property value. The artifacts property +// returns a []Artifactable when successful +func (m *ItemItemActionsArtifactsGetResponse) GetArtifacts()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable) { + return m.artifacts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsArtifactsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["artifacts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateArtifactFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable) + } + } + m.SetArtifacts(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 *ItemItemActionsArtifactsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsArtifactsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetArtifacts() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetArtifacts())) + for i, v := range m.GetArtifacts() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("artifacts", 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 *ItemItemActionsArtifactsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArtifacts sets the artifacts property value. The artifacts property +func (m *ItemItemActionsArtifactsGetResponse) SetArtifacts(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable)() { + m.artifacts = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsArtifactsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsArtifactsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArtifacts()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable) + GetTotalCount()(*int32) + SetArtifacts(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_actions_artifacts_item_with_archive_escaped_format_item_request_builder.go b/pkg/github/repos/item_item_actions_artifacts_item_with_archive_escaped_format_item_request_builder.go new file mode 100644 index 00000000..a1e9ec51 --- /dev/null +++ b/pkg/github/repos/item_item_actions_artifacts_item_with_archive_escaped_format_item_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\artifacts\{artifact_id}\{archive_format} +type ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilderInternal instantiates a new ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder and sets the default values. +func NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) { + m := &ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/artifacts/{artifact_id}/{archive_format}", pathParameters), + } + return m +} +// NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder instantiates a new ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder and sets the default values. +func NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` inthe response header to find the URL for the download. The `:archive_format` must be `zip`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/artifacts#download-an-artifact +func (m *ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets a redirect URL to download an archive for a repository. This URL expires after 1 minute. Look for `Location:` inthe response header to find the URL for the download. The `:archive_format` must be `zip`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) 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 *ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder when successful +func (m *ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) { + return NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_artifacts_request_builder.go b/pkg/github/repos/item_item_actions_artifacts_request_builder.go new file mode 100644 index 00000000..8d5795ef --- /dev/null +++ b/pkg/github/repos/item_item_actions_artifacts_request_builder.go @@ -0,0 +1,76 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsArtifactsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\artifacts +type ItemItemActionsArtifactsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsArtifactsRequestBuilderGetQueryParameters lists all artifacts for a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsArtifactsRequestBuilderGetQueryParameters struct { + // The name field of an artifact. When specified, only artifacts with this name will be returned. + Name *string `uriparametername:"name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByArtifact_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.actions.artifacts.item collection +// returns a *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder when successful +func (m *ItemItemActionsArtifactsRequestBuilder) ByArtifact_id(artifact_id int32)(*ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["artifact_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(artifact_id), 10) + return NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsArtifactsRequestBuilderInternal instantiates a new ItemItemActionsArtifactsRequestBuilder and sets the default values. +func NewItemItemActionsArtifactsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsRequestBuilder) { + m := &ItemItemActionsArtifactsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/artifacts{?name*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsArtifactsRequestBuilder instantiates a new ItemItemActionsArtifactsRequestBuilder and sets the default values. +func NewItemItemActionsArtifactsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsArtifactsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all artifacts for a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemActionsArtifactsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/artifacts#list-artifacts-for-a-repository +func (m *ItemItemActionsArtifactsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsArtifactsRequestBuilderGetQueryParameters])(ItemItemActionsArtifactsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsArtifactsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsArtifactsGetResponseable), nil +} +// ToGetRequestInformation lists all artifacts for a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsArtifactsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsArtifactsRequestBuilderGetQueryParameters])(*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 *ItemItemActionsArtifactsRequestBuilder when successful +func (m *ItemItemActionsArtifactsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsArtifactsRequestBuilder) { + return NewItemItemActionsArtifactsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_artifacts_with_artifact_escaped_item_request_builder.go b/pkg/github/repos/item_item_actions_artifacts_with_artifact_escaped_item_request_builder.go new file mode 100644 index 00000000..1d6fccbf --- /dev/null +++ b/pkg/github/repos/item_item_actions_artifacts_with_artifact_escaped_item_request_builder.go @@ -0,0 +1,91 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\artifacts\{artifact_id} +type ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByArchive_format gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.actions.artifacts.item.item collection +// returns a *ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder when successful +func (m *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) ByArchive_format(archive_format string)(*ItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if archive_format != "" { + urlTplParams["archive_format"] = archive_format + } + return NewItemItemActionsArtifactsItemWithArchive_formatItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilderInternal instantiates a new ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder and sets the default values. +func NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) { + m := &ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/artifacts/{artifact_id}", pathParameters), + } + return m +} +// NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilder instantiates a new ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder and sets the default values. +func NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an artifact for a workflow run.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/artifacts#delete-an-artifact +func (m *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific artifact for a workflow run.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a Artifactable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/artifacts#get-an-artifact +func (m *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateArtifactFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable), nil +} +// ToDeleteRequestInformation deletes an artifact for a workflow run.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsArtifactsWithArtifact_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific artifact for a workflow run.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsArtifactsWithArtifact_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder when successful +func (m *ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsArtifactsWithArtifact_ItemRequestBuilder) { + return NewItemItemActionsArtifactsWithArtifact_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_cache_request_builder.go b/pkg/github/repos/item_item_actions_cache_request_builder.go new file mode 100644 index 00000000..97638132 --- /dev/null +++ b/pkg/github/repos/item_item_actions_cache_request_builder.go @@ -0,0 +1,33 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsCacheRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\cache +type ItemItemActionsCacheRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsCacheRequestBuilderInternal instantiates a new ItemItemActionsCacheRequestBuilder and sets the default values. +func NewItemItemActionsCacheRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCacheRequestBuilder) { + m := &ItemItemActionsCacheRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/cache", pathParameters), + } + return m +} +// NewItemItemActionsCacheRequestBuilder instantiates a new ItemItemActionsCacheRequestBuilder and sets the default values. +func NewItemItemActionsCacheRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCacheRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsCacheRequestBuilderInternal(urlParams, requestAdapter) +} +// Usage the usage property +// returns a *ItemItemActionsCacheUsageRequestBuilder when successful +func (m *ItemItemActionsCacheRequestBuilder) Usage()(*ItemItemActionsCacheUsageRequestBuilder) { + return NewItemItemActionsCacheUsageRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// UsagePolicy the usagePolicy property +// returns a *ItemItemActionsCacheUsagePolicyRequestBuilder when successful +func (m *ItemItemActionsCacheRequestBuilder) UsagePolicy()(*ItemItemActionsCacheUsagePolicyRequestBuilder) { + return NewItemItemActionsCacheUsagePolicyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/repos/item_item_actions_cache_usage_policy_request_builder.go b/pkg/github/repos/item_item_actions_cache_usage_policy_request_builder.go new file mode 100644 index 00000000..e167908a --- /dev/null +++ b/pkg/github/repos/item_item_actions_cache_usage_policy_request_builder.go @@ -0,0 +1,83 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsCacheUsagePolicyRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\cache\usage-policy +type ItemItemActionsCacheUsagePolicyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsCacheUsagePolicyRequestBuilderInternal instantiates a new ItemItemActionsCacheUsagePolicyRequestBuilder and sets the default values. +func NewItemItemActionsCacheUsagePolicyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCacheUsagePolicyRequestBuilder) { + m := &ItemItemActionsCacheUsagePolicyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/cache/usage-policy", pathParameters), + } + return m +} +// NewItemItemActionsCacheUsagePolicyRequestBuilder instantiates a new ItemItemActionsCacheUsagePolicyRequestBuilder and sets the default values. +func NewItemItemActionsCacheUsagePolicyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCacheUsagePolicyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsCacheUsagePolicyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets GitHub Actions cache usage policy for a repository.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsCacheUsagePolicyForRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#get-github-actions-cache-usage-policy-for-a-repository +func (m *ItemItemActionsCacheUsagePolicyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsagePolicyForRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsCacheUsagePolicyForRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsagePolicyForRepositoryable), nil +} +// Patch sets GitHub Actions cache usage policy for a repository.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#set-github-actions-cache-usage-policy-for-a-repository +func (m *ItemItemActionsCacheUsagePolicyRequestBuilder) Patch(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsagePolicyForRepositoryable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets GitHub Actions cache usage policy for a repository.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsCacheUsagePolicyRequestBuilder) 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 sets GitHub Actions cache usage policy for a repository.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsCacheUsagePolicyRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsagePolicyForRepositoryable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemItemActionsCacheUsagePolicyRequestBuilder when successful +func (m *ItemItemActionsCacheUsagePolicyRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsCacheUsagePolicyRequestBuilder) { + return NewItemItemActionsCacheUsagePolicyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_cache_usage_request_builder.go b/pkg/github/repos/item_item_actions_cache_usage_request_builder.go new file mode 100644 index 00000000..76d24114 --- /dev/null +++ b/pkg/github/repos/item_item_actions_cache_usage_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsCacheUsageRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\cache\usage +type ItemItemActionsCacheUsageRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsCacheUsageRequestBuilderInternal instantiates a new ItemItemActionsCacheUsageRequestBuilder and sets the default values. +func NewItemItemActionsCacheUsageRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCacheUsageRequestBuilder) { + m := &ItemItemActionsCacheUsageRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/cache/usage", pathParameters), + } + return m +} +// NewItemItemActionsCacheUsageRequestBuilder instantiates a new ItemItemActionsCacheUsageRequestBuilder and sets the default values. +func NewItemItemActionsCacheUsageRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCacheUsageRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsCacheUsageRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets GitHub Actions cache usage for a repository.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsCacheUsageByRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#get-github-actions-cache-usage-for-a-repository +func (m *ItemItemActionsCacheUsageRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsageByRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsCacheUsageByRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheUsageByRepositoryable), nil +} +// ToGetRequestInformation gets GitHub Actions cache usage for a repository.The data fetched using this API is refreshed approximately every 5 minutes, so values returned from this endpoint may take at least 5 minutes to get updated.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsCacheUsageRequestBuilder) 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 *ItemItemActionsCacheUsageRequestBuilder when successful +func (m *ItemItemActionsCacheUsageRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsCacheUsageRequestBuilder) { + return NewItemItemActionsCacheUsageRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_caches_request_builder.go b/pkg/github/repos/item_item_actions_caches_request_builder.go new file mode 100644 index 00000000..0835a8ca --- /dev/null +++ b/pkg/github/repos/item_item_actions_caches_request_builder.go @@ -0,0 +1,118 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i8b204dcde995ee341e5bbddd9cc39955f8e8755f676aad97ef2843097de21fbb "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/actions/caches" +) + +// ItemItemActionsCachesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\caches +type ItemItemActionsCachesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsCachesRequestBuilderDeleteQueryParameters deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemActionsCachesRequestBuilderDeleteQueryParameters struct { + // A key for identifying the cache. + Key *string `uriparametername:"key"` + // The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. + Ref *string `uriparametername:"ref"` +} +// ItemItemActionsCachesRequestBuilderGetQueryParameters lists the GitHub Actions caches for a repository.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemActionsCachesRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i8b204dcde995ee341e5bbddd9cc39955f8e8755f676aad97ef2843097de21fbb.GetDirectionQueryParameterType `uriparametername:"direction"` + // An explicit key or prefix for identifying the cache + Key *string `uriparametername:"key"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The full Git reference for narrowing down the cache. The `ref` for a branch should be formatted as `refs/heads/`. To reference a pull request use `refs/pull//merge`. + Ref *string `uriparametername:"ref"` + // The property to sort the results by. `created_at` means when the cache was created. `last_accessed_at` means when the cache was last accessed. `size_in_bytes` is the size of the cache in bytes. + Sort *i8b204dcde995ee341e5bbddd9cc39955f8e8755f676aad97ef2843097de21fbb.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByCache_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.actions.caches.item collection +// returns a *ItemItemActionsCachesWithCache_ItemRequestBuilder when successful +func (m *ItemItemActionsCachesRequestBuilder) ByCache_id(cache_id int32)(*ItemItemActionsCachesWithCache_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["cache_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(cache_id), 10) + return NewItemItemActionsCachesWithCache_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsCachesRequestBuilderInternal instantiates a new ItemItemActionsCachesRequestBuilder and sets the default values. +func NewItemItemActionsCachesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCachesRequestBuilder) { + m := &ItemItemActionsCachesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/caches{?direction*,key*,page*,per_page*,ref*,sort*}", pathParameters), + } + return m +} +// NewItemItemActionsCachesRequestBuilder instantiates a new ItemItemActionsCachesRequestBuilder and sets the default values. +func NewItemItemActionsCachesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCachesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsCachesRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsCacheListable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#delete-github-actions-caches-for-a-repository-using-a-cache-key +func (m *ItemItemActionsCachesRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsCachesRequestBuilderDeleteQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheListable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsCacheListFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheListable), nil +} +// Get lists the GitHub Actions caches for a repository.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsCacheListable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#list-github-actions-caches-for-a-repository +func (m *ItemItemActionsCachesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsCachesRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheListable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsCacheListFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsCacheListable), nil +} +// ToDeleteRequestInformation deletes one or more GitHub Actions caches for a repository, using a complete cache key. By default, all caches that match the provided key are deleted, but you can optionally provide a Git ref to restrict deletions to caches that match both the provided key and the Git ref.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsCachesRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsCachesRequestBuilderDeleteQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/caches?key={key}{&ref*}", m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation lists the GitHub Actions caches for a repository.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsCachesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsCachesRequestBuilderGetQueryParameters])(*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 *ItemItemActionsCachesRequestBuilder when successful +func (m *ItemItemActionsCachesRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsCachesRequestBuilder) { + return NewItemItemActionsCachesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_caches_with_cache_escaped_item_request_builder.go b/pkg/github/repos/item_item_actions_caches_with_cache_escaped_item_request_builder.go new file mode 100644 index 00000000..de89f4a2 --- /dev/null +++ b/pkg/github/repos/item_item_actions_caches_with_cache_escaped_item_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsCachesWithCache_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\caches\{cache_id} +type ItemItemActionsCachesWithCache_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsCachesWithCache_ItemRequestBuilderInternal instantiates a new ItemItemActionsCachesWithCache_ItemRequestBuilder and sets the default values. +func NewItemItemActionsCachesWithCache_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCachesWithCache_ItemRequestBuilder) { + m := &ItemItemActionsCachesWithCache_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/caches/{cache_id}", pathParameters), + } + return m +} +// NewItemItemActionsCachesWithCache_ItemRequestBuilder instantiates a new ItemItemActionsCachesWithCache_ItemRequestBuilder and sets the default values. +func NewItemItemActionsCachesWithCache_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsCachesWithCache_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsCachesWithCache_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a GitHub Actions cache for a repository, using a cache ID.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/cache#delete-a-github-actions-cache-for-a-repository-using-a-cache-id +func (m *ItemItemActionsCachesWithCache_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation deletes a GitHub Actions cache for a repository, using a cache ID.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsCachesWithCache_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) + 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 *ItemItemActionsCachesWithCache_ItemRequestBuilder when successful +func (m *ItemItemActionsCachesWithCache_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsCachesWithCache_ItemRequestBuilder) { + return NewItemItemActionsCachesWithCache_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_jobs_item_logs_request_builder.go b/pkg/github/repos/item_item_actions_jobs_item_logs_request_builder.go new file mode 100644 index 00000000..f480fcc0 --- /dev/null +++ b/pkg/github/repos/item_item_actions_jobs_item_logs_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsJobsItemLogsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\jobs\{job_id}\logs +type ItemItemActionsJobsItemLogsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsJobsItemLogsRequestBuilderInternal instantiates a new ItemItemActionsJobsItemLogsRequestBuilder and sets the default values. +func NewItemItemActionsJobsItemLogsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsItemLogsRequestBuilder) { + m := &ItemItemActionsJobsItemLogsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/jobs/{job_id}/logs", pathParameters), + } + return m +} +// NewItemItemActionsJobsItemLogsRequestBuilder instantiates a new ItemItemActionsJobsItemLogsRequestBuilder and sets the default values. +func NewItemItemActionsJobsItemLogsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsItemLogsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsJobsItemLogsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Lookfor `Location:` in the response header to find the URL for the download.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-jobs#download-job-logs-for-a-workflow-run +func (m *ItemItemActionsJobsItemLogsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets a redirect URL to download a plain text file of logs for a workflow job. This link expires after 1 minute. Lookfor `Location:` in the response header to find the URL for the download.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsJobsItemLogsRequestBuilder) 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) + 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 *ItemItemActionsJobsItemLogsRequestBuilder when successful +func (m *ItemItemActionsJobsItemLogsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsJobsItemLogsRequestBuilder) { + return NewItemItemActionsJobsItemLogsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_jobs_item_rerun_post_request_body.go b/pkg/github/repos/item_item_actions_jobs_item_rerun_post_request_body.go new file mode 100644 index 00000000..317ac7a3 --- /dev/null +++ b/pkg/github/repos/item_item_actions_jobs_item_rerun_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsJobsItemRerunPostRequestBody 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 enable debug logging for the re-run. + enable_debug_logging *bool +} +// NewItemItemActionsJobsItemRerunPostRequestBody instantiates a new ItemItemActionsJobsItemRerunPostRequestBody and sets the default values. +func NewItemItemActionsJobsItemRerunPostRequestBody()(*ItemItemActionsJobsItemRerunPostRequestBody) { + m := &ItemItemActionsJobsItemRerunPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsJobsItemRerunPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsJobsItemRerunPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsJobsItemRerunPostRequestBody(), 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 *ItemItemActionsJobsItemRerunPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnableDebugLogging gets the enable_debug_logging property value. Whether to enable debug logging for the re-run. +// returns a *bool when successful +func (m *ItemItemActionsJobsItemRerunPostRequestBody) GetEnableDebugLogging()(*bool) { + return m.enable_debug_logging +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsJobsItemRerunPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enable_debug_logging"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnableDebugLogging(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemActionsJobsItemRerunPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enable_debug_logging", m.GetEnableDebugLogging()) + 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 *ItemItemActionsJobsItemRerunPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnableDebugLogging sets the enable_debug_logging property value. Whether to enable debug logging for the re-run. +func (m *ItemItemActionsJobsItemRerunPostRequestBody) SetEnableDebugLogging(value *bool)() { + m.enable_debug_logging = value +} +type ItemItemActionsJobsItemRerunPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnableDebugLogging()(*bool) + SetEnableDebugLogging(value *bool)() +} diff --git a/pkg/github/repos/item_item_actions_jobs_item_rerun_request_builder.go b/pkg/github/repos/item_item_actions_jobs_item_rerun_request_builder.go new file mode 100644 index 00000000..c437b4aa --- /dev/null +++ b/pkg/github/repos/item_item_actions_jobs_item_rerun_request_builder.go @@ -0,0 +1,65 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsJobsItemRerunRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\jobs\{job_id}\rerun +type ItemItemActionsJobsItemRerunRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsJobsItemRerunRequestBuilderInternal instantiates a new ItemItemActionsJobsItemRerunRequestBuilder and sets the default values. +func NewItemItemActionsJobsItemRerunRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsItemRerunRequestBuilder) { + m := &ItemItemActionsJobsItemRerunRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/jobs/{job_id}/rerun", pathParameters), + } + return m +} +// NewItemItemActionsJobsItemRerunRequestBuilder instantiates a new ItemItemActionsJobsItemRerunRequestBuilder and sets the default values. +func NewItemItemActionsJobsItemRerunRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsItemRerunRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsJobsItemRerunRequestBuilderInternal(urlParams, requestAdapter) +} +// Post re-run a job and its dependent jobs in a workflow run.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run +func (m *ItemItemActionsJobsItemRerunRequestBuilder) Post(ctx context.Context, body ItemItemActionsJobsItemRerunPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToPostRequestInformation re-run a job and its dependent jobs in a workflow run.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsJobsItemRerunRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsJobsItemRerunPostRequestBodyable, 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 *ItemItemActionsJobsItemRerunRequestBuilder when successful +func (m *ItemItemActionsJobsItemRerunRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsJobsItemRerunRequestBuilder) { + return NewItemItemActionsJobsItemRerunRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_jobs_request_builder.go b/pkg/github/repos/item_item_actions_jobs_request_builder.go new file mode 100644 index 00000000..906be975 --- /dev/null +++ b/pkg/github/repos/item_item_actions_jobs_request_builder.go @@ -0,0 +1,34 @@ +package repos + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsJobsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\jobs +type ItemItemActionsJobsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByJob_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.actions.jobs.item collection +// returns a *ItemItemActionsJobsWithJob_ItemRequestBuilder when successful +func (m *ItemItemActionsJobsRequestBuilder) ByJob_id(job_id int32)(*ItemItemActionsJobsWithJob_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["job_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(job_id), 10) + return NewItemItemActionsJobsWithJob_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsJobsRequestBuilderInternal instantiates a new ItemItemActionsJobsRequestBuilder and sets the default values. +func NewItemItemActionsJobsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsRequestBuilder) { + m := &ItemItemActionsJobsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/jobs", pathParameters), + } + return m +} +// NewItemItemActionsJobsRequestBuilder instantiates a new ItemItemActionsJobsRequestBuilder and sets the default values. +func NewItemItemActionsJobsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsJobsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_actions_jobs_with_job_escaped_item_request_builder.go b/pkg/github/repos/item_item_actions_jobs_with_job_escaped_item_request_builder.go new file mode 100644 index 00000000..5fd6726d --- /dev/null +++ b/pkg/github/repos/item_item_actions_jobs_with_job_escaped_item_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsJobsWithJob_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\jobs\{job_id} +type ItemItemActionsJobsWithJob_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsJobsWithJob_ItemRequestBuilderInternal instantiates a new ItemItemActionsJobsWithJob_ItemRequestBuilder and sets the default values. +func NewItemItemActionsJobsWithJob_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsWithJob_ItemRequestBuilder) { + m := &ItemItemActionsJobsWithJob_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/jobs/{job_id}", pathParameters), + } + return m +} +// NewItemItemActionsJobsWithJob_ItemRequestBuilder instantiates a new ItemItemActionsJobsWithJob_ItemRequestBuilder and sets the default values. +func NewItemItemActionsJobsWithJob_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsJobsWithJob_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsJobsWithJob_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a specific job in a workflow run.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a Jobable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run +func (m *ItemItemActionsJobsWithJob_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateJobFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable), nil +} +// Logs the logs property +// returns a *ItemItemActionsJobsItemLogsRequestBuilder when successful +func (m *ItemItemActionsJobsWithJob_ItemRequestBuilder) Logs()(*ItemItemActionsJobsItemLogsRequestBuilder) { + return NewItemItemActionsJobsItemLogsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rerun the rerun property +// returns a *ItemItemActionsJobsItemRerunRequestBuilder when successful +func (m *ItemItemActionsJobsWithJob_ItemRequestBuilder) Rerun()(*ItemItemActionsJobsItemRerunRequestBuilder) { + return NewItemItemActionsJobsItemRerunRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets a specific job in a workflow run.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsJobsWithJob_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsJobsWithJob_ItemRequestBuilder when successful +func (m *ItemItemActionsJobsWithJob_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsJobsWithJob_ItemRequestBuilder) { + return NewItemItemActionsJobsWithJob_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_oidc_customization_request_builder.go b/pkg/github/repos/item_item_actions_oidc_customization_request_builder.go new file mode 100644 index 00000000..add4b864 --- /dev/null +++ b/pkg/github/repos/item_item_actions_oidc_customization_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsOidcCustomizationRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\oidc\customization +type ItemItemActionsOidcCustomizationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsOidcCustomizationRequestBuilderInternal instantiates a new ItemItemActionsOidcCustomizationRequestBuilder and sets the default values. +func NewItemItemActionsOidcCustomizationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOidcCustomizationRequestBuilder) { + m := &ItemItemActionsOidcCustomizationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/oidc/customization", pathParameters), + } + return m +} +// NewItemItemActionsOidcCustomizationRequestBuilder instantiates a new ItemItemActionsOidcCustomizationRequestBuilder and sets the default values. +func NewItemItemActionsOidcCustomizationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOidcCustomizationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsOidcCustomizationRequestBuilderInternal(urlParams, requestAdapter) +} +// Sub the sub property +// returns a *ItemItemActionsOidcCustomizationSubRequestBuilder when successful +func (m *ItemItemActionsOidcCustomizationRequestBuilder) Sub()(*ItemItemActionsOidcCustomizationSubRequestBuilder) { + return NewItemItemActionsOidcCustomizationSubRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/repos/item_item_actions_oidc_customization_sub_put_request_body.go b/pkg/github/repos/item_item_actions_oidc_customization_sub_put_request_body.go new file mode 100644 index 00000000..bc19ea6a --- /dev/null +++ b/pkg/github/repos/item_item_actions_oidc_customization_sub_put_request_body.go @@ -0,0 +1,116 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsOidcCustomizationSubPutRequestBody actions OIDC subject customization for a repository +type ItemItemActionsOidcCustomizationSubPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. + include_claim_keys []string + // Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. + use_default *bool +} +// NewItemItemActionsOidcCustomizationSubPutRequestBody instantiates a new ItemItemActionsOidcCustomizationSubPutRequestBody and sets the default values. +func NewItemItemActionsOidcCustomizationSubPutRequestBody()(*ItemItemActionsOidcCustomizationSubPutRequestBody) { + m := &ItemItemActionsOidcCustomizationSubPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsOidcCustomizationSubPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsOidcCustomizationSubPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsOidcCustomizationSubPutRequestBody(), 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 *ItemItemActionsOidcCustomizationSubPutRequestBody) 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 *ItemItemActionsOidcCustomizationSubPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["include_claim_keys"] = 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.SetIncludeClaimKeys(res) + } + return nil + } + res["use_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseDefault(val) + } + return nil + } + return res +} +// GetIncludeClaimKeys gets the include_claim_keys property value. Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. +// returns a []string when successful +func (m *ItemItemActionsOidcCustomizationSubPutRequestBody) GetIncludeClaimKeys()([]string) { + return m.include_claim_keys +} +// GetUseDefault gets the use_default property value. Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. +// returns a *bool when successful +func (m *ItemItemActionsOidcCustomizationSubPutRequestBody) GetUseDefault()(*bool) { + return m.use_default +} +// Serialize serializes information the current object +func (m *ItemItemActionsOidcCustomizationSubPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetIncludeClaimKeys() != nil { + err := writer.WriteCollectionOfStringValues("include_claim_keys", m.GetIncludeClaimKeys()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_default", m.GetUseDefault()) + 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 *ItemItemActionsOidcCustomizationSubPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncludeClaimKeys sets the include_claim_keys property value. Array of unique strings. Each claim key can only contain alphanumeric characters and underscores. +func (m *ItemItemActionsOidcCustomizationSubPutRequestBody) SetIncludeClaimKeys(value []string)() { + m.include_claim_keys = value +} +// SetUseDefault sets the use_default property value. Whether to use the default template or not. If `true`, the `include_claim_keys` field is ignored. +func (m *ItemItemActionsOidcCustomizationSubPutRequestBody) SetUseDefault(value *bool)() { + m.use_default = value +} +type ItemItemActionsOidcCustomizationSubPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncludeClaimKeys()([]string) + GetUseDefault()(*bool) + SetIncludeClaimKeys(value []string)() + SetUseDefault(value *bool)() +} diff --git a/pkg/github/repos/item_item_actions_oidc_customization_sub_request_builder.go b/pkg/github/repos/item_item_actions_oidc_customization_sub_request_builder.go new file mode 100644 index 00000000..7d1c8e55 --- /dev/null +++ b/pkg/github/repos/item_item_actions_oidc_customization_sub_request_builder.go @@ -0,0 +1,102 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsOidcCustomizationSubRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\oidc\customization\sub +type ItemItemActionsOidcCustomizationSubRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsOidcCustomizationSubRequestBuilderInternal instantiates a new ItemItemActionsOidcCustomizationSubRequestBuilder and sets the default values. +func NewItemItemActionsOidcCustomizationSubRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOidcCustomizationSubRequestBuilder) { + m := &ItemItemActionsOidcCustomizationSubRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/oidc/customization/sub", pathParameters), + } + return m +} +// NewItemItemActionsOidcCustomizationSubRequestBuilder instantiates a new ItemItemActionsOidcCustomizationSubRequestBuilder and sets the default values. +func NewItemItemActionsOidcCustomizationSubRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOidcCustomizationSubRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsOidcCustomizationSubRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the customization template for an OpenID Connect (OIDC) subject claim.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a OidcCustomSubRepoable 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/enterprise-server@3.14/rest/actions/oidc#get-the-customization-template-for-an-oidc-subject-claim-for-a-repository +func (m *ItemItemActionsOidcCustomizationSubRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OidcCustomSubRepoable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOidcCustomSubRepoFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OidcCustomSubRepoable), nil +} +// Put sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable 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 +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/oidc#set-the-customization-template-for-an-oidc-subject-claim-for-a-repository +func (m *ItemItemActionsOidcCustomizationSubRequestBuilder) Put(ctx context.Context, body ItemItemActionsOidcCustomizationSubPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToGetRequestInformation gets the customization template for an OpenID Connect (OIDC) subject claim.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsOidcCustomizationSubRequestBuilder) 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 +} +// ToPutRequestInformation sets the customization template and `opt-in` or `opt-out` flag for an OpenID Connect (OIDC) subject claim for a repository.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsOidcCustomizationSubRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemActionsOidcCustomizationSubPutRequestBodyable, 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 *ItemItemActionsOidcCustomizationSubRequestBuilder when successful +func (m *ItemItemActionsOidcCustomizationSubRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsOidcCustomizationSubRequestBuilder) { + return NewItemItemActionsOidcCustomizationSubRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_oidc_request_builder.go b/pkg/github/repos/item_item_actions_oidc_request_builder.go new file mode 100644 index 00000000..c98d18ae --- /dev/null +++ b/pkg/github/repos/item_item_actions_oidc_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsOidcRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\oidc +type ItemItemActionsOidcRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsOidcRequestBuilderInternal instantiates a new ItemItemActionsOidcRequestBuilder and sets the default values. +func NewItemItemActionsOidcRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOidcRequestBuilder) { + m := &ItemItemActionsOidcRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/oidc", pathParameters), + } + return m +} +// NewItemItemActionsOidcRequestBuilder instantiates a new ItemItemActionsOidcRequestBuilder and sets the default values. +func NewItemItemActionsOidcRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOidcRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsOidcRequestBuilderInternal(urlParams, requestAdapter) +} +// Customization the customization property +// returns a *ItemItemActionsOidcCustomizationRequestBuilder when successful +func (m *ItemItemActionsOidcRequestBuilder) Customization()(*ItemItemActionsOidcCustomizationRequestBuilder) { + return NewItemItemActionsOidcCustomizationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/repos/item_item_actions_organization_secrets_get_response.go b/pkg/github/repos/item_item_actions_organization_secrets_get_response.go new file mode 100644 index 00000000..e5c215c1 --- /dev/null +++ b/pkg/github/repos/item_item_actions_organization_secrets_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsOrganizationSecretsGetResponse 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 secrets property + secrets []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable + // The total_count property + total_count *int32 +} +// NewItemItemActionsOrganizationSecretsGetResponse instantiates a new ItemItemActionsOrganizationSecretsGetResponse and sets the default values. +func NewItemItemActionsOrganizationSecretsGetResponse()(*ItemItemActionsOrganizationSecretsGetResponse) { + m := &ItemItemActionsOrganizationSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsOrganizationSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsOrganizationSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsOrganizationSecretsGetResponse(), 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 *ItemItemActionsOrganizationSecretsGetResponse) 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 *ItemItemActionsOrganizationSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable) + } + } + m.SetSecrets(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 +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []ActionsSecretable when successful +func (m *ItemItemActionsOrganizationSecretsGetResponse) GetSecrets()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsOrganizationSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsOrganizationSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", 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 *ItemItemActionsOrganizationSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemItemActionsOrganizationSecretsGetResponse) SetSecrets(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsOrganizationSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsOrganizationSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable) + GetTotalCount()(*int32) + SetSecrets(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_actions_organization_secrets_request_builder.go b/pkg/github/repos/item_item_actions_organization_secrets_request_builder.go new file mode 100644 index 00000000..6eded0c3 --- /dev/null +++ b/pkg/github/repos/item_item_actions_organization_secrets_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsOrganizationSecretsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\organization-secrets +type ItemItemActionsOrganizationSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsOrganizationSecretsRequestBuilderGetQueryParameters lists all organization secrets shared with a repository without revealing their encryptedvalues.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemActionsOrganizationSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemActionsOrganizationSecretsRequestBuilderInternal instantiates a new ItemItemActionsOrganizationSecretsRequestBuilder and sets the default values. +func NewItemItemActionsOrganizationSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOrganizationSecretsRequestBuilder) { + m := &ItemItemActionsOrganizationSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/organization-secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsOrganizationSecretsRequestBuilder instantiates a new ItemItemActionsOrganizationSecretsRequestBuilder and sets the default values. +func NewItemItemActionsOrganizationSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOrganizationSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsOrganizationSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all organization secrets shared with a repository without revealing their encryptedvalues.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsOrganizationSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#list-repository-organization-secrets +func (m *ItemItemActionsOrganizationSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsOrganizationSecretsRequestBuilderGetQueryParameters])(ItemItemActionsOrganizationSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsOrganizationSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsOrganizationSecretsGetResponseable), nil +} +// ToGetRequestInformation lists all organization secrets shared with a repository without revealing their encryptedvalues.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsOrganizationSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsOrganizationSecretsRequestBuilderGetQueryParameters])(*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 *ItemItemActionsOrganizationSecretsRequestBuilder when successful +func (m *ItemItemActionsOrganizationSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsOrganizationSecretsRequestBuilder) { + return NewItemItemActionsOrganizationSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_organization_variables_get_response.go b/pkg/github/repos/item_item_actions_organization_variables_get_response.go new file mode 100644 index 00000000..c3f5e925 --- /dev/null +++ b/pkg/github/repos/item_item_actions_organization_variables_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsOrganizationVariablesGetResponse 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 total_count property + total_count *int32 + // The variables property + variables []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable +} +// NewItemItemActionsOrganizationVariablesGetResponse instantiates a new ItemItemActionsOrganizationVariablesGetResponse and sets the default values. +func NewItemItemActionsOrganizationVariablesGetResponse()(*ItemItemActionsOrganizationVariablesGetResponse) { + m := &ItemItemActionsOrganizationVariablesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsOrganizationVariablesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsOrganizationVariablesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsOrganizationVariablesGetResponse(), 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 *ItemItemActionsOrganizationVariablesGetResponse) 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 *ItemItemActionsOrganizationVariablesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 + } + res["variables"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsVariableFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable) + } + } + m.SetVariables(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsOrganizationVariablesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetVariables gets the variables property value. The variables property +// returns a []ActionsVariableable when successful +func (m *ItemItemActionsOrganizationVariablesGetResponse) GetVariables()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable) { + return m.variables +} +// Serialize serializes information the current object +func (m *ItemItemActionsOrganizationVariablesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetVariables() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVariables())) + for i, v := range m.GetVariables() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("variables", 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 *ItemItemActionsOrganizationVariablesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsOrganizationVariablesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetVariables sets the variables property value. The variables property +func (m *ItemItemActionsOrganizationVariablesGetResponse) SetVariables(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable)() { + m.variables = value +} +type ItemItemActionsOrganizationVariablesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetVariables()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable) + SetTotalCount(value *int32)() + SetVariables(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable)() +} diff --git a/pkg/github/repos/item_item_actions_organization_variables_request_builder.go b/pkg/github/repos/item_item_actions_organization_variables_request_builder.go new file mode 100644 index 00000000..2e03cda7 --- /dev/null +++ b/pkg/github/repos/item_item_actions_organization_variables_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsOrganizationVariablesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\organization-variables +type ItemItemActionsOrganizationVariablesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsOrganizationVariablesRequestBuilderGetQueryParameters lists all organization variables shared with a repository.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemActionsOrganizationVariablesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 30). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemActionsOrganizationVariablesRequestBuilderInternal instantiates a new ItemItemActionsOrganizationVariablesRequestBuilder and sets the default values. +func NewItemItemActionsOrganizationVariablesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOrganizationVariablesRequestBuilder) { + m := &ItemItemActionsOrganizationVariablesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/organization-variables{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsOrganizationVariablesRequestBuilder instantiates a new ItemItemActionsOrganizationVariablesRequestBuilder and sets the default values. +func NewItemItemActionsOrganizationVariablesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsOrganizationVariablesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsOrganizationVariablesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all organization variables shared with a repository.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsOrganizationVariablesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#list-repository-organization-variables +func (m *ItemItemActionsOrganizationVariablesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsOrganizationVariablesRequestBuilderGetQueryParameters])(ItemItemActionsOrganizationVariablesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsOrganizationVariablesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsOrganizationVariablesGetResponseable), nil +} +// ToGetRequestInformation lists all organization variables shared with a repository.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsOrganizationVariablesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsOrganizationVariablesRequestBuilderGetQueryParameters])(*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 *ItemItemActionsOrganizationVariablesRequestBuilder when successful +func (m *ItemItemActionsOrganizationVariablesRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsOrganizationVariablesRequestBuilder) { + return NewItemItemActionsOrganizationVariablesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_permissions_access_request_builder.go b/pkg/github/repos/item_item_actions_permissions_access_request_builder.go new file mode 100644 index 00000000..d23d598e --- /dev/null +++ b/pkg/github/repos/item_item_actions_permissions_access_request_builder.go @@ -0,0 +1,83 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsPermissionsAccessRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\permissions\access +type ItemItemActionsPermissionsAccessRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsPermissionsAccessRequestBuilderInternal instantiates a new ItemItemActionsPermissionsAccessRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsAccessRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsAccessRequestBuilder) { + m := &ItemItemActionsPermissionsAccessRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/permissions/access", pathParameters), + } + return m +} +// NewItemItemActionsPermissionsAccessRequestBuilder instantiates a new ItemItemActionsPermissionsAccessRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsAccessRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsAccessRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsPermissionsAccessRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.This endpoint only applies to internal and private repositories.For more information, see "[Allowing access to components in a private repository](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)" and"[Allowing access to components in an internal repository](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsWorkflowAccessToRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#get-the-level-of-access-for-workflows-outside-of-the-repository +func (m *ItemItemActionsPermissionsAccessRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsWorkflowAccessToRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsWorkflowAccessToRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsWorkflowAccessToRepositoryable), nil +} +// Put sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.This endpoint only applies to internal and private repositories.For more information, see "[Allowing access to components in a private repository](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)" and"[Allowing access to components in an internal repository](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#set-the-level-of-access-for-workflows-outside-of-the-repository +func (m *ItemItemActionsPermissionsAccessRequestBuilder) Put(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsWorkflowAccessToRepositoryable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.This endpoint only applies to internal and private repositories.For more information, see "[Allowing access to components in a private repository](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)" and"[Allowing access to components in an internal repository](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsAccessRequestBuilder) 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 +} +// ToPutRequestInformation sets the level of access that workflows outside of the repository have to actions and reusable workflows in the repository.This endpoint only applies to internal and private repositories.For more information, see "[Allowing access to components in a private repository](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-a-private-repository)" and"[Allowing access to components in an internal repository](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#allowing-access-to-components-in-an-internal-repository)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsAccessRequestBuilder) ToPutRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsWorkflowAccessToRepositoryable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemItemActionsPermissionsAccessRequestBuilder when successful +func (m *ItemItemActionsPermissionsAccessRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsPermissionsAccessRequestBuilder) { + return NewItemItemActionsPermissionsAccessRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_permissions_put_request_body.go b/pkg/github/repos/item_item_actions_permissions_put_request_body.go new file mode 100644 index 00000000..f71a911e --- /dev/null +++ b/pkg/github/repos/item_item_actions_permissions_put_request_body.go @@ -0,0 +1,111 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsPermissionsPutRequestBody 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 permissions policy that controls the actions that are allowed to run. + allowed_actions *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions + // Whether GitHub Actions is enabled on the repository. + enabled *bool +} +// NewItemItemActionsPermissionsPutRequestBody instantiates a new ItemItemActionsPermissionsPutRequestBody and sets the default values. +func NewItemItemActionsPermissionsPutRequestBody()(*ItemItemActionsPermissionsPutRequestBody) { + m := &ItemItemActionsPermissionsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsPermissionsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsPermissionsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsPermissionsPutRequestBody(), 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 *ItemItemActionsPermissionsPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowedActions gets the allowed_actions property value. The permissions policy that controls the actions that are allowed to run. +// returns a *AllowedActions when successful +func (m *ItemItemActionsPermissionsPutRequestBody) GetAllowedActions()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions) { + return m.allowed_actions +} +// GetEnabled gets the enabled property value. Whether GitHub Actions is enabled on the repository. +// returns a *bool when successful +func (m *ItemItemActionsPermissionsPutRequestBody) GetEnabled()(*bool) { + return m.enabled +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsPermissionsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allowed_actions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParseAllowedActions) + if err != nil { + return err + } + if val != nil { + m.SetAllowedActions(val.(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions)) + } + return nil + } + res["enabled"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnabled(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemActionsPermissionsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAllowedActions() != nil { + cast := (*m.GetAllowedActions()).String() + err := writer.WriteStringValue("allowed_actions", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enabled", m.GetEnabled()) + 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 *ItemItemActionsPermissionsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowedActions sets the allowed_actions property value. The permissions policy that controls the actions that are allowed to run. +func (m *ItemItemActionsPermissionsPutRequestBody) SetAllowedActions(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions)() { + m.allowed_actions = value +} +// SetEnabled sets the enabled property value. Whether GitHub Actions is enabled on the repository. +func (m *ItemItemActionsPermissionsPutRequestBody) SetEnabled(value *bool)() { + m.enabled = value +} +type ItemItemActionsPermissionsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowedActions()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions) + GetEnabled()(*bool) + SetAllowedActions(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AllowedActions)() + SetEnabled(value *bool)() +} diff --git a/pkg/github/repos/item_item_actions_permissions_request_builder.go b/pkg/github/repos/item_item_actions_permissions_request_builder.go new file mode 100644 index 00000000..6f379913 --- /dev/null +++ b/pkg/github/repos/item_item_actions_permissions_request_builder.go @@ -0,0 +1,98 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsPermissionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\permissions +type ItemItemActionsPermissionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Access the access property +// returns a *ItemItemActionsPermissionsAccessRequestBuilder when successful +func (m *ItemItemActionsPermissionsRequestBuilder) Access()(*ItemItemActionsPermissionsAccessRequestBuilder) { + return NewItemItemActionsPermissionsAccessRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsPermissionsRequestBuilderInternal instantiates a new ItemItemActionsPermissionsRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsRequestBuilder) { + m := &ItemItemActionsPermissionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/permissions", pathParameters), + } + return m +} +// NewItemItemActionsPermissionsRequestBuilder instantiates a new ItemItemActionsPermissionsRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsPermissionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository.You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. +// returns a ActionsRepositoryPermissionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#get-github-actions-permissions-for-a-repository +func (m *ItemItemActionsPermissionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsRepositoryPermissionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsRepositoryPermissionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsRepositoryPermissionsable), nil +} +// Put sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository.If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as `allowed_actions` to `selected` actions, then you cannot override them for the repository.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#set-github-actions-permissions-for-a-repository +func (m *ItemItemActionsPermissionsRequestBuilder) Put(ctx context.Context, body ItemItemActionsPermissionsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// SelectedActions the selectedActions property +// returns a *ItemItemActionsPermissionsSelectedActionsRequestBuilder when successful +func (m *ItemItemActionsPermissionsRequestBuilder) SelectedActions()(*ItemItemActionsPermissionsSelectedActionsRequestBuilder) { + return NewItemItemActionsPermissionsSelectedActionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets the GitHub Actions permissions policy for a repository, including whether GitHub Actions is enabled and the actions allowed to run in the repository.You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsRequestBuilder) 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 +} +// ToPutRequestInformation sets the GitHub Actions permissions policy for enabling GitHub Actions and allowed actions in the repository.If the repository belongs to an organization or enterprise that has set restrictive permissions at the organization or enterprise levels, such as `allowed_actions` to `selected` actions, then you cannot override them for the repository.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemActionsPermissionsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemItemActionsPermissionsRequestBuilder when successful +func (m *ItemItemActionsPermissionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsPermissionsRequestBuilder) { + return NewItemItemActionsPermissionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} +// Workflow the workflow property +// returns a *ItemItemActionsPermissionsWorkflowRequestBuilder when successful +func (m *ItemItemActionsPermissionsRequestBuilder) Workflow()(*ItemItemActionsPermissionsWorkflowRequestBuilder) { + return NewItemItemActionsPermissionsWorkflowRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/repos/item_item_actions_permissions_selected_actions_request_builder.go b/pkg/github/repos/item_item_actions_permissions_selected_actions_request_builder.go new file mode 100644 index 00000000..3311c207 --- /dev/null +++ b/pkg/github/repos/item_item_actions_permissions_selected_actions_request_builder.go @@ -0,0 +1,83 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsPermissionsSelectedActionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\permissions\selected-actions +type ItemItemActionsPermissionsSelectedActionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsPermissionsSelectedActionsRequestBuilderInternal instantiates a new ItemItemActionsPermissionsSelectedActionsRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsSelectedActionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsSelectedActionsRequestBuilder) { + m := &ItemItemActionsPermissionsSelectedActionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/permissions/selected-actions", pathParameters), + } + return m +} +// NewItemItemActionsPermissionsSelectedActionsRequestBuilder instantiates a new ItemItemActionsPermissionsSelectedActionsRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsSelectedActionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsSelectedActionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsPermissionsSelectedActionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)."You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. +// returns a SelectedActionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#get-allowed-actions-and-reusable-workflows-for-a-repository +func (m *ItemItemActionsPermissionsSelectedActionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SelectedActionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSelectedActionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SelectedActionsable), nil +} +// Put sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)."If the repository belongs to an organization or enterprise that has `selected` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings.To use the `patterns_allowed` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#set-allowed-actions-and-reusable-workflows-for-a-repository +func (m *ItemItemActionsPermissionsSelectedActionsRequestBuilder) Put(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SelectedActionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets the settings for selected actions that are allowed in a repository. To use this endpoint, the repository policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)."You must authenticate using an access token with the `repo` scope to use this endpoint. GitHub Apps must have the `administration` repository permission to use this API. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsSelectedActionsRequestBuilder) 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 +} +// ToPutRequestInformation sets the actions that are allowed in a repository. To use this endpoint, the repository permission policy for `allowed_actions` must be configured to `selected`. For more information, see "[Set GitHub Actions permissions for a repository](#set-github-actions-permissions-for-a-repository)."If the repository belongs to an organization or enterprise that has `selected` actions set at the organization or enterprise levels, then you cannot override any of the allowed actions settings.To use the `patterns_allowed` setting for private repositories, the repository must belong to an enterprise. If the repository does not belong to an enterprise, then the `patterns_allowed` setting only applies to public repositories.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsSelectedActionsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SelectedActionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemItemActionsPermissionsSelectedActionsRequestBuilder when successful +func (m *ItemItemActionsPermissionsSelectedActionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsPermissionsSelectedActionsRequestBuilder) { + return NewItemItemActionsPermissionsSelectedActionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_permissions_workflow_request_builder.go b/pkg/github/repos/item_item_actions_permissions_workflow_request_builder.go new file mode 100644 index 00000000..dd3f88c9 --- /dev/null +++ b/pkg/github/repos/item_item_actions_permissions_workflow_request_builder.go @@ -0,0 +1,83 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsPermissionsWorkflowRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\permissions\workflow +type ItemItemActionsPermissionsWorkflowRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsPermissionsWorkflowRequestBuilderInternal instantiates a new ItemItemActionsPermissionsWorkflowRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsWorkflowRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsWorkflowRequestBuilder) { + m := &ItemItemActionsPermissionsWorkflowRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/permissions/workflow", pathParameters), + } + return m +} +// NewItemItemActionsPermissionsWorkflowRequestBuilder instantiates a new ItemItemActionsPermissionsWorkflowRequestBuilder and sets the default values. +func NewItemItemActionsPermissionsWorkflowRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsPermissionsWorkflowRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsPermissionsWorkflowRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository,as well as if GitHub Actions can submit approving pull request reviews.For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)."OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsGetDefaultWorkflowPermissionsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#get-default-workflow-permissions-for-a-repository +func (m *ItemItemActionsPermissionsWorkflowRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsGetDefaultWorkflowPermissionsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsGetDefaultWorkflowPermissionsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsGetDefaultWorkflowPermissionsable), nil +} +// Put sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository, and sets if GitHub Actionscan submit approving pull request reviews.For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/permissions#set-default-workflow-permissions-for-a-repository +func (m *ItemItemActionsPermissionsWorkflowRequestBuilder) Put(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSetDefaultWorkflowPermissionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository,as well as if GitHub Actions can submit approving pull request reviews.For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)."OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsWorkflowRequestBuilder) 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 +} +// ToPutRequestInformation sets the default workflow permissions granted to the `GITHUB_TOKEN` when running workflows in a repository, and sets if GitHub Actionscan submit approving pull request reviews.For more information, see "[Setting the permissions of the GITHUB_TOKEN for your repository](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#setting-the-permissions-of-the-github_token-for-your-repository)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsPermissionsWorkflowRequestBuilder) ToPutRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSetDefaultWorkflowPermissionsable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemItemActionsPermissionsWorkflowRequestBuilder when successful +func (m *ItemItemActionsPermissionsWorkflowRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsPermissionsWorkflowRequestBuilder) { + return NewItemItemActionsPermissionsWorkflowRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_request_builder.go b/pkg/github/repos/item_item_actions_request_builder.go new file mode 100644 index 00000000..4c44cdde --- /dev/null +++ b/pkg/github/repos/item_item_actions_request_builder.go @@ -0,0 +1,88 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions +type ItemItemActionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Artifacts the artifacts property +// returns a *ItemItemActionsArtifactsRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Artifacts()(*ItemItemActionsArtifactsRequestBuilder) { + return NewItemItemActionsArtifactsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Cache the cache property +// returns a *ItemItemActionsCacheRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Cache()(*ItemItemActionsCacheRequestBuilder) { + return NewItemItemActionsCacheRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Caches the caches property +// returns a *ItemItemActionsCachesRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Caches()(*ItemItemActionsCachesRequestBuilder) { + return NewItemItemActionsCachesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsRequestBuilderInternal instantiates a new ItemItemActionsRequestBuilder and sets the default values. +func NewItemItemActionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRequestBuilder) { + m := &ItemItemActionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions", pathParameters), + } + return m +} +// NewItemItemActionsRequestBuilder instantiates a new ItemItemActionsRequestBuilder and sets the default values. +func NewItemItemActionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Jobs the jobs property +// returns a *ItemItemActionsJobsRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Jobs()(*ItemItemActionsJobsRequestBuilder) { + return NewItemItemActionsJobsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Oidc the oidc property +// returns a *ItemItemActionsOidcRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Oidc()(*ItemItemActionsOidcRequestBuilder) { + return NewItemItemActionsOidcRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// OrganizationSecrets the organizationSecrets property +// returns a *ItemItemActionsOrganizationSecretsRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) OrganizationSecrets()(*ItemItemActionsOrganizationSecretsRequestBuilder) { + return NewItemItemActionsOrganizationSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// OrganizationVariables the organizationVariables property +// returns a *ItemItemActionsOrganizationVariablesRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) OrganizationVariables()(*ItemItemActionsOrganizationVariablesRequestBuilder) { + return NewItemItemActionsOrganizationVariablesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Permissions the permissions property +// returns a *ItemItemActionsPermissionsRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Permissions()(*ItemItemActionsPermissionsRequestBuilder) { + return NewItemItemActionsPermissionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Runners the runners property +// returns a *ItemItemActionsRunnersRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Runners()(*ItemItemActionsRunnersRequestBuilder) { + return NewItemItemActionsRunnersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Runs the runs property +// returns a *ItemItemActionsRunsRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Runs()(*ItemItemActionsRunsRequestBuilder) { + return NewItemItemActionsRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Secrets the secrets property +// returns a *ItemItemActionsSecretsRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Secrets()(*ItemItemActionsSecretsRequestBuilder) { + return NewItemItemActionsSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Variables the variables property +// returns a *ItemItemActionsVariablesRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Variables()(*ItemItemActionsVariablesRequestBuilder) { + return NewItemItemActionsVariablesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Workflows the workflows property +// returns a *ItemItemActionsWorkflowsRequestBuilder when successful +func (m *ItemItemActionsRequestBuilder) Workflows()(*ItemItemActionsWorkflowsRequestBuilder) { + return NewItemItemActionsWorkflowsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/repos/item_item_actions_runners_downloads_request_builder.go b/pkg/github/repos/item_item_actions_runners_downloads_request_builder.go new file mode 100644 index 00000000..41aa5e8d --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_downloads_request_builder.go @@ -0,0 +1,60 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunnersDownloadsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners\downloads +type ItemItemActionsRunnersDownloadsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunnersDownloadsRequestBuilderInternal instantiates a new ItemItemActionsRunnersDownloadsRequestBuilder and sets the default values. +func NewItemItemActionsRunnersDownloadsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersDownloadsRequestBuilder) { + m := &ItemItemActionsRunnersDownloadsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners/downloads", pathParameters), + } + return m +} +// NewItemItemActionsRunnersDownloadsRequestBuilder instantiates a new ItemItemActionsRunnersDownloadsRequestBuilder and sets the default values. +func NewItemItemActionsRunnersDownloadsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersDownloadsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersDownloadsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists binaries for the runner application that you can download and run.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a []RunnerApplicationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#list-runner-applications-for-a-repository +func (m *ItemItemActionsRunnersDownloadsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerApplicationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerApplicationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerApplicationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerApplicationable) + } + } + return val, nil +} +// ToGetRequestInformation lists binaries for the runner application that you can download and run.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersDownloadsRequestBuilder) 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 *ItemItemActionsRunnersDownloadsRequestBuilder when successful +func (m *ItemItemActionsRunnersDownloadsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersDownloadsRequestBuilder) { + return NewItemItemActionsRunnersDownloadsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runners_generate_jitconfig_post_request_body.go b/pkg/github/repos/item_item_actions_runners_generate_jitconfig_post_request_body.go new file mode 100644 index 00000000..bad5059a --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_generate_jitconfig_post_request_body.go @@ -0,0 +1,175 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsRunnersGenerateJitconfigPostRequestBody 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 names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. + labels []string + // The name of the new runner. + name *string + // The ID of the runner group to register the runner to. + runner_group_id *int32 + // The working directory to be used for job execution, relative to the runner install directory. + work_folder *string +} +// NewItemItemActionsRunnersGenerateJitconfigPostRequestBody instantiates a new ItemItemActionsRunnersGenerateJitconfigPostRequestBody and sets the default values. +func NewItemItemActionsRunnersGenerateJitconfigPostRequestBody()(*ItemItemActionsRunnersGenerateJitconfigPostRequestBody) { + m := &ItemItemActionsRunnersGenerateJitconfigPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + work_folderValue := "_work" + m.SetWorkFolder(&work_folderValue) + return m +} +// CreateItemItemActionsRunnersGenerateJitconfigPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersGenerateJitconfigPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersGenerateJitconfigPostRequestBody(), 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 *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) 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 *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = 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.SetLabels(res) + } + 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["runner_group_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetRunnerGroupId(val) + } + return nil + } + res["work_folder"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetWorkFolder(val) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. +// returns a []string when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) GetLabels()([]string) { + return m.labels +} +// GetName gets the name property value. The name of the new runner. +// returns a *string when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) GetName()(*string) { + return m.name +} +// GetRunnerGroupId gets the runner_group_id property value. The ID of the runner group to register the runner to. +// returns a *int32 when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) GetRunnerGroupId()(*int32) { + return m.runner_group_id +} +// GetWorkFolder gets the work_folder property value. The working directory to be used for job execution, relative to the runner install directory. +// returns a *string when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) GetWorkFolder()(*string) { + return m.work_folder +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("runner_group_id", m.GetRunnerGroupId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("work_folder", m.GetWorkFolder()) + 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 *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to add to the runner. **Minimum items**: 1. **Maximum items**: 100. +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) SetLabels(value []string)() { + m.labels = value +} +// SetName sets the name property value. The name of the new runner. +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetRunnerGroupId sets the runner_group_id property value. The ID of the runner group to register the runner to. +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) SetRunnerGroupId(value *int32)() { + m.runner_group_id = value +} +// SetWorkFolder sets the work_folder property value. The working directory to be used for job execution, relative to the runner install directory. +func (m *ItemItemActionsRunnersGenerateJitconfigPostRequestBody) SetWorkFolder(value *string)() { + m.work_folder = value +} +type ItemItemActionsRunnersGenerateJitconfigPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + GetName()(*string) + GetRunnerGroupId()(*int32) + GetWorkFolder()(*string) + SetLabels(value []string)() + SetName(value *string)() + SetRunnerGroupId(value *int32)() + SetWorkFolder(value *string)() +} diff --git a/pkg/github/repos/item_item_actions_runners_generate_jitconfig_post_response.go b/pkg/github/repos/item_item_actions_runners_generate_jitconfig_post_response.go new file mode 100644 index 00000000..3946d6ad --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_generate_jitconfig_post_response.go @@ -0,0 +1,110 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsRunnersGenerateJitconfigPostResponse 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 runner configuration. + encoded_jit_config *string + // A self hosted runner + runner ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable +} +// NewItemItemActionsRunnersGenerateJitconfigPostResponse instantiates a new ItemItemActionsRunnersGenerateJitconfigPostResponse and sets the default values. +func NewItemItemActionsRunnersGenerateJitconfigPostResponse()(*ItemItemActionsRunnersGenerateJitconfigPostResponse) { + m := &ItemItemActionsRunnersGenerateJitconfigPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersGenerateJitconfigPostResponse(), 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 *ItemItemActionsRunnersGenerateJitconfigPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncodedJitConfig gets the encoded_jit_config property value. The base64 encoded runner configuration. +// returns a *string when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostResponse) GetEncodedJitConfig()(*string) { + return m.encoded_jit_config +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["encoded_jit_config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncodedJitConfig(val) + } + return nil + } + res["runner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRunner(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)) + } + return nil + } + return res +} +// GetRunner gets the runner property value. A self hosted runner +// returns a Runnerable when successful +func (m *ItemItemActionsRunnersGenerateJitconfigPostResponse) GetRunner()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) { + return m.runner +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersGenerateJitconfigPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("encoded_jit_config", m.GetEncodedJitConfig()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("runner", m.GetRunner()) + 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 *ItemItemActionsRunnersGenerateJitconfigPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncodedJitConfig sets the encoded_jit_config property value. The base64 encoded runner configuration. +func (m *ItemItemActionsRunnersGenerateJitconfigPostResponse) SetEncodedJitConfig(value *string)() { + m.encoded_jit_config = value +} +// SetRunner sets the runner property value. A self hosted runner +func (m *ItemItemActionsRunnersGenerateJitconfigPostResponse) SetRunner(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() { + m.runner = value +} +type ItemItemActionsRunnersGenerateJitconfigPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncodedJitConfig()(*string) + GetRunner()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) + SetEncodedJitConfig(value *string)() + SetRunner(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() +} diff --git a/pkg/github/repos/item_item_actions_runners_generate_jitconfig_request_builder.go b/pkg/github/repos/item_item_actions_runners_generate_jitconfig_request_builder.go new file mode 100644 index 00000000..96afc358 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_generate_jitconfig_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunnersGenerateJitconfigRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners\generate-jitconfig +type ItemItemActionsRunnersGenerateJitconfigRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunnersGenerateJitconfigRequestBuilderInternal instantiates a new ItemItemActionsRunnersGenerateJitconfigRequestBuilder and sets the default values. +func NewItemItemActionsRunnersGenerateJitconfigRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersGenerateJitconfigRequestBuilder) { + m := &ItemItemActionsRunnersGenerateJitconfigRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners/generate-jitconfig", pathParameters), + } + return m +} +// NewItemItemActionsRunnersGenerateJitconfigRequestBuilder instantiates a new ItemItemActionsRunnersGenerateJitconfigRequestBuilder and sets the default values. +func NewItemItemActionsRunnersGenerateJitconfigRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersGenerateJitconfigRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersGenerateJitconfigRequestBuilderInternal(urlParams, requestAdapter) +} +// Post generates a configuration that can be passed to the runner application at startup.The authenticated user must have admin access to the repository.OAuth tokens and personal access tokens (classic) need the`repo` scope to use this endpoint. +// returns a ItemItemActionsRunnersGenerateJitconfigPostResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#create-configuration-for-a-just-in-time-runner-for-a-repository +func (m *ItemItemActionsRunnersGenerateJitconfigRequestBuilder) Post(ctx context.Context, body ItemItemActionsRunnersGenerateJitconfigPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemActionsRunnersGenerateJitconfigPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunnersGenerateJitconfigPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunnersGenerateJitconfigPostResponseable), nil +} +// ToPostRequestInformation generates a configuration that can be passed to the runner application at startup.The authenticated user must have admin access to the repository.OAuth tokens and personal access tokens (classic) need the`repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersGenerateJitconfigRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsRunnersGenerateJitconfigPostRequestBodyable, 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 *ItemItemActionsRunnersGenerateJitconfigRequestBuilder when successful +func (m *ItemItemActionsRunnersGenerateJitconfigRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersGenerateJitconfigRequestBuilder) { + return NewItemItemActionsRunnersGenerateJitconfigRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runners_get_response.go b/pkg/github/repos/item_item_actions_runners_get_response.go new file mode 100644 index 00000000..844bd0c1 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsRunnersGetResponse 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 runners property + runners []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunnersGetResponse instantiates a new ItemItemActionsRunnersGetResponse and sets the default values. +func NewItemItemActionsRunnersGetResponse()(*ItemItemActionsRunnersGetResponse) { + m := &ItemItemActionsRunnersGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersGetResponse(), 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 *ItemItemActionsRunnersGetResponse) 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 *ItemItemActionsRunnersGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["runners"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) + } + } + m.SetRunners(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 +} +// GetRunners gets the runners property value. The runners property +// returns a []Runnerable when successful +func (m *ItemItemActionsRunnersGetResponse) GetRunners()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) { + return m.runners +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunnersGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRunners() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRunners())) + for i, v := range m.GetRunners() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("runners", 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 *ItemItemActionsRunnersGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRunners sets the runners property value. The runners property +func (m *ItemItemActionsRunnersGetResponse) SetRunners(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() { + m.runners = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunnersGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunnersGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRunners()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable) + GetTotalCount()(*int32) + SetRunners(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_actions_runners_item_labels_delete_response.go b/pkg/github/repos/item_item_actions_runners_item_labels_delete_response.go new file mode 100644 index 00000000..87baea69 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_item_labels_delete_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsRunnersItemLabelsDeleteResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunnersItemLabelsDeleteResponse instantiates a new ItemItemActionsRunnersItemLabelsDeleteResponse and sets the default values. +func NewItemItemActionsRunnersItemLabelsDeleteResponse()(*ItemItemActionsRunnersItemLabelsDeleteResponse) { + m := &ItemItemActionsRunnersItemLabelsDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsDeleteResponse(), 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 *ItemItemActionsRunnersItemLabelsDeleteResponse) 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 *ItemItemActionsRunnersItemLabelsDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemItemActionsRunnersItemLabelsDeleteResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunnersItemLabelsDeleteResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersItemLabelsDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemItemActionsRunnersItemLabelsDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemItemActionsRunnersItemLabelsDeleteResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunnersItemLabelsDeleteResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunnersItemLabelsDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_actions_runners_item_labels_get_response.go b/pkg/github/repos/item_item_actions_runners_item_labels_get_response.go new file mode 100644 index 00000000..65a3e52e --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_item_labels_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsRunnersItemLabelsGetResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunnersItemLabelsGetResponse instantiates a new ItemItemActionsRunnersItemLabelsGetResponse and sets the default values. +func NewItemItemActionsRunnersItemLabelsGetResponse()(*ItemItemActionsRunnersItemLabelsGetResponse) { + m := &ItemItemActionsRunnersItemLabelsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsGetResponse(), 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 *ItemItemActionsRunnersItemLabelsGetResponse) 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 *ItemItemActionsRunnersItemLabelsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemItemActionsRunnersItemLabelsGetResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunnersItemLabelsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersItemLabelsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemItemActionsRunnersItemLabelsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemItemActionsRunnersItemLabelsGetResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunnersItemLabelsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunnersItemLabelsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_actions_runners_item_labels_item_with_name_delete_response.go b/pkg/github/repos/item_item_actions_runners_item_labels_item_with_name_delete_response.go new file mode 100644 index 00000000..548f02ac --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_item_labels_item_with_name_delete_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse instantiates a new ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse and sets the default values. +func NewItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse()(*ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) { + m := &ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse(), 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 *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) 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 *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_actions_runners_item_labels_post_request_body.go b/pkg/github/repos/item_item_actions_runners_item_labels_post_request_body.go new file mode 100644 index 00000000..ea0e0ffc --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_item_labels_post_request_body.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsRunnersItemLabelsPostRequestBody 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 names of the custom labels to add to the runner. + labels []string +} +// NewItemItemActionsRunnersItemLabelsPostRequestBody instantiates a new ItemItemActionsRunnersItemLabelsPostRequestBody and sets the default values. +func NewItemItemActionsRunnersItemLabelsPostRequestBody()(*ItemItemActionsRunnersItemLabelsPostRequestBody) { + m := &ItemItemActionsRunnersItemLabelsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersItemLabelsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersItemLabelsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsPostRequestBody(), 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 *ItemItemActionsRunnersItemLabelsPostRequestBody) 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 *ItemItemActionsRunnersItemLabelsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = 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.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to add to the runner. +// returns a []string when successful +func (m *ItemItemActionsRunnersItemLabelsPostRequestBody) GetLabels()([]string) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersItemLabelsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + 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 *ItemItemActionsRunnersItemLabelsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to add to the runner. +func (m *ItemItemActionsRunnersItemLabelsPostRequestBody) SetLabels(value []string)() { + m.labels = value +} +type ItemItemActionsRunnersItemLabelsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + SetLabels(value []string)() +} diff --git a/pkg/github/repos/item_item_actions_runners_item_labels_post_response.go b/pkg/github/repos/item_item_actions_runners_item_labels_post_response.go new file mode 100644 index 00000000..a62a70ec --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_item_labels_post_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsRunnersItemLabelsPostResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunnersItemLabelsPostResponse instantiates a new ItemItemActionsRunnersItemLabelsPostResponse and sets the default values. +func NewItemItemActionsRunnersItemLabelsPostResponse()(*ItemItemActionsRunnersItemLabelsPostResponse) { + m := &ItemItemActionsRunnersItemLabelsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsPostResponse(), 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 *ItemItemActionsRunnersItemLabelsPostResponse) 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 *ItemItemActionsRunnersItemLabelsPostResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemItemActionsRunnersItemLabelsPostResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunnersItemLabelsPostResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersItemLabelsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemItemActionsRunnersItemLabelsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemItemActionsRunnersItemLabelsPostResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunnersItemLabelsPostResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunnersItemLabelsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_actions_runners_item_labels_put_request_body.go b/pkg/github/repos/item_item_actions_runners_item_labels_put_request_body.go new file mode 100644 index 00000000..56144712 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_item_labels_put_request_body.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsRunnersItemLabelsPutRequestBody 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 names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. + labels []string +} +// NewItemItemActionsRunnersItemLabelsPutRequestBody instantiates a new ItemItemActionsRunnersItemLabelsPutRequestBody and sets the default values. +func NewItemItemActionsRunnersItemLabelsPutRequestBody()(*ItemItemActionsRunnersItemLabelsPutRequestBody) { + m := &ItemItemActionsRunnersItemLabelsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersItemLabelsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersItemLabelsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsPutRequestBody(), 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 *ItemItemActionsRunnersItemLabelsPutRequestBody) 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 *ItemItemActionsRunnersItemLabelsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = 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.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. +// returns a []string when successful +func (m *ItemItemActionsRunnersItemLabelsPutRequestBody) GetLabels()([]string) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersItemLabelsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + 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 *ItemItemActionsRunnersItemLabelsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the custom labels to set for the runner. You can pass an empty array to remove all custom labels. +func (m *ItemItemActionsRunnersItemLabelsPutRequestBody) SetLabels(value []string)() { + m.labels = value +} +type ItemItemActionsRunnersItemLabelsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + SetLabels(value []string)() +} diff --git a/pkg/github/repos/item_item_actions_runners_item_labels_put_response.go b/pkg/github/repos/item_item_actions_runners_item_labels_put_response.go new file mode 100644 index 00000000..0f831e67 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_item_labels_put_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsRunnersItemLabelsPutResponse 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 labels property + labels []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunnersItemLabelsPutResponse instantiates a new ItemItemActionsRunnersItemLabelsPutResponse and sets the default values. +func NewItemItemActionsRunnersItemLabelsPutResponse()(*ItemItemActionsRunnersItemLabelsPutResponse) { + m := &ItemItemActionsRunnersItemLabelsPutResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunnersItemLabelsPutResponse(), 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 *ItemItemActionsRunnersItemLabelsPutResponse) 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 *ItemItemActionsRunnersItemLabelsPutResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerLabelFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + } + } + m.SetLabels(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 +} +// GetLabels gets the labels property value. The labels property +// returns a []RunnerLabelable when successful +func (m *ItemItemActionsRunnersItemLabelsPutResponse) GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) { + return m.labels +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunnersItemLabelsPutResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunnersItemLabelsPutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemItemActionsRunnersItemLabelsPutResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemItemActionsRunnersItemLabelsPutResponse) SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() { + m.labels = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunnersItemLabelsPutResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunnersItemLabelsPutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable) + GetTotalCount()(*int32) + SetLabels(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RunnerLabelable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_actions_runners_item_labels_request_builder.go b/pkg/github/repos/item_item_actions_runners_item_labels_request_builder.go new file mode 100644 index 00000000..79e51791 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_item_labels_request_builder.go @@ -0,0 +1,178 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunnersItemLabelsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners\{runner_id}\labels +type ItemItemActionsRunnersItemLabelsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByName gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.actions.runners.item.labels.item collection +// returns a *ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) ByName(name string)(*ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsRunnersItemLabelsRequestBuilderInternal instantiates a new ItemItemActionsRunnersItemLabelsRequestBuilder and sets the default values. +func NewItemItemActionsRunnersItemLabelsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersItemLabelsRequestBuilder) { + m := &ItemItemActionsRunnersItemLabelsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners/{runner_id}/labels", pathParameters), + } + return m +} +// NewItemItemActionsRunnersItemLabelsRequestBuilder instantiates a new ItemItemActionsRunnersItemLabelsRequestBuilder and sets the default values. +func NewItemItemActionsRunnersItemLabelsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersItemLabelsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersItemLabelsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete remove all custom labels from a self-hosted runner configured in arepository. Returns the remaining read-only labels from the runner.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsRunnersItemLabelsDeleteResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#remove-all-custom-labels-from-a-self-hosted-runner-for-a-repository +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemActionsRunnersItemLabelsDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunnersItemLabelsDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunnersItemLabelsDeleteResponseable), nil +} +// Get lists all labels for a self-hosted runner configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsRunnersItemLabelsGetResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#list-labels-for-a-self-hosted-runner-for-a-repository +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemActionsRunnersItemLabelsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunnersItemLabelsGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunnersItemLabelsGetResponseable), nil +} +// Post adds custom labels to a self-hosted runner configured in a repository.Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsRunnersItemLabelsPostResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#add-custom-labels-to-a-self-hosted-runner-for-a-repository +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) Post(ctx context.Context, body ItemItemActionsRunnersItemLabelsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemActionsRunnersItemLabelsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunnersItemLabelsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunnersItemLabelsPostResponseable), nil +} +// Put remove all previous custom labels and set the new custom labels for a specificself-hosted runner configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsRunnersItemLabelsPutResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#set-custom-labels-for-a-self-hosted-runner-for-a-repository +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) Put(ctx context.Context, body ItemItemActionsRunnersItemLabelsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemActionsRunnersItemLabelsPutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunnersItemLabelsPutResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunnersItemLabelsPutResponseable), nil +} +// ToDeleteRequestInformation remove all custom labels from a self-hosted runner configured in arepository. Returns the remaining read-only labels from the runner.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation lists all labels for a self-hosted runner configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) 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 adds custom labels to a self-hosted runner configured in a repository.Authenticated users must have admin access to the organization to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsRunnersItemLabelsPostRequestBodyable, 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 +} +// ToPutRequestInformation remove all previous custom labels and set the new custom labels for a specificself-hosted runner configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemActionsRunnersItemLabelsPutRequestBodyable, 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 *ItemItemActionsRunnersItemLabelsRequestBuilder when successful +func (m *ItemItemActionsRunnersItemLabelsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersItemLabelsRequestBuilder) { + return NewItemItemActionsRunnersItemLabelsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runners_item_labels_with_name_item_request_builder.go b/pkg/github/repos/item_item_actions_runners_item_labels_with_name_item_request_builder.go new file mode 100644 index 00000000..b15ee622 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_item_labels_with_name_item_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners\{runner_id}\labels\{name} +type ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal instantiates a new ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + m := &ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners/{runner_id}/labels/{name}", pathParameters), + } + return m +} +// NewItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder instantiates a new ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersItemLabelsWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete remove a custom label from a self-hosted runner configuredin a repository. Returns the remaining labels from the runner.This endpoint returns a `404 Not Found` status if the custom label is notpresent on the runner.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#remove-a-custom-label-from-a-self-hosted-runner-for-a-repository +func (m *ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunnersItemLabelsItemWithNameDeleteResponseable), nil +} +// ToDeleteRequestInformation remove a custom label from a self-hosted runner configuredin a repository. Returns the remaining labels from the runner.This endpoint returns a `404 Not Found` status if the custom label is notpresent on the runner.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder) 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") + 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 *ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder) { + return NewItemItemActionsRunnersItemLabelsWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runners_registration_token_request_builder.go b/pkg/github/repos/item_item_actions_runners_registration_token_request_builder.go new file mode 100644 index 00000000..f4b0f00d --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_registration_token_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunnersRegistrationTokenRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners\registration-token +type ItemItemActionsRunnersRegistrationTokenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunnersRegistrationTokenRequestBuilderInternal instantiates a new ItemItemActionsRunnersRegistrationTokenRequestBuilder and sets the default values. +func NewItemItemActionsRunnersRegistrationTokenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersRegistrationTokenRequestBuilder) { + m := &ItemItemActionsRunnersRegistrationTokenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners/registration-token", pathParameters), + } + return m +} +// NewItemItemActionsRunnersRegistrationTokenRequestBuilder instantiates a new ItemItemActionsRunnersRegistrationTokenRequestBuilder and sets the default values. +func NewItemItemActionsRunnersRegistrationTokenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersRegistrationTokenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersRegistrationTokenRequestBuilderInternal(urlParams, requestAdapter) +} +// Post returns a token that you can pass to the `config` script. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner:```./config.sh --url https://github.com/octo-org --token TOKEN```Authenticated users must have admin access to the repository to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a AuthenticationTokenable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#create-a-registration-token-for-a-repository +func (m *ItemItemActionsRunnersRegistrationTokenRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuthenticationTokenable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthenticationTokenFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuthenticationTokenable), nil +} +// ToPostRequestInformation returns a token that you can pass to the `config` script. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to configure your self-hosted runner:```./config.sh --url https://github.com/octo-org --token TOKEN```Authenticated users must have admin access to the repository to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersRegistrationTokenRequestBuilder) 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 *ItemItemActionsRunnersRegistrationTokenRequestBuilder when successful +func (m *ItemItemActionsRunnersRegistrationTokenRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersRegistrationTokenRequestBuilder) { + return NewItemItemActionsRunnersRegistrationTokenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runners_remove_token_request_builder.go b/pkg/github/repos/item_item_actions_runners_remove_token_request_builder.go new file mode 100644 index 00000000..56e40b8f --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_remove_token_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunnersRemoveTokenRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners\remove-token +type ItemItemActionsRunnersRemoveTokenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunnersRemoveTokenRequestBuilderInternal instantiates a new ItemItemActionsRunnersRemoveTokenRequestBuilder and sets the default values. +func NewItemItemActionsRunnersRemoveTokenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersRemoveTokenRequestBuilder) { + m := &ItemItemActionsRunnersRemoveTokenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners/remove-token", pathParameters), + } + return m +} +// NewItemItemActionsRunnersRemoveTokenRequestBuilder instantiates a new ItemItemActionsRunnersRemoveTokenRequestBuilder and sets the default values. +func NewItemItemActionsRunnersRemoveTokenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersRemoveTokenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersRemoveTokenRequestBuilderInternal(urlParams, requestAdapter) +} +// Post returns a token that you can pass to the `config` script to remove a self-hosted runner from an repository. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:```./config.sh remove --token TOKEN```Authenticated users must have admin access to the repository to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a AuthenticationTokenable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#create-a-remove-token-for-a-repository +func (m *ItemItemActionsRunnersRemoveTokenRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuthenticationTokenable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAuthenticationTokenFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.AuthenticationTokenable), nil +} +// ToPostRequestInformation returns a token that you can pass to the `config` script to remove a self-hosted runner from an repository. The token expires after one hour.For example, you can replace `TOKEN` in the following example with the registration token provided by this endpoint to remove your self-hosted runner from an organization:```./config.sh remove --token TOKEN```Authenticated users must have admin access to the repository to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersRemoveTokenRequestBuilder) 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 *ItemItemActionsRunnersRemoveTokenRequestBuilder when successful +func (m *ItemItemActionsRunnersRemoveTokenRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersRemoveTokenRequestBuilder) { + return NewItemItemActionsRunnersRemoveTokenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runners_request_builder.go b/pkg/github/repos/item_item_actions_runners_request_builder.go new file mode 100644 index 00000000..ecedd9d6 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_request_builder.go @@ -0,0 +1,96 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsRunnersRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners +type ItemItemActionsRunnersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsRunnersRequestBuilderGetQueryParameters lists all self-hosted runners configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemActionsRunnersRequestBuilderGetQueryParameters struct { + // The name of a self-hosted runner. + Name *string `uriparametername:"name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRunner_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.actions.runners.item collection +// returns a *ItemItemActionsRunnersWithRunner_ItemRequestBuilder when successful +func (m *ItemItemActionsRunnersRequestBuilder) ByRunner_id(runner_id int32)(*ItemItemActionsRunnersWithRunner_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["runner_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(runner_id), 10) + return NewItemItemActionsRunnersWithRunner_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsRunnersRequestBuilderInternal instantiates a new ItemItemActionsRunnersRequestBuilder and sets the default values. +func NewItemItemActionsRunnersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersRequestBuilder) { + m := &ItemItemActionsRunnersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners{?name*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsRunnersRequestBuilder instantiates a new ItemItemActionsRunnersRequestBuilder and sets the default values. +func NewItemItemActionsRunnersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersRequestBuilderInternal(urlParams, requestAdapter) +} +// Downloads the downloads property +// returns a *ItemItemActionsRunnersDownloadsRequestBuilder when successful +func (m *ItemItemActionsRunnersRequestBuilder) Downloads()(*ItemItemActionsRunnersDownloadsRequestBuilder) { + return NewItemItemActionsRunnersDownloadsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// GenerateJitconfig the generateJitconfig property +// returns a *ItemItemActionsRunnersGenerateJitconfigRequestBuilder when successful +func (m *ItemItemActionsRunnersRequestBuilder) GenerateJitconfig()(*ItemItemActionsRunnersGenerateJitconfigRequestBuilder) { + return NewItemItemActionsRunnersGenerateJitconfigRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get lists all self-hosted runners configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsRunnersGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#list-self-hosted-runners-for-a-repository +func (m *ItemItemActionsRunnersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunnersRequestBuilderGetQueryParameters])(ItemItemActionsRunnersGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunnersGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunnersGetResponseable), nil +} +// RegistrationToken the registrationToken property +// returns a *ItemItemActionsRunnersRegistrationTokenRequestBuilder when successful +func (m *ItemItemActionsRunnersRequestBuilder) RegistrationToken()(*ItemItemActionsRunnersRegistrationTokenRequestBuilder) { + return NewItemItemActionsRunnersRegistrationTokenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// RemoveToken the removeToken property +// returns a *ItemItemActionsRunnersRemoveTokenRequestBuilder when successful +func (m *ItemItemActionsRunnersRequestBuilder) RemoveToken()(*ItemItemActionsRunnersRemoveTokenRequestBuilder) { + return NewItemItemActionsRunnersRemoveTokenRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all self-hosted runners configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunnersRequestBuilderGetQueryParameters])(*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 *ItemItemActionsRunnersRequestBuilder when successful +func (m *ItemItemActionsRunnersRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersRequestBuilder) { + return NewItemItemActionsRunnersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runners_with_runner_escaped_item_request_builder.go b/pkg/github/repos/item_item_actions_runners_with_runner_escaped_item_request_builder.go new file mode 100644 index 00000000..17a6b3b4 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runners_with_runner_escaped_item_request_builder.go @@ -0,0 +1,84 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunnersWithRunner_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runners\{runner_id} +type ItemItemActionsRunnersWithRunner_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunnersWithRunner_ItemRequestBuilderInternal instantiates a new ItemItemActionsRunnersWithRunner_ItemRequestBuilder and sets the default values. +func NewItemItemActionsRunnersWithRunner_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersWithRunner_ItemRequestBuilder) { + m := &ItemItemActionsRunnersWithRunner_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runners/{runner_id}", pathParameters), + } + return m +} +// NewItemItemActionsRunnersWithRunner_ItemRequestBuilder instantiates a new ItemItemActionsRunnersWithRunner_ItemRequestBuilder and sets the default values. +func NewItemItemActionsRunnersWithRunner_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunnersWithRunner_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunnersWithRunner_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.Authenticated users must have admin access to the repository to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#delete-a-self-hosted-runner-from-a-repository +func (m *ItemItemActionsRunnersWithRunner_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific self-hosted runner configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a Runnerable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/self-hosted-runners#get-a-self-hosted-runner-for-a-repository +func (m *ItemItemActionsRunnersWithRunner_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRunnerFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Runnerable), nil +} +// Labels the labels property +// returns a *ItemItemActionsRunnersItemLabelsRequestBuilder when successful +func (m *ItemItemActionsRunnersWithRunner_ItemRequestBuilder) Labels()(*ItemItemActionsRunnersItemLabelsRequestBuilder) { + return NewItemItemActionsRunnersItemLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation forces the removal of a self-hosted runner from a repository. You can use this endpoint to completely remove the runner when the machine you were using no longer exists.Authenticated users must have admin access to the repository to use this endpoint.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersWithRunner_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific self-hosted runner configured in a repository.Authenticated users must have admin access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunnersWithRunner_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsRunnersWithRunner_ItemRequestBuilder when successful +func (m *ItemItemActionsRunnersWithRunner_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunnersWithRunner_ItemRequestBuilder) { + return NewItemItemActionsRunnersWithRunner_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_get_response.go b/pkg/github/repos/item_item_actions_runs_get_response.go new file mode 100644 index 00000000..cad00fc1 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsRunsGetResponse 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 total_count property + total_count *int32 + // The workflow_runs property + workflow_runs []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable +} +// NewItemItemActionsRunsGetResponse instantiates a new ItemItemActionsRunsGetResponse and sets the default values. +func NewItemItemActionsRunsGetResponse()(*ItemItemActionsRunsGetResponse) { + m := &ItemItemActionsRunsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsGetResponse(), 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 *ItemItemActionsRunsGetResponse) 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 *ItemItemActionsRunsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 + } + res["workflow_runs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWorkflowRunFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable) + } + } + m.SetWorkflowRuns(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetWorkflowRuns gets the workflow_runs property value. The workflow_runs property +// returns a []WorkflowRunable when successful +func (m *ItemItemActionsRunsGetResponse) GetWorkflowRuns()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable) { + return m.workflow_runs +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetWorkflowRuns() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWorkflowRuns())) + for i, v := range m.GetWorkflowRuns() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("workflow_runs", 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 *ItemItemActionsRunsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetWorkflowRuns sets the workflow_runs property value. The workflow_runs property +func (m *ItemItemActionsRunsGetResponse) SetWorkflowRuns(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable)() { + m.workflow_runs = value +} +type ItemItemActionsRunsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetWorkflowRuns()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable) + SetTotalCount(value *int32)() + SetWorkflowRuns(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable)() +} diff --git a/pkg/github/repos/item_item_actions_runs_item_approvals_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_approvals_request_builder.go new file mode 100644 index 00000000..9abab636 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_approvals_request_builder.go @@ -0,0 +1,60 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunsItemApprovalsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\approvals +type ItemItemActionsRunsItemApprovalsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemApprovalsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemApprovalsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemApprovalsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemApprovalsRequestBuilder) { + m := &ItemItemActionsRunsItemApprovalsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/approvals", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemApprovalsRequestBuilder instantiates a new ItemItemActionsRunsItemApprovalsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemApprovalsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemApprovalsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemApprovalsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a []EnvironmentApprovalsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#get-the-review-history-for-a-workflow-run +func (m *ItemItemActionsRunsItemApprovalsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnvironmentApprovalsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnvironmentApprovalsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnvironmentApprovalsable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnvironmentApprovalsable) + } + } + return val, nil +} +// ToGetRequestInformation anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemApprovalsRequestBuilder) 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 *ItemItemActionsRunsItemApprovalsRequestBuilder when successful +func (m *ItemItemActionsRunsItemApprovalsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemApprovalsRequestBuilder) { + return NewItemItemActionsRunsItemApprovalsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_item_artifacts_get_response.go b/pkg/github/repos/item_item_actions_runs_item_artifacts_get_response.go new file mode 100644 index 00000000..ad522383 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_artifacts_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsRunsItemArtifactsGetResponse 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 artifacts property + artifacts []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunsItemArtifactsGetResponse instantiates a new ItemItemActionsRunsItemArtifactsGetResponse and sets the default values. +func NewItemItemActionsRunsItemArtifactsGetResponse()(*ItemItemActionsRunsItemArtifactsGetResponse) { + m := &ItemItemActionsRunsItemArtifactsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunsItemArtifactsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunsItemArtifactsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemArtifactsGetResponse(), 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 *ItemItemActionsRunsItemArtifactsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArtifacts gets the artifacts property value. The artifacts property +// returns a []Artifactable when successful +func (m *ItemItemActionsRunsItemArtifactsGetResponse) GetArtifacts()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable) { + return m.artifacts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunsItemArtifactsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["artifacts"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateArtifactFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable) + } + } + m.SetArtifacts(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 *ItemItemActionsRunsItemArtifactsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunsItemArtifactsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetArtifacts() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetArtifacts())) + for i, v := range m.GetArtifacts() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("artifacts", 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 *ItemItemActionsRunsItemArtifactsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArtifacts sets the artifacts property value. The artifacts property +func (m *ItemItemActionsRunsItemArtifactsGetResponse) SetArtifacts(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable)() { + m.artifacts = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunsItemArtifactsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunsItemArtifactsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArtifacts()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable) + GetTotalCount()(*int32) + SetArtifacts(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Artifactable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_actions_runs_item_artifacts_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_artifacts_request_builder.go new file mode 100644 index 00000000..2930698c --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_artifacts_request_builder.go @@ -0,0 +1,65 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsRunsItemArtifactsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\artifacts +type ItemItemActionsRunsItemArtifactsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsRunsItemArtifactsRequestBuilderGetQueryParameters lists artifacts for a workflow run.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsRunsItemArtifactsRequestBuilderGetQueryParameters struct { + // The name field of an artifact. When specified, only artifacts with this name will be returned. + Name *string `uriparametername:"name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemActionsRunsItemArtifactsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemArtifactsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemArtifactsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemArtifactsRequestBuilder) { + m := &ItemItemActionsRunsItemArtifactsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/artifacts{?name*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemArtifactsRequestBuilder instantiates a new ItemItemActionsRunsItemArtifactsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemArtifactsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemArtifactsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemArtifactsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists artifacts for a workflow run.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemActionsRunsItemArtifactsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/artifacts#list-workflow-run-artifacts +func (m *ItemItemActionsRunsItemArtifactsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemArtifactsRequestBuilderGetQueryParameters])(ItemItemActionsRunsItemArtifactsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunsItemArtifactsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunsItemArtifactsGetResponseable), nil +} +// ToGetRequestInformation lists artifacts for a workflow run.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemArtifactsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemArtifactsRequestBuilderGetQueryParameters])(*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 *ItemItemActionsRunsItemArtifactsRequestBuilder when successful +func (m *ItemItemActionsRunsItemArtifactsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemArtifactsRequestBuilder) { + return NewItemItemActionsRunsItemArtifactsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_get_response.go b/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_get_response.go new file mode 100644 index 00000000..a30fcd42 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsRunsItemAttemptsItemJobsGetResponse 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 jobs property + jobs []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunsItemAttemptsItemJobsGetResponse instantiates a new ItemItemActionsRunsItemAttemptsItemJobsGetResponse and sets the default values. +func NewItemItemActionsRunsItemAttemptsItemJobsGetResponse()(*ItemItemActionsRunsItemAttemptsItemJobsGetResponse) { + m := &ItemItemActionsRunsItemAttemptsItemJobsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunsItemAttemptsItemJobsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunsItemAttemptsItemJobsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemAttemptsItemJobsGetResponse(), 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 *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) 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 *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["jobs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateJobFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable) + } + } + m.SetJobs(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 +} +// GetJobs gets the jobs property value. The jobs property +// returns a []Jobable when successful +func (m *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) GetJobs()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable) { + return m.jobs +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetJobs() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetJobs())) + for i, v := range m.GetJobs() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("jobs", 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 *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetJobs sets the jobs property value. The jobs property +func (m *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) SetJobs(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable)() { + m.jobs = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunsItemAttemptsItemJobsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunsItemAttemptsItemJobsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetJobs()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable) + GetTotalCount()(*int32) + SetJobs(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_request_builder.go new file mode 100644 index 00000000..c7dc332d --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_attempts_item_jobs_request_builder.go @@ -0,0 +1,68 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\attempts\{attempt_number}\jobs +type ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsRunsItemAttemptsItemJobsRequestBuilderGetQueryParameters lists jobs for a specific workflow run attempt. You can use parameters to narrow the list of results. For more informationabout using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsRunsItemAttemptsItemJobsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemActionsRunsItemAttemptsItemJobsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsItemJobsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder) { + m := &ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/attempts/{attempt_number}/jobs{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemAttemptsItemJobsRequestBuilder instantiates a new ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsItemJobsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemAttemptsItemJobsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists jobs for a specific workflow run attempt. You can use parameters to narrow the list of results. For more informationabout using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemActionsRunsItemAttemptsItemJobsGetResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run-attempt +func (m *ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemAttemptsItemJobsRequestBuilderGetQueryParameters])(ItemItemActionsRunsItemAttemptsItemJobsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunsItemAttemptsItemJobsGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunsItemAttemptsItemJobsGetResponseable), nil +} +// ToGetRequestInformation lists jobs for a specific workflow run attempt. You can use parameters to narrow the list of results. For more informationabout using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemAttemptsItemJobsRequestBuilderGetQueryParameters])(*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 *ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder when successful +func (m *ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder) { + return NewItemItemActionsRunsItemAttemptsItemJobsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_item_attempts_item_logs_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_attempts_item_logs_request_builder.go new file mode 100644 index 00000000..5c7423ac --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_attempts_item_logs_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\attempts\{attempt_number}\logs +type ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) { + m := &ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/attempts/{attempt_number}/logs", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilder instantiates a new ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a redirect URL to download an archive of log files for a specific workflow run attempt. This link expires after1 minute. Look for `Location:` in the response header to find the URL for the download.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#download-workflow-run-attempt-logs +func (m *ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets a redirect URL to download an archive of log files for a specific workflow run attempt. This link expires after1 minute. Look for `Location:` in the response header to find the URL for the download.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) 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) + 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 *ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder when successful +func (m *ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) { + return NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_item_attempts_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_attempts_request_builder.go new file mode 100644 index 00000000..8972f95c --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_attempts_request_builder.go @@ -0,0 +1,34 @@ +package repos + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsRunsItemAttemptsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\attempts +type ItemItemActionsRunsItemAttemptsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByAttempt_number gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.actions.runs.item.attempts.item collection +// returns a *ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder when successful +func (m *ItemItemActionsRunsItemAttemptsRequestBuilder) ByAttempt_number(attempt_number int32)(*ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["attempt_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(attempt_number), 10) + return NewItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsRunsItemAttemptsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemAttemptsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsRequestBuilder) { + m := &ItemItemActionsRunsItemAttemptsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/attempts", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemAttemptsRequestBuilder instantiates a new ItemItemActionsRunsItemAttemptsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemAttemptsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_actions_runs_item_attempts_with_attempt_escaped_number_item_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_attempts_with_attempt_escaped_number_item_request_builder.go new file mode 100644 index 00000000..267b789d --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_attempts_with_attempt_escaped_number_item_request_builder.go @@ -0,0 +1,72 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\attempts\{attempt_number} +type ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderGetQueryParameters gets a specific workflow run attempt.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderGetQueryParameters struct { + // If `true` pull requests are omitted from the response (empty array). + Exclude_pull_requests *bool `uriparametername:"exclude_pull_requests"` +} +// NewItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderInternal instantiates a new ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) { + m := &ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/attempts/{attempt_number}{?exclude_pull_requests*}", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder instantiates a new ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a specific workflow run attempt.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a WorkflowRunable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#get-a-workflow-run-attempt +func (m *ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWorkflowRunFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable), nil +} +// Jobs the jobs property +// returns a *ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder when successful +func (m *ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) Jobs()(*ItemItemActionsRunsItemAttemptsItemJobsRequestBuilder) { + return NewItemItemActionsRunsItemAttemptsItemJobsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Logs the logs property +// returns a *ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder when successful +func (m *ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) Logs()(*ItemItemActionsRunsItemAttemptsItemLogsRequestBuilder) { + return NewItemItemActionsRunsItemAttemptsItemLogsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets a specific workflow run attempt.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilderGetQueryParameters])(*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 *ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder when successful +func (m *ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder) { + return NewItemItemActionsRunsItemAttemptsWithAttempt_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_item_cancel_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_cancel_request_builder.go new file mode 100644 index 00000000..24cc96a9 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_cancel_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunsItemCancelRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\cancel +type ItemItemActionsRunsItemCancelRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemCancelRequestBuilderInternal instantiates a new ItemItemActionsRunsItemCancelRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemCancelRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemCancelRequestBuilder) { + m := &ItemItemActionsRunsItemCancelRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/cancel", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemCancelRequestBuilder instantiates a new ItemItemActionsRunsItemCancelRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemCancelRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemCancelRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemCancelRequestBuilderInternal(urlParams, requestAdapter) +} +// Post cancels a workflow run using its `id`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#cancel-a-workflow-run +func (m *ItemItemActionsRunsItemCancelRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToPostRequestInformation cancels a workflow run using its `id`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemCancelRequestBuilder) 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 *ItemItemActionsRunsItemCancelRequestBuilder when successful +func (m *ItemItemActionsRunsItemCancelRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemCancelRequestBuilder) { + return NewItemItemActionsRunsItemCancelRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_item_deployment_escaped_protection_escaped_rule_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_deployment_escaped_protection_escaped_rule_request_builder.go new file mode 100644 index 00000000..23496c0c --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_deployment_escaped_protection_escaped_rule_request_builder.go @@ -0,0 +1,193 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\deployment_protection_rule +type ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Deployment_protection_rulePostRequestBody composed type wrapper for classes ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable +type Deployment_protection_rulePostRequestBody struct { + // Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable + deployment_protection_rulePostRequestBodyReviewCustomGatesCommentRequired ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable + // Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable + deployment_protection_rulePostRequestBodyReviewCustomGatesStateRequired ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable + // Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable + reviewCustomGatesCommentRequired ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable + // Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable + reviewCustomGatesStateRequired ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable +} +// NewDeployment_protection_rulePostRequestBody instantiates a new Deployment_protection_rulePostRequestBody and sets the default values. +func NewDeployment_protection_rulePostRequestBody()(*Deployment_protection_rulePostRequestBody) { + m := &Deployment_protection_rulePostRequestBody{ + } + return m +} +// CreateDeployment_protection_rulePostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateDeployment_protection_rulePostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewDeployment_protection_rulePostRequestBody() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReviewCustomGatesCommentRequiredFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable); ok { + result.SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired(cast) + } + } else if val, err := parseNode.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReviewCustomGatesStateRequiredFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable); ok { + result.SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired(cast) + } + } else if val, err := parseNode.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReviewCustomGatesCommentRequiredFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable); ok { + result.SetReviewCustomGatesCommentRequired(cast) + } + } else if val, err := parseNode.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReviewCustomGatesStateRequiredFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable); ok { + result.SetReviewCustomGatesStateRequired(cast) + } + } + } + return result, nil +} +// GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired gets the reviewCustomGatesCommentRequired property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable +// returns a ReviewCustomGatesCommentRequiredable when successful +func (m *Deployment_protection_rulePostRequestBody) GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable) { + return m.deployment_protection_rulePostRequestBodyReviewCustomGatesCommentRequired +} +// GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired gets the reviewCustomGatesStateRequired property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable +// returns a ReviewCustomGatesStateRequiredable when successful +func (m *Deployment_protection_rulePostRequestBody) GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable) { + return m.deployment_protection_rulePostRequestBodyReviewCustomGatesStateRequired +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Deployment_protection_rulePostRequestBody) 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 *Deployment_protection_rulePostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetReviewCustomGatesCommentRequired gets the reviewCustomGatesCommentRequired property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable +// returns a ReviewCustomGatesCommentRequiredable when successful +func (m *Deployment_protection_rulePostRequestBody) GetReviewCustomGatesCommentRequired()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable) { + return m.reviewCustomGatesCommentRequired +} +// GetReviewCustomGatesStateRequired gets the reviewCustomGatesStateRequired property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable +// returns a ReviewCustomGatesStateRequiredable when successful +func (m *Deployment_protection_rulePostRequestBody) GetReviewCustomGatesStateRequired()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable) { + return m.reviewCustomGatesStateRequired +} +// Serialize serializes information the current object +func (m *Deployment_protection_rulePostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired() != nil { + err := writer.WriteObjectValue("", m.GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired()) + if err != nil { + return err + } + } else if m.GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired() != nil { + err := writer.WriteObjectValue("", m.GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired()) + if err != nil { + return err + } + } else if m.GetReviewCustomGatesCommentRequired() != nil { + err := writer.WriteObjectValue("", m.GetReviewCustomGatesCommentRequired()) + if err != nil { + return err + } + } else if m.GetReviewCustomGatesStateRequired() != nil { + err := writer.WriteObjectValue("", m.GetReviewCustomGatesStateRequired()) + if err != nil { + return err + } + } + return nil +} +// SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired sets the reviewCustomGatesCommentRequired property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable +func (m *Deployment_protection_rulePostRequestBody) SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable)() { + m.deployment_protection_rulePostRequestBodyReviewCustomGatesCommentRequired = value +} +// SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired sets the reviewCustomGatesStateRequired property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable +func (m *Deployment_protection_rulePostRequestBody) SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable)() { + m.deployment_protection_rulePostRequestBodyReviewCustomGatesStateRequired = value +} +// SetReviewCustomGatesCommentRequired sets the reviewCustomGatesCommentRequired property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable +func (m *Deployment_protection_rulePostRequestBody) SetReviewCustomGatesCommentRequired(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable)() { + m.reviewCustomGatesCommentRequired = value +} +// SetReviewCustomGatesStateRequired sets the reviewCustomGatesStateRequired property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable +func (m *Deployment_protection_rulePostRequestBody) SetReviewCustomGatesStateRequired(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable)() { + m.reviewCustomGatesStateRequired = value +} +type Deployment_protection_rulePostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable) + GetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable) + GetReviewCustomGatesCommentRequired()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable) + GetReviewCustomGatesStateRequired()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable) + SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesCommentRequired(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable)() + SetDeploymentProtectionRulePostRequestBodyReviewCustomGatesStateRequired(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable)() + SetReviewCustomGatesCommentRequired(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesCommentRequiredable)() + SetReviewCustomGatesStateRequired(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCustomGatesStateRequiredable)() +} +// NewItemItemActionsRunsItemDeployment_protection_ruleRequestBuilderInternal instantiates a new ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemDeployment_protection_ruleRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder) { + m := &ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/deployment_protection_rule", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder instantiates a new ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemDeployment_protection_ruleRequestBuilderInternal(urlParams, requestAdapter) +} +// Post approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see "[Using environments for deployment](https://docs.github.com/enterprise-server@3.14/actions/deployment/targeting-different-environments/using-environments-for-deployment)."> [!NOTE]> GitHub Apps can only review their own custom deployment protection rules. To approve or reject pending deployments that are waiting for review from a specific person or team, see [`POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments`](/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#review-custom-deployment-protection-rules-for-a-workflow-run +func (m *ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder) Post(ctx context.Context, body Deployment_protection_rulePostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation approve or reject custom deployment protection rules provided by a GitHub App for a workflow run. For more information, see "[Using environments for deployment](https://docs.github.com/enterprise-server@3.14/actions/deployment/targeting-different-environments/using-environments-for-deployment)."> [!NOTE]> GitHub Apps can only review their own custom deployment protection rules. To approve or reject pending deployments that are waiting for review from a specific person or team, see [`POST /repos/{owner}/{repo}/actions/runs/{run_id}/pending_deployments`](/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder) ToPostRequestInformation(ctx context.Context, body Deployment_protection_rulePostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder when successful +func (m *ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder) { + return NewItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_item_force_cancel_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_force_cancel_request_builder.go new file mode 100644 index 00000000..82b9b9d2 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_force_cancel_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunsItemForceCancelRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\force-cancel +type ItemItemActionsRunsItemForceCancelRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemForceCancelRequestBuilderInternal instantiates a new ItemItemActionsRunsItemForceCancelRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemForceCancelRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemForceCancelRequestBuilder) { + m := &ItemItemActionsRunsItemForceCancelRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/force-cancel", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemForceCancelRequestBuilder instantiates a new ItemItemActionsRunsItemForceCancelRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemForceCancelRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemForceCancelRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemForceCancelRequestBuilderInternal(urlParams, requestAdapter) +} +// Post cancels a workflow run and bypasses conditions that would otherwise cause a workflow execution to continue, such as an `always()` condition on a job.You should only use this endpoint to cancel a workflow run when the workflow run is not responding to [`POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel`](/rest/actions/workflow-runs#cancel-a-workflow-run).OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#force-cancel-a-workflow-run +func (m *ItemItemActionsRunsItemForceCancelRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToPostRequestInformation cancels a workflow run and bypasses conditions that would otherwise cause a workflow execution to continue, such as an `always()` condition on a job.You should only use this endpoint to cancel a workflow run when the workflow run is not responding to [`POST /repos/{owner}/{repo}/actions/runs/{run_id}/cancel`](/rest/actions/workflow-runs#cancel-a-workflow-run).OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemForceCancelRequestBuilder) 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 *ItemItemActionsRunsItemForceCancelRequestBuilder when successful +func (m *ItemItemActionsRunsItemForceCancelRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemForceCancelRequestBuilder) { + return NewItemItemActionsRunsItemForceCancelRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_item_jobs_get_response.go b/pkg/github/repos/item_item_actions_runs_item_jobs_get_response.go new file mode 100644 index 00000000..31109ed2 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_jobs_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsRunsItemJobsGetResponse 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 jobs property + jobs []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable + // The total_count property + total_count *int32 +} +// NewItemItemActionsRunsItemJobsGetResponse instantiates a new ItemItemActionsRunsItemJobsGetResponse and sets the default values. +func NewItemItemActionsRunsItemJobsGetResponse()(*ItemItemActionsRunsItemJobsGetResponse) { + m := &ItemItemActionsRunsItemJobsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunsItemJobsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunsItemJobsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemJobsGetResponse(), 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 *ItemItemActionsRunsItemJobsGetResponse) 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 *ItemItemActionsRunsItemJobsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["jobs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateJobFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable) + } + } + m.SetJobs(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 +} +// GetJobs gets the jobs property value. The jobs property +// returns a []Jobable when successful +func (m *ItemItemActionsRunsItemJobsGetResponse) GetJobs()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable) { + return m.jobs +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsRunsItemJobsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunsItemJobsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetJobs() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetJobs())) + for i, v := range m.GetJobs() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("jobs", 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 *ItemItemActionsRunsItemJobsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetJobs sets the jobs property value. The jobs property +func (m *ItemItemActionsRunsItemJobsGetResponse) SetJobs(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable)() { + m.jobs = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsRunsItemJobsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsRunsItemJobsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetJobs()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable) + GetTotalCount()(*int32) + SetJobs(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Jobable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_actions_runs_item_jobs_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_jobs_request_builder.go new file mode 100644 index 00000000..ee33076d --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_jobs_request_builder.go @@ -0,0 +1,66 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i3e816b8b203fde35988384fc3d1fc8dce9f00e858c7547b7f756244e61d13913 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/actions/runs/item/jobs" +) + +// ItemItemActionsRunsItemJobsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\jobs +type ItemItemActionsRunsItemJobsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsRunsItemJobsRequestBuilderGetQueryParameters lists jobs for a workflow run. You can use parameters to narrow the list of results. For more informationabout using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsRunsItemJobsRequestBuilderGetQueryParameters struct { + // Filters jobs by their `completed_at` timestamp. `latest` returns jobs from the most recent execution of the workflow run. `all` returns all jobs for a workflow run, including from old executions of the workflow run. + Filter *i3e816b8b203fde35988384fc3d1fc8dce9f00e858c7547b7f756244e61d13913.GetFilterQueryParameterType `uriparametername:"filter"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemActionsRunsItemJobsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemJobsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemJobsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemJobsRequestBuilder) { + m := &ItemItemActionsRunsItemJobsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/jobs{?filter*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemJobsRequestBuilder instantiates a new ItemItemActionsRunsItemJobsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemJobsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemJobsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemJobsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists jobs for a workflow run. You can use parameters to narrow the list of results. For more informationabout using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemActionsRunsItemJobsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-jobs#list-jobs-for-a-workflow-run +func (m *ItemItemActionsRunsItemJobsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemJobsRequestBuilderGetQueryParameters])(ItemItemActionsRunsItemJobsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunsItemJobsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunsItemJobsGetResponseable), nil +} +// ToGetRequestInformation lists jobs for a workflow run. You can use parameters to narrow the list of results. For more informationabout using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemJobsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsItemJobsRequestBuilderGetQueryParameters])(*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 *ItemItemActionsRunsItemJobsRequestBuilder when successful +func (m *ItemItemActionsRunsItemJobsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemJobsRequestBuilder) { + return NewItemItemActionsRunsItemJobsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_item_logs_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_logs_request_builder.go new file mode 100644 index 00000000..3ea96fe5 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_logs_request_builder.go @@ -0,0 +1,81 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunsItemLogsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\logs +type ItemItemActionsRunsItemLogsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemLogsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemLogsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemLogsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemLogsRequestBuilder) { + m := &ItemItemActionsRunsItemLogsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/logs", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemLogsRequestBuilder instantiates a new ItemItemActionsRunsItemLogsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemLogsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemLogsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemLogsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes all logs for a workflow run.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a BasicError error when the service returns a 403 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#delete-workflow-run-logs +func (m *ItemItemActionsRunsItemLogsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for`Location:` in the response header to find the URL for the download.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#download-workflow-run-logs +func (m *ItemItemActionsRunsItemLogsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation deletes all logs for a workflow run.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemLogsRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation gets a redirect URL to download an archive of log files for a workflow run. This link expires after 1 minute. Look for`Location:` in the response header to find the URL for the download.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemLogsRequestBuilder) 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) + 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 *ItemItemActionsRunsItemLogsRequestBuilder when successful +func (m *ItemItemActionsRunsItemLogsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemLogsRequestBuilder) { + return NewItemItemActionsRunsItemLogsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_item_pending_escaped_deployments_post_request_body.go b/pkg/github/repos/item_item_actions_runs_item_pending_escaped_deployments_post_request_body.go new file mode 100644 index 00000000..bac44457 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_pending_escaped_deployments_post_request_body.go @@ -0,0 +1,115 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsRunsItemPending_deploymentsPostRequestBody 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 comment to accompany the deployment review + comment *string + // The list of environment ids to approve or reject + environment_ids []int32 +} +// NewItemItemActionsRunsItemPending_deploymentsPostRequestBody instantiates a new ItemItemActionsRunsItemPending_deploymentsPostRequestBody and sets the default values. +func NewItemItemActionsRunsItemPending_deploymentsPostRequestBody()(*ItemItemActionsRunsItemPending_deploymentsPostRequestBody) { + m := &ItemItemActionsRunsItemPending_deploymentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunsItemPending_deploymentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunsItemPending_deploymentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemPending_deploymentsPostRequestBody(), 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 *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetComment gets the comment property value. A comment to accompany the deployment review +// returns a *string when successful +func (m *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) GetComment()(*string) { + return m.comment +} +// GetEnvironmentIds gets the environment_ids property value. The list of environment ids to approve or reject +// returns a []int32 when successful +func (m *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) GetEnvironmentIds()([]int32) { + return m.environment_ids +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetComment(val) + } + return nil + } + res["environment_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.SetEnvironmentIds(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("comment", m.GetComment()) + if err != nil { + return err + } + } + if m.GetEnvironmentIds() != nil { + err := writer.WriteCollectionOfInt32Values("environment_ids", m.GetEnvironmentIds()) + 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 *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetComment sets the comment property value. A comment to accompany the deployment review +func (m *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) SetComment(value *string)() { + m.comment = value +} +// SetEnvironmentIds sets the environment_ids property value. The list of environment ids to approve or reject +func (m *ItemItemActionsRunsItemPending_deploymentsPostRequestBody) SetEnvironmentIds(value []int32)() { + m.environment_ids = value +} +type ItemItemActionsRunsItemPending_deploymentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetComment()(*string) + GetEnvironmentIds()([]int32) + SetComment(value *string)() + SetEnvironmentIds(value []int32)() +} diff --git a/pkg/github/repos/item_item_actions_runs_item_pending_escaped_deployments_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_pending_escaped_deployments_request_builder.go new file mode 100644 index 00000000..3cdfa590 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_pending_escaped_deployments_request_builder.go @@ -0,0 +1,94 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunsItemPending_deploymentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\pending_deployments +type ItemItemActionsRunsItemPending_deploymentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemPending_deploymentsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemPending_deploymentsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemPending_deploymentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemPending_deploymentsRequestBuilder) { + m := &ItemItemActionsRunsItemPending_deploymentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/pending_deployments", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemPending_deploymentsRequestBuilder instantiates a new ItemItemActionsRunsItemPending_deploymentsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemPending_deploymentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemPending_deploymentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemPending_deploymentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get all deployment environments for a workflow run that are waiting for protection rules to pass.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a []PendingDeploymentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#get-pending-deployments-for-a-workflow-run +func (m *ItemItemActionsRunsItemPending_deploymentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PendingDeploymentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePendingDeploymentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PendingDeploymentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PendingDeploymentable) + } + } + return val, nil +} +// Post approve or reject pending deployments that are waiting on approval by a required reviewer.Required reviewers with read access to the repository contents and deployments can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a []Deploymentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#review-pending-deployments-for-a-workflow-run +func (m *ItemItemActionsRunsItemPending_deploymentsRequestBuilder) Post(ctx context.Context, body ItemItemActionsRunsItemPending_deploymentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Deploymentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Deploymentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Deploymentable) + } + } + return val, nil +} +// ToGetRequestInformation get all deployment environments for a workflow run that are waiting for protection rules to pass.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemPending_deploymentsRequestBuilder) 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 approve or reject pending deployments that are waiting on approval by a required reviewer.Required reviewers with read access to the repository contents and deployments can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemPending_deploymentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsRunsItemPending_deploymentsPostRequestBodyable, 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 *ItemItemActionsRunsItemPending_deploymentsRequestBuilder when successful +func (m *ItemItemActionsRunsItemPending_deploymentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemPending_deploymentsRequestBuilder) { + return NewItemItemActionsRunsItemPending_deploymentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_item_rerun_failed_jobs_post_request_body.go b/pkg/github/repos/item_item_actions_runs_item_rerun_failed_jobs_post_request_body.go new file mode 100644 index 00000000..ca2e596d --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_rerun_failed_jobs_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsRunsItemRerunFailedJobsPostRequestBody 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 enable debug logging for the re-run. + enable_debug_logging *bool +} +// NewItemItemActionsRunsItemRerunFailedJobsPostRequestBody instantiates a new ItemItemActionsRunsItemRerunFailedJobsPostRequestBody and sets the default values. +func NewItemItemActionsRunsItemRerunFailedJobsPostRequestBody()(*ItemItemActionsRunsItemRerunFailedJobsPostRequestBody) { + m := &ItemItemActionsRunsItemRerunFailedJobsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunsItemRerunFailedJobsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunsItemRerunFailedJobsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemRerunFailedJobsPostRequestBody(), 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 *ItemItemActionsRunsItemRerunFailedJobsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnableDebugLogging gets the enable_debug_logging property value. Whether to enable debug logging for the re-run. +// returns a *bool when successful +func (m *ItemItemActionsRunsItemRerunFailedJobsPostRequestBody) GetEnableDebugLogging()(*bool) { + return m.enable_debug_logging +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunsItemRerunFailedJobsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enable_debug_logging"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnableDebugLogging(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunsItemRerunFailedJobsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enable_debug_logging", m.GetEnableDebugLogging()) + 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 *ItemItemActionsRunsItemRerunFailedJobsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnableDebugLogging sets the enable_debug_logging property value. Whether to enable debug logging for the re-run. +func (m *ItemItemActionsRunsItemRerunFailedJobsPostRequestBody) SetEnableDebugLogging(value *bool)() { + m.enable_debug_logging = value +} +type ItemItemActionsRunsItemRerunFailedJobsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnableDebugLogging()(*bool) + SetEnableDebugLogging(value *bool)() +} diff --git a/pkg/github/repos/item_item_actions_runs_item_rerun_failed_jobs_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_rerun_failed_jobs_request_builder.go new file mode 100644 index 00000000..f5a69df6 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_rerun_failed_jobs_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunsItemRerunFailedJobsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\rerun-failed-jobs +type ItemItemActionsRunsItemRerunFailedJobsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemRerunFailedJobsRequestBuilderInternal instantiates a new ItemItemActionsRunsItemRerunFailedJobsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemRerunFailedJobsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemRerunFailedJobsRequestBuilder) { + m := &ItemItemActionsRunsItemRerunFailedJobsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/rerun-failed-jobs", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemRerunFailedJobsRequestBuilder instantiates a new ItemItemActionsRunsItemRerunFailedJobsRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemRerunFailedJobsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemRerunFailedJobsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemRerunFailedJobsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post re-run all of the failed jobs and their dependent jobs in a workflow run using the `id` of the workflow run.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#re-run-failed-jobs-from-a-workflow-run +func (m *ItemItemActionsRunsItemRerunFailedJobsRequestBuilder) Post(ctx context.Context, body ItemItemActionsRunsItemRerunFailedJobsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToPostRequestInformation re-run all of the failed jobs and their dependent jobs in a workflow run using the `id` of the workflow run.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemRerunFailedJobsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsRunsItemRerunFailedJobsPostRequestBodyable, 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 *ItemItemActionsRunsItemRerunFailedJobsRequestBuilder when successful +func (m *ItemItemActionsRunsItemRerunFailedJobsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemRerunFailedJobsRequestBuilder) { + return NewItemItemActionsRunsItemRerunFailedJobsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_item_rerun_post_request_body.go b/pkg/github/repos/item_item_actions_runs_item_rerun_post_request_body.go new file mode 100644 index 00000000..2522f36c --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_rerun_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsRunsItemRerunPostRequestBody 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 enable debug logging for the re-run. + enable_debug_logging *bool +} +// NewItemItemActionsRunsItemRerunPostRequestBody instantiates a new ItemItemActionsRunsItemRerunPostRequestBody and sets the default values. +func NewItemItemActionsRunsItemRerunPostRequestBody()(*ItemItemActionsRunsItemRerunPostRequestBody) { + m := &ItemItemActionsRunsItemRerunPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsRunsItemRerunPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsRunsItemRerunPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsRunsItemRerunPostRequestBody(), 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 *ItemItemActionsRunsItemRerunPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnableDebugLogging gets the enable_debug_logging property value. Whether to enable debug logging for the re-run. +// returns a *bool when successful +func (m *ItemItemActionsRunsItemRerunPostRequestBody) GetEnableDebugLogging()(*bool) { + return m.enable_debug_logging +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemActionsRunsItemRerunPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["enable_debug_logging"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnableDebugLogging(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemActionsRunsItemRerunPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("enable_debug_logging", m.GetEnableDebugLogging()) + 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 *ItemItemActionsRunsItemRerunPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnableDebugLogging sets the enable_debug_logging property value. Whether to enable debug logging for the re-run. +func (m *ItemItemActionsRunsItemRerunPostRequestBody) SetEnableDebugLogging(value *bool)() { + m.enable_debug_logging = value +} +type ItemItemActionsRunsItemRerunPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnableDebugLogging()(*bool) + SetEnableDebugLogging(value *bool)() +} diff --git a/pkg/github/repos/item_item_actions_runs_item_rerun_request_builder.go b/pkg/github/repos/item_item_actions_runs_item_rerun_request_builder.go new file mode 100644 index 00000000..ae7b1981 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_item_rerun_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunsItemRerunRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id}\rerun +type ItemItemActionsRunsItemRerunRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsRunsItemRerunRequestBuilderInternal instantiates a new ItemItemActionsRunsItemRerunRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemRerunRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemRerunRequestBuilder) { + m := &ItemItemActionsRunsItemRerunRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}/rerun", pathParameters), + } + return m +} +// NewItemItemActionsRunsItemRerunRequestBuilder instantiates a new ItemItemActionsRunsItemRerunRequestBuilder and sets the default values. +func NewItemItemActionsRunsItemRerunRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsItemRerunRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsItemRerunRequestBuilderInternal(urlParams, requestAdapter) +} +// Post re-runs your workflow run using its `id`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#re-run-a-workflow +func (m *ItemItemActionsRunsItemRerunRequestBuilder) Post(ctx context.Context, body ItemItemActionsRunsItemRerunPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToPostRequestInformation re-runs your workflow run using its `id`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsItemRerunRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsRunsItemRerunPostRequestBodyable, 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 *ItemItemActionsRunsItemRerunRequestBuilder when successful +func (m *ItemItemActionsRunsItemRerunRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsItemRerunRequestBuilder) { + return NewItemItemActionsRunsItemRerunRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_request_builder.go b/pkg/github/repos/item_item_actions_runs_request_builder.go new file mode 100644 index 00000000..9158f0e8 --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_request_builder.go @@ -0,0 +1,92 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i5547fe1de0de8b4c932dd2b844bb02fdcb60303fd757c74855d9345fee32f80b "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/actions/runs" +) + +// ItemItemActionsRunsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs +type ItemItemActionsRunsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsRunsRequestBuilderGetQueryParameters lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.This API will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. +type ItemItemActionsRunsRequestBuilderGetQueryParameters struct { + // Returns someone's workflow runs. Use the login for the user who created the `push` associated with the check suite or workflow run. + Actor *string `uriparametername:"actor"` + // Returns workflow runs associated with a branch. Use the name of the branch of the `push`. + Branch *string `uriparametername:"branch"` + // Returns workflow runs with the `check_suite_id` that you specify. + Check_suite_id *int32 `uriparametername:"check_suite_id"` + // Returns workflow runs created within the given date-time range. For more information on the syntax, see "[Understanding the search syntax](https://docs.github.com/enterprise-server@3.14/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." + Created *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"created"` + // Returns workflow run triggered by the event you specify. For example, `push`, `pull_request` or `issue`. For more information, see "[Events that trigger workflows](https://docs.github.com/enterprise-server@3.14/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." + Event *string `uriparametername:"event"` + // If `true` pull requests are omitted from the response (empty array). + Exclude_pull_requests *bool `uriparametername:"exclude_pull_requests"` + // Only returns workflow runs that are associated with the specified `head_sha`. + Head_sha *string `uriparametername:"head_sha"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Returns workflow runs with the check run `status` or `conclusion` that you specify. For example, a conclusion can be `success` or a status can be `in_progress`. Only GitHub Actions can set a status of `waiting`, `pending`, or `requested`. + Status *i5547fe1de0de8b4c932dd2b844bb02fdcb60303fd757c74855d9345fee32f80b.GetStatusQueryParameterType `uriparametername:"status"` +} +// ByRun_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.actions.runs.item collection +// returns a *ItemItemActionsRunsWithRun_ItemRequestBuilder when successful +func (m *ItemItemActionsRunsRequestBuilder) ByRun_id(run_id int32)(*ItemItemActionsRunsWithRun_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["run_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(run_id), 10) + return NewItemItemActionsRunsWithRun_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsRunsRequestBuilderInternal instantiates a new ItemItemActionsRunsRequestBuilder and sets the default values. +func NewItemItemActionsRunsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsRequestBuilder) { + m := &ItemItemActionsRunsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs{?actor*,branch*,check_suite_id*,created*,event*,exclude_pull_requests*,head_sha*,page*,per_page*,status*}", pathParameters), + } + return m +} +// NewItemItemActionsRunsRequestBuilder instantiates a new ItemItemActionsRunsRequestBuilder and sets the default values. +func NewItemItemActionsRunsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.This API will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. +// returns a ItemItemActionsRunsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#list-workflow-runs-for-a-repository +func (m *ItemItemActionsRunsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsRequestBuilderGetQueryParameters])(ItemItemActionsRunsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsRunsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsRunsGetResponseable), nil +} +// ToGetRequestInformation lists all workflow runs for a repository. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository.This API will return up to 1,000 results for each search when using the following parameters: `actor`, `branch`, `check_suite_id`, `created`, `event`, `head_sha`, `status`. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsRequestBuilderGetQueryParameters])(*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 *ItemItemActionsRunsRequestBuilder when successful +func (m *ItemItemActionsRunsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsRequestBuilder) { + return NewItemItemActionsRunsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_runs_with_run_escaped_item_request_builder.go b/pkg/github/repos/item_item_actions_runs_with_run_escaped_item_request_builder.go new file mode 100644 index 00000000..139f39ae --- /dev/null +++ b/pkg/github/repos/item_item_actions_runs_with_run_escaped_item_request_builder.go @@ -0,0 +1,139 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsRunsWithRun_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\runs\{run_id} +type ItemItemActionsRunsWithRun_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsRunsWithRun_ItemRequestBuilderGetQueryParameters gets a specific workflow run.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsRunsWithRun_ItemRequestBuilderGetQueryParameters struct { + // If `true` pull requests are omitted from the response (empty array). + Exclude_pull_requests *bool `uriparametername:"exclude_pull_requests"` +} +// Approvals the approvals property +// returns a *ItemItemActionsRunsItemApprovalsRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Approvals()(*ItemItemActionsRunsItemApprovalsRequestBuilder) { + return NewItemItemActionsRunsItemApprovalsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Artifacts the artifacts property +// returns a *ItemItemActionsRunsItemArtifactsRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Artifacts()(*ItemItemActionsRunsItemArtifactsRequestBuilder) { + return NewItemItemActionsRunsItemArtifactsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Attempts the attempts property +// returns a *ItemItemActionsRunsItemAttemptsRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Attempts()(*ItemItemActionsRunsItemAttemptsRequestBuilder) { + return NewItemItemActionsRunsItemAttemptsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Cancel the cancel property +// returns a *ItemItemActionsRunsItemCancelRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Cancel()(*ItemItemActionsRunsItemCancelRequestBuilder) { + return NewItemItemActionsRunsItemCancelRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsRunsWithRun_ItemRequestBuilderInternal instantiates a new ItemItemActionsRunsWithRun_ItemRequestBuilder and sets the default values. +func NewItemItemActionsRunsWithRun_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsWithRun_ItemRequestBuilder) { + m := &ItemItemActionsRunsWithRun_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/runs/{run_id}{?exclude_pull_requests*}", pathParameters), + } + return m +} +// NewItemItemActionsRunsWithRun_ItemRequestBuilder instantiates a new ItemItemActionsRunsWithRun_ItemRequestBuilder and sets the default values. +func NewItemItemActionsRunsWithRun_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsRunsWithRun_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsRunsWithRun_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a specific workflow run.Anyone with write access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#delete-a-workflow-run +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Deployment_protection_rule the deployment_protection_rule property +// returns a *ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Deployment_protection_rule()(*ItemItemActionsRunsItemDeployment_protection_ruleRequestBuilder) { + return NewItemItemActionsRunsItemDeployment_protection_ruleRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ForceCancel the forceCancel property +// returns a *ItemItemActionsRunsItemForceCancelRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) ForceCancel()(*ItemItemActionsRunsItemForceCancelRequestBuilder) { + return NewItemItemActionsRunsItemForceCancelRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get gets a specific workflow run.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a WorkflowRunable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#get-a-workflow-run +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsWithRun_ItemRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWorkflowRunFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable), nil +} +// Jobs the jobs property +// returns a *ItemItemActionsRunsItemJobsRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Jobs()(*ItemItemActionsRunsItemJobsRequestBuilder) { + return NewItemItemActionsRunsItemJobsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Logs the logs property +// returns a *ItemItemActionsRunsItemLogsRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Logs()(*ItemItemActionsRunsItemLogsRequestBuilder) { + return NewItemItemActionsRunsItemLogsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Pending_deployments the pending_deployments property +// returns a *ItemItemActionsRunsItemPending_deploymentsRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Pending_deployments()(*ItemItemActionsRunsItemPending_deploymentsRequestBuilder) { + return NewItemItemActionsRunsItemPending_deploymentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rerun the rerun property +// returns a *ItemItemActionsRunsItemRerunRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) Rerun()(*ItemItemActionsRunsItemRerunRequestBuilder) { + return NewItemItemActionsRunsItemRerunRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// RerunFailedJobs the rerunFailedJobs property +// returns a *ItemItemActionsRunsItemRerunFailedJobsRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) RerunFailedJobs()(*ItemItemActionsRunsItemRerunFailedJobsRequestBuilder) { + return NewItemItemActionsRunsItemRerunFailedJobsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a specific workflow run.Anyone with write access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsWithRun_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a specific workflow run.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsRunsWithRun_ItemRequestBuilderGetQueryParameters])(*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 *ItemItemActionsRunsWithRun_ItemRequestBuilder when successful +func (m *ItemItemActionsRunsWithRun_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsRunsWithRun_ItemRequestBuilder) { + return NewItemItemActionsRunsWithRun_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_secrets_get_response.go b/pkg/github/repos/item_item_actions_secrets_get_response.go new file mode 100644 index 00000000..a3a9bfb0 --- /dev/null +++ b/pkg/github/repos/item_item_actions_secrets_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsSecretsGetResponse 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 secrets property + secrets []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable + // The total_count property + total_count *int32 +} +// NewItemItemActionsSecretsGetResponse instantiates a new ItemItemActionsSecretsGetResponse and sets the default values. +func NewItemItemActionsSecretsGetResponse()(*ItemItemActionsSecretsGetResponse) { + m := &ItemItemActionsSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsSecretsGetResponse(), 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 *ItemItemActionsSecretsGetResponse) 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 *ItemItemActionsSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable) + } + } + m.SetSecrets(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 +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []ActionsSecretable when successful +func (m *ItemItemActionsSecretsGetResponse) GetSecrets()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemActionsSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", 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 *ItemItemActionsSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemItemActionsSecretsGetResponse) SetSecrets(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemActionsSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable) + GetTotalCount()(*int32) + SetSecrets(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_actions_secrets_item_with_secret_escaped_name_put_request_body.go b/pkg/github/repos/item_item_actions_secrets_item_with_secret_escaped_name_put_request_body.go new file mode 100644 index 00000000..961b1b09 --- /dev/null +++ b/pkg/github/repos/item_item_actions_secrets_item_with_secret_escaped_name_put_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsSecretsItemWithSecret_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 + // Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-a-repository-public-key) endpoint. + encrypted_value *string + // ID of the key you used to encrypt the secret. + key_id *string +} +// NewItemItemActionsSecretsItemWithSecret_namePutRequestBody instantiates a new ItemItemActionsSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewItemItemActionsSecretsItemWithSecret_namePutRequestBody()(*ItemItemActionsSecretsItemWithSecret_namePutRequestBody) { + m := &ItemItemActionsSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsSecretsItemWithSecret_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 *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-a-repository-public-key) endpoint. +// returns a *string when successful +func (m *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) 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 *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) 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 + } + return res +} +// GetKeyId gets the key_id property value. ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// Serialize serializes information the current object +func (m *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) 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 + } + } + { + 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 *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-a-repository-public-key) endpoint. +func (m *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. ID of the key you used to encrypt the secret. +func (m *ItemItemActionsSecretsItemWithSecret_namePutRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +type ItemItemActionsSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() +} diff --git a/pkg/github/repos/item_item_actions_secrets_public_key_request_builder.go b/pkg/github/repos/item_item_actions_secrets_public_key_request_builder.go new file mode 100644 index 00000000..1dd26070 --- /dev/null +++ b/pkg/github/repos/item_item_actions_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsSecretsPublicKeyRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\secrets\public-key +type ItemItemActionsSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsSecretsPublicKeyRequestBuilderInternal instantiates a new ItemItemActionsSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemActionsSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsSecretsPublicKeyRequestBuilder) { + m := &ItemItemActionsSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/secrets/public-key", pathParameters), + } + return m +} +// NewItemItemActionsSecretsPublicKeyRequestBuilder instantiates a new ItemItemActionsSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemActionsSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-a-repository-public-key +func (m *ItemItemActionsSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsPublicKeyable), nil +} +// ToGetRequestInformation gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsSecretsPublicKeyRequestBuilder) 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 *ItemItemActionsSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemActionsSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsSecretsPublicKeyRequestBuilder) { + return NewItemItemActionsSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_secrets_request_builder.go b/pkg/github/repos/item_item_actions_secrets_request_builder.go new file mode 100644 index 00000000..e4e5cbd8 --- /dev/null +++ b/pkg/github/repos/item_item_actions_secrets_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsSecretsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\secrets +type ItemItemActionsSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsSecretsRequestBuilderGetQueryParameters lists all secrets available in a repository without revealing their encryptedvalues.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemActionsSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/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-enterprise-server/pkg/github.repos.item.item.actions.secrets.item collection +// returns a *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemActionsSecretsRequestBuilder) BySecret_name(secret_name string)(*ItemItemActionsSecretsWithSecret_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 NewItemItemActionsSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsSecretsRequestBuilderInternal instantiates a new ItemItemActionsSecretsRequestBuilder and sets the default values. +func NewItemItemActionsSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsSecretsRequestBuilder) { + m := &ItemItemActionsSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsSecretsRequestBuilder instantiates a new ItemItemActionsSecretsRequestBuilder and sets the default values. +func NewItemItemActionsSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all secrets available in a repository without revealing their encryptedvalues.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#list-repository-secrets +func (m *ItemItemActionsSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsSecretsRequestBuilderGetQueryParameters])(ItemItemActionsSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *ItemItemActionsSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemActionsSecretsRequestBuilder) PublicKey()(*ItemItemActionsSecretsPublicKeyRequestBuilder) { + return NewItemItemActionsSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all secrets available in a repository without revealing their encryptedvalues.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsSecretsRequestBuilderGetQueryParameters])(*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 *ItemItemActionsSecretsRequestBuilder when successful +func (m *ItemItemActionsSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsSecretsRequestBuilder) { + return NewItemItemActionsSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_secrets_with_secret_escaped_name_item_request_builder.go b/pkg/github/repos/item_item_actions_secrets_with_secret_escaped_name_item_request_builder.go new file mode 100644 index 00000000..c616b5d5 --- /dev/null +++ b/pkg/github/repos/item_item_actions_secrets_with_secret_escaped_name_item_request_builder.go @@ -0,0 +1,110 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\secrets\{secret_name} +type ItemItemActionsSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new ItemItemActionsSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemActionsSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) { + m := &ItemItemActionsSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/secrets/{secret_name}", pathParameters), + } + return m +} +// NewItemItemActionsSecretsWithSecret_nameItemRequestBuilder instantiates a new ItemItemActionsSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemActionsSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a secret in a repository using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#delete-a-repository-secret +func (m *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a single repository secret without revealing its encrypted value.The authenticated user must have collaborator access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-a-repository-secret +func (m *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable), nil +} +// Put creates or updates a repository secret with an encrypted value. 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/enterprise-server@3.14/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#create-or-update-a-repository-secret +func (m *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body ItemItemActionsSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToDeleteRequestInformation deletes a secret in a repository using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsSecretsWithSecret_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a single repository secret without revealing its encrypted value.The authenticated user must have collaborator access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsSecretsWithSecret_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 +} +// ToPutRequestInformation creates or updates a repository secret with an encrypted value. 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/enterprise-server@3.14/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemActionsSecretsItemWithSecret_namePutRequestBodyable, 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 *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsSecretsWithSecret_nameItemRequestBuilder) { + return NewItemItemActionsSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_variables_get_response.go b/pkg/github/repos/item_item_actions_variables_get_response.go new file mode 100644 index 00000000..67408f77 --- /dev/null +++ b/pkg/github/repos/item_item_actions_variables_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsVariablesGetResponse 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 total_count property + total_count *int32 + // The variables property + variables []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable +} +// NewItemItemActionsVariablesGetResponse instantiates a new ItemItemActionsVariablesGetResponse and sets the default values. +func NewItemItemActionsVariablesGetResponse()(*ItemItemActionsVariablesGetResponse) { + m := &ItemItemActionsVariablesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsVariablesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsVariablesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsVariablesGetResponse(), 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 *ItemItemActionsVariablesGetResponse) 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 *ItemItemActionsVariablesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 + } + res["variables"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsVariableFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable) + } + } + m.SetVariables(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsVariablesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetVariables gets the variables property value. The variables property +// returns a []ActionsVariableable when successful +func (m *ItemItemActionsVariablesGetResponse) GetVariables()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable) { + return m.variables +} +// Serialize serializes information the current object +func (m *ItemItemActionsVariablesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetVariables() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVariables())) + for i, v := range m.GetVariables() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("variables", 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 *ItemItemActionsVariablesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsVariablesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetVariables sets the variables property value. The variables property +func (m *ItemItemActionsVariablesGetResponse) SetVariables(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable)() { + m.variables = value +} +type ItemItemActionsVariablesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetVariables()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable) + SetTotalCount(value *int32)() + SetVariables(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable)() +} diff --git a/pkg/github/repos/item_item_actions_variables_item_with_name_patch_request_body.go b/pkg/github/repos/item_item_actions_variables_item_with_name_patch_request_body.go new file mode 100644 index 00000000..748b2d11 --- /dev/null +++ b/pkg/github/repos/item_item_actions_variables_item_with_name_patch_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsVariablesItemWithNamePatchRequestBody 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 name of the variable. + name *string + // The value of the variable. + value *string +} +// NewItemItemActionsVariablesItemWithNamePatchRequestBody instantiates a new ItemItemActionsVariablesItemWithNamePatchRequestBody and sets the default values. +func NewItemItemActionsVariablesItemWithNamePatchRequestBody()(*ItemItemActionsVariablesItemWithNamePatchRequestBody) { + m := &ItemItemActionsVariablesItemWithNamePatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsVariablesItemWithNamePatchRequestBody(), 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 *ItemItemActionsVariablesItemWithNamePatchRequestBody) 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 *ItemItemActionsVariablesItemWithNamePatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemItemActionsVariablesItemWithNamePatchRequestBody) GetName()(*string) { + return m.name +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemItemActionsVariablesItemWithNamePatchRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemItemActionsVariablesItemWithNamePatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + 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 *ItemItemActionsVariablesItemWithNamePatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemItemActionsVariablesItemWithNamePatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemItemActionsVariablesItemWithNamePatchRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemItemActionsVariablesItemWithNamePatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetValue()(*string) + SetName(value *string)() + SetValue(value *string)() +} diff --git a/pkg/github/repos/item_item_actions_variables_post_request_body.go b/pkg/github/repos/item_item_actions_variables_post_request_body.go new file mode 100644 index 00000000..d1b4f5da --- /dev/null +++ b/pkg/github/repos/item_item_actions_variables_post_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsVariablesPostRequestBody 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 name of the variable. + name *string + // The value of the variable. + value *string +} +// NewItemItemActionsVariablesPostRequestBody instantiates a new ItemItemActionsVariablesPostRequestBody and sets the default values. +func NewItemItemActionsVariablesPostRequestBody()(*ItemItemActionsVariablesPostRequestBody) { + m := &ItemItemActionsVariablesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsVariablesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsVariablesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsVariablesPostRequestBody(), 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 *ItemItemActionsVariablesPostRequestBody) 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 *ItemItemActionsVariablesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemItemActionsVariablesPostRequestBody) GetName()(*string) { + return m.name +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemItemActionsVariablesPostRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemItemActionsVariablesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + 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 *ItemItemActionsVariablesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemItemActionsVariablesPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemItemActionsVariablesPostRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemItemActionsVariablesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetValue()(*string) + SetName(value *string)() + SetValue(value *string)() +} diff --git a/pkg/github/repos/item_item_actions_variables_request_builder.go b/pkg/github/repos/item_item_actions_variables_request_builder.go new file mode 100644 index 00000000..5026c2ba --- /dev/null +++ b/pkg/github/repos/item_item_actions_variables_request_builder.go @@ -0,0 +1,107 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsVariablesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\variables +type ItemItemActionsVariablesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsVariablesRequestBuilderGetQueryParameters lists all repository variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemActionsVariablesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 30). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByName gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.actions.variables.item collection +// returns a *ItemItemActionsVariablesWithNameItemRequestBuilder when successful +func (m *ItemItemActionsVariablesRequestBuilder) ByName(name string)(*ItemItemActionsVariablesWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemItemActionsVariablesWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsVariablesRequestBuilderInternal instantiates a new ItemItemActionsVariablesRequestBuilder and sets the default values. +func NewItemItemActionsVariablesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsVariablesRequestBuilder) { + m := &ItemItemActionsVariablesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/variables{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsVariablesRequestBuilder instantiates a new ItemItemActionsVariablesRequestBuilder and sets the default values. +func NewItemItemActionsVariablesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsVariablesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsVariablesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all repository variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemActionsVariablesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#list-repository-variables +func (m *ItemItemActionsVariablesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsVariablesRequestBuilderGetQueryParameters])(ItemItemActionsVariablesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsVariablesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsVariablesGetResponseable), nil +} +// Post creates a repository variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#create-a-repository-variable +func (m *ItemItemActionsVariablesRequestBuilder) Post(ctx context.Context, body ItemItemActionsVariablesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToGetRequestInformation lists all repository variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsVariablesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsVariablesRequestBuilderGetQueryParameters])(*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 repository variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsVariablesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsVariablesPostRequestBodyable, 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 *ItemItemActionsVariablesRequestBuilder when successful +func (m *ItemItemActionsVariablesRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsVariablesRequestBuilder) { + return NewItemItemActionsVariablesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_variables_with_name_item_request_builder.go b/pkg/github/repos/item_item_actions_variables_with_name_item_request_builder.go new file mode 100644 index 00000000..370d5393 --- /dev/null +++ b/pkg/github/repos/item_item_actions_variables_with_name_item_request_builder.go @@ -0,0 +1,105 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsVariablesWithNameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\variables\{name} +type ItemItemActionsVariablesWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsVariablesWithNameItemRequestBuilderInternal instantiates a new ItemItemActionsVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemItemActionsVariablesWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsVariablesWithNameItemRequestBuilder) { + m := &ItemItemActionsVariablesWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/variables/{name}", pathParameters), + } + return m +} +// NewItemItemActionsVariablesWithNameItemRequestBuilder instantiates a new ItemItemActionsVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemItemActionsVariablesWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsVariablesWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsVariablesWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a repository variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#delete-a-repository-variable +func (m *ItemItemActionsVariablesWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific variable in a repository.The authenticated user must have collaborator access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsVariableable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#get-a-repository-variable +func (m *ItemItemActionsVariablesWithNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsVariableFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable), nil +} +// Patch updates a repository variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#update-a-repository-variable +func (m *ItemItemActionsVariablesWithNameItemRequestBuilder) Patch(ctx context.Context, body ItemItemActionsVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation deletes a repository variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsVariablesWithNameItemRequestBuilder) 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 +} +// ToGetRequestInformation gets a specific variable in a repository.The authenticated user must have collaborator access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsVariablesWithNameItemRequestBuilder) 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 repository variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsVariablesWithNameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemActionsVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemItemActionsVariablesWithNameItemRequestBuilder when successful +func (m *ItemItemActionsVariablesWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsVariablesWithNameItemRequestBuilder) { + return NewItemItemActionsVariablesWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_workflows_get_response.go b/pkg/github/repos/item_item_actions_workflows_get_response.go new file mode 100644 index 00000000..e2d8e14a --- /dev/null +++ b/pkg/github/repos/item_item_actions_workflows_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsWorkflowsGetResponse 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 total_count property + total_count *int32 + // The workflows property + workflows []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Workflowable +} +// NewItemItemActionsWorkflowsGetResponse instantiates a new ItemItemActionsWorkflowsGetResponse and sets the default values. +func NewItemItemActionsWorkflowsGetResponse()(*ItemItemActionsWorkflowsGetResponse) { + m := &ItemItemActionsWorkflowsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsWorkflowsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsWorkflowsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsWorkflowsGetResponse(), 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 *ItemItemActionsWorkflowsGetResponse) 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 *ItemItemActionsWorkflowsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 + } + res["workflows"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWorkflowFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Workflowable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Workflowable) + } + } + m.SetWorkflows(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsWorkflowsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetWorkflows gets the workflows property value. The workflows property +// returns a []Workflowable when successful +func (m *ItemItemActionsWorkflowsGetResponse) GetWorkflows()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Workflowable) { + return m.workflows +} +// Serialize serializes information the current object +func (m *ItemItemActionsWorkflowsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetWorkflows() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWorkflows())) + for i, v := range m.GetWorkflows() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("workflows", 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 *ItemItemActionsWorkflowsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsWorkflowsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetWorkflows sets the workflows property value. The workflows property +func (m *ItemItemActionsWorkflowsGetResponse) SetWorkflows(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Workflowable)() { + m.workflows = value +} +type ItemItemActionsWorkflowsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetWorkflows()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Workflowable) + SetTotalCount(value *int32)() + SetWorkflows(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Workflowable)() +} diff --git a/pkg/github/repos/item_item_actions_workflows_item_disable_request_builder.go b/pkg/github/repos/item_item_actions_workflows_item_disable_request_builder.go new file mode 100644 index 00000000..289bb69f --- /dev/null +++ b/pkg/github/repos/item_item_actions_workflows_item_disable_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsWorkflowsItemDisableRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\workflows\{workflow_id}\disable +type ItemItemActionsWorkflowsItemDisableRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsWorkflowsItemDisableRequestBuilderInternal instantiates a new ItemItemActionsWorkflowsItemDisableRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemDisableRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemDisableRequestBuilder) { + m := &ItemItemActionsWorkflowsItemDisableRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/workflows/{workflow_id}/disable", pathParameters), + } + return m +} +// NewItemItemActionsWorkflowsItemDisableRequestBuilder instantiates a new ItemItemActionsWorkflowsItemDisableRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemDisableRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemDisableRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsWorkflowsItemDisableRequestBuilderInternal(urlParams, requestAdapter) +} +// Put disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflows#disable-a-workflow +func (m *ItemItemActionsWorkflowsItemDisableRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPutRequestInformation disables a workflow and sets the `state` of the workflow to `disabled_manually`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsWorkflowsItemDisableRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemItemActionsWorkflowsItemDisableRequestBuilder when successful +func (m *ItemItemActionsWorkflowsItemDisableRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsWorkflowsItemDisableRequestBuilder) { + return NewItemItemActionsWorkflowsItemDisableRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_workflows_item_dispatches_post_request_body.go b/pkg/github/repos/item_item_actions_workflows_item_dispatches_post_request_body.go new file mode 100644 index 00000000..d156f3a7 --- /dev/null +++ b/pkg/github/repos/item_item_actions_workflows_item_dispatches_post_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemActionsWorkflowsItemDispatchesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted. + inputs ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable + // The git reference for the workflow. The reference can be a branch or tag name. + ref *string +} +// NewItemItemActionsWorkflowsItemDispatchesPostRequestBody instantiates a new ItemItemActionsWorkflowsItemDispatchesPostRequestBody and sets the default values. +func NewItemItemActionsWorkflowsItemDispatchesPostRequestBody()(*ItemItemActionsWorkflowsItemDispatchesPostRequestBody) { + m := &ItemItemActionsWorkflowsItemDispatchesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsWorkflowsItemDispatchesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsWorkflowsItemDispatchesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsWorkflowsItemDispatchesPostRequestBody(), 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 *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) 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 *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["inputs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInputs(val.(ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable)) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + return res +} +// GetInputs gets the inputs property value. Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted. +// returns a ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable when successful +func (m *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) GetInputs()(ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable) { + return m.inputs +} +// GetRef gets the ref property value. The git reference for the workflow. The reference can be a branch or tag name. +// returns a *string when successful +func (m *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) GetRef()(*string) { + return m.ref +} +// Serialize serializes information the current object +func (m *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("inputs", m.GetInputs()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + 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 *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetInputs sets the inputs property value. Input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted. +func (m *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) SetInputs(value ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable)() { + m.inputs = value +} +// SetRef sets the ref property value. The git reference for the workflow. The reference can be a branch or tag name. +func (m *ItemItemActionsWorkflowsItemDispatchesPostRequestBody) SetRef(value *string)() { + m.ref = value +} +type ItemItemActionsWorkflowsItemDispatchesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInputs()(ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable) + GetRef()(*string) + SetInputs(value ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable)() + SetRef(value *string)() +} diff --git a/pkg/github/repos/item_item_actions_workflows_item_dispatches_post_request_body_escaped_inputs.go b/pkg/github/repos/item_item_actions_workflows_item_dispatches_post_request_body_escaped_inputs.go new file mode 100644 index 00000000..29ed3ceb --- /dev/null +++ b/pkg/github/repos/item_item_actions_workflows_item_dispatches_post_request_body_escaped_inputs.go @@ -0,0 +1,52 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs input keys and values configured in the workflow file. The maximum number of properties is 10. Any default properties configured in the workflow file will be used when `inputs` are omitted. +type ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs instantiates a new ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs and sets the default values. +func NewItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs()(*ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs) { + m := &ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs(), 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 *ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs) 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 *ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs) 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 *ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs) 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 *ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputs) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemActionsWorkflowsItemDispatchesPostRequestBody_inputsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_actions_workflows_item_dispatches_request_builder.go b/pkg/github/repos/item_item_actions_workflows_item_dispatches_request_builder.go new file mode 100644 index 00000000..8f245cbe --- /dev/null +++ b/pkg/github/repos/item_item_actions_workflows_item_dispatches_request_builder.go @@ -0,0 +1,55 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsWorkflowsItemDispatchesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\workflows\{workflow_id}\dispatches +type ItemItemActionsWorkflowsItemDispatchesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsWorkflowsItemDispatchesRequestBuilderInternal instantiates a new ItemItemActionsWorkflowsItemDispatchesRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemDispatchesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemDispatchesRequestBuilder) { + m := &ItemItemActionsWorkflowsItemDispatchesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/workflows/{workflow_id}/dispatches", pathParameters), + } + return m +} +// NewItemItemActionsWorkflowsItemDispatchesRequestBuilder instantiates a new ItemItemActionsWorkflowsItemDispatchesRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemDispatchesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemDispatchesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsWorkflowsItemDispatchesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post you can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.You must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)."OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflows#create-a-workflow-dispatch-event +func (m *ItemItemActionsWorkflowsItemDispatchesRequestBuilder) Post(ctx context.Context, body ItemItemActionsWorkflowsItemDispatchesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation you can use this endpoint to manually trigger a GitHub Actions workflow run. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.You must configure your GitHub Actions workflow to run when the [`workflow_dispatch` webhook](/developers/webhooks-and-events/webhook-events-and-payloads#workflow_dispatch) event occurs. The `inputs` are configured in the workflow file. For more information about how to configure the `workflow_dispatch` event in the workflow file, see "[Events that trigger workflows](/actions/reference/events-that-trigger-workflows#workflow_dispatch)."OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsWorkflowsItemDispatchesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemActionsWorkflowsItemDispatchesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemItemActionsWorkflowsItemDispatchesRequestBuilder when successful +func (m *ItemItemActionsWorkflowsItemDispatchesRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsWorkflowsItemDispatchesRequestBuilder) { + return NewItemItemActionsWorkflowsItemDispatchesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_workflows_item_enable_request_builder.go b/pkg/github/repos/item_item_actions_workflows_item_enable_request_builder.go new file mode 100644 index 00000000..e393ef28 --- /dev/null +++ b/pkg/github/repos/item_item_actions_workflows_item_enable_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsWorkflowsItemEnableRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\workflows\{workflow_id}\enable +type ItemItemActionsWorkflowsItemEnableRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsWorkflowsItemEnableRequestBuilderInternal instantiates a new ItemItemActionsWorkflowsItemEnableRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemEnableRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemEnableRequestBuilder) { + m := &ItemItemActionsWorkflowsItemEnableRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/workflows/{workflow_id}/enable", pathParameters), + } + return m +} +// NewItemItemActionsWorkflowsItemEnableRequestBuilder instantiates a new ItemItemActionsWorkflowsItemEnableRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemEnableRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemEnableRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsWorkflowsItemEnableRequestBuilderInternal(urlParams, requestAdapter) +} +// Put enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflows#enable-a-workflow +func (m *ItemItemActionsWorkflowsItemEnableRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPutRequestInformation enables a workflow and sets the `state` of the workflow to `active`. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemActionsWorkflowsItemEnableRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemItemActionsWorkflowsItemEnableRequestBuilder when successful +func (m *ItemItemActionsWorkflowsItemEnableRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsWorkflowsItemEnableRequestBuilder) { + return NewItemItemActionsWorkflowsItemEnableRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_workflows_item_runs_get_response.go b/pkg/github/repos/item_item_actions_workflows_item_runs_get_response.go new file mode 100644 index 00000000..044e4c58 --- /dev/null +++ b/pkg/github/repos/item_item_actions_workflows_item_runs_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemActionsWorkflowsItemRunsGetResponse 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 total_count property + total_count *int32 + // The workflow_runs property + workflow_runs []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable +} +// NewItemItemActionsWorkflowsItemRunsGetResponse instantiates a new ItemItemActionsWorkflowsItemRunsGetResponse and sets the default values. +func NewItemItemActionsWorkflowsItemRunsGetResponse()(*ItemItemActionsWorkflowsItemRunsGetResponse) { + m := &ItemItemActionsWorkflowsItemRunsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemActionsWorkflowsItemRunsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemActionsWorkflowsItemRunsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemActionsWorkflowsItemRunsGetResponse(), 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 *ItemItemActionsWorkflowsItemRunsGetResponse) 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 *ItemItemActionsWorkflowsItemRunsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 + } + res["workflow_runs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWorkflowRunFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable) + } + } + m.SetWorkflowRuns(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemActionsWorkflowsItemRunsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetWorkflowRuns gets the workflow_runs property value. The workflow_runs property +// returns a []WorkflowRunable when successful +func (m *ItemItemActionsWorkflowsItemRunsGetResponse) GetWorkflowRuns()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable) { + return m.workflow_runs +} +// Serialize serializes information the current object +func (m *ItemItemActionsWorkflowsItemRunsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetWorkflowRuns() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWorkflowRuns())) + for i, v := range m.GetWorkflowRuns() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("workflow_runs", 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 *ItemItemActionsWorkflowsItemRunsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemActionsWorkflowsItemRunsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetWorkflowRuns sets the workflow_runs property value. The workflow_runs property +func (m *ItemItemActionsWorkflowsItemRunsGetResponse) SetWorkflowRuns(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable)() { + m.workflow_runs = value +} +type ItemItemActionsWorkflowsItemRunsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetWorkflowRuns()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable) + SetTotalCount(value *int32)() + SetWorkflowRuns(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WorkflowRunable)() +} diff --git a/pkg/github/repos/item_item_actions_workflows_item_runs_request_builder.go b/pkg/github/repos/item_item_actions_workflows_item_runs_request_builder.go new file mode 100644 index 00000000..c135c253 --- /dev/null +++ b/pkg/github/repos/item_item_actions_workflows_item_runs_request_builder.go @@ -0,0 +1,81 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i5a8fbecffc3c36ae633aeabafc6d21aa41fc2c9db26db3c2bc0b58be8bd2bf87 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/actions/workflows/item/runs" +) + +// ItemItemActionsWorkflowsItemRunsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\workflows\{workflow_id}\runs +type ItemItemActionsWorkflowsItemRunsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsWorkflowsItemRunsRequestBuilderGetQueryParameters list all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpointOAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsWorkflowsItemRunsRequestBuilderGetQueryParameters struct { + // Returns someone's workflow runs. Use the login for the user who created the `push` associated with the check suite or workflow run. + Actor *string `uriparametername:"actor"` + // Returns workflow runs associated with a branch. Use the name of the branch of the `push`. + Branch *string `uriparametername:"branch"` + // Returns workflow runs with the `check_suite_id` that you specify. + Check_suite_id *int32 `uriparametername:"check_suite_id"` + // Returns workflow runs created within the given date-time range. For more information on the syntax, see "[Understanding the search syntax](https://docs.github.com/enterprise-server@3.14/search-github/getting-started-with-searching-on-github/understanding-the-search-syntax#query-for-dates)." + Created *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"created"` + // Returns workflow run triggered by the event you specify. For example, `push`, `pull_request` or `issue`. For more information, see "[Events that trigger workflows](https://docs.github.com/enterprise-server@3.14/actions/automating-your-workflow-with-github-actions/events-that-trigger-workflows)." + Event *string `uriparametername:"event"` + // If `true` pull requests are omitted from the response (empty array). + Exclude_pull_requests *bool `uriparametername:"exclude_pull_requests"` + // Only returns workflow runs that are associated with the specified `head_sha`. + Head_sha *string `uriparametername:"head_sha"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Returns workflow runs with the check run `status` or `conclusion` that you specify. For example, a conclusion can be `success` or a status can be `in_progress`. Only GitHub Actions can set a status of `waiting`, `pending`, or `requested`. + Status *i5a8fbecffc3c36ae633aeabafc6d21aa41fc2c9db26db3c2bc0b58be8bd2bf87.GetStatusQueryParameterType `uriparametername:"status"` +} +// NewItemItemActionsWorkflowsItemRunsRequestBuilderInternal instantiates a new ItemItemActionsWorkflowsItemRunsRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemRunsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemRunsRequestBuilder) { + m := &ItemItemActionsWorkflowsItemRunsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/workflows/{workflow_id}/runs{?actor*,branch*,check_suite_id*,created*,event*,exclude_pull_requests*,head_sha*,page*,per_page*,status*}", pathParameters), + } + return m +} +// NewItemItemActionsWorkflowsItemRunsRequestBuilder instantiates a new ItemItemActionsWorkflowsItemRunsRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsItemRunsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsItemRunsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsWorkflowsItemRunsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpointOAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemActionsWorkflowsItemRunsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#list-workflow-runs-for-a-workflow +func (m *ItemItemActionsWorkflowsItemRunsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsWorkflowsItemRunsRequestBuilderGetQueryParameters])(ItemItemActionsWorkflowsItemRunsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsWorkflowsItemRunsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsWorkflowsItemRunsGetResponseable), nil +} +// ToGetRequestInformation list all workflow runs for a workflow. You can replace `workflow_id` with the workflow file name. For example, you could use `main.yaml`. You can use parameters to narrow the list of results. For more information about using parameters, see [Parameters](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#parameters).Anyone with read access to the repository can use this endpointOAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsWorkflowsItemRunsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsWorkflowsItemRunsRequestBuilderGetQueryParameters])(*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 *ItemItemActionsWorkflowsItemRunsRequestBuilder when successful +func (m *ItemItemActionsWorkflowsItemRunsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsWorkflowsItemRunsRequestBuilder) { + return NewItemItemActionsWorkflowsItemRunsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_workflows_request_builder.go b/pkg/github/repos/item_item_actions_workflows_request_builder.go new file mode 100644 index 00000000..1549b869 --- /dev/null +++ b/pkg/github/repos/item_item_actions_workflows_request_builder.go @@ -0,0 +1,74 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemActionsWorkflowsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\workflows +type ItemItemActionsWorkflowsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActionsWorkflowsRequestBuilderGetQueryParameters lists the workflows in a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemActionsWorkflowsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByWorkflow_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.actions.workflows.item collection +// returns a *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder when successful +func (m *ItemItemActionsWorkflowsRequestBuilder) ByWorkflow_id(workflow_id int32)(*ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["workflow_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(workflow_id), 10) + return NewItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemActionsWorkflowsRequestBuilderInternal instantiates a new ItemItemActionsWorkflowsRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsRequestBuilder) { + m := &ItemItemActionsWorkflowsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/workflows{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemActionsWorkflowsRequestBuilder instantiates a new ItemItemActionsWorkflowsRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsWorkflowsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the workflows in a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemActionsWorkflowsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflows#list-repository-workflows +func (m *ItemItemActionsWorkflowsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsWorkflowsRequestBuilderGetQueryParameters])(ItemItemActionsWorkflowsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemActionsWorkflowsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemActionsWorkflowsGetResponseable), nil +} +// ToGetRequestInformation lists the workflows in a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsWorkflowsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActionsWorkflowsRequestBuilderGetQueryParameters])(*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 *ItemItemActionsWorkflowsRequestBuilder when successful +func (m *ItemItemActionsWorkflowsRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsWorkflowsRequestBuilder) { + return NewItemItemActionsWorkflowsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_actions_workflows_with_workflow_escaped_item_request_builder.go b/pkg/github/repos/item_item_actions_workflows_with_workflow_escaped_item_request_builder.go new file mode 100644 index 00000000..e0cb8fd5 --- /dev/null +++ b/pkg/github/repos/item_item_actions_workflows_with_workflow_escaped_item_request_builder.go @@ -0,0 +1,77 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\actions\workflows\{workflow_id} +type ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilderInternal instantiates a new ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) { + m := &ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/actions/workflows/{workflow_id}", pathParameters), + } + return m +} +// NewItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder instantiates a new ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder and sets the default values. +func NewItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Disable the disable property +// returns a *ItemItemActionsWorkflowsItemDisableRequestBuilder when successful +func (m *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) Disable()(*ItemItemActionsWorkflowsItemDisableRequestBuilder) { + return NewItemItemActionsWorkflowsItemDisableRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Dispatches the dispatches property +// returns a *ItemItemActionsWorkflowsItemDispatchesRequestBuilder when successful +func (m *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) Dispatches()(*ItemItemActionsWorkflowsItemDispatchesRequestBuilder) { + return NewItemItemActionsWorkflowsItemDispatchesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Enable the enable property +// returns a *ItemItemActionsWorkflowsItemEnableRequestBuilder when successful +func (m *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) Enable()(*ItemItemActionsWorkflowsItemEnableRequestBuilder) { + return NewItemItemActionsWorkflowsItemEnableRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get gets a specific workflow. You can replace `workflow_id` with the workflowfile name. For example, you could use `main.yaml`.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a Workflowable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/workflows#get-a-workflow +func (m *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Workflowable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWorkflowFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Workflowable), nil +} +// Runs the runs property +// returns a *ItemItemActionsWorkflowsItemRunsRequestBuilder when successful +func (m *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) Runs()(*ItemItemActionsWorkflowsItemRunsRequestBuilder) { + return NewItemItemActionsWorkflowsItemRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets a specific workflow. You can replace `workflow_id` with the workflowfile name. For example, you could use `main.yaml`.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemActionsWorkflowsWithWorkflow_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder when successful +func (m *ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder) { + return NewItemItemActionsWorkflowsWithWorkflow_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_activity_request_builder.go b/pkg/github/repos/item_item_activity_request_builder.go new file mode 100644 index 00000000..13eac779 --- /dev/null +++ b/pkg/github/repos/item_item_activity_request_builder.go @@ -0,0 +1,84 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ib5124c4c5caa755c59049eeed08ed9d06377227c579c3bc3be1163b10a1d65f5 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/activity" +) + +// ItemItemActivityRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\activity +type ItemItemActivityRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemActivityRequestBuilderGetQueryParameters lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users.For more information about viewing repository activity,see "[Viewing activity and data for your repository](https://docs.github.com/enterprise-server@3.14/repositories/viewing-activity-and-data-for-your-repository)." +type ItemItemActivityRequestBuilderGetQueryParameters struct { + // The activity type to filter by.For example, you can choose to filter by "force_push", to see all force pushes to the repository. + Activity_type *ib5124c4c5caa755c59049eeed08ed9d06377227c579c3bc3be1163b10a1d65f5.GetActivity_typeQueryParameterType `uriparametername:"activity_type"` + // The GitHub username to use to filter by the actor who performed the activity. + Actor *string `uriparametername:"actor"` + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *ib5124c4c5caa755c59049eeed08ed9d06377227c579c3bc3be1163b10a1d65f5.GetDirectionQueryParameterType `uriparametername:"direction"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The Git reference for the activities you want to list.The `ref` for a branch can be formatted either as `refs/heads/BRANCH_NAME` or `BRANCH_NAME`, where `BRANCH_NAME` is the name of your branch. + Ref *string `uriparametername:"ref"` + // The time period to filter by.For example, `day` will filter for activity that occurred in the past 24 hours, and `week` will filter for activity that occurred in the past 7 days (168 hours). + Time_period *ib5124c4c5caa755c59049eeed08ed9d06377227c579c3bc3be1163b10a1d65f5.GetTime_periodQueryParameterType `uriparametername:"time_period"` +} +// NewItemItemActivityRequestBuilderInternal instantiates a new ItemItemActivityRequestBuilder and sets the default values. +func NewItemItemActivityRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActivityRequestBuilder) { + m := &ItemItemActivityRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/activity{?activity_type*,actor*,after*,before*,direction*,per_page*,ref*,time_period*}", pathParameters), + } + return m +} +// NewItemItemActivityRequestBuilder instantiates a new ItemItemActivityRequestBuilder and sets the default values. +func NewItemItemActivityRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemActivityRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemActivityRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users.For more information about viewing repository activity,see "[Viewing activity and data for your repository](https://docs.github.com/enterprise-server@3.14/repositories/viewing-activity-and-data-for-your-repository)." +// returns a []Activityable when successful +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#list-repository-activities +func (m *ItemItemActivityRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActivityRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Activityable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActivityFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Activityable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Activityable) + } + } + return val, nil +} +// ToGetRequestInformation lists a detailed history of changes to a repository, such as pushes, merges, force pushes, and branch changes, and associates these changes with commits and users.For more information about viewing repository activity,see "[Viewing activity and data for your repository](https://docs.github.com/enterprise-server@3.14/repositories/viewing-activity-and-data-for-your-repository)." +// returns a *RequestInformation when successful +func (m *ItemItemActivityRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemActivityRequestBuilderGetQueryParameters])(*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 *ItemItemActivityRequestBuilder when successful +func (m *ItemItemActivityRequestBuilder) WithUrl(rawUrl string)(*ItemItemActivityRequestBuilder) { + return NewItemItemActivityRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_assignees_request_builder.go b/pkg/github/repos/item_item_assignees_request_builder.go new file mode 100644 index 00000000..48edf06e --- /dev/null +++ b/pkg/github/repos/item_item_assignees_request_builder.go @@ -0,0 +1,83 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemAssigneesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\assignees +type ItemItemAssigneesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemAssigneesRequestBuilderGetQueryParameters lists the [available assignees](https://docs.github.com/enterprise-server@3.14/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. +type ItemItemAssigneesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByAssignee gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.assignees.item collection +// returns a *ItemItemAssigneesWithAssigneeItemRequestBuilder when successful +func (m *ItemItemAssigneesRequestBuilder) ByAssignee(assignee string)(*ItemItemAssigneesWithAssigneeItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if assignee != "" { + urlTplParams["assignee"] = assignee + } + return NewItemItemAssigneesWithAssigneeItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemAssigneesRequestBuilderInternal instantiates a new ItemItemAssigneesRequestBuilder and sets the default values. +func NewItemItemAssigneesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAssigneesRequestBuilder) { + m := &ItemItemAssigneesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/assignees{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemAssigneesRequestBuilder instantiates a new ItemItemAssigneesRequestBuilder and sets the default values. +func NewItemItemAssigneesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAssigneesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemAssigneesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the [available assignees](https://docs.github.com/enterprise-server@3.14/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. +// returns a []SimpleUserable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/assignees#list-assignees +func (m *ItemItemAssigneesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemAssigneesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists the [available assignees](https://docs.github.com/enterprise-server@3.14/articles/assigning-issues-and-pull-requests-to-other-github-users/) for issues in a repository. +// returns a *RequestInformation when successful +func (m *ItemItemAssigneesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemAssigneesRequestBuilderGetQueryParameters])(*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 *ItemItemAssigneesRequestBuilder when successful +func (m *ItemItemAssigneesRequestBuilder) WithUrl(rawUrl string)(*ItemItemAssigneesRequestBuilder) { + return NewItemItemAssigneesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_assignees_with_assignee_item_request_builder.go b/pkg/github/repos/item_item_assignees_with_assignee_item_request_builder.go new file mode 100644 index 00000000..2d5746c6 --- /dev/null +++ b/pkg/github/repos/item_item_assignees_with_assignee_item_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemAssigneesWithAssigneeItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\assignees\{assignee} +type ItemItemAssigneesWithAssigneeItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemAssigneesWithAssigneeItemRequestBuilderInternal instantiates a new ItemItemAssigneesWithAssigneeItemRequestBuilder and sets the default values. +func NewItemItemAssigneesWithAssigneeItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAssigneesWithAssigneeItemRequestBuilder) { + m := &ItemItemAssigneesWithAssigneeItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/assignees/{assignee}", pathParameters), + } + return m +} +// NewItemItemAssigneesWithAssigneeItemRequestBuilder instantiates a new ItemItemAssigneesWithAssigneeItemRequestBuilder and sets the default values. +func NewItemItemAssigneesWithAssigneeItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAssigneesWithAssigneeItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemAssigneesWithAssigneeItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get checks if a user has permission to be assigned to an issue in this repository.If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned.Otherwise a `404` status code is returned. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/assignees#check-if-a-user-can-be-assigned +func (m *ItemItemAssigneesWithAssigneeItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation checks if a user has permission to be assigned to an issue in this repository.If the `assignee` can be assigned to issues in the repository, a `204` header with no content is returned.Otherwise a `404` status code is returned. +// returns a *RequestInformation when successful +func (m *ItemItemAssigneesWithAssigneeItemRequestBuilder) 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 *ItemItemAssigneesWithAssigneeItemRequestBuilder when successful +func (m *ItemItemAssigneesWithAssigneeItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemAssigneesWithAssigneeItemRequestBuilder) { + return NewItemItemAssigneesWithAssigneeItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_autolinks_post_request_body.go b/pkg/github/repos/item_item_autolinks_post_request_body.go new file mode 100644 index 00000000..bf822bd5 --- /dev/null +++ b/pkg/github/repos/item_item_autolinks_post_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemAutolinksPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Whether this autolink reference matches alphanumeric characters. If true, the `` parameter of the `url_template` matches alphanumeric characters `A-Z` (case insensitive), `0-9`, and `-`. If false, this autolink reference only matches numeric characters. + is_alphanumeric *bool + // This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit. + key_prefix *string + // The URL must contain `` for the reference number. `` matches different characters depending on the value of `is_alphanumeric`. + url_template *string +} +// NewItemItemAutolinksPostRequestBody instantiates a new ItemItemAutolinksPostRequestBody and sets the default values. +func NewItemItemAutolinksPostRequestBody()(*ItemItemAutolinksPostRequestBody) { + m := &ItemItemAutolinksPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemAutolinksPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemAutolinksPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemAutolinksPostRequestBody(), 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 *ItemItemAutolinksPostRequestBody) 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 *ItemItemAutolinksPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["is_alphanumeric"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsAlphanumeric(val) + } + return nil + } + res["key_prefix"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetKeyPrefix(val) + } + return nil + } + res["url_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrlTemplate(val) + } + return nil + } + return res +} +// GetIsAlphanumeric gets the is_alphanumeric property value. Whether this autolink reference matches alphanumeric characters. If true, the `` parameter of the `url_template` matches alphanumeric characters `A-Z` (case insensitive), `0-9`, and `-`. If false, this autolink reference only matches numeric characters. +// returns a *bool when successful +func (m *ItemItemAutolinksPostRequestBody) GetIsAlphanumeric()(*bool) { + return m.is_alphanumeric +} +// GetKeyPrefix gets the key_prefix property value. This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit. +// returns a *string when successful +func (m *ItemItemAutolinksPostRequestBody) GetKeyPrefix()(*string) { + return m.key_prefix +} +// GetUrlTemplate gets the url_template property value. The URL must contain `` for the reference number. `` matches different characters depending on the value of `is_alphanumeric`. +// returns a *string when successful +func (m *ItemItemAutolinksPostRequestBody) GetUrlTemplate()(*string) { + return m.url_template +} +// Serialize serializes information the current object +func (m *ItemItemAutolinksPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("is_alphanumeric", m.GetIsAlphanumeric()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("key_prefix", m.GetKeyPrefix()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url_template", m.GetUrlTemplate()) + 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 *ItemItemAutolinksPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIsAlphanumeric sets the is_alphanumeric property value. Whether this autolink reference matches alphanumeric characters. If true, the `` parameter of the `url_template` matches alphanumeric characters `A-Z` (case insensitive), `0-9`, and `-`. If false, this autolink reference only matches numeric characters. +func (m *ItemItemAutolinksPostRequestBody) SetIsAlphanumeric(value *bool)() { + m.is_alphanumeric = value +} +// SetKeyPrefix sets the key_prefix property value. This prefix appended by certain characters will generate a link any time it is found in an issue, pull request, or commit. +func (m *ItemItemAutolinksPostRequestBody) SetKeyPrefix(value *string)() { + m.key_prefix = value +} +// SetUrlTemplate sets the url_template property value. The URL must contain `` for the reference number. `` matches different characters depending on the value of `is_alphanumeric`. +func (m *ItemItemAutolinksPostRequestBody) SetUrlTemplate(value *string)() { + m.url_template = value +} +type ItemItemAutolinksPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIsAlphanumeric()(*bool) + GetKeyPrefix()(*string) + GetUrlTemplate()(*string) + SetIsAlphanumeric(value *bool)() + SetKeyPrefix(value *string)() + SetUrlTemplate(value *string)() +} diff --git a/pkg/github/repos/item_item_autolinks_request_builder.go b/pkg/github/repos/item_item_autolinks_request_builder.go new file mode 100644 index 00000000..4e7298e2 --- /dev/null +++ b/pkg/github/repos/item_item_autolinks_request_builder.go @@ -0,0 +1,106 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemAutolinksRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\autolinks +type ItemItemAutolinksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByAutolink_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.autolinks.item collection +// returns a *ItemItemAutolinksWithAutolink_ItemRequestBuilder when successful +func (m *ItemItemAutolinksRequestBuilder) ByAutolink_id(autolink_id int32)(*ItemItemAutolinksWithAutolink_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["autolink_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(autolink_id), 10) + return NewItemItemAutolinksWithAutolink_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemAutolinksRequestBuilderInternal instantiates a new ItemItemAutolinksRequestBuilder and sets the default values. +func NewItemItemAutolinksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAutolinksRequestBuilder) { + m := &ItemItemAutolinksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/autolinks", pathParameters), + } + return m +} +// NewItemItemAutolinksRequestBuilder instantiates a new ItemItemAutolinksRequestBuilder and sets the default values. +func NewItemItemAutolinksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAutolinksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemAutolinksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets all autolinks that are configured for a repository.Information about autolinks are only available to repository administrators. +// returns a []Autolinkable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/autolinks#get-all-autolinks-of-a-repository +func (m *ItemItemAutolinksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Autolinkable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAutolinkFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Autolinkable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Autolinkable) + } + } + return val, nil +} +// Post users with admin access to the repository can create an autolink. +// returns a Autolinkable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/autolinks#create-an-autolink-reference-for-a-repository +func (m *ItemItemAutolinksRequestBuilder) Post(ctx context.Context, body ItemItemAutolinksPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Autolinkable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAutolinkFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Autolinkable), nil +} +// ToGetRequestInformation gets all autolinks that are configured for a repository.Information about autolinks are only available to repository administrators. +// returns a *RequestInformation when successful +func (m *ItemItemAutolinksRequestBuilder) 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 users with admin access to the repository can create an autolink. +// returns a *RequestInformation when successful +func (m *ItemItemAutolinksRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemAutolinksPostRequestBodyable, 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 *ItemItemAutolinksRequestBuilder when successful +func (m *ItemItemAutolinksRequestBuilder) WithUrl(rawUrl string)(*ItemItemAutolinksRequestBuilder) { + return NewItemItemAutolinksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_autolinks_with_autolink_escaped_item_request_builder.go b/pkg/github/repos/item_item_autolinks_with_autolink_escaped_item_request_builder.go new file mode 100644 index 00000000..4a6d250f --- /dev/null +++ b/pkg/github/repos/item_item_autolinks_with_autolink_escaped_item_request_builder.go @@ -0,0 +1,88 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemAutolinksWithAutolink_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\autolinks\{autolink_id} +type ItemItemAutolinksWithAutolink_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemAutolinksWithAutolink_ItemRequestBuilderInternal instantiates a new ItemItemAutolinksWithAutolink_ItemRequestBuilder and sets the default values. +func NewItemItemAutolinksWithAutolink_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAutolinksWithAutolink_ItemRequestBuilder) { + m := &ItemItemAutolinksWithAutolink_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/autolinks/{autolink_id}", pathParameters), + } + return m +} +// NewItemItemAutolinksWithAutolink_ItemRequestBuilder instantiates a new ItemItemAutolinksWithAutolink_ItemRequestBuilder and sets the default values. +func NewItemItemAutolinksWithAutolink_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAutolinksWithAutolink_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemAutolinksWithAutolink_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete this deletes a single autolink reference by ID that was configured for the given repository.Information about autolinks are only available to repository administrators. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/autolinks#delete-an-autolink-reference-from-a-repository +func (m *ItemItemAutolinksWithAutolink_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 { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get this returns a single autolink reference by ID that was configured for the given repository.Information about autolinks are only available to repository administrators. +// returns a Autolinkable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/autolinks#get-an-autolink-reference-of-a-repository +func (m *ItemItemAutolinksWithAutolink_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Autolinkable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAutolinkFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Autolinkable), nil +} +// ToDeleteRequestInformation this deletes a single autolink reference by ID that was configured for the given repository.Information about autolinks are only available to repository administrators. +// returns a *RequestInformation when successful +func (m *ItemItemAutolinksWithAutolink_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") + return requestInfo, nil +} +// ToGetRequestInformation this returns a single autolink reference by ID that was configured for the given repository.Information about autolinks are only available to repository administrators. +// returns a *RequestInformation when successful +func (m *ItemItemAutolinksWithAutolink_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemAutolinksWithAutolink_ItemRequestBuilder when successful +func (m *ItemItemAutolinksWithAutolink_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemAutolinksWithAutolink_ItemRequestBuilder) { + return NewItemItemAutolinksWithAutolink_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_automated_security_fixes_request_builder.go b/pkg/github/repos/item_item_automated_security_fixes_request_builder.go new file mode 100644 index 00000000..382d2a26 --- /dev/null +++ b/pkg/github/repos/item_item_automated_security_fixes_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemAutomatedSecurityFixesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\automated-security-fixes +type ItemItemAutomatedSecurityFixesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemAutomatedSecurityFixesRequestBuilderInternal instantiates a new ItemItemAutomatedSecurityFixesRequestBuilder and sets the default values. +func NewItemItemAutomatedSecurityFixesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAutomatedSecurityFixesRequestBuilder) { + m := &ItemItemAutomatedSecurityFixesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/automated-security-fixes", pathParameters), + } + return m +} +// NewItemItemAutomatedSecurityFixesRequestBuilder instantiates a new ItemItemAutomatedSecurityFixesRequestBuilder and sets the default values. +func NewItemItemAutomatedSecurityFixesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemAutomatedSecurityFixesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemAutomatedSecurityFixesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get shows whether automated security fixes are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/enterprise-server@3.14/articles/configuring-automated-security-fixes)". +// returns a CheckAutomatedSecurityFixesable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#check-if-automated-security-fixes-are-enabled-for-a-repository +func (m *ItemItemAutomatedSecurityFixesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckAutomatedSecurityFixesable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCheckAutomatedSecurityFixesFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckAutomatedSecurityFixesable), nil +} +// ToGetRequestInformation shows whether automated security fixes are enabled, disabled or paused for a repository. The authenticated user must have admin read access to the repository. For more information, see "[Configuring automated security fixes](https://docs.github.com/enterprise-server@3.14/articles/configuring-automated-security-fixes)". +// returns a *RequestInformation when successful +func (m *ItemItemAutomatedSecurityFixesRequestBuilder) 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 *ItemItemAutomatedSecurityFixesRequestBuilder when successful +func (m *ItemItemAutomatedSecurityFixesRequestBuilder) WithUrl(rawUrl string)(*ItemItemAutomatedSecurityFixesRequestBuilder) { + return NewItemItemAutomatedSecurityFixesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_branches_item_protection_enforce_escaped_admins_request_builder.go b/pkg/github/repos/item_item_branches_item_protection_enforce_escaped_admins_request_builder.go new file mode 100644 index 00000000..5fc75700 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_enforce_escaped_admins_request_builder.go @@ -0,0 +1,111 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\enforce_admins +type ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemBranchesItemProtectionEnforce_adminsRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionEnforce_adminsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) { + m := &ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/enforce_admins", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionEnforce_adminsRequestBuilder instantiates a new ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionEnforce_adminsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionEnforce_adminsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#delete-admin-branch-protection +func (m *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a ProtectedBranchAdminEnforcedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#get-admin-branch-protection +func (m *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProtectedBranchAdminEnforcedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProtectedBranchAdminEnforcedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProtectedBranchAdminEnforcedable), nil +} +// Post protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. +// returns a ProtectedBranchAdminEnforcedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#set-admin-branch-protection +func (m *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProtectedBranchAdminEnforcedable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProtectedBranchAdminEnforcedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProtectedBranchAdminEnforcedable), nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removing admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) 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 protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Adding admin enforcement requires admin or owner permissions to the repository and branch protection to be enabled. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) 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 *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) { + return NewItemItemBranchesItemProtectionEnforce_adminsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_branches_item_protection_put_request_body.go b/pkg/github/repos/item_item_branches_item_protection_put_request_body.go new file mode 100644 index 00000000..4243b0e9 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_put_request_body.go @@ -0,0 +1,370 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Allows deletion of the protected branch by anyone with write access to the repository. Set to `false` to prevent deletion of the protected branch. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://docs.github.com/enterprise-server@3.14/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation. + allow_deletions *bool + // Permits force pushes to the protected branch by anyone with write access to the repository. Set to `true` to allow force pushes. Set to `false` or `null` to block force pushes. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://docs.github.com/enterprise-server@3.14/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation." + allow_force_pushes *bool + // Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. Default: `false`. + allow_fork_syncing *bool + // If set to `true`, the `restrictions` branch protection settings which limits who can push will also block pushes which create new branches, unless the push is initiated by a user, team, or app which has the ability to push. Set to `true` to restrict new branch creation. Default: `false`. + block_creations *bool + // Enforce all configured restrictions for administrators. Set to `true` to enforce required status checks for repository administrators. Set to `null` to disable. + enforce_admins *bool + // Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. Default: `false`. + lock_branch *bool + // Requires all conversations on code to be resolved before a pull request can be merged into a branch that matches this rule. Set to `false` to disable. Default: `false`. + required_conversation_resolution *bool + // Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to `true` to enforce a linear commit history. Set to `false` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: `false`. For more information, see "[Requiring a linear commit history](https://docs.github.com/enterprise-server@3.14/github/administering-a-repository/requiring-a-linear-commit-history)" in the GitHub Help documentation. + required_linear_history *bool + // Require at least one approving review on a pull request, before merging. Set to `null` to disable. + required_pull_request_reviews ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable + // Require status checks to pass before merging. Set to `null` to disable. + required_status_checks ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable + // Restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable. + restrictions ItemItemBranchesItemProtectionPutRequestBody_restrictionsable +} +// NewItemItemBranchesItemProtectionPutRequestBody instantiates a new ItemItemBranchesItemProtectionPutRequestBody and sets the default values. +func NewItemItemBranchesItemProtectionPutRequestBody()(*ItemItemBranchesItemProtectionPutRequestBody) { + m := &ItemItemBranchesItemProtectionPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionPutRequestBody(), 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 *ItemItemBranchesItemProtectionPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowDeletions gets the allow_deletions property value. Allows deletion of the protected branch by anyone with write access to the repository. Set to `false` to prevent deletion of the protected branch. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://docs.github.com/enterprise-server@3.14/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetAllowDeletions()(*bool) { + return m.allow_deletions +} +// GetAllowForcePushes gets the allow_force_pushes property value. Permits force pushes to the protected branch by anyone with write access to the repository. Set to `true` to allow force pushes. Set to `false` or `null` to block force pushes. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://docs.github.com/enterprise-server@3.14/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation." +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetAllowForcePushes()(*bool) { + return m.allow_force_pushes +} +// GetAllowForkSyncing gets the allow_fork_syncing property value. Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. Default: `false`. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetAllowForkSyncing()(*bool) { + return m.allow_fork_syncing +} +// GetBlockCreations gets the block_creations property value. If set to `true`, the `restrictions` branch protection settings which limits who can push will also block pushes which create new branches, unless the push is initiated by a user, team, or app which has the ability to push. Set to `true` to restrict new branch creation. Default: `false`. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetBlockCreations()(*bool) { + return m.block_creations +} +// GetEnforceAdmins gets the enforce_admins property value. Enforce all configured restrictions for administrators. Set to `true` to enforce required status checks for repository administrators. Set to `null` to disable. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetEnforceAdmins()(*bool) { + return m.enforce_admins +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_deletions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowDeletions(val) + } + return nil + } + res["allow_force_pushes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForcePushes(val) + } + return nil + } + res["allow_fork_syncing"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForkSyncing(val) + } + return nil + } + res["block_creations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetBlockCreations(val) + } + return nil + } + res["enforce_admins"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetEnforceAdmins(val) + } + return nil + } + res["lock_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLockBranch(val) + } + return nil + } + res["required_conversation_resolution"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequiredConversationResolution(val) + } + return nil + } + res["required_linear_history"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetRequiredLinearHistory(val) + } + return nil + } + res["required_pull_request_reviews"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredPullRequestReviews(val.(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable)) + } + return nil + } + res["required_status_checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemBranchesItemProtectionPutRequestBody_required_status_checksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRequiredStatusChecks(val.(ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable)) + } + return nil + } + res["restrictions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemBranchesItemProtectionPutRequestBody_restrictionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetRestrictions(val.(ItemItemBranchesItemProtectionPutRequestBody_restrictionsable)) + } + return nil + } + return res +} +// GetLockBranch gets the lock_branch property value. Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. Default: `false`. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetLockBranch()(*bool) { + return m.lock_branch +} +// GetRequiredConversationResolution gets the required_conversation_resolution property value. Requires all conversations on code to be resolved before a pull request can be merged into a branch that matches this rule. Set to `false` to disable. Default: `false`. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetRequiredConversationResolution()(*bool) { + return m.required_conversation_resolution +} +// GetRequiredLinearHistory gets the required_linear_history property value. Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to `true` to enforce a linear commit history. Set to `false` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: `false`. For more information, see "[Requiring a linear commit history](https://docs.github.com/enterprise-server@3.14/github/administering-a-repository/requiring-a-linear-commit-history)" in the GitHub Help documentation. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetRequiredLinearHistory()(*bool) { + return m.required_linear_history +} +// GetRequiredPullRequestReviews gets the required_pull_request_reviews property value. Require at least one approving review on a pull request, before merging. Set to `null` to disable. +// returns a ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetRequiredPullRequestReviews()(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable) { + return m.required_pull_request_reviews +} +// GetRequiredStatusChecks gets the required_status_checks property value. Require status checks to pass before merging. Set to `null` to disable. +// returns a ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetRequiredStatusChecks()(ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable) { + return m.required_status_checks +} +// GetRestrictions gets the restrictions property value. Restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable. +// returns a ItemItemBranchesItemProtectionPutRequestBody_restrictionsable when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody) GetRestrictions()(ItemItemBranchesItemProtectionPutRequestBody_restrictionsable) { + return m.restrictions +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_deletions", m.GetAllowDeletions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_force_pushes", m.GetAllowForcePushes()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_fork_syncing", m.GetAllowForkSyncing()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("block_creations", m.GetBlockCreations()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("enforce_admins", m.GetEnforceAdmins()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("lock_branch", m.GetLockBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("required_conversation_resolution", m.GetRequiredConversationResolution()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("required_linear_history", m.GetRequiredLinearHistory()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_pull_request_reviews", m.GetRequiredPullRequestReviews()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("required_status_checks", m.GetRequiredStatusChecks()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("restrictions", m.GetRestrictions()) + 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 *ItemItemBranchesItemProtectionPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowDeletions sets the allow_deletions property value. Allows deletion of the protected branch by anyone with write access to the repository. Set to `false` to prevent deletion of the protected branch. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://docs.github.com/enterprise-server@3.14/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetAllowDeletions(value *bool)() { + m.allow_deletions = value +} +// SetAllowForcePushes sets the allow_force_pushes property value. Permits force pushes to the protected branch by anyone with write access to the repository. Set to `true` to allow force pushes. Set to `false` or `null` to block force pushes. Default: `false`. For more information, see "[Enabling force pushes to a protected branch](https://docs.github.com/enterprise-server@3.14/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)" in the GitHub Help documentation." +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetAllowForcePushes(value *bool)() { + m.allow_force_pushes = value +} +// SetAllowForkSyncing sets the allow_fork_syncing property value. Whether users can pull changes from upstream when the branch is locked. Set to `true` to allow fork syncing. Set to `false` to prevent fork syncing. Default: `false`. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetAllowForkSyncing(value *bool)() { + m.allow_fork_syncing = value +} +// SetBlockCreations sets the block_creations property value. If set to `true`, the `restrictions` branch protection settings which limits who can push will also block pushes which create new branches, unless the push is initiated by a user, team, or app which has the ability to push. Set to `true` to restrict new branch creation. Default: `false`. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetBlockCreations(value *bool)() { + m.block_creations = value +} +// SetEnforceAdmins sets the enforce_admins property value. Enforce all configured restrictions for administrators. Set to `true` to enforce required status checks for repository administrators. Set to `null` to disable. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetEnforceAdmins(value *bool)() { + m.enforce_admins = value +} +// SetLockBranch sets the lock_branch property value. Whether to set the branch as read-only. If this is true, users will not be able to push to the branch. Default: `false`. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetLockBranch(value *bool)() { + m.lock_branch = value +} +// SetRequiredConversationResolution sets the required_conversation_resolution property value. Requires all conversations on code to be resolved before a pull request can be merged into a branch that matches this rule. Set to `false` to disable. Default: `false`. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetRequiredConversationResolution(value *bool)() { + m.required_conversation_resolution = value +} +// SetRequiredLinearHistory sets the required_linear_history property value. Enforces a linear commit Git history, which prevents anyone from pushing merge commits to a branch. Set to `true` to enforce a linear commit history. Set to `false` to disable a linear commit Git history. Your repository must allow squash merging or rebase merging before you can enable a linear commit history. Default: `false`. For more information, see "[Requiring a linear commit history](https://docs.github.com/enterprise-server@3.14/github/administering-a-repository/requiring-a-linear-commit-history)" in the GitHub Help documentation. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetRequiredLinearHistory(value *bool)() { + m.required_linear_history = value +} +// SetRequiredPullRequestReviews sets the required_pull_request_reviews property value. Require at least one approving review on a pull request, before merging. Set to `null` to disable. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetRequiredPullRequestReviews(value ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable)() { + m.required_pull_request_reviews = value +} +// SetRequiredStatusChecks sets the required_status_checks property value. Require status checks to pass before merging. Set to `null` to disable. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetRequiredStatusChecks(value ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable)() { + m.required_status_checks = value +} +// SetRestrictions sets the restrictions property value. Restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable. +func (m *ItemItemBranchesItemProtectionPutRequestBody) SetRestrictions(value ItemItemBranchesItemProtectionPutRequestBody_restrictionsable)() { + m.restrictions = value +} +type ItemItemBranchesItemProtectionPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowDeletions()(*bool) + GetAllowForcePushes()(*bool) + GetAllowForkSyncing()(*bool) + GetBlockCreations()(*bool) + GetEnforceAdmins()(*bool) + GetLockBranch()(*bool) + GetRequiredConversationResolution()(*bool) + GetRequiredLinearHistory()(*bool) + GetRequiredPullRequestReviews()(ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable) + GetRequiredStatusChecks()(ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable) + GetRestrictions()(ItemItemBranchesItemProtectionPutRequestBody_restrictionsable) + SetAllowDeletions(value *bool)() + SetAllowForcePushes(value *bool)() + SetAllowForkSyncing(value *bool)() + SetBlockCreations(value *bool)() + SetEnforceAdmins(value *bool)() + SetLockBranch(value *bool)() + SetRequiredConversationResolution(value *bool)() + SetRequiredLinearHistory(value *bool)() + SetRequiredPullRequestReviews(value ItemItemBranchesItemProtectionPutRequestBody_required_pull_request_reviewsable)() + SetRequiredStatusChecks(value ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable)() + SetRestrictions(value ItemItemBranchesItemProtectionPutRequestBody_restrictionsable)() +} diff --git a/pkg/github/repos/item_item_branches_item_protection_put_request_body_escaped_required_escaped_status_escaped_checks.go b/pkg/github/repos/item_item_branches_item_protection_put_request_body_escaped_required_escaped_status_escaped_checks.go new file mode 100644 index 00000000..9fd190f6 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_put_request_body_escaped_required_escaped_status_escaped_checks.go @@ -0,0 +1,160 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemBranchesItemProtectionPutRequestBody_required_status_checks require status checks to pass before merging. Set to `null` to disable. +type ItemItemBranchesItemProtectionPutRequestBody_required_status_checks 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 list of status checks to require in order to merge into this branch. + checks []ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable + // **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. + // Deprecated: + contexts []string + // Require branches to be up to date before merging. + strict *bool +} +// NewItemItemBranchesItemProtectionPutRequestBody_required_status_checks instantiates a new ItemItemBranchesItemProtectionPutRequestBody_required_status_checks and sets the default values. +func NewItemItemBranchesItemProtectionPutRequestBody_required_status_checks()(*ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) { + m := &ItemItemBranchesItemProtectionPutRequestBody_required_status_checks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionPutRequestBody_required_status_checksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionPutRequestBody_required_status_checksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionPutRequestBody_required_status_checks(), 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 *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChecks gets the checks property value. The list of status checks to require in order to merge into this branch. +// returns a []ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) GetChecks()([]ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable) { + return m.checks +} +// GetContexts gets the contexts property value. **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. +// Deprecated: +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) GetContexts()([]string) { + return m.contexts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable) + } + } + m.SetChecks(res) + } + return nil + } + res["contexts"] = 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.SetContexts(res) + } + return nil + } + res["strict"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetStrict(val) + } + return nil + } + return res +} +// GetStrict gets the strict property value. Require branches to be up to date before merging. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) GetStrict()(*bool) { + return m.strict +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetChecks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetChecks())) + for i, v := range m.GetChecks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("checks", cast) + if err != nil { + return err + } + } + if m.GetContexts() != nil { + err := writer.WriteCollectionOfStringValues("contexts", m.GetContexts()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("strict", m.GetStrict()) + 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 *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChecks sets the checks property value. The list of status checks to require in order to merge into this branch. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) SetChecks(value []ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable)() { + m.checks = value +} +// SetContexts sets the contexts property value. **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. +// Deprecated: +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) SetContexts(value []string)() { + m.contexts = value +} +// SetStrict sets the strict property value. Require branches to be up to date before merging. +func (m *ItemItemBranchesItemProtectionPutRequestBody_required_status_checks) SetStrict(value *bool)() { + m.strict = value +} +type ItemItemBranchesItemProtectionPutRequestBody_required_status_checksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChecks()([]ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable) + GetContexts()([]string) + GetStrict()(*bool) + SetChecks(value []ItemItemBranchesItemProtectionPutRequestBody_required_status_checks_checksable)() + SetContexts(value []string)() + SetStrict(value *bool)() +} diff --git a/pkg/github/repos/item_item_branches_item_protection_put_request_body_escaped_restrictions.go b/pkg/github/repos/item_item_branches_item_protection_put_request_body_escaped_restrictions.go new file mode 100644 index 00000000..04b9e937 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_put_request_body_escaped_restrictions.go @@ -0,0 +1,157 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemBranchesItemProtectionPutRequestBody_restrictions restrict who can push to the protected branch. User, app, and team `restrictions` are only available for organization-owned repositories. Set to `null` to disable. +type ItemItemBranchesItemProtectionPutRequestBody_restrictions 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 list of app `slug`s with push access + apps []string + // The list of team `slug`s with push access + teams []string + // The list of user `login`s with push access + users []string +} +// NewItemItemBranchesItemProtectionPutRequestBody_restrictions instantiates a new ItemItemBranchesItemProtectionPutRequestBody_restrictions and sets the default values. +func NewItemItemBranchesItemProtectionPutRequestBody_restrictions()(*ItemItemBranchesItemProtectionPutRequestBody_restrictions) { + m := &ItemItemBranchesItemProtectionPutRequestBody_restrictions{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionPutRequestBody_restrictionsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionPutRequestBody_restrictionsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionPutRequestBody_restrictions(), 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 *ItemItemBranchesItemProtectionPutRequestBody_restrictions) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The list of app `slug`s with push access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = 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.SetApps(res) + } + return nil + } + res["teams"] = 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.SetTeams(res) + } + return nil + } + res["users"] = 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.SetUsers(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The list of team `slug`s with push access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) GetTeams()([]string) { + return m.teams +} +// GetUsers gets the users property value. The list of user `login`s with push access +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + if err != nil { + return err + } + } + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + if err != nil { + return err + } + } + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionPutRequestBody_restrictions) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The list of app `slug`s with push access +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) SetApps(value []string)() { + m.apps = value +} +// SetTeams sets the teams property value. The list of team `slug`s with push access +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) SetTeams(value []string)() { + m.teams = value +} +// SetUsers sets the users property value. The list of user `login`s with push access +func (m *ItemItemBranchesItemProtectionPutRequestBody_restrictions) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionPutRequestBody_restrictionsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + GetTeams()([]string) + GetUsers()([]string) + SetApps(value []string)() + SetTeams(value []string)() + SetUsers(value []string)() +} diff --git a/pkg/github/repos/item_item_branches_item_protection_request_builder.go b/pkg/github/repos/item_item_branches_item_protection_request_builder.go new file mode 100644 index 00000000..b6e0589b --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_request_builder.go @@ -0,0 +1,152 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection +type ItemItemBranchesItemProtectionRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemBranchesItemProtectionRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequestBuilder) { + m := &ItemItemBranchesItemProtectionRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRequestBuilder instantiates a new ItemItemBranchesItemProtectionRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#delete-branch-protection +func (m *ItemItemBranchesItemProtectionRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Enforce_admins the enforce_admins property +// returns a *ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) Enforce_admins()(*ItemItemBranchesItemProtectionEnforce_adminsRequestBuilder) { + return NewItemItemBranchesItemProtectionEnforce_adminsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a BranchProtectionable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#get-branch-protection +func (m *ItemItemBranchesItemProtectionRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BranchProtectionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBranchProtectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BranchProtectionable), nil +} +// Put protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Protecting a branch requires admin or owner permissions to the repository.> [!NOTE]> Passing new arrays of `users` and `teams` replaces their previous values.> [!NOTE]> The list of users, apps, and teams in total is limited to 100 items. +// returns a ProtectedBranchable 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 ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#update-branch-protection +func (m *ItemItemBranchesItemProtectionRequestBuilder) Put(ctx context.Context, body ItemItemBranchesItemProtectionPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProtectedBranchable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProtectedBranchFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProtectedBranchable), nil +} +// Required_pull_request_reviews the required_pull_request_reviews property +// returns a *ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) Required_pull_request_reviews()(*ItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_pull_request_reviewsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Required_signatures the required_signatures property +// returns a *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) Required_signatures()(*ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_signaturesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Required_status_checks the required_status_checks property +// returns a *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) Required_status_checks()(*ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_status_checksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Restrictions the restrictions property +// returns a *ItemItemBranchesItemProtectionRestrictionsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) Restrictions()(*ItemItemBranchesItemProtectionRestrictionsRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) 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 +} +// ToPutRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Protecting a branch requires admin or owner permissions to the repository.> [!NOTE]> Passing new arrays of `users` and `teams` replaces their previous values.> [!NOTE]> The list of users, apps, and teams in total is limited to 100 items. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemBranchesItemProtectionPutRequestBodyable, 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 *ItemItemBranchesItemProtectionRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRequestBuilder) { + return NewItemItemBranchesItemProtectionRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_branches_item_protection_required_escaped_signatures_request_builder.go b/pkg/github/repos/item_item_branches_item_protection_required_escaped_signatures_request_builder.go new file mode 100644 index 00000000..36fd9729 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_required_escaped_signatures_request_builder.go @@ -0,0 +1,119 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\required_signatures +type ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemBranchesItemProtectionRequired_signaturesRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_signaturesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) { + m := &ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/required_signatures", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRequired_signaturesRequestBuilder instantiates a new ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_signaturesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRequired_signaturesRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#delete-commit-signature-protection +func (m *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://docs.github.com/enterprise-server@3.14/articles/signing-commits-with-gpg) in GitHub Help.> [!NOTE]> You must enable branch protection to require signed commits. +// returns a ProtectedBranchAdminEnforcedable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#get-commit-signature-protection +func (m *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProtectedBranchAdminEnforcedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProtectedBranchAdminEnforcedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProtectedBranchAdminEnforcedable), nil +} +// Post protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. +// returns a ProtectedBranchAdminEnforcedable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#create-commit-signature-protection +func (m *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProtectedBranchAdminEnforcedable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProtectedBranchAdminEnforcedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ProtectedBranchAdminEnforcedable), nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.When authenticated with admin or owner permissions to the repository, you can use this endpoint to disable required signed commits on a branch. You must enable branch protection to require signed commits. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.When authenticated with admin or owner permissions to the repository, you can use this endpoint to check whether a branch requires signed commits. An enabled status of `true` indicates you must sign commits on this branch. For more information, see [Signing commits with GPG](https://docs.github.com/enterprise-server@3.14/articles/signing-commits-with-gpg) in GitHub Help.> [!NOTE]> You must enable branch protection to require signed commits. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) 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 protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.When authenticated with admin or owner permissions to the repository, you can use this endpoint to require signed commits on a branch. You must enable branch protection to require signed commits. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) 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 *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRequired_signaturesRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_signaturesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_branches_item_protection_required_escaped_status_escaped_checks_contexts_request_builder.go b/pkg/github/repos/item_item_branches_item_protection_required_escaped_status_escaped_checks_contexts_request_builder.go new file mode 100644 index 00000000..b3148cc3 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_required_escaped_status_escaped_checks_contexts_request_builder.go @@ -0,0 +1,577 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\required_status_checks\contexts +type ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ContextsDeleteRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able, string +type ContextsDeleteRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able + contextsDeleteRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able + // Composed type representation for type string + contextsDeleteRequestBodyString *string + // Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able + itemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able + // Composed type representation for type string + string *string +} +// NewContextsDeleteRequestBody instantiates a new ContextsDeleteRequestBody and sets the default values. +func NewContextsDeleteRequestBody()(*ContextsDeleteRequestBody) { + m := &ContextsDeleteRequestBody{ + } + return m +} +// CreateContextsDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContextsDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewContextsDeleteRequestBody() + 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.SetContextsDeleteRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able when successful +func (m *ContextsDeleteRequestBody) GetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able) { + return m.contextsDeleteRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 +} +// GetContextsDeleteRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ContextsDeleteRequestBody) GetContextsDeleteRequestBodyString()(*string) { + return m.contextsDeleteRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContextsDeleteRequestBody) 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 *ContextsDeleteRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able when successful +func (m *ContextsDeleteRequestBody) GetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ContextsDeleteRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ContextsDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetContextsDeleteRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetContextsDeleteRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able +func (m *ContextsDeleteRequestBody) SetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able)() { + m.contextsDeleteRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 = value +} +// SetContextsDeleteRequestBodyString sets the string property value. Composed type representation for type string +func (m *ContextsDeleteRequestBody) SetContextsDeleteRequestBodyString(value *string)() { + m.contextsDeleteRequestBodyString = value +} +// SetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able +func (m *ContextsDeleteRequestBody) SetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ContextsDeleteRequestBody) SetString(value *string)() { + m.string = value +} +// ContextsPostRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able, string +type ContextsPostRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able + contextsPostRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able + // Composed type representation for type string + contextsPostRequestBodyString *string + // Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able + itemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able + // Composed type representation for type string + string *string +} +// NewContextsPostRequestBody instantiates a new ContextsPostRequestBody and sets the default values. +func NewContextsPostRequestBody()(*ContextsPostRequestBody) { + m := &ContextsPostRequestBody{ + } + return m +} +// CreateContextsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContextsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewContextsPostRequestBody() + 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.SetContextsPostRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able when successful +func (m *ContextsPostRequestBody) GetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able) { + return m.contextsPostRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 +} +// GetContextsPostRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ContextsPostRequestBody) GetContextsPostRequestBodyString()(*string) { + return m.contextsPostRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContextsPostRequestBody) 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 *ContextsPostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able when successful +func (m *ContextsPostRequestBody) GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ContextsPostRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ContextsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetContextsPostRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetContextsPostRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able +func (m *ContextsPostRequestBody) SetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able)() { + m.contextsPostRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 = value +} +// SetContextsPostRequestBodyString sets the string property value. Composed type representation for type string +func (m *ContextsPostRequestBody) SetContextsPostRequestBodyString(value *string)() { + m.contextsPostRequestBodyString = value +} +// SetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able +func (m *ContextsPostRequestBody) SetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ContextsPostRequestBody) SetString(value *string)() { + m.string = value +} +// ContextsPutRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able, string +type ContextsPutRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able + contextsPutRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able + // Composed type representation for type string + contextsPutRequestBodyString *string + // Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able + itemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able + // Composed type representation for type string + string *string +} +// NewContextsPutRequestBody instantiates a new ContextsPutRequestBody and sets the default values. +func NewContextsPutRequestBody()(*ContextsPutRequestBody) { + m := &ContextsPutRequestBody{ + } + return m +} +// CreateContextsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateContextsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewContextsPutRequestBody() + 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.SetContextsPutRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able when successful +func (m *ContextsPutRequestBody) GetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able) { + return m.contextsPutRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 +} +// GetContextsPutRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ContextsPutRequestBody) GetContextsPutRequestBodyString()(*string) { + return m.contextsPutRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ContextsPutRequestBody) 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 *ContextsPutRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able when successful +func (m *ContextsPutRequestBody) GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ContextsPutRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ContextsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetContextsPutRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetContextsPutRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able +func (m *ContextsPutRequestBody) SetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able)() { + m.contextsPutRequestBodyItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 = value +} +// SetContextsPutRequestBodyString sets the string property value. Composed type representation for type string +func (m *ContextsPutRequestBody) SetContextsPutRequestBodyString(value *string)() { + m.contextsPutRequestBodyString = value +} +// SetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able +func (m *ContextsPutRequestBody) SetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ContextsPutRequestBody) SetString(value *string)() { + m.string = value +} +type ContextsDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able) + GetContextsDeleteRequestBodyString()(*string) + GetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able) + GetString()(*string) + SetContextsDeleteRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able)() + SetContextsDeleteRequestBodyString(value *string)() + SetItemItemBranchesItemProtectionRequiredStatusChecksContextsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsDeleteRequestBodyMember1able)() + SetString(value *string)() +} +type ContextsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able) + GetContextsPostRequestBodyString()(*string) + GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able) + GetString()(*string) + SetContextsPostRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able)() + SetContextsPostRequestBodyString(value *string)() + SetItemItemBranchesItemProtectionRequiredStatusChecksContextsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPostRequestBodyMember1able)() + SetString(value *string)() +} +type ContextsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able) + GetContextsPutRequestBodyString()(*string) + GetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able) + GetString()(*string) + SetContextsPutRequestBodyItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able)() + SetContextsPutRequestBodyString(value *string)() + SetItemItemBranchesItemProtectionRequiredStatusChecksContextsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRequired_status_checksContextsPutRequestBodyMember1able)() + SetString(value *string)() +} +// NewItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) { + m := &ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/required_status_checks/contexts", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder instantiates a new ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a []string 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/enterprise-server@3.14/rest/branches/branch-protection#remove-status-check-contexts +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) Delete(ctx context.Context, body ContextsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]string, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitiveCollection(ctx, requestInfo, "string", errorMapping) + if err != nil { + return nil, err + } + val := make([]string, len(res)) + for i, v := range res { + if v != nil { + val[i] = *(v.(*string)) + } + } + return val, nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a []string when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#get-all-status-check-contexts +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]string, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitiveCollection(ctx, requestInfo, "string", errorMapping) + if err != nil { + return nil, err + } + val := make([]string, len(res)) + for i, v := range res { + if v != nil { + val[i] = *(v.(*string)) + } + } + return val, nil +} +// Post protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a []string 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#add-status-check-contexts +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) Post(ctx context.Context, body ContextsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]string, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitiveCollection(ctx, requestInfo, "string", errorMapping) + if err != nil { + return nil, err + } + val := make([]string, len(res)) + for i, v := range res { + if v != nil { + val[i] = *(v.(*string)) + } + } + return val, nil +} +// Put protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a []string 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/enterprise-server@3.14/rest/branches/branch-protection#set-status-check-contexts +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) Put(ctx context.Context, body ContextsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]string, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitiveCollection(ctx, requestInfo, "string", errorMapping) + if err != nil { + return nil, err + } + val := make([]string, len(res)) + for i, v := range res { + if v != nil { + val[i] = *(v.(*string)) + } + } + return val, nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ContextsDeleteRequestBodyable, 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") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) 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 protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ContextsPostRequestBodyable, 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 +} +// ToPutRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ContextsPutRequestBodyable, 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 *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_branches_item_protection_required_escaped_status_escaped_checks_patch_request_body.go b/pkg/github/repos/item_item_branches_item_protection_required_escaped_status_escaped_checks_patch_request_body.go new file mode 100644 index 00000000..8e17ff98 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_required_escaped_status_escaped_checks_patch_request_body.go @@ -0,0 +1,159 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody 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 list of status checks to require in order to merge into this branch. + checks []ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable + // **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. + // Deprecated: + contexts []string + // Require branches to be up to date before merging. + strict *bool +} +// NewItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody instantiates a new ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody()(*ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) { + m := &ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRequired_status_checksPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRequired_status_checksPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody(), 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 *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetChecks gets the checks property value. The list of status checks to require in order to merge into this branch. +// returns a []ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) GetChecks()([]ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable) { + return m.checks +} +// GetContexts gets the contexts property value. **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. +// Deprecated: +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) GetContexts()([]string) { + return m.contexts +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable) + } + } + m.SetChecks(res) + } + return nil + } + res["contexts"] = 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.SetContexts(res) + } + return nil + } + res["strict"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetStrict(val) + } + return nil + } + return res +} +// GetStrict gets the strict property value. Require branches to be up to date before merging. +// returns a *bool when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) GetStrict()(*bool) { + return m.strict +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetChecks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetChecks())) + for i, v := range m.GetChecks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("checks", cast) + if err != nil { + return err + } + } + if m.GetContexts() != nil { + err := writer.WriteCollectionOfStringValues("contexts", m.GetContexts()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("strict", m.GetStrict()) + 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 *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetChecks sets the checks property value. The list of status checks to require in order to merge into this branch. +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) SetChecks(value []ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable)() { + m.checks = value +} +// SetContexts sets the contexts property value. **Deprecated**: The list of status checks to require in order to merge into this branch. If any of these checks have recently been set by a particular GitHub App, they will be required to come from that app in future for the branch to merge. Use `checks` instead of `contexts` for more fine-grained control. +// Deprecated: +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) SetContexts(value []string)() { + m.contexts = value +} +// SetStrict sets the strict property value. Require branches to be up to date before merging. +func (m *ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody) SetStrict(value *bool)() { + m.strict = value +} +type ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetChecks()([]ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable) + GetContexts()([]string) + GetStrict()(*bool) + SetChecks(value []ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBody_checksable)() + SetContexts(value []string)() + SetStrict(value *bool)() +} diff --git a/pkg/github/repos/item_item_branches_item_protection_required_escaped_status_escaped_checks_request_builder.go b/pkg/github/repos/item_item_branches_item_protection_required_escaped_status_escaped_checks_request_builder.go new file mode 100644 index 00000000..aa1d48df --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_required_escaped_status_escaped_checks_request_builder.go @@ -0,0 +1,125 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\required_status_checks +type ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemBranchesItemProtectionRequired_status_checksRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) { + m := &ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/required_status_checks", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRequired_status_checksRequestBuilder instantiates a new ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRequired_status_checksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRequired_status_checksRequestBuilderInternal(urlParams, requestAdapter) +} +// Contexts the contexts property +// returns a *ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) Contexts()(*ItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_status_checksContextsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#remove-status-check-protection +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a StatusCheckPolicyable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#get-status-checks-protection +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.StatusCheckPolicyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateStatusCheckPolicyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.StatusCheckPolicyable), nil +} +// Patch protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. +// returns a StatusCheckPolicyable 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/enterprise-server@3.14/rest/branches/branch-protection#update-status-check-protection +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) Patch(ctx context.Context, body ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.StatusCheckPolicyable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateStatusCheckPolicyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.StatusCheckPolicyable), nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) 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 +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) 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 protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Updating required status checks requires admin or owner permissions to the repository and branch protection to be enabled. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemBranchesItemProtectionRequired_status_checksPatchRequestBodyable, 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 *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRequired_status_checksRequestBuilder) { + return NewItemItemBranchesItemProtectionRequired_status_checksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_delete_request_body_member1.go b/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_delete_request_body_member1.go new file mode 100644 index 00000000..5ce1f77b --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_delete_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 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 GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. + apps []string +} +// NewItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = 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.SetApps(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + 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 *ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. +func (m *ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1) SetApps(value []string)() { + m.apps = value +} +type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + SetApps(value []string)() +} diff --git a/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_post_request_body_member1.go b/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_post_request_body_member1.go new file mode 100644 index 00000000..a099409b --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_post_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 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 GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. + apps []string +} +// NewItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = 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.SetApps(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + 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 *ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1) SetApps(value []string)() { + m.apps = value +} +type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + SetApps(value []string)() +} diff --git a/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_put_request_body_member1.go b/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_put_request_body_member1.go new file mode 100644 index 00000000..0e1ebc43 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_put_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 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 GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. + apps []string +} +// NewItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetApps gets the apps property value. The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1) GetApps()([]string) { + return m.apps +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["apps"] = 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.SetApps(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetApps() != nil { + err := writer.WriteCollectionOfStringValues("apps", m.GetApps()) + 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 *ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetApps sets the apps property value. The GitHub Apps that have push access to this branch. Use the slugified version of the app name. **Note**: The list of users, apps, and teams in total is limited to 100 items. +func (m *ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1) SetApps(value []string)() { + m.apps = value +} +type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetApps()([]string) + SetApps(value []string)() +} diff --git a/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_request_builder.go b/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_request_builder.go new file mode 100644 index 00000000..49e6325e --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_restrictions_apps_request_builder.go @@ -0,0 +1,569 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\restrictions\apps +type ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// AppsDeleteRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able, string +type AppsDeleteRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able + appsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able + // Composed type representation for type string + appsDeleteRequestBodyString *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able + // Composed type representation for type string + string *string +} +// NewAppsDeleteRequestBody instantiates a new AppsDeleteRequestBody and sets the default values. +func NewAppsDeleteRequestBody()(*AppsDeleteRequestBody) { + m := &AppsDeleteRequestBody{ + } + return m +} +// CreateAppsDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAppsDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewAppsDeleteRequestBody() + 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.SetAppsDeleteRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able when successful +func (m *AppsDeleteRequestBody) GetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able) { + return m.appsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 +} +// GetAppsDeleteRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *AppsDeleteRequestBody) GetAppsDeleteRequestBodyString()(*string) { + return m.appsDeleteRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AppsDeleteRequestBody) 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 *AppsDeleteRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able when successful +func (m *AppsDeleteRequestBody) GetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *AppsDeleteRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *AppsDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetAppsDeleteRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetAppsDeleteRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able +func (m *AppsDeleteRequestBody) SetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able)() { + m.appsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 = value +} +// SetAppsDeleteRequestBodyString sets the string property value. Composed type representation for type string +func (m *AppsDeleteRequestBody) SetAppsDeleteRequestBodyString(value *string)() { + m.appsDeleteRequestBodyString = value +} +// SetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able +func (m *AppsDeleteRequestBody) SetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *AppsDeleteRequestBody) SetString(value *string)() { + m.string = value +} +// AppsPostRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able, string +type AppsPostRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able + appsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able + // Composed type representation for type string + appsPostRequestBodyString *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able + // Composed type representation for type string + string *string +} +// NewAppsPostRequestBody instantiates a new AppsPostRequestBody and sets the default values. +func NewAppsPostRequestBody()(*AppsPostRequestBody) { + m := &AppsPostRequestBody{ + } + return m +} +// CreateAppsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAppsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewAppsPostRequestBody() + 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.SetAppsPostRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able when successful +func (m *AppsPostRequestBody) GetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able) { + return m.appsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 +} +// GetAppsPostRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *AppsPostRequestBody) GetAppsPostRequestBodyString()(*string) { + return m.appsPostRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AppsPostRequestBody) 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 *AppsPostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able when successful +func (m *AppsPostRequestBody) GetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *AppsPostRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *AppsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetAppsPostRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetAppsPostRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able +func (m *AppsPostRequestBody) SetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able)() { + m.appsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 = value +} +// SetAppsPostRequestBodyString sets the string property value. Composed type representation for type string +func (m *AppsPostRequestBody) SetAppsPostRequestBodyString(value *string)() { + m.appsPostRequestBodyString = value +} +// SetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able +func (m *AppsPostRequestBody) SetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *AppsPostRequestBody) SetString(value *string)() { + m.string = value +} +// AppsPutRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able, string +type AppsPutRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able + appsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able + // Composed type representation for type string + appsPutRequestBodyString *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able + // Composed type representation for type string + string *string +} +// NewAppsPutRequestBody instantiates a new AppsPutRequestBody and sets the default values. +func NewAppsPutRequestBody()(*AppsPutRequestBody) { + m := &AppsPutRequestBody{ + } + return m +} +// CreateAppsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateAppsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewAppsPutRequestBody() + 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.SetAppsPutRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able when successful +func (m *AppsPutRequestBody) GetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able) { + return m.appsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 +} +// GetAppsPutRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *AppsPutRequestBody) GetAppsPutRequestBodyString()(*string) { + return m.appsPutRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *AppsPutRequestBody) 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 *AppsPutRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able when successful +func (m *AppsPutRequestBody) GetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *AppsPutRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *AppsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetAppsPutRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetAppsPutRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able +func (m *AppsPutRequestBody) SetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able)() { + m.appsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 = value +} +// SetAppsPutRequestBodyString sets the string property value. Composed type representation for type string +func (m *AppsPutRequestBody) SetAppsPutRequestBodyString(value *string)() { + m.appsPutRequestBodyString = value +} +// SetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able +func (m *AppsPutRequestBody) SetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *AppsPutRequestBody) SetString(value *string)() { + m.string = value +} +type AppsDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able) + GetAppsDeleteRequestBodyString()(*string) + GetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able) + GetString()(*string) + SetAppsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able)() + SetAppsDeleteRequestBodyString(value *string)() + SetItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsDeleteRequestBodyMember1able)() + SetString(value *string)() +} +type AppsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able) + GetAppsPostRequestBodyString()(*string) + GetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able) + GetString()(*string) + SetAppsPostRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able)() + SetAppsPostRequestBodyString(value *string)() + SetItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPostRequestBodyMember1able)() + SetString(value *string)() +} +type AppsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able) + GetAppsPutRequestBodyString()(*string) + GetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able) + GetString()(*string) + SetAppsPutRequestBodyItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able)() + SetAppsPutRequestBodyString(value *string)() + SetItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsAppsPutRequestBodyMember1able)() + SetString(value *string)() +} +// NewItemItemBranchesItemProtectionRestrictionsAppsRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsAppsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) { + m := &ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/restrictions/apps", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder instantiates a new ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRestrictionsAppsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removes the ability of an app to push to this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a []Integrationable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#remove-app-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) Delete(ctx context.Context, body AppsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIntegrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable) + } + } + return val, nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists the GitHub Apps that have push access to this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a []Integrationable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#get-apps-with-access-to-the-protected-branch +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIntegrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable) + } + } + return val, nil +} +// Post protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Grants the specified apps push access for this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a []Integrationable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#add-app-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) Post(ctx context.Context, body AppsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIntegrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable) + } + } + return val, nil +} +// Put protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a []Integrationable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#set-app-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) Put(ctx context.Context, body AppsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIntegrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Integrationable) + } + } + return val, nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removes the ability of an app to push to this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body AppsDeleteRequestBodyable, 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") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists the GitHub Apps that have push access to this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) 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 protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Grants the specified apps push access for this branch. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) ToPostRequestInformation(ctx context.Context, body AppsPostRequestBodyable, 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 +} +// ToPutRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Replaces the list of apps that have push access to this branch. This removes all apps that previously had push access and grants push access to the new list of apps. Only GitHub Apps that are installed on the repository and that have been granted write access to the repository contents can be added as authorized actors on a protected branch. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) ToPutRequestInformation(ctx context.Context, body AppsPutRequestBodyable, 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 *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_branches_item_protection_restrictions_request_builder.go b/pkg/github/repos/item_item_branches_item_protection_restrictions_request_builder.go new file mode 100644 index 00000000..83cb43a0 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_restrictions_request_builder.go @@ -0,0 +1,98 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRestrictionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\restrictions +type ItemItemBranchesItemProtectionRestrictionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Apps the apps property +// returns a *ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) Apps()(*ItemItemBranchesItemProtectionRestrictionsAppsRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsAppsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemBranchesItemProtectionRestrictionsRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRestrictionsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsRequestBuilder) { + m := &ItemItemBranchesItemProtectionRestrictionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/restrictions", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRestrictionsRequestBuilder instantiates a new ItemItemBranchesItemProtectionRestrictionsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRestrictionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Disables the ability to restrict who can push to this branch. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#delete-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists who has access to this protected branch.> [!NOTE]> Users, apps, and teams `restrictions` are only available for organization-owned repositories. +// returns a BranchRestrictionPolicyable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#get-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BranchRestrictionPolicyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBranchRestrictionPolicyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BranchRestrictionPolicyable), nil +} +// Teams the teams property +// returns a *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) Teams()(*ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Disables the ability to restrict who can push to this branch. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) 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 +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists who has access to this protected branch.> [!NOTE]> Users, apps, and teams `restrictions` are only available for organization-owned repositories. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) 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 +} +// Users the users property +// returns a *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) Users()(*ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsUsersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemBranchesItemProtectionRestrictionsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRestrictionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRestrictionsRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_delete_request_body_member1.go b/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_delete_request_body_member1.go new file mode 100644 index 00000000..a507a82d --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_delete_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 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 slug values for teams + teams []string +} +// NewItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1) 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 *ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["teams"] = 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.SetTeams(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The slug values for teams +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1) GetTeams()([]string) { + return m.teams +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + 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 *ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTeams sets the teams property value. The slug values for teams +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1) SetTeams(value []string)() { + m.teams = value +} +type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTeams()([]string) + SetTeams(value []string)() +} diff --git a/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_post_request_body_member1.go b/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_post_request_body_member1.go new file mode 100644 index 00000000..68bec9b1 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_post_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 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 slug values for teams + teams []string +} +// NewItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1) 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 *ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["teams"] = 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.SetTeams(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The slug values for teams +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1) GetTeams()([]string) { + return m.teams +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + 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 *ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTeams sets the teams property value. The slug values for teams +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1) SetTeams(value []string)() { + m.teams = value +} +type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTeams()([]string) + SetTeams(value []string)() +} diff --git a/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_put_request_body_member1.go b/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_put_request_body_member1.go new file mode 100644 index 00000000..dace748a --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_put_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 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 slug values for teams + teams []string +} +// NewItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1) 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 *ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["teams"] = 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.SetTeams(res) + } + return nil + } + return res +} +// GetTeams gets the teams property value. The slug values for teams +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1) GetTeams()([]string) { + return m.teams +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetTeams() != nil { + err := writer.WriteCollectionOfStringValues("teams", m.GetTeams()) + 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 *ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTeams sets the teams property value. The slug values for teams +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1) SetTeams(value []string)() { + m.teams = value +} +type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTeams()([]string) + SetTeams(value []string)() +} diff --git a/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_request_builder.go b/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_request_builder.go new file mode 100644 index 00000000..86d63331 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_restrictions_teams_request_builder.go @@ -0,0 +1,569 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\restrictions\teams +type ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// TeamsDeleteRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able, string +type TeamsDeleteRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able + // Composed type representation for type string + string *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able + teamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able + // Composed type representation for type string + teamsDeleteRequestBodyString *string +} +// NewTeamsDeleteRequestBody instantiates a new TeamsDeleteRequestBody and sets the default values. +func NewTeamsDeleteRequestBody()(*TeamsDeleteRequestBody) { + m := &TeamsDeleteRequestBody{ + } + return m +} +// CreateTeamsDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamsDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewTeamsDeleteRequestBody() + 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.SetString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetTeamsDeleteRequestBodyString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamsDeleteRequestBody) 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 *TeamsDeleteRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able when successful +func (m *TeamsDeleteRequestBody) GetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *TeamsDeleteRequestBody) GetString()(*string) { + return m.string +} +// GetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able when successful +func (m *TeamsDeleteRequestBody) GetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able) { + return m.teamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 +} +// GetTeamsDeleteRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *TeamsDeleteRequestBody) GetTeamsDeleteRequestBodyString()(*string) { + return m.teamsDeleteRequestBodyString +} +// Serialize serializes information the current object +func (m *TeamsDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetTeamsDeleteRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetTeamsDeleteRequestBodyString()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able +func (m *TeamsDeleteRequestBody) SetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *TeamsDeleteRequestBody) SetString(value *string)() { + m.string = value +} +// SetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able +func (m *TeamsDeleteRequestBody) SetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able)() { + m.teamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1 = value +} +// SetTeamsDeleteRequestBodyString sets the string property value. Composed type representation for type string +func (m *TeamsDeleteRequestBody) SetTeamsDeleteRequestBodyString(value *string)() { + m.teamsDeleteRequestBodyString = value +} +// TeamsPostRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able, string +type TeamsPostRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able + // Composed type representation for type string + string *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able + teamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able + // Composed type representation for type string + teamsPostRequestBodyString *string +} +// NewTeamsPostRequestBody instantiates a new TeamsPostRequestBody and sets the default values. +func NewTeamsPostRequestBody()(*TeamsPostRequestBody) { + m := &TeamsPostRequestBody{ + } + return m +} +// CreateTeamsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewTeamsPostRequestBody() + 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.SetString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetTeamsPostRequestBodyString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamsPostRequestBody) 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 *TeamsPostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able when successful +func (m *TeamsPostRequestBody) GetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *TeamsPostRequestBody) GetString()(*string) { + return m.string +} +// GetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able when successful +func (m *TeamsPostRequestBody) GetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able) { + return m.teamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 +} +// GetTeamsPostRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *TeamsPostRequestBody) GetTeamsPostRequestBodyString()(*string) { + return m.teamsPostRequestBodyString +} +// Serialize serializes information the current object +func (m *TeamsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetTeamsPostRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetTeamsPostRequestBodyString()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able +func (m *TeamsPostRequestBody) SetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *TeamsPostRequestBody) SetString(value *string)() { + m.string = value +} +// SetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able +func (m *TeamsPostRequestBody) SetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able)() { + m.teamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1 = value +} +// SetTeamsPostRequestBodyString sets the string property value. Composed type representation for type string +func (m *TeamsPostRequestBody) SetTeamsPostRequestBodyString(value *string)() { + m.teamsPostRequestBodyString = value +} +// TeamsPutRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able, string +type TeamsPutRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able + // Composed type representation for type string + string *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able + teamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able + // Composed type representation for type string + teamsPutRequestBodyString *string +} +// NewTeamsPutRequestBody instantiates a new TeamsPutRequestBody and sets the default values. +func NewTeamsPutRequestBody()(*TeamsPutRequestBody) { + m := &TeamsPutRequestBody{ + } + return m +} +// CreateTeamsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTeamsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewTeamsPutRequestBody() + 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.SetString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetTeamsPutRequestBodyString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *TeamsPutRequestBody) 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 *TeamsPutRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able when successful +func (m *TeamsPutRequestBody) GetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *TeamsPutRequestBody) GetString()(*string) { + return m.string +} +// GetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able when successful +func (m *TeamsPutRequestBody) GetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able) { + return m.teamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 +} +// GetTeamsPutRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *TeamsPutRequestBody) GetTeamsPutRequestBodyString()(*string) { + return m.teamsPutRequestBodyString +} +// Serialize serializes information the current object +func (m *TeamsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetTeamsPutRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetTeamsPutRequestBodyString()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able +func (m *TeamsPutRequestBody) SetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *TeamsPutRequestBody) SetString(value *string)() { + m.string = value +} +// SetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able +func (m *TeamsPutRequestBody) SetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able)() { + m.teamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1 = value +} +// SetTeamsPutRequestBodyString sets the string property value. Composed type representation for type string +func (m *TeamsPutRequestBody) SetTeamsPutRequestBodyString(value *string)() { + m.teamsPutRequestBodyString = value +} +type TeamsDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able) + GetString()(*string) + GetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able) + GetTeamsDeleteRequestBodyString()(*string) + SetItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able)() + SetString(value *string)() + SetTeamsDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsDeleteRequestBodyMember1able)() + SetTeamsDeleteRequestBodyString(value *string)() +} +type TeamsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able) + GetString()(*string) + GetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able) + GetTeamsPostRequestBodyString()(*string) + SetItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able)() + SetString(value *string)() + SetTeamsPostRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPostRequestBodyMember1able)() + SetTeamsPostRequestBodyString(value *string)() +} +type TeamsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able) + GetString()(*string) + GetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able) + GetTeamsPutRequestBodyString()(*string) + SetItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able)() + SetString(value *string)() + SetTeamsPutRequestBodyItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsTeamsPutRequestBodyMember1able)() + SetTeamsPutRequestBodyString(value *string)() +} +// NewItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) { + m := &ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/restrictions/teams", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder instantiates a new ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removes the ability of a team to push to this branch. You can also remove push access for child teams. +// returns a []Teamable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#remove-team-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) Delete(ctx context.Context, body TeamsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable) + } + } + return val, nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists the teams who have push access to this branch. The list includes child teams. +// returns a []Teamable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#get-teams-with-access-to-the-protected-branch +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable) + } + } + return val, nil +} +// Post protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Grants the specified teams push access for this branch. You can also give push access to child teams. +// returns a []Teamable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#add-team-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) Post(ctx context.Context, body TeamsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable) + } + } + return val, nil +} +// Put protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. +// returns a []Teamable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#set-team-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) Put(ctx context.Context, body TeamsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable) + } + } + return val, nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removes the ability of a team to push to this branch. You can also remove push access for child teams. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body TeamsDeleteRequestBodyable, 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") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists the teams who have push access to this branch. The list includes child teams. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) 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 protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Grants the specified teams push access for this branch. You can also give push access to child teams. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) ToPostRequestInformation(ctx context.Context, body TeamsPostRequestBodyable, 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 +} +// ToPutRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Replaces the list of teams that have push access to this branch. This removes all teams that previously had push access and grants push access to the new list of teams. Team restrictions include child teams. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) ToPutRequestInformation(ctx context.Context, body TeamsPutRequestBodyable, 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 *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_branches_item_protection_restrictions_users_delete_request_body_member1.go b/pkg/github/repos/item_item_branches_item_protection_restrictions_users_delete_request_body_member1.go new file mode 100644 index 00000000..9f01a921 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_restrictions_users_delete_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 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 username for users + users []string +} +// NewItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1) 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 *ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["users"] = 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.SetUsers(res) + } + return nil + } + return res +} +// GetUsers gets the users property value. The username for users +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetUsers sets the users property value. The username for users +func (m *ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetUsers()([]string) + SetUsers(value []string)() +} diff --git a/pkg/github/repos/item_item_branches_item_protection_restrictions_users_post_request_body_member1.go b/pkg/github/repos/item_item_branches_item_protection_restrictions_users_post_request_body_member1.go new file mode 100644 index 00000000..7f7e50e8 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_restrictions_users_post_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 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 username for users + users []string +} +// NewItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1) 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 *ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["users"] = 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.SetUsers(res) + } + return nil + } + return res +} +// GetUsers gets the users property value. The username for users +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetUsers sets the users property value. The username for users +func (m *ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetUsers()([]string) + SetUsers(value []string)() +} diff --git a/pkg/github/repos/item_item_branches_item_protection_restrictions_users_put_request_body_member1.go b/pkg/github/repos/item_item_branches_item_protection_restrictions_users_put_request_body_member1.go new file mode 100644 index 00000000..b809f506 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_restrictions_users_put_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 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 username for users + users []string +} +// NewItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 instantiates a new ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1()(*ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1) { + m := &ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1(), 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 *ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1) 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 *ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["users"] = 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.SetUsers(res) + } + return nil + } + return res +} +// GetUsers gets the users property value. The username for users +// returns a []string when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1) GetUsers()([]string) { + return m.users +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetUsers() != nil { + err := writer.WriteCollectionOfStringValues("users", m.GetUsers()) + 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 *ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetUsers sets the users property value. The username for users +func (m *ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1) SetUsers(value []string)() { + m.users = value +} +type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetUsers()([]string) + SetUsers(value []string)() +} diff --git a/pkg/github/repos/item_item_branches_item_protection_restrictions_users_request_builder.go b/pkg/github/repos/item_item_branches_item_protection_restrictions_users_request_builder.go new file mode 100644 index 00000000..0c439f2a --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_protection_restrictions_users_request_builder.go @@ -0,0 +1,569 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\protection\restrictions\users +type ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// UsersDeleteRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able, string +type UsersDeleteRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able + // Composed type representation for type string + string *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able + usersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able + // Composed type representation for type string + usersDeleteRequestBodyString *string +} +// NewUsersDeleteRequestBody instantiates a new UsersDeleteRequestBody and sets the default values. +func NewUsersDeleteRequestBody()(*UsersDeleteRequestBody) { + m := &UsersDeleteRequestBody{ + } + return m +} +// CreateUsersDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsersDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewUsersDeleteRequestBody() + 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.SetString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetUsersDeleteRequestBodyString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UsersDeleteRequestBody) 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 *UsersDeleteRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able when successful +func (m *UsersDeleteRequestBody) GetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *UsersDeleteRequestBody) GetString()(*string) { + return m.string +} +// GetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able when successful +func (m *UsersDeleteRequestBody) GetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able) { + return m.usersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 +} +// GetUsersDeleteRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *UsersDeleteRequestBody) GetUsersDeleteRequestBodyString()(*string) { + return m.usersDeleteRequestBodyString +} +// Serialize serializes information the current object +func (m *UsersDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetUsersDeleteRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetUsersDeleteRequestBodyString()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able +func (m *UsersDeleteRequestBody) SetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *UsersDeleteRequestBody) SetString(value *string)() { + m.string = value +} +// SetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able +func (m *UsersDeleteRequestBody) SetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able)() { + m.usersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1 = value +} +// SetUsersDeleteRequestBodyString sets the string property value. Composed type representation for type string +func (m *UsersDeleteRequestBody) SetUsersDeleteRequestBodyString(value *string)() { + m.usersDeleteRequestBodyString = value +} +// UsersPostRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able, string +type UsersPostRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able + // Composed type representation for type string + string *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able + usersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able + // Composed type representation for type string + usersPostRequestBodyString *string +} +// NewUsersPostRequestBody instantiates a new UsersPostRequestBody and sets the default values. +func NewUsersPostRequestBody()(*UsersPostRequestBody) { + m := &UsersPostRequestBody{ + } + return m +} +// CreateUsersPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsersPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewUsersPostRequestBody() + 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.SetString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetUsersPostRequestBodyString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UsersPostRequestBody) 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 *UsersPostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able when successful +func (m *UsersPostRequestBody) GetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *UsersPostRequestBody) GetString()(*string) { + return m.string +} +// GetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able when successful +func (m *UsersPostRequestBody) GetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able) { + return m.usersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 +} +// GetUsersPostRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *UsersPostRequestBody) GetUsersPostRequestBodyString()(*string) { + return m.usersPostRequestBodyString +} +// Serialize serializes information the current object +func (m *UsersPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetUsersPostRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetUsersPostRequestBodyString()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able +func (m *UsersPostRequestBody) SetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *UsersPostRequestBody) SetString(value *string)() { + m.string = value +} +// SetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able +func (m *UsersPostRequestBody) SetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able)() { + m.usersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1 = value +} +// SetUsersPostRequestBodyString sets the string property value. Composed type representation for type string +func (m *UsersPostRequestBody) SetUsersPostRequestBodyString(value *string)() { + m.usersPostRequestBodyString = value +} +// UsersPutRequestBody composed type wrapper for classes ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able, string +type UsersPutRequestBody struct { + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able + itemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able + // Composed type representation for type string + string *string + // Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able + usersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able + // Composed type representation for type string + usersPutRequestBodyString *string +} +// NewUsersPutRequestBody instantiates a new UsersPutRequestBody and sets the default values. +func NewUsersPutRequestBody()(*UsersPutRequestBody) { + m := &UsersPutRequestBody{ + } + return m +} +// CreateUsersPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsersPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewUsersPutRequestBody() + 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.SetString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetUsersPutRequestBodyString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UsersPutRequestBody) 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 *UsersPutRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able when successful +func (m *UsersPutRequestBody) GetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able) { + return m.itemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *UsersPutRequestBody) GetString()(*string) { + return m.string +} +// GetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 gets the ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able +// returns a ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able when successful +func (m *UsersPutRequestBody) GetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able) { + return m.usersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 +} +// GetUsersPutRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *UsersPutRequestBody) GetUsersPutRequestBodyString()(*string) { + return m.usersPutRequestBodyString +} +// Serialize serializes information the current object +func (m *UsersPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetUsersPutRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetUsersPutRequestBodyString()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able +func (m *UsersPutRequestBody) SetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able)() { + m.itemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *UsersPutRequestBody) SetString(value *string)() { + m.string = value +} +// SetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 sets the ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 property value. Composed type representation for type ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able +func (m *UsersPutRequestBody) SetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able)() { + m.usersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1 = value +} +// SetUsersPutRequestBodyString sets the string property value. Composed type representation for type string +func (m *UsersPutRequestBody) SetUsersPutRequestBodyString(value *string)() { + m.usersPutRequestBodyString = value +} +type UsersDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able) + GetString()(*string) + GetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able) + GetUsersDeleteRequestBodyString()(*string) + SetItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able)() + SetString(value *string)() + SetUsersDeleteRequestBodyItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersDeleteRequestBodyMember1able)() + SetUsersDeleteRequestBodyString(value *string)() +} +type UsersPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able) + GetString()(*string) + GetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able) + GetUsersPostRequestBodyString()(*string) + SetItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able)() + SetString(value *string)() + SetUsersPostRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPostRequestBodyMember1able)() + SetUsersPostRequestBodyString(value *string)() +} +type UsersPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able) + GetString()(*string) + GetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1()(ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able) + GetUsersPutRequestBodyString()(*string) + SetItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able)() + SetString(value *string)() + SetUsersPutRequestBodyItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1(value ItemItemBranchesItemProtectionRestrictionsUsersPutRequestBodyMember1able)() + SetUsersPutRequestBodyString(value *string)() +} +// NewItemItemBranchesItemProtectionRestrictionsUsersRequestBuilderInternal instantiates a new ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsUsersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) { + m := &ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/protection/restrictions/users", pathParameters), + } + return m +} +// NewItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder instantiates a new ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder and sets the default values. +func NewItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemProtectionRestrictionsUsersRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removes the ability of a user to push to this branch.| Type | Description || ------- | --------------------------------------------------------------------------------------------------------------------------------------------- || `array` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | +// returns a []SimpleUserable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#remove-user-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) Delete(ctx context.Context, body UsersDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists the people who have push access to this branch. +// returns a []SimpleUserable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#get-users-with-access-to-the-protected-branch +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// Post protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Grants the specified people push access for this branch.| Type | Description || ------- | ----------------------------------------------------------------------------------------------------------------------------- || `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | +// returns a []SimpleUserable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#add-user-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) Post(ctx context.Context, body UsersPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// Put protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people.| Type | Description || ------- | ----------------------------------------------------------------------------------------------------------------------------- || `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | +// returns a []SimpleUserable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection#set-user-access-restrictions +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) Put(ctx context.Context, body UsersPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// ToDeleteRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Removes the ability of a user to push to this branch.| Type | Description || ------- | --------------------------------------------------------------------------------------------------------------------------------------------- || `array` | Usernames of the people who should no longer have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body UsersDeleteRequestBodyable, 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") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists the people who have push access to this branch. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) 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 protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Grants the specified people push access for this branch.| Type | Description || ------- | ----------------------------------------------------------------------------------------------------------------------------- || `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) ToPostRequestInformation(ctx context.Context, body UsersPostRequestBodyable, 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 +} +// ToPutRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Replaces the list of people that have push access to this branch. This removes all people that previously had push access and grants push access to the new list of people.| Type | Description || ------- | ----------------------------------------------------------------------------------------------------------------------------- || `array` | Usernames for people who can have push access. **Note**: The list of users, apps, and teams in total is limited to 100 items. | +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) ToPutRequestInformation(ctx context.Context, body UsersPutRequestBodyable, 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 *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder when successful +func (m *ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder) { + return NewItemItemBranchesItemProtectionRestrictionsUsersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_branches_item_rename_post_request_body.go b/pkg/github/repos/item_item_branches_item_rename_post_request_body.go new file mode 100644 index 00000000..07dfc1ca --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_rename_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemBranchesItemRenamePostRequestBody 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 new name of the branch. + new_name *string +} +// NewItemItemBranchesItemRenamePostRequestBody instantiates a new ItemItemBranchesItemRenamePostRequestBody and sets the default values. +func NewItemItemBranchesItemRenamePostRequestBody()(*ItemItemBranchesItemRenamePostRequestBody) { + m := &ItemItemBranchesItemRenamePostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemBranchesItemRenamePostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemBranchesItemRenamePostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemBranchesItemRenamePostRequestBody(), 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 *ItemItemBranchesItemRenamePostRequestBody) 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 *ItemItemBranchesItemRenamePostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["new_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNewName(val) + } + return nil + } + return res +} +// GetNewName gets the new_name property value. The new name of the branch. +// returns a *string when successful +func (m *ItemItemBranchesItemRenamePostRequestBody) GetNewName()(*string) { + return m.new_name +} +// Serialize serializes information the current object +func (m *ItemItemBranchesItemRenamePostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("new_name", m.GetNewName()) + 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 *ItemItemBranchesItemRenamePostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNewName sets the new_name property value. The new name of the branch. +func (m *ItemItemBranchesItemRenamePostRequestBody) SetNewName(value *string)() { + m.new_name = value +} +type ItemItemBranchesItemRenamePostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNewName()(*string) + SetNewName(value *string)() +} diff --git a/pkg/github/repos/item_item_branches_item_rename_request_builder.go b/pkg/github/repos/item_item_branches_item_rename_request_builder.go new file mode 100644 index 00000000..2ec14186 --- /dev/null +++ b/pkg/github/repos/item_item_branches_item_rename_request_builder.go @@ -0,0 +1,69 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemBranchesItemRenameRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch}\rename +type ItemItemBranchesItemRenameRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemBranchesItemRenameRequestBuilderInternal instantiates a new ItemItemBranchesItemRenameRequestBuilder and sets the default values. +func NewItemItemBranchesItemRenameRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemRenameRequestBuilder) { + m := &ItemItemBranchesItemRenameRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}/rename", pathParameters), + } + return m +} +// NewItemItemBranchesItemRenameRequestBuilder instantiates a new ItemItemBranchesItemRenameRequestBuilder and sets the default values. +func NewItemItemBranchesItemRenameRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesItemRenameRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesItemRenameRequestBuilderInternal(urlParams, requestAdapter) +} +// Post renames a branch in a repository.> [!NOTE]> Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/enterprise-server@3.14/github/administering-a-repository/renaming-a-branch)".The authenticated user must have push access to the branch. If the branch is the default branch, the authenticated user must also have admin or owner permissions.In order to rename the default branch, fine-grained access tokens also need the `administration:write` repository permission. +// returns a BranchWithProtectionable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branches#rename-a-branch +func (m *ItemItemBranchesItemRenameRequestBuilder) Post(ctx context.Context, body ItemItemBranchesItemRenamePostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BranchWithProtectionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBranchWithProtectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BranchWithProtectionable), nil +} +// ToPostRequestInformation renames a branch in a repository.> [!NOTE]> Although the API responds immediately, the branch rename process might take some extra time to complete in the background. You won't be able to push to the old branch name while the rename process is in progress. For more information, see "[Renaming a branch](https://docs.github.com/enterprise-server@3.14/github/administering-a-repository/renaming-a-branch)".The authenticated user must have push access to the branch. If the branch is the default branch, the authenticated user must also have admin or owner permissions.In order to rename the default branch, fine-grained access tokens also need the `administration:write` repository permission. +// returns a *RequestInformation when successful +func (m *ItemItemBranchesItemRenameRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemBranchesItemRenamePostRequestBodyable, 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 *ItemItemBranchesItemRenameRequestBuilder when successful +func (m *ItemItemBranchesItemRenameRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesItemRenameRequestBuilder) { + return NewItemItemBranchesItemRenameRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_branches_request_builder.go b/pkg/github/repos/item_item_branches_request_builder.go new file mode 100644 index 00000000..6875d557 --- /dev/null +++ b/pkg/github/repos/item_item_branches_request_builder.go @@ -0,0 +1,84 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemBranchesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches +type ItemItemBranchesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemBranchesRequestBuilderGetQueryParameters list branches +type ItemItemBranchesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Setting to `true` returns only branches protected by branch protections or rulesets. When set to `false`, only unprotected branches are returned. Omitting this parameter returns all branches. + Protected *bool `uriparametername:"protected"` +} +// ByBranch gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.branches.item collection +// returns a *ItemItemBranchesWithBranchItemRequestBuilder when successful +func (m *ItemItemBranchesRequestBuilder) ByBranch(branch string)(*ItemItemBranchesWithBranchItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if branch != "" { + urlTplParams["branch"] = branch + } + return NewItemItemBranchesWithBranchItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemBranchesRequestBuilderInternal instantiates a new ItemItemBranchesRequestBuilder and sets the default values. +func NewItemItemBranchesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesRequestBuilder) { + m := &ItemItemBranchesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches{?page*,per_page*,protected*}", pathParameters), + } + return m +} +// NewItemItemBranchesRequestBuilder instantiates a new ItemItemBranchesRequestBuilder and sets the default values. +func NewItemItemBranchesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list branches +// returns a []ShortBranchable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branches#list-branches +func (m *ItemItemBranchesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemBranchesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ShortBranchable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateShortBranchFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ShortBranchable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ShortBranchable) + } + } + return val, nil +} +// returns a *RequestInformation when successful +func (m *ItemItemBranchesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemBranchesRequestBuilderGetQueryParameters])(*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 *ItemItemBranchesRequestBuilder when successful +func (m *ItemItemBranchesRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesRequestBuilder) { + return NewItemItemBranchesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_branches_with_branch_item_request_builder.go b/pkg/github/repos/item_item_branches_with_branch_item_request_builder.go new file mode 100644 index 00000000..002f8581 --- /dev/null +++ b/pkg/github/repos/item_item_branches_with_branch_item_request_builder.go @@ -0,0 +1,70 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemBranchesWithBranchItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\branches\{branch} +type ItemItemBranchesWithBranchItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemBranchesWithBranchItemRequestBuilderInternal instantiates a new ItemItemBranchesWithBranchItemRequestBuilder and sets the default values. +func NewItemItemBranchesWithBranchItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesWithBranchItemRequestBuilder) { + m := &ItemItemBranchesWithBranchItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/branches/{branch}", pathParameters), + } + return m +} +// NewItemItemBranchesWithBranchItemRequestBuilder instantiates a new ItemItemBranchesWithBranchItemRequestBuilder and sets the default values. +func NewItemItemBranchesWithBranchItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemBranchesWithBranchItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemBranchesWithBranchItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get a branch +// returns a BranchWithProtectionable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branches#get-a-branch +func (m *ItemItemBranchesWithBranchItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BranchWithProtectionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBranchWithProtectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BranchWithProtectionable), nil +} +// Protection the protection property +// returns a *ItemItemBranchesItemProtectionRequestBuilder when successful +func (m *ItemItemBranchesWithBranchItemRequestBuilder) Protection()(*ItemItemBranchesItemProtectionRequestBuilder) { + return NewItemItemBranchesItemProtectionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rename the rename property +// returns a *ItemItemBranchesItemRenameRequestBuilder when successful +func (m *ItemItemBranchesWithBranchItemRequestBuilder) Rename()(*ItemItemBranchesItemRenameRequestBuilder) { + return NewItemItemBranchesItemRenameRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// returns a *RequestInformation when successful +func (m *ItemItemBranchesWithBranchItemRequestBuilder) 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 *ItemItemBranchesWithBranchItemRequestBuilder when successful +func (m *ItemItemBranchesWithBranchItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemBranchesWithBranchItemRequestBuilder) { + return NewItemItemBranchesWithBranchItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_check_runs_item_annotations_request_builder.go b/pkg/github/repos/item_item_check_runs_item_annotations_request_builder.go new file mode 100644 index 00000000..c69859c4 --- /dev/null +++ b/pkg/github/repos/item_item_check_runs_item_annotations_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCheckRunsItemAnnotationsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-runs\{check_run_id}\annotations +type ItemItemCheckRunsItemAnnotationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCheckRunsItemAnnotationsRequestBuilderGetQueryParameters lists annotations for a check run using the annotation `id`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +type ItemItemCheckRunsItemAnnotationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCheckRunsItemAnnotationsRequestBuilderInternal instantiates a new ItemItemCheckRunsItemAnnotationsRequestBuilder and sets the default values. +func NewItemItemCheckRunsItemAnnotationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsItemAnnotationsRequestBuilder) { + m := &ItemItemCheckRunsItemAnnotationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-runs/{check_run_id}/annotations{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCheckRunsItemAnnotationsRequestBuilder instantiates a new ItemItemCheckRunsItemAnnotationsRequestBuilder and sets the default values. +func NewItemItemCheckRunsItemAnnotationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsItemAnnotationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckRunsItemAnnotationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists annotations for a check run using the annotation `id`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a []CheckAnnotationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/checks/runs#list-check-run-annotations +func (m *ItemItemCheckRunsItemAnnotationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCheckRunsItemAnnotationsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckAnnotationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCheckAnnotationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckAnnotationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckAnnotationable) + } + } + return val, nil +} +// ToGetRequestInformation lists annotations for a check run using the annotation `id`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemCheckRunsItemAnnotationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCheckRunsItemAnnotationsRequestBuilderGetQueryParameters])(*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 *ItemItemCheckRunsItemAnnotationsRequestBuilder when successful +func (m *ItemItemCheckRunsItemAnnotationsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckRunsItemAnnotationsRequestBuilder) { + return NewItemItemCheckRunsItemAnnotationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_check_runs_item_rerequest_request_builder.go b/pkg/github/repos/item_item_check_runs_item_rerequest_request_builder.go new file mode 100644 index 00000000..4cd05ec9 --- /dev/null +++ b/pkg/github/repos/item_item_check_runs_item_rerequest_request_builder.go @@ -0,0 +1,65 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCheckRunsItemRerequestRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-runs\{check_run_id}\rerequest +type ItemItemCheckRunsItemRerequestRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCheckRunsItemRerequestRequestBuilderInternal instantiates a new ItemItemCheckRunsItemRerequestRequestBuilder and sets the default values. +func NewItemItemCheckRunsItemRerequestRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsItemRerequestRequestBuilder) { + m := &ItemItemCheckRunsItemRerequestRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-runs/{check_run_id}/rerequest", pathParameters), + } + return m +} +// NewItemItemCheckRunsItemRerequestRequestBuilder instantiates a new ItemItemCheckRunsItemRerequestRequestBuilder and sets the default values. +func NewItemItemCheckRunsItemRerequestRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsItemRerequestRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckRunsItemRerequestRequestBuilderInternal(urlParams, requestAdapter) +} +// Post triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#check_run) event with the action `rerequested`. When a check run is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)".OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a EmptyObjectable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/checks/runs#rerequest-a-check-run +func (m *ItemItemCheckRunsItemRerequestRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToPostRequestInformation triggers GitHub to rerequest an existing check run, without pushing new code to a repository. This endpoint will trigger the [`check_run` webhook](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#check_run) event with the action `rerequested`. When a check run is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.For more information about how to re-run GitHub Actions jobs, see "[Re-run a job from a workflow run](https://docs.github.com/enterprise-server@3.14/rest/actions/workflow-runs#re-run-a-job-from-a-workflow-run)".OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCheckRunsItemRerequestRequestBuilder) 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 *ItemItemCheckRunsItemRerequestRequestBuilder when successful +func (m *ItemItemCheckRunsItemRerequestRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckRunsItemRerequestRequestBuilder) { + return NewItemItemCheckRunsItemRerequestRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_check_runs_item_with_check_escaped_run_escaped_patch_request_body_member1.go b/pkg/github/repos/item_item_check_runs_item_with_check_escaped_run_escaped_patch_request_body_member1.go new file mode 100644 index 00000000..ccd030e1 --- /dev/null +++ b/pkg/github/repos/item_item_check_runs_item_with_check_escaped_run_escaped_patch_request_body_member1.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 instantiates a new ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 and sets the default values. +func NewItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1()(*ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1) { + m := &ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1(), 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 *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1) 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 *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1) 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 *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1) 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 *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_check_runs_item_with_check_escaped_run_escaped_patch_request_body_member2.go b/pkg/github/repos/item_item_check_runs_item_with_check_escaped_run_escaped_patch_request_body_member2.go new file mode 100644 index 00000000..7eb9c554 --- /dev/null +++ b/pkg/github/repos/item_item_check_runs_item_with_check_escaped_run_escaped_patch_request_body_member2.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 instantiates a new ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 and sets the default values. +func NewItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2()(*ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2) { + m := &ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2(), 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 *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2) 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 *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2) 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 *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2) 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 *ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_check_runs_post_request_body_member1.go b/pkg/github/repos/item_item_check_runs_post_request_body_member1.go new file mode 100644 index 00000000..ad3b692d --- /dev/null +++ b/pkg/github/repos/item_item_check_runs_post_request_body_member1.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCheckRunsPostRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemCheckRunsPostRequestBodyMember1 instantiates a new ItemItemCheckRunsPostRequestBodyMember1 and sets the default values. +func NewItemItemCheckRunsPostRequestBodyMember1()(*ItemItemCheckRunsPostRequestBodyMember1) { + m := &ItemItemCheckRunsPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckRunsPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckRunsPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckRunsPostRequestBodyMember1(), 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 *ItemItemCheckRunsPostRequestBodyMember1) 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 *ItemItemCheckRunsPostRequestBodyMember1) 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 *ItemItemCheckRunsPostRequestBodyMember1) 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 *ItemItemCheckRunsPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemCheckRunsPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_check_runs_post_request_body_member2.go b/pkg/github/repos/item_item_check_runs_post_request_body_member2.go new file mode 100644 index 00000000..d4916532 --- /dev/null +++ b/pkg/github/repos/item_item_check_runs_post_request_body_member2.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCheckRunsPostRequestBodyMember2 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemCheckRunsPostRequestBodyMember2 instantiates a new ItemItemCheckRunsPostRequestBodyMember2 and sets the default values. +func NewItemItemCheckRunsPostRequestBodyMember2()(*ItemItemCheckRunsPostRequestBodyMember2) { + m := &ItemItemCheckRunsPostRequestBodyMember2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckRunsPostRequestBodyMember2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckRunsPostRequestBodyMember2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckRunsPostRequestBodyMember2(), 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 *ItemItemCheckRunsPostRequestBodyMember2) 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 *ItemItemCheckRunsPostRequestBodyMember2) 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 *ItemItemCheckRunsPostRequestBodyMember2) 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 *ItemItemCheckRunsPostRequestBodyMember2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemCheckRunsPostRequestBodyMember2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_check_runs_request_builder.go b/pkg/github/repos/item_item_check_runs_request_builder.go new file mode 100644 index 00000000..9126c945 --- /dev/null +++ b/pkg/github/repos/item_item_check_runs_request_builder.go @@ -0,0 +1,192 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCheckRunsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-runs +type ItemItemCheckRunsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// CheckRunsPostRequestBody composed type wrapper for classes ItemItemCheckRunsPostRequestBodyMember1able, ItemItemCheckRunsPostRequestBodyMember2able +type CheckRunsPostRequestBody struct { + // Composed type representation for type ItemItemCheckRunsPostRequestBodyMember1able + checkRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1 ItemItemCheckRunsPostRequestBodyMember1able + // Composed type representation for type ItemItemCheckRunsPostRequestBodyMember2able + checkRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2 ItemItemCheckRunsPostRequestBodyMember2able + // Composed type representation for type ItemItemCheckRunsPostRequestBodyMember1able + itemItemCheckRunsPostRequestBodyMember1 ItemItemCheckRunsPostRequestBodyMember1able + // Composed type representation for type ItemItemCheckRunsPostRequestBodyMember2able + itemItemCheckRunsPostRequestBodyMember2 ItemItemCheckRunsPostRequestBodyMember2able +} +// NewCheckRunsPostRequestBody instantiates a new CheckRunsPostRequestBody and sets the default values. +func NewCheckRunsPostRequestBody()(*CheckRunsPostRequestBody) { + m := &CheckRunsPostRequestBody{ + } + return m +} +// CreateCheckRunsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCheckRunsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewCheckRunsPostRequestBody() + 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 { + } + } + } + return result, nil +} +// GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1 gets the ItemItemCheckRunsPostRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember1able +// returns a ItemItemCheckRunsPostRequestBodyMember1able when successful +func (m *CheckRunsPostRequestBody) GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1()(ItemItemCheckRunsPostRequestBodyMember1able) { + return m.checkRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1 +} +// GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2 gets the ItemItemCheckRunsPostRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember2able +// returns a ItemItemCheckRunsPostRequestBodyMember2able when successful +func (m *CheckRunsPostRequestBody) GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2()(ItemItemCheckRunsPostRequestBodyMember2able) { + return m.checkRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2 +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *CheckRunsPostRequestBody) 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 *CheckRunsPostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemCheckRunsPostRequestBodyMember1 gets the ItemItemCheckRunsPostRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember1able +// returns a ItemItemCheckRunsPostRequestBodyMember1able when successful +func (m *CheckRunsPostRequestBody) GetItemItemCheckRunsPostRequestBodyMember1()(ItemItemCheckRunsPostRequestBodyMember1able) { + return m.itemItemCheckRunsPostRequestBodyMember1 +} +// GetItemItemCheckRunsPostRequestBodyMember2 gets the ItemItemCheckRunsPostRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember2able +// returns a ItemItemCheckRunsPostRequestBodyMember2able when successful +func (m *CheckRunsPostRequestBody) GetItemItemCheckRunsPostRequestBodyMember2()(ItemItemCheckRunsPostRequestBodyMember2able) { + return m.itemItemCheckRunsPostRequestBodyMember2 +} +// Serialize serializes information the current object +func (m *CheckRunsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetItemItemCheckRunsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemCheckRunsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemCheckRunsPostRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetItemItemCheckRunsPostRequestBodyMember2()) + if err != nil { + return err + } + } + return nil +} +// SetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1 sets the ItemItemCheckRunsPostRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember1able +func (m *CheckRunsPostRequestBody) SetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1(value ItemItemCheckRunsPostRequestBodyMember1able)() { + m.checkRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1 = value +} +// SetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2 sets the ItemItemCheckRunsPostRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember2able +func (m *CheckRunsPostRequestBody) SetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2(value ItemItemCheckRunsPostRequestBodyMember2able)() { + m.checkRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2 = value +} +// SetItemItemCheckRunsPostRequestBodyMember1 sets the ItemItemCheckRunsPostRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember1able +func (m *CheckRunsPostRequestBody) SetItemItemCheckRunsPostRequestBodyMember1(value ItemItemCheckRunsPostRequestBodyMember1able)() { + m.itemItemCheckRunsPostRequestBodyMember1 = value +} +// SetItemItemCheckRunsPostRequestBodyMember2 sets the ItemItemCheckRunsPostRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsPostRequestBodyMember2able +func (m *CheckRunsPostRequestBody) SetItemItemCheckRunsPostRequestBodyMember2(value ItemItemCheckRunsPostRequestBodyMember2able)() { + m.itemItemCheckRunsPostRequestBodyMember2 = value +} +type CheckRunsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1()(ItemItemCheckRunsPostRequestBodyMember1able) + GetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2()(ItemItemCheckRunsPostRequestBodyMember2able) + GetItemItemCheckRunsPostRequestBodyMember1()(ItemItemCheckRunsPostRequestBodyMember1able) + GetItemItemCheckRunsPostRequestBodyMember2()(ItemItemCheckRunsPostRequestBodyMember2able) + SetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember1(value ItemItemCheckRunsPostRequestBodyMember1able)() + SetCheckRunsPostRequestBodyItemItemCheckRunsPostRequestBodyMember2(value ItemItemCheckRunsPostRequestBodyMember2able)() + SetItemItemCheckRunsPostRequestBodyMember1(value ItemItemCheckRunsPostRequestBodyMember1able)() + SetItemItemCheckRunsPostRequestBodyMember2(value ItemItemCheckRunsPostRequestBodyMember2able)() +} +// ByCheck_run_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.checkRuns.item collection +// returns a *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder when successful +func (m *ItemItemCheckRunsRequestBuilder) ByCheck_run_id(check_run_id int32)(*ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["check_run_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(check_run_id), 10) + return NewItemItemCheckRunsWithCheck_run_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCheckRunsRequestBuilderInternal instantiates a new ItemItemCheckRunsRequestBuilder and sets the default values. +func NewItemItemCheckRunsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsRequestBuilder) { + m := &ItemItemCheckRunsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-runs", pathParameters), + } + return m +} +// NewItemItemCheckRunsRequestBuilder instantiates a new ItemItemCheckRunsRequestBuilder and sets the default values. +func NewItemItemCheckRunsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckRunsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a new check run for a specific commit in a repository.To create a check run, you must use a GitHub App. OAuth apps and authenticated users are not able to create a check suite.In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs.> [!NOTE]> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. +// returns a CheckRunable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/checks/runs#create-a-check-run +func (m *ItemItemCheckRunsRequestBuilder) Post(ctx context.Context, body CheckRunsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCheckRunFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable), nil +} +// ToPostRequestInformation creates a new check run for a specific commit in a repository.To create a check run, you must use a GitHub App. OAuth apps and authenticated users are not able to create a check suite.In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs.> [!NOTE]> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array. +// returns a *RequestInformation when successful +func (m *ItemItemCheckRunsRequestBuilder) ToPostRequestInformation(ctx context.Context, body CheckRunsPostRequestBodyable, 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 *ItemItemCheckRunsRequestBuilder when successful +func (m *ItemItemCheckRunsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckRunsRequestBuilder) { + return NewItemItemCheckRunsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_check_runs_with_check_escaped_run_escaped_item_request_builder.go b/pkg/github/repos/item_item_check_runs_with_check_escaped_run_escaped_item_request_builder.go new file mode 100644 index 00000000..a9bebff0 --- /dev/null +++ b/pkg/github/repos/item_item_check_runs_with_check_escaped_run_escaped_item_request_builder.go @@ -0,0 +1,235 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCheckRunsWithCheck_run_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-runs\{check_run_id} +type ItemItemCheckRunsWithCheck_run_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// WithCheck_run_PatchRequestBody composed type wrapper for classes ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able, ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able +type WithCheck_run_PatchRequestBody struct { + // Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able + itemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able + // Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able + itemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able + // Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able + withCheck_run_PatchRequestBodyItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able + // Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able + withCheck_run_PatchRequestBodyItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able +} +// NewWithCheck_run_PatchRequestBody instantiates a new WithCheck_run_PatchRequestBody and sets the default values. +func NewWithCheck_run_PatchRequestBody()(*WithCheck_run_PatchRequestBody) { + m := &WithCheck_run_PatchRequestBody{ + } + return m +} +// CreateWithCheck_run_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWithCheck_run_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewWithCheck_run_PatchRequestBody() + if parseNode != nil { + if val, err := parseNode.GetObjectValue(CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able); ok { + result.SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able); ok { + result.SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able); ok { + result.SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1(cast) + } + } else if val, err := parseNode.GetObjectValue(CreateItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able); ok { + result.SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2(cast) + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WithCheck_run_PatchRequestBody) 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 *WithCheck_run_PatchRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1 gets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able +// returns a ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able when successful +func (m *WithCheck_run_PatchRequestBody) GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able) { + return m.itemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 +} +// GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2 gets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able +// returns a ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able when successful +func (m *WithCheck_run_PatchRequestBody) GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able) { + return m.itemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 +} +// GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1 gets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able +// returns a ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able when successful +func (m *WithCheck_run_PatchRequestBody) GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able) { + return m.withCheck_run_PatchRequestBodyItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 +} +// GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2 gets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able +// returns a ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able when successful +func (m *WithCheck_run_PatchRequestBody) GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able) { + return m.withCheck_run_PatchRequestBodyItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 +} +// Serialize serializes information the current object +func (m *WithCheck_run_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1 sets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able +func (m *WithCheck_run_PatchRequestBody) SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able)() { + m.itemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 = value +} +// SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2 sets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able +func (m *WithCheck_run_PatchRequestBody) SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able)() { + m.itemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 = value +} +// SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1 sets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able +func (m *WithCheck_run_PatchRequestBody) SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able)() { + m.withCheck_run_PatchRequestBodyItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1 = value +} +// SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2 sets the ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 property value. Composed type representation for type ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able +func (m *WithCheck_run_PatchRequestBody) SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able)() { + m.withCheck_run_PatchRequestBodyItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2 = value +} +type WithCheck_run_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able) + GetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able) + GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able) + GetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2()(ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able) + SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able)() + SetItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able)() + SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember1(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember1able)() + SetWithCheckRunPatchRequestBodyItemItemCheckRunsItemWithCheckRunPatchRequestBodyMember2(value ItemItemCheckRunsItemWithCheck_run_PatchRequestBodyMember2able)() +} +// Annotations the annotations property +// returns a *ItemItemCheckRunsItemAnnotationsRequestBuilder when successful +func (m *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) Annotations()(*ItemItemCheckRunsItemAnnotationsRequestBuilder) { + return NewItemItemCheckRunsItemAnnotationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCheckRunsWithCheck_run_ItemRequestBuilderInternal instantiates a new ItemItemCheckRunsWithCheck_run_ItemRequestBuilder and sets the default values. +func NewItemItemCheckRunsWithCheck_run_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) { + m := &ItemItemCheckRunsWithCheck_run_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-runs/{check_run_id}", pathParameters), + } + return m +} +// NewItemItemCheckRunsWithCheck_run_ItemRequestBuilder instantiates a new ItemItemCheckRunsWithCheck_run_ItemRequestBuilder and sets the default values. +func NewItemItemCheckRunsWithCheck_run_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckRunsWithCheck_run_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a single check run using its `id`.> [!NOTE]> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a CheckRunable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/checks/runs#get-a-check-run +func (m *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCheckRunFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable), nil +} +// Patch updates a check run for a specific commit in a repository.> [!NOTE]> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a CheckRunable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/checks/runs#update-a-check-run +func (m *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) Patch(ctx context.Context, body WithCheck_run_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCheckRunFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable), nil +} +// Rerequest the rerequest property +// returns a *ItemItemCheckRunsItemRerequestRequestBuilder when successful +func (m *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) Rerequest()(*ItemItemCheckRunsItemRerequestRequestBuilder) { + return NewItemItemCheckRunsItemRerequestRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets a single check run using its `id`.> [!NOTE]> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemCheckRunsWithCheck_run_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 check run for a specific commit in a repository.> [!NOTE]> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body WithCheck_run_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 *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder when successful +func (m *ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckRunsWithCheck_run_ItemRequestBuilder) { + return NewItemItemCheckRunsWithCheck_run_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_check_suites_item_check_runs_get_response.go b/pkg/github/repos/item_item_check_suites_item_check_runs_get_response.go new file mode 100644 index 00000000..47604298 --- /dev/null +++ b/pkg/github/repos/item_item_check_suites_item_check_runs_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemCheckSuitesItemCheckRunsGetResponse 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 check_runs property + check_runs []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable + // The total_count property + total_count *int32 +} +// NewItemItemCheckSuitesItemCheckRunsGetResponse instantiates a new ItemItemCheckSuitesItemCheckRunsGetResponse and sets the default values. +func NewItemItemCheckSuitesItemCheckRunsGetResponse()(*ItemItemCheckSuitesItemCheckRunsGetResponse) { + m := &ItemItemCheckSuitesItemCheckRunsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckSuitesItemCheckRunsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckSuitesItemCheckRunsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckSuitesItemCheckRunsGetResponse(), 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 *ItemItemCheckSuitesItemCheckRunsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCheckRuns gets the check_runs property value. The check_runs property +// returns a []CheckRunable when successful +func (m *ItemItemCheckSuitesItemCheckRunsGetResponse) GetCheckRuns()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable) { + return m.check_runs +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCheckSuitesItemCheckRunsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["check_runs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCheckRunFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable) + } + } + m.SetCheckRuns(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 *ItemItemCheckSuitesItemCheckRunsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemCheckSuitesItemCheckRunsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCheckRuns() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCheckRuns())) + for i, v := range m.GetCheckRuns() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("check_runs", 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 *ItemItemCheckSuitesItemCheckRunsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCheckRuns sets the check_runs property value. The check_runs property +func (m *ItemItemCheckSuitesItemCheckRunsGetResponse) SetCheckRuns(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable)() { + m.check_runs = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemCheckSuitesItemCheckRunsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemCheckSuitesItemCheckRunsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCheckRuns()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable) + GetTotalCount()(*int32) + SetCheckRuns(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_check_suites_item_check_runs_request_builder.go b/pkg/github/repos/item_item_check_suites_item_check_runs_request_builder.go new file mode 100644 index 00000000..2913d7dd --- /dev/null +++ b/pkg/github/repos/item_item_check_suites_item_check_runs_request_builder.go @@ -0,0 +1,70 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ia59821f935278ce2134e37176fcfc47c47f81819f8a6e9b764577234616aa46a "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/checksuites/item/checkruns" +) + +// ItemItemCheckSuitesItemCheckRunsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-suites\{check_suite_id}\check-runs +type ItemItemCheckSuitesItemCheckRunsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCheckSuitesItemCheckRunsRequestBuilderGetQueryParameters lists check runs for a check suite using its `id`.> [!NOTE]> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +type ItemItemCheckSuitesItemCheckRunsRequestBuilderGetQueryParameters struct { + // Returns check runs with the specified `name`. + Check_name *string `uriparametername:"check_name"` + // Filters check runs by their `completed_at` timestamp. `latest` returns the most recent check runs. + Filter *ia59821f935278ce2134e37176fcfc47c47f81819f8a6e9b764577234616aa46a.GetFilterQueryParameterType `uriparametername:"filter"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Returns check runs with the specified `status`. + Status *ia59821f935278ce2134e37176fcfc47c47f81819f8a6e9b764577234616aa46a.GetStatusQueryParameterType `uriparametername:"status"` +} +// NewItemItemCheckSuitesItemCheckRunsRequestBuilderInternal instantiates a new ItemItemCheckSuitesItemCheckRunsRequestBuilder and sets the default values. +func NewItemItemCheckSuitesItemCheckRunsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesItemCheckRunsRequestBuilder) { + m := &ItemItemCheckSuitesItemCheckRunsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-suites/{check_suite_id}/check-runs{?check_name*,filter*,page*,per_page*,status*}", pathParameters), + } + return m +} +// NewItemItemCheckSuitesItemCheckRunsRequestBuilder instantiates a new ItemItemCheckSuitesItemCheckRunsRequestBuilder and sets the default values. +func NewItemItemCheckSuitesItemCheckRunsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesItemCheckRunsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckSuitesItemCheckRunsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists check runs for a check suite using its `id`.> [!NOTE]> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a ItemItemCheckSuitesItemCheckRunsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/checks/runs#list-check-runs-in-a-check-suite +func (m *ItemItemCheckSuitesItemCheckRunsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCheckSuitesItemCheckRunsRequestBuilderGetQueryParameters])(ItemItemCheckSuitesItemCheckRunsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemCheckSuitesItemCheckRunsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemCheckSuitesItemCheckRunsGetResponseable), nil +} +// ToGetRequestInformation lists check runs for a check suite using its `id`.> [!NOTE]> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemCheckSuitesItemCheckRunsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCheckSuitesItemCheckRunsRequestBuilderGetQueryParameters])(*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 *ItemItemCheckSuitesItemCheckRunsRequestBuilder when successful +func (m *ItemItemCheckSuitesItemCheckRunsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckSuitesItemCheckRunsRequestBuilder) { + return NewItemItemCheckSuitesItemCheckRunsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_check_suites_item_rerequest_request_builder.go b/pkg/github/repos/item_item_check_suites_item_rerequest_request_builder.go new file mode 100644 index 00000000..455d52ff --- /dev/null +++ b/pkg/github/repos/item_item_check_suites_item_rerequest_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCheckSuitesItemRerequestRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-suites\{check_suite_id}\rerequest +type ItemItemCheckSuitesItemRerequestRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCheckSuitesItemRerequestRequestBuilderInternal instantiates a new ItemItemCheckSuitesItemRerequestRequestBuilder and sets the default values. +func NewItemItemCheckSuitesItemRerequestRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesItemRerequestRequestBuilder) { + m := &ItemItemCheckSuitesItemRerequestRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-suites/{check_suite_id}/rerequest", pathParameters), + } + return m +} +// NewItemItemCheckSuitesItemRerequestRequestBuilder instantiates a new ItemItemCheckSuitesItemRerequestRequestBuilder and sets the default values. +func NewItemItemCheckSuitesItemRerequestRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesItemRerequestRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckSuitesItemRerequestRequestBuilderInternal(urlParams, requestAdapter) +} +// Post triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/checks/suites#rerequest-a-check-suite +func (m *ItemItemCheckSuitesItemRerequestRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToPostRequestInformation triggers GitHub to rerequest an existing check suite, without pushing new code to a repository. This endpoint will trigger the [`check_suite` webhook](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#check_suite) event with the action `rerequested`. When a check suite is `rerequested`, its `status` is reset to `queued` and the `conclusion` is cleared.OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCheckSuitesItemRerequestRequestBuilder) 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 *ItemItemCheckSuitesItemRerequestRequestBuilder when successful +func (m *ItemItemCheckSuitesItemRerequestRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckSuitesItemRerequestRequestBuilder) { + return NewItemItemCheckSuitesItemRerequestRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_check_suites_post_request_body.go b/pkg/github/repos/item_item_check_suites_post_request_body.go new file mode 100644 index 00000000..8af87abf --- /dev/null +++ b/pkg/github/repos/item_item_check_suites_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCheckSuitesPostRequestBody 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 sha of the head commit. + head_sha *string +} +// NewItemItemCheckSuitesPostRequestBody instantiates a new ItemItemCheckSuitesPostRequestBody and sets the default values. +func NewItemItemCheckSuitesPostRequestBody()(*ItemItemCheckSuitesPostRequestBody) { + m := &ItemItemCheckSuitesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckSuitesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckSuitesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckSuitesPostRequestBody(), 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 *ItemItemCheckSuitesPostRequestBody) 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 *ItemItemCheckSuitesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["head_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadSha(val) + } + return nil + } + return res +} +// GetHeadSha gets the head_sha property value. The sha of the head commit. +// returns a *string when successful +func (m *ItemItemCheckSuitesPostRequestBody) GetHeadSha()(*string) { + return m.head_sha +} +// Serialize serializes information the current object +func (m *ItemItemCheckSuitesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("head_sha", m.GetHeadSha()) + 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 *ItemItemCheckSuitesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetHeadSha sets the head_sha property value. The sha of the head commit. +func (m *ItemItemCheckSuitesPostRequestBody) SetHeadSha(value *string)() { + m.head_sha = value +} +type ItemItemCheckSuitesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetHeadSha()(*string) + SetHeadSha(value *string)() +} diff --git a/pkg/github/repos/item_item_check_suites_preferences_patch_request_body.go b/pkg/github/repos/item_item_check_suites_preferences_patch_request_body.go new file mode 100644 index 00000000..54ecfbe4 --- /dev/null +++ b/pkg/github/repos/item_item_check_suites_preferences_patch_request_body.go @@ -0,0 +1,92 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCheckSuitesPreferencesPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. + auto_trigger_checks []ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable +} +// NewItemItemCheckSuitesPreferencesPatchRequestBody instantiates a new ItemItemCheckSuitesPreferencesPatchRequestBody and sets the default values. +func NewItemItemCheckSuitesPreferencesPatchRequestBody()(*ItemItemCheckSuitesPreferencesPatchRequestBody) { + m := &ItemItemCheckSuitesPreferencesPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckSuitesPreferencesPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckSuitesPreferencesPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckSuitesPreferencesPatchRequestBody(), 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 *ItemItemCheckSuitesPreferencesPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAutoTriggerChecks gets the auto_trigger_checks property value. Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. +// returns a []ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable when successful +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody) GetAutoTriggerChecks()([]ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable) { + return m.auto_trigger_checks +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["auto_trigger_checks"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable) + } + } + m.SetAutoTriggerChecks(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAutoTriggerChecks() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAutoTriggerChecks())) + for i, v := range m.GetAutoTriggerChecks() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("auto_trigger_checks", 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 *ItemItemCheckSuitesPreferencesPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAutoTriggerChecks sets the auto_trigger_checks property value. Enables or disables automatic creation of CheckSuite events upon pushes to the repository. Enabled by default. +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody) SetAutoTriggerChecks(value []ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable)() { + m.auto_trigger_checks = value +} +type ItemItemCheckSuitesPreferencesPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAutoTriggerChecks()([]ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable) + SetAutoTriggerChecks(value []ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable)() +} diff --git a/pkg/github/repos/item_item_check_suites_preferences_patch_request_body_escaped_auto_escaped_trigger_escaped_checks.go b/pkg/github/repos/item_item_check_suites_preferences_patch_request_body_escaped_auto_escaped_trigger_escaped_checks.go new file mode 100644 index 00000000..5586afad --- /dev/null +++ b/pkg/github/repos/item_item_check_suites_preferences_patch_request_body_escaped_auto_escaped_trigger_escaped_checks.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The `id` of the GitHub App. + app_id *int32 + // Set to `true` to enable automatic creation of CheckSuite events upon pushes to the repository, or `false` to disable them. + setting *bool +} +// NewItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks instantiates a new ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks and sets the default values. +func NewItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks()(*ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) { + m := &ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks(), 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 *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAppId gets the app_id property value. The `id` of the GitHub App. +// returns a *int32 when successful +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) GetAppId()(*int32) { + return m.app_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["app_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetAppId(val) + } + return nil + } + res["setting"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSetting(val) + } + return nil + } + return res +} +// GetSetting gets the setting property value. Set to `true` to enable automatic creation of CheckSuite events upon pushes to the repository, or `false` to disable them. +// returns a *bool when successful +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) GetSetting()(*bool) { + return m.setting +} +// Serialize serializes information the current object +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("app_id", m.GetAppId()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("setting", m.GetSetting()) + 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 *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAppId sets the app_id property value. The `id` of the GitHub App. +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) SetAppId(value *int32)() { + m.app_id = value +} +// SetSetting sets the setting property value. Set to `true` to enable automatic creation of CheckSuite events upon pushes to the repository, or `false` to disable them. +func (m *ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checks) SetSetting(value *bool)() { + m.setting = value +} +type ItemItemCheckSuitesPreferencesPatchRequestBody_auto_trigger_checksable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAppId()(*int32) + GetSetting()(*bool) + SetAppId(value *int32)() + SetSetting(value *bool)() +} diff --git a/pkg/github/repos/item_item_check_suites_preferences_request_builder.go b/pkg/github/repos/item_item_check_suites_preferences_request_builder.go new file mode 100644 index 00000000..16de42b0 --- /dev/null +++ b/pkg/github/repos/item_item_check_suites_preferences_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCheckSuitesPreferencesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-suites\preferences +type ItemItemCheckSuitesPreferencesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCheckSuitesPreferencesRequestBuilderInternal instantiates a new ItemItemCheckSuitesPreferencesRequestBuilder and sets the default values. +func NewItemItemCheckSuitesPreferencesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesPreferencesRequestBuilder) { + m := &ItemItemCheckSuitesPreferencesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-suites/preferences", pathParameters), + } + return m +} +// NewItemItemCheckSuitesPreferencesRequestBuilder instantiates a new ItemItemCheckSuitesPreferencesRequestBuilder and sets the default values. +func NewItemItemCheckSuitesPreferencesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesPreferencesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckSuitesPreferencesRequestBuilderInternal(urlParams, requestAdapter) +} +// Patch changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/enterprise-server@3.14/rest/checks/suites#create-a-check-suite).You must have admin permissions in the repository to set preferences for check suites. +// returns a CheckSuitePreferenceable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/checks/suites#update-repository-preferences-for-check-suites +func (m *ItemItemCheckSuitesPreferencesRequestBuilder) Patch(ctx context.Context, body ItemItemCheckSuitesPreferencesPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckSuitePreferenceable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCheckSuitePreferenceFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckSuitePreferenceable), nil +} +// ToPatchRequestInformation changes the default automatic flow when creating check suites. By default, a check suite is automatically created each time code is pushed to a repository. When you disable the automatic creation of check suites, you can manually [Create a check suite](https://docs.github.com/enterprise-server@3.14/rest/checks/suites#create-a-check-suite).You must have admin permissions in the repository to set preferences for check suites. +// returns a *RequestInformation when successful +func (m *ItemItemCheckSuitesPreferencesRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemCheckSuitesPreferencesPatchRequestBodyable, 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 *ItemItemCheckSuitesPreferencesRequestBuilder when successful +func (m *ItemItemCheckSuitesPreferencesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckSuitesPreferencesRequestBuilder) { + return NewItemItemCheckSuitesPreferencesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_check_suites_request_builder.go b/pkg/github/repos/item_item_check_suites_request_builder.go new file mode 100644 index 00000000..35e51c13 --- /dev/null +++ b/pkg/github/repos/item_item_check_suites_request_builder.go @@ -0,0 +1,77 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCheckSuitesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-suites +type ItemItemCheckSuitesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByCheck_suite_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.checkSuites.item collection +// returns a *ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder when successful +func (m *ItemItemCheckSuitesRequestBuilder) ByCheck_suite_id(check_suite_id int32)(*ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["check_suite_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(check_suite_id), 10) + return NewItemItemCheckSuitesWithCheck_suite_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCheckSuitesRequestBuilderInternal instantiates a new ItemItemCheckSuitesRequestBuilder and sets the default values. +func NewItemItemCheckSuitesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesRequestBuilder) { + m := &ItemItemCheckSuitesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-suites", pathParameters), + } + return m +} +// NewItemItemCheckSuitesRequestBuilder instantiates a new ItemItemCheckSuitesRequestBuilder and sets the default values. +func NewItemItemCheckSuitesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckSuitesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a check suite manually. By default, check suites are automatically created when you create a [check run](https://docs.github.com/enterprise-server@3.14/rest/checks/runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/enterprise-server@3.14/rest/checks/suites#update-repository-preferences-for-check-suites)".> [!NOTE]> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a CheckSuiteable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/checks/suites#create-a-check-suite +func (m *ItemItemCheckSuitesRequestBuilder) Post(ctx context.Context, body ItemItemCheckSuitesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckSuiteable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCheckSuiteFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckSuiteable), nil +} +// Preferences the preferences property +// returns a *ItemItemCheckSuitesPreferencesRequestBuilder when successful +func (m *ItemItemCheckSuitesRequestBuilder) Preferences()(*ItemItemCheckSuitesPreferencesRequestBuilder) { + return NewItemItemCheckSuitesPreferencesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToPostRequestInformation creates a check suite manually. By default, check suites are automatically created when you create a [check run](https://docs.github.com/enterprise-server@3.14/rest/checks/runs). You only need to use this endpoint for manually creating check suites when you've disabled automatic creation using "[Update repository preferences for check suites](https://docs.github.com/enterprise-server@3.14/rest/checks/suites#update-repository-preferences-for-check-suites)".> [!NOTE]> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.OAuth apps and personal access tokens (classic) cannot use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCheckSuitesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemCheckSuitesPostRequestBodyable, 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 *ItemItemCheckSuitesRequestBuilder when successful +func (m *ItemItemCheckSuitesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckSuitesRequestBuilder) { + return NewItemItemCheckSuitesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_check_suites_with_check_escaped_suite_escaped_item_request_builder.go b/pkg/github/repos/item_item_check_suites_with_check_escaped_suite_escaped_item_request_builder.go new file mode 100644 index 00000000..d58dc5fe --- /dev/null +++ b/pkg/github/repos/item_item_check_suites_with_check_escaped_suite_escaped_item_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\check-suites\{check_suite_id} +type ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// CheckRuns the checkRuns property +// returns a *ItemItemCheckSuitesItemCheckRunsRequestBuilder when successful +func (m *ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) CheckRuns()(*ItemItemCheckSuitesItemCheckRunsRequestBuilder) { + return NewItemItemCheckSuitesItemCheckRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCheckSuitesWithCheck_suite_ItemRequestBuilderInternal instantiates a new ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder and sets the default values. +func NewItemItemCheckSuitesWithCheck_suite_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) { + m := &ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/check-suites/{check_suite_id}", pathParameters), + } + return m +} +// NewItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder instantiates a new ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder and sets the default values. +func NewItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCheckSuitesWithCheck_suite_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a single check suite using its `id`.> [!NOTE]> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a CheckSuiteable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/checks/suites#get-a-check-suite +func (m *ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckSuiteable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCheckSuiteFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckSuiteable), nil +} +// Rerequest the rerequest property +// returns a *ItemItemCheckSuitesItemRerequestRequestBuilder when successful +func (m *ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) Rerequest()(*ItemItemCheckSuitesItemRerequestRequestBuilder) { + return NewItemItemCheckSuitesItemRerequestRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation gets a single check suite using its `id`.> [!NOTE]> The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemCheckSuitesWithCheck_suite_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder when successful +func (m *ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder) { + return NewItemItemCheckSuitesWithCheck_suite_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_code_scanning_alerts_item_instances_request_builder.go b/pkg/github/repos/item_item_code_scanning_alerts_item_instances_request_builder.go new file mode 100644 index 00000000..658f0d8c --- /dev/null +++ b/pkg/github/repos/item_item_code_scanning_alerts_item_instances_request_builder.go @@ -0,0 +1,77 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCodeScanningAlertsItemInstancesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\alerts\{alert_number}\instances +type ItemItemCodeScanningAlertsItemInstancesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodeScanningAlertsItemInstancesRequestBuilderGetQueryParameters lists all instances of the specified 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. +type ItemItemCodeScanningAlertsItemInstancesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. + Ref *string `uriparametername:"ref"` +} +// NewItemItemCodeScanningAlertsItemInstancesRequestBuilderInternal instantiates a new ItemItemCodeScanningAlertsItemInstancesRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsItemInstancesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsItemInstancesRequestBuilder) { + m := &ItemItemCodeScanningAlertsItemInstancesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts/{alert_number}/instances{?page*,per_page*,ref*}", pathParameters), + } + return m +} +// NewItemItemCodeScanningAlertsItemInstancesRequestBuilder instantiates a new ItemItemCodeScanningAlertsItemInstancesRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsItemInstancesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsItemInstancesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningAlertsItemInstancesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all instances of the specified 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 []CodeScanningAlertInstanceable 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 Instances503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/code-scanning/code-scanning#list-instances-of-a-code-scanning-alert +func (m *ItemItemCodeScanningAlertsItemInstancesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAlertsItemInstancesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertInstanceable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateInstances503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningAlertInstanceFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertInstanceable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertInstanceable) + } + } + return val, nil +} +// ToGetRequestInformation lists all instances of the specified 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 *ItemItemCodeScanningAlertsItemInstancesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAlertsItemInstancesRequestBuilderGetQueryParameters])(*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 *ItemItemCodeScanningAlertsItemInstancesRequestBuilder when successful +func (m *ItemItemCodeScanningAlertsItemInstancesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningAlertsItemInstancesRequestBuilder) { + return NewItemItemCodeScanningAlertsItemInstancesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_code_scanning_alerts_item_with_alert_escaped_number_patch_request_body.go b/pkg/github/repos/item_item_code_scanning_alerts_item_with_alert_escaped_number_patch_request_body.go new file mode 100644 index 00000000..3f2fee5e --- /dev/null +++ b/pkg/github/repos/item_item_code_scanning_alerts_item_with_alert_escaped_number_patch_request_body.go @@ -0,0 +1,141 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody 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 dismissal comment associated with the dismissal of the alert. + dismissed_comment *string + // **Required when the state is dismissed.** The reason for dismissing or closing the alert. + dismissed_reason *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertDismissedReason + // Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`. + state *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertSetState +} +// NewItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody instantiates a new ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody and sets the default values. +func NewItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody()(*ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) { + m := &ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody(), 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 *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDismissedComment gets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +// returns a *string when successful +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) GetDismissedComment()(*string) { + return m.dismissed_comment +} +// GetDismissedReason gets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +// returns a *CodeScanningAlertDismissedReason when successful +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) GetDismissedReason()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertDismissedReason) { + return m.dismissed_reason +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["dismissed_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedComment(val) + } + return nil + } + res["dismissed_reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParseCodeScanningAlertDismissedReason) + if err != nil { + return err + } + if val != nil { + m.SetDismissedReason(val.(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertDismissedReason)) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParseCodeScanningAlertSetState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertSetState)) + } + return nil + } + return res +} +// GetState gets the state property value. Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`. +// returns a *CodeScanningAlertSetState when successful +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) GetState()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertSetState) { + return m.state +} +// Serialize serializes information the current object +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("dismissed_comment", m.GetDismissedComment()) + if err != nil { + return err + } + } + if m.GetDismissedReason() != nil { + cast := (*m.GetDismissedReason()).String() + err := writer.WriteStringValue("dismissed_reason", &cast) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &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 *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDismissedComment sets the dismissed_comment property value. The dismissal comment associated with the dismissal of the alert. +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) SetDismissedComment(value *string)() { + m.dismissed_comment = value +} +// SetDismissedReason sets the dismissed_reason property value. **Required when the state is dismissed.** The reason for dismissing or closing the alert. +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) SetDismissedReason(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertDismissedReason)() { + m.dismissed_reason = value +} +// SetState sets the state property value. Sets the state of the code scanning alert. You must provide `dismissed_reason` when you set the state to `dismissed`. +func (m *ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBody) SetState(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertSetState)() { + m.state = value +} +type ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDismissedComment()(*string) + GetDismissedReason()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertDismissedReason) + GetState()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertSetState) + SetDismissedComment(value *string)() + SetDismissedReason(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertDismissedReason)() + SetState(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertSetState)() +} diff --git a/pkg/github/repos/item_item_code_scanning_alerts_request_builder.go b/pkg/github/repos/item_item_code_scanning_alerts_request_builder.go new file mode 100644 index 00000000..94e675a2 --- /dev/null +++ b/pkg/github/repos/item_item_code_scanning_alerts_request_builder.go @@ -0,0 +1,101 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i6c770f215866341afbb0263b70f7d303a7c6d6d999489894513c17b798403478 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/codescanning/alerts" +) + +// ItemItemCodeScanningAlertsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\alerts +type ItemItemCodeScanningAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodeScanningAlertsRequestBuilderGetQueryParameters lists code scanning alerts.The response includes a `most_recent_instance` object.This provides details of the most recent instance of this alertfor the default branch (or for the specified Git reference if you used `ref` in the request).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. +type ItemItemCodeScanningAlertsRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i6c770f215866341afbb0263b70f7d303a7c6d6d999489894513c17b798403478.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. + Ref *string `uriparametername:"ref"` + // If specified, only code scanning alerts with this severity will be returned. + Severity *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertSeverity `uriparametername:"severity"` + // The property by which to sort the results. + Sort *i6c770f215866341afbb0263b70f7d303a7c6d6d999489894513c17b798403478.GetSortQueryParameterType `uriparametername:"sort"` + // If specified, only code scanning alerts with this state will be returned. + State *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertStateQuery `uriparametername:"state"` + // The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. + Tool_guid *string `uriparametername:"tool_guid"` + // The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. + Tool_name *string `uriparametername:"tool_name"` +} +// ByAlert_number gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.codeScanning.alerts.item collection +// returns a *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder when successful +func (m *ItemItemCodeScanningAlertsRequestBuilder) ByAlert_number(alert_number int32)(*ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["alert_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(alert_number), 10) + return NewItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCodeScanningAlertsRequestBuilderInternal instantiates a new ItemItemCodeScanningAlertsRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsRequestBuilder) { + m := &ItemItemCodeScanningAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts{?direction*,page*,per_page*,ref*,severity*,sort*,state*,tool_guid*,tool_name*}", pathParameters), + } + return m +} +// NewItemItemCodeScanningAlertsRequestBuilder instantiates a new ItemItemCodeScanningAlertsRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists code scanning alerts.The response includes a `most_recent_instance` object.This provides details of the most recent instance of this alertfor the default branch (or for the specified Git reference if you used `ref` in the request).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 []CodeScanningAlertItemsable 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 Alerts503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/code-scanning/code-scanning#list-code-scanning-alerts-for-a-repository +func (m *ItemItemCodeScanningAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAlertsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertItemsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAlerts503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningAlertItemsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertItemsable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertItemsable) + } + } + return val, nil +} +// ToGetRequestInformation lists code scanning alerts.The response includes a `most_recent_instance` object.This provides details of the most recent instance of this alertfor the default branch (or for the specified Git reference if you used `ref` in the request).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 *ItemItemCodeScanningAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAlertsRequestBuilderGetQueryParameters])(*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 *ItemItemCodeScanningAlertsRequestBuilder when successful +func (m *ItemItemCodeScanningAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningAlertsRequestBuilder) { + return NewItemItemCodeScanningAlertsRequestBuilder(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 new file mode 100644 index 00000000..df8d472d --- /dev/null +++ b/pkg/github/repos/item_item_code_scanning_alerts_with_alert_escaped_number_item_request_builder.go @@ -0,0 +1,109 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\alerts\{alert_number} +type ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// 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{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/alerts/{alert_number}", pathParameters), + } + return m +} +// NewItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder instantiates a new ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a single 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 CodeScanningAlertable 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 CodeScanningAlert503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/code-scanning/code-scanning#get-a-code-scanning-alert +func (m *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningAlert503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertable), nil +} +// Instances the instances property +// returns a *ItemItemCodeScanningAlertsItemInstancesRequestBuilder when successful +func (m *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) Instances()(*ItemItemCodeScanningAlertsItemInstancesRequestBuilder) { + return NewItemItemCodeScanningAlertsItemInstancesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch updates the status of a single 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 CodeScanningAlertable 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 CodeScanningAlert503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/code-scanning/code-scanning#update-a-code-scanning-alert +func (m *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) Patch(ctx context.Context, body ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningAlert503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAlertable), nil +} +// ToGetRequestInformation gets a single 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 *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) 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 the status of a single 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 *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemCodeScanningAlertsItemWithAlert_numberPatchRequestBodyable, 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 *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder when successful +func (m *ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder) { + return NewItemItemCodeScanningAlertsWithAlert_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_code_scanning_analyses_request_builder.go b/pkg/github/repos/item_item_code_scanning_analyses_request_builder.go new file mode 100644 index 00000000..0750266b --- /dev/null +++ b/pkg/github/repos/item_item_code_scanning_analyses_request_builder.go @@ -0,0 +1,99 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i28946bb8568c041f1c5556b91b3fd696a730699a2d05643ff6b069662bd098ab "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/codescanning/analyses" +) + +// ItemItemCodeScanningAnalysesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\analyses +type ItemItemCodeScanningAnalysesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodeScanningAnalysesRequestBuilderGetQueryParameters lists the details of all code scanning analyses for a repository,starting with the most recent.The response is paginated and you can use the `page` and `per_page` parametersto list the analyses you're interested in.By default 30 analyses are listed per page.The `rules_count` field in the response give the number of rulesthat were run in the analysis.For very old analyses this data is not available,and `0` is returned in this field.> [!WARNING]> **Deprecation notice:** The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.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. +type ItemItemCodeScanningAnalysesRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i28946bb8568c041f1c5556b91b3fd696a730699a2d05643ff6b069662bd098ab.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The Git reference for the analyses you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. + Ref *string `uriparametername:"ref"` + // Filter analyses belonging to the same SARIF upload. + Sarif_id *string `uriparametername:"sarif_id"` + // The property by which to sort the results. + Sort *i28946bb8568c041f1c5556b91b3fd696a730699a2d05643ff6b069662bd098ab.GetSortQueryParameterType `uriparametername:"sort"` + // The GUID of a code scanning tool. Only results by this tool will be listed. Note that some code scanning tools may not include a GUID in their analysis data. You can specify the tool by using either `tool_guid` or `tool_name`, but not both. + Tool_guid *string `uriparametername:"tool_guid"` + // The name of a code scanning tool. Only results by this tool will be listed. You can specify the tool by using either `tool_name` or `tool_guid`, but not both. + Tool_name *string `uriparametername:"tool_name"` +} +// ByAnalysis_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.codeScanning.analyses.item collection +// returns a *ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder when successful +func (m *ItemItemCodeScanningAnalysesRequestBuilder) ByAnalysis_id(analysis_id int32)(*ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["analysis_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(analysis_id), 10) + return NewItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCodeScanningAnalysesRequestBuilderInternal instantiates a new ItemItemCodeScanningAnalysesRequestBuilder and sets the default values. +func NewItemItemCodeScanningAnalysesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAnalysesRequestBuilder) { + m := &ItemItemCodeScanningAnalysesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/analyses{?direction*,page*,per_page*,ref*,sarif_id*,sort*,tool_guid*,tool_name*}", pathParameters), + } + return m +} +// NewItemItemCodeScanningAnalysesRequestBuilder instantiates a new ItemItemCodeScanningAnalysesRequestBuilder and sets the default values. +func NewItemItemCodeScanningAnalysesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAnalysesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningAnalysesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the details of all code scanning analyses for a repository,starting with the most recent.The response is paginated and you can use the `page` and `per_page` parametersto list the analyses you're interested in.By default 30 analyses are listed per page.The `rules_count` field in the response give the number of rulesthat were run in the analysis.For very old analyses this data is not available,and `0` is returned in this field.> [!WARNING]> **Deprecation notice:** The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.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 []CodeScanningAnalysisable 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 Analyses503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/code-scanning/code-scanning#list-code-scanning-analyses-for-a-repository +func (m *ItemItemCodeScanningAnalysesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAnalysesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAnalysisable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAnalyses503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningAnalysisFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAnalysisable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAnalysisable) + } + } + return val, nil +} +// ToGetRequestInformation lists the details of all code scanning analyses for a repository,starting with the most recent.The response is paginated and you can use the `page` and `per_page` parametersto list the analyses you're interested in.By default 30 analyses are listed per page.The `rules_count` field in the response give the number of rulesthat were run in the analysis.For very old analyses this data is not available,and `0` is returned in this field.> [!WARNING]> **Deprecation notice:** The `tool_name` field is deprecated and will, in future, not be included in the response for this endpoint. The example response reflects this change. The tool name can now be found inside the `tool` field.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 *ItemItemCodeScanningAnalysesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAnalysesRequestBuilderGetQueryParameters])(*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 *ItemItemCodeScanningAnalysesRequestBuilder when successful +func (m *ItemItemCodeScanningAnalysesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningAnalysesRequestBuilder) { + return NewItemItemCodeScanningAnalysesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_code_scanning_analyses_with_analysis_escaped_item_request_builder.go b/pkg/github/repos/item_item_code_scanning_analyses_with_analysis_escaped_item_request_builder.go new file mode 100644 index 00000000..c311e50a --- /dev/null +++ b/pkg/github/repos/item_item_code_scanning_analyses_with_analysis_escaped_item_request_builder.go @@ -0,0 +1,107 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\analyses\{analysis_id} +type ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderDeleteQueryParameters deletes a specified code scanning analysis from a repository.You can delete one analysis at a time.To delete a series of analyses, start with the most recent analysis and work backwards.Conceptually, the process is similar to the undo function in a text editor.When you list the analyses for a repository,one or more will be identified as deletable in the response:```"deletable": true```An analysis is deletable when it's the most recent in a set of analyses.Typically, a repository will have multiple sets of analysesfor each enabled code scanning tool,where a set is determined by a unique combination of analysis values:* `ref`* `tool`* `category`If you attempt to delete an analysis that is not the most recent in a set,you'll get a 400 response with the message:```Analysis specified is not deletable.```The response from a successful `DELETE` operation provides you withtwo alternative URLs for deleting the next analysis in the set:`next_analysis_url` and `confirm_delete_url`.Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysisin a set. This is a useful option if you want to preserve at least one analysisfor the specified tool in your repository.Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool.When you delete the last analysis in a set, the value of `next_analysis_url` and `confirm_delete_url`in the 200 response is `null`.As an example of the deletion process,let's imagine that you added a workflow that configured a particular code scanning toolto analyze the code in a repository. This tool has added 15 analyses:10 on the default branch, and another 5 on a topic branch.You therefore have two separate sets of analyses for this tool.You've now decided that you want to remove all of the analyses for the tool.To do this you must make 15 separate deletion requests.To start, you must find an analysis that's identified as deletable.Each set of analyses always has one that's identified as deletable.Having found the deletable analysis for one of the two sets,delete this analysis and then continue deleting the next analysis in the set until they're all deleted.Then repeat the process for the second set.The procedure therefore consists of a nested loop:**Outer loop**:* List the analyses for the repository, filtered by tool.* Parse this list to find a deletable analysis. If found: **Inner loop**: * Delete the identified analysis. * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration.The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely.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. +type ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderDeleteQueryParameters struct { + // Allow deletion if the specified analysis is the last in a set. If you attempt to delete the final analysis in a set without setting this parameter to `true`, you'll get a 400 response with the message: `Analysis is last of its type and deletion may result in the loss of historical alert data. Please specify confirm_delete.` + Confirm_delete *string `uriparametername:"confirm_delete"` +} +// NewItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderInternal instantiates a new ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) { + m := &ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/analyses/{analysis_id}{?confirm_delete*}", pathParameters), + } + return m +} +// NewItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder instantiates a new ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a specified code scanning analysis from a repository.You can delete one analysis at a time.To delete a series of analyses, start with the most recent analysis and work backwards.Conceptually, the process is similar to the undo function in a text editor.When you list the analyses for a repository,one or more will be identified as deletable in the response:```"deletable": true```An analysis is deletable when it's the most recent in a set of analyses.Typically, a repository will have multiple sets of analysesfor each enabled code scanning tool,where a set is determined by a unique combination of analysis values:* `ref`* `tool`* `category`If you attempt to delete an analysis that is not the most recent in a set,you'll get a 400 response with the message:```Analysis specified is not deletable.```The response from a successful `DELETE` operation provides you withtwo alternative URLs for deleting the next analysis in the set:`next_analysis_url` and `confirm_delete_url`.Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysisin a set. This is a useful option if you want to preserve at least one analysisfor the specified tool in your repository.Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool.When you delete the last analysis in a set, the value of `next_analysis_url` and `confirm_delete_url`in the 200 response is `null`.As an example of the deletion process,let's imagine that you added a workflow that configured a particular code scanning toolto analyze the code in a repository. This tool has added 15 analyses:10 on the default branch, and another 5 on a topic branch.You therefore have two separate sets of analyses for this tool.You've now decided that you want to remove all of the analyses for the tool.To do this you must make 15 separate deletion requests.To start, you must find an analysis that's identified as deletable.Each set of analyses always has one that's identified as deletable.Having found the deletable analysis for one of the two sets,delete this analysis and then continue deleting the next analysis in the set until they're all deleted.Then repeat the process for the second set.The procedure therefore consists of a nested loop:**Outer loop**:* List the analyses for the repository, filtered by tool.* Parse this list to find a deletable analysis. If found: **Inner loop**: * Delete the identified analysis. * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration.The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely.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 CodeScanningAnalysisDeletionable 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 CodeScanningAnalysisDeletion503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/code-scanning/code-scanning#delete-a-code-scanning-analysis-from-a-repository +func (m *ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderDeleteQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAnalysisDeletionable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningAnalysisDeletion503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningAnalysisDeletionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAnalysisDeletionable), nil +} +// Get gets a specified code scanning analysis for a repository.The default JSON response contains fields that describe the analysis.This includes the Git reference and commit SHA to which the analysis relates,the datetime of the analysis, the name of the code scanning tool,and the number of alerts.The `rules_count` field in the default response give the number of rulesthat were run in the analysis.For very old analyses this data is not available,and `0` is returned in this field.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/sarif+json`**: Instead of returning a summary of the analysis, this endpoint returns a subset of the analysis data that was uploaded. The data is formatted as [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). It also returns additional data such as the `github/alertNumber` and `github/alertUrl` properties.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 CodeScanningAnalysisable 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 CodeScanningAnalysis503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository +func (m *ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAnalysisable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningAnalysis503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningAnalysisFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningAnalysisable), nil +} +// ToDeleteRequestInformation deletes a specified code scanning analysis from a repository.You can delete one analysis at a time.To delete a series of analyses, start with the most recent analysis and work backwards.Conceptually, the process is similar to the undo function in a text editor.When you list the analyses for a repository,one or more will be identified as deletable in the response:```"deletable": true```An analysis is deletable when it's the most recent in a set of analyses.Typically, a repository will have multiple sets of analysesfor each enabled code scanning tool,where a set is determined by a unique combination of analysis values:* `ref`* `tool`* `category`If you attempt to delete an analysis that is not the most recent in a set,you'll get a 400 response with the message:```Analysis specified is not deletable.```The response from a successful `DELETE` operation provides you withtwo alternative URLs for deleting the next analysis in the set:`next_analysis_url` and `confirm_delete_url`.Use the `next_analysis_url` URL if you want to avoid accidentally deleting the final analysisin a set. This is a useful option if you want to preserve at least one analysisfor the specified tool in your repository.Use the `confirm_delete_url` URL if you are content to remove all analyses for a tool.When you delete the last analysis in a set, the value of `next_analysis_url` and `confirm_delete_url`in the 200 response is `null`.As an example of the deletion process,let's imagine that you added a workflow that configured a particular code scanning toolto analyze the code in a repository. This tool has added 15 analyses:10 on the default branch, and another 5 on a topic branch.You therefore have two separate sets of analyses for this tool.You've now decided that you want to remove all of the analyses for the tool.To do this you must make 15 separate deletion requests.To start, you must find an analysis that's identified as deletable.Each set of analyses always has one that's identified as deletable.Having found the deletable analysis for one of the two sets,delete this analysis and then continue deleting the next analysis in the set until they're all deleted.Then repeat the process for the second set.The procedure therefore consists of a nested loop:**Outer loop**:* List the analyses for the repository, filtered by tool.* Parse this list to find a deletable analysis. If found: **Inner loop**: * Delete the identified analysis. * Parse the response for the value of `confirm_delete_url` and, if found, use this in the next iteration.The above process assumes that you want to remove all trace of the tool's analyses from the GitHub user interface, for the specified repository, and it therefore uses the `confirm_delete_url` value. Alternatively, you could use the `next_analysis_url` value, which would leave the last analysis in each set undeleted to avoid removing a tool's analysis entirely.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 *ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilderDeleteQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToGetRequestInformation gets a specified code scanning analysis for a repository.The default JSON response contains fields that describe the analysis.This includes the Git reference and commit SHA to which the analysis relates,the datetime of the analysis, the name of the code scanning tool,and the number of alerts.The `rules_count` field in the default response give the number of rulesthat were run in the analysis.For very old analyses this data is not available,and `0` is returned in this field.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/sarif+json`**: Instead of returning a summary of the analysis, this endpoint returns a subset of the analysis data that was uploaded. The data is formatted as [SARIF version 2.1.0](https://docs.oasis-open.org/sarif/sarif/v2.1.0/cs01/sarif-v2.1.0-cs01.html). It also returns additional data such as the `github/alertNumber` and `github/alertUrl` properties.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 *ItemItemCodeScanningAnalysesWithAnalysis_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder when successful +func (m *ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder) { + return NewItemItemCodeScanningAnalysesWithAnalysis_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_code_scanning_default_setup_request_builder.go b/pkg/github/repos/item_item_code_scanning_default_setup_request_builder.go new file mode 100644 index 00000000..220f2c34 --- /dev/null +++ b/pkg/github/repos/item_item_code_scanning_default_setup_request_builder.go @@ -0,0 +1,106 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCodeScanningDefaultSetupRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\default-setup +type ItemItemCodeScanningDefaultSetupRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCodeScanningDefaultSetupRequestBuilderInternal instantiates a new ItemItemCodeScanningDefaultSetupRequestBuilder and sets the default values. +func NewItemItemCodeScanningDefaultSetupRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningDefaultSetupRequestBuilder) { + m := &ItemItemCodeScanningDefaultSetupRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/default-setup", pathParameters), + } + return m +} +// NewItemItemCodeScanningDefaultSetupRequestBuilder instantiates a new ItemItemCodeScanningDefaultSetupRequestBuilder and sets the default values. +func NewItemItemCodeScanningDefaultSetupRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningDefaultSetupRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningDefaultSetupRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a code scanning default setup configuration.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 CodeScanningDefaultSetupable 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 CodeScanningDefaultSetup503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/code-scanning/code-scanning#get-a-code-scanning-default-setup-configuration +func (m *ItemItemCodeScanningDefaultSetupRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningDefaultSetupable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningDefaultSetup503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningDefaultSetupFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningDefaultSetupable), nil +} +// Patch updates a code scanning default setup configuration.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 EmptyObjectable 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 +// returns a EmptyObject503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/code-scanning/code-scanning#update-a-code-scanning-default-setup-configuration +func (m *ItemItemCodeScanningDefaultSetupRequestBuilder) Patch(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningDefaultSetupUpdateable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObject503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToGetRequestInformation gets a code scanning default setup configuration.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 *ItemItemCodeScanningDefaultSetupRequestBuilder) 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 scanning default setup configuration.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 *ItemItemCodeScanningDefaultSetupRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningDefaultSetupUpdateable, 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 *ItemItemCodeScanningDefaultSetupRequestBuilder when successful +func (m *ItemItemCodeScanningDefaultSetupRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningDefaultSetupRequestBuilder) { + return NewItemItemCodeScanningDefaultSetupRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_code_scanning_request_builder.go b/pkg/github/repos/item_item_code_scanning_request_builder.go new file mode 100644 index 00000000..51d17202 --- /dev/null +++ b/pkg/github/repos/item_item_code_scanning_request_builder.go @@ -0,0 +1,43 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCodeScanningRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning +type ItemItemCodeScanningRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemItemCodeScanningAlertsRequestBuilder when successful +func (m *ItemItemCodeScanningRequestBuilder) Alerts()(*ItemItemCodeScanningAlertsRequestBuilder) { + return NewItemItemCodeScanningAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Analyses the analyses property +// returns a *ItemItemCodeScanningAnalysesRequestBuilder when successful +func (m *ItemItemCodeScanningRequestBuilder) Analyses()(*ItemItemCodeScanningAnalysesRequestBuilder) { + return NewItemItemCodeScanningAnalysesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCodeScanningRequestBuilderInternal instantiates a new ItemItemCodeScanningRequestBuilder and sets the default values. +func NewItemItemCodeScanningRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningRequestBuilder) { + m := &ItemItemCodeScanningRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning", pathParameters), + } + return m +} +// NewItemItemCodeScanningRequestBuilder instantiates a new ItemItemCodeScanningRequestBuilder and sets the default values. +func NewItemItemCodeScanningRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningRequestBuilderInternal(urlParams, requestAdapter) +} +// DefaultSetup the defaultSetup property +// returns a *ItemItemCodeScanningDefaultSetupRequestBuilder when successful +func (m *ItemItemCodeScanningRequestBuilder) DefaultSetup()(*ItemItemCodeScanningDefaultSetupRequestBuilder) { + return NewItemItemCodeScanningDefaultSetupRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Sarifs the sarifs property +// returns a *ItemItemCodeScanningSarifsRequestBuilder when successful +func (m *ItemItemCodeScanningRequestBuilder) Sarifs()(*ItemItemCodeScanningSarifsRequestBuilder) { + return NewItemItemCodeScanningSarifsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/repos/item_item_code_scanning_sarifs_post_request_body.go b/pkg/github/repos/item_item_code_scanning_sarifs_post_request_body.go new file mode 100644 index 00000000..4f004cca --- /dev/null +++ b/pkg/github/repos/item_item_code_scanning_sarifs_post_request_body.go @@ -0,0 +1,207 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCodeScanningSarifsPostRequestBody struct { + // The base directory used in the analysis, as it appears in the SARIF file.This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository. + checkout_uri *string + // The SHA of the commit to which the analysis you are uploading relates. + commit_sha *string + // The full Git reference, formatted as `refs/heads/`,`refs/tags/`, `refs/pull//merge`, or `refs/pull//head`. + ref *string + // A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [`gzip`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. For more information, see "[SARIF support for code scanning](https://docs.github.com/enterprise-server@3.14/code-security/secure-coding/sarif-support-for-code-scanning)." + sarif *string + // The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + started_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The name of the tool used to generate the code scanning analysis. If this parameter is not used, the tool name defaults to "API". If the uploaded SARIF contains a tool GUID, this will be available for filtering using the `tool_guid` parameter of operations such as `GET /repos/{owner}/{repo}/code-scanning/alerts`. + tool_name *string +} +// NewItemItemCodeScanningSarifsPostRequestBody instantiates a new ItemItemCodeScanningSarifsPostRequestBody and sets the default values. +func NewItemItemCodeScanningSarifsPostRequestBody()(*ItemItemCodeScanningSarifsPostRequestBody) { + m := &ItemItemCodeScanningSarifsPostRequestBody{ + } + return m +} +// CreateItemItemCodeScanningSarifsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCodeScanningSarifsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCodeScanningSarifsPostRequestBody(), nil +} +// GetCheckoutUri gets the checkout_uri property value. The base directory used in the analysis, as it appears in the SARIF file.This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository. +// returns a *string when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetCheckoutUri()(*string) { + return m.checkout_uri +} +// GetCommitSha gets the commit_sha property value. The SHA of the commit to which the analysis you are uploading relates. +// returns a *string when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetCommitSha()(*string) { + return m.commit_sha +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["checkout_uri"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCheckoutUri(val) + } + return nil + } + res["commit_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitSha(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["sarif"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSarif(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["tool_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetToolName(val) + } + return nil + } + return res +} +// GetRef gets the ref property value. The full Git reference, formatted as `refs/heads/`,`refs/tags/`, `refs/pull//merge`, or `refs/pull//head`. +// returns a *string when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetRef()(*string) { + return m.ref +} +// GetSarif gets the sarif property value. A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [`gzip`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. For more information, see "[SARIF support for code scanning](https://docs.github.com/enterprise-server@3.14/code-security/secure-coding/sarif-support-for-code-scanning)." +// returns a *string when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetSarif()(*string) { + return m.sarif +} +// GetStartedAt gets the started_at property value. The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.started_at +} +// GetToolName gets the tool_name property value. The name of the tool used to generate the code scanning analysis. If this parameter is not used, the tool name defaults to "API". If the uploaded SARIF contains a tool GUID, this will be available for filtering using the `tool_guid` parameter of operations such as `GET /repos/{owner}/{repo}/code-scanning/alerts`. +// returns a *string when successful +func (m *ItemItemCodeScanningSarifsPostRequestBody) GetToolName()(*string) { + return m.tool_name +} +// Serialize serializes information the current object +func (m *ItemItemCodeScanningSarifsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("checkout_uri", m.GetCheckoutUri()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_sha", m.GetCommitSha()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sarif", m.GetSarif()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("started_at", m.GetStartedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tool_name", m.GetToolName()) + if err != nil { + return err + } + } + return nil +} +// SetCheckoutUri sets the checkout_uri property value. The base directory used in the analysis, as it appears in the SARIF file.This property is used to convert file paths from absolute to relative, so that alerts can be mapped to their correct location in the repository. +func (m *ItemItemCodeScanningSarifsPostRequestBody) SetCheckoutUri(value *string)() { + m.checkout_uri = value +} +// SetCommitSha sets the commit_sha property value. The SHA of the commit to which the analysis you are uploading relates. +func (m *ItemItemCodeScanningSarifsPostRequestBody) SetCommitSha(value *string)() { + m.commit_sha = value +} +// SetRef sets the ref property value. The full Git reference, formatted as `refs/heads/`,`refs/tags/`, `refs/pull//merge`, or `refs/pull//head`. +func (m *ItemItemCodeScanningSarifsPostRequestBody) SetRef(value *string)() { + m.ref = value +} +// SetSarif sets the sarif property value. A Base64 string representing the SARIF file to upload. You must first compress your SARIF file using [`gzip`](http://www.gnu.org/software/gzip/manual/gzip.html) and then translate the contents of the file into a Base64 encoding string. For more information, see "[SARIF support for code scanning](https://docs.github.com/enterprise-server@3.14/code-security/secure-coding/sarif-support-for-code-scanning)." +func (m *ItemItemCodeScanningSarifsPostRequestBody) SetSarif(value *string)() { + m.sarif = value +} +// SetStartedAt sets the started_at property value. The time that the analysis run began. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *ItemItemCodeScanningSarifsPostRequestBody) SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.started_at = value +} +// SetToolName sets the tool_name property value. The name of the tool used to generate the code scanning analysis. If this parameter is not used, the tool name defaults to "API". If the uploaded SARIF contains a tool GUID, this will be available for filtering using the `tool_guid` parameter of operations such as `GET /repos/{owner}/{repo}/code-scanning/alerts`. +func (m *ItemItemCodeScanningSarifsPostRequestBody) SetToolName(value *string)() { + m.tool_name = value +} +type ItemItemCodeScanningSarifsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCheckoutUri()(*string) + GetCommitSha()(*string) + GetRef()(*string) + GetSarif()(*string) + GetStartedAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetToolName()(*string) + SetCheckoutUri(value *string)() + SetCommitSha(value *string)() + SetRef(value *string)() + SetSarif(value *string)() + SetStartedAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetToolName(value *string)() +} diff --git a/pkg/github/repos/item_item_code_scanning_sarifs_request_builder.go b/pkg/github/repos/item_item_code_scanning_sarifs_request_builder.go new file mode 100644 index 00000000..89f3c175 --- /dev/null +++ b/pkg/github/repos/item_item_code_scanning_sarifs_request_builder.go @@ -0,0 +1,81 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCodeScanningSarifsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\sarifs +type ItemItemCodeScanningSarifsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// BySarif_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.codeScanning.sarifs.item collection +// returns a *ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder when successful +func (m *ItemItemCodeScanningSarifsRequestBuilder) BySarif_id(sarif_id string)(*ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if sarif_id != "" { + urlTplParams["sarif_id"] = sarif_id + } + return NewItemItemCodeScanningSarifsWithSarif_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCodeScanningSarifsRequestBuilderInternal instantiates a new ItemItemCodeScanningSarifsRequestBuilder and sets the default values. +func NewItemItemCodeScanningSarifsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningSarifsRequestBuilder) { + m := &ItemItemCodeScanningSarifsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/sarifs", pathParameters), + } + return m +} +// NewItemItemCodeScanningSarifsRequestBuilder instantiates a new ItemItemCodeScanningSarifsRequestBuilder and sets the default values. +func NewItemItemCodeScanningSarifsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningSarifsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningSarifsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. For troubleshooting information, see "[Troubleshooting SARIF uploads](https://docs.github.com/enterprise-server@3.14/code-security/code-scanning/troubleshooting-sarif)."There are two places where you can upload code scanning results. - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)." - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see "[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)."You must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example:```gzip -c analysis-data.sarif | base64 -w0```SARIF upload supports a maximum number of entries per the following data objects, and an analysis will be rejected if any of these objects is above its maximum value. For some objects, there are additional values over which the entries will be ignored while keeping the most important entries whenever applicable.To get the most out of your analysis when it includes data above the supported limits, try to optimize the analysis configuration. For example, for the CodeQL tool, identify and remove the most noisy queries. For more information, see "[SARIF results exceed one or more limits](https://docs.github.com/enterprise-server@3.14/code-security/code-scanning/troubleshooting-sarif/results-exceed-limit)."| **SARIF data** | **Maximum values** | **Additional limits** ||----------------------------------|:------------------:|----------------------------------------------------------------------------------|| Runs per file | 20 | || Results per run | 25,000 | Only the top 5,000 results will be included, prioritized by severity. || Rules per run | 25,000 | || Tool extensions per run | 100 | || Thread Flow Locations per result | 10,000 | Only the top 1,000 Thread Flow Locations will be included, using prioritization. || Location per result | 1,000 | Only 100 locations will be included. || Tags per rule | 20 | Only 10 tags will be included. |The `202 Accepted` response includes an `id` value.You can use this ID to check the status of the upload by using it in the `/sarifs/{sarif_id}` endpoint.For more information, see "[Get information about a SARIF upload](/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload)."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.This endpoint is limited to 1,000 requests per hour for each user or app installation calling it. +// returns a CodeScanningSarifsReceiptable 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 CodeScanningSarifsReceipt503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/code-scanning/code-scanning#upload-an-analysis-as-sarif-data +func (m *ItemItemCodeScanningSarifsRequestBuilder) Post(ctx context.Context, body ItemItemCodeScanningSarifsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningSarifsReceiptable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningSarifsReceipt503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningSarifsReceiptFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningSarifsReceiptable), nil +} +// ToPostRequestInformation uploads SARIF data containing the results of a code scanning analysis to make the results available in a repository. For troubleshooting information, see "[Troubleshooting SARIF uploads](https://docs.github.com/enterprise-server@3.14/code-security/code-scanning/troubleshooting-sarif)."There are two places where you can upload code scanning results. - If you upload to a pull request, for example `--ref refs/pull/42/merge` or `--ref refs/pull/42/head`, then the results appear as alerts in a pull request check. For more information, see "[Triaging code scanning alerts in pull requests](/code-security/secure-coding/triaging-code-scanning-alerts-in-pull-requests)." - If you upload to a branch, for example `--ref refs/heads/my-branch`, then the results appear in the **Security** tab for your repository. For more information, see "[Managing code scanning alerts for your repository](/code-security/secure-coding/managing-code-scanning-alerts-for-your-repository#viewing-the-alerts-for-a-repository)."You must compress the SARIF-formatted analysis data that you want to upload, using `gzip`, and then encode it as a Base64 format string. For example:```gzip -c analysis-data.sarif | base64 -w0```SARIF upload supports a maximum number of entries per the following data objects, and an analysis will be rejected if any of these objects is above its maximum value. For some objects, there are additional values over which the entries will be ignored while keeping the most important entries whenever applicable.To get the most out of your analysis when it includes data above the supported limits, try to optimize the analysis configuration. For example, for the CodeQL tool, identify and remove the most noisy queries. For more information, see "[SARIF results exceed one or more limits](https://docs.github.com/enterprise-server@3.14/code-security/code-scanning/troubleshooting-sarif/results-exceed-limit)."| **SARIF data** | **Maximum values** | **Additional limits** ||----------------------------------|:------------------:|----------------------------------------------------------------------------------|| Runs per file | 20 | || Results per run | 25,000 | Only the top 5,000 results will be included, prioritized by severity. || Rules per run | 25,000 | || Tool extensions per run | 100 | || Thread Flow Locations per result | 10,000 | Only the top 1,000 Thread Flow Locations will be included, using prioritization. || Location per result | 1,000 | Only 100 locations will be included. || Tags per rule | 20 | Only 10 tags will be included. |The `202 Accepted` response includes an `id` value.You can use this ID to check the status of the upload by using it in the `/sarifs/{sarif_id}` endpoint.For more information, see "[Get information about a SARIF upload](/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload)."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.This endpoint is limited to 1,000 requests per hour for each user or app installation calling it. +// returns a *RequestInformation when successful +func (m *ItemItemCodeScanningSarifsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemCodeScanningSarifsPostRequestBodyable, 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 *ItemItemCodeScanningSarifsRequestBuilder when successful +func (m *ItemItemCodeScanningSarifsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningSarifsRequestBuilder) { + return NewItemItemCodeScanningSarifsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_code_scanning_sarifs_with_sarif_escaped_item_request_builder.go b/pkg/github/repos/item_item_code_scanning_sarifs_with_sarif_escaped_item_request_builder.go new file mode 100644 index 00000000..265d2c03 --- /dev/null +++ b/pkg/github/repos/item_item_code_scanning_sarifs_with_sarif_escaped_item_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\code-scanning\sarifs\{sarif_id} +type ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCodeScanningSarifsWithSarif_ItemRequestBuilderInternal instantiates a new ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningSarifsWithSarif_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder) { + m := &ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/code-scanning/sarifs/{sarif_id}", pathParameters), + } + return m +} +// NewItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder instantiates a new ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder and sets the default values. +func NewItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeScanningSarifsWithSarif_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "[Get a code scanning analysis for a repository](/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository)."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 CodeScanningSarifsStatusable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a CodeScanningSarifsStatus503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/code-scanning/code-scanning#get-information-about-a-sarif-upload +func (m *ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningSarifsStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningSarifsStatus503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeScanningSarifsStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeScanningSarifsStatusable), nil +} +// ToGetRequestInformation gets information about a SARIF upload, including the status and the URL of the analysis that was uploaded so that you can retrieve details of the analysis. For more information, see "[Get a code scanning analysis for a repository](/rest/code-scanning/code-scanning#get-a-code-scanning-analysis-for-a-repository)."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 *ItemItemCodeScanningSarifsWithSarif_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder when successful +func (m *ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder) { + return NewItemItemCodeScanningSarifsWithSarif_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_codeowners_errors_request_builder.go b/pkg/github/repos/item_item_codeowners_errors_request_builder.go new file mode 100644 index 00000000..ea8e9008 --- /dev/null +++ b/pkg/github/repos/item_item_codeowners_errors_request_builder.go @@ -0,0 +1,62 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCodeownersErrorsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\codeowners\errors +type ItemItemCodeownersErrorsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCodeownersErrorsRequestBuilderGetQueryParameters list any syntax errors that are detected in the CODEOWNERSfile.For more information about the correct CODEOWNERS syntax,see "[About code owners](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners)." +type ItemItemCodeownersErrorsRequestBuilderGetQueryParameters struct { + // A branch, tag or commit name used to determine which version of the CODEOWNERS file to use. Default: the repository's default branch (e.g. `main`) + Ref *string `uriparametername:"ref"` +} +// NewItemItemCodeownersErrorsRequestBuilderInternal instantiates a new ItemItemCodeownersErrorsRequestBuilder and sets the default values. +func NewItemItemCodeownersErrorsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeownersErrorsRequestBuilder) { + m := &ItemItemCodeownersErrorsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/codeowners/errors{?ref*}", pathParameters), + } + return m +} +// NewItemItemCodeownersErrorsRequestBuilder instantiates a new ItemItemCodeownersErrorsRequestBuilder and sets the default values. +func NewItemItemCodeownersErrorsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeownersErrorsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeownersErrorsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list any syntax errors that are detected in the CODEOWNERSfile.For more information about the correct CODEOWNERS syntax,see "[About code owners](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners)." +// returns a CodeownersErrorsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#list-codeowners-errors +func (m *ItemItemCodeownersErrorsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeownersErrorsRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeownersErrorsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeownersErrorsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeownersErrorsable), nil +} +// ToGetRequestInformation list any syntax errors that are detected in the CODEOWNERSfile.For more information about the correct CODEOWNERS syntax,see "[About code owners](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners)." +// returns a *RequestInformation when successful +func (m *ItemItemCodeownersErrorsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCodeownersErrorsRequestBuilderGetQueryParameters])(*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 *ItemItemCodeownersErrorsRequestBuilder when successful +func (m *ItemItemCodeownersErrorsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCodeownersErrorsRequestBuilder) { + return NewItemItemCodeownersErrorsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_codeowners_request_builder.go b/pkg/github/repos/item_item_codeowners_request_builder.go new file mode 100644 index 00000000..e9a545c2 --- /dev/null +++ b/pkg/github/repos/item_item_codeowners_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCodeownersRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\codeowners +type ItemItemCodeownersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCodeownersRequestBuilderInternal instantiates a new ItemItemCodeownersRequestBuilder and sets the default values. +func NewItemItemCodeownersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeownersRequestBuilder) { + m := &ItemItemCodeownersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/codeowners", pathParameters), + } + return m +} +// NewItemItemCodeownersRequestBuilder instantiates a new ItemItemCodeownersRequestBuilder and sets the default values. +func NewItemItemCodeownersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCodeownersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCodeownersRequestBuilderInternal(urlParams, requestAdapter) +} +// Errors the errors property +// returns a *ItemItemCodeownersErrorsRequestBuilder when successful +func (m *ItemItemCodeownersRequestBuilder) Errors()(*ItemItemCodeownersErrorsRequestBuilder) { + return NewItemItemCodeownersErrorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/repos/item_item_collaborators_item_permission_request_builder.go b/pkg/github/repos/item_item_collaborators_item_permission_request_builder.go new file mode 100644 index 00000000..f0374eef --- /dev/null +++ b/pkg/github/repos/item_item_collaborators_item_permission_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCollaboratorsItemPermissionRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\collaborators\{username}\permission +type ItemItemCollaboratorsItemPermissionRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCollaboratorsItemPermissionRequestBuilderInternal instantiates a new ItemItemCollaboratorsItemPermissionRequestBuilder and sets the default values. +func NewItemItemCollaboratorsItemPermissionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCollaboratorsItemPermissionRequestBuilder) { + m := &ItemItemCollaboratorsItemPermissionRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/collaborators/{username}/permission", pathParameters), + } + return m +} +// NewItemItemCollaboratorsItemPermissionRequestBuilder instantiates a new ItemItemCollaboratorsItemPermissionRequestBuilder and sets the default values. +func NewItemItemCollaboratorsItemPermissionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCollaboratorsItemPermissionRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCollaboratorsItemPermissionRequestBuilderInternal(urlParams, requestAdapter) +} +// Get checks the repository permission of a collaborator. The possible repositorypermissions are `admin`, `write`, `read`, and `none`.*Note*: The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the`maintain` role is mapped to `write` and the `triage` role is mapped to `read`. To determine the role assigned to thecollaborator, see the `role_name` attribute, which will provide the full role name, including custom roles. The`permissions` hash can also be used to determine which base level of access the collaborator has to the repository. +// returns a RepositoryCollaboratorPermissionable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/collaborators/collaborators#get-repository-permissions-for-a-user +func (m *ItemItemCollaboratorsItemPermissionRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryCollaboratorPermissionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryCollaboratorPermissionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryCollaboratorPermissionable), nil +} +// ToGetRequestInformation checks the repository permission of a collaborator. The possible repositorypermissions are `admin`, `write`, `read`, and `none`.*Note*: The `permission` attribute provides the legacy base roles of `admin`, `write`, `read`, and `none`, where the`maintain` role is mapped to `write` and the `triage` role is mapped to `read`. To determine the role assigned to thecollaborator, see the `role_name` attribute, which will provide the full role name, including custom roles. The`permissions` hash can also be used to determine which base level of access the collaborator has to the repository. +// returns a *RequestInformation when successful +func (m *ItemItemCollaboratorsItemPermissionRequestBuilder) 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 *ItemItemCollaboratorsItemPermissionRequestBuilder when successful +func (m *ItemItemCollaboratorsItemPermissionRequestBuilder) WithUrl(rawUrl string)(*ItemItemCollaboratorsItemPermissionRequestBuilder) { + return NewItemItemCollaboratorsItemPermissionRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_collaborators_item_with_username_put_request_body.go b/pkg/github/repos/item_item_collaborators_item_with_username_put_request_body.go new file mode 100644 index 00000000..7f74d5f0 --- /dev/null +++ b/pkg/github/repos/item_item_collaborators_item_with_username_put_request_body.go @@ -0,0 +1,82 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCollaboratorsItemWithUsernamePutRequestBody 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 permission to grant the collaborator. **Only valid on organization-owned repositories.** + permission *string +} +// NewItemItemCollaboratorsItemWithUsernamePutRequestBody instantiates a new ItemItemCollaboratorsItemWithUsernamePutRequestBody and sets the default values. +func NewItemItemCollaboratorsItemWithUsernamePutRequestBody()(*ItemItemCollaboratorsItemWithUsernamePutRequestBody) { + m := &ItemItemCollaboratorsItemWithUsernamePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + permissionValue := "push" + m.SetPermission(&permissionValue) + return m +} +// CreateItemItemCollaboratorsItemWithUsernamePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCollaboratorsItemWithUsernamePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCollaboratorsItemWithUsernamePutRequestBody(), 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 *ItemItemCollaboratorsItemWithUsernamePutRequestBody) 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 *ItemItemCollaboratorsItemWithUsernamePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["permission"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPermission(val) + } + return nil + } + return res +} +// GetPermission gets the permission property value. The permission to grant the collaborator. **Only valid on organization-owned repositories.** +// returns a *string when successful +func (m *ItemItemCollaboratorsItemWithUsernamePutRequestBody) GetPermission()(*string) { + return m.permission +} +// Serialize serializes information the current object +func (m *ItemItemCollaboratorsItemWithUsernamePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("permission", m.GetPermission()) + 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 *ItemItemCollaboratorsItemWithUsernamePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPermission sets the permission property value. The permission to grant the collaborator. **Only valid on organization-owned repositories.** +func (m *ItemItemCollaboratorsItemWithUsernamePutRequestBody) SetPermission(value *string)() { + m.permission = value +} +type ItemItemCollaboratorsItemWithUsernamePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPermission()(*string) + SetPermission(value *string)() +} diff --git a/pkg/github/repos/item_item_collaborators_request_builder.go b/pkg/github/repos/item_item_collaborators_request_builder.go new file mode 100644 index 00000000..9cf931ce --- /dev/null +++ b/pkg/github/repos/item_item_collaborators_request_builder.go @@ -0,0 +1,88 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i293299893727ad48e14dcd30db71529cc064f23afc28739e14075a132764fd44 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/collaborators" +) + +// ItemItemCollaboratorsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\collaborators +type ItemItemCollaboratorsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCollaboratorsRequestBuilderGetQueryParameters for organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint.Team members will include the members of child teams.The authenticated user must have push access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. +type ItemItemCollaboratorsRequestBuilderGetQueryParameters struct { + // Filter collaborators returned by their affiliation. `outside` means all outside collaborators of an organization-owned repository. `direct` means all collaborators with permissions to an organization-owned repository, regardless of organization membership status. `all` means all collaborators the authenticated user can see. + Affiliation *i293299893727ad48e14dcd30db71529cc064f23afc28739e14075a132764fd44.GetAffiliationQueryParameterType `uriparametername:"affiliation"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Filter collaborators by the permissions they have on the repository. If not specified, all collaborators will be returned. + Permission *i293299893727ad48e14dcd30db71529cc064f23afc28739e14075a132764fd44.GetPermissionQueryParameterType `uriparametername:"permission"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.collaborators.item collection +// returns a *ItemItemCollaboratorsWithUsernameItemRequestBuilder when successful +func (m *ItemItemCollaboratorsRequestBuilder) ByUsername(username string)(*ItemItemCollaboratorsWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemItemCollaboratorsWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCollaboratorsRequestBuilderInternal instantiates a new ItemItemCollaboratorsRequestBuilder and sets the default values. +func NewItemItemCollaboratorsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCollaboratorsRequestBuilder) { + m := &ItemItemCollaboratorsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/collaborators{?affiliation*,page*,per_page*,permission*}", pathParameters), + } + return m +} +// NewItemItemCollaboratorsRequestBuilder instantiates a new ItemItemCollaboratorsRequestBuilder and sets the default values. +func NewItemItemCollaboratorsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCollaboratorsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCollaboratorsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get for organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint.Team members will include the members of child teams.The authenticated user must have push access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. +// returns a []Collaboratorable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/collaborators/collaborators#list-repository-collaborators +func (m *ItemItemCollaboratorsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCollaboratorsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Collaboratorable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCollaboratorFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Collaboratorable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Collaboratorable) + } + } + return val, nil +} +// ToGetRequestInformation for organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.Organization members with write, maintain, or admin privileges on the organization-owned repository can use this endpoint.Team members will include the members of child teams.The authenticated user must have push access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCollaboratorsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCollaboratorsRequestBuilderGetQueryParameters])(*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 *ItemItemCollaboratorsRequestBuilder when successful +func (m *ItemItemCollaboratorsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCollaboratorsRequestBuilder) { + return NewItemItemCollaboratorsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_collaborators_with_username_item_request_builder.go b/pkg/github/repos/item_item_collaborators_with_username_item_request_builder.go new file mode 100644 index 00000000..2c7a87f7 --- /dev/null +++ b/pkg/github/repos/item_item_collaborators_with_username_item_request_builder.go @@ -0,0 +1,119 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCollaboratorsWithUsernameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\collaborators\{username} +type ItemItemCollaboratorsWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCollaboratorsWithUsernameItemRequestBuilderInternal instantiates a new ItemItemCollaboratorsWithUsernameItemRequestBuilder and sets the default values. +func NewItemItemCollaboratorsWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCollaboratorsWithUsernameItemRequestBuilder) { + m := &ItemItemCollaboratorsWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/collaborators/{username}", pathParameters), + } + return m +} +// NewItemItemCollaboratorsWithUsernameItemRequestBuilder instantiates a new ItemItemCollaboratorsWithUsernameItemRequestBuilder and sets the default values. +func NewItemItemCollaboratorsWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCollaboratorsWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCollaboratorsWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a collaborator from a repository.To use this endpoint, the authenticated user must either be an administrator of the repository or target themselves for removal.This endpoint also:- Cancels any outstanding invitations- Unasigns the user from any issues- Removes access to organization projects if the user is not an organization member and is not a collaborator on any other organization repositories.- Unstars the repository- Updates access permissions to packagesRemoving a user as a collaborator has the following effects on forks: - If the user had access to a fork through their membership to this repository, the user will also be removed from the fork. - If the user had their own fork of the repository, the fork will be deleted. - If the user still has read access to the repository, open pull requests by this user from a fork will be denied.> [!NOTE]> A user can still have access to the repository through organization permissions like base repository permissions.Although the API responds immediately, the additional permission updates might take some extra time to complete in the background.For more information on fork permissions, see "[About permissions and visibility of forks](https://docs.github.com/enterprise-server@3.14/pull-requests/collaborating-with-pull-requests/working-with-forks/about-permissions-and-visibility-of-forks)". +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/collaborators/collaborators#remove-a-repository-collaborator +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get for organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.Team members will include the members of child teams.The authenticated user must have push access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/collaborators/collaborators#check-if-a-user-is-a-repository-collaborator +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Permission the permission property +// returns a *ItemItemCollaboratorsItemPermissionRequestBuilder when successful +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) Permission()(*ItemItemCollaboratorsItemPermissionRequestBuilder) { + return NewItemItemCollaboratorsItemPermissionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Put this endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."Adding an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/enterprise-server@3.14/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)."For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with:```Cannot assign {member} permission of {role name}```Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)."**Updating an existing collaborator's permission level**The endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different `permission` parameter. The response will be a `204`, with no other indication that the permission level changed. +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/collaborators/collaborators#add-a-repository-collaborator +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) Put(ctx context.Context, body ItemItemCollaboratorsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation removes a collaborator from a repository.To use this endpoint, the authenticated user must either be an administrator of the repository or target themselves for removal.This endpoint also:- Cancels any outstanding invitations- Unasigns the user from any issues- Removes access to organization projects if the user is not an organization member and is not a collaborator on any other organization repositories.- Unstars the repository- Updates access permissions to packagesRemoving a user as a collaborator has the following effects on forks: - If the user had access to a fork through their membership to this repository, the user will also be removed from the fork. - If the user had their own fork of the repository, the fork will be deleted. - If the user still has read access to the repository, open pull requests by this user from a fork will be denied.> [!NOTE]> A user can still have access to the repository through organization permissions like base repository permissions.Although the API responds immediately, the additional permission updates might take some extra time to complete in the background.For more information on fork permissions, see "[About permissions and visibility of forks](https://docs.github.com/enterprise-server@3.14/pull-requests/collaborating-with-pull-requests/working-with-forks/about-permissions-and-visibility-of-forks)". +// returns a *RequestInformation when successful +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation for organization-owned repositories, the list of collaborators includes outside collaborators, organization members that are direct collaborators, organization members with access through team memberships, organization members with access through default organization permissions, and organization owners.Team members will include the members of child teams.The authenticated user must have push access to the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:org` and `repo` scopes to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) 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) + return requestInfo, nil +} +// ToPutRequestInformation this endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."Adding an outside collaborator may be restricted by enterprise administrators. For more information, see "[Enforcing repository management policies in your enterprise](https://docs.github.com/enterprise-server@3.14/admin/policies/enforcing-policies-for-your-enterprise/enforcing-repository-management-policies-in-your-enterprise#enforcing-a-policy-for-inviting-outside-collaborators-to-repositories)."For more information on permission levels, see "[Repository permission levels for an organization](https://docs.github.com/enterprise-server@3.14/github/setting-up-and-managing-organizations-and-teams/repository-permission-levels-for-an-organization#permission-levels-for-repositories-owned-by-an-organization)". There are restrictions on which permissions can be granted to organization members when an organization base role is in place. In this case, the permission being given must be equal to or higher than the org base permission. Otherwise, the request will fail with:```Cannot assign {member} permission of {role name}```Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)."**Updating an existing collaborator's permission level**The endpoint can also be used to change the permissions of an existing collaborator without first removing and re-adding the collaborator. To change the permissions, use the same endpoint and pass a different `permission` parameter. The response will be a `204`, with no other indication that the permission level changed. +// returns a *RequestInformation when successful +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemCollaboratorsItemWithUsernamePutRequestBodyable, 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 *ItemItemCollaboratorsWithUsernameItemRequestBuilder when successful +func (m *ItemItemCollaboratorsWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCollaboratorsWithUsernameItemRequestBuilder) { + return NewItemItemCollaboratorsWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_comments_item_reactions_post_request_body.go b/pkg/github/repos/item_item_comments_item_reactions_post_request_body.go new file mode 100644 index 00000000..be6052cb --- /dev/null +++ b/pkg/github/repos/item_item_comments_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCommentsItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemCommentsItemReactionsPostRequestBody instantiates a new ItemItemCommentsItemReactionsPostRequestBody and sets the default values. +func NewItemItemCommentsItemReactionsPostRequestBody()(*ItemItemCommentsItemReactionsPostRequestBody) { + m := &ItemItemCommentsItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCommentsItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCommentsItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCommentsItemReactionsPostRequestBody(), 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 *ItemItemCommentsItemReactionsPostRequestBody) 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 *ItemItemCommentsItemReactionsPostRequestBody) 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 *ItemItemCommentsItemReactionsPostRequestBody) 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 *ItemItemCommentsItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemCommentsItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_comments_item_reactions_request_builder.go b/pkg/github/repos/item_item_comments_item_reactions_request_builder.go new file mode 100644 index 00000000..5cdfdc72 --- /dev/null +++ b/pkg/github/repos/item_item_comments_item_reactions_request_builder.go @@ -0,0 +1,120 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i2daa89030a4a9be72ff596adb42acdd38f379e1d583f9f68dea5e1f91d45ba3d "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/comments/item/reactions" +) + +// ItemItemCommentsItemReactionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\comments\{comment_id}\reactions +type ItemItemCommentsItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommentsItemReactionsRequestBuilderGetQueryParameters list the reactions to a [commit comment](https://docs.github.com/enterprise-server@3.14/rest/commits/comments#get-a-commit-comment). +type ItemItemCommentsItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a commit comment. + Content *i2daa89030a4a9be72ff596adb42acdd38f379e1d583f9f68dea5e1f91d45ba3d.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReaction_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.comments.item.reactions.item collection +// returns a *ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemCommentsItemReactionsRequestBuilder) ByReaction_id(reaction_id int32)(*ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["reaction_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(reaction_id), 10) + return NewItemItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCommentsItemReactionsRequestBuilderInternal instantiates a new ItemItemCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemItemCommentsItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsItemReactionsRequestBuilder) { + m := &ItemItemCommentsItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/comments/{comment_id}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommentsItemReactionsRequestBuilder instantiates a new ItemItemCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemItemCommentsItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommentsItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the reactions to a [commit comment](https://docs.github.com/enterprise-server@3.14/rest/commits/comments#get-a-commit-comment). +// returns a []Reactionable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-a-commit-comment +func (m *ItemItemCommentsItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommentsItemReactionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable) + } + } + return val, nil +} +// Post create a reaction to a [commit comment](https://docs.github.com/enterprise-server@3.14/rest/commits/comments#get-a-commit-comment). A response with an HTTP `200` status means that you already added the reaction type to this commit comment. +// returns a Reactionable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#create-reaction-for-a-commit-comment +func (m *ItemItemCommentsItemReactionsRequestBuilder) Post(ctx context.Context, body ItemItemCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable), nil +} +// ToGetRequestInformation list the reactions to a [commit comment](https://docs.github.com/enterprise-server@3.14/rest/commits/comments#get-a-commit-comment). +// returns a *RequestInformation when successful +func (m *ItemItemCommentsItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommentsItemReactionsRequestBuilderGetQueryParameters])(*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 create a reaction to a [commit comment](https://docs.github.com/enterprise-server@3.14/rest/commits/comments#get-a-commit-comment). A response with an HTTP `200` status means that you already added the reaction type to this commit comment. +// returns a *RequestInformation when successful +func (m *ItemItemCommentsItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemCommentsItemReactionsPostRequestBodyable, 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 *ItemItemCommentsItemReactionsRequestBuilder when successful +func (m *ItemItemCommentsItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommentsItemReactionsRequestBuilder) { + return NewItemItemCommentsItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_comments_item_reactions_with_reaction_escaped_item_request_builder.go b/pkg/github/repos/item_item_comments_item_reactions_with_reaction_escaped_item_request_builder.go new file mode 100644 index 00000000..ac8f0557 --- /dev/null +++ b/pkg/github/repos/item_item_comments_item_reactions_with_reaction_escaped_item_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\comments\{comment_id}\reactions\{reaction_id} +type ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal instantiates a new ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + m := &ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/comments/{comment_id}/reactions/{reaction_id}", pathParameters), + } + return m +} +// NewItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder instantiates a new ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!NOTE]> You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`.Delete a reaction to a [commit comment](https://docs.github.com/enterprise-server@3.14/rest/commits/comments#get-a-commit-comment). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#delete-a-commit-comment-reaction +func (m *ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation > [!NOTE]> You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/comments/:comment_id/reactions/:reaction_id`.Delete a reaction to a [commit comment](https://docs.github.com/enterprise-server@3.14/rest/commits/comments#get-a-commit-comment). +// returns a *RequestInformation when successful +func (m *ItemItemCommentsItemReactionsWithReaction_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) + 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 *ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder) { + return NewItemItemCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_comments_item_with_comment_escaped_patch_request_body.go b/pkg/github/repos/item_item_comments_item_with_comment_escaped_patch_request_body.go new file mode 100644 index 00000000..b4fd2408 --- /dev/null +++ b/pkg/github/repos/item_item_comments_item_with_comment_escaped_patch_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCommentsItemWithComment_PatchRequestBody 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 contents of the comment + body *string +} +// NewItemItemCommentsItemWithComment_PatchRequestBody instantiates a new ItemItemCommentsItemWithComment_PatchRequestBody and sets the default values. +func NewItemItemCommentsItemWithComment_PatchRequestBody()(*ItemItemCommentsItemWithComment_PatchRequestBody) { + m := &ItemItemCommentsItemWithComment_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCommentsItemWithComment_PatchRequestBody(), 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 *ItemItemCommentsItemWithComment_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The contents of the comment +// returns a *string when successful +func (m *ItemItemCommentsItemWithComment_PatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCommentsItemWithComment_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemCommentsItemWithComment_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemItemCommentsItemWithComment_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The contents of the comment +func (m *ItemItemCommentsItemWithComment_PatchRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemItemCommentsItemWithComment_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/pkg/github/repos/item_item_comments_request_builder.go b/pkg/github/repos/item_item_comments_request_builder.go new file mode 100644 index 00000000..52fb7ece --- /dev/null +++ b/pkg/github/repos/item_item_comments_request_builder.go @@ -0,0 +1,78 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCommentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\comments +type ItemItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommentsRequestBuilderGetQueryParameters lists the commit comments for a specified repository. Comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemCommentsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByComment_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.comments.item collection +// returns a *ItemItemCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemItemCommentsRequestBuilder) ByComment_id(comment_id int64)(*ItemItemCommentsWithComment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["comment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(comment_id, 10) + return NewItemItemCommentsWithComment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCommentsRequestBuilderInternal instantiates a new ItemItemCommentsRequestBuilder and sets the default values. +func NewItemItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsRequestBuilder) { + m := &ItemItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/comments{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommentsRequestBuilder instantiates a new ItemItemCommentsRequestBuilder and sets the default values. +func NewItemItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the commit comments for a specified repository. Comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []CommitCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/commits/comments#list-commit-comments-for-a-repository +func (m *ItemItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommentsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCommitCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitCommentable) + } + } + return val, nil +} +// ToGetRequestInformation lists the commit comments for a specified repository. Comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommentsRequestBuilderGetQueryParameters])(*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 *ItemItemCommentsRequestBuilder when successful +func (m *ItemItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommentsRequestBuilder) { + return NewItemItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_comments_with_comment_escaped_item_request_builder.go b/pkg/github/repos/item_item_comments_with_comment_escaped_item_request_builder.go new file mode 100644 index 00000000..d3ba6a46 --- /dev/null +++ b/pkg/github/repos/item_item_comments_with_comment_escaped_item_request_builder.go @@ -0,0 +1,127 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCommentsWithComment_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\comments\{comment_id} +type ItemItemCommentsWithComment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCommentsWithComment_ItemRequestBuilderInternal instantiates a new ItemItemCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemCommentsWithComment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsWithComment_ItemRequestBuilder) { + m := &ItemItemCommentsWithComment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/comments/{comment_id}", pathParameters), + } + return m +} +// NewItemItemCommentsWithComment_ItemRequestBuilder instantiates a new ItemItemCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemCommentsWithComment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommentsWithComment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommentsWithComment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a commit comment +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/commits/comments#delete-a-commit-comment +func (m *ItemItemCommentsWithComment_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 { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a specified commit comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a CommitCommentable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/commits/comments#get-a-commit-comment +func (m *ItemItemCommentsWithComment_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCommitCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitCommentable), nil +} +// Patch updates the contents of a specified commit comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a CommitCommentable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/commits/comments#update-a-commit-comment +func (m *ItemItemCommentsWithComment_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemCommentsItemWithComment_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitCommentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCommitCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitCommentable), nil +} +// Reactions the reactions property +// returns a *ItemItemCommentsItemReactionsRequestBuilder when successful +func (m *ItemItemCommentsWithComment_ItemRequestBuilder) Reactions()(*ItemItemCommentsItemReactionsRequestBuilder) { + return NewItemItemCommentsItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// returns a *RequestInformation when successful +func (m *ItemItemCommentsWithComment_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") + return requestInfo, nil +} +// ToGetRequestInformation gets a specified commit comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemCommentsWithComment_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 the contents of a specified commit comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemCommentsWithComment_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemCommentsItemWithComment_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 *ItemItemCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemItemCommentsWithComment_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommentsWithComment_ItemRequestBuilder) { + return NewItemItemCommentsWithComment_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_commits_commit_escaped_sha_item_request_builder.go b/pkg/github/repos/item_item_commits_commit_escaped_sha_item_request_builder.go new file mode 100644 index 00000000..58da8b95 --- /dev/null +++ b/pkg/github/repos/item_item_commits_commit_escaped_sha_item_request_builder.go @@ -0,0 +1,111 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCommitsCommit_shaItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id} +type ItemItemCommitsCommit_shaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsCommit_shaItemRequestBuilderGetQueryParameters returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.> [!NOTE]> If there are more than 300 files in the commit diff and the default JSON media type is requested, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." Pagination query parameters are not supported for these media types.- **`application/vnd.github.diff`**: Returns the diff of the commit. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.sha`**: Returns the commit's SHA-1 hash. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +type ItemItemCommitsCommit_shaItemRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BranchesWhereHead the branchesWhereHead property +// returns a *ItemItemCommitsItemBranchesWhereHeadRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) BranchesWhereHead()(*ItemItemCommitsItemBranchesWhereHeadRequestBuilder) { + return NewItemItemCommitsItemBranchesWhereHeadRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckRuns the checkRuns property +// returns a *ItemItemCommitsItemCheckRunsRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) CheckRuns()(*ItemItemCommitsItemCheckRunsRequestBuilder) { + return NewItemItemCommitsItemCheckRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckSuites the checkSuites property +// returns a *ItemItemCommitsItemCheckSuitesRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) CheckSuites()(*ItemItemCommitsItemCheckSuitesRequestBuilder) { + return NewItemItemCommitsItemCheckSuitesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemItemCommitsItemCommentsRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) Comments()(*ItemItemCommitsItemCommentsRequestBuilder) { + return NewItemItemCommitsItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCommitsCommit_shaItemRequestBuilderInternal instantiates a new ItemItemCommitsCommit_shaItemRequestBuilder and sets the default values. +func NewItemItemCommitsCommit_shaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsCommit_shaItemRequestBuilder) { + m := &ItemItemCommitsCommit_shaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommitsCommit_shaItemRequestBuilder instantiates a new ItemItemCommitsCommit_shaItemRequestBuilder and sets the default values. +func NewItemItemCommitsCommit_shaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsCommit_shaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsCommit_shaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.> [!NOTE]> If there are more than 300 files in the commit diff and the default JSON media type is requested, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." Pagination query parameters are not supported for these media types.- **`application/vnd.github.diff`**: Returns the diff of the commit. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.sha`**: Returns the commit's SHA-1 hash. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a Commitable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 500 status code +// returns a Commit503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/commits/commits#get-a-commit +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsCommit_shaItemRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Commitable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCommit503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Commitable), nil +} +// Pulls the pulls property +// returns a *ItemItemCommitsItemPullsRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) Pulls()(*ItemItemCommitsItemPullsRequestBuilder) { + return NewItemItemCommitsItemPullsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Status the status property +// returns a *ItemItemCommitsItemStatusRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) Status()(*ItemItemCommitsItemStatusRequestBuilder) { + return NewItemItemCommitsItemStatusRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Statuses the statuses property +// returns a *ItemItemCommitsItemStatusesRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) Statuses()(*ItemItemCommitsItemStatusesRequestBuilder) { + return NewItemItemCommitsItemStatusesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation returns the contents of a single commit reference. You must have `read` access for the repository to use this endpoint.> [!NOTE]> If there are more than 300 files in the commit diff and the default JSON media type is requested, the response will include pagination link headers for the remaining files, up to a limit of 3000 files. Each page contains the static commit information, and the only changes are to the file listing.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)." Pagination query parameters are not supported for these media types.- **`application/vnd.github.diff`**: Returns the diff of the commit. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property. Larger diffs may time out and return a 5xx status code.- **`application/vnd.github.sha`**: Returns the commit's SHA-1 hash. You can use this endpoint to check if a remote reference's SHA-1 hash is the same as your local reference's SHA-1 hash by providing the local SHA-1 reference as the ETag.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsCommit_shaItemRequestBuilderGetQueryParameters])(*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 *ItemItemCommitsCommit_shaItemRequestBuilder when successful +func (m *ItemItemCommitsCommit_shaItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsCommit_shaItemRequestBuilder) { + return NewItemItemCommitsCommit_shaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_commits_item_branches_where_head_request_builder.go b/pkg/github/repos/item_item_commits_item_branches_where_head_request_builder.go new file mode 100644 index 00000000..7ccec2c8 --- /dev/null +++ b/pkg/github/repos/item_item_commits_item_branches_where_head_request_builder.go @@ -0,0 +1,66 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCommitsItemBranchesWhereHeadRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id}\branches-where-head +type ItemItemCommitsItemBranchesWhereHeadRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemCommitsItemBranchesWhereHeadRequestBuilderInternal instantiates a new ItemItemCommitsItemBranchesWhereHeadRequestBuilder and sets the default values. +func NewItemItemCommitsItemBranchesWhereHeadRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemBranchesWhereHeadRequestBuilder) { + m := &ItemItemCommitsItemBranchesWhereHeadRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}/branches-where-head", pathParameters), + } + return m +} +// NewItemItemCommitsItemBranchesWhereHeadRequestBuilder instantiates a new ItemItemCommitsItemBranchesWhereHeadRequestBuilder and sets the default values. +func NewItemItemCommitsItemBranchesWhereHeadRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemBranchesWhereHeadRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsItemBranchesWhereHeadRequestBuilderInternal(urlParams, requestAdapter) +} +// Get protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. +// returns a []BranchShortable when successful +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/commits/commits#list-branches-for-head-commit +func (m *ItemItemCommitsItemBranchesWhereHeadRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BranchShortable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBranchShortFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BranchShortable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BranchShortable) + } + } + return val, nil +} +// ToGetRequestInformation protected branches are available in public repositories with GitHub Free and GitHub Free for organizations, and in public and private repositories with GitHub Pro, GitHub Team, GitHub Enterprise Cloud, and GitHub Enterprise Server. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Returns all branches where the given commit SHA is the HEAD, or latest commit for the branch. +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemBranchesWhereHeadRequestBuilder) 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 *ItemItemCommitsItemBranchesWhereHeadRequestBuilder when successful +func (m *ItemItemCommitsItemBranchesWhereHeadRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsItemBranchesWhereHeadRequestBuilder) { + return NewItemItemCommitsItemBranchesWhereHeadRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_commits_item_check_runs_get_response.go b/pkg/github/repos/item_item_commits_item_check_runs_get_response.go new file mode 100644 index 00000000..cb71cb9d --- /dev/null +++ b/pkg/github/repos/item_item_commits_item_check_runs_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemCommitsItemCheckRunsGetResponse 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 check_runs property + check_runs []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable + // The total_count property + total_count *int32 +} +// NewItemItemCommitsItemCheckRunsGetResponse instantiates a new ItemItemCommitsItemCheckRunsGetResponse and sets the default values. +func NewItemItemCommitsItemCheckRunsGetResponse()(*ItemItemCommitsItemCheckRunsGetResponse) { + m := &ItemItemCommitsItemCheckRunsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCommitsItemCheckRunsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCommitsItemCheckRunsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCommitsItemCheckRunsGetResponse(), 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 *ItemItemCommitsItemCheckRunsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCheckRuns gets the check_runs property value. The check_runs property +// returns a []CheckRunable when successful +func (m *ItemItemCommitsItemCheckRunsGetResponse) GetCheckRuns()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable) { + return m.check_runs +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCommitsItemCheckRunsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["check_runs"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCheckRunFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable) + } + } + m.SetCheckRuns(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 *ItemItemCommitsItemCheckRunsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemCommitsItemCheckRunsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCheckRuns() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCheckRuns())) + for i, v := range m.GetCheckRuns() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("check_runs", 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 *ItemItemCommitsItemCheckRunsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCheckRuns sets the check_runs property value. The check_runs property +func (m *ItemItemCommitsItemCheckRunsGetResponse) SetCheckRuns(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable)() { + m.check_runs = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemCommitsItemCheckRunsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemCommitsItemCheckRunsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCheckRuns()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable) + GetTotalCount()(*int32) + SetCheckRuns(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckRunable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_commits_item_check_runs_request_builder.go b/pkg/github/repos/item_item_commits_item_check_runs_request_builder.go new file mode 100644 index 00000000..2969f586 --- /dev/null +++ b/pkg/github/repos/item_item_commits_item_check_runs_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ia54199ab4ea9f515da05caac08d933841a68e598f4835042091716e5b346eb74 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/commits/item/checkruns" +) + +// ItemItemCommitsItemCheckRunsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id}\check-runs +type ItemItemCommitsItemCheckRunsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsItemCheckRunsRequestBuilderGetQueryParameters lists check runs for a commit ref. The `ref` can be a SHA, branch name, or a tag name.> [!NOTE]> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.If there are more than 1000 check suites on a single git reference, this endpoint will limit check runs to the 1000 most recent check suites. To iterate over all possible check runs, use the [List check suites for a Git reference](https://docs.github.com/enterprise-server@3.14/rest/reference/checks#list-check-suites-for-a-git-reference) endpoint and provide the `check_suite_id` parameter to the [List check runs in a check suite](https://docs.github.com/enterprise-server@3.14/rest/reference/checks#list-check-runs-in-a-check-suite) endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +type ItemItemCommitsItemCheckRunsRequestBuilderGetQueryParameters struct { + App_id *int32 `uriparametername:"app_id"` + // Returns check runs with the specified `name`. + Check_name *string `uriparametername:"check_name"` + // Filters check runs by their `completed_at` timestamp. `latest` returns the most recent check runs. + Filter *ia54199ab4ea9f515da05caac08d933841a68e598f4835042091716e5b346eb74.GetFilterQueryParameterType `uriparametername:"filter"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Returns check runs with the specified `status`. + Status *ia54199ab4ea9f515da05caac08d933841a68e598f4835042091716e5b346eb74.GetStatusQueryParameterType `uriparametername:"status"` +} +// NewItemItemCommitsItemCheckRunsRequestBuilderInternal instantiates a new ItemItemCommitsItemCheckRunsRequestBuilder and sets the default values. +func NewItemItemCommitsItemCheckRunsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemCheckRunsRequestBuilder) { + m := &ItemItemCommitsItemCheckRunsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}/check-runs{?app_id*,check_name*,filter*,page*,per_page*,status*}", pathParameters), + } + return m +} +// NewItemItemCommitsItemCheckRunsRequestBuilder instantiates a new ItemItemCommitsItemCheckRunsRequestBuilder and sets the default values. +func NewItemItemCommitsItemCheckRunsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemCheckRunsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsItemCheckRunsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists check runs for a commit ref. The `ref` can be a SHA, branch name, or a tag name.> [!NOTE]> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.If there are more than 1000 check suites on a single git reference, this endpoint will limit check runs to the 1000 most recent check suites. To iterate over all possible check runs, use the [List check suites for a Git reference](https://docs.github.com/enterprise-server@3.14/rest/reference/checks#list-check-suites-for-a-git-reference) endpoint and provide the `check_suite_id` parameter to the [List check runs in a check suite](https://docs.github.com/enterprise-server@3.14/rest/reference/checks#list-check-runs-in-a-check-suite) endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a ItemItemCommitsItemCheckRunsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/checks/runs#list-check-runs-for-a-git-reference +func (m *ItemItemCommitsItemCheckRunsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemCheckRunsRequestBuilderGetQueryParameters])(ItemItemCommitsItemCheckRunsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemCommitsItemCheckRunsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemCommitsItemCheckRunsGetResponseable), nil +} +// ToGetRequestInformation lists check runs for a commit ref. The `ref` can be a SHA, branch name, or a tag name.> [!NOTE]> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array.If there are more than 1000 check suites on a single git reference, this endpoint will limit check runs to the 1000 most recent check suites. To iterate over all possible check runs, use the [List check suites for a Git reference](https://docs.github.com/enterprise-server@3.14/rest/reference/checks#list-check-suites-for-a-git-reference) endpoint and provide the `check_suite_id` parameter to the [List check runs in a check suite](https://docs.github.com/enterprise-server@3.14/rest/reference/checks#list-check-runs-in-a-check-suite) endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemCheckRunsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemCheckRunsRequestBuilderGetQueryParameters])(*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 *ItemItemCommitsItemCheckRunsRequestBuilder when successful +func (m *ItemItemCommitsItemCheckRunsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsItemCheckRunsRequestBuilder) { + return NewItemItemCommitsItemCheckRunsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_commits_item_check_suites_get_response.go b/pkg/github/repos/item_item_commits_item_check_suites_get_response.go new file mode 100644 index 00000000..462c5de8 --- /dev/null +++ b/pkg/github/repos/item_item_commits_item_check_suites_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemCommitsItemCheckSuitesGetResponse 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 check_suites property + check_suites []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckSuiteable + // The total_count property + total_count *int32 +} +// NewItemItemCommitsItemCheckSuitesGetResponse instantiates a new ItemItemCommitsItemCheckSuitesGetResponse and sets the default values. +func NewItemItemCommitsItemCheckSuitesGetResponse()(*ItemItemCommitsItemCheckSuitesGetResponse) { + m := &ItemItemCommitsItemCheckSuitesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCommitsItemCheckSuitesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCommitsItemCheckSuitesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCommitsItemCheckSuitesGetResponse(), 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 *ItemItemCommitsItemCheckSuitesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCheckSuites gets the check_suites property value. The check_suites property +// returns a []CheckSuiteable when successful +func (m *ItemItemCommitsItemCheckSuitesGetResponse) GetCheckSuites()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckSuiteable) { + return m.check_suites +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCommitsItemCheckSuitesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["check_suites"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCheckSuiteFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckSuiteable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckSuiteable) + } + } + m.SetCheckSuites(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 *ItemItemCommitsItemCheckSuitesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemCommitsItemCheckSuitesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCheckSuites() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCheckSuites())) + for i, v := range m.GetCheckSuites() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("check_suites", 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 *ItemItemCommitsItemCheckSuitesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCheckSuites sets the check_suites property value. The check_suites property +func (m *ItemItemCommitsItemCheckSuitesGetResponse) SetCheckSuites(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckSuiteable)() { + m.check_suites = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemCommitsItemCheckSuitesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemCommitsItemCheckSuitesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCheckSuites()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckSuiteable) + GetTotalCount()(*int32) + SetCheckSuites(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CheckSuiteable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_commits_item_check_suites_request_builder.go b/pkg/github/repos/item_item_commits_item_check_suites_request_builder.go new file mode 100644 index 00000000..934b9984 --- /dev/null +++ b/pkg/github/repos/item_item_commits_item_check_suites_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCommitsItemCheckSuitesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id}\check-suites +type ItemItemCommitsItemCheckSuitesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsItemCheckSuitesRequestBuilderGetQueryParameters lists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name.> [!NOTE]> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +type ItemItemCommitsItemCheckSuitesRequestBuilderGetQueryParameters struct { + // Filters check suites by GitHub App `id`. + App_id *int32 `uriparametername:"app_id"` + // Returns check runs with the specified `name`. + Check_name *string `uriparametername:"check_name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCommitsItemCheckSuitesRequestBuilderInternal instantiates a new ItemItemCommitsItemCheckSuitesRequestBuilder and sets the default values. +func NewItemItemCommitsItemCheckSuitesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemCheckSuitesRequestBuilder) { + m := &ItemItemCommitsItemCheckSuitesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}/check-suites{?app_id*,check_name*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommitsItemCheckSuitesRequestBuilder instantiates a new ItemItemCommitsItemCheckSuitesRequestBuilder and sets the default values. +func NewItemItemCommitsItemCheckSuitesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemCheckSuitesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsItemCheckSuitesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name.> [!NOTE]> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a ItemItemCommitsItemCheckSuitesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/checks/suites#list-check-suites-for-a-git-reference +func (m *ItemItemCommitsItemCheckSuitesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemCheckSuitesRequestBuilderGetQueryParameters])(ItemItemCommitsItemCheckSuitesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemCommitsItemCheckSuitesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemCommitsItemCheckSuitesGetResponseable), nil +} +// ToGetRequestInformation lists check suites for a commit `ref`. The `ref` can be a SHA, branch name, or a tag name.> [!NOTE]> The endpoints to manage checks only look for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty `pull_requests` array and a `null` value for `head_branch`.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint on a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemCheckSuitesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemCheckSuitesRequestBuilderGetQueryParameters])(*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 *ItemItemCommitsItemCheckSuitesRequestBuilder when successful +func (m *ItemItemCommitsItemCheckSuitesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsItemCheckSuitesRequestBuilder) { + return NewItemItemCommitsItemCheckSuitesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_commits_item_comments_post_request_body.go b/pkg/github/repos/item_item_commits_item_comments_post_request_body.go new file mode 100644 index 00000000..ed36957b --- /dev/null +++ b/pkg/github/repos/item_item_commits_item_comments_post_request_body.go @@ -0,0 +1,167 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemCommitsItemCommentsPostRequestBody 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 contents of the comment. + body *string + // **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. + line *int32 + // Relative path of the file to comment on. + path *string + // Line index in the diff to comment on. + position *int32 +} +// NewItemItemCommitsItemCommentsPostRequestBody instantiates a new ItemItemCommitsItemCommentsPostRequestBody and sets the default values. +func NewItemItemCommitsItemCommentsPostRequestBody()(*ItemItemCommitsItemCommentsPostRequestBody) { + m := &ItemItemCommitsItemCommentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemCommitsItemCommentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemCommitsItemCommentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemCommitsItemCommentsPostRequestBody(), 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 *ItemItemCommitsItemCommentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The contents of the comment. +// returns a *string when successful +func (m *ItemItemCommitsItemCommentsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemCommitsItemCommentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLine(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + return res +} +// GetLine gets the line property value. **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. +// returns a *int32 when successful +func (m *ItemItemCommitsItemCommentsPostRequestBody) GetLine()(*int32) { + return m.line +} +// GetPath gets the path property value. Relative path of the file to comment on. +// returns a *string when successful +func (m *ItemItemCommitsItemCommentsPostRequestBody) GetPath()(*string) { + return m.path +} +// GetPosition gets the position property value. Line index in the diff to comment on. +// returns a *int32 when successful +func (m *ItemItemCommitsItemCommentsPostRequestBody) GetPosition()(*int32) { + return m.position +} +// Serialize serializes information the current object +func (m *ItemItemCommitsItemCommentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("line", m.GetLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("position", m.GetPosition()) + 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 *ItemItemCommitsItemCommentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The contents of the comment. +func (m *ItemItemCommitsItemCommentsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetLine sets the line property value. **Deprecated**. Use **position** parameter instead. Line number in the file to comment on. +func (m *ItemItemCommitsItemCommentsPostRequestBody) SetLine(value *int32)() { + m.line = value +} +// SetPath sets the path property value. Relative path of the file to comment on. +func (m *ItemItemCommitsItemCommentsPostRequestBody) SetPath(value *string)() { + m.path = value +} +// SetPosition sets the position property value. Line index in the diff to comment on. +func (m *ItemItemCommitsItemCommentsPostRequestBody) SetPosition(value *int32)() { + m.position = value +} +type ItemItemCommitsItemCommentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetLine()(*int32) + GetPath()(*string) + GetPosition()(*int32) + SetBody(value *string)() + SetLine(value *int32)() + SetPath(value *string)() + SetPosition(value *int32)() +} diff --git a/pkg/github/repos/item_item_commits_item_comments_request_builder.go b/pkg/github/repos/item_item_commits_item_comments_request_builder.go new file mode 100644 index 00000000..e09f986a --- /dev/null +++ b/pkg/github/repos/item_item_commits_item_comments_request_builder.go @@ -0,0 +1,104 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCommitsItemCommentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id}\comments +type ItemItemCommitsItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsItemCommentsRequestBuilderGetQueryParameters lists the comments for a specified commit.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemCommitsItemCommentsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCommitsItemCommentsRequestBuilderInternal instantiates a new ItemItemCommitsItemCommentsRequestBuilder and sets the default values. +func NewItemItemCommitsItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemCommentsRequestBuilder) { + m := &ItemItemCommitsItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}/comments{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommitsItemCommentsRequestBuilder instantiates a new ItemItemCommitsItemCommentsRequestBuilder and sets the default values. +func NewItemItemCommitsItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the comments for a specified commit.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []CommitCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/commits/comments#list-commit-comments +func (m *ItemItemCommitsItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemCommentsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCommitCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitCommentable) + } + } + return val, nil +} +// Post create a comment for a commit using its `:commit_sha`.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a CommitCommentable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/commits/comments#create-a-commit-comment +func (m *ItemItemCommitsItemCommentsRequestBuilder) Post(ctx context.Context, body ItemItemCommitsItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitCommentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCommitCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitCommentable), nil +} +// ToGetRequestInformation lists the comments for a specified commit.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemCommentsRequestBuilderGetQueryParameters])(*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 create a comment for a commit using its `:commit_sha`.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemCommentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemCommitsItemCommentsPostRequestBodyable, 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 *ItemItemCommitsItemCommentsRequestBuilder when successful +func (m *ItemItemCommitsItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsItemCommentsRequestBuilder) { + return NewItemItemCommitsItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_commits_item_pulls_request_builder.go b/pkg/github/repos/item_item_commits_item_pulls_request_builder.go new file mode 100644 index 00000000..f49a9ccf --- /dev/null +++ b/pkg/github/repos/item_item_commits_item_pulls_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCommitsItemPullsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id}\pulls +type ItemItemCommitsItemPullsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsItemPullsRequestBuilderGetQueryParameters lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit.To list the open or merged pull requests associated with a branch, you can set the `commit_sha` parameter to the branch name. +type ItemItemCommitsItemPullsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCommitsItemPullsRequestBuilderInternal instantiates a new ItemItemCommitsItemPullsRequestBuilder and sets the default values. +func NewItemItemCommitsItemPullsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemPullsRequestBuilder) { + m := &ItemItemCommitsItemPullsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}/pulls{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommitsItemPullsRequestBuilder instantiates a new ItemItemCommitsItemPullsRequestBuilder and sets the default values. +func NewItemItemCommitsItemPullsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemPullsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsItemPullsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit.To list the open or merged pull requests associated with a branch, you can set the `commit_sha` parameter to the branch name. +// returns a []PullRequestSimpleable when successful +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/commits/commits#list-pull-requests-associated-with-a-commit +func (m *ItemItemCommitsItemPullsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemPullsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestSimpleable) + } + } + return val, nil +} +// ToGetRequestInformation lists the merged pull request that introduced the commit to the repository. If the commit is not present in the default branch, will only return open pull requests associated with the commit.To list the open or merged pull requests associated with a branch, you can set the `commit_sha` parameter to the branch name. +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemPullsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemPullsRequestBuilderGetQueryParameters])(*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 *ItemItemCommitsItemPullsRequestBuilder when successful +func (m *ItemItemCommitsItemPullsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsItemPullsRequestBuilder) { + return NewItemItemCommitsItemPullsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_commits_item_status_request_builder.go b/pkg/github/repos/item_item_commits_item_status_request_builder.go new file mode 100644 index 00000000..a322e0ee --- /dev/null +++ b/pkg/github/repos/item_item_commits_item_status_request_builder.go @@ -0,0 +1,68 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCommitsItemStatusRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id}\status +type ItemItemCommitsItemStatusRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsItemStatusRequestBuilderGetQueryParameters users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name.Additionally, a combined `state` is returned. The `state` is one of:* **failure** if any of the contexts report as `error` or `failure`* **pending** if there are no statuses or a context is `pending`* **success** if the latest status for all contexts is `success` +type ItemItemCommitsItemStatusRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCommitsItemStatusRequestBuilderInternal instantiates a new ItemItemCommitsItemStatusRequestBuilder and sets the default values. +func NewItemItemCommitsItemStatusRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemStatusRequestBuilder) { + m := &ItemItemCommitsItemStatusRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}/status{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommitsItemStatusRequestBuilder instantiates a new ItemItemCommitsItemStatusRequestBuilder and sets the default values. +func NewItemItemCommitsItemStatusRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemStatusRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsItemStatusRequestBuilderInternal(urlParams, requestAdapter) +} +// Get users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name.Additionally, a combined `state` is returned. The `state` is one of:* **failure** if any of the contexts report as `error` or `failure`* **pending** if there are no statuses or a context is `pending`* **success** if the latest status for all contexts is `success` +// returns a CombinedCommitStatusable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/commits/statuses#get-the-combined-status-for-a-specific-reference +func (m *ItemItemCommitsItemStatusRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemStatusRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CombinedCommitStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCombinedCommitStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CombinedCommitStatusable), nil +} +// ToGetRequestInformation users with pull access in a repository can access a combined view of commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name.Additionally, a combined `state` is returned. The `state` is one of:* **failure** if any of the contexts report as `error` or `failure`* **pending** if there are no statuses or a context is `pending`* **success** if the latest status for all contexts is `success` +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemStatusRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemStatusRequestBuilderGetQueryParameters])(*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 *ItemItemCommitsItemStatusRequestBuilder when successful +func (m *ItemItemCommitsItemStatusRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsItemStatusRequestBuilder) { + return NewItemItemCommitsItemStatusRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_commits_item_statuses_request_builder.go b/pkg/github/repos/item_item_commits_item_statuses_request_builder.go new file mode 100644 index 00000000..a04cc0b4 --- /dev/null +++ b/pkg/github/repos/item_item_commits_item_statuses_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCommitsItemStatusesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits\{commit_sha-id}\statuses +type ItemItemCommitsItemStatusesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsItemStatusesRequestBuilderGetQueryParameters users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`. +type ItemItemCommitsItemStatusesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCommitsItemStatusesRequestBuilderInternal instantiates a new ItemItemCommitsItemStatusesRequestBuilder and sets the default values. +func NewItemItemCommitsItemStatusesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemStatusesRequestBuilder) { + m := &ItemItemCommitsItemStatusesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits/{commit_sha%2Did}/statuses{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCommitsItemStatusesRequestBuilder instantiates a new ItemItemCommitsItemStatusesRequestBuilder and sets the default values. +func NewItemItemCommitsItemStatusesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsItemStatusesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsItemStatusesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`. +// returns a []Statusable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/commits/statuses#list-commit-statuses-for-a-reference +func (m *ItemItemCommitsItemStatusesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemStatusesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Statusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateStatusFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Statusable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Statusable) + } + } + return val, nil +} +// ToGetRequestInformation users with pull access in a repository can view commit statuses for a given ref. The ref can be a SHA, a branch name, or a tag name. Statuses are returned in reverse chronological order. The first status in the list will be the latest one.This resource is also available via a legacy route: `GET /repos/:owner/:repo/statuses/:ref`. +// returns a *RequestInformation when successful +func (m *ItemItemCommitsItemStatusesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsItemStatusesRequestBuilderGetQueryParameters])(*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 *ItemItemCommitsItemStatusesRequestBuilder when successful +func (m *ItemItemCommitsItemStatusesRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsItemStatusesRequestBuilder) { + return NewItemItemCommitsItemStatusesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_commits_request_builder.go b/pkg/github/repos/item_item_commits_request_builder.go new file mode 100644 index 00000000..a8cf322d --- /dev/null +++ b/pkg/github/repos/item_item_commits_request_builder.go @@ -0,0 +1,102 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCommitsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\commits +type ItemItemCommitsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCommitsRequestBuilderGetQueryParameters **Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +type ItemItemCommitsRequestBuilderGetQueryParameters struct { + // GitHub username or email address to use to filter by commit author. + Author *string `uriparametername:"author"` + // GitHub username or email address to use to filter by commit committer. + Committer *string `uriparametername:"committer"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // Only commits containing this file path will be returned. + Path *string `uriparametername:"path"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // SHA or branch to start listing commits from. Default: the repository’s default branch (usually `main`). + Sha *string `uriparametername:"sha"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Due to limitations of Git, timestamps must be between 1970-01-01 and 2099-12-31 (inclusive) or unexpected results may be returned. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // Only commits before this date will be returned. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Due to limitations of Git, timestamps must be between 1970-01-01 and 2099-12-31 (inclusive) or unexpected results may be returned. + Until *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"until"` +} +// ByCommit_shaId gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.commits.item collection +// returns a *ItemItemCommitsCommit_shaItemRequestBuilder when successful +func (m *ItemItemCommitsRequestBuilder) ByCommit_shaId(commit_shaId string)(*ItemItemCommitsCommit_shaItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if commit_shaId != "" { + urlTplParams["commit_sha%2Did"] = commit_shaId + } + return NewItemItemCommitsCommit_shaItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCommitsRequestBuilderInternal instantiates a new ItemItemCommitsRequestBuilder and sets the default values. +func NewItemItemCommitsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsRequestBuilder) { + m := &ItemItemCommitsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/commits{?author*,committer*,page*,path*,per_page*,sha*,since*,until*}", pathParameters), + } + return m +} +// NewItemItemCommitsRequestBuilder instantiates a new ItemItemCommitsRequestBuilder and sets the default values. +func NewItemItemCommitsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCommitsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCommitsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a []Commitable 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 +// returns a BasicError error when the service returns a 409 status code +// returns a BasicError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/commits/commits#list-commits +func (m *ItemItemCommitsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Commitable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Commitable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Commitable) + } + } + return val, nil +} +// ToGetRequestInformation **Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemCommitsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCommitsRequestBuilderGetQueryParameters])(*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 *ItemItemCommitsRequestBuilder when successful +func (m *ItemItemCommitsRequestBuilder) WithUrl(rawUrl string)(*ItemItemCommitsRequestBuilder) { + return NewItemItemCommitsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_compare_request_builder.go b/pkg/github/repos/item_item_compare_request_builder.go new file mode 100644 index 00000000..8e8889fb --- /dev/null +++ b/pkg/github/repos/item_item_compare_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemCompareRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\compare +type ItemItemCompareRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByBasehead gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.compare.item collection +// returns a *ItemItemCompareWithBaseheadItemRequestBuilder when successful +func (m *ItemItemCompareRequestBuilder) ByBasehead(basehead string)(*ItemItemCompareWithBaseheadItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if basehead != "" { + urlTplParams["basehead"] = basehead + } + return NewItemItemCompareWithBaseheadItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemCompareRequestBuilderInternal instantiates a new ItemItemCompareRequestBuilder and sets the default values. +func NewItemItemCompareRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCompareRequestBuilder) { + m := &ItemItemCompareRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/compare", pathParameters), + } + return m +} +// NewItemItemCompareRequestBuilder instantiates a new ItemItemCompareRequestBuilder and sets the default values. +func NewItemItemCompareRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCompareRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCompareRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_compare_with_basehead_item_request_builder.go b/pkg/github/repos/item_item_compare_with_basehead_item_request_builder.go new file mode 100644 index 00000000..48bbf4aa --- /dev/null +++ b/pkg/github/repos/item_item_compare_with_basehead_item_request_builder.go @@ -0,0 +1,72 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemCompareWithBaseheadItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\compare\{basehead} +type ItemItemCompareWithBaseheadItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemCompareWithBaseheadItemRequestBuilderGetQueryParameters compares two commits against one another. You can compare refs (branches or tags) and commit SHAs in the same repository, or you can compare refs and commit SHAs that exist in different repositories within the same repository network, including fork branches. For more information about how to view a repository's network, see "[Understanding connections between repositories](https://docs.github.com/enterprise-server@3.14/repositories/viewing-activity-and-data-for-your-repository/understanding-connections-between-repositories)."This endpoint is equivalent to running the `git log BASE..HEAD` command, but it returns commits in a different order. The `git log BASE..HEAD` command returns commits in reverse chronological order, whereas the API returns commits in chronological order.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.diff`**: Returns the diff of the commit.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property.The API response includes details about the files that were changed between the two commits. This includes the status of the change (if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file.When calling this endpoint without any paging parameter (`per_page` or `page`), the returned list is limited to 250 commits, and the last commit in the list is the most recent of the entire comparison.**Working with large comparisons**To process a response with a large number of commits, use a query parameter (`per_page` or `page`) to paginate the results. When using pagination:- The list of changed files is only shown on the first page of results, and it includes up to 300 changed files for the entire comparison.- The results are returned in chronological order, but the last commit in the returned list may not be the most recent one in the entire set if there are more pages of results.For more information on working with pagination, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api)."**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The `verification` object includes the following fields:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +type ItemItemCompareWithBaseheadItemRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemCompareWithBaseheadItemRequestBuilderInternal instantiates a new ItemItemCompareWithBaseheadItemRequestBuilder and sets the default values. +func NewItemItemCompareWithBaseheadItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCompareWithBaseheadItemRequestBuilder) { + m := &ItemItemCompareWithBaseheadItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/compare/{basehead}{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemCompareWithBaseheadItemRequestBuilder instantiates a new ItemItemCompareWithBaseheadItemRequestBuilder and sets the default values. +func NewItemItemCompareWithBaseheadItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemCompareWithBaseheadItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemCompareWithBaseheadItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get compares two commits against one another. You can compare refs (branches or tags) and commit SHAs in the same repository, or you can compare refs and commit SHAs that exist in different repositories within the same repository network, including fork branches. For more information about how to view a repository's network, see "[Understanding connections between repositories](https://docs.github.com/enterprise-server@3.14/repositories/viewing-activity-and-data-for-your-repository/understanding-connections-between-repositories)."This endpoint is equivalent to running the `git log BASE..HEAD` command, but it returns commits in a different order. The `git log BASE..HEAD` command returns commits in reverse chronological order, whereas the API returns commits in chronological order.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.diff`**: Returns the diff of the commit.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property.The API response includes details about the files that were changed between the two commits. This includes the status of the change (if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file.When calling this endpoint without any paging parameter (`per_page` or `page`), the returned list is limited to 250 commits, and the last commit in the list is the most recent of the entire comparison.**Working with large comparisons**To process a response with a large number of commits, use a query parameter (`per_page` or `page`) to paginate the results. When using pagination:- The list of changed files is only shown on the first page of results, and it includes up to 300 changed files for the entire comparison.- The results are returned in chronological order, but the last commit in the returned list may not be the most recent one in the entire set if there are more pages of results.For more information on working with pagination, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api)."**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The `verification` object includes the following fields:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a CommitComparisonable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 500 status code +// returns a CommitComparison503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/commits/commits#compare-two-commits +func (m *ItemItemCompareWithBaseheadItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCompareWithBaseheadItemRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitComparisonable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCommitComparison503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCommitComparisonFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitComparisonable), nil +} +// ToGetRequestInformation compares two commits against one another. You can compare refs (branches or tags) and commit SHAs in the same repository, or you can compare refs and commit SHAs that exist in different repositories within the same repository network, including fork branches. For more information about how to view a repository's network, see "[Understanding connections between repositories](https://docs.github.com/enterprise-server@3.14/repositories/viewing-activity-and-data-for-your-repository/understanding-connections-between-repositories)."This endpoint is equivalent to running the `git log BASE..HEAD` command, but it returns commits in a different order. The `git log BASE..HEAD` command returns commits in reverse chronological order, whereas the API returns commits in chronological order.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.diff`**: Returns the diff of the commit.- **`application/vnd.github.patch`**: Returns the patch of the commit. Diffs with binary data will have no `patch` property.The API response includes details about the files that were changed between the two commits. This includes the status of the change (if a file was added, removed, modified, or renamed), and details of the change itself. For example, files with a `renamed` status have a `previous_filename` field showing the previous filename of the file, and files with a `modified` status have a `patch` field showing the changes made to the file.When calling this endpoint without any paging parameter (`per_page` or `page`), the returned list is limited to 250 commits, and the last commit in the list is the most recent of the entire comparison.**Working with large comparisons**To process a response with a large number of commits, use a query parameter (`per_page` or `page`) to paginate the results. When using pagination:- The list of changed files is only shown on the first page of results, and it includes up to 300 changed files for the entire comparison.- The results are returned in chronological order, but the last commit in the returned list may not be the most recent one in the entire set if there are more pages of results.For more information on working with pagination, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api)."**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The `verification` object includes the following fields:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemCompareWithBaseheadItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemCompareWithBaseheadItemRequestBuilderGetQueryParameters])(*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 *ItemItemCompareWithBaseheadItemRequestBuilder when successful +func (m *ItemItemCompareWithBaseheadItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemCompareWithBaseheadItemRequestBuilder) { + return NewItemItemCompareWithBaseheadItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_contents_item_with_path_delete_request_body.go b/pkg/github/repos/item_item_contents_item_with_path_delete_request_body.go new file mode 100644 index 00000000..4440e955 --- /dev/null +++ b/pkg/github/repos/item_item_contents_item_with_path_delete_request_body.go @@ -0,0 +1,196 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemContentsItemWithPathDeleteRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // object containing information about the author. + author ItemItemContentsItemWithPathDeleteRequestBody_authorable + // The branch name. Default: the repository’s default branch + branch *string + // object containing information about the committer. + committer ItemItemContentsItemWithPathDeleteRequestBody_committerable + // The commit message. + message *string + // The blob SHA of the file being deleted. + sha *string +} +// NewItemItemContentsItemWithPathDeleteRequestBody instantiates a new ItemItemContentsItemWithPathDeleteRequestBody and sets the default values. +func NewItemItemContentsItemWithPathDeleteRequestBody()(*ItemItemContentsItemWithPathDeleteRequestBody) { + m := &ItemItemContentsItemWithPathDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemContentsItemWithPathDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemContentsItemWithPathDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemContentsItemWithPathDeleteRequestBody(), 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 *ItemItemContentsItemWithPathDeleteRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. object containing information about the author. +// returns a ItemItemContentsItemWithPathDeleteRequestBody_authorable when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody) GetAuthor()(ItemItemContentsItemWithPathDeleteRequestBody_authorable) { + return m.author +} +// GetBranch gets the branch property value. The branch name. Default: the repository’s default branch +// returns a *string when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody) GetBranch()(*string) { + return m.branch +} +// GetCommitter gets the committer property value. object containing information about the committer. +// returns a ItemItemContentsItemWithPathDeleteRequestBody_committerable when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody) GetCommitter()(ItemItemContentsItemWithPathDeleteRequestBody_committerable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemContentsItemWithPathDeleteRequestBody_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(ItemItemContentsItemWithPathDeleteRequestBody_authorable)) + } + return nil + } + res["branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranch(val) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemContentsItemWithPathDeleteRequestBody_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(ItemItemContentsItemWithPathDeleteRequestBody_committerable)) + } + 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 + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The commit message. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody) GetMessage()(*string) { + return m.message +} +// GetSha gets the sha property value. The blob SHA of the file being deleted. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *ItemItemContentsItemWithPathDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branch", m.GetBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *ItemItemContentsItemWithPathDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. object containing information about the author. +func (m *ItemItemContentsItemWithPathDeleteRequestBody) SetAuthor(value ItemItemContentsItemWithPathDeleteRequestBody_authorable)() { + m.author = value +} +// SetBranch sets the branch property value. The branch name. Default: the repository’s default branch +func (m *ItemItemContentsItemWithPathDeleteRequestBody) SetBranch(value *string)() { + m.branch = value +} +// SetCommitter sets the committer property value. object containing information about the committer. +func (m *ItemItemContentsItemWithPathDeleteRequestBody) SetCommitter(value ItemItemContentsItemWithPathDeleteRequestBody_committerable)() { + m.committer = value +} +// SetMessage sets the message property value. The commit message. +func (m *ItemItemContentsItemWithPathDeleteRequestBody) SetMessage(value *string)() { + m.message = value +} +// SetSha sets the sha property value. The blob SHA of the file being deleted. +func (m *ItemItemContentsItemWithPathDeleteRequestBody) SetSha(value *string)() { + m.sha = value +} +type ItemItemContentsItemWithPathDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(ItemItemContentsItemWithPathDeleteRequestBody_authorable) + GetBranch()(*string) + GetCommitter()(ItemItemContentsItemWithPathDeleteRequestBody_committerable) + GetMessage()(*string) + GetSha()(*string) + SetAuthor(value ItemItemContentsItemWithPathDeleteRequestBody_authorable)() + SetBranch(value *string)() + SetCommitter(value ItemItemContentsItemWithPathDeleteRequestBody_committerable)() + SetMessage(value *string)() + SetSha(value *string)() +} diff --git a/pkg/github/repos/item_item_contents_item_with_path_delete_request_body_escaped_author.go b/pkg/github/repos/item_item_contents_item_with_path_delete_request_body_escaped_author.go new file mode 100644 index 00000000..329e76fe --- /dev/null +++ b/pkg/github/repos/item_item_contents_item_with_path_delete_request_body_escaped_author.go @@ -0,0 +1,110 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemContentsItemWithPathDeleteRequestBody_author object containing information about the author. +type ItemItemContentsItemWithPathDeleteRequestBody_author 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 email of the author (or committer) of the commit + email *string + // The name of the author (or committer) of the commit + name *string +} +// NewItemItemContentsItemWithPathDeleteRequestBody_author instantiates a new ItemItemContentsItemWithPathDeleteRequestBody_author and sets the default values. +func NewItemItemContentsItemWithPathDeleteRequestBody_author()(*ItemItemContentsItemWithPathDeleteRequestBody_author) { + m := &ItemItemContentsItemWithPathDeleteRequestBody_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemContentsItemWithPathDeleteRequestBody_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemContentsItemWithPathDeleteRequestBody_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemContentsItemWithPathDeleteRequestBody_author(), 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 *ItemItemContentsItemWithPathDeleteRequestBody_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email of the author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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 author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemContentsItemWithPathDeleteRequestBody_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemContentsItemWithPathDeleteRequestBody_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email of the author (or committer) of the commit +func (m *ItemItemContentsItemWithPathDeleteRequestBody_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name of the author (or committer) of the commit +func (m *ItemItemContentsItemWithPathDeleteRequestBody_author) SetName(value *string)() { + m.name = value +} +type ItemItemContentsItemWithPathDeleteRequestBody_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/repos/item_item_contents_item_with_path_delete_request_body_escaped_committer.go b/pkg/github/repos/item_item_contents_item_with_path_delete_request_body_escaped_committer.go new file mode 100644 index 00000000..12d49e58 --- /dev/null +++ b/pkg/github/repos/item_item_contents_item_with_path_delete_request_body_escaped_committer.go @@ -0,0 +1,110 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemContentsItemWithPathDeleteRequestBody_committer object containing information about the committer. +type ItemItemContentsItemWithPathDeleteRequestBody_committer 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 email of the author (or committer) of the commit + email *string + // The name of the author (or committer) of the commit + name *string +} +// NewItemItemContentsItemWithPathDeleteRequestBody_committer instantiates a new ItemItemContentsItemWithPathDeleteRequestBody_committer and sets the default values. +func NewItemItemContentsItemWithPathDeleteRequestBody_committer()(*ItemItemContentsItemWithPathDeleteRequestBody_committer) { + m := &ItemItemContentsItemWithPathDeleteRequestBody_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemContentsItemWithPathDeleteRequestBody_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemContentsItemWithPathDeleteRequestBody_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemContentsItemWithPathDeleteRequestBody_committer(), 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 *ItemItemContentsItemWithPathDeleteRequestBody_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmail gets the email property value. The email of the author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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 author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemContentsItemWithPathDeleteRequestBody_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemContentsItemWithPathDeleteRequestBody_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemContentsItemWithPathDeleteRequestBody_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmail sets the email property value. The email of the author (or committer) of the commit +func (m *ItemItemContentsItemWithPathDeleteRequestBody_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name of the author (or committer) of the commit +func (m *ItemItemContentsItemWithPathDeleteRequestBody_committer) SetName(value *string)() { + m.name = value +} +type ItemItemContentsItemWithPathDeleteRequestBody_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmail()(*string) + GetName()(*string) + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/repos/item_item_contents_item_with_path_put_request_body.go b/pkg/github/repos/item_item_contents_item_with_path_put_request_body.go new file mode 100644 index 00000000..865ae583 --- /dev/null +++ b/pkg/github/repos/item_item_contents_item_with_path_put_request_body.go @@ -0,0 +1,225 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemContentsItemWithPathPutRequestBody 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 author of the file. Default: The `committer` or the authenticated user if you omit `committer`. + author ItemItemContentsItemWithPathPutRequestBody_authorable + // The branch name. Default: the repository’s default branch. + branch *string + // The person that committed the file. Default: the authenticated user. + committer ItemItemContentsItemWithPathPutRequestBody_committerable + // The new file content, using Base64 encoding. + content *string + // The commit message. + message *string + // **Required if you are updating a file**. The blob SHA of the file being replaced. + sha *string +} +// NewItemItemContentsItemWithPathPutRequestBody instantiates a new ItemItemContentsItemWithPathPutRequestBody and sets the default values. +func NewItemItemContentsItemWithPathPutRequestBody()(*ItemItemContentsItemWithPathPutRequestBody) { + m := &ItemItemContentsItemWithPathPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemContentsItemWithPathPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemContentsItemWithPathPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemContentsItemWithPathPutRequestBody(), 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 *ItemItemContentsItemWithPathPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. The author of the file. Default: The `committer` or the authenticated user if you omit `committer`. +// returns a ItemItemContentsItemWithPathPutRequestBody_authorable when successful +func (m *ItemItemContentsItemWithPathPutRequestBody) GetAuthor()(ItemItemContentsItemWithPathPutRequestBody_authorable) { + return m.author +} +// GetBranch gets the branch property value. The branch name. Default: the repository’s default branch. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody) GetBranch()(*string) { + return m.branch +} +// GetCommitter gets the committer property value. The person that committed the file. Default: the authenticated user. +// returns a ItemItemContentsItemWithPathPutRequestBody_committerable when successful +func (m *ItemItemContentsItemWithPathPutRequestBody) GetCommitter()(ItemItemContentsItemWithPathPutRequestBody_committerable) { + return m.committer +} +// GetContent gets the content property value. The new file content, using Base64 encoding. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody) GetContent()(*string) { + return m.content +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemContentsItemWithPathPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemContentsItemWithPathPutRequestBody_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(ItemItemContentsItemWithPathPutRequestBody_authorable)) + } + return nil + } + res["branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranch(val) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemContentsItemWithPathPutRequestBody_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(ItemItemContentsItemWithPathPutRequestBody_committerable)) + } + return nil + } + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContent(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 + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The commit message. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody) GetMessage()(*string) { + return m.message +} +// GetSha gets the sha property value. **Required if you are updating a file**. The blob SHA of the file being replaced. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *ItemItemContentsItemWithPathPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("branch", m.GetBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("content", m.GetContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *ItemItemContentsItemWithPathPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. The author of the file. Default: The `committer` or the authenticated user if you omit `committer`. +func (m *ItemItemContentsItemWithPathPutRequestBody) SetAuthor(value ItemItemContentsItemWithPathPutRequestBody_authorable)() { + m.author = value +} +// SetBranch sets the branch property value. The branch name. Default: the repository’s default branch. +func (m *ItemItemContentsItemWithPathPutRequestBody) SetBranch(value *string)() { + m.branch = value +} +// SetCommitter sets the committer property value. The person that committed the file. Default: the authenticated user. +func (m *ItemItemContentsItemWithPathPutRequestBody) SetCommitter(value ItemItemContentsItemWithPathPutRequestBody_committerable)() { + m.committer = value +} +// SetContent sets the content property value. The new file content, using Base64 encoding. +func (m *ItemItemContentsItemWithPathPutRequestBody) SetContent(value *string)() { + m.content = value +} +// SetMessage sets the message property value. The commit message. +func (m *ItemItemContentsItemWithPathPutRequestBody) SetMessage(value *string)() { + m.message = value +} +// SetSha sets the sha property value. **Required if you are updating a file**. The blob SHA of the file being replaced. +func (m *ItemItemContentsItemWithPathPutRequestBody) SetSha(value *string)() { + m.sha = value +} +type ItemItemContentsItemWithPathPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(ItemItemContentsItemWithPathPutRequestBody_authorable) + GetBranch()(*string) + GetCommitter()(ItemItemContentsItemWithPathPutRequestBody_committerable) + GetContent()(*string) + GetMessage()(*string) + GetSha()(*string) + SetAuthor(value ItemItemContentsItemWithPathPutRequestBody_authorable)() + SetBranch(value *string)() + SetCommitter(value ItemItemContentsItemWithPathPutRequestBody_committerable)() + SetContent(value *string)() + SetMessage(value *string)() + SetSha(value *string)() +} diff --git a/pkg/github/repos/item_item_contents_item_with_path_put_request_body_escaped_author.go b/pkg/github/repos/item_item_contents_item_with_path_put_request_body_escaped_author.go new file mode 100644 index 00000000..698132c9 --- /dev/null +++ b/pkg/github/repos/item_item_contents_item_with_path_put_request_body_escaped_author.go @@ -0,0 +1,139 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemContentsItemWithPathPutRequestBody_author the author of the file. Default: The `committer` or the authenticated user if you omit `committer`. +type ItemItemContentsItemWithPathPutRequestBody_author 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 date property + date *string + // The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. + email *string + // The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted. + name *string +} +// NewItemItemContentsItemWithPathPutRequestBody_author instantiates a new ItemItemContentsItemWithPathPutRequestBody_author and sets the default values. +func NewItemItemContentsItemWithPathPutRequestBody_author()(*ItemItemContentsItemWithPathPutRequestBody_author) { + m := &ItemItemContentsItemWithPathPutRequestBody_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemContentsItemWithPathPutRequestBody_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemContentsItemWithPathPutRequestBody_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemContentsItemWithPathPutRequestBody_author(), 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 *ItemItemContentsItemWithPathPutRequestBody_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. The date property +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_author) GetDate()(*string) { + return m.date +} +// GetEmail gets the email property value. The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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 author or committer of the commit. You'll receive a `422` status code if `name` is omitted. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemContentsItemWithPathPutRequestBody_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemContentsItemWithPathPutRequestBody_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. The date property +func (m *ItemItemContentsItemWithPathPutRequestBody_author) SetDate(value *string)() { + m.date = value +} +// SetEmail sets the email property value. The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. +func (m *ItemItemContentsItemWithPathPutRequestBody_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted. +func (m *ItemItemContentsItemWithPathPutRequestBody_author) SetName(value *string)() { + m.name = value +} +type ItemItemContentsItemWithPathPutRequestBody_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*string) + GetEmail()(*string) + GetName()(*string) + SetDate(value *string)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/repos/item_item_contents_item_with_path_put_request_body_escaped_committer.go b/pkg/github/repos/item_item_contents_item_with_path_put_request_body_escaped_committer.go new file mode 100644 index 00000000..10461c71 --- /dev/null +++ b/pkg/github/repos/item_item_contents_item_with_path_put_request_body_escaped_committer.go @@ -0,0 +1,139 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemContentsItemWithPathPutRequestBody_committer the person that committed the file. Default: the authenticated user. +type ItemItemContentsItemWithPathPutRequestBody_committer 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 date property + date *string + // The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. + email *string + // The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted. + name *string +} +// NewItemItemContentsItemWithPathPutRequestBody_committer instantiates a new ItemItemContentsItemWithPathPutRequestBody_committer and sets the default values. +func NewItemItemContentsItemWithPathPutRequestBody_committer()(*ItemItemContentsItemWithPathPutRequestBody_committer) { + m := &ItemItemContentsItemWithPathPutRequestBody_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemContentsItemWithPathPutRequestBody_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemContentsItemWithPathPutRequestBody_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemContentsItemWithPathPutRequestBody_committer(), 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 *ItemItemContentsItemWithPathPutRequestBody_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. The date property +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) GetDate()(*string) { + return m.date +} +// GetEmail gets the email property value. The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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 author or committer of the commit. You'll receive a `422` status code if `name` is omitted. +// returns a *string when successful +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemContentsItemWithPathPutRequestBody_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. The date property +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) SetDate(value *string)() { + m.date = value +} +// SetEmail sets the email property value. The email of the author or committer of the commit. You'll receive a `422` status code if `email` is omitted. +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name of the author or committer of the commit. You'll receive a `422` status code if `name` is omitted. +func (m *ItemItemContentsItemWithPathPutRequestBody_committer) SetName(value *string)() { + m.name = value +} +type ItemItemContentsItemWithPathPutRequestBody_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*string) + GetEmail()(*string) + GetName()(*string) + SetDate(value *string)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/repos/item_item_contents_request_builder.go b/pkg/github/repos/item_item_contents_request_builder.go new file mode 100644 index 00000000..3cbfe7a1 --- /dev/null +++ b/pkg/github/repos/item_item_contents_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemContentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\contents +type ItemItemContentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByPath gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.contents.item collection +// returns a *ItemItemContentsWithPathItemRequestBuilder when successful +func (m *ItemItemContentsRequestBuilder) ByPath(path string)(*ItemItemContentsWithPathItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if path != "" { + urlTplParams["path"] = path + } + return NewItemItemContentsWithPathItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemContentsRequestBuilderInternal instantiates a new ItemItemContentsRequestBuilder and sets the default values. +func NewItemItemContentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemContentsRequestBuilder) { + m := &ItemItemContentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/contents", pathParameters), + } + return m +} +// NewItemItemContentsRequestBuilder instantiates a new ItemItemContentsRequestBuilder and sets the default values. +func NewItemItemContentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemContentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemContentsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_contents_with_path_item_request_builder.go b/pkg/github/repos/item_item_contents_with_path_item_request_builder.go new file mode 100644 index 00000000..2b04b77d --- /dev/null +++ b/pkg/github/repos/item_item_contents_with_path_item_request_builder.go @@ -0,0 +1,284 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemContentsWithPathItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\contents\{path} +type ItemItemContentsWithPathItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemContentsWithPathItemRequestBuilderGetQueryParameters gets the contents of a file or directory in a repository. Specify the file path or directory with the `path` parameter. If you omit the `path` parameter, you will receive the contents of the repository's root directory.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents for files and symlinks.- **`application/vnd.github.html+json`**: Returns the file contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).- **`application/vnd.github.object+json`**: Returns the contents in a consistent object format regardless of the content type. For example, instead of an array of objects for a directory, the response will be an object with an `entries` attribute containing the array of objects.If the content is a directory, the response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value _should_ be "submodule". This behavior exists [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as "submodule".If the content is a symlink and the symlink's target is a normal file in the repository, then the API responds with the content of the file. Otherwise, the API responds with an object describing the symlink itself.If the content is a submodule, the `submodule_git_url` field identifies the location of the submodule repository, and the `sha` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links["git"]`) and the github.com URLs (`html_url` and `_links["html"]`) will have null values.**Notes**:- To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/enterprise-server@3.14/rest/git/trees#get-a-tree).- This API has an upper limit of 1,000 files for a directory. If you need to retrievemore files, use the [Git Trees API](https://docs.github.com/enterprise-server@3.14/rest/git/trees#get-a-tree).- Download URLs expire and are meant to be used just once. To ensure the download URL does not expire, please use the contents API to obtain a fresh download URL for each download.- If the requested file's size is: - 1 MB or smaller: All features of this endpoint are supported. - Between 1-100 MB: Only the `raw` or `object` custom media types are supported. Both will work as normal, except that when using the `object` media type, the `content` field will be an emptystring and the `encoding` field will be `"none"`. To get the contents of these larger files, use the `raw` media type. - Greater than 100 MB: This endpoint is not supported. +type ItemItemContentsWithPathItemRequestBuilderGetQueryParameters struct { + // The name of the commit/branch/tag. Default: the repository’s default branch. + Ref *string `uriparametername:"ref"` +} +// WithPathGetResponse composed type wrapper for classes ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentFileable, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSubmoduleable, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSymlinkable, []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WithPathGetResponseMember1able +type WithPathGetResponse struct { + // Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentFileable + contentFile ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentFileable + // Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSubmoduleable + contentSubmodule ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSubmoduleable + // Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSymlinkable + contentSymlink ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSymlinkable + // Composed type representation for type []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WithPathGetResponseMember1able + withPathGetResponseMember1 []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WithPathGetResponseMember1able +} +// NewWithPathGetResponse instantiates a new WithPathGetResponse and sets the default values. +func NewWithPathGetResponse()(*WithPathGetResponse) { + m := &WithPathGetResponse{ + } + return m +} +// CreateWithPathGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWithPathGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewWithPathGetResponse() + 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.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWithPathGetResponseMember1FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WithPathGetResponseMember1able, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WithPathGetResponseMember1able) + } + } + result.SetWithPathGetResponseMember1(cast) + } + return result, nil +} +// GetContentFile gets the contentFile property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentFileable +// returns a ContentFileable when successful +func (m *WithPathGetResponse) GetContentFile()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentFileable) { + return m.contentFile +} +// GetContentSubmodule gets the contentSubmodule property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSubmoduleable +// returns a ContentSubmoduleable when successful +func (m *WithPathGetResponse) GetContentSubmodule()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSubmoduleable) { + return m.contentSubmodule +} +// GetContentSymlink gets the contentSymlink property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSymlinkable +// returns a ContentSymlinkable when successful +func (m *WithPathGetResponse) GetContentSymlink()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSymlinkable) { + return m.contentSymlink +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WithPathGetResponse) 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 *WithPathGetResponse) GetIsComposedType()(bool) { + return true +} +// GetWithPathGetResponseMember1 gets the WithPathGetResponseMember1 property value. Composed type representation for type []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WithPathGetResponseMember1able +// returns a []WithPathGetResponseMember1able when successful +func (m *WithPathGetResponse) GetWithPathGetResponseMember1()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WithPathGetResponseMember1able) { + return m.withPathGetResponseMember1 +} +// Serialize serializes information the current object +func (m *WithPathGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetContentFile() != nil { + err := writer.WriteObjectValue("", m.GetContentFile()) + if err != nil { + return err + } + } else if m.GetContentSubmodule() != nil { + err := writer.WriteObjectValue("", m.GetContentSubmodule()) + if err != nil { + return err + } + } else if m.GetContentSymlink() != nil { + err := writer.WriteObjectValue("", m.GetContentSymlink()) + if err != nil { + return err + } + } else if m.GetWithPathGetResponseMember1() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetWithPathGetResponseMember1())) + for i, v := range m.GetWithPathGetResponseMember1() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } + return nil +} +// SetContentFile sets the contentFile property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentFileable +func (m *WithPathGetResponse) SetContentFile(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentFileable)() { + m.contentFile = value +} +// SetContentSubmodule sets the contentSubmodule property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSubmoduleable +func (m *WithPathGetResponse) SetContentSubmodule(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSubmoduleable)() { + m.contentSubmodule = value +} +// SetContentSymlink sets the contentSymlink property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSymlinkable +func (m *WithPathGetResponse) SetContentSymlink(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSymlinkable)() { + m.contentSymlink = value +} +// SetWithPathGetResponseMember1 sets the WithPathGetResponseMember1 property value. Composed type representation for type []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WithPathGetResponseMember1able +func (m *WithPathGetResponse) SetWithPathGetResponseMember1(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WithPathGetResponseMember1able)() { + m.withPathGetResponseMember1 = value +} +type WithPathGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentFile()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentFileable) + GetContentSubmodule()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSubmoduleable) + GetContentSymlink()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSymlinkable) + GetWithPathGetResponseMember1()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WithPathGetResponseMember1able) + SetContentFile(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentFileable)() + SetContentSubmodule(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSubmoduleable)() + SetContentSymlink(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentSymlinkable)() + SetWithPathGetResponseMember1(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WithPathGetResponseMember1able)() +} +// NewItemItemContentsWithPathItemRequestBuilderInternal instantiates a new ItemItemContentsWithPathItemRequestBuilder and sets the default values. +func NewItemItemContentsWithPathItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemContentsWithPathItemRequestBuilder) { + m := &ItemItemContentsWithPathItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/contents/{path}{?ref*}", pathParameters), + } + return m +} +// NewItemItemContentsWithPathItemRequestBuilder instantiates a new ItemItemContentsWithPathItemRequestBuilder and sets the default values. +func NewItemItemContentsWithPathItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemContentsWithPathItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemContentsWithPathItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a file in a repository.You can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author.The `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user's information is used.You must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code.> [!NOTE]> If you use this endpoint and the "[Create or update file contents](https://docs.github.com/enterprise-server@3.14/rest/repos/contents/#create-or-update-file-contents)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead. +// returns a FileCommitable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a FileCommit503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/contents#delete-a-file +func (m *ItemItemContentsWithPathItemRequestBuilder) Delete(ctx context.Context, body ItemItemContentsItemWithPathDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FileCommitable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateFileCommit503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateFileCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FileCommitable), nil +} +// Get gets the contents of a file or directory in a repository. Specify the file path or directory with the `path` parameter. If you omit the `path` parameter, you will receive the contents of the repository's root directory.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents for files and symlinks.- **`application/vnd.github.html+json`**: Returns the file contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).- **`application/vnd.github.object+json`**: Returns the contents in a consistent object format regardless of the content type. For example, instead of an array of objects for a directory, the response will be an object with an `entries` attribute containing the array of objects.If the content is a directory, the response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value _should_ be "submodule". This behavior exists [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as "submodule".If the content is a symlink and the symlink's target is a normal file in the repository, then the API responds with the content of the file. Otherwise, the API responds with an object describing the symlink itself.If the content is a submodule, the `submodule_git_url` field identifies the location of the submodule repository, and the `sha` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links["git"]`) and the github.com URLs (`html_url` and `_links["html"]`) will have null values.**Notes**:- To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/enterprise-server@3.14/rest/git/trees#get-a-tree).- This API has an upper limit of 1,000 files for a directory. If you need to retrievemore files, use the [Git Trees API](https://docs.github.com/enterprise-server@3.14/rest/git/trees#get-a-tree).- Download URLs expire and are meant to be used just once. To ensure the download URL does not expire, please use the contents API to obtain a fresh download URL for each download.- If the requested file's size is: - 1 MB or smaller: All features of this endpoint are supported. - Between 1-100 MB: Only the `raw` or `object` custom media types are supported. Both will work as normal, except that when using the `object` media type, the `content` field will be an emptystring and the `encoding` field will be `"none"`. To get the contents of these larger files, use the `raw` media type. - Greater than 100 MB: This endpoint is not supported. +// returns a WithPathGetResponseable 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/enterprise-server@3.14/rest/repos/contents#get-repository-content +func (m *ItemItemContentsWithPathItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemContentsWithPathItemRequestBuilderGetQueryParameters])(WithPathGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateWithPathGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(WithPathGetResponseable), nil +} +// Put creates a new file or replaces an existing file in a repository.> [!NOTE]> If you use this endpoint and the "[Delete a file](https://docs.github.com/enterprise-server@3.14/rest/repos/contents/#delete-a-file)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The `workflow` scope is also required in order to modify files in the `.github/workflows` directory. +// returns a FileCommitable 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/enterprise-server@3.14/rest/repos/contents#create-or-update-file-contents +func (m *ItemItemContentsWithPathItemRequestBuilder) Put(ctx context.Context, body ItemItemContentsItemWithPathPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FileCommitable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateFileCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FileCommitable), nil +} +// ToDeleteRequestInformation deletes a file in a repository.You can provide an additional `committer` parameter, which is an object containing information about the committer. Or, you can provide an `author` parameter, which is an object containing information about the author.The `author` section is optional and is filled in with the `committer` information if omitted. If the `committer` information is omitted, the authenticated user's information is used.You must provide values for both `name` and `email`, whether you choose to use `author` or `committer`. Otherwise, you'll receive a `422` status code.> [!NOTE]> If you use this endpoint and the "[Create or update file contents](https://docs.github.com/enterprise-server@3.14/rest/repos/contents/#create-or-update-file-contents)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead. +// returns a *RequestInformation when successful +func (m *ItemItemContentsWithPathItemRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ItemItemContentsItemWithPathDeleteRequestBodyable, 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") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation gets the contents of a file or directory in a repository. Specify the file path or directory with the `path` parameter. If you omit the `path` parameter, you will receive the contents of the repository's root directory.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents for files and symlinks.- **`application/vnd.github.html+json`**: Returns the file contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup).- **`application/vnd.github.object+json`**: Returns the contents in a consistent object format regardless of the content type. For example, instead of an array of objects for a directory, the response will be an object with an `entries` attribute containing the array of objects.If the content is a directory, the response will be an array of objects, one object for each item in the directory. When listing the contents of a directory, submodules have their "type" specified as "file". Logically, the value _should_ be "submodule". This behavior exists [for backwards compatibility purposes](https://git.io/v1YCW). In the next major version of the API, the type will be returned as "submodule".If the content is a symlink and the symlink's target is a normal file in the repository, then the API responds with the content of the file. Otherwise, the API responds with an object describing the symlink itself.If the content is a submodule, the `submodule_git_url` field identifies the location of the submodule repository, and the `sha` identifies a specific commit within the submodule repository. Git uses the given URL when cloning the submodule repository, and checks out the submodule at that specific commit. If the submodule repository is not hosted on github.com, the Git URLs (`git_url` and `_links["git"]`) and the github.com URLs (`html_url` and `_links["html"]`) will have null values.**Notes**:- To get a repository's contents recursively, you can [recursively get the tree](https://docs.github.com/enterprise-server@3.14/rest/git/trees#get-a-tree).- This API has an upper limit of 1,000 files for a directory. If you need to retrievemore files, use the [Git Trees API](https://docs.github.com/enterprise-server@3.14/rest/git/trees#get-a-tree).- Download URLs expire and are meant to be used just once. To ensure the download URL does not expire, please use the contents API to obtain a fresh download URL for each download.- If the requested file's size is: - 1 MB or smaller: All features of this endpoint are supported. - Between 1-100 MB: Only the `raw` or `object` custom media types are supported. Both will work as normal, except that when using the `object` media type, the `content` field will be an emptystring and the `encoding` field will be `"none"`. To get the contents of these larger files, use the `raw` media type. - Greater than 100 MB: This endpoint is not supported. +// returns a *RequestInformation when successful +func (m *ItemItemContentsWithPathItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemContentsWithPathItemRequestBuilderGetQueryParameters])(*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 +} +// ToPutRequestInformation creates a new file or replaces an existing file in a repository.> [!NOTE]> If you use this endpoint and the "[Delete a file](https://docs.github.com/enterprise-server@3.14/rest/repos/contents/#delete-a-file)" endpoint in parallel, the concurrent requests will conflict and you will receive errors. You must use these endpoints serially instead.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. The `workflow` scope is also required in order to modify files in the `.github/workflows` directory. +// returns a *RequestInformation when successful +func (m *ItemItemContentsWithPathItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemContentsItemWithPathPutRequestBodyable, 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 *ItemItemContentsWithPathItemRequestBuilder when successful +func (m *ItemItemContentsWithPathItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemContentsWithPathItemRequestBuilder) { + return NewItemItemContentsWithPathItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_contributors_request_builder.go b/pkg/github/repos/item_item_contributors_request_builder.go new file mode 100644 index 00000000..9bf1225f --- /dev/null +++ b/pkg/github/repos/item_item_contributors_request_builder.go @@ -0,0 +1,75 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemContributorsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\contributors +type ItemItemContributorsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemContributorsRequestBuilderGetQueryParameters lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API caches contributor data to improve performance.GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. +type ItemItemContributorsRequestBuilderGetQueryParameters struct { + // Set to `1` or `true` to include anonymous contributors in results. + Anon *string `uriparametername:"anon"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemContributorsRequestBuilderInternal instantiates a new ItemItemContributorsRequestBuilder and sets the default values. +func NewItemItemContributorsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemContributorsRequestBuilder) { + m := &ItemItemContributorsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/contributors{?anon*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemContributorsRequestBuilder instantiates a new ItemItemContributorsRequestBuilder and sets the default values. +func NewItemItemContributorsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemContributorsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemContributorsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API caches contributor data to improve performance.GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. +// returns a []Contributorable 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/enterprise-server@3.14/rest/repos/repos#list-repository-contributors +func (m *ItemItemContributorsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemContributorsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Contributorable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateContributorFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Contributorable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Contributorable) + } + } + return val, nil +} +// ToGetRequestInformation lists contributors to the specified repository and sorts them by the number of commits per contributor in descending order. This endpoint may return information that is a few hours old because the GitHub REST API caches contributor data to improve performance.GitHub identifies contributors by author email address. This endpoint groups contribution counts by GitHub user, which includes all associated email addresses. To improve performance, only the first 500 author email addresses in the repository link to GitHub users. The rest will appear as anonymous contributors without associated GitHub user information. +// returns a *RequestInformation when successful +func (m *ItemItemContributorsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemContributorsRequestBuilderGetQueryParameters])(*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 *ItemItemContributorsRequestBuilder when successful +func (m *ItemItemContributorsRequestBuilder) WithUrl(rawUrl string)(*ItemItemContributorsRequestBuilder) { + return NewItemItemContributorsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_dependabot_alerts_item_with_alert_escaped_number_patch_request_body.go b/pkg/github/repos/item_item_dependabot_alerts_item_with_alert_escaped_number_patch_request_body.go new file mode 100644 index 00000000..60e7716d --- /dev/null +++ b/pkg/github/repos/item_item_dependabot_alerts_item_with_alert_escaped_number_patch_request_body.go @@ -0,0 +1,61 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody struct { + // An optional comment associated with dismissing the alert. + dismissed_comment *string +} +// NewItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody instantiates a new ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody and sets the default values. +func NewItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody()(*ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody) { + m := &ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody{ + } + return m +} +// CreateItemItemDependabotAlertsItemWithAlert_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDependabotAlertsItemWithAlert_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody(), nil +} +// GetDismissedComment gets the dismissed_comment property value. An optional comment associated with dismissing the alert. +// returns a *string when successful +func (m *ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody) GetDismissedComment()(*string) { + return m.dismissed_comment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["dismissed_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDismissedComment(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("dismissed_comment", m.GetDismissedComment()) + if err != nil { + return err + } + } + return nil +} +// SetDismissedComment sets the dismissed_comment property value. An optional comment associated with dismissing the alert. +func (m *ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBody) SetDismissedComment(value *string)() { + m.dismissed_comment = value +} +type ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDismissedComment()(*string) + SetDismissedComment(value *string)() +} diff --git a/pkg/github/repos/item_item_dependabot_alerts_request_builder.go b/pkg/github/repos/item_item_dependabot_alerts_request_builder.go new file mode 100644 index 00000000..333879ea --- /dev/null +++ b/pkg/github/repos/item_item_dependabot_alerts_request_builder.go @@ -0,0 +1,115 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i8393e6fbe49565baf8cec2bd146fda3d83f1a474d09b264e9b4a52c3a16b03f1 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/dependabot/alerts" +) + +// ItemItemDependabotAlertsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependabot\alerts +type ItemItemDependabotAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemDependabotAlertsRequestBuilderGetQueryParameters oAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +type ItemItemDependabotAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *i8393e6fbe49565baf8cec2bd146fda3d83f1a474d09b264e9b4a52c3a16b03f1.GetDirectionQueryParameterType `uriparametername:"direction"` + // A comma-separated list of ecosystems. If specified, only alerts for these ecosystems will be returned.Can be: `composer`, `go`, `maven`, `npm`, `nuget`, `pip`, `pub`, `rubygems`, `rust` + Ecosystem *string `uriparametername:"ecosystem"` + // **Deprecated**. The number of results per page (max 100), starting from the first matching result.This parameter must not be used in combination with `last`.Instead, use `per_page` in combination with `after` to fetch the first page of results. + First *int32 `uriparametername:"first"` + // **Deprecated**. The number of results per page (max 100), starting from the last matching result.This parameter must not be used in combination with `first`.Instead, use `per_page` in combination with `before` to fetch the last page of results. + Last *int32 `uriparametername:"last"` + // A comma-separated list of full manifest paths. If specified, only alerts for these manifests will be returned. + Manifest *string `uriparametername:"manifest"` + // A comma-separated list of package names. If specified, only alerts for these packages will be returned. + Package *string `uriparametername:"package"` + // **Deprecated**. Page number of the results to fetch. Use cursor-based pagination with `before` or `after` instead. + // Deprecated: + 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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + // Deprecated: + Per_page *int32 `uriparametername:"per_page"` + // The scope of the vulnerable dependency. If specified, only alerts with this scope will be returned. + Scope *i8393e6fbe49565baf8cec2bd146fda3d83f1a474d09b264e9b4a52c3a16b03f1.GetScopeQueryParameterType `uriparametername:"scope"` + // A comma-separated list of severities. If specified, only alerts with these severities will be returned.Can be: `low`, `medium`, `high`, `critical` + Severity *string `uriparametername:"severity"` + // The property by which to sort the results.`created` means when the alert was created.`updated` means when the alert's state last changed. + Sort *i8393e6fbe49565baf8cec2bd146fda3d83f1a474d09b264e9b4a52c3a16b03f1.GetSortQueryParameterType `uriparametername:"sort"` + // A comma-separated list of states. If specified, only alerts with these states will be returned.Can be: `auto_dismissed`, `dismissed`, `fixed`, `open` + State *string `uriparametername:"state"` +} +// ByAlert_number gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.dependabot.alerts.item collection +// returns a *ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder when successful +func (m *ItemItemDependabotAlertsRequestBuilder) ByAlert_number(alert_number int32)(*ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["alert_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(alert_number), 10) + return NewItemItemDependabotAlertsWithAlert_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemDependabotAlertsRequestBuilderInternal instantiates a new ItemItemDependabotAlertsRequestBuilder and sets the default values. +func NewItemItemDependabotAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotAlertsRequestBuilder) { + m := &ItemItemDependabotAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependabot/alerts{?after*,before*,direction*,ecosystem*,first*,last*,manifest*,package*,page*,per_page*,scope*,severity*,sort*,state*}", pathParameters), + } + return m +} +// NewItemItemDependabotAlertsRequestBuilder instantiates a new ItemItemDependabotAlertsRequestBuilder and sets the default values. +func NewItemItemDependabotAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependabotAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get oAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a []DependabotAlertable 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 ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/alerts#list-dependabot-alerts-for-a-repository +func (m *ItemItemDependabotAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDependabotAlertsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotAlertable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDependabotAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotAlertable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotAlertable) + } + } + return val, nil +} +// ToGetRequestInformation oAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDependabotAlertsRequestBuilderGetQueryParameters])(*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 *ItemItemDependabotAlertsRequestBuilder when successful +func (m *ItemItemDependabotAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependabotAlertsRequestBuilder) { + return NewItemItemDependabotAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_dependabot_alerts_with_alert_escaped_number_item_request_builder.go b/pkg/github/repos/item_item_dependabot_alerts_with_alert_escaped_number_item_request_builder.go new file mode 100644 index 00000000..99000fbd --- /dev/null +++ b/pkg/github/repos/item_item_dependabot_alerts_with_alert_escaped_number_item_request_builder.go @@ -0,0 +1,106 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependabot\alerts\{alert_number} +type ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDependabotAlertsWithAlert_numberItemRequestBuilderInternal instantiates a new ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder and sets the default values. +func NewItemItemDependabotAlertsWithAlert_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) { + m := &ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependabot/alerts/{alert_number}", pathParameters), + } + return m +} +// NewItemItemDependabotAlertsWithAlert_numberItemRequestBuilder instantiates a new ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder and sets the default values. +func NewItemItemDependabotAlertsWithAlert_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependabotAlertsWithAlert_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get oAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a DependabotAlertable 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/enterprise-server@3.14/rest/dependabot/alerts#get-a-dependabot-alert +func (m *ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotAlertable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDependabotAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotAlertable), nil +} +// Patch the authenticated user must have access to security alerts for the repository to use this endpoint. For more information, see "[Granting access to security alerts](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)."OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a DependabotAlertable 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 BasicError error when the service returns a 409 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/alerts#update-a-dependabot-alert +func (m *ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) Patch(ctx context.Context, body ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotAlertable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDependabotAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotAlertable), nil +} +// ToGetRequestInformation oAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) 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 the authenticated user must have access to security alerts for the repository to use this endpoint. For more information, see "[Granting access to security alerts](https://docs.github.com/enterprise-server@3.14/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-security-and-analysis-settings-for-your-repository#granting-access-to-security-alerts)."OAuth app tokens and personal access tokens (classic) need the `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemDependabotAlertsItemWithAlert_numberPatchRequestBodyable, 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 *ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder when successful +func (m *ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependabotAlertsWithAlert_numberItemRequestBuilder) { + return NewItemItemDependabotAlertsWithAlert_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_dependabot_request_builder.go b/pkg/github/repos/item_item_dependabot_request_builder.go new file mode 100644 index 00000000..ca39c117 --- /dev/null +++ b/pkg/github/repos/item_item_dependabot_request_builder.go @@ -0,0 +1,33 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemDependabotRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependabot +type ItemItemDependabotRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemItemDependabotAlertsRequestBuilder when successful +func (m *ItemItemDependabotRequestBuilder) Alerts()(*ItemItemDependabotAlertsRequestBuilder) { + return NewItemItemDependabotAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemDependabotRequestBuilderInternal instantiates a new ItemItemDependabotRequestBuilder and sets the default values. +func NewItemItemDependabotRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotRequestBuilder) { + m := &ItemItemDependabotRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependabot", pathParameters), + } + return m +} +// NewItemItemDependabotRequestBuilder instantiates a new ItemItemDependabotRequestBuilder and sets the default values. +func NewItemItemDependabotRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependabotRequestBuilderInternal(urlParams, requestAdapter) +} +// Secrets the secrets property +// returns a *ItemItemDependabotSecretsRequestBuilder when successful +func (m *ItemItemDependabotRequestBuilder) Secrets()(*ItemItemDependabotSecretsRequestBuilder) { + return NewItemItemDependabotSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/repos/item_item_dependabot_secrets_get_response.go b/pkg/github/repos/item_item_dependabot_secrets_get_response.go new file mode 100644 index 00000000..ee09ffbe --- /dev/null +++ b/pkg/github/repos/item_item_dependabot_secrets_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemDependabotSecretsGetResponse 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 secrets property + secrets []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotSecretable + // The total_count property + total_count *int32 +} +// NewItemItemDependabotSecretsGetResponse instantiates a new ItemItemDependabotSecretsGetResponse and sets the default values. +func NewItemItemDependabotSecretsGetResponse()(*ItemItemDependabotSecretsGetResponse) { + m := &ItemItemDependabotSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemDependabotSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDependabotSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDependabotSecretsGetResponse(), 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 *ItemItemDependabotSecretsGetResponse) 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 *ItemItemDependabotSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDependabotSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotSecretable) + } + } + m.SetSecrets(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 +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []DependabotSecretable when successful +func (m *ItemItemDependabotSecretsGetResponse) GetSecrets()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemDependabotSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemDependabotSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", 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 *ItemItemDependabotSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemItemDependabotSecretsGetResponse) SetSecrets(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemDependabotSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemDependabotSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotSecretable) + GetTotalCount()(*int32) + SetSecrets(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotSecretable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_dependabot_secrets_item_with_secret_escaped_name_put_request_body.go b/pkg/github/repos/item_item_dependabot_secrets_item_with_secret_escaped_name_put_request_body.go new file mode 100644 index 00000000..a59a6cb6 --- /dev/null +++ b/pkg/github/repos/item_item_dependabot_secrets_item_with_secret_escaped_name_put_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemDependabotSecretsItemWithSecret_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 + // Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#get-a-repository-public-key) endpoint. + encrypted_value *string + // ID of the key you used to encrypt the secret. + key_id *string +} +// NewItemItemDependabotSecretsItemWithSecret_namePutRequestBody instantiates a new ItemItemDependabotSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewItemItemDependabotSecretsItemWithSecret_namePutRequestBody()(*ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) { + m := &ItemItemDependabotSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemDependabotSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDependabotSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDependabotSecretsItemWithSecret_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 *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#get-a-repository-public-key) endpoint. +// returns a *string when successful +func (m *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) 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 *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) 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 + } + return res +} +// GetKeyId gets the key_id property value. ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// Serialize serializes information the current object +func (m *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) 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 + } + } + { + 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 *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get a repository public key](https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#get-a-repository-public-key) endpoint. +func (m *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. ID of the key you used to encrypt the secret. +func (m *ItemItemDependabotSecretsItemWithSecret_namePutRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +type ItemItemDependabotSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() +} diff --git a/pkg/github/repos/item_item_dependabot_secrets_public_key_request_builder.go b/pkg/github/repos/item_item_dependabot_secrets_public_key_request_builder.go new file mode 100644 index 00000000..bdd124d7 --- /dev/null +++ b/pkg/github/repos/item_item_dependabot_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemDependabotSecretsPublicKeyRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependabot\secrets\public-key +type ItemItemDependabotSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDependabotSecretsPublicKeyRequestBuilderInternal instantiates a new ItemItemDependabotSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemDependabotSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotSecretsPublicKeyRequestBuilder) { + m := &ItemItemDependabotSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependabot/secrets/public-key", pathParameters), + } + return m +} +// NewItemItemDependabotSecretsPublicKeyRequestBuilder instantiates a new ItemItemDependabotSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemDependabotSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependabotSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets. Anyone with read accessto the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the repository is private. +// returns a DependabotPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#get-a-repository-public-key +func (m *ItemItemDependabotSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDependabotPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotPublicKeyable), nil +} +// ToGetRequestInformation gets your public key, which you need to encrypt secrets. You need toencrypt a secret before you can create or update secrets. Anyone with read accessto the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint if the repository is private. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotSecretsPublicKeyRequestBuilder) 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 *ItemItemDependabotSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemDependabotSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependabotSecretsPublicKeyRequestBuilder) { + return NewItemItemDependabotSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_dependabot_secrets_request_builder.go b/pkg/github/repos/item_item_dependabot_secrets_request_builder.go new file mode 100644 index 00000000..c13c2eef --- /dev/null +++ b/pkg/github/repos/item_item_dependabot_secrets_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemDependabotSecretsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependabot\secrets +type ItemItemDependabotSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemDependabotSecretsRequestBuilderGetQueryParameters lists all secrets available in a repository without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemDependabotSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/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-enterprise-server/pkg/github.repos.item.item.dependabot.secrets.item collection +// returns a *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemDependabotSecretsRequestBuilder) BySecret_name(secret_name string)(*ItemItemDependabotSecretsWithSecret_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 NewItemItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemDependabotSecretsRequestBuilderInternal instantiates a new ItemItemDependabotSecretsRequestBuilder and sets the default values. +func NewItemItemDependabotSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotSecretsRequestBuilder) { + m := &ItemItemDependabotSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependabot/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemDependabotSecretsRequestBuilder instantiates a new ItemItemDependabotSecretsRequestBuilder and sets the default values. +func NewItemItemDependabotSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependabotSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all secrets available in a repository without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemDependabotSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#list-repository-secrets +func (m *ItemItemDependabotSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDependabotSecretsRequestBuilderGetQueryParameters])(ItemItemDependabotSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemDependabotSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemDependabotSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *ItemItemDependabotSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemDependabotSecretsRequestBuilder) PublicKey()(*ItemItemDependabotSecretsPublicKeyRequestBuilder) { + return NewItemItemDependabotSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all secrets available in a repository without revealing their encryptedvalues.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDependabotSecretsRequestBuilderGetQueryParameters])(*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 *ItemItemDependabotSecretsRequestBuilder when successful +func (m *ItemItemDependabotSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependabotSecretsRequestBuilder) { + return NewItemItemDependabotSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_dependabot_secrets_with_secret_escaped_name_item_request_builder.go b/pkg/github/repos/item_item_dependabot_secrets_with_secret_escaped_name_item_request_builder.go new file mode 100644 index 00000000..914f536d --- /dev/null +++ b/pkg/github/repos/item_item_dependabot_secrets_with_secret_escaped_name_item_request_builder.go @@ -0,0 +1,110 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependabot\secrets\{secret_name} +type ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) { + m := &ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependabot/secrets/{secret_name}", pathParameters), + } + return m +} +// NewItemItemDependabotSecretsWithSecret_nameItemRequestBuilder instantiates a new ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemDependabotSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependabotSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a secret in a repository using the secret name.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#delete-a-repository-secret +func (m *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a single repository secret without revealing its encrypted value.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a DependabotSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#get-a-repository-secret +func (m *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDependabotSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependabotSecretable), nil +} +// Put creates or updates a repository secret with an encrypted value. 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/enterprise-server@3.14/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependabot/secrets#create-or-update-a-repository-secret +func (m *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body ItemItemDependabotSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToDeleteRequestInformation deletes a secret in a repository using the secret name.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotSecretsWithSecret_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a single repository secret without revealing its encrypted value.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotSecretsWithSecret_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 +} +// ToPutRequestInformation creates or updates a repository secret with an encrypted value. 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/enterprise-server@3.14/rest/guides/encrypting-secrets-for-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemDependabotSecretsItemWithSecret_namePutRequestBodyable, 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 *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependabotSecretsWithSecret_nameItemRequestBuilder) { + return NewItemItemDependabotSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_dependency_graph_compare_request_builder.go b/pkg/github/repos/item_item_dependency_graph_compare_request_builder.go new file mode 100644 index 00000000..724c16b9 --- /dev/null +++ b/pkg/github/repos/item_item_dependency_graph_compare_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemDependencyGraphCompareRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependency-graph\compare +type ItemItemDependencyGraphCompareRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByBasehead gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.dependencyGraph.compare.item collection +// returns a *ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder when successful +func (m *ItemItemDependencyGraphCompareRequestBuilder) ByBasehead(basehead string)(*ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if basehead != "" { + urlTplParams["basehead"] = basehead + } + return NewItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemDependencyGraphCompareRequestBuilderInternal instantiates a new ItemItemDependencyGraphCompareRequestBuilder and sets the default values. +func NewItemItemDependencyGraphCompareRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphCompareRequestBuilder) { + m := &ItemItemDependencyGraphCompareRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependency-graph/compare", pathParameters), + } + return m +} +// NewItemItemDependencyGraphCompareRequestBuilder instantiates a new ItemItemDependencyGraphCompareRequestBuilder and sets the default values. +func NewItemItemDependencyGraphCompareRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphCompareRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependencyGraphCompareRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_dependency_graph_compare_with_basehead_item_request_builder.go b/pkg/github/repos/item_item_dependency_graph_compare_with_basehead_item_request_builder.go new file mode 100644 index 00000000..1b17477d --- /dev/null +++ b/pkg/github/repos/item_item_dependency_graph_compare_with_basehead_item_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependency-graph\compare\{basehead} +type ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderGetQueryParameters gets the diff of the dependency changes between two commits of a repository, based on the changes to the dependency manifests made in those commits. +type ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderGetQueryParameters struct { + // The full path, relative to the repository root, of the dependency manifest file. + Name *string `uriparametername:"name"` +} +// NewItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderInternal instantiates a new ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder and sets the default values. +func NewItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder) { + m := &ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependency-graph/compare/{basehead}{?name*}", pathParameters), + } + return m +} +// NewItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder instantiates a new ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder and sets the default values. +func NewItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the diff of the dependency changes between two commits of a repository, based on the changes to the dependency manifests made in those commits. +// returns a []DependencyGraphDiffable 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/enterprise-server@3.14/rest/dependency-graph/dependency-review#get-a-diff-of-the-dependencies-between-commits +func (m *ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependencyGraphDiffable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDependencyGraphDiffFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependencyGraphDiffable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependencyGraphDiffable) + } + } + return val, nil +} +// ToGetRequestInformation gets the diff of the dependency changes between two commits of a repository, based on the changes to the dependency manifests made in those commits. +// returns a *RequestInformation when successful +func (m *ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilderGetQueryParameters])(*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 *ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder when successful +func (m *ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder) { + return NewItemItemDependencyGraphCompareWithBaseheadItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_dependency_graph_request_builder.go b/pkg/github/repos/item_item_dependency_graph_request_builder.go new file mode 100644 index 00000000..3662dca3 --- /dev/null +++ b/pkg/github/repos/item_item_dependency_graph_request_builder.go @@ -0,0 +1,38 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemDependencyGraphRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependency-graph +type ItemItemDependencyGraphRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Compare the compare property +// returns a *ItemItemDependencyGraphCompareRequestBuilder when successful +func (m *ItemItemDependencyGraphRequestBuilder) Compare()(*ItemItemDependencyGraphCompareRequestBuilder) { + return NewItemItemDependencyGraphCompareRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemDependencyGraphRequestBuilderInternal instantiates a new ItemItemDependencyGraphRequestBuilder and sets the default values. +func NewItemItemDependencyGraphRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphRequestBuilder) { + m := &ItemItemDependencyGraphRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependency-graph", pathParameters), + } + return m +} +// NewItemItemDependencyGraphRequestBuilder instantiates a new ItemItemDependencyGraphRequestBuilder and sets the default values. +func NewItemItemDependencyGraphRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependencyGraphRequestBuilderInternal(urlParams, requestAdapter) +} +// Sbom the sbom property +// returns a *ItemItemDependencyGraphSbomRequestBuilder when successful +func (m *ItemItemDependencyGraphRequestBuilder) Sbom()(*ItemItemDependencyGraphSbomRequestBuilder) { + return NewItemItemDependencyGraphSbomRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Snapshots the snapshots property +// returns a *ItemItemDependencyGraphSnapshotsRequestBuilder when successful +func (m *ItemItemDependencyGraphRequestBuilder) Snapshots()(*ItemItemDependencyGraphSnapshotsRequestBuilder) { + return NewItemItemDependencyGraphSnapshotsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/repos/item_item_dependency_graph_sbom_request_builder.go b/pkg/github/repos/item_item_dependency_graph_sbom_request_builder.go new file mode 100644 index 00000000..92594fe3 --- /dev/null +++ b/pkg/github/repos/item_item_dependency_graph_sbom_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemDependencyGraphSbomRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependency-graph\sbom +type ItemItemDependencyGraphSbomRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDependencyGraphSbomRequestBuilderInternal instantiates a new ItemItemDependencyGraphSbomRequestBuilder and sets the default values. +func NewItemItemDependencyGraphSbomRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphSbomRequestBuilder) { + m := &ItemItemDependencyGraphSbomRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependency-graph/sbom", pathParameters), + } + return m +} +// NewItemItemDependencyGraphSbomRequestBuilder instantiates a new ItemItemDependencyGraphSbomRequestBuilder and sets the default values. +func NewItemItemDependencyGraphSbomRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphSbomRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependencyGraphSbomRequestBuilderInternal(urlParams, requestAdapter) +} +// Get exports the software bill of materials (SBOM) for a repository in SPDX JSON format. +// returns a DependencyGraphSpdxSbomable 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/enterprise-server@3.14/rest/dependency-graph/sboms#export-a-software-bill-of-materials-sbom-for-a-repository +func (m *ItemItemDependencyGraphSbomRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependencyGraphSpdxSbomable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDependencyGraphSpdxSbomFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DependencyGraphSpdxSbomable), nil +} +// ToGetRequestInformation exports the software bill of materials (SBOM) for a repository in SPDX JSON format. +// returns a *RequestInformation when successful +func (m *ItemItemDependencyGraphSbomRequestBuilder) 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 *ItemItemDependencyGraphSbomRequestBuilder when successful +func (m *ItemItemDependencyGraphSbomRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependencyGraphSbomRequestBuilder) { + return NewItemItemDependencyGraphSbomRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_dependency_graph_snapshots_post_response.go b/pkg/github/repos/item_item_dependency_graph_snapshots_post_response.go new file mode 100644 index 00000000..c5313125 --- /dev/null +++ b/pkg/github/repos/item_item_dependency_graph_snapshots_post_response.go @@ -0,0 +1,167 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemDependencyGraphSnapshotsPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The time at which the snapshot was created. + created_at *string + // ID of the created snapshot. + id *int32 + // A message providing further details about the result, such as why the dependencies were not updated. + message *string + // Either "SUCCESS", "ACCEPTED", or "INVALID". "SUCCESS" indicates that the snapshot was successfully created and the repository's dependencies were updated. "ACCEPTED" indicates that the snapshot was successfully created, but the repository's dependencies were not updated. "INVALID" indicates that the snapshot was malformed. + result *string +} +// NewItemItemDependencyGraphSnapshotsPostResponse instantiates a new ItemItemDependencyGraphSnapshotsPostResponse and sets the default values. +func NewItemItemDependencyGraphSnapshotsPostResponse()(*ItemItemDependencyGraphSnapshotsPostResponse) { + m := &ItemItemDependencyGraphSnapshotsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemDependencyGraphSnapshotsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDependencyGraphSnapshotsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDependencyGraphSnapshotsPostResponse(), 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 *ItemItemDependencyGraphSnapshotsPostResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCreatedAt gets the created_at property value. The time at which the snapshot was created. +// returns a *string when successful +func (m *ItemItemDependencyGraphSnapshotsPostResponse) GetCreatedAt()(*string) { + return m.created_at +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemDependencyGraphSnapshotsPostResponse) 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.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCreatedAt(val) + } + return nil + } + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(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 + } + res["result"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResult(val) + } + return nil + } + return res +} +// GetId gets the id property value. ID of the created snapshot. +// returns a *int32 when successful +func (m *ItemItemDependencyGraphSnapshotsPostResponse) GetId()(*int32) { + return m.id +} +// GetMessage gets the message property value. A message providing further details about the result, such as why the dependencies were not updated. +// returns a *string when successful +func (m *ItemItemDependencyGraphSnapshotsPostResponse) GetMessage()(*string) { + return m.message +} +// GetResult gets the result property value. Either "SUCCESS", "ACCEPTED", or "INVALID". "SUCCESS" indicates that the snapshot was successfully created and the repository's dependencies were updated. "ACCEPTED" indicates that the snapshot was successfully created, but the repository's dependencies were not updated. "INVALID" indicates that the snapshot was malformed. +// returns a *string when successful +func (m *ItemItemDependencyGraphSnapshotsPostResponse) GetResult()(*string) { + return m.result +} +// Serialize serializes information the current object +func (m *ItemItemDependencyGraphSnapshotsPostResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("created_at", m.GetCreatedAt()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("result", m.GetResult()) + 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 *ItemItemDependencyGraphSnapshotsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCreatedAt sets the created_at property value. The time at which the snapshot was created. +func (m *ItemItemDependencyGraphSnapshotsPostResponse) SetCreatedAt(value *string)() { + m.created_at = value +} +// SetId sets the id property value. ID of the created snapshot. +func (m *ItemItemDependencyGraphSnapshotsPostResponse) SetId(value *int32)() { + m.id = value +} +// SetMessage sets the message property value. A message providing further details about the result, such as why the dependencies were not updated. +func (m *ItemItemDependencyGraphSnapshotsPostResponse) SetMessage(value *string)() { + m.message = value +} +// SetResult sets the result property value. Either "SUCCESS", "ACCEPTED", or "INVALID". "SUCCESS" indicates that the snapshot was successfully created and the repository's dependencies were updated. "ACCEPTED" indicates that the snapshot was successfully created, but the repository's dependencies were not updated. "INVALID" indicates that the snapshot was malformed. +func (m *ItemItemDependencyGraphSnapshotsPostResponse) SetResult(value *string)() { + m.result = value +} +type ItemItemDependencyGraphSnapshotsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCreatedAt()(*string) + GetId()(*int32) + GetMessage()(*string) + GetResult()(*string) + SetCreatedAt(value *string)() + SetId(value *int32)() + SetMessage(value *string)() + SetResult(value *string)() +} diff --git a/pkg/github/repos/item_item_dependency_graph_snapshots_request_builder.go b/pkg/github/repos/item_item_dependency_graph_snapshots_request_builder.go new file mode 100644 index 00000000..f6cde0cd --- /dev/null +++ b/pkg/github/repos/item_item_dependency_graph_snapshots_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemDependencyGraphSnapshotsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dependency-graph\snapshots +type ItemItemDependencyGraphSnapshotsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDependencyGraphSnapshotsRequestBuilderInternal instantiates a new ItemItemDependencyGraphSnapshotsRequestBuilder and sets the default values. +func NewItemItemDependencyGraphSnapshotsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphSnapshotsRequestBuilder) { + m := &ItemItemDependencyGraphSnapshotsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dependency-graph/snapshots", pathParameters), + } + return m +} +// NewItemItemDependencyGraphSnapshotsRequestBuilder instantiates a new ItemItemDependencyGraphSnapshotsRequestBuilder and sets the default values. +func NewItemItemDependencyGraphSnapshotsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDependencyGraphSnapshotsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDependencyGraphSnapshotsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post create a new snapshot of a repository's dependencies.The authenticated user must have access to the repository.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemDependencyGraphSnapshotsPostResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/dependency-graph/dependency-submission#create-a-snapshot-of-dependencies-for-a-repository +func (m *ItemItemDependencyGraphSnapshotsRequestBuilder) Post(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Snapshotable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemDependencyGraphSnapshotsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemDependencyGraphSnapshotsPostResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemDependencyGraphSnapshotsPostResponseable), nil +} +// ToPostRequestInformation create a new snapshot of a repository's dependencies.The authenticated user must have access to the repository.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDependencyGraphSnapshotsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Snapshotable, 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 *ItemItemDependencyGraphSnapshotsRequestBuilder when successful +func (m *ItemItemDependencyGraphSnapshotsRequestBuilder) WithUrl(rawUrl string)(*ItemItemDependencyGraphSnapshotsRequestBuilder) { + return NewItemItemDependencyGraphSnapshotsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_deployments_item_statuses_post_request_body.go b/pkg/github/repos/item_item_deployments_item_statuses_post_request_body.go new file mode 100644 index 00000000..4b9b01d3 --- /dev/null +++ b/pkg/github/repos/item_item_deployments_item_statuses_post_request_body.go @@ -0,0 +1,225 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemDeploymentsItemStatusesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Adds a new `inactive` status to all prior non-transient, non-production environment deployments with the same repository and `environment` name as the created status's deployment. An `inactive` status is only added to deployments that had a `success` state. Default: `true` + auto_inactive *bool + // A short description of the status. The maximum description length is 140 characters. + description *string + // Name for the target deployment environment, which can be changed when setting a deploy status. For example, `production`, `staging`, or `qa`. If not defined, the environment of the previous status on the deployment will be used, if it exists. Otherwise, the environment of the deployment will be used. + environment *string + // Sets the URL for accessing your environment. Default: `""` + environment_url *string + // The full URL of the deployment's output. This parameter replaces `target_url`. We will continue to accept `target_url` to support legacy uses, but we recommend replacing `target_url` with `log_url`. Setting `log_url` will automatically set `target_url` to the same value. Default: `""` + log_url *string + // The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment.> [!NOTE]> It's recommended to use the `log_url` parameter, which replaces `target_url`. + target_url *string +} +// NewItemItemDeploymentsItemStatusesPostRequestBody instantiates a new ItemItemDeploymentsItemStatusesPostRequestBody and sets the default values. +func NewItemItemDeploymentsItemStatusesPostRequestBody()(*ItemItemDeploymentsItemStatusesPostRequestBody) { + m := &ItemItemDeploymentsItemStatusesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemDeploymentsItemStatusesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDeploymentsItemStatusesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDeploymentsItemStatusesPostRequestBody(), 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 *ItemItemDeploymentsItemStatusesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAutoInactive gets the auto_inactive property value. Adds a new `inactive` status to all prior non-transient, non-production environment deployments with the same repository and `environment` name as the created status's deployment. An `inactive` status is only added to deployments that had a `success` state. Default: `true` +// returns a *bool when successful +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) GetAutoInactive()(*bool) { + return m.auto_inactive +} +// GetDescription gets the description property value. A short description of the status. The maximum description length is 140 characters. +// returns a *string when successful +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) GetDescription()(*string) { + return m.description +} +// GetEnvironment gets the environment property value. Name for the target deployment environment, which can be changed when setting a deploy status. For example, `production`, `staging`, or `qa`. If not defined, the environment of the previous status on the deployment will be used, if it exists. Otherwise, the environment of the deployment will be used. +// returns a *string when successful +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) GetEnvironment()(*string) { + return m.environment +} +// GetEnvironmentUrl gets the environment_url property value. Sets the URL for accessing your environment. Default: `""` +// returns a *string when successful +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) GetEnvironmentUrl()(*string) { + return m.environment_url +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["auto_inactive"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAutoInactive(val) + } + 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["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["environment_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironmentUrl(val) + } + return nil + } + res["log_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLogUrl(val) + } + return nil + } + res["target_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetUrl(val) + } + return nil + } + return res +} +// GetLogUrl gets the log_url property value. The full URL of the deployment's output. This parameter replaces `target_url`. We will continue to accept `target_url` to support legacy uses, but we recommend replacing `target_url` with `log_url`. Setting `log_url` will automatically set `target_url` to the same value. Default: `""` +// returns a *string when successful +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) GetLogUrl()(*string) { + return m.log_url +} +// GetTargetUrl gets the target_url property value. The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment.> [!NOTE]> It's recommended to use the `log_url` parameter, which replaces `target_url`. +// returns a *string when successful +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) GetTargetUrl()(*string) { + return m.target_url +} +// Serialize serializes information the current object +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("auto_inactive", m.GetAutoInactive()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment_url", m.GetEnvironmentUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("log_url", m.GetLogUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_url", m.GetTargetUrl()) + 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 *ItemItemDeploymentsItemStatusesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAutoInactive sets the auto_inactive property value. Adds a new `inactive` status to all prior non-transient, non-production environment deployments with the same repository and `environment` name as the created status's deployment. An `inactive` status is only added to deployments that had a `success` state. Default: `true` +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) SetAutoInactive(value *bool)() { + m.auto_inactive = value +} +// SetDescription sets the description property value. A short description of the status. The maximum description length is 140 characters. +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetEnvironment sets the environment property value. Name for the target deployment environment, which can be changed when setting a deploy status. For example, `production`, `staging`, or `qa`. If not defined, the environment of the previous status on the deployment will be used, if it exists. Otherwise, the environment of the deployment will be used. +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) SetEnvironment(value *string)() { + m.environment = value +} +// SetEnvironmentUrl sets the environment_url property value. Sets the URL for accessing your environment. Default: `""` +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) SetEnvironmentUrl(value *string)() { + m.environment_url = value +} +// SetLogUrl sets the log_url property value. The full URL of the deployment's output. This parameter replaces `target_url`. We will continue to accept `target_url` to support legacy uses, but we recommend replacing `target_url` with `log_url`. Setting `log_url` will automatically set `target_url` to the same value. Default: `""` +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) SetLogUrl(value *string)() { + m.log_url = value +} +// SetTargetUrl sets the target_url property value. The target URL to associate with this status. This URL should contain output to keep the user updated while the task is running or serve as historical information for what happened in the deployment.> [!NOTE]> It's recommended to use the `log_url` parameter, which replaces `target_url`. +func (m *ItemItemDeploymentsItemStatusesPostRequestBody) SetTargetUrl(value *string)() { + m.target_url = value +} +type ItemItemDeploymentsItemStatusesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAutoInactive()(*bool) + GetDescription()(*string) + GetEnvironment()(*string) + GetEnvironmentUrl()(*string) + GetLogUrl()(*string) + GetTargetUrl()(*string) + SetAutoInactive(value *bool)() + SetDescription(value *string)() + SetEnvironment(value *string)() + SetEnvironmentUrl(value *string)() + SetLogUrl(value *string)() + SetTargetUrl(value *string)() +} diff --git a/pkg/github/repos/item_item_deployments_item_statuses_request_builder.go b/pkg/github/repos/item_item_deployments_item_statuses_request_builder.go new file mode 100644 index 00000000..8d506b55 --- /dev/null +++ b/pkg/github/repos/item_item_deployments_item_statuses_request_builder.go @@ -0,0 +1,117 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemDeploymentsItemStatusesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\deployments\{deployment_id}\statuses +type ItemItemDeploymentsItemStatusesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemDeploymentsItemStatusesRequestBuilderGetQueryParameters users with pull access can view deployment statuses for a deployment: +type ItemItemDeploymentsItemStatusesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByStatus_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.deployments.item.statuses.item collection +// returns a *ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder when successful +func (m *ItemItemDeploymentsItemStatusesRequestBuilder) ByStatus_id(status_id int32)(*ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["status_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(status_id), 10) + return NewItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemDeploymentsItemStatusesRequestBuilderInternal instantiates a new ItemItemDeploymentsItemStatusesRequestBuilder and sets the default values. +func NewItemItemDeploymentsItemStatusesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsItemStatusesRequestBuilder) { + m := &ItemItemDeploymentsItemStatusesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/deployments/{deployment_id}/statuses{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemDeploymentsItemStatusesRequestBuilder instantiates a new ItemItemDeploymentsItemStatusesRequestBuilder and sets the default values. +func NewItemItemDeploymentsItemStatusesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsItemStatusesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDeploymentsItemStatusesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get users with pull access can view deployment statuses for a deployment: +// returns a []DeploymentStatusable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/statuses#list-deployment-statuses +func (m *ItemItemDeploymentsItemStatusesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDeploymentsItemStatusesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentStatusable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentStatusable) + } + } + return val, nil +} +// Post users with `push` access can create deployment statuses for a given deployment.OAuth app tokens and personal access tokens (classic) need the `repo_deployment` scope to use this endpoint. +// returns a DeploymentStatusable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/statuses#create-a-deployment-status +func (m *ItemItemDeploymentsItemStatusesRequestBuilder) Post(ctx context.Context, body ItemItemDeploymentsItemStatusesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentStatusable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentStatusable), nil +} +// ToGetRequestInformation users with pull access can view deployment statuses for a deployment: +// returns a *RequestInformation when successful +func (m *ItemItemDeploymentsItemStatusesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDeploymentsItemStatusesRequestBuilderGetQueryParameters])(*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 users with `push` access can create deployment statuses for a given deployment.OAuth app tokens and personal access tokens (classic) need the `repo_deployment` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDeploymentsItemStatusesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemDeploymentsItemStatusesPostRequestBodyable, 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 *ItemItemDeploymentsItemStatusesRequestBuilder when successful +func (m *ItemItemDeploymentsItemStatusesRequestBuilder) WithUrl(rawUrl string)(*ItemItemDeploymentsItemStatusesRequestBuilder) { + return NewItemItemDeploymentsItemStatusesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_deployments_item_statuses_with_status_escaped_item_request_builder.go b/pkg/github/repos/item_item_deployments_item_statuses_with_status_escaped_item_request_builder.go new file mode 100644 index 00000000..1a397fba --- /dev/null +++ b/pkg/github/repos/item_item_deployments_item_statuses_with_status_escaped_item_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\deployments\{deployment_id}\statuses\{status_id} +type ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilderInternal instantiates a new ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder and sets the default values. +func NewItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder) { + m := &ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/deployments/{deployment_id}/statuses/{status_id}", pathParameters), + } + return m +} +// NewItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder instantiates a new ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder and sets the default values. +func NewItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get users with pull access can view a deployment status for a deployment: +// returns a DeploymentStatusable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/statuses#get-a-deployment-status +func (m *ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentStatusable), nil +} +// ToGetRequestInformation users with pull access can view a deployment status for a deployment: +// returns a *RequestInformation when successful +func (m *ItemItemDeploymentsItemStatusesWithStatus_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder when successful +func (m *ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder) { + return NewItemItemDeploymentsItemStatusesWithStatus_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_deployments_post_request_body.go b/pkg/github/repos/item_item_deployments_post_request_body.go new file mode 100644 index 00000000..911983fb --- /dev/null +++ b/pkg/github/repos/item_item_deployments_post_request_body.go @@ -0,0 +1,322 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemDeploymentsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. + auto_merge *bool + // Short description of the deployment. + description *string + // Name for the target deployment environment (e.g., `production`, `staging`, `qa`). + environment *string + // The payload property + payload *string + // Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. + production_environment *bool + // The ref to deploy. This can be a branch, tag, or SHA. + ref *string + // The [status](https://docs.github.com/enterprise-server@3.14/rest/commits/statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. + required_contexts []string + // Specifies a task to execute (e.g., `deploy` or `deploy:migrations`). + task *string + // Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` + transient_environment *bool +} +// NewItemItemDeploymentsPostRequestBody instantiates a new ItemItemDeploymentsPostRequestBody and sets the default values. +func NewItemItemDeploymentsPostRequestBody()(*ItemItemDeploymentsPostRequestBody) { + m := &ItemItemDeploymentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + environmentValue := "production" + m.SetEnvironment(&environmentValue) + taskValue := "deploy" + m.SetTask(&taskValue) + return m +} +// CreateItemItemDeploymentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDeploymentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDeploymentsPostRequestBody(), 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 *ItemItemDeploymentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAutoMerge gets the auto_merge property value. Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. +// returns a *bool when successful +func (m *ItemItemDeploymentsPostRequestBody) GetAutoMerge()(*bool) { + return m.auto_merge +} +// GetDescription gets the description property value. Short description of the deployment. +// returns a *string when successful +func (m *ItemItemDeploymentsPostRequestBody) GetDescription()(*string) { + return m.description +} +// GetEnvironment gets the environment property value. Name for the target deployment environment (e.g., `production`, `staging`, `qa`). +// returns a *string when successful +func (m *ItemItemDeploymentsPostRequestBody) GetEnvironment()(*string) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemDeploymentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAutoMerge(val) + } + 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["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPayload(val) + } + return nil + } + res["production_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetProductionEnvironment(val) + } + return nil + } + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["required_contexts"] = 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.SetRequiredContexts(res) + } + return nil + } + res["task"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTask(val) + } + return nil + } + res["transient_environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetTransientEnvironment(val) + } + return nil + } + return res +} +// GetPayload gets the payload property value. The payload property +// returns a *string when successful +func (m *ItemItemDeploymentsPostRequestBody) GetPayload()(*string) { + return m.payload +} +// GetProductionEnvironment gets the production_environment property value. Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. +// returns a *bool when successful +func (m *ItemItemDeploymentsPostRequestBody) GetProductionEnvironment()(*bool) { + return m.production_environment +} +// GetRef gets the ref property value. The ref to deploy. This can be a branch, tag, or SHA. +// returns a *string when successful +func (m *ItemItemDeploymentsPostRequestBody) GetRef()(*string) { + return m.ref +} +// GetRequiredContexts gets the required_contexts property value. The [status](https://docs.github.com/enterprise-server@3.14/rest/commits/statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. +// returns a []string when successful +func (m *ItemItemDeploymentsPostRequestBody) GetRequiredContexts()([]string) { + return m.required_contexts +} +// GetTask gets the task property value. Specifies a task to execute (e.g., `deploy` or `deploy:migrations`). +// returns a *string when successful +func (m *ItemItemDeploymentsPostRequestBody) GetTask()(*string) { + return m.task +} +// GetTransientEnvironment gets the transient_environment property value. Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` +// returns a *bool when successful +func (m *ItemItemDeploymentsPostRequestBody) GetTransientEnvironment()(*bool) { + return m.transient_environment +} +// Serialize serializes information the current object +func (m *ItemItemDeploymentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("auto_merge", m.GetAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("payload", m.GetPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("production_environment", m.GetProductionEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + if m.GetRequiredContexts() != nil { + err := writer.WriteCollectionOfStringValues("required_contexts", m.GetRequiredContexts()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("task", m.GetTask()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("transient_environment", m.GetTransientEnvironment()) + 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 *ItemItemDeploymentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAutoMerge sets the auto_merge property value. Attempts to automatically merge the default branch into the requested ref, if it's behind the default branch. +func (m *ItemItemDeploymentsPostRequestBody) SetAutoMerge(value *bool)() { + m.auto_merge = value +} +// SetDescription sets the description property value. Short description of the deployment. +func (m *ItemItemDeploymentsPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetEnvironment sets the environment property value. Name for the target deployment environment (e.g., `production`, `staging`, `qa`). +func (m *ItemItemDeploymentsPostRequestBody) SetEnvironment(value *string)() { + m.environment = value +} +// SetPayload sets the payload property value. The payload property +func (m *ItemItemDeploymentsPostRequestBody) SetPayload(value *string)() { + m.payload = value +} +// SetProductionEnvironment sets the production_environment property value. Specifies if the given environment is one that end-users directly interact with. Default: `true` when `environment` is `production` and `false` otherwise. +func (m *ItemItemDeploymentsPostRequestBody) SetProductionEnvironment(value *bool)() { + m.production_environment = value +} +// SetRef sets the ref property value. The ref to deploy. This can be a branch, tag, or SHA. +func (m *ItemItemDeploymentsPostRequestBody) SetRef(value *string)() { + m.ref = value +} +// SetRequiredContexts sets the required_contexts property value. The [status](https://docs.github.com/enterprise-server@3.14/rest/commits/statuses) contexts to verify against commit status checks. If you omit this parameter, GitHub verifies all unique contexts before creating a deployment. To bypass checking entirely, pass an empty array. Defaults to all unique contexts. +func (m *ItemItemDeploymentsPostRequestBody) SetRequiredContexts(value []string)() { + m.required_contexts = value +} +// SetTask sets the task property value. Specifies a task to execute (e.g., `deploy` or `deploy:migrations`). +func (m *ItemItemDeploymentsPostRequestBody) SetTask(value *string)() { + m.task = value +} +// SetTransientEnvironment sets the transient_environment property value. Specifies if the given environment is specific to the deployment and will no longer exist at some point in the future. Default: `false` +func (m *ItemItemDeploymentsPostRequestBody) SetTransientEnvironment(value *bool)() { + m.transient_environment = value +} +type ItemItemDeploymentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAutoMerge()(*bool) + GetDescription()(*string) + GetEnvironment()(*string) + GetPayload()(*string) + GetProductionEnvironment()(*bool) + GetRef()(*string) + GetRequiredContexts()([]string) + GetTask()(*string) + GetTransientEnvironment()(*bool) + SetAutoMerge(value *bool)() + SetDescription(value *string)() + SetEnvironment(value *string)() + SetPayload(value *string)() + SetProductionEnvironment(value *bool)() + SetRef(value *string)() + SetRequiredContexts(value []string)() + SetTask(value *string)() + SetTransientEnvironment(value *bool)() +} diff --git a/pkg/github/repos/item_item_deployments_request_builder.go b/pkg/github/repos/item_item_deployments_request_builder.go new file mode 100644 index 00000000..16ca5622 --- /dev/null +++ b/pkg/github/repos/item_item_deployments_request_builder.go @@ -0,0 +1,121 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemDeploymentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\deployments +type ItemItemDeploymentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemDeploymentsRequestBuilderGetQueryParameters simple filtering of deployments is available via query parameters: +type ItemItemDeploymentsRequestBuilderGetQueryParameters struct { + // The name of the environment that was deployed to (e.g., `staging` or `production`). + Environment *string `uriparametername:"environment"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The name of the ref. This can be a branch, tag, or SHA. + Ref *string `uriparametername:"ref"` + // The SHA recorded at creation time. + Sha *string `uriparametername:"sha"` + // The name of the task for the deployment (e.g., `deploy` or `deploy:migrations`). + Task *string `uriparametername:"task"` +} +// ByDeployment_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.deployments.item collection +// returns a *ItemItemDeploymentsWithDeployment_ItemRequestBuilder when successful +func (m *ItemItemDeploymentsRequestBuilder) ByDeployment_id(deployment_id int32)(*ItemItemDeploymentsWithDeployment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["deployment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(deployment_id), 10) + return NewItemItemDeploymentsWithDeployment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemDeploymentsRequestBuilderInternal instantiates a new ItemItemDeploymentsRequestBuilder and sets the default values. +func NewItemItemDeploymentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsRequestBuilder) { + m := &ItemItemDeploymentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/deployments{?environment*,page*,per_page*,ref*,sha*,task*}", pathParameters), + } + return m +} +// NewItemItemDeploymentsRequestBuilder instantiates a new ItemItemDeploymentsRequestBuilder and sets the default values. +func NewItemItemDeploymentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDeploymentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get simple filtering of deployments is available via query parameters: +// returns a []Deploymentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/deployments#list-deployments +func (m *ItemItemDeploymentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDeploymentsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Deploymentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Deploymentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Deploymentable) + } + } + return val, nil +} +// Post deployments offer a few configurable parameters with certain defaults.The `ref` parameter can be any named branch, tag, or SHA. At GitHub Enterprise Server we often deploy branches and verify thembefore we merge a pull request.The `environment` parameter allows deployments to be issued to different runtime environments. Teams often havemultiple environments for verifying their applications, such as `production`, `staging`, and `qa`. This parametermakes it easier to track which environments have requested deployments. The default environment is `production`.The `auto_merge` parameter is used to ensure that the requested ref is not behind the repository's default branch. Ifthe ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API willreturn a failure response.By default, [commit statuses](https://docs.github.com/enterprise-server@3.14/rest/commits/statuses) for every submitted context must be in a `success`state. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or tospecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you donot require any contexts or create any commit statuses, the deployment will always succeed.The `payload` parameter is available for any extra information that a deployment system might need. It is a JSON textfield that will be passed on when a deployment event is dispatched.The `task` parameter is used by the deployment system to allow different execution paths. In the web world this mightbe `deploy:migrations` to run schema changes on the system. In the compiled world this could be a flag to compile anapplication with debugging enabled.Merged branch response:You will see this response when GitHub automatically merges the base branch into the topic branch instead of creatinga deployment. This auto-merge happens when:* Auto-merge option is enabled in the repository* Topic branch does not include the latest changes on the base branch, which is `master` in the response example* There are no merge conflictsIf there are no new commits in the base branch, a new request to create a deployment should give a successfulresponse.Merge conflict response:This error happens when the `auto_merge` option is enabled and when the default branch (in this case `master`), can'tbe merged into the branch that's being deployed (in this case `topic-branch`), due to merge conflicts.Failed commit status checks:This error happens when the `required_contexts` parameter indicates that one or more contexts need to have a `success`status for the commit to be deployed, but one or more of the required contexts do not have a state of `success`.OAuth app tokens and personal access tokens (classic) need the `repo` or `repo_deployment` scope to use this endpoint. +// returns a Deploymentable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/deployments#create-a-deployment +func (m *ItemItemDeploymentsRequestBuilder) Post(ctx context.Context, body ItemItemDeploymentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Deploymentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Deploymentable), nil +} +// ToGetRequestInformation simple filtering of deployments is available via query parameters: +// returns a *RequestInformation when successful +func (m *ItemItemDeploymentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemDeploymentsRequestBuilderGetQueryParameters])(*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 deployments offer a few configurable parameters with certain defaults.The `ref` parameter can be any named branch, tag, or SHA. At GitHub Enterprise Server we often deploy branches and verify thembefore we merge a pull request.The `environment` parameter allows deployments to be issued to different runtime environments. Teams often havemultiple environments for verifying their applications, such as `production`, `staging`, and `qa`. This parametermakes it easier to track which environments have requested deployments. The default environment is `production`.The `auto_merge` parameter is used to ensure that the requested ref is not behind the repository's default branch. Ifthe ref _is_ behind the default branch for the repository, we will attempt to merge it for you. If the merge succeeds,the API will return a successful merge commit. If merge conflicts prevent the merge from succeeding, the API willreturn a failure response.By default, [commit statuses](https://docs.github.com/enterprise-server@3.14/rest/commits/statuses) for every submitted context must be in a `success`state. The `required_contexts` parameter allows you to specify a subset of contexts that must be `success`, or tospecify contexts that have not yet been submitted. You are not required to use commit statuses to deploy. If you donot require any contexts or create any commit statuses, the deployment will always succeed.The `payload` parameter is available for any extra information that a deployment system might need. It is a JSON textfield that will be passed on when a deployment event is dispatched.The `task` parameter is used by the deployment system to allow different execution paths. In the web world this mightbe `deploy:migrations` to run schema changes on the system. In the compiled world this could be a flag to compile anapplication with debugging enabled.Merged branch response:You will see this response when GitHub automatically merges the base branch into the topic branch instead of creatinga deployment. This auto-merge happens when:* Auto-merge option is enabled in the repository* Topic branch does not include the latest changes on the base branch, which is `master` in the response example* There are no merge conflictsIf there are no new commits in the base branch, a new request to create a deployment should give a successfulresponse.Merge conflict response:This error happens when the `auto_merge` option is enabled and when the default branch (in this case `master`), can'tbe merged into the branch that's being deployed (in this case `topic-branch`), due to merge conflicts.Failed commit status checks:This error happens when the `required_contexts` parameter indicates that one or more contexts need to have a `success`status for the commit to be deployed, but one or more of the required contexts do not have a state of `success`.OAuth app tokens and personal access tokens (classic) need the `repo` or `repo_deployment` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDeploymentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemDeploymentsPostRequestBodyable, 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 *ItemItemDeploymentsRequestBuilder when successful +func (m *ItemItemDeploymentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemDeploymentsRequestBuilder) { + return NewItemItemDeploymentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_deployments_with_deployment_escaped_item_request_builder.go b/pkg/github/repos/item_item_deployments_with_deployment_escaped_item_request_builder.go new file mode 100644 index 00000000..3c8dbdf3 --- /dev/null +++ b/pkg/github/repos/item_item_deployments_with_deployment_escaped_item_request_builder.go @@ -0,0 +1,94 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemDeploymentsWithDeployment_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\deployments\{deployment_id} +type ItemItemDeploymentsWithDeployment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDeploymentsWithDeployment_ItemRequestBuilderInternal instantiates a new ItemItemDeploymentsWithDeployment_ItemRequestBuilder and sets the default values. +func NewItemItemDeploymentsWithDeployment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsWithDeployment_ItemRequestBuilder) { + m := &ItemItemDeploymentsWithDeployment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/deployments/{deployment_id}", pathParameters), + } + return m +} +// NewItemItemDeploymentsWithDeployment_ItemRequestBuilder instantiates a new ItemItemDeploymentsWithDeployment_ItemRequestBuilder and sets the default values. +func NewItemItemDeploymentsWithDeployment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDeploymentsWithDeployment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDeploymentsWithDeployment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete if the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment.To set a deployment as inactive, you must:* Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.* Mark the active deployment as inactive by adding any non-successful deployment status.For more information, see "[Create a deployment](https://docs.github.com/enterprise-server@3.14/rest/deployments/deployments/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/enterprise-server@3.14/rest/deployments/statuses#create-a-deployment-status)."OAuth app tokens and personal access tokens (classic) need the `repo` or `repo_deployment` scope to use this endpoint. +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/deployments#delete-a-deployment +func (m *ItemItemDeploymentsWithDeployment_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 { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get get a deployment +// returns a Deploymentable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/deployments#get-a-deployment +func (m *ItemItemDeploymentsWithDeployment_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Deploymentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Deploymentable), nil +} +// Statuses the statuses property +// returns a *ItemItemDeploymentsItemStatusesRequestBuilder when successful +func (m *ItemItemDeploymentsWithDeployment_ItemRequestBuilder) Statuses()(*ItemItemDeploymentsItemStatusesRequestBuilder) { + return NewItemItemDeploymentsItemStatusesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation if the repository only has one deployment, you can delete the deployment regardless of its status. If the repository has more than one deployment, you can only delete inactive deployments. This ensures that repositories with multiple deployments will always have an active deployment.To set a deployment as inactive, you must:* Create a new deployment that is active so that the system has a record of the current state, then delete the previously active deployment.* Mark the active deployment as inactive by adding any non-successful deployment status.For more information, see "[Create a deployment](https://docs.github.com/enterprise-server@3.14/rest/deployments/deployments/#create-a-deployment)" and "[Create a deployment status](https://docs.github.com/enterprise-server@3.14/rest/deployments/statuses#create-a-deployment-status)."OAuth app tokens and personal access tokens (classic) need the `repo` or `repo_deployment` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDeploymentsWithDeployment_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") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ItemItemDeploymentsWithDeployment_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemDeploymentsWithDeployment_ItemRequestBuilder when successful +func (m *ItemItemDeploymentsWithDeployment_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemDeploymentsWithDeployment_ItemRequestBuilder) { + return NewItemItemDeploymentsWithDeployment_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_dispatches_post_request_body.go b/pkg/github/repos/item_item_dispatches_post_request_body.go new file mode 100644 index 00000000..a463fda9 --- /dev/null +++ b/pkg/github/repos/item_item_dispatches_post_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemDispatchesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. + client_payload ItemItemDispatchesPostRequestBody_client_payloadable + // A custom webhook event name. Must be 100 characters or fewer. + event_type *string +} +// NewItemItemDispatchesPostRequestBody instantiates a new ItemItemDispatchesPostRequestBody and sets the default values. +func NewItemItemDispatchesPostRequestBody()(*ItemItemDispatchesPostRequestBody) { + m := &ItemItemDispatchesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemDispatchesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDispatchesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDispatchesPostRequestBody(), 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 *ItemItemDispatchesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetClientPayload gets the client_payload property value. JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. +// returns a ItemItemDispatchesPostRequestBody_client_payloadable when successful +func (m *ItemItemDispatchesPostRequestBody) GetClientPayload()(ItemItemDispatchesPostRequestBody_client_payloadable) { + return m.client_payload +} +// GetEventType gets the event_type property value. A custom webhook event name. Must be 100 characters or fewer. +// returns a *string when successful +func (m *ItemItemDispatchesPostRequestBody) GetEventType()(*string) { + return m.event_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemDispatchesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["client_payload"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemDispatchesPostRequestBody_client_payloadFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetClientPayload(val.(ItemItemDispatchesPostRequestBody_client_payloadable)) + } + return nil + } + res["event_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEventType(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemDispatchesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("client_payload", m.GetClientPayload()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("event_type", m.GetEventType()) + 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 *ItemItemDispatchesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetClientPayload sets the client_payload property value. JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. +func (m *ItemItemDispatchesPostRequestBody) SetClientPayload(value ItemItemDispatchesPostRequestBody_client_payloadable)() { + m.client_payload = value +} +// SetEventType sets the event_type property value. A custom webhook event name. Must be 100 characters or fewer. +func (m *ItemItemDispatchesPostRequestBody) SetEventType(value *string)() { + m.event_type = value +} +type ItemItemDispatchesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetClientPayload()(ItemItemDispatchesPostRequestBody_client_payloadable) + GetEventType()(*string) + SetClientPayload(value ItemItemDispatchesPostRequestBody_client_payloadable)() + SetEventType(value *string)() +} diff --git a/pkg/github/repos/item_item_dispatches_post_request_body_escaped_client_escaped_payload.go b/pkg/github/repos/item_item_dispatches_post_request_body_escaped_client_escaped_payload.go new file mode 100644 index 00000000..1e325ee0 --- /dev/null +++ b/pkg/github/repos/item_item_dispatches_post_request_body_escaped_client_escaped_payload.go @@ -0,0 +1,52 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemDispatchesPostRequestBody_client_payload jSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. +type ItemItemDispatchesPostRequestBody_client_payload struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemDispatchesPostRequestBody_client_payload instantiates a new ItemItemDispatchesPostRequestBody_client_payload and sets the default values. +func NewItemItemDispatchesPostRequestBody_client_payload()(*ItemItemDispatchesPostRequestBody_client_payload) { + m := &ItemItemDispatchesPostRequestBody_client_payload{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemDispatchesPostRequestBody_client_payloadFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemDispatchesPostRequestBody_client_payloadFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemDispatchesPostRequestBody_client_payload(), 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 *ItemItemDispatchesPostRequestBody_client_payload) 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 *ItemItemDispatchesPostRequestBody_client_payload) 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 *ItemItemDispatchesPostRequestBody_client_payload) 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 *ItemItemDispatchesPostRequestBody_client_payload) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemDispatchesPostRequestBody_client_payloadable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_dispatches_request_builder.go b/pkg/github/repos/item_item_dispatches_request_builder.go new file mode 100644 index 00000000..76e08420 --- /dev/null +++ b/pkg/github/repos/item_item_dispatches_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemDispatchesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\dispatches +type ItemItemDispatchesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemDispatchesRequestBuilderInternal instantiates a new ItemItemDispatchesRequestBuilder and sets the default values. +func NewItemItemDispatchesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDispatchesRequestBuilder) { + m := &ItemItemDispatchesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/dispatches", pathParameters), + } + return m +} +// NewItemItemDispatchesRequestBuilder instantiates a new ItemItemDispatchesRequestBuilder and sets the default values. +func NewItemItemDispatchesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemDispatchesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemDispatchesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post you can use this endpoint to trigger a webhook event called `repository_dispatch` when you want activity that happens outside of GitHub Enterprise Server to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the `repository_dispatch` event occurs. For an example `repository_dispatch` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#repository_dispatch)."The `client_payload` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the `client_payload` can include a message that a user would like to send using a GitHub Actions workflow. Or the `client_payload` can be used as a test to debug your workflow.This input example shows how you can use the `client_payload` as a test to debug your workflow.OAuth app tokens and personal access tokens (classic) need the `repo` 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/enterprise-server@3.14/rest/repos/repos#create-a-repository-dispatch-event +func (m *ItemItemDispatchesRequestBuilder) Post(ctx context.Context, body ItemItemDispatchesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation you can use this endpoint to trigger a webhook event called `repository_dispatch` when you want activity that happens outside of GitHub Enterprise Server to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the `repository_dispatch` event occurs. For an example `repository_dispatch` webhook payload, see "[RepositoryDispatchEvent](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#repository_dispatch)."The `client_payload` parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the `client_payload` can include a message that a user would like to send using a GitHub Actions workflow. Or the `client_payload` can be used as a test to debug your workflow.This input example shows how you can use the `client_payload` as a test to debug your workflow.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemDispatchesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemDispatchesPostRequestBodyable, 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 *ItemItemDispatchesRequestBuilder when successful +func (m *ItemItemDispatchesRequestBuilder) WithUrl(rawUrl string)(*ItemItemDispatchesRequestBuilder) { + return NewItemItemDispatchesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_get_response.go b/pkg/github/repos/item_item_environments_get_response.go new file mode 100644 index 00000000..59fa3f64 --- /dev/null +++ b/pkg/github/repos/item_item_environments_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemEnvironmentsGetResponse 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 environments property + environments []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Environmentable + // The number of environments in this repository + total_count *int32 +} +// NewItemItemEnvironmentsGetResponse instantiates a new ItemItemEnvironmentsGetResponse and sets the default values. +func NewItemItemEnvironmentsGetResponse()(*ItemItemEnvironmentsGetResponse) { + m := &ItemItemEnvironmentsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsGetResponse(), 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 *ItemItemEnvironmentsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEnvironments gets the environments property value. The environments property +// returns a []Environmentable when successful +func (m *ItemItemEnvironmentsGetResponse) GetEnvironments()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Environmentable) { + return m.environments +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["environments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnvironmentFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Environmentable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Environmentable) + } + } + m.SetEnvironments(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 number of environments in this repository +// returns a *int32 when successful +func (m *ItemItemEnvironmentsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEnvironments() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetEnvironments())) + for i, v := range m.GetEnvironments() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("environments", 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 *ItemItemEnvironmentsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEnvironments sets the environments property value. The environments property +func (m *ItemItemEnvironmentsGetResponse) SetEnvironments(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Environmentable)() { + m.environments = value +} +// SetTotalCount sets the total_count property value. The number of environments in this repository +func (m *ItemItemEnvironmentsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemEnvironmentsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEnvironments()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Environmentable) + GetTotalCount()(*int32) + SetEnvironments(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Environmentable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_environments_item_deployment_branch_policies_get_response.go b/pkg/github/repos/item_item_environments_item_deployment_branch_policies_get_response.go new file mode 100644 index 00000000..bae3a238 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_deployment_branch_policies_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse 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 branch_policies property + branch_policies []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyable + // The number of deployment branch policies for the environment. + total_count *int32 +} +// NewItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse instantiates a new ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse and sets the default values. +func NewItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse()(*ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) { + m := &ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse(), 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 *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBranchPolicies gets the branch_policies property value. The branch_policies property +// returns a []DeploymentBranchPolicyable when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) GetBranchPolicies()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyable) { + return m.branch_policies +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["branch_policies"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentBranchPolicyFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyable) + } + } + m.SetBranchPolicies(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 number of deployment branch policies for the environment. +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBranchPolicies() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetBranchPolicies())) + for i, v := range m.GetBranchPolicies() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("branch_policies", 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 *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBranchPolicies sets the branch_policies property value. The branch_policies property +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) SetBranchPolicies(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyable)() { + m.branch_policies = value +} +// SetTotalCount sets the total_count property value. The number of deployment branch policies for the environment. +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBranchPolicies()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyable) + GetTotalCount()(*int32) + SetBranchPolicies(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_environments_item_deployment_branch_policies_request_builder.go b/pkg/github/repos/item_item_environments_item_deployment_branch_policies_request_builder.go new file mode 100644 index 00000000..4695e23f --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_deployment_branch_policies_request_builder.go @@ -0,0 +1,106 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\deployment-branch-policies +type ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderGetQueryParameters lists the deployment branch policies for an environment.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByBranch_policy_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.environments.item.deploymentBranchPolicies.item collection +// returns a *ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) ByBranch_policy_id(branch_policy_id int32)(*ItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["branch_policy_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(branch_policy_id), 10) + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesWithBranch_policy_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) { + m := &ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/deployment-branch-policies{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder instantiates a new ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the deployment branch policies for an environment.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/branch-policies#list-deployment-branch-policies +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderGetQueryParameters])(ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemEnvironmentsItemDeploymentBranchPoliciesGetResponseable), nil +} +// Post creates a deployment branch or tag policy for an environment.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a DeploymentBranchPolicyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/branch-policies#create-a-deployment-branch-policy +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) Post(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyNamePatternWithTypeable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentBranchPolicyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyable), nil +} +// ToGetRequestInformation lists the deployment branch policies for an environment.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderGetQueryParameters])(*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 deployment branch or tag policy for an environment.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicyNamePatternWithTypeable, 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 *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) { + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_apps_get_response.go b/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_apps_get_response.go new file mode 100644 index 00000000..d660c075 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_apps_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse 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 available_custom_deployment_protection_rule_integrations property + available_custom_deployment_protection_rule_integrations []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomDeploymentRuleAppable + // The total number of custom deployment protection rule integrations available for this environment. + total_count *int32 +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse()(*ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) { + m := &ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse(), 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 *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAvailableCustomDeploymentProtectionRuleIntegrations gets the available_custom_deployment_protection_rule_integrations property value. The available_custom_deployment_protection_rule_integrations property +// returns a []CustomDeploymentRuleAppable when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) GetAvailableCustomDeploymentProtectionRuleIntegrations()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomDeploymentRuleAppable) { + return m.available_custom_deployment_protection_rule_integrations +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["available_custom_deployment_protection_rule_integrations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCustomDeploymentRuleAppFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomDeploymentRuleAppable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomDeploymentRuleAppable) + } + } + m.SetAvailableCustomDeploymentProtectionRuleIntegrations(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 number of custom deployment protection rule integrations available for this environment. +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAvailableCustomDeploymentProtectionRuleIntegrations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetAvailableCustomDeploymentProtectionRuleIntegrations())) + for i, v := range m.GetAvailableCustomDeploymentProtectionRuleIntegrations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("available_custom_deployment_protection_rule_integrations", 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 *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAvailableCustomDeploymentProtectionRuleIntegrations sets the available_custom_deployment_protection_rule_integrations property value. The available_custom_deployment_protection_rule_integrations property +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) SetAvailableCustomDeploymentProtectionRuleIntegrations(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomDeploymentRuleAppable)() { + m.available_custom_deployment_protection_rule_integrations = value +} +// SetTotalCount sets the total_count property value. The total number of custom deployment protection rule integrations available for this environment. +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAvailableCustomDeploymentProtectionRuleIntegrations()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomDeploymentRuleAppable) + GetTotalCount()(*int32) + SetAvailableCustomDeploymentProtectionRuleIntegrations(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomDeploymentRuleAppable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_apps_request_builder.go b/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_apps_request_builder.go new file mode 100644 index 00000000..312428c3 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_apps_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\deployment_protection_rules\apps +type ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderGetQueryParameters gets all custom deployment protection rule integrations that are available for an environment.The authenticated user must have admin or owner permissions to the repository to use this endpoint.For more information about environments, see "[Using environments for deployment](https://docs.github.com/enterprise-server@3.14/actions/deployment/targeting-different-environments/using-environments-for-deployment)."For more information about the app that is providing this custom deployment rule, see "[GET an app](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#get-an-app)".OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder) { + m := &ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/deployment_protection_rules/apps{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets all custom deployment protection rule integrations that are available for an environment.The authenticated user must have admin or owner permissions to the repository to use this endpoint.For more information about environments, see "[Using environments for deployment](https://docs.github.com/enterprise-server@3.14/actions/deployment/targeting-different-environments/using-environments-for-deployment)."For more information about the app that is providing this custom deployment rule, see "[GET an app](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#get-an-app)".OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/protection-rules#list-custom-deployment-rule-integrations-available-for-an-environment +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderGetQueryParameters])(ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemEnvironmentsItemDeployment_protection_rulesAppsGetResponseable), nil +} +// ToGetRequestInformation gets all custom deployment protection rule integrations that are available for an environment.The authenticated user must have admin or owner permissions to the repository to use this endpoint.For more information about environments, see "[Using environments for deployment](https://docs.github.com/enterprise-server@3.14/actions/deployment/targeting-different-environments/using-environments-for-deployment)."For more information about the app that is providing this custom deployment rule, see "[GET an app](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#get-an-app)".OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderGetQueryParameters])(*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 *ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_get_response.go b/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_get_response.go new file mode 100644 index 00000000..d06f9c3e --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse 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 custom_deployment_protection_rules property + custom_deployment_protection_rules []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentProtectionRuleable + // The number of enabled custom deployment protection rules for this environment + total_count *int32 +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesGetResponse instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesGetResponse()(*ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) { + m := &ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemDeployment_protection_rulesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemDeployment_protection_rulesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesGetResponse(), 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 *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCustomDeploymentProtectionRules gets the custom_deployment_protection_rules property value. The custom_deployment_protection_rules property +// returns a []DeploymentProtectionRuleable when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) GetCustomDeploymentProtectionRules()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentProtectionRuleable) { + return m.custom_deployment_protection_rules +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["custom_deployment_protection_rules"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentProtectionRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentProtectionRuleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentProtectionRuleable) + } + } + m.SetCustomDeploymentProtectionRules(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 number of enabled custom deployment protection rules for this environment +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetCustomDeploymentProtectionRules() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetCustomDeploymentProtectionRules())) + for i, v := range m.GetCustomDeploymentProtectionRules() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("custom_deployment_protection_rules", 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 *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCustomDeploymentProtectionRules sets the custom_deployment_protection_rules property value. The custom_deployment_protection_rules property +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) SetCustomDeploymentProtectionRules(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentProtectionRuleable)() { + m.custom_deployment_protection_rules = value +} +// SetTotalCount sets the total_count property value. The number of enabled custom deployment protection rules for this environment +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemEnvironmentsItemDeployment_protection_rulesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCustomDeploymentProtectionRules()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentProtectionRuleable) + GetTotalCount()(*int32) + SetCustomDeploymentProtectionRules(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentProtectionRuleable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_post_request_body.go b/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_post_request_body.go new file mode 100644 index 00000000..6f415ee1 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The ID of the custom app that will be enabled on the environment. + integration_id *int32 +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody()(*ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody) { + m := &ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody(), 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 *ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody) 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 *ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["integration_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetIntegrationId(val) + } + return nil + } + return res +} +// GetIntegrationId gets the integration_id property value. The ID of the custom app that will be enabled on the environment. +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody) GetIntegrationId()(*int32) { + return m.integration_id +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("integration_id", m.GetIntegrationId()) + 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 *ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIntegrationId sets the integration_id property value. The ID of the custom app that will be enabled on the environment. +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBody) SetIntegrationId(value *int32)() { + m.integration_id = value +} +type ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIntegrationId()(*int32) + SetIntegrationId(value *int32)() +} diff --git a/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_request_builder.go b/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_request_builder.go new file mode 100644 index 00000000..5adc7f08 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_deployment_escaped_protection_escaped_rules_request_builder.go @@ -0,0 +1,104 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\deployment_protection_rules +type ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Apps the apps property +// returns a *ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) Apps()(*ItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilder) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesAppsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ByProtection_rule_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.environments.item.deployment_protection_rules.item collection +// returns a *ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) ByProtection_rule_id(protection_rule_id int32)(*ItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["protection_rule_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(protection_rule_id), 10) + return NewItemItemEnvironmentsItemDeployment_protection_rulesWithProtection_rule_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) { + m := &ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/deployment_protection_rules", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder instantiates a new ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets all custom deployment protection rules that are enabled for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see "[Using environments for deployment](https://docs.github.com/enterprise-server@3.14/actions/deployment/targeting-different-environments/using-environments-for-deployment)."For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#get-an-app).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemEnvironmentsItemDeployment_protection_rulesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/protection-rules#get-all-deployment-protection-rules-for-an-environment +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemEnvironmentsItemDeployment_protection_rulesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemEnvironmentsItemDeployment_protection_rulesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemEnvironmentsItemDeployment_protection_rulesGetResponseable), nil +} +// Post enable a custom deployment protection rule for an environment.The authenticated user must have admin or owner permissions to the repository to use this endpoint.For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#get-an-app).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a DeploymentProtectionRuleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/protection-rules#create-a-custom-deployment-protection-rule-on-an-environment +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) Post(ctx context.Context, body ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentProtectionRuleable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentProtectionRuleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentProtectionRuleable), nil +} +// ToGetRequestInformation gets all custom deployment protection rules that are enabled for an environment. Anyone with read access to the repository can use this endpoint. For more information about environments, see "[Using environments for deployment](https://docs.github.com/enterprise-server@3.14/actions/deployment/targeting-different-environments/using-environments-for-deployment)."For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#get-an-app).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) 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 enable a custom deployment protection rule for an environment.The authenticated user must have admin or owner permissions to the repository to use this endpoint.For more information about the app that is providing this custom deployment rule, see the [documentation for the `GET /apps/{app_slug}` endpoint](https://docs.github.com/enterprise-server@3.14/rest/apps/apps#get-an-app).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemEnvironmentsItemDeployment_protection_rulesPostRequestBodyable, 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 *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder when successful +func (m *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_item_secrets_get_response.go b/pkg/github/repos/item_item_environments_item_secrets_get_response.go new file mode 100644 index 00000000..6471d7d5 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_secrets_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemEnvironmentsItemSecretsGetResponse 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 secrets property + secrets []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable + // The total_count property + total_count *int32 +} +// NewItemItemEnvironmentsItemSecretsGetResponse instantiates a new ItemItemEnvironmentsItemSecretsGetResponse and sets the default values. +func NewItemItemEnvironmentsItemSecretsGetResponse()(*ItemItemEnvironmentsItemSecretsGetResponse) { + m := &ItemItemEnvironmentsItemSecretsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemSecretsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemSecretsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemSecretsGetResponse(), 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 *ItemItemEnvironmentsItemSecretsGetResponse) 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 *ItemItemEnvironmentsItemSecretsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["secrets"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsSecretFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable) + } + } + m.SetSecrets(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 +} +// GetSecrets gets the secrets property value. The secrets property +// returns a []ActionsSecretable when successful +func (m *ItemItemEnvironmentsItemSecretsGetResponse) GetSecrets()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable) { + return m.secrets +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemSecretsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemSecretsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetSecrets() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetSecrets())) + for i, v := range m.GetSecrets() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("secrets", 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 *ItemItemEnvironmentsItemSecretsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSecrets sets the secrets property value. The secrets property +func (m *ItemItemEnvironmentsItemSecretsGetResponse) SetSecrets(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable)() { + m.secrets = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemEnvironmentsItemSecretsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type ItemItemEnvironmentsItemSecretsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSecrets()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable) + GetTotalCount()(*int32) + SetSecrets(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/repos/item_item_environments_item_secrets_item_with_secret_escaped_name_put_request_body.go b/pkg/github/repos/item_item_environments_item_secrets_item_with_secret_escaped_name_put_request_body.go new file mode 100644 index 00000000..152f2dfb --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_secrets_item_with_secret_escaped_name_put_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemEnvironmentsItemSecretsItemWithSecret_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 + // Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-an-environment-public-key) endpoint. + encrypted_value *string + // ID of the key you used to encrypt the secret. + key_id *string +} +// NewItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody instantiates a new ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody and sets the default values. +func NewItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody()(*ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) { + m := &ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemSecretsItemWithSecret_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 *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEncryptedValue gets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-an-environment-public-key) endpoint. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) 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 *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) 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 + } + return res +} +// GetKeyId gets the key_id property value. ID of the key you used to encrypt the secret. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) GetKeyId()(*string) { + return m.key_id +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) 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 + } + } + { + 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 *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEncryptedValue sets the encrypted_value property value. Value for your secret, encrypted with [LibSodium](https://libsodium.gitbook.io/doc/bindings_for_other_languages) using the public key retrieved from the [Get an environment public key](https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-an-environment-public-key) endpoint. +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) SetEncryptedValue(value *string)() { + m.encrypted_value = value +} +// SetKeyId sets the key_id property value. ID of the key you used to encrypt the secret. +func (m *ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBody) SetKeyId(value *string)() { + m.key_id = value +} +type ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEncryptedValue()(*string) + GetKeyId()(*string) + SetEncryptedValue(value *string)() + SetKeyId(value *string)() +} diff --git a/pkg/github/repos/item_item_environments_item_secrets_public_key_request_builder.go b/pkg/github/repos/item_item_environments_item_secrets_public_key_request_builder.go new file mode 100644 index 00000000..cb11a972 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_secrets_public_key_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\secrets\public-key +type ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + m := &ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets/public-key", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder instantiates a new ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get the public key for an environment, which you need to encrypt environmentsecrets. You need to encrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsPublicKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-an-environment-public-key +func (m *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsPublicKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsPublicKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsPublicKeyable), nil +} +// ToGetRequestInformation get the public key for an environment, which you need to encrypt environmentsecrets. You need to encrypt a secret before you can create or update secrets.Anyone with read access to the repository can use this endpoint.If the repository is private, OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) 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 *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_item_secrets_request_builder.go b/pkg/github/repos/item_item_environments_item_secrets_request_builder.go new file mode 100644 index 00000000..af1b0406 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_secrets_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemEnvironmentsItemSecretsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\secrets +type ItemItemEnvironmentsItemSecretsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/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-enterprise-server/pkg/github.repos.item.item.environments.item.secrets.item collection +// returns a *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) BySecret_name(secret_name string)(*ItemItemEnvironmentsItemSecretsWithSecret_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 NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemEnvironmentsItemSecretsRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemSecretsRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsRequestBuilder) { + m := &ItemItemEnvironmentsItemSecretsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemSecretsRequestBuilder instantiates a new ItemItemEnvironmentsItemSecretsRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemSecretsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemEnvironmentsItemSecretsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#list-environment-secrets +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters])(ItemItemEnvironmentsItemSecretsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemEnvironmentsItemSecretsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemEnvironmentsItemSecretsGetResponseable), nil +} +// PublicKey the publicKey property +// returns a *ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) PublicKey()(*ItemItemEnvironmentsItemSecretsPublicKeyRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsPublicKeyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation lists all secrets available in an environment without revealing theirencrypted values.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemSecretsRequestBuilderGetQueryParameters])(*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 *ItemItemEnvironmentsItemSecretsRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemSecretsRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_item_secrets_with_secret_escaped_name_item_request_builder.go b/pkg/github/repos/item_item_environments_item_secrets_with_secret_escaped_name_item_request_builder.go new file mode 100644 index 00000000..9104f2de --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_secrets_with_secret_escaped_name_item_request_builder.go @@ -0,0 +1,110 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\secrets\{secret_name} +type ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + m := &ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/secrets/{secret_name}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder instantiates a new ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a secret in an environment using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#delete-an-environment-secret +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a single environment secret without revealing its encrypted value.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsSecretable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#get-an-environment-secret +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsSecretFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsSecretable), nil +} +// Put creates or updates an environment secret with an encrypted value. 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/enterprise-server@3.14/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/secrets#create-or-update-an-environment-secret +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) Put(ctx context.Context, body ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToDeleteRequestInformation deletes a secret in an environment using the secret name.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsWithSecret_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a single environment secret without revealing its encrypted value.Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsWithSecret_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 +} +// ToPutRequestInformation creates or updates an environment secret with an encrypted value. 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/enterprise-server@3.14/rest/guides/encrypting-secrets-for-the-rest-api)."Authenticated users must have collaborator access to a repository to create, update, or read secrets.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemEnvironmentsItemSecretsItemWithSecret_namePutRequestBodyable, 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 *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsWithSecret_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_item_variables_get_response.go b/pkg/github/repos/item_item_environments_item_variables_get_response.go new file mode 100644 index 00000000..3c0cc36f --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_variables_get_response.go @@ -0,0 +1,122 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemEnvironmentsItemVariablesGetResponse 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 total_count property + total_count *int32 + // The variables property + variables []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable +} +// NewItemItemEnvironmentsItemVariablesGetResponse instantiates a new ItemItemEnvironmentsItemVariablesGetResponse and sets the default values. +func NewItemItemEnvironmentsItemVariablesGetResponse()(*ItemItemEnvironmentsItemVariablesGetResponse) { + m := &ItemItemEnvironmentsItemVariablesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemVariablesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemVariablesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemVariablesGetResponse(), 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 *ItemItemEnvironmentsItemVariablesGetResponse) 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 *ItemItemEnvironmentsItemVariablesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 + } + res["variables"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsVariableFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable) + } + } + m.SetVariables(res) + } + return nil + } + return res +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemVariablesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// GetVariables gets the variables property value. The variables property +// returns a []ActionsVariableable when successful +func (m *ItemItemEnvironmentsItemVariablesGetResponse) GetVariables()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable) { + return m.variables +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemVariablesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("total_count", m.GetTotalCount()) + if err != nil { + return err + } + } + if m.GetVariables() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetVariables())) + for i, v := range m.GetVariables() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("variables", 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 *ItemItemEnvironmentsItemVariablesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *ItemItemEnvironmentsItemVariablesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +// SetVariables sets the variables property value. The variables property +func (m *ItemItemEnvironmentsItemVariablesGetResponse) SetVariables(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable)() { + m.variables = value +} +type ItemItemEnvironmentsItemVariablesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetTotalCount()(*int32) + GetVariables()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable) + SetTotalCount(value *int32)() + SetVariables(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable)() +} diff --git a/pkg/github/repos/item_item_environments_item_variables_item_with_name_patch_request_body.go b/pkg/github/repos/item_item_environments_item_variables_item_with_name_patch_request_body.go new file mode 100644 index 00000000..4e6e9317 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_variables_item_with_name_patch_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody 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 name of the variable. + name *string + // The value of the variable. + value *string +} +// NewItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody instantiates a new ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody and sets the default values. +func NewItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody()(*ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) { + m := &ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody(), 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 *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) 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 *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) GetName()(*string) { + return m.name +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + 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 *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetValue()(*string) + SetName(value *string)() + SetValue(value *string)() +} diff --git a/pkg/github/repos/item_item_environments_item_variables_post_request_body.go b/pkg/github/repos/item_item_environments_item_variables_post_request_body.go new file mode 100644 index 00000000..dff25b31 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_variables_post_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemEnvironmentsItemVariablesPostRequestBody 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 name of the variable. + name *string + // The value of the variable. + value *string +} +// NewItemItemEnvironmentsItemVariablesPostRequestBody instantiates a new ItemItemEnvironmentsItemVariablesPostRequestBody and sets the default values. +func NewItemItemEnvironmentsItemVariablesPostRequestBody()(*ItemItemEnvironmentsItemVariablesPostRequestBody) { + m := &ItemItemEnvironmentsItemVariablesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemVariablesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemVariablesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemVariablesPostRequestBody(), 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 *ItemItemEnvironmentsItemVariablesPostRequestBody) 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 *ItemItemEnvironmentsItemVariablesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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["value"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetValue(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the variable. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) GetName()(*string) { + return m.name +} +// GetValue gets the value property value. The value of the variable. +// returns a *string when successful +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) GetValue()(*string) { + return m.value +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("value", m.GetValue()) + 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 *ItemItemEnvironmentsItemVariablesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name of the variable. +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetValue sets the value property value. The value of the variable. +func (m *ItemItemEnvironmentsItemVariablesPostRequestBody) SetValue(value *string)() { + m.value = value +} +type ItemItemEnvironmentsItemVariablesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + GetValue()(*string) + SetName(value *string)() + SetValue(value *string)() +} diff --git a/pkg/github/repos/item_item_environments_item_variables_request_builder.go b/pkg/github/repos/item_item_environments_item_variables_request_builder.go new file mode 100644 index 00000000..6b40feac --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_variables_request_builder.go @@ -0,0 +1,107 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemEnvironmentsItemVariablesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\variables +type ItemItemEnvironmentsItemVariablesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // The number of results per page (max 30). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByName gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.environments.item.variables.item collection +// returns a *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) ByName(name string)(*ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemEnvironmentsItemVariablesRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemVariablesRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemVariablesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemVariablesRequestBuilder) { + m := &ItemItemEnvironmentsItemVariablesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/variables{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemVariablesRequestBuilder instantiates a new ItemItemEnvironmentsItemVariablesRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemVariablesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemVariablesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemVariablesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ItemItemEnvironmentsItemVariablesGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#list-environment-variables +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters])(ItemItemEnvironmentsItemVariablesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemEnvironmentsItemVariablesGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemEnvironmentsItemVariablesGetResponseable), nil +} +// Post create an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a EmptyObjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#create-an-environment-variable +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) Post(ctx context.Context, body ItemItemEnvironmentsItemVariablesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmptyObjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EmptyObjectable), nil +} +// ToGetRequestInformation lists all environment variables.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsItemVariablesRequestBuilderGetQueryParameters])(*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 create an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemEnvironmentsItemVariablesPostRequestBodyable, 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 *ItemItemEnvironmentsItemVariablesRequestBuilder when successful +func (m *ItemItemEnvironmentsItemVariablesRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemVariablesRequestBuilder) { + return NewItemItemEnvironmentsItemVariablesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_item_variables_with_name_item_request_builder.go b/pkg/github/repos/item_item_environments_item_variables_with_name_item_request_builder.go new file mode 100644 index 00000000..3aea2fdc --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_variables_with_name_item_request_builder.go @@ -0,0 +1,105 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name}\variables\{name} +type ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal instantiates a new ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + m := &ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}/variables/{name}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder instantiates a new ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an environment variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#delete-an-environment-variable +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a specific variable in an environment.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a ActionsVariableable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#get-an-environment-variable +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateActionsVariableFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ActionsVariableable), nil +} +// Patch updates an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/actions/variables#update-an-environment-variable +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) Patch(ctx context.Context, body ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation deletes an environment variable using the variable name.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) 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 +} +// ToGetRequestInformation gets a specific variable in an environment.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) 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 an environment variable that you can reference in a GitHub Actions workflow.Authenticated users must have collaborator access to a repository to create, update, or read variables.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemEnvironmentsItemVariablesItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PATCH, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder) { + return NewItemItemEnvironmentsItemVariablesWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_item_with_environment_escaped_name_put_request_body.go b/pkg/github/repos/item_item_environments_item_with_environment_escaped_name_put_request_body.go new file mode 100644 index 00000000..d0dc890c --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_with_environment_escaped_name_put_request_body.go @@ -0,0 +1,161 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody struct { + // The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. + deployment_branch_policy ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicySettingsable + // Whether or not a user who created the job is prevented from approving their own job. + prevent_self_review *bool + // The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. + reviewers []ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable + // The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days). + wait_timer *int32 +} +// NewItemItemEnvironmentsItemWithEnvironment_namePutRequestBody instantiates a new ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody and sets the default values. +func NewItemItemEnvironmentsItemWithEnvironment_namePutRequestBody()(*ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) { + m := &ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody{ + } + return m +} +// CreateItemItemEnvironmentsItemWithEnvironment_namePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemWithEnvironment_namePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemWithEnvironment_namePutRequestBody(), nil +} +// GetDeploymentBranchPolicy gets the deployment_branch_policy property value. The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. +// returns a DeploymentBranchPolicySettingsable when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) GetDeploymentBranchPolicy()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicySettingsable) { + return m.deployment_branch_policy +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["deployment_branch_policy"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeploymentBranchPolicySettingsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetDeploymentBranchPolicy(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicySettingsable)) + } + return nil + } + res["prevent_self_review"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPreventSelfReview(val) + } + return nil + } + res["reviewers"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable) + } + } + m.SetReviewers(res) + } + return nil + } + res["wait_timer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetWaitTimer(val) + } + return nil + } + return res +} +// GetPreventSelfReview gets the prevent_self_review property value. Whether or not a user who created the job is prevented from approving their own job. +// returns a *bool when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) GetPreventSelfReview()(*bool) { + return m.prevent_self_review +} +// GetReviewers gets the reviewers property value. The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. +// returns a []ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) GetReviewers()([]ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable) { + return m.reviewers +} +// GetWaitTimer gets the wait_timer property value. The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days). +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) GetWaitTimer()(*int32) { + return m.wait_timer +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("deployment_branch_policy", m.GetDeploymentBranchPolicy()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("prevent_self_review", m.GetPreventSelfReview()) + if err != nil { + return err + } + } + if m.GetReviewers() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetReviewers())) + for i, v := range m.GetReviewers() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("reviewers", cast) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("wait_timer", m.GetWaitTimer()) + if err != nil { + return err + } + } + return nil +} +// SetDeploymentBranchPolicy sets the deployment_branch_policy property value. The type of deployment branch policy for this environment. To allow all branches to deploy, set to `null`. +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) SetDeploymentBranchPolicy(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicySettingsable)() { + m.deployment_branch_policy = value +} +// SetPreventSelfReview sets the prevent_self_review property value. Whether or not a user who created the job is prevented from approving their own job. +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) SetPreventSelfReview(value *bool)() { + m.prevent_self_review = value +} +// SetReviewers sets the reviewers property value. The people or teams that may review jobs that reference the environment. You can list up to six users or teams as reviewers. The reviewers must have at least read access to the repository. Only one of the required reviewers needs to approve the job for it to proceed. +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) SetReviewers(value []ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable)() { + m.reviewers = value +} +// SetWaitTimer sets the wait_timer property value. The amount of time to delay a job after the job is initially triggered. The time (in minutes) must be an integer between 0 and 43,200 (30 days). +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody) SetWaitTimer(value *int32)() { + m.wait_timer = value +} +type ItemItemEnvironmentsItemWithEnvironment_namePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDeploymentBranchPolicy()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicySettingsable) + GetPreventSelfReview()(*bool) + GetReviewers()([]ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable) + GetWaitTimer()(*int32) + SetDeploymentBranchPolicy(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentBranchPolicySettingsable)() + SetPreventSelfReview(value *bool)() + SetReviewers(value []ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable)() + SetWaitTimer(value *int32)() +} diff --git a/pkg/github/repos/item_item_environments_item_with_environment_escaped_name_put_request_body_escaped_reviewers.go b/pkg/github/repos/item_item_environments_item_with_environment_escaped_name_put_request_body_escaped_reviewers.go new file mode 100644 index 00000000..f9786163 --- /dev/null +++ b/pkg/github/repos/item_item_environments_item_with_environment_escaped_name_put_request_body_escaped_reviewers.go @@ -0,0 +1,111 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The id of the user or team who can review the deployment + id *int32 + // The type of reviewer. + typeEscaped *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentReviewerType +} +// NewItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers instantiates a new ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers and sets the default values. +func NewItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers()(*ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) { + m := &ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers(), 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 *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) 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 *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetId(val) + } + return nil + } + res["type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParseDeploymentReviewerType) + if err != nil { + return err + } + if val != nil { + m.SetTypeEscaped(val.(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentReviewerType)) + } + return nil + } + return res +} +// GetId gets the id property value. The id of the user or team who can review the deployment +// returns a *int32 when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) GetId()(*int32) { + return m.id +} +// GetTypeEscaped gets the type property value. The type of reviewer. +// returns a *DeploymentReviewerType when successful +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) GetTypeEscaped()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentReviewerType) { + return m.typeEscaped +} +// Serialize serializes information the current object +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteInt32Value("id", m.GetId()) + if err != nil { + return err + } + } + if m.GetTypeEscaped() != nil { + cast := (*m.GetTypeEscaped()).String() + err := writer.WriteStringValue("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 *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetId sets the id property value. The id of the user or team who can review the deployment +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) SetId(value *int32)() { + m.id = value +} +// SetTypeEscaped sets the type property value. The type of reviewer. +func (m *ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewers) SetTypeEscaped(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentReviewerType)() { + m.typeEscaped = value +} +type ItemItemEnvironmentsItemWithEnvironment_namePutRequestBody_reviewersable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetId()(*int32) + GetTypeEscaped()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentReviewerType) + SetId(value *int32)() + SetTypeEscaped(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeploymentReviewerType)() +} diff --git a/pkg/github/repos/item_item_environments_request_builder.go b/pkg/github/repos/item_item_environments_request_builder.go new file mode 100644 index 00000000..f8e98aba --- /dev/null +++ b/pkg/github/repos/item_item_environments_request_builder.go @@ -0,0 +1,75 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemEnvironmentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments +type ItemItemEnvironmentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEnvironmentsRequestBuilderGetQueryParameters lists the environments for a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +type ItemItemEnvironmentsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByEnvironment_name gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.environments.item collection +// returns a *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsRequestBuilder) ByEnvironment_name(environment_name string)(*ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if environment_name != "" { + urlTplParams["environment_name"] = environment_name + } + return NewItemItemEnvironmentsWithEnvironment_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemEnvironmentsRequestBuilderInternal instantiates a new ItemItemEnvironmentsRequestBuilder and sets the default values. +func NewItemItemEnvironmentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsRequestBuilder) { + m := &ItemItemEnvironmentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsRequestBuilder instantiates a new ItemItemEnvironmentsRequestBuilder and sets the default values. +func NewItemItemEnvironmentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the environments for a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a ItemItemEnvironmentsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/environments#list-environments +func (m *ItemItemEnvironmentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsRequestBuilderGetQueryParameters])(ItemItemEnvironmentsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemEnvironmentsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemEnvironmentsGetResponseable), nil +} +// ToGetRequestInformation lists the environments for a repository.Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEnvironmentsRequestBuilderGetQueryParameters])(*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 *ItemItemEnvironmentsRequestBuilder when successful +func (m *ItemItemEnvironmentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsRequestBuilder) { + return NewItemItemEnvironmentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_environments_with_environment_escaped_name_item_request_builder.go b/pkg/github/repos/item_item_environments_with_environment_escaped_name_item_request_builder.go new file mode 100644 index 00000000..20681991 --- /dev/null +++ b/pkg/github/repos/item_item_environments_with_environment_escaped_name_item_request_builder.go @@ -0,0 +1,134 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\environments\{environment_name} +type ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemEnvironmentsWithEnvironment_nameItemRequestBuilderInternal instantiates a new ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsWithEnvironment_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) { + m := &ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/environments/{environment_name}", pathParameters), + } + return m +} +// NewItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder instantiates a new ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder and sets the default values. +func NewItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEnvironmentsWithEnvironment_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete oAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/environments#delete-an-environment +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Deployment_protection_rules the deployment_protection_rules property +// returns a *ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Deployment_protection_rules()(*ItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilder) { + return NewItemItemEnvironmentsItemDeployment_protection_rulesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// DeploymentBranchPolicies the deploymentBranchPolicies property +// returns a *ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) DeploymentBranchPolicies()(*ItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilder) { + return NewItemItemEnvironmentsItemDeploymentBranchPoliciesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get > [!NOTE]> To get information about name patterns that branches must match in order to deploy to this environment, see "[Get a deployment branch policy](/rest/deployments/branch-policies#get-a-deployment-branch-policy)."Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a Environmentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/environments#get-an-environment +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Environmentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnvironmentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Environmentable), nil +} +// Put create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see "[Environments](/actions/reference/environments#environment-protection-rules)."> [!NOTE]> To create or update name patterns that branches must match in order to deploy to this environment, see "[Deployment branch policies](/rest/deployments/branch-policies)."> [!NOTE]> To create or update secrets for an environment, see "[GitHub Actions secrets](/rest/actions/secrets)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a Environmentable when successful +// returns a BasicError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deployments/environments#create-or-update-an-environment +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Put(ctx context.Context, body ItemItemEnvironmentsItemWithEnvironment_namePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Environmentable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnvironmentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Environmentable), nil +} +// Secrets the secrets property +// returns a *ItemItemEnvironmentsItemSecretsRequestBuilder when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Secrets()(*ItemItemEnvironmentsItemSecretsRequestBuilder) { + return NewItemItemEnvironmentsItemSecretsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation oAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsWithEnvironment_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) + return requestInfo, nil +} +// ToGetRequestInformation > [!NOTE]> To get information about name patterns that branches must match in order to deploy to this environment, see "[Get a deployment branch policy](/rest/deployments/branch-policies#get-a-deployment-branch-policy)."Anyone with read access to the repository can use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsWithEnvironment_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 +} +// ToPutRequestInformation create or update an environment with protection rules, such as required reviewers. For more information about environment protection rules, see "[Environments](/actions/reference/environments#environment-protection-rules)."> [!NOTE]> To create or update name patterns that branches must match in order to deploy to this environment, see "[Deployment branch policies](/rest/deployments/branch-policies)."> [!NOTE]> To create or update secrets for an environment, see "[GitHub Actions secrets](/rest/actions/secrets)."OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemEnvironmentsItemWithEnvironment_namePutRequestBodyable, 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 +} +// Variables the variables property +// returns a *ItemItemEnvironmentsItemVariablesRequestBuilder when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) Variables()(*ItemItemEnvironmentsItemVariablesRequestBuilder) { + return NewItemItemEnvironmentsItemVariablesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder when successful +func (m *ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder) { + return NewItemItemEnvironmentsWithEnvironment_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_events_request_builder.go b/pkg/github/repos/item_item_events_request_builder.go new file mode 100644 index 00000000..fa439eab --- /dev/null +++ b/pkg/github/repos/item_item_events_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemEventsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\events +type ItemItemEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemEventsRequestBuilderGetQueryParameters > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +type ItemItemEventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemEventsRequestBuilderInternal instantiates a new ItemItemEventsRequestBuilder and sets the default values. +func NewItemItemEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEventsRequestBuilder) { + m := &ItemItemEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/events{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemEventsRequestBuilder instantiates a new ItemItemEventsRequestBuilder and sets the default values. +func NewItemItemEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a []Eventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/events#list-repository-events +func (m *ItemItemEventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEventsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable) + } + } + return val, nil +} +// ToGetRequestInformation > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a *RequestInformation when successful +func (m *ItemItemEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemEventsRequestBuilderGetQueryParameters])(*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 *ItemItemEventsRequestBuilder when successful +func (m *ItemItemEventsRequestBuilder) WithUrl(rawUrl string)(*ItemItemEventsRequestBuilder) { + return NewItemItemEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_forks_post_request_body.go b/pkg/github/repos/item_item_forks_post_request_body.go new file mode 100644 index 00000000..762c276f --- /dev/null +++ b/pkg/github/repos/item_item_forks_post_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemForksPostRequestBody 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 forking from an existing repository, fork with only the default branch. + default_branch_only *bool + // When forking from an existing repository, a new name for the fork. + name *string + // Optional parameter to specify the organization name if forking into an organization. + organization *string +} +// NewItemItemForksPostRequestBody instantiates a new ItemItemForksPostRequestBody and sets the default values. +func NewItemItemForksPostRequestBody()(*ItemItemForksPostRequestBody) { + m := &ItemItemForksPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemForksPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemForksPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemForksPostRequestBody(), 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 *ItemItemForksPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDefaultBranchOnly gets the default_branch_only property value. When forking from an existing repository, fork with only the default branch. +// returns a *bool when successful +func (m *ItemItemForksPostRequestBody) GetDefaultBranchOnly()(*bool) { + return m.default_branch_only +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemForksPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["default_branch_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranchOnly(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["organization"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOrganization(val) + } + return nil + } + return res +} +// GetName gets the name property value. When forking from an existing repository, a new name for the fork. +// returns a *string when successful +func (m *ItemItemForksPostRequestBody) GetName()(*string) { + return m.name +} +// GetOrganization gets the organization property value. Optional parameter to specify the organization name if forking into an organization. +// returns a *string when successful +func (m *ItemItemForksPostRequestBody) GetOrganization()(*string) { + return m.organization +} +// Serialize serializes information the current object +func (m *ItemItemForksPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("default_branch_only", m.GetDefaultBranchOnly()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("organization", m.GetOrganization()) + 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 *ItemItemForksPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDefaultBranchOnly sets the default_branch_only property value. When forking from an existing repository, fork with only the default branch. +func (m *ItemItemForksPostRequestBody) SetDefaultBranchOnly(value *bool)() { + m.default_branch_only = value +} +// SetName sets the name property value. When forking from an existing repository, a new name for the fork. +func (m *ItemItemForksPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetOrganization sets the organization property value. Optional parameter to specify the organization name if forking into an organization. +func (m *ItemItemForksPostRequestBody) SetOrganization(value *string)() { + m.organization = value +} +type ItemItemForksPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDefaultBranchOnly()(*bool) + GetName()(*string) + GetOrganization()(*string) + SetDefaultBranchOnly(value *bool)() + SetName(value *string)() + SetOrganization(value *string)() +} diff --git a/pkg/github/repos/item_item_forks_request_builder.go b/pkg/github/repos/item_item_forks_request_builder.go new file mode 100644 index 00000000..de315ded --- /dev/null +++ b/pkg/github/repos/item_item_forks_request_builder.go @@ -0,0 +1,114 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i798d43269e92aadb9e3c0d3875f4c1ae215e34660f3f323293c403131b6cc28e "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/forks" +) + +// ItemItemForksRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\forks +type ItemItemForksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemForksRequestBuilderGetQueryParameters list forks +type ItemItemForksRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The sort order. `stargazers` will sort by star count. + Sort *i798d43269e92aadb9e3c0d3875f4c1ae215e34660f3f323293c403131b6cc28e.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewItemItemForksRequestBuilderInternal instantiates a new ItemItemForksRequestBuilder and sets the default values. +func NewItemItemForksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemForksRequestBuilder) { + m := &ItemItemForksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/forks{?page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewItemItemForksRequestBuilder instantiates a new ItemItemForksRequestBuilder and sets the default values. +func NewItemItemForksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemForksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemForksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list forks +// returns a []MinimalRepositoryable when successful +// returns a BasicError error when the service returns a 400 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/forks#list-forks +func (m *ItemItemForksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemForksRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + return val, nil +} +// Post create a fork for the authenticated user.> [!NOTE]> Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Enterprise Server Support](https://support.github.com/contact?tags=dotcom-rest-api).> [!NOTE]> Although this endpoint works with GitHub Apps, the GitHub App must be installed on the destination account with access to all repositories and on the source account with access to the source repository. +// returns a FullRepositoryable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/forks#create-a-fork +func (m *ItemItemForksRequestBuilder) Post(ctx context.Context, body ItemItemForksPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FullRepositoryable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FullRepositoryable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemForksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemForksRequestBuilderGetQueryParameters])(*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 create a fork for the authenticated user.> [!NOTE]> Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact [GitHub Enterprise Server Support](https://support.github.com/contact?tags=dotcom-rest-api).> [!NOTE]> Although this endpoint works with GitHub Apps, the GitHub App must be installed on the destination account with access to all repositories and on the source account with access to the source repository. +// returns a *RequestInformation when successful +func (m *ItemItemForksRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemForksPostRequestBodyable, 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 *ItemItemForksRequestBuilder when successful +func (m *ItemItemForksRequestBuilder) WithUrl(rawUrl string)(*ItemItemForksRequestBuilder) { + return NewItemItemForksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_generate_post_request_body.go b/pkg/github/repos/item_item_generate_post_request_body.go new file mode 100644 index 00000000..7dd8fd0e --- /dev/null +++ b/pkg/github/repos/item_item_generate_post_request_body.go @@ -0,0 +1,196 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGeneratePostRequestBody 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 short description of the new repository. + description *string + // Set to `true` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: `false`. + include_all_branches *bool + // The name of the new repository. + name *string + // The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. + owner *string + // Either `true` to create a new private repository or `false` to create a new public one. + private *bool +} +// NewItemItemGeneratePostRequestBody instantiates a new ItemItemGeneratePostRequestBody and sets the default values. +func NewItemItemGeneratePostRequestBody()(*ItemItemGeneratePostRequestBody) { + m := &ItemItemGeneratePostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGeneratePostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGeneratePostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGeneratePostRequestBody(), 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 *ItemItemGeneratePostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. A short description of the new repository. +// returns a *string when successful +func (m *ItemItemGeneratePostRequestBody) 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 *ItemItemGeneratePostRequestBody) 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["include_all_branches"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncludeAllBranches(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["owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOwner(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + return res +} +// GetIncludeAllBranches gets the include_all_branches property value. Set to `true` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: `false`. +// returns a *bool when successful +func (m *ItemItemGeneratePostRequestBody) GetIncludeAllBranches()(*bool) { + return m.include_all_branches +} +// GetName gets the name property value. The name of the new repository. +// returns a *string when successful +func (m *ItemItemGeneratePostRequestBody) GetName()(*string) { + return m.name +} +// GetOwner gets the owner property value. The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. +// returns a *string when successful +func (m *ItemItemGeneratePostRequestBody) GetOwner()(*string) { + return m.owner +} +// GetPrivate gets the private property value. Either `true` to create a new private repository or `false` to create a new public one. +// returns a *bool when successful +func (m *ItemItemGeneratePostRequestBody) GetPrivate()(*bool) { + return m.private +} +// Serialize serializes information the current object +func (m *ItemItemGeneratePostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("include_all_branches", m.GetIncludeAllBranches()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("owner", m.GetOwner()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + 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 *ItemItemGeneratePostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. A short description of the new repository. +func (m *ItemItemGeneratePostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetIncludeAllBranches sets the include_all_branches property value. Set to `true` to include the directory structure and files from all branches in the template repository, and not just the default branch. Default: `false`. +func (m *ItemItemGeneratePostRequestBody) SetIncludeAllBranches(value *bool)() { + m.include_all_branches = value +} +// SetName sets the name property value. The name of the new repository. +func (m *ItemItemGeneratePostRequestBody) SetName(value *string)() { + m.name = value +} +// SetOwner sets the owner property value. The organization or person who will own the new repository. To create a new repository in an organization, the authenticated user must be a member of the specified organization. +func (m *ItemItemGeneratePostRequestBody) SetOwner(value *string)() { + m.owner = value +} +// SetPrivate sets the private property value. Either `true` to create a new private repository or `false` to create a new public one. +func (m *ItemItemGeneratePostRequestBody) SetPrivate(value *bool)() { + m.private = value +} +type ItemItemGeneratePostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetIncludeAllBranches()(*bool) + GetName()(*string) + GetOwner()(*string) + GetPrivate()(*bool) + SetDescription(value *string)() + SetIncludeAllBranches(value *bool)() + SetName(value *string)() + SetOwner(value *string)() + SetPrivate(value *bool)() +} diff --git a/pkg/github/repos/item_item_generate_request_builder.go b/pkg/github/repos/item_item_generate_request_builder.go new file mode 100644 index 00000000..b1ed9a8f --- /dev/null +++ b/pkg/github/repos/item_item_generate_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemGenerateRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\generate +type ItemItemGenerateRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemGenerateRequestBuilderInternal instantiates a new ItemItemGenerateRequestBuilder and sets the default values. +func NewItemItemGenerateRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGenerateRequestBuilder) { + m := &ItemItemGenerateRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/generate", pathParameters), + } + return m +} +// NewItemItemGenerateRequestBuilder instantiates a new ItemItemGenerateRequestBuilder and sets the default values. +func NewItemItemGenerateRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGenerateRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGenerateRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. If the repository is not public, the authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/enterprise-server@3.14/rest/repos/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository. +// returns a FullRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#create-a-repository-using-a-template +func (m *ItemItemGenerateRequestBuilder) Post(ctx context.Context, body ItemItemGeneratePostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FullRepositoryable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateFullRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FullRepositoryable), nil +} +// ToPostRequestInformation creates a new repository using a repository template. Use the `template_owner` and `template_repo` route parameters to specify the repository to use as the template. If the repository is not public, the authenticated user must own or be a member of an organization that owns the repository. To check if a repository is available to use as a template, get the repository's information using the [Get a repository](https://docs.github.com/enterprise-server@3.14/rest/repos/repos#get-a-repository) endpoint and check that the `is_template` key is `true`.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemGenerateRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemGeneratePostRequestBodyable, 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 *ItemItemGenerateRequestBuilder when successful +func (m *ItemItemGenerateRequestBuilder) WithUrl(rawUrl string)(*ItemItemGenerateRequestBuilder) { + return NewItemItemGenerateRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_git_blobs_post_request_body.go b/pkg/github/repos/item_item_git_blobs_post_request_body.go new file mode 100644 index 00000000..6aaa85ac --- /dev/null +++ b/pkg/github/repos/item_item_git_blobs_post_request_body.go @@ -0,0 +1,111 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGitBlobsPostRequestBody 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 new blob's content. + content *string + // The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported. + encoding *string +} +// NewItemItemGitBlobsPostRequestBody instantiates a new ItemItemGitBlobsPostRequestBody and sets the default values. +func NewItemItemGitBlobsPostRequestBody()(*ItemItemGitBlobsPostRequestBody) { + m := &ItemItemGitBlobsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + encodingValue := "utf-8" + m.SetEncoding(&encodingValue) + return m +} +// CreateItemItemGitBlobsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitBlobsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitBlobsPostRequestBody(), 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 *ItemItemGitBlobsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContent gets the content property value. The new blob's content. +// returns a *string when successful +func (m *ItemItemGitBlobsPostRequestBody) GetContent()(*string) { + return m.content +} +// GetEncoding gets the encoding property value. The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported. +// returns a *string when successful +func (m *ItemItemGitBlobsPostRequestBody) GetEncoding()(*string) { + return m.encoding +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitBlobsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContent(val) + } + return nil + } + res["encoding"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEncoding(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemGitBlobsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content", m.GetContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("encoding", m.GetEncoding()) + 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 *ItemItemGitBlobsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContent sets the content property value. The new blob's content. +func (m *ItemItemGitBlobsPostRequestBody) SetContent(value *string)() { + m.content = value +} +// SetEncoding sets the encoding property value. The encoding used for `content`. Currently, `"utf-8"` and `"base64"` are supported. +func (m *ItemItemGitBlobsPostRequestBody) SetEncoding(value *string)() { + m.encoding = value +} +type ItemItemGitBlobsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContent()(*string) + GetEncoding()(*string) + SetContent(value *string)() + SetEncoding(value *string)() +} diff --git a/pkg/github/repos/item_item_git_blobs_request_builder.go b/pkg/github/repos/item_item_git_blobs_request_builder.go new file mode 100644 index 00000000..4f239df2 --- /dev/null +++ b/pkg/github/repos/item_item_git_blobs_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemGitBlobsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\blobs +type ItemItemGitBlobsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByFile_sha gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.git.blobs.item collection +// returns a *ItemItemGitBlobsWithFile_shaItemRequestBuilder when successful +func (m *ItemItemGitBlobsRequestBuilder) ByFile_sha(file_sha string)(*ItemItemGitBlobsWithFile_shaItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if file_sha != "" { + urlTplParams["file_sha"] = file_sha + } + return NewItemItemGitBlobsWithFile_shaItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitBlobsRequestBuilderInternal instantiates a new ItemItemGitBlobsRequestBuilder and sets the default values. +func NewItemItemGitBlobsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitBlobsRequestBuilder) { + m := &ItemItemGitBlobsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/blobs", pathParameters), + } + return m +} +// NewItemItemGitBlobsRequestBuilder instantiates a new ItemItemGitBlobsRequestBuilder and sets the default values. +func NewItemItemGitBlobsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitBlobsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitBlobsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post create a blob +// returns a ShortBlobable 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/enterprise-server@3.14/rest/git/blobs#create-a-blob +func (m *ItemItemGitBlobsRequestBuilder) Post(ctx context.Context, body ItemItemGitBlobsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ShortBlobable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateShortBlobFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ShortBlobable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemGitBlobsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemGitBlobsPostRequestBodyable, 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 *ItemItemGitBlobsRequestBuilder when successful +func (m *ItemItemGitBlobsRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitBlobsRequestBuilder) { + return NewItemItemGitBlobsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_git_blobs_with_file_escaped_sha_item_request_builder.go b/pkg/github/repos/item_item_git_blobs_with_file_escaped_sha_item_request_builder.go new file mode 100644 index 00000000..5882524f --- /dev/null +++ b/pkg/github/repos/item_item_git_blobs_with_file_escaped_sha_item_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemGitBlobsWithFile_shaItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\blobs\{file_sha} +type ItemItemGitBlobsWithFile_shaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemGitBlobsWithFile_shaItemRequestBuilderInternal instantiates a new ItemItemGitBlobsWithFile_shaItemRequestBuilder and sets the default values. +func NewItemItemGitBlobsWithFile_shaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitBlobsWithFile_shaItemRequestBuilder) { + m := &ItemItemGitBlobsWithFile_shaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/blobs/{file_sha}", pathParameters), + } + return m +} +// NewItemItemGitBlobsWithFile_shaItemRequestBuilder instantiates a new ItemItemGitBlobsWithFile_shaItemRequestBuilder and sets the default values. +func NewItemItemGitBlobsWithFile_shaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitBlobsWithFile_shaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitBlobsWithFile_shaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get the `content` in the response will always be Base64 encoded.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw blob data.- **`application/vnd.github+json`**: Returns a JSON representation of the blob with `content` as a base64 encoded string. This is the default if no media type is specified.**Note** This endpoint supports blobs up to 100 megabytes in size. +// returns a Blobable 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 +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/git/blobs#get-a-blob +func (m *ItemItemGitBlobsWithFile_shaItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Blobable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBlobFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Blobable), nil +} +// ToGetRequestInformation the `content` in the response will always be Base64 encoded.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw blob data.- **`application/vnd.github+json`**: Returns a JSON representation of the blob with `content` as a base64 encoded string. This is the default if no media type is specified.**Note** This endpoint supports blobs up to 100 megabytes in size. +// returns a *RequestInformation when successful +func (m *ItemItemGitBlobsWithFile_shaItemRequestBuilder) 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 *ItemItemGitBlobsWithFile_shaItemRequestBuilder when successful +func (m *ItemItemGitBlobsWithFile_shaItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitBlobsWithFile_shaItemRequestBuilder) { + return NewItemItemGitBlobsWithFile_shaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_git_commits_post_request_body.go b/pkg/github/repos/item_item_git_commits_post_request_body.go new file mode 100644 index 00000000..0b047c9c --- /dev/null +++ b/pkg/github/repos/item_item_git_commits_post_request_body.go @@ -0,0 +1,231 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGitCommitsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Information about the author of the commit. By default, the `author` will be the authenticated user and the current date. See the `author` and `committer` object below for details. + author ItemItemGitCommitsPostRequestBody_authorable + // Information about the person who is making the commit. By default, `committer` will use the information set in `author`. See the `author` and `committer` object below for details. + committer ItemItemGitCommitsPostRequestBody_committerable + // The commit message + message *string + // The full SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided. + parents []string + // The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the `gpgsig` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a `signature` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits. + signature *string + // The SHA of the tree object this commit points to + tree *string +} +// NewItemItemGitCommitsPostRequestBody instantiates a new ItemItemGitCommitsPostRequestBody and sets the default values. +func NewItemItemGitCommitsPostRequestBody()(*ItemItemGitCommitsPostRequestBody) { + m := &ItemItemGitCommitsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitCommitsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitCommitsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitCommitsPostRequestBody(), 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 *ItemItemGitCommitsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthor gets the author property value. Information about the author of the commit. By default, the `author` will be the authenticated user and the current date. See the `author` and `committer` object below for details. +// returns a ItemItemGitCommitsPostRequestBody_authorable when successful +func (m *ItemItemGitCommitsPostRequestBody) GetAuthor()(ItemItemGitCommitsPostRequestBody_authorable) { + return m.author +} +// GetCommitter gets the committer property value. Information about the person who is making the commit. By default, `committer` will use the information set in `author`. See the `author` and `committer` object below for details. +// returns a ItemItemGitCommitsPostRequestBody_committerable when successful +func (m *ItemItemGitCommitsPostRequestBody) GetCommitter()(ItemItemGitCommitsPostRequestBody_committerable) { + return m.committer +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitCommitsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["author"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemGitCommitsPostRequestBody_authorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAuthor(val.(ItemItemGitCommitsPostRequestBody_authorable)) + } + return nil + } + res["committer"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemGitCommitsPostRequestBody_committerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetCommitter(val.(ItemItemGitCommitsPostRequestBody_committerable)) + } + 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 + } + res["parents"] = 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.SetParents(res) + } + return nil + } + res["signature"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSignature(val) + } + return nil + } + res["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTree(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The commit message +// returns a *string when successful +func (m *ItemItemGitCommitsPostRequestBody) GetMessage()(*string) { + return m.message +} +// GetParents gets the parents property value. The full SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided. +// returns a []string when successful +func (m *ItemItemGitCommitsPostRequestBody) GetParents()([]string) { + return m.parents +} +// GetSignature gets the signature property value. The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the `gpgsig` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a `signature` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits. +// returns a *string when successful +func (m *ItemItemGitCommitsPostRequestBody) GetSignature()(*string) { + return m.signature +} +// GetTree gets the tree property value. The SHA of the tree object this commit points to +// returns a *string when successful +func (m *ItemItemGitCommitsPostRequestBody) GetTree()(*string) { + return m.tree +} +// Serialize serializes information the current object +func (m *ItemItemGitCommitsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("author", m.GetAuthor()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("committer", m.GetCommitter()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + if m.GetParents() != nil { + err := writer.WriteCollectionOfStringValues("parents", m.GetParents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("signature", m.GetSignature()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tree", m.GetTree()) + 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 *ItemItemGitCommitsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthor sets the author property value. Information about the author of the commit. By default, the `author` will be the authenticated user and the current date. See the `author` and `committer` object below for details. +func (m *ItemItemGitCommitsPostRequestBody) SetAuthor(value ItemItemGitCommitsPostRequestBody_authorable)() { + m.author = value +} +// SetCommitter sets the committer property value. Information about the person who is making the commit. By default, `committer` will use the information set in `author`. See the `author` and `committer` object below for details. +func (m *ItemItemGitCommitsPostRequestBody) SetCommitter(value ItemItemGitCommitsPostRequestBody_committerable)() { + m.committer = value +} +// SetMessage sets the message property value. The commit message +func (m *ItemItemGitCommitsPostRequestBody) SetMessage(value *string)() { + m.message = value +} +// SetParents sets the parents property value. The full SHAs of the commits that were the parents of this commit. If omitted or empty, the commit will be written as a root commit. For a single parent, an array of one SHA should be provided; for a merge commit, an array of more than one should be provided. +func (m *ItemItemGitCommitsPostRequestBody) SetParents(value []string)() { + m.parents = value +} +// SetSignature sets the signature property value. The [PGP signature](https://en.wikipedia.org/wiki/Pretty_Good_Privacy) of the commit. GitHub adds the signature to the `gpgsig` header of the created commit. For a commit signature to be verifiable by Git or GitHub, it must be an ASCII-armored detached PGP signature over the string commit as it would be written to the object database. To pass a `signature` parameter, you need to first manually create a valid PGP signature, which can be complicated. You may find it easier to [use the command line](https://git-scm.com/book/id/v2/Git-Tools-Signing-Your-Work) to create signed commits. +func (m *ItemItemGitCommitsPostRequestBody) SetSignature(value *string)() { + m.signature = value +} +// SetTree sets the tree property value. The SHA of the tree object this commit points to +func (m *ItemItemGitCommitsPostRequestBody) SetTree(value *string)() { + m.tree = value +} +type ItemItemGitCommitsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthor()(ItemItemGitCommitsPostRequestBody_authorable) + GetCommitter()(ItemItemGitCommitsPostRequestBody_committerable) + GetMessage()(*string) + GetParents()([]string) + GetSignature()(*string) + GetTree()(*string) + SetAuthor(value ItemItemGitCommitsPostRequestBody_authorable)() + SetCommitter(value ItemItemGitCommitsPostRequestBody_committerable)() + SetMessage(value *string)() + SetParents(value []string)() + SetSignature(value *string)() + SetTree(value *string)() +} diff --git a/pkg/github/repos/item_item_git_commits_post_request_body_escaped_author.go b/pkg/github/repos/item_item_git_commits_post_request_body_escaped_author.go new file mode 100644 index 00000000..7f6fdae0 --- /dev/null +++ b/pkg/github/repos/item_item_git_commits_post_request_body_escaped_author.go @@ -0,0 +1,140 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemGitCommitsPostRequestBody_author information about the author of the commit. By default, the `author` will be the authenticated user and the current date. See the `author` and `committer` object below for details. +type ItemItemGitCommitsPostRequestBody_author struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The email of the author (or committer) of the commit + email *string + // The name of the author (or committer) of the commit + name *string +} +// NewItemItemGitCommitsPostRequestBody_author instantiates a new ItemItemGitCommitsPostRequestBody_author and sets the default values. +func NewItemItemGitCommitsPostRequestBody_author()(*ItemItemGitCommitsPostRequestBody_author) { + m := &ItemItemGitCommitsPostRequestBody_author{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitCommitsPostRequestBody_authorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitCommitsPostRequestBody_authorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitCommitsPostRequestBody_author(), 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 *ItemItemGitCommitsPostRequestBody_author) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *ItemItemGitCommitsPostRequestBody_author) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. The email of the author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemGitCommitsPostRequestBody_author) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitCommitsPostRequestBody_author) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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 author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemGitCommitsPostRequestBody_author) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemGitCommitsPostRequestBody_author) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemGitCommitsPostRequestBody_author) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *ItemItemGitCommitsPostRequestBody_author) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. The email of the author (or committer) of the commit +func (m *ItemItemGitCommitsPostRequestBody_author) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name of the author (or committer) of the commit +func (m *ItemItemGitCommitsPostRequestBody_author) SetName(value *string)() { + m.name = value +} +type ItemItemGitCommitsPostRequestBody_authorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/repos/item_item_git_commits_post_request_body_escaped_committer.go b/pkg/github/repos/item_item_git_commits_post_request_body_escaped_committer.go new file mode 100644 index 00000000..05ab58bd --- /dev/null +++ b/pkg/github/repos/item_item_git_commits_post_request_body_escaped_committer.go @@ -0,0 +1,140 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemGitCommitsPostRequestBody_committer information about the person who is making the commit. By default, `committer` will use the information set in `author`. See the `author` and `committer` object below for details. +type ItemItemGitCommitsPostRequestBody_committer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The email of the author (or committer) of the commit + email *string + // The name of the author (or committer) of the commit + name *string +} +// NewItemItemGitCommitsPostRequestBody_committer instantiates a new ItemItemGitCommitsPostRequestBody_committer and sets the default values. +func NewItemItemGitCommitsPostRequestBody_committer()(*ItemItemGitCommitsPostRequestBody_committer) { + m := &ItemItemGitCommitsPostRequestBody_committer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitCommitsPostRequestBody_committerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitCommitsPostRequestBody_committerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitCommitsPostRequestBody_committer(), 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 *ItemItemGitCommitsPostRequestBody_committer) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *ItemItemGitCommitsPostRequestBody_committer) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. The email of the author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemGitCommitsPostRequestBody_committer) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitCommitsPostRequestBody_committer) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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 author (or committer) of the commit +// returns a *string when successful +func (m *ItemItemGitCommitsPostRequestBody_committer) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemGitCommitsPostRequestBody_committer) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemGitCommitsPostRequestBody_committer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. Indicates when this commit was authored (or committed). This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *ItemItemGitCommitsPostRequestBody_committer) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. The email of the author (or committer) of the commit +func (m *ItemItemGitCommitsPostRequestBody_committer) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name of the author (or committer) of the commit +func (m *ItemItemGitCommitsPostRequestBody_committer) SetName(value *string)() { + m.name = value +} +type ItemItemGitCommitsPostRequestBody_committerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/repos/item_item_git_commits_request_builder.go b/pkg/github/repos/item_item_git_commits_request_builder.go new file mode 100644 index 00000000..88826e37 --- /dev/null +++ b/pkg/github/repos/item_item_git_commits_request_builder.go @@ -0,0 +1,81 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemGitCommitsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\commits +type ItemItemGitCommitsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByCommit_sha gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.git.commits.item collection +// returns a *ItemItemGitCommitsWithCommit_shaItemRequestBuilder when successful +func (m *ItemItemGitCommitsRequestBuilder) ByCommit_sha(commit_sha string)(*ItemItemGitCommitsWithCommit_shaItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if commit_sha != "" { + urlTplParams["commit_sha"] = commit_sha + } + return NewItemItemGitCommitsWithCommit_shaItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitCommitsRequestBuilderInternal instantiates a new ItemItemGitCommitsRequestBuilder and sets the default values. +func NewItemItemGitCommitsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitCommitsRequestBuilder) { + m := &ItemItemGitCommitsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/commits", pathParameters), + } + return m +} +// NewItemItemGitCommitsRequestBuilder instantiates a new ItemItemGitCommitsRequestBuilder and sets the default values. +func NewItemItemGitCommitsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitCommitsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitCommitsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a new Git [commit object](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects).**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in the table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a GitCommitable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/git/commits#create-a-commit +func (m *ItemItemGitCommitsRequestBuilder) Post(ctx context.Context, body ItemItemGitCommitsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitCommitable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGitCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitCommitable), nil +} +// ToPostRequestInformation creates a new Git [commit object](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects).**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in the table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemGitCommitsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemGitCommitsPostRequestBodyable, 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 *ItemItemGitCommitsRequestBuilder when successful +func (m *ItemItemGitCommitsRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitCommitsRequestBuilder) { + return NewItemItemGitCommitsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_git_commits_with_commit_escaped_sha_item_request_builder.go b/pkg/github/repos/item_item_git_commits_with_commit_escaped_sha_item_request_builder.go new file mode 100644 index 00000000..636f222c --- /dev/null +++ b/pkg/github/repos/item_item_git_commits_with_commit_escaped_sha_item_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemGitCommitsWithCommit_shaItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\commits\{commit_sha} +type ItemItemGitCommitsWithCommit_shaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemGitCommitsWithCommit_shaItemRequestBuilderInternal instantiates a new ItemItemGitCommitsWithCommit_shaItemRequestBuilder and sets the default values. +func NewItemItemGitCommitsWithCommit_shaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitCommitsWithCommit_shaItemRequestBuilder) { + m := &ItemItemGitCommitsWithCommit_shaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/commits/{commit_sha}", pathParameters), + } + return m +} +// NewItemItemGitCommitsWithCommit_shaItemRequestBuilder instantiates a new ItemItemGitCommitsWithCommit_shaItemRequestBuilder and sets the default values. +func NewItemItemGitCommitsWithCommit_shaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitCommitsWithCommit_shaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitCommitsWithCommit_shaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a Git [commit object](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects).To get the contents of a commit, see "[Get a commit](/rest/commits/commits#get-a-commit)."**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in the table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a GitCommitable when successful +// 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/enterprise-server@3.14/rest/git/commits#get-a-commit-object +func (m *ItemItemGitCommitsWithCommit_shaItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitCommitable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGitCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitCommitable), nil +} +// ToGetRequestInformation gets a Git [commit object](https://git-scm.com/book/en/v2/Git-Internals-Git-Objects).To get the contents of a commit, see "[Get a commit](/rest/commits/commits#get-a-commit)."**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in the table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemGitCommitsWithCommit_shaItemRequestBuilder) 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 *ItemItemGitCommitsWithCommit_shaItemRequestBuilder when successful +func (m *ItemItemGitCommitsWithCommit_shaItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitCommitsWithCommit_shaItemRequestBuilder) { + return NewItemItemGitCommitsWithCommit_shaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_git_matching_refs_request_builder.go b/pkg/github/repos/item_item_git_matching_refs_request_builder.go new file mode 100644 index 00000000..8d380df0 --- /dev/null +++ b/pkg/github/repos/item_item_git_matching_refs_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemGitMatchingRefsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\matching-refs +type ItemItemGitMatchingRefsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRef gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.git.matchingRefs.item collection +// returns a *ItemItemGitMatchingRefsWithRefItemRequestBuilder when successful +func (m *ItemItemGitMatchingRefsRequestBuilder) ByRef(ref string)(*ItemItemGitMatchingRefsWithRefItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ref != "" { + urlTplParams["ref"] = ref + } + return NewItemItemGitMatchingRefsWithRefItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitMatchingRefsRequestBuilderInternal instantiates a new ItemItemGitMatchingRefsRequestBuilder and sets the default values. +func NewItemItemGitMatchingRefsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitMatchingRefsRequestBuilder) { + m := &ItemItemGitMatchingRefsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/matching-refs", pathParameters), + } + return m +} +// NewItemItemGitMatchingRefsRequestBuilder instantiates a new ItemItemGitMatchingRefsRequestBuilder and sets the default values. +func NewItemItemGitMatchingRefsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitMatchingRefsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitMatchingRefsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_git_matching_refs_with_ref_item_request_builder.go b/pkg/github/repos/item_item_git_matching_refs_with_ref_item_request_builder.go new file mode 100644 index 00000000..7f7d7aa4 --- /dev/null +++ b/pkg/github/repos/item_item_git_matching_refs_with_ref_item_request_builder.go @@ -0,0 +1,64 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemGitMatchingRefsWithRefItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\matching-refs\{ref} +type ItemItemGitMatchingRefsWithRefItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemGitMatchingRefsWithRefItemRequestBuilderInternal instantiates a new ItemItemGitMatchingRefsWithRefItemRequestBuilder and sets the default values. +func NewItemItemGitMatchingRefsWithRefItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitMatchingRefsWithRefItemRequestBuilder) { + m := &ItemItemGitMatchingRefsWithRefItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/matching-refs/{ref}", pathParameters), + } + return m +} +// NewItemItemGitMatchingRefsWithRefItemRequestBuilder instantiates a new ItemItemGitMatchingRefsWithRefItemRequestBuilder and sets the default values. +func NewItemItemGitMatchingRefsWithRefItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitMatchingRefsWithRefItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitMatchingRefsWithRefItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns an array of references from your Git database that match the supplied name. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't exist in the repository, but existing refs start with `:ref`, they will be returned as an array.When you use this endpoint without providing a `:ref`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just `heads` and `tags`.> [!NOTE]> You need to explicitly [request a pull request](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".If you request matching references for a branch named `feature` but the branch `feature` doesn't exist, the response can still include other matching head refs that start with the word `feature`, such as `featureA` and `featureB`. +// returns a []GitRefable when successful +// returns a BasicError error when the service returns a 409 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/git/refs#list-matching-references +func (m *ItemItemGitMatchingRefsWithRefItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitRefable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGitRefFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitRefable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitRefable) + } + } + return val, nil +} +// ToGetRequestInformation returns an array of references from your Git database that match the supplied name. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't exist in the repository, but existing refs start with `:ref`, they will be returned as an array.When you use this endpoint without providing a `:ref`, it will return an array of all the references from your Git database, including notes and stashes if they exist on the server. Anything in the namespace is returned, not just `heads` and `tags`.> [!NOTE]> You need to explicitly [request a pull request](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".If you request matching references for a branch named `feature` but the branch `feature` doesn't exist, the response can still include other matching head refs that start with the word `feature`, such as `featureA` and `featureB`. +// returns a *RequestInformation when successful +func (m *ItemItemGitMatchingRefsWithRefItemRequestBuilder) 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 *ItemItemGitMatchingRefsWithRefItemRequestBuilder when successful +func (m *ItemItemGitMatchingRefsWithRefItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitMatchingRefsWithRefItemRequestBuilder) { + return NewItemItemGitMatchingRefsWithRefItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_git_ref_request_builder.go b/pkg/github/repos/item_item_git_ref_request_builder.go new file mode 100644 index 00000000..862df60c --- /dev/null +++ b/pkg/github/repos/item_item_git_ref_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemGitRefRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\ref +type ItemItemGitRefRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRef gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.git.ref.item collection +// returns a *ItemItemGitRefWithRefItemRequestBuilder when successful +func (m *ItemItemGitRefRequestBuilder) ByRef(ref string)(*ItemItemGitRefWithRefItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ref != "" { + urlTplParams["ref"] = ref + } + return NewItemItemGitRefWithRefItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitRefRequestBuilderInternal instantiates a new ItemItemGitRefRequestBuilder and sets the default values. +func NewItemItemGitRefRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefRequestBuilder) { + m := &ItemItemGitRefRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/ref", pathParameters), + } + return m +} +// NewItemItemGitRefRequestBuilder instantiates a new ItemItemGitRefRequestBuilder and sets the default values. +func NewItemItemGitRefRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitRefRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_git_ref_with_ref_item_request_builder.go b/pkg/github/repos/item_item_git_ref_with_ref_item_request_builder.go new file mode 100644 index 00000000..3fae0651 --- /dev/null +++ b/pkg/github/repos/item_item_git_ref_with_ref_item_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemGitRefWithRefItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\ref\{ref} +type ItemItemGitRefWithRefItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemGitRefWithRefItemRequestBuilderInternal instantiates a new ItemItemGitRefWithRefItemRequestBuilder and sets the default values. +func NewItemItemGitRefWithRefItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefWithRefItemRequestBuilder) { + m := &ItemItemGitRefWithRefItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/ref/{ref}", pathParameters), + } + return m +} +// NewItemItemGitRefWithRefItemRequestBuilder instantiates a new ItemItemGitRefWithRefItemRequestBuilder and sets the default values. +func NewItemItemGitRefWithRefItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefWithRefItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitRefWithRefItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a single reference from your Git database. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't match an existing ref, a `404` is returned.> [!NOTE]> You need to explicitly [request a pull request](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". +// returns a GitRefable when successful +// 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/enterprise-server@3.14/rest/git/refs#get-a-reference +func (m *ItemItemGitRefWithRefItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitRefable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGitRefFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitRefable), nil +} +// ToGetRequestInformation returns a single reference from your Git database. The `:ref` in the URL must be formatted as `heads/` for branches and `tags/` for tags. If the `:ref` doesn't match an existing ref, a `404` is returned.> [!NOTE]> You need to explicitly [request a pull request](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#get-a-pull-request) to trigger a test merge commit, which checks the mergeability of pull requests. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)". +// returns a *RequestInformation when successful +func (m *ItemItemGitRefWithRefItemRequestBuilder) 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 *ItemItemGitRefWithRefItemRequestBuilder when successful +func (m *ItemItemGitRefWithRefItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitRefWithRefItemRequestBuilder) { + return NewItemItemGitRefWithRefItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_git_refs_item_with_ref_patch_request_body.go b/pkg/github/repos/item_item_git_refs_item_with_ref_patch_request_body.go new file mode 100644 index 00000000..3ba5f773 --- /dev/null +++ b/pkg/github/repos/item_item_git_refs_item_with_ref_patch_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGitRefsItemWithRefPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to `false` will make sure you're not overwriting work. + force *bool + // The SHA1 value to set this reference to + sha *string +} +// NewItemItemGitRefsItemWithRefPatchRequestBody instantiates a new ItemItemGitRefsItemWithRefPatchRequestBody and sets the default values. +func NewItemItemGitRefsItemWithRefPatchRequestBody()(*ItemItemGitRefsItemWithRefPatchRequestBody) { + m := &ItemItemGitRefsItemWithRefPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitRefsItemWithRefPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitRefsItemWithRefPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitRefsItemWithRefPatchRequestBody(), 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 *ItemItemGitRefsItemWithRefPatchRequestBody) 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 *ItemItemGitRefsItemWithRefPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["force"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetForce(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetForce gets the force property value. Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to `false` will make sure you're not overwriting work. +// returns a *bool when successful +func (m *ItemItemGitRefsItemWithRefPatchRequestBody) GetForce()(*bool) { + return m.force +} +// GetSha gets the sha property value. The SHA1 value to set this reference to +// returns a *string when successful +func (m *ItemItemGitRefsItemWithRefPatchRequestBody) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *ItemItemGitRefsItemWithRefPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("force", m.GetForce()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *ItemItemGitRefsItemWithRefPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetForce sets the force property value. Indicates whether to force the update or to make sure the update is a fast-forward update. Leaving this out or setting it to `false` will make sure you're not overwriting work. +func (m *ItemItemGitRefsItemWithRefPatchRequestBody) SetForce(value *bool)() { + m.force = value +} +// SetSha sets the sha property value. The SHA1 value to set this reference to +func (m *ItemItemGitRefsItemWithRefPatchRequestBody) SetSha(value *string)() { + m.sha = value +} +type ItemItemGitRefsItemWithRefPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetForce()(*bool) + GetSha()(*string) + SetForce(value *bool)() + SetSha(value *string)() +} diff --git a/pkg/github/repos/item_item_git_refs_post_request_body.go b/pkg/github/repos/item_item_git_refs_post_request_body.go new file mode 100644 index 00000000..2b225bf6 --- /dev/null +++ b/pkg/github/repos/item_item_git_refs_post_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGitRefsPostRequestBody 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 name of the fully qualified reference (ie: `refs/heads/master`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. + ref *string + // The SHA1 value for this reference. + sha *string +} +// NewItemItemGitRefsPostRequestBody instantiates a new ItemItemGitRefsPostRequestBody and sets the default values. +func NewItemItemGitRefsPostRequestBody()(*ItemItemGitRefsPostRequestBody) { + m := &ItemItemGitRefsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitRefsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitRefsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitRefsPostRequestBody(), 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 *ItemItemGitRefsPostRequestBody) 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 *ItemItemGitRefsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ref"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRef(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetRef gets the ref property value. The name of the fully qualified reference (ie: `refs/heads/master`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. +// returns a *string when successful +func (m *ItemItemGitRefsPostRequestBody) GetRef()(*string) { + return m.ref +} +// GetSha gets the sha property value. The SHA1 value for this reference. +// returns a *string when successful +func (m *ItemItemGitRefsPostRequestBody) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *ItemItemGitRefsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("ref", m.GetRef()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *ItemItemGitRefsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRef sets the ref property value. The name of the fully qualified reference (ie: `refs/heads/master`). If it doesn't start with 'refs' and have at least two slashes, it will be rejected. +func (m *ItemItemGitRefsPostRequestBody) SetRef(value *string)() { + m.ref = value +} +// SetSha sets the sha property value. The SHA1 value for this reference. +func (m *ItemItemGitRefsPostRequestBody) SetSha(value *string)() { + m.sha = value +} +type ItemItemGitRefsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRef()(*string) + GetSha()(*string) + SetRef(value *string)() + SetSha(value *string)() +} diff --git a/pkg/github/repos/item_item_git_refs_request_builder.go b/pkg/github/repos/item_item_git_refs_request_builder.go new file mode 100644 index 00000000..ee30c1af --- /dev/null +++ b/pkg/github/repos/item_item_git_refs_request_builder.go @@ -0,0 +1,79 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemGitRefsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\refs +type ItemItemGitRefsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRef gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.git.refs.item collection +// returns a *ItemItemGitRefsWithRefItemRequestBuilder when successful +func (m *ItemItemGitRefsRequestBuilder) ByRef(ref string)(*ItemItemGitRefsWithRefItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ref != "" { + urlTplParams["ref"] = ref + } + return NewItemItemGitRefsWithRefItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitRefsRequestBuilderInternal instantiates a new ItemItemGitRefsRequestBuilder and sets the default values. +func NewItemItemGitRefsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefsRequestBuilder) { + m := &ItemItemGitRefsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/refs", pathParameters), + } + return m +} +// NewItemItemGitRefsRequestBuilder instantiates a new ItemItemGitRefsRequestBuilder and sets the default values. +func NewItemItemGitRefsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitRefsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches. +// returns a GitRefable when successful +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/git/refs#create-a-reference +func (m *ItemItemGitRefsRequestBuilder) Post(ctx context.Context, body ItemItemGitRefsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitRefable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGitRefFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitRefable), nil +} +// ToPostRequestInformation creates a reference for your repository. You are unable to create new references for empty repositories, even if the commit SHA-1 hash used exists. Empty repositories are repositories without branches. +// returns a *RequestInformation when successful +func (m *ItemItemGitRefsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemGitRefsPostRequestBodyable, 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 *ItemItemGitRefsRequestBuilder when successful +func (m *ItemItemGitRefsRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitRefsRequestBuilder) { + return NewItemItemGitRefsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_git_refs_with_ref_item_request_builder.go b/pkg/github/repos/item_item_git_refs_with_ref_item_request_builder.go new file mode 100644 index 00000000..df3b42d8 --- /dev/null +++ b/pkg/github/repos/item_item_git_refs_with_ref_item_request_builder.go @@ -0,0 +1,96 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemGitRefsWithRefItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\refs\{ref} +type ItemItemGitRefsWithRefItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemGitRefsWithRefItemRequestBuilderInternal instantiates a new ItemItemGitRefsWithRefItemRequestBuilder and sets the default values. +func NewItemItemGitRefsWithRefItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefsWithRefItemRequestBuilder) { + m := &ItemItemGitRefsWithRefItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/refs/{ref}", pathParameters), + } + return m +} +// NewItemItemGitRefsWithRefItemRequestBuilder instantiates a new ItemItemGitRefsWithRefItemRequestBuilder and sets the default values. +func NewItemItemGitRefsWithRefItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRefsWithRefItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitRefsWithRefItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes the provided reference. +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/git/refs#delete-a-reference +func (m *ItemItemGitRefsWithRefItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Patch updates the provided reference to point to a new SHA. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. +// returns a GitRefable when successful +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/git/refs#update-a-reference +func (m *ItemItemGitRefsWithRefItemRequestBuilder) Patch(ctx context.Context, body ItemItemGitRefsItemWithRefPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitRefable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGitRefFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitRefable), nil +} +// ToDeleteRequestInformation deletes the provided reference. +// returns a *RequestInformation when successful +func (m *ItemItemGitRefsWithRefItemRequestBuilder) 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") + return requestInfo, nil +} +// ToPatchRequestInformation updates the provided reference to point to a new SHA. For more information, see "[Git References](https://git-scm.com/book/en/v2/Git-Internals-Git-References)" in the Git documentation. +// returns a *RequestInformation when successful +func (m *ItemItemGitRefsWithRefItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemGitRefsItemWithRefPatchRequestBodyable, 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 *ItemItemGitRefsWithRefItemRequestBuilder when successful +func (m *ItemItemGitRefsWithRefItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitRefsWithRefItemRequestBuilder) { + return NewItemItemGitRefsWithRefItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_git_request_builder.go b/pkg/github/repos/item_item_git_request_builder.go new file mode 100644 index 00000000..eb9451b6 --- /dev/null +++ b/pkg/github/repos/item_item_git_request_builder.go @@ -0,0 +1,58 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemGitRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git +type ItemItemGitRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Blobs the blobs property +// returns a *ItemItemGitBlobsRequestBuilder when successful +func (m *ItemItemGitRequestBuilder) Blobs()(*ItemItemGitBlobsRequestBuilder) { + return NewItemItemGitBlobsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Commits the commits property +// returns a *ItemItemGitCommitsRequestBuilder when successful +func (m *ItemItemGitRequestBuilder) Commits()(*ItemItemGitCommitsRequestBuilder) { + return NewItemItemGitCommitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitRequestBuilderInternal instantiates a new ItemItemGitRequestBuilder and sets the default values. +func NewItemItemGitRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRequestBuilder) { + m := &ItemItemGitRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git", pathParameters), + } + return m +} +// NewItemItemGitRequestBuilder instantiates a new ItemItemGitRequestBuilder and sets the default values. +func NewItemItemGitRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitRequestBuilderInternal(urlParams, requestAdapter) +} +// MatchingRefs the matchingRefs property +// returns a *ItemItemGitMatchingRefsRequestBuilder when successful +func (m *ItemItemGitRequestBuilder) MatchingRefs()(*ItemItemGitMatchingRefsRequestBuilder) { + return NewItemItemGitMatchingRefsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Ref the ref property +// returns a *ItemItemGitRefRequestBuilder when successful +func (m *ItemItemGitRequestBuilder) Ref()(*ItemItemGitRefRequestBuilder) { + return NewItemItemGitRefRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Refs the refs property +// returns a *ItemItemGitRefsRequestBuilder when successful +func (m *ItemItemGitRequestBuilder) Refs()(*ItemItemGitRefsRequestBuilder) { + return NewItemItemGitRefsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Tags the tags property +// returns a *ItemItemGitTagsRequestBuilder when successful +func (m *ItemItemGitRequestBuilder) Tags()(*ItemItemGitTagsRequestBuilder) { + return NewItemItemGitTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Trees the trees property +// returns a *ItemItemGitTreesRequestBuilder when successful +func (m *ItemItemGitRequestBuilder) Trees()(*ItemItemGitTreesRequestBuilder) { + return NewItemItemGitTreesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/repos/item_item_git_tags_post_request_body.go b/pkg/github/repos/item_item_git_tags_post_request_body.go new file mode 100644 index 00000000..2e85db94 --- /dev/null +++ b/pkg/github/repos/item_item_git_tags_post_request_body.go @@ -0,0 +1,167 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGitTagsPostRequestBody 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 tag message. + message *string + // The SHA of the git object this is tagging. + object *string + // The tag's name. This is typically a version (e.g., "v0.0.1"). + tag *string + // An object with information about the individual creating the tag. + tagger ItemItemGitTagsPostRequestBody_taggerable +} +// NewItemItemGitTagsPostRequestBody instantiates a new ItemItemGitTagsPostRequestBody and sets the default values. +func NewItemItemGitTagsPostRequestBody()(*ItemItemGitTagsPostRequestBody) { + m := &ItemItemGitTagsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitTagsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitTagsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitTagsPostRequestBody(), 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 *ItemItemGitTagsPostRequestBody) 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 *ItemItemGitTagsPostRequestBody) 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["object"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetObject(val) + } + return nil + } + res["tag"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTag(val) + } + return nil + } + res["tagger"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemGitTagsPostRequestBody_taggerFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTagger(val.(ItemItemGitTagsPostRequestBody_taggerable)) + } + return nil + } + return res +} +// GetMessage gets the message property value. The tag message. +// returns a *string when successful +func (m *ItemItemGitTagsPostRequestBody) GetMessage()(*string) { + return m.message +} +// GetObject gets the object property value. The SHA of the git object this is tagging. +// returns a *string when successful +func (m *ItemItemGitTagsPostRequestBody) GetObject()(*string) { + return m.object +} +// GetTag gets the tag property value. The tag's name. This is typically a version (e.g., "v0.0.1"). +// returns a *string when successful +func (m *ItemItemGitTagsPostRequestBody) GetTag()(*string) { + return m.tag +} +// GetTagger gets the tagger property value. An object with information about the individual creating the tag. +// returns a ItemItemGitTagsPostRequestBody_taggerable when successful +func (m *ItemItemGitTagsPostRequestBody) GetTagger()(ItemItemGitTagsPostRequestBody_taggerable) { + return m.tagger +} +// Serialize serializes information the current object +func (m *ItemItemGitTagsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("object", m.GetObject()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tag", m.GetTag()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("tagger", m.GetTagger()) + 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 *ItemItemGitTagsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The tag message. +func (m *ItemItemGitTagsPostRequestBody) SetMessage(value *string)() { + m.message = value +} +// SetObject sets the object property value. The SHA of the git object this is tagging. +func (m *ItemItemGitTagsPostRequestBody) SetObject(value *string)() { + m.object = value +} +// SetTag sets the tag property value. The tag's name. This is typically a version (e.g., "v0.0.1"). +func (m *ItemItemGitTagsPostRequestBody) SetTag(value *string)() { + m.tag = value +} +// SetTagger sets the tagger property value. An object with information about the individual creating the tag. +func (m *ItemItemGitTagsPostRequestBody) SetTagger(value ItemItemGitTagsPostRequestBody_taggerable)() { + m.tagger = value +} +type ItemItemGitTagsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + GetObject()(*string) + GetTag()(*string) + GetTagger()(ItemItemGitTagsPostRequestBody_taggerable) + SetMessage(value *string)() + SetObject(value *string)() + SetTag(value *string)() + SetTagger(value ItemItemGitTagsPostRequestBody_taggerable)() +} diff --git a/pkg/github/repos/item_item_git_tags_post_request_body_escaped_tagger.go b/pkg/github/repos/item_item_git_tags_post_request_body_escaped_tagger.go new file mode 100644 index 00000000..a952dc90 --- /dev/null +++ b/pkg/github/repos/item_item_git_tags_post_request_body_escaped_tagger.go @@ -0,0 +1,140 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemGitTagsPostRequestBody_tagger an object with information about the individual creating the tag. +type ItemItemGitTagsPostRequestBody_tagger 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 this object was tagged. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + date *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The email of the author of the tag + email *string + // The name of the author of the tag + name *string +} +// NewItemItemGitTagsPostRequestBody_tagger instantiates a new ItemItemGitTagsPostRequestBody_tagger and sets the default values. +func NewItemItemGitTagsPostRequestBody_tagger()(*ItemItemGitTagsPostRequestBody_tagger) { + m := &ItemItemGitTagsPostRequestBody_tagger{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitTagsPostRequestBody_taggerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitTagsPostRequestBody_taggerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitTagsPostRequestBody_tagger(), 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 *ItemItemGitTagsPostRequestBody_tagger) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDate gets the date property value. When this object was tagged. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *ItemItemGitTagsPostRequestBody_tagger) GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.date +} +// GetEmail gets the email property value. The email of the author of the tag +// returns a *string when successful +func (m *ItemItemGitTagsPostRequestBody_tagger) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitTagsPostRequestBody_tagger) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["date"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDate(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(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 author of the tag +// returns a *string when successful +func (m *ItemItemGitTagsPostRequestBody_tagger) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemGitTagsPostRequestBody_tagger) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("date", m.GetDate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemGitTagsPostRequestBody_tagger) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDate sets the date property value. When this object was tagged. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *ItemItemGitTagsPostRequestBody_tagger) SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.date = value +} +// SetEmail sets the email property value. The email of the author of the tag +func (m *ItemItemGitTagsPostRequestBody_tagger) SetEmail(value *string)() { + m.email = value +} +// SetName sets the name property value. The name of the author of the tag +func (m *ItemItemGitTagsPostRequestBody_tagger) SetName(value *string)() { + m.name = value +} +type ItemItemGitTagsPostRequestBody_taggerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDate()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetEmail()(*string) + GetName()(*string) + SetDate(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetEmail(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/repos/item_item_git_tags_request_builder.go b/pkg/github/repos/item_item_git_tags_request_builder.go new file mode 100644 index 00000000..291b9293 --- /dev/null +++ b/pkg/github/repos/item_item_git_tags_request_builder.go @@ -0,0 +1,79 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemGitTagsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\tags +type ItemItemGitTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTag_sha gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.git.tags.item collection +// returns a *ItemItemGitTagsWithTag_shaItemRequestBuilder when successful +func (m *ItemItemGitTagsRequestBuilder) ByTag_sha(tag_sha string)(*ItemItemGitTagsWithTag_shaItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if tag_sha != "" { + urlTplParams["tag_sha"] = tag_sha + } + return NewItemItemGitTagsWithTag_shaItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitTagsRequestBuilderInternal instantiates a new ItemItemGitTagsRequestBuilder and sets the default values. +func NewItemItemGitTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTagsRequestBuilder) { + m := &ItemItemGitTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/tags", pathParameters), + } + return m +} +// NewItemItemGitTagsRequestBuilder instantiates a new ItemItemGitTagsRequestBuilder and sets the default values. +func NewItemItemGitTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTagsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitTagsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then [create](https://docs.github.com/enterprise-server@3.14/rest/git/refs#create-a-reference) the `refs/tags/[tag]` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/enterprise-server@3.14/rest/git/refs#create-a-reference) the tag reference - this call would be unnecessary.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a GitTagable when successful +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/git/tags#create-a-tag-object +func (m *ItemItemGitTagsRequestBuilder) Post(ctx context.Context, body ItemItemGitTagsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitTagable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGitTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitTagable), nil +} +// ToPostRequestInformation note that creating a tag object does not create the reference that makes a tag in Git. If you want to create an annotated tag in Git, you have to do this call to create the tag object, and then [create](https://docs.github.com/enterprise-server@3.14/rest/git/refs#create-a-reference) the `refs/tags/[tag]` reference. If you want to create a lightweight tag, you only have to [create](https://docs.github.com/enterprise-server@3.14/rest/git/refs#create-a-reference) the tag reference - this call would be unnecessary.**Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemGitTagsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemGitTagsPostRequestBodyable, 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 *ItemItemGitTagsRequestBuilder when successful +func (m *ItemItemGitTagsRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitTagsRequestBuilder) { + return NewItemItemGitTagsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_git_tags_with_tag_escaped_sha_item_request_builder.go b/pkg/github/repos/item_item_git_tags_with_tag_escaped_sha_item_request_builder.go new file mode 100644 index 00000000..fa58c17f --- /dev/null +++ b/pkg/github/repos/item_item_git_tags_with_tag_escaped_sha_item_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemGitTagsWithTag_shaItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\tags\{tag_sha} +type ItemItemGitTagsWithTag_shaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemGitTagsWithTag_shaItemRequestBuilderInternal instantiates a new ItemItemGitTagsWithTag_shaItemRequestBuilder and sets the default values. +func NewItemItemGitTagsWithTag_shaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTagsWithTag_shaItemRequestBuilder) { + m := &ItemItemGitTagsWithTag_shaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/tags/{tag_sha}", pathParameters), + } + return m +} +// NewItemItemGitTagsWithTag_shaItemRequestBuilder instantiates a new ItemItemGitTagsWithTag_shaItemRequestBuilder and sets the default values. +func NewItemItemGitTagsWithTag_shaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTagsWithTag_shaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitTagsWithTag_shaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get **Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a GitTagable when successful +// 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/enterprise-server@3.14/rest/git/tags#get-a-tag +func (m *ItemItemGitTagsWithTag_shaItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitTagable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGitTagFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitTagable), nil +} +// ToGetRequestInformation **Signature verification object**The response will include a `verification` object that describes the result of verifying the commit's signature. The following fields are included in the `verification` object:| Name | Type | Description || ---- | ---- | ----------- || `verified` | `boolean` | Indicates whether GitHub considers the signature in this commit to be verified. || `reason` | `string` | The reason for verified value. Possible values and their meanings are enumerated in table below. || `signature` | `string` | The signature that was extracted from the commit. || `payload` | `string` | The value that was signed. |These are the possible values for `reason` in the `verification` object:| Value | Description || ----- | ----------- || `expired_key` | The key that made the signature is expired. || `not_signing_key` | The "signing" flag is not among the usage flags in the GPG key that made the signature. || `gpgverify_error` | There was an error communicating with the signature verification service. || `gpgverify_unavailable` | The signature verification service is currently unavailable. || `unsigned` | The object does not include a signature. || `unknown_signature_type` | A non-PGP signature was found in the commit. || `no_user` | No user was associated with the `committer` email address in the commit. || `unverified_email` | The `committer` email address in the commit was associated with a user, but the email address is not verified on their account. || `bad_email` | The `committer` email address in the commit is not included in the identities of the PGP key that made the signature. || `unknown_key` | The key that made the signature has not been registered with any user's account. || `malformed_signature` | There was an error parsing the signature. || `invalid` | The signature could not be cryptographically verified using the key whose key-id was found in the signature. || `valid` | None of the above errors applied, so the signature is considered to be verified. | +// returns a *RequestInformation when successful +func (m *ItemItemGitTagsWithTag_shaItemRequestBuilder) 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 *ItemItemGitTagsWithTag_shaItemRequestBuilder when successful +func (m *ItemItemGitTagsWithTag_shaItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitTagsWithTag_shaItemRequestBuilder) { + return NewItemItemGitTagsWithTag_shaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_git_trees_post_request_body.go b/pkg/github/repos/item_item_git_trees_post_request_body.go new file mode 100644 index 00000000..5a10e218 --- /dev/null +++ b/pkg/github/repos/item_item_git_trees_post_request_body.go @@ -0,0 +1,121 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGitTreesPostRequestBody 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 SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by `base_tree` and entries defined in the `tree` parameter. Entries defined in the `tree` parameter will overwrite items from `base_tree` with the same `path`. If you're creating new changes on a branch, then normally you'd set `base_tree` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on.If not provided, GitHub will create a new Git tree object from only the entries defined in the `tree` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the `tree` parameter will be listed as deleted by the new commit. + base_tree *string + // Objects (of `path`, `mode`, `type`, and `sha`) specifying a tree structure. + tree []ItemItemGitTreesPostRequestBody_treeable +} +// NewItemItemGitTreesPostRequestBody instantiates a new ItemItemGitTreesPostRequestBody and sets the default values. +func NewItemItemGitTreesPostRequestBody()(*ItemItemGitTreesPostRequestBody) { + m := &ItemItemGitTreesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitTreesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitTreesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitTreesPostRequestBody(), 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 *ItemItemGitTreesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBaseTree gets the base_tree property value. The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by `base_tree` and entries defined in the `tree` parameter. Entries defined in the `tree` parameter will overwrite items from `base_tree` with the same `path`. If you're creating new changes on a branch, then normally you'd set `base_tree` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on.If not provided, GitHub will create a new Git tree object from only the entries defined in the `tree` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the `tree` parameter will be listed as deleted by the new commit. +// returns a *string when successful +func (m *ItemItemGitTreesPostRequestBody) GetBaseTree()(*string) { + return m.base_tree +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitTreesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base_tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBaseTree(val) + } + return nil + } + res["tree"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemGitTreesPostRequestBody_treeFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemGitTreesPostRequestBody_treeable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemGitTreesPostRequestBody_treeable) + } + } + m.SetTree(res) + } + return nil + } + return res +} +// GetTree gets the tree property value. Objects (of `path`, `mode`, `type`, and `sha`) specifying a tree structure. +// returns a []ItemItemGitTreesPostRequestBody_treeable when successful +func (m *ItemItemGitTreesPostRequestBody) GetTree()([]ItemItemGitTreesPostRequestBody_treeable) { + return m.tree +} +// Serialize serializes information the current object +func (m *ItemItemGitTreesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("base_tree", m.GetBaseTree()) + if err != nil { + return err + } + } + if m.GetTree() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetTree())) + for i, v := range m.GetTree() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("tree", 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 *ItemItemGitTreesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBaseTree sets the base_tree property value. The SHA1 of an existing Git tree object which will be used as the base for the new tree. If provided, a new Git tree object will be created from entries in the Git tree object pointed to by `base_tree` and entries defined in the `tree` parameter. Entries defined in the `tree` parameter will overwrite items from `base_tree` with the same `path`. If you're creating new changes on a branch, then normally you'd set `base_tree` to the SHA1 of the Git tree object of the current latest commit on the branch you're working on.If not provided, GitHub will create a new Git tree object from only the entries defined in the `tree` parameter. If you create a new commit pointing to such a tree, then all files which were a part of the parent commit's tree and were not defined in the `tree` parameter will be listed as deleted by the new commit. +func (m *ItemItemGitTreesPostRequestBody) SetBaseTree(value *string)() { + m.base_tree = value +} +// SetTree sets the tree property value. Objects (of `path`, `mode`, `type`, and `sha`) specifying a tree structure. +func (m *ItemItemGitTreesPostRequestBody) SetTree(value []ItemItemGitTreesPostRequestBody_treeable)() { + m.tree = value +} +type ItemItemGitTreesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBaseTree()(*string) + GetTree()([]ItemItemGitTreesPostRequestBody_treeable) + SetBaseTree(value *string)() + SetTree(value []ItemItemGitTreesPostRequestBody_treeable)() +} diff --git a/pkg/github/repos/item_item_git_trees_post_request_body_escaped_tree.go b/pkg/github/repos/item_item_git_trees_post_request_body_escaped_tree.go new file mode 100644 index 00000000..80f0fba7 --- /dev/null +++ b/pkg/github/repos/item_item_git_trees_post_request_body_escaped_tree.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemGitTreesPostRequestBody_tree 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 content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or `tree.sha`. **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. + content *string + // The file referenced in the tree. + path *string + // The SHA1 checksum ID of the object in the tree. Also called `tree.sha`. If the value is `null` then the file will be deleted. **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. + sha *string +} +// NewItemItemGitTreesPostRequestBody_tree instantiates a new ItemItemGitTreesPostRequestBody_tree and sets the default values. +func NewItemItemGitTreesPostRequestBody_tree()(*ItemItemGitTreesPostRequestBody_tree) { + m := &ItemItemGitTreesPostRequestBody_tree{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemGitTreesPostRequestBody_treeFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemGitTreesPostRequestBody_treeFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemGitTreesPostRequestBody_tree(), 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 *ItemItemGitTreesPostRequestBody_tree) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContent gets the content property value. The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or `tree.sha`. **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. +// returns a *string when successful +func (m *ItemItemGitTreesPostRequestBody_tree) GetContent()(*string) { + return m.content +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemGitTreesPostRequestBody_tree) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContent(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetPath gets the path property value. The file referenced in the tree. +// returns a *string when successful +func (m *ItemItemGitTreesPostRequestBody_tree) GetPath()(*string) { + return m.path +} +// GetSha gets the sha property value. The SHA1 checksum ID of the object in the tree. Also called `tree.sha`. If the value is `null` then the file will be deleted. **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. +// returns a *string when successful +func (m *ItemItemGitTreesPostRequestBody_tree) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *ItemItemGitTreesPostRequestBody_tree) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content", m.GetContent()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *ItemItemGitTreesPostRequestBody_tree) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContent sets the content property value. The content you want this file to have. GitHub will write this blob out and use that SHA for this entry. Use either this, or `tree.sha`. **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. +func (m *ItemItemGitTreesPostRequestBody_tree) SetContent(value *string)() { + m.content = value +} +// SetPath sets the path property value. The file referenced in the tree. +func (m *ItemItemGitTreesPostRequestBody_tree) SetPath(value *string)() { + m.path = value +} +// SetSha sets the sha property value. The SHA1 checksum ID of the object in the tree. Also called `tree.sha`. If the value is `null` then the file will be deleted. **Note:** Use either `tree.sha` or `content` to specify the contents of the entry. Using both `tree.sha` and `content` will return an error. +func (m *ItemItemGitTreesPostRequestBody_tree) SetSha(value *string)() { + m.sha = value +} +type ItemItemGitTreesPostRequestBody_treeable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContent()(*string) + GetPath()(*string) + GetSha()(*string) + SetContent(value *string)() + SetPath(value *string)() + SetSha(value *string)() +} diff --git a/pkg/github/repos/item_item_git_trees_request_builder.go b/pkg/github/repos/item_item_git_trees_request_builder.go new file mode 100644 index 00000000..7249003f --- /dev/null +++ b/pkg/github/repos/item_item_git_trees_request_builder.go @@ -0,0 +1,83 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemGitTreesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\trees +type ItemItemGitTreesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTree_sha gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.git.trees.item collection +// returns a *ItemItemGitTreesWithTree_shaItemRequestBuilder when successful +func (m *ItemItemGitTreesRequestBuilder) ByTree_sha(tree_sha string)(*ItemItemGitTreesWithTree_shaItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if tree_sha != "" { + urlTplParams["tree_sha"] = tree_sha + } + return NewItemItemGitTreesWithTree_shaItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemGitTreesRequestBuilderInternal instantiates a new ItemItemGitTreesRequestBuilder and sets the default values. +func NewItemItemGitTreesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTreesRequestBuilder) { + m := &ItemItemGitTreesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/trees", pathParameters), + } + return m +} +// NewItemItemGitTreesRequestBuilder instantiates a new ItemItemGitTreesRequestBuilder and sets the default values. +func NewItemItemGitTreesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTreesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitTreesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post the tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure.If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/enterprise-server@3.14/rest/git/commits#create-a-commit)" and "[Update a reference](https://docs.github.com/enterprise-server@3.14/rest/git/refs#update-a-reference)."Returns an error if you try to delete a file that does not exist. +// returns a GitTreeable 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 +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/git/trees#create-a-tree +func (m *ItemItemGitTreesRequestBuilder) Post(ctx context.Context, body ItemItemGitTreesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitTreeable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGitTreeFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitTreeable), nil +} +// ToPostRequestInformation the tree creation API accepts nested entries. If you specify both a tree and a nested path modifying that tree, this endpoint will overwrite the contents of the tree with the new path contents, and create a new tree structure.If you use this endpoint to add, delete, or modify the file contents in a tree, you will need to commit the tree and then update a branch to point to the commit. For more information see "[Create a commit](https://docs.github.com/enterprise-server@3.14/rest/git/commits#create-a-commit)" and "[Update a reference](https://docs.github.com/enterprise-server@3.14/rest/git/refs#update-a-reference)."Returns an error if you try to delete a file that does not exist. +// returns a *RequestInformation when successful +func (m *ItemItemGitTreesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemGitTreesPostRequestBodyable, 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 *ItemItemGitTreesRequestBuilder when successful +func (m *ItemItemGitTreesRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitTreesRequestBuilder) { + return NewItemItemGitTreesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_git_trees_with_tree_escaped_sha_item_request_builder.go b/pkg/github/repos/item_item_git_trees_with_tree_escaped_sha_item_request_builder.go new file mode 100644 index 00000000..a3cc21f9 --- /dev/null +++ b/pkg/github/repos/item_item_git_trees_with_tree_escaped_sha_item_request_builder.go @@ -0,0 +1,70 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemGitTreesWithTree_shaItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\git\trees\{tree_sha} +type ItemItemGitTreesWithTree_shaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemGitTreesWithTree_shaItemRequestBuilderGetQueryParameters returns a single tree using the SHA1 value or ref name for that tree.If `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.> [!NOTE]> The limit for the `tree` array is 100,000 entries with a maximum size of 7 MB when using the `recursive` parameter. +type ItemItemGitTreesWithTree_shaItemRequestBuilderGetQueryParameters struct { + // Setting this parameter to any value returns the objects or subtrees referenced by the tree specified in `:tree_sha`. For example, setting `recursive` to any of the following will enable returning objects or subtrees: `0`, `1`, `"true"`, and `"false"`. Omit this parameter to prevent recursively returning objects or subtrees. + Recursive *string `uriparametername:"recursive"` +} +// NewItemItemGitTreesWithTree_shaItemRequestBuilderInternal instantiates a new ItemItemGitTreesWithTree_shaItemRequestBuilder and sets the default values. +func NewItemItemGitTreesWithTree_shaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTreesWithTree_shaItemRequestBuilder) { + m := &ItemItemGitTreesWithTree_shaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/git/trees/{tree_sha}{?recursive*}", pathParameters), + } + return m +} +// NewItemItemGitTreesWithTree_shaItemRequestBuilder instantiates a new ItemItemGitTreesWithTree_shaItemRequestBuilder and sets the default values. +func NewItemItemGitTreesWithTree_shaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemGitTreesWithTree_shaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemGitTreesWithTree_shaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a single tree using the SHA1 value or ref name for that tree.If `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.> [!NOTE]> The limit for the `tree` array is 100,000 entries with a maximum size of 7 MB when using the `recursive` parameter. +// returns a GitTreeable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/git/trees#get-a-tree +func (m *ItemItemGitTreesWithTree_shaItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemGitTreesWithTree_shaItemRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitTreeable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGitTreeFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GitTreeable), nil +} +// ToGetRequestInformation returns a single tree using the SHA1 value or ref name for that tree.If `truncated` is `true` in the response then the number of items in the `tree` array exceeded our maximum limit. If you need to fetch more items, use the non-recursive method of fetching trees, and fetch one sub-tree at a time.> [!NOTE]> The limit for the `tree` array is 100,000 entries with a maximum size of 7 MB when using the `recursive` parameter. +// returns a *RequestInformation when successful +func (m *ItemItemGitTreesWithTree_shaItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemGitTreesWithTree_shaItemRequestBuilderGetQueryParameters])(*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 *ItemItemGitTreesWithTree_shaItemRequestBuilder when successful +func (m *ItemItemGitTreesWithTree_shaItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemGitTreesWithTree_shaItemRequestBuilder) { + return NewItemItemGitTreesWithTree_shaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_hooks_item_config_patch_request_body.go b/pkg/github/repos/item_item_hooks_item_config_patch_request_body.go new file mode 100644 index 00000000..7cad1cd9 --- /dev/null +++ b/pkg/github/repos/item_item_hooks_item_config_patch_request_body.go @@ -0,0 +1,149 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemHooksItemConfigPatchRequestBody struct { + // The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewItemItemHooksItemConfigPatchRequestBody instantiates a new ItemItemHooksItemConfigPatchRequestBody and sets the default values. +func NewItemItemHooksItemConfigPatchRequestBody()(*ItemItemHooksItemConfigPatchRequestBody) { + m := &ItemItemHooksItemConfigPatchRequestBody{ + } + return m +} +// CreateItemItemHooksItemConfigPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemHooksItemConfigPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemHooksItemConfigPatchRequestBody(), nil +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *ItemItemHooksItemConfigPatchRequestBody) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemHooksItemConfigPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a WebhookConfigInsecureSslable when successful +func (m *ItemItemHooksItemConfigPatchRequestBody) GetInsecureSsl()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). +// returns a *string when successful +func (m *ItemItemHooksItemConfigPatchRequestBody) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *ItemItemHooksItemConfigPatchRequestBody) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ItemItemHooksItemConfigPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + if err != nil { + return err + } + } + return nil +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *ItemItemHooksItemConfigPatchRequestBody) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *ItemItemHooksItemConfigPatchRequestBody) SetInsecureSsl(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). +func (m *ItemItemHooksItemConfigPatchRequestBody) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *ItemItemHooksItemConfigPatchRequestBody) SetUrl(value *string)() { + m.url = value +} +type ItemItemHooksItemConfigPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/repos/item_item_hooks_item_config_request_builder.go b/pkg/github/repos/item_item_hooks_item_config_request_builder.go new file mode 100644 index 00000000..b829cd03 --- /dev/null +++ b/pkg/github/repos/item_item_hooks_item_config_request_builder.go @@ -0,0 +1,88 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemHooksItemConfigRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks\{hook_id}\config +type ItemItemHooksItemConfigRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemHooksItemConfigRequestBuilderInternal instantiates a new ItemItemHooksItemConfigRequestBuilder and sets the default values. +func NewItemItemHooksItemConfigRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemConfigRequestBuilder) { + m := &ItemItemHooksItemConfigRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks/{hook_id}/config", pathParameters), + } + return m +} +// NewItemItemHooksItemConfigRequestBuilder instantiates a new ItemItemHooksItemConfigRequestBuilder and sets the default values. +func NewItemItemHooksItemConfigRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemConfigRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksItemConfigRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the webhook configuration for a repository. To get more information about the webhook, including the `active` state and `events`, use "[Get a repository webhook](/rest/webhooks/repos#get-a-repository-webhook)."OAuth app tokens and personal access tokens (classic) need the `read:repo_hook` or `repo` scope to use this endpoint. +// returns a WebhookConfigable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/webhooks#get-a-webhook-configuration-for-a-repository +func (m *ItemItemHooksItemConfigRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWebhookConfigFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable), nil +} +// Patch updates the webhook configuration for a repository. To update more information about the webhook, including the `active` state and `events`, use "[Update a repository webhook](/rest/webhooks/repos#update-a-repository-webhook)."OAuth app tokens and personal access tokens (classic) need the `write:repo_hook` or `repo` scope to use this endpoint. +// returns a WebhookConfigable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/webhooks#update-a-webhook-configuration-for-a-repository +func (m *ItemItemHooksItemConfigRequestBuilder) Patch(ctx context.Context, body ItemItemHooksItemConfigPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWebhookConfigFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable), nil +} +// ToGetRequestInformation returns the webhook configuration for a repository. To get more information about the webhook, including the `active` state and `events`, use "[Get a repository webhook](/rest/webhooks/repos#get-a-repository-webhook)."OAuth app tokens and personal access tokens (classic) need the `read:repo_hook` or `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemHooksItemConfigRequestBuilder) 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 the webhook configuration for a repository. To update more information about the webhook, including the `active` state and `events`, use "[Update a repository webhook](/rest/webhooks/repos#update-a-repository-webhook)."OAuth app tokens and personal access tokens (classic) need the `write:repo_hook` or `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemHooksItemConfigRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemHooksItemConfigPatchRequestBodyable, 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 *ItemItemHooksItemConfigRequestBuilder when successful +func (m *ItemItemHooksItemConfigRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksItemConfigRequestBuilder) { + return NewItemItemHooksItemConfigRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_post_response.go b/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_post_response.go new file mode 100644 index 00000000..56379578 --- /dev/null +++ b/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_post_response.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemHooksItemDeliveriesItemAttemptsPostResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemHooksItemDeliveriesItemAttemptsPostResponse instantiates a new ItemItemHooksItemDeliveriesItemAttemptsPostResponse and sets the default values. +func NewItemItemHooksItemDeliveriesItemAttemptsPostResponse()(*ItemItemHooksItemDeliveriesItemAttemptsPostResponse) { + m := &ItemItemHooksItemDeliveriesItemAttemptsPostResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemHooksItemDeliveriesItemAttemptsPostResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemHooksItemDeliveriesItemAttemptsPostResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemHooksItemDeliveriesItemAttemptsPostResponse(), 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 *ItemItemHooksItemDeliveriesItemAttemptsPostResponse) 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 *ItemItemHooksItemDeliveriesItemAttemptsPostResponse) 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 *ItemItemHooksItemDeliveriesItemAttemptsPostResponse) 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 *ItemItemHooksItemDeliveriesItemAttemptsPostResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemHooksItemDeliveriesItemAttemptsPostResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_request_builder.go b/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_request_builder.go new file mode 100644 index 00000000..4844b3e2 --- /dev/null +++ b/pkg/github/repos/item_item_hooks_item_deliveries_item_attempts_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks\{hook_id}\deliveries\{delivery_id}\attempts +type ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal instantiates a new ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder and sets the default values. +func NewItemItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + m := &ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks/{hook_id}/deliveries/{delivery_id}/attempts", pathParameters), + } + return m +} +// NewItemItemHooksItemDeliveriesItemAttemptsRequestBuilder instantiates a new ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder and sets the default values. +func NewItemItemHooksItemDeliveriesItemAttemptsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post redeliver a webhook delivery for a webhook configured in a repository. +// returns a ItemItemHooksItemDeliveriesItemAttemptsPostResponseable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/webhooks#redeliver-a-delivery-for-a-repository-webhook +func (m *ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemHooksItemDeliveriesItemAttemptsPostResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemHooksItemDeliveriesItemAttemptsPostResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemHooksItemDeliveriesItemAttemptsPostResponseable), nil +} +// ToPostRequestInformation redeliver a webhook delivery for a webhook configured in a repository. +// returns a *RequestInformation when successful +func (m *ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder) 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 *ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder when successful +func (m *ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + return NewItemItemHooksItemDeliveriesItemAttemptsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_hooks_item_deliveries_request_builder.go b/pkg/github/repos/item_item_hooks_item_deliveries_request_builder.go new file mode 100644 index 00000000..6f71a74f --- /dev/null +++ b/pkg/github/repos/item_item_hooks_item_deliveries_request_builder.go @@ -0,0 +1,85 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemHooksItemDeliveriesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks\{hook_id}\deliveries +type ItemItemHooksItemDeliveriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemHooksItemDeliveriesRequestBuilderGetQueryParameters returns a list of webhook deliveries for a webhook configured in a repository. +type ItemItemHooksItemDeliveriesRequestBuilderGetQueryParameters struct { + // Used for pagination: the starting delivery from which the page of deliveries is fetched. Refer to the `link` header for the next and previous page cursors. + Cursor *string `uriparametername:"cursor"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + Redelivery *bool `uriparametername:"redelivery"` +} +// ByDelivery_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.hooks.item.deliveries.item collection +// returns a *ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder when successful +func (m *ItemItemHooksItemDeliveriesRequestBuilder) ByDelivery_id(delivery_id int32)(*ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["delivery_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(delivery_id), 10) + return NewItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemHooksItemDeliveriesRequestBuilderInternal instantiates a new ItemItemHooksItemDeliveriesRequestBuilder and sets the default values. +func NewItemItemHooksItemDeliveriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemDeliveriesRequestBuilder) { + m := &ItemItemHooksItemDeliveriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks/{hook_id}/deliveries{?cursor*,per_page*,redelivery*}", pathParameters), + } + return m +} +// NewItemItemHooksItemDeliveriesRequestBuilder instantiates a new ItemItemHooksItemDeliveriesRequestBuilder and sets the default values. +func NewItemItemHooksItemDeliveriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemDeliveriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksItemDeliveriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a list of webhook deliveries for a webhook configured in a repository. +// returns a []HookDeliveryItemable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/webhooks#list-deliveries-for-a-repository-webhook +func (m *ItemItemHooksItemDeliveriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemHooksItemDeliveriesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryItemable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateHookDeliveryItemFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryItemable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryItemable) + } + } + return val, nil +} +// ToGetRequestInformation returns a list of webhook deliveries for a webhook configured in a repository. +// returns a *RequestInformation when successful +func (m *ItemItemHooksItemDeliveriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemHooksItemDeliveriesRequestBuilderGetQueryParameters])(*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 *ItemItemHooksItemDeliveriesRequestBuilder when successful +func (m *ItemItemHooksItemDeliveriesRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksItemDeliveriesRequestBuilder) { + return NewItemItemHooksItemDeliveriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_hooks_item_deliveries_with_delivery_escaped_item_request_builder.go b/pkg/github/repos/item_item_hooks_item_deliveries_with_delivery_escaped_item_request_builder.go new file mode 100644 index 00000000..5ca49793 --- /dev/null +++ b/pkg/github/repos/item_item_hooks_item_deliveries_with_delivery_escaped_item_request_builder.go @@ -0,0 +1,68 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks\{hook_id}\deliveries\{delivery_id} +type ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Attempts the attempts property +// returns a *ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder when successful +func (m *ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) Attempts()(*ItemItemHooksItemDeliveriesItemAttemptsRequestBuilder) { + return NewItemItemHooksItemDeliveriesItemAttemptsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal instantiates a new ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder and sets the default values. +func NewItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + m := &ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks/{hook_id}/deliveries/{delivery_id}", pathParameters), + } + return m +} +// NewItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder instantiates a new ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder and sets the default values. +func NewItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a delivery for a webhook configured in a repository. +// returns a HookDeliveryable when successful +// returns a BasicError error when the service returns a 400 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/webhooks#get-a-delivery-for-a-repository-webhook +func (m *ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateHookDeliveryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.HookDeliveryable), nil +} +// ToGetRequestInformation returns a delivery for a webhook configured in a repository. +// returns a *RequestInformation when successful +func (m *ItemItemHooksItemDeliveriesWithDelivery_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder when successful +func (m *ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder) { + return NewItemItemHooksItemDeliveriesWithDelivery_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_hooks_item_pings_request_builder.go b/pkg/github/repos/item_item_hooks_item_pings_request_builder.go new file mode 100644 index 00000000..5e1d7fea --- /dev/null +++ b/pkg/github/repos/item_item_hooks_item_pings_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemHooksItemPingsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks\{hook_id}\pings +type ItemItemHooksItemPingsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemHooksItemPingsRequestBuilderInternal instantiates a new ItemItemHooksItemPingsRequestBuilder and sets the default values. +func NewItemItemHooksItemPingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemPingsRequestBuilder) { + m := &ItemItemHooksItemPingsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks/{hook_id}/pings", pathParameters), + } + return m +} +// NewItemItemHooksItemPingsRequestBuilder instantiates a new ItemItemHooksItemPingsRequestBuilder and sets the default values. +func NewItemItemHooksItemPingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemPingsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksItemPingsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post this will trigger a [ping event](https://docs.github.com/enterprise-server@3.14/webhooks/#ping-event) to be sent to the hook. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/webhooks#ping-a-repository-webhook +func (m *ItemItemHooksItemPingsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation this will trigger a [ping event](https://docs.github.com/enterprise-server@3.14/webhooks/#ping-event) to be sent to the hook. +// returns a *RequestInformation when successful +func (m *ItemItemHooksItemPingsRequestBuilder) 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 *ItemItemHooksItemPingsRequestBuilder when successful +func (m *ItemItemHooksItemPingsRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksItemPingsRequestBuilder) { + return NewItemItemHooksItemPingsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_hooks_item_tests_request_builder.go b/pkg/github/repos/item_item_hooks_item_tests_request_builder.go new file mode 100644 index 00000000..3c3728d7 --- /dev/null +++ b/pkg/github/repos/item_item_hooks_item_tests_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemHooksItemTestsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks\{hook_id}\tests +type ItemItemHooksItemTestsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemHooksItemTestsRequestBuilderInternal instantiates a new ItemItemHooksItemTestsRequestBuilder and sets the default values. +func NewItemItemHooksItemTestsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemTestsRequestBuilder) { + m := &ItemItemHooksItemTestsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks/{hook_id}/tests", pathParameters), + } + return m +} +// NewItemItemHooksItemTestsRequestBuilder instantiates a new ItemItemHooksItemTestsRequestBuilder and sets the default values. +func NewItemItemHooksItemTestsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksItemTestsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksItemTestsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post this will trigger the hook with the latest push to the current repository if the hook is subscribed to `push` events. If the hook is not subscribed to `push` events, the server will respond with 204 but no test POST will be generated.> [!NOTE]> Previously `/repos/:owner/:repo/hooks/:hook_id/test` +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/webhooks#test-the-push-repository-webhook +func (m *ItemItemHooksItemTestsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation this will trigger the hook with the latest push to the current repository if the hook is subscribed to `push` events. If the hook is not subscribed to `push` events, the server will respond with 204 but no test POST will be generated.> [!NOTE]> Previously `/repos/:owner/:repo/hooks/:hook_id/test` +// returns a *RequestInformation when successful +func (m *ItemItemHooksItemTestsRequestBuilder) 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 *ItemItemHooksItemTestsRequestBuilder when successful +func (m *ItemItemHooksItemTestsRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksItemTestsRequestBuilder) { + return NewItemItemHooksItemTestsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_hooks_item_with_hook_escaped_patch_request_body.go b/pkg/github/repos/item_item_hooks_item_with_hook_escaped_patch_request_body.go new file mode 100644 index 00000000..e3c2f26f --- /dev/null +++ b/pkg/github/repos/item_item_hooks_item_with_hook_escaped_patch_request_body.go @@ -0,0 +1,215 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemHooksItemWithHook_PatchRequestBody struct { + // Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + active *bool + // Determines a list of events to be added to the list of events that the Hook triggers for. + add_events []string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Configuration object of the webhook + config ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable + // Determines what [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events. + events []string + // Determines a list of events to be removed from the list of events that the Hook triggers for. + remove_events []string +} +// NewItemItemHooksItemWithHook_PatchRequestBody instantiates a new ItemItemHooksItemWithHook_PatchRequestBody and sets the default values. +func NewItemItemHooksItemWithHook_PatchRequestBody()(*ItemItemHooksItemWithHook_PatchRequestBody) { + m := &ItemItemHooksItemWithHook_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemHooksItemWithHook_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemHooksItemWithHook_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemHooksItemWithHook_PatchRequestBody(), nil +} +// GetActive gets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +// returns a *bool when successful +func (m *ItemItemHooksItemWithHook_PatchRequestBody) GetActive()(*bool) { + return m.active +} +// GetAddEvents gets the add_events property value. Determines a list of events to be added to the list of events that the Hook triggers for. +// returns a []string when successful +func (m *ItemItemHooksItemWithHook_PatchRequestBody) GetAddEvents()([]string) { + return m.add_events +} +// 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 *ItemItemHooksItemWithHook_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfig gets the config property value. Configuration object of the webhook +// returns a WebhookConfigable when successful +func (m *ItemItemHooksItemWithHook_PatchRequestBody) GetConfig()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable) { + return m.config +} +// GetEvents gets the events property value. Determines what [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events. +// returns a []string when successful +func (m *ItemItemHooksItemWithHook_PatchRequestBody) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemHooksItemWithHook_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["add_events"] = 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.SetAddEvents(res) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWebhookConfigFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable)) + } + return nil + } + res["events"] = 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.SetEvents(res) + } + return nil + } + res["remove_events"] = 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.SetRemoveEvents(res) + } + return nil + } + return res +} +// GetRemoveEvents gets the remove_events property value. Determines a list of events to be removed from the list of events that the Hook triggers for. +// returns a []string when successful +func (m *ItemItemHooksItemWithHook_PatchRequestBody) GetRemoveEvents()([]string) { + return m.remove_events +} +// Serialize serializes information the current object +func (m *ItemItemHooksItemWithHook_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + if m.GetAddEvents() != nil { + err := writer.WriteCollectionOfStringValues("add_events", m.GetAddEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + if m.GetRemoveEvents() != nil { + err := writer.WriteCollectionOfStringValues("remove_events", m.GetRemoveEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +func (m *ItemItemHooksItemWithHook_PatchRequestBody) SetActive(value *bool)() { + m.active = value +} +// SetAddEvents sets the add_events property value. Determines a list of events to be added to the list of events that the Hook triggers for. +func (m *ItemItemHooksItemWithHook_PatchRequestBody) SetAddEvents(value []string)() { + m.add_events = 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 *ItemItemHooksItemWithHook_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfig sets the config property value. Configuration object of the webhook +func (m *ItemItemHooksItemWithHook_PatchRequestBody) SetConfig(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable)() { + m.config = value +} +// SetEvents sets the events property value. Determines what [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events. +func (m *ItemItemHooksItemWithHook_PatchRequestBody) SetEvents(value []string)() { + m.events = value +} +// SetRemoveEvents sets the remove_events property value. Determines a list of events to be removed from the list of events that the Hook triggers for. +func (m *ItemItemHooksItemWithHook_PatchRequestBody) SetRemoveEvents(value []string)() { + m.remove_events = value +} +type ItemItemHooksItemWithHook_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetAddEvents()([]string) + GetConfig()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable) + GetEvents()([]string) + GetRemoveEvents()([]string) + SetActive(value *bool)() + SetAddEvents(value []string)() + SetConfig(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigable)() + SetEvents(value []string)() + SetRemoveEvents(value []string)() +} diff --git a/pkg/github/repos/item_item_hooks_post_request_body.go b/pkg/github/repos/item_item_hooks_post_request_body.go new file mode 100644 index 00000000..f0bc19f9 --- /dev/null +++ b/pkg/github/repos/item_item_hooks_post_request_body.go @@ -0,0 +1,154 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemHooksPostRequestBody struct { + // Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. + active *bool + // Key/value pairs to provide settings for this webhook. + config ItemItemHooksPostRequestBody_configable + // Determines what [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) the hook is triggered for. + events []string + // Use `web` to create a webhook. Default: `web`. This parameter only accepts the value `web`. + name *string +} +// NewItemItemHooksPostRequestBody instantiates a new ItemItemHooksPostRequestBody and sets the default values. +func NewItemItemHooksPostRequestBody()(*ItemItemHooksPostRequestBody) { + m := &ItemItemHooksPostRequestBody{ + } + return m +} +// CreateItemItemHooksPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemHooksPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemHooksPostRequestBody(), nil +} +// GetActive gets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +// returns a *bool when successful +func (m *ItemItemHooksPostRequestBody) GetActive()(*bool) { + return m.active +} +// GetConfig gets the config property value. Key/value pairs to provide settings for this webhook. +// returns a ItemItemHooksPostRequestBody_configable when successful +func (m *ItemItemHooksPostRequestBody) GetConfig()(ItemItemHooksPostRequestBody_configable) { + return m.config +} +// GetEvents gets the events property value. Determines what [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) the hook is triggered for. +// returns a []string when successful +func (m *ItemItemHooksPostRequestBody) GetEvents()([]string) { + return m.events +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemHooksPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["active"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetActive(val) + } + return nil + } + res["config"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemHooksPostRequestBody_configFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConfig(val.(ItemItemHooksPostRequestBody_configable)) + } + return nil + } + res["events"] = 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.SetEvents(res) + } + 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. Use `web` to create a webhook. Default: `web`. This parameter only accepts the value `web`. +// returns a *string when successful +func (m *ItemItemHooksPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemHooksPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("active", m.GetActive()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("config", m.GetConfig()) + if err != nil { + return err + } + } + if m.GetEvents() != nil { + err := writer.WriteCollectionOfStringValues("events", m.GetEvents()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + return nil +} +// SetActive sets the active property value. Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications. +func (m *ItemItemHooksPostRequestBody) SetActive(value *bool)() { + m.active = value +} +// SetConfig sets the config property value. Key/value pairs to provide settings for this webhook. +func (m *ItemItemHooksPostRequestBody) SetConfig(value ItemItemHooksPostRequestBody_configable)() { + m.config = value +} +// SetEvents sets the events property value. Determines what [events](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads) the hook is triggered for. +func (m *ItemItemHooksPostRequestBody) SetEvents(value []string)() { + m.events = value +} +// SetName sets the name property value. Use `web` to create a webhook. Default: `web`. This parameter only accepts the value `web`. +func (m *ItemItemHooksPostRequestBody) SetName(value *string)() { + m.name = value +} +type ItemItemHooksPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetActive()(*bool) + GetConfig()(ItemItemHooksPostRequestBody_configable) + GetEvents()([]string) + GetName()(*string) + SetActive(value *bool)() + SetConfig(value ItemItemHooksPostRequestBody_configable)() + SetEvents(value []string)() + SetName(value *string)() +} diff --git a/pkg/github/repos/item_item_hooks_post_request_body_escaped_config.go b/pkg/github/repos/item_item_hooks_post_request_body_escaped_config.go new file mode 100644 index 00000000..d8194c37 --- /dev/null +++ b/pkg/github/repos/item_item_hooks_post_request_body_escaped_config.go @@ -0,0 +1,169 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemHooksPostRequestBody_config key/value pairs to provide settings for this webhook. +type ItemItemHooksPostRequestBody_config 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 media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. + content_type *string + // The insecure_ssl property + insecure_ssl ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable + // If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). + secret *string + // The URL to which the payloads will be delivered. + url *string +} +// NewItemItemHooksPostRequestBody_config instantiates a new ItemItemHooksPostRequestBody_config and sets the default values. +func NewItemItemHooksPostRequestBody_config()(*ItemItemHooksPostRequestBody_config) { + m := &ItemItemHooksPostRequestBody_config{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemHooksPostRequestBody_configFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemHooksPostRequestBody_configFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemHooksPostRequestBody_config(), 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 *ItemItemHooksPostRequestBody_config) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContentType gets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +// returns a *string when successful +func (m *ItemItemHooksPostRequestBody_config) GetContentType()(*string) { + return m.content_type +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemHooksPostRequestBody_config) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["content_type"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContentType(val) + } + return nil + } + res["insecure_ssl"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateWebhookConfigInsecureSslFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetInsecureSsl(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)) + } + return nil + } + res["secret"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSecret(val) + } + return nil + } + res["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetInsecureSsl gets the insecure_ssl property value. The insecure_ssl property +// returns a WebhookConfigInsecureSslable when successful +func (m *ItemItemHooksPostRequestBody_config) GetInsecureSsl()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable) { + return m.insecure_ssl +} +// GetSecret gets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). +// returns a *string when successful +func (m *ItemItemHooksPostRequestBody_config) GetSecret()(*string) { + return m.secret +} +// GetUrl gets the url property value. The URL to which the payloads will be delivered. +// returns a *string when successful +func (m *ItemItemHooksPostRequestBody_config) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ItemItemHooksPostRequestBody_config) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("content_type", m.GetContentType()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("insecure_ssl", m.GetInsecureSsl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("secret", m.GetSecret()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ItemItemHooksPostRequestBody_config) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContentType sets the content_type property value. The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`. +func (m *ItemItemHooksPostRequestBody_config) SetContentType(value *string)() { + m.content_type = value +} +// SetInsecureSsl sets the insecure_ssl property value. The insecure_ssl property +func (m *ItemItemHooksPostRequestBody_config) SetInsecureSsl(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)() { + m.insecure_ssl = value +} +// SetSecret sets the secret property value. If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#delivery-headers). +func (m *ItemItemHooksPostRequestBody_config) SetSecret(value *string)() { + m.secret = value +} +// SetUrl sets the url property value. The URL to which the payloads will be delivered. +func (m *ItemItemHooksPostRequestBody_config) SetUrl(value *string)() { + m.url = value +} +type ItemItemHooksPostRequestBody_configable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContentType()(*string) + GetInsecureSsl()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable) + GetSecret()(*string) + GetUrl()(*string) + SetContentType(value *string)() + SetInsecureSsl(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.WebhookConfigInsecureSslable)() + SetSecret(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/repos/item_item_hooks_request_builder.go b/pkg/github/repos/item_item_hooks_request_builder.go new file mode 100644 index 00000000..5e57bc6e --- /dev/null +++ b/pkg/github/repos/item_item_hooks_request_builder.go @@ -0,0 +1,121 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemHooksRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks +type ItemItemHooksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemHooksRequestBuilderGetQueryParameters lists webhooks for a repository. `last response` may return null if there have not been any deliveries within 30 days. +type ItemItemHooksRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByHook_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.hooks.item collection +// returns a *ItemItemHooksWithHook_ItemRequestBuilder when successful +func (m *ItemItemHooksRequestBuilder) ByHook_id(hook_id int32)(*ItemItemHooksWithHook_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["hook_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(hook_id), 10) + return NewItemItemHooksWithHook_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemHooksRequestBuilderInternal instantiates a new ItemItemHooksRequestBuilder and sets the default values. +func NewItemItemHooksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksRequestBuilder) { + m := &ItemItemHooksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemHooksRequestBuilder instantiates a new ItemItemHooksRequestBuilder and sets the default values. +func NewItemItemHooksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists webhooks for a repository. `last response` may return null if there have not been any deliveries within 30 days. +// returns a []Hookable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/webhooks#list-repository-webhooks +func (m *ItemItemHooksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemHooksRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Hookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Hookable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Hookable) + } + } + return val, nil +} +// Post repositories can have multiple webhooks installed. Each webhook should have a unique `config`. Multiple webhooks canshare the same `config` as long as those webhooks do not have any `events` that overlap. +// returns a Hookable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/webhooks#create-a-repository-webhook +func (m *ItemItemHooksRequestBuilder) Post(ctx context.Context, body ItemItemHooksPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Hookable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Hookable), nil +} +// ToGetRequestInformation lists webhooks for a repository. `last response` may return null if there have not been any deliveries within 30 days. +// returns a *RequestInformation when successful +func (m *ItemItemHooksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemHooksRequestBuilderGetQueryParameters])(*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 repositories can have multiple webhooks installed. Each webhook should have a unique `config`. Multiple webhooks canshare the same `config` as long as those webhooks do not have any `events` that overlap. +// returns a *RequestInformation when successful +func (m *ItemItemHooksRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemHooksPostRequestBodyable, 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 *ItemItemHooksRequestBuilder when successful +func (m *ItemItemHooksRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksRequestBuilder) { + return NewItemItemHooksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_hooks_with_hook_escaped_item_request_builder.go b/pkg/github/repos/item_item_hooks_with_hook_escaped_item_request_builder.go new file mode 100644 index 00000000..1f053ed4 --- /dev/null +++ b/pkg/github/repos/item_item_hooks_with_hook_escaped_item_request_builder.go @@ -0,0 +1,144 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemHooksWithHook_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\hooks\{hook_id} +type ItemItemHooksWithHook_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Config the config property +// returns a *ItemItemHooksItemConfigRequestBuilder when successful +func (m *ItemItemHooksWithHook_ItemRequestBuilder) Config()(*ItemItemHooksItemConfigRequestBuilder) { + return NewItemItemHooksItemConfigRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemHooksWithHook_ItemRequestBuilderInternal instantiates a new ItemItemHooksWithHook_ItemRequestBuilder and sets the default values. +func NewItemItemHooksWithHook_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksWithHook_ItemRequestBuilder) { + m := &ItemItemHooksWithHook_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/hooks/{hook_id}", pathParameters), + } + return m +} +// NewItemItemHooksWithHook_ItemRequestBuilder instantiates a new ItemItemHooksWithHook_ItemRequestBuilder and sets the default values. +func NewItemItemHooksWithHook_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemHooksWithHook_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemHooksWithHook_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a repository webhook +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/webhooks#delete-a-repository-webhook +func (m *ItemItemHooksWithHook_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 { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Deliveries the deliveries property +// returns a *ItemItemHooksItemDeliveriesRequestBuilder when successful +func (m *ItemItemHooksWithHook_ItemRequestBuilder) Deliveries()(*ItemItemHooksItemDeliveriesRequestBuilder) { + return NewItemItemHooksItemDeliveriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get returns a webhook configured in a repository. To get only the webhook `config` properties, see "[Get a webhook configuration for a repository](/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository)." +// returns a Hookable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/webhooks#get-a-repository-webhook +func (m *ItemItemHooksWithHook_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Hookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Hookable), nil +} +// Patch updates a webhook configured in a repository. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for a repository](/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository)." +// returns a Hookable 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/enterprise-server@3.14/rest/repos/webhooks#update-a-repository-webhook +func (m *ItemItemHooksWithHook_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemHooksItemWithHook_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Hookable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateHookFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Hookable), nil +} +// Pings the pings property +// returns a *ItemItemHooksItemPingsRequestBuilder when successful +func (m *ItemItemHooksWithHook_ItemRequestBuilder) Pings()(*ItemItemHooksItemPingsRequestBuilder) { + return NewItemItemHooksItemPingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Tests the tests property +// returns a *ItemItemHooksItemTestsRequestBuilder when successful +func (m *ItemItemHooksWithHook_ItemRequestBuilder) Tests()(*ItemItemHooksItemTestsRequestBuilder) { + return NewItemItemHooksItemTestsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// returns a *RequestInformation when successful +func (m *ItemItemHooksWithHook_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") + return requestInfo, nil +} +// ToGetRequestInformation returns a webhook configured in a repository. To get only the webhook `config` properties, see "[Get a webhook configuration for a repository](/rest/webhooks/repo-config#get-a-webhook-configuration-for-a-repository)." +// returns a *RequestInformation when successful +func (m *ItemItemHooksWithHook_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 webhook configured in a repository. If you previously had a `secret` set, you must provide the same `secret` or set a new `secret` or the secret will be removed. If you are only updating individual webhook `config` properties, use "[Update a webhook configuration for a repository](/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository)." +// returns a *RequestInformation when successful +func (m *ItemItemHooksWithHook_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemHooksItemWithHook_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 *ItemItemHooksWithHook_ItemRequestBuilder when successful +func (m *ItemItemHooksWithHook_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemHooksWithHook_ItemRequestBuilder) { + return NewItemItemHooksWithHook_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_installation_request_builder.go b/pkg/github/repos/item_item_installation_request_builder.go new file mode 100644 index 00000000..72306ae2 --- /dev/null +++ b/pkg/github/repos/item_item_installation_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemInstallationRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\installation +type ItemItemInstallationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemInstallationRequestBuilderInternal instantiates a new ItemItemInstallationRequestBuilder and sets the default values. +func NewItemItemInstallationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemInstallationRequestBuilder) { + m := &ItemItemInstallationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/installation", pathParameters), + } + return m +} +// NewItemItemInstallationRequestBuilder instantiates a new ItemItemInstallationRequestBuilder and sets the default values. +func NewItemItemInstallationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemInstallationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemInstallationRequestBuilderInternal(urlParams, requestAdapter) +} +// Get enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a Installationable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/apps#get-a-repository-installation-for-the-authenticated-app +func (m *ItemItemInstallationRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateInstallationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable), nil +} +// ToGetRequestInformation enables an authenticated GitHub App to find the repository's installation information. The installation's account type will be either an organization or a user account, depending which account the repository belongs to.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemInstallationRequestBuilder) 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 *ItemItemInstallationRequestBuilder when successful +func (m *ItemItemInstallationRequestBuilder) WithUrl(rawUrl string)(*ItemItemInstallationRequestBuilder) { + return NewItemItemInstallationRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_invitations_item_with_invitation_escaped_patch_request_body.go b/pkg/github/repos/item_item_invitations_item_with_invitation_escaped_patch_request_body.go new file mode 100644 index 00000000..c78762df --- /dev/null +++ b/pkg/github/repos/item_item_invitations_item_with_invitation_escaped_patch_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemInvitationsItemWithInvitation_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemInvitationsItemWithInvitation_PatchRequestBody instantiates a new ItemItemInvitationsItemWithInvitation_PatchRequestBody and sets the default values. +func NewItemItemInvitationsItemWithInvitation_PatchRequestBody()(*ItemItemInvitationsItemWithInvitation_PatchRequestBody) { + m := &ItemItemInvitationsItemWithInvitation_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemInvitationsItemWithInvitation_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemInvitationsItemWithInvitation_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemInvitationsItemWithInvitation_PatchRequestBody(), 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 *ItemItemInvitationsItemWithInvitation_PatchRequestBody) 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 *ItemItemInvitationsItemWithInvitation_PatchRequestBody) 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 *ItemItemInvitationsItemWithInvitation_PatchRequestBody) 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 *ItemItemInvitationsItemWithInvitation_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemInvitationsItemWithInvitation_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_invitations_request_builder.go b/pkg/github/repos/item_item_invitations_request_builder.go new file mode 100644 index 00000000..d4a781b6 --- /dev/null +++ b/pkg/github/repos/item_item_invitations_request_builder.go @@ -0,0 +1,78 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemInvitationsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\invitations +type ItemItemInvitationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemInvitationsRequestBuilderGetQueryParameters when authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. +type ItemItemInvitationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByInvitation_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.invitations.item collection +// returns a *ItemItemInvitationsWithInvitation_ItemRequestBuilder when successful +func (m *ItemItemInvitationsRequestBuilder) ByInvitation_id(invitation_id int32)(*ItemItemInvitationsWithInvitation_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["invitation_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(invitation_id), 10) + return NewItemItemInvitationsWithInvitation_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemInvitationsRequestBuilderInternal instantiates a new ItemItemInvitationsRequestBuilder and sets the default values. +func NewItemItemInvitationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemInvitationsRequestBuilder) { + m := &ItemItemInvitationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/invitations{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemInvitationsRequestBuilder instantiates a new ItemItemInvitationsRequestBuilder and sets the default values. +func NewItemItemInvitationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemInvitationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemInvitationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get when authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. +// returns a []RepositoryInvitationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/collaborators/invitations#list-repository-invitations +func (m *ItemItemInvitationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemInvitationsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryInvitationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryInvitationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryInvitationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryInvitationable) + } + } + return val, nil +} +// ToGetRequestInformation when authenticating as a user with admin rights to a repository, this endpoint will list all currently open repository invitations. +// returns a *RequestInformation when successful +func (m *ItemItemInvitationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemInvitationsRequestBuilderGetQueryParameters])(*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 *ItemItemInvitationsRequestBuilder when successful +func (m *ItemItemInvitationsRequestBuilder) WithUrl(rawUrl string)(*ItemItemInvitationsRequestBuilder) { + return NewItemItemInvitationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_invitations_with_invitation_escaped_item_request_builder.go b/pkg/github/repos/item_item_invitations_with_invitation_escaped_item_request_builder.go new file mode 100644 index 00000000..a4e10809 --- /dev/null +++ b/pkg/github/repos/item_item_invitations_with_invitation_escaped_item_request_builder.go @@ -0,0 +1,81 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemInvitationsWithInvitation_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\invitations\{invitation_id} +type ItemItemInvitationsWithInvitation_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemInvitationsWithInvitation_ItemRequestBuilderInternal instantiates a new ItemItemInvitationsWithInvitation_ItemRequestBuilder and sets the default values. +func NewItemItemInvitationsWithInvitation_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemInvitationsWithInvitation_ItemRequestBuilder) { + m := &ItemItemInvitationsWithInvitation_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/invitations/{invitation_id}", pathParameters), + } + return m +} +// NewItemItemInvitationsWithInvitation_ItemRequestBuilder instantiates a new ItemItemInvitationsWithInvitation_ItemRequestBuilder and sets the default values. +func NewItemItemInvitationsWithInvitation_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemInvitationsWithInvitation_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemInvitationsWithInvitation_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a repository invitation +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/collaborators/invitations#delete-a-repository-invitation +func (m *ItemItemInvitationsWithInvitation_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Patch update a repository invitation +// returns a RepositoryInvitationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/collaborators/invitations#update-a-repository-invitation +func (m *ItemItemInvitationsWithInvitation_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemInvitationsItemWithInvitation_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryInvitationable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryInvitationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryInvitationable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemInvitationsWithInvitation_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) + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ItemItemInvitationsWithInvitation_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemInvitationsItemWithInvitation_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 *ItemItemInvitationsWithInvitation_ItemRequestBuilder when successful +func (m *ItemItemInvitationsWithInvitation_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemInvitationsWithInvitation_ItemRequestBuilder) { + return NewItemItemInvitationsWithInvitation_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_comments_item_reactions_post_request_body.go b/pkg/github/repos/item_item_issues_comments_item_reactions_post_request_body.go new file mode 100644 index 00000000..01f1b541 --- /dev/null +++ b/pkg/github/repos/item_item_issues_comments_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesCommentsItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemIssuesCommentsItemReactionsPostRequestBody instantiates a new ItemItemIssuesCommentsItemReactionsPostRequestBody and sets the default values. +func NewItemItemIssuesCommentsItemReactionsPostRequestBody()(*ItemItemIssuesCommentsItemReactionsPostRequestBody) { + m := &ItemItemIssuesCommentsItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesCommentsItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesCommentsItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesCommentsItemReactionsPostRequestBody(), 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 *ItemItemIssuesCommentsItemReactionsPostRequestBody) 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 *ItemItemIssuesCommentsItemReactionsPostRequestBody) 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 *ItemItemIssuesCommentsItemReactionsPostRequestBody) 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 *ItemItemIssuesCommentsItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemIssuesCommentsItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_issues_comments_item_reactions_request_builder.go b/pkg/github/repos/item_item_issues_comments_item_reactions_request_builder.go new file mode 100644 index 00000000..cfe788d2 --- /dev/null +++ b/pkg/github/repos/item_item_issues_comments_item_reactions_request_builder.go @@ -0,0 +1,120 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i5a10400ca5eff11dc8c6b73f4eca4f74336ae966b820149343b78d655929e36f "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/issues/comments/item/reactions" +) + +// ItemItemIssuesCommentsItemReactionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\comments\{comment_id}\reactions +type ItemItemIssuesCommentsItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesCommentsItemReactionsRequestBuilderGetQueryParameters list the reactions to an [issue comment](https://docs.github.com/enterprise-server@3.14/rest/issues/comments#get-an-issue-comment). +type ItemItemIssuesCommentsItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue comment. + Content *i5a10400ca5eff11dc8c6b73f4eca4f74336ae966b820149343b78d655929e36f.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReaction_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.issues.comments.item.reactions.item collection +// returns a *ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemIssuesCommentsItemReactionsRequestBuilder) ByReaction_id(reaction_id int32)(*ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["reaction_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(reaction_id), 10) + return NewItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesCommentsItemReactionsRequestBuilderInternal instantiates a new ItemItemIssuesCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsItemReactionsRequestBuilder) { + m := &ItemItemIssuesCommentsItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/comments/{comment_id}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemIssuesCommentsItemReactionsRequestBuilder instantiates a new ItemItemIssuesCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesCommentsItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the reactions to an [issue comment](https://docs.github.com/enterprise-server@3.14/rest/issues/comments#get-an-issue-comment). +// returns a []Reactionable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-an-issue-comment +func (m *ItemItemIssuesCommentsItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesCommentsItemReactionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable) + } + } + return val, nil +} +// Post create a reaction to an [issue comment](https://docs.github.com/enterprise-server@3.14/rest/issues/comments#get-an-issue-comment). A response with an HTTP `200` status means that you already added the reaction type to this issue comment. +// returns a Reactionable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#create-reaction-for-an-issue-comment +func (m *ItemItemIssuesCommentsItemReactionsRequestBuilder) Post(ctx context.Context, body ItemItemIssuesCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable), nil +} +// ToGetRequestInformation list the reactions to an [issue comment](https://docs.github.com/enterprise-server@3.14/rest/issues/comments#get-an-issue-comment). +// returns a *RequestInformation when successful +func (m *ItemItemIssuesCommentsItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesCommentsItemReactionsRequestBuilderGetQueryParameters])(*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 create a reaction to an [issue comment](https://docs.github.com/enterprise-server@3.14/rest/issues/comments#get-an-issue-comment). A response with an HTTP `200` status means that you already added the reaction type to this issue comment. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesCommentsItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemIssuesCommentsItemReactionsPostRequestBodyable, 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 *ItemItemIssuesCommentsItemReactionsRequestBuilder when successful +func (m *ItemItemIssuesCommentsItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesCommentsItemReactionsRequestBuilder) { + return NewItemItemIssuesCommentsItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_comments_item_reactions_with_reaction_escaped_item_request_builder.go b/pkg/github/repos/item_item_issues_comments_item_reactions_with_reaction_escaped_item_request_builder.go new file mode 100644 index 00000000..59107eea --- /dev/null +++ b/pkg/github/repos/item_item_issues_comments_item_reactions_with_reaction_escaped_item_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\comments\{comment_id}\reactions\{reaction_id} +type ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilderInternal instantiates a new ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder) { + m := &ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/comments/{comment_id}/reactions/{reaction_id}", pathParameters), + } + return m +} +// NewItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder instantiates a new ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!NOTE]> You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`.Delete a reaction to an [issue comment](https://docs.github.com/enterprise-server@3.14/rest/issues/comments#get-an-issue-comment). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#delete-an-issue-comment-reaction +func (m *ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation > [!NOTE]> You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/issues/comments/:comment_id/reactions/:reaction_id`.Delete a reaction to an [issue comment](https://docs.github.com/enterprise-server@3.14/rest/issues/comments#get-an-issue-comment). +// returns a *RequestInformation when successful +func (m *ItemItemIssuesCommentsItemReactionsWithReaction_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) + 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 *ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder) { + return NewItemItemIssuesCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_comments_item_with_comment_escaped_patch_request_body.go b/pkg/github/repos/item_item_issues_comments_item_with_comment_escaped_patch_request_body.go new file mode 100644 index 00000000..77996dc9 --- /dev/null +++ b/pkg/github/repos/item_item_issues_comments_item_with_comment_escaped_patch_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesCommentsItemWithComment_PatchRequestBody 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 contents of the comment. + body *string +} +// NewItemItemIssuesCommentsItemWithComment_PatchRequestBody instantiates a new ItemItemIssuesCommentsItemWithComment_PatchRequestBody and sets the default values. +func NewItemItemIssuesCommentsItemWithComment_PatchRequestBody()(*ItemItemIssuesCommentsItemWithComment_PatchRequestBody) { + m := &ItemItemIssuesCommentsItemWithComment_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesCommentsItemWithComment_PatchRequestBody(), 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 *ItemItemIssuesCommentsItemWithComment_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The contents of the comment. +// returns a *string when successful +func (m *ItemItemIssuesCommentsItemWithComment_PatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesCommentsItemWithComment_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemIssuesCommentsItemWithComment_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemItemIssuesCommentsItemWithComment_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The contents of the comment. +func (m *ItemItemIssuesCommentsItemWithComment_PatchRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemItemIssuesCommentsItemWithComment_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/pkg/github/repos/item_item_issues_comments_request_builder.go b/pkg/github/repos/item_item_issues_comments_request_builder.go new file mode 100644 index 00000000..7560cff7 --- /dev/null +++ b/pkg/github/repos/item_item_issues_comments_request_builder.go @@ -0,0 +1,92 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i4d5f3c017b54ef14e1c25a3f4336a2c80936fe025b2e07c82c10af52ae23acb2 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/issues/comments" +) + +// ItemItemIssuesCommentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\comments +type ItemItemIssuesCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesCommentsRequestBuilderGetQueryParameters you can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request.By default, issue comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemIssuesCommentsRequestBuilderGetQueryParameters struct { + // Either `asc` or `desc`. Ignored without the `sort` parameter. + Direction *i4d5f3c017b54ef14e1c25a3f4336a2c80936fe025b2e07c82c10af52ae23acb2.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // The property to sort the results by. + Sort *i4d5f3c017b54ef14e1c25a3f4336a2c80936fe025b2e07c82c10af52ae23acb2.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByComment_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.issues.comments.item collection +// returns a *ItemItemIssuesCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemItemIssuesCommentsRequestBuilder) ByComment_id(comment_id int64)(*ItemItemIssuesCommentsWithComment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["comment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(comment_id, 10) + return NewItemItemIssuesCommentsWithComment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesCommentsRequestBuilderInternal instantiates a new ItemItemIssuesCommentsRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsRequestBuilder) { + m := &ItemItemIssuesCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/comments{?direction*,page*,per_page*,since*,sort*}", pathParameters), + } + return m +} +// NewItemItemIssuesCommentsRequestBuilder instantiates a new ItemItemIssuesCommentsRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get you can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request.By default, issue comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []IssueCommentable 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/enterprise-server@3.14/rest/issues/comments#list-issue-comments-for-a-repository +func (m *ItemItemIssuesCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesCommentsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueCommentable) + } + } + return val, nil +} +// ToGetRequestInformation you can use the REST API to list comments on issues and pull requests for a repository. Every pull request is an issue, but not every issue is a pull request.By default, issue comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesCommentsRequestBuilderGetQueryParameters])(*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 *ItemItemIssuesCommentsRequestBuilder when successful +func (m *ItemItemIssuesCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesCommentsRequestBuilder) { + return NewItemItemIssuesCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_comments_with_comment_escaped_item_request_builder.go b/pkg/github/repos/item_item_issues_comments_with_comment_escaped_item_request_builder.go new file mode 100644 index 00000000..af0db9b2 --- /dev/null +++ b/pkg/github/repos/item_item_issues_comments_with_comment_escaped_item_request_builder.go @@ -0,0 +1,123 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemIssuesCommentsWithComment_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\comments\{comment_id} +type ItemItemIssuesCommentsWithComment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemIssuesCommentsWithComment_ItemRequestBuilderInternal instantiates a new ItemItemIssuesCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsWithComment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsWithComment_ItemRequestBuilder) { + m := &ItemItemIssuesCommentsWithComment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/comments/{comment_id}", pathParameters), + } + return m +} +// NewItemItemIssuesCommentsWithComment_ItemRequestBuilder instantiates a new ItemItemIssuesCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesCommentsWithComment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesCommentsWithComment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesCommentsWithComment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete you can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/comments#delete-an-issue-comment +func (m *ItemItemIssuesCommentsWithComment_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get you can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a IssueCommentable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/comments#get-an-issue-comment +func (m *ItemItemIssuesCommentsWithComment_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueCommentable), nil +} +// Patch you can use the REST API to update comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a IssueCommentable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/comments#update-an-issue-comment +func (m *ItemItemIssuesCommentsWithComment_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemIssuesCommentsItemWithComment_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueCommentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueCommentable), nil +} +// Reactions the reactions property +// returns a *ItemItemIssuesCommentsItemReactionsRequestBuilder when successful +func (m *ItemItemIssuesCommentsWithComment_ItemRequestBuilder) Reactions()(*ItemItemIssuesCommentsItemReactionsRequestBuilder) { + return NewItemItemIssuesCommentsItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation you can use the REST API to delete comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesCommentsWithComment_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) + return requestInfo, nil +} +// ToGetRequestInformation you can use the REST API to get comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesCommentsWithComment_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 you can use the REST API to update comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesCommentsWithComment_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemIssuesCommentsItemWithComment_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 *ItemItemIssuesCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemItemIssuesCommentsWithComment_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesCommentsWithComment_ItemRequestBuilder) { + return NewItemItemIssuesCommentsWithComment_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_events_request_builder.go b/pkg/github/repos/item_item_issues_events_request_builder.go new file mode 100644 index 00000000..2220ca2c --- /dev/null +++ b/pkg/github/repos/item_item_issues_events_request_builder.go @@ -0,0 +1,82 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemIssuesEventsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\events +type ItemItemIssuesEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesEventsRequestBuilderGetQueryParameters lists events for a repository. +type ItemItemIssuesEventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByEvent_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.issues.events.item collection +// returns a *ItemItemIssuesEventsWithEvent_ItemRequestBuilder when successful +func (m *ItemItemIssuesEventsRequestBuilder) ByEvent_id(event_id int32)(*ItemItemIssuesEventsWithEvent_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["event_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(event_id), 10) + return NewItemItemIssuesEventsWithEvent_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesEventsRequestBuilderInternal instantiates a new ItemItemIssuesEventsRequestBuilder and sets the default values. +func NewItemItemIssuesEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesEventsRequestBuilder) { + m := &ItemItemIssuesEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/events{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemIssuesEventsRequestBuilder instantiates a new ItemItemIssuesEventsRequestBuilder and sets the default values. +func NewItemItemIssuesEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists events for a repository. +// returns a []IssueEventable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/events#list-issue-events-for-a-repository +func (m *ItemItemIssuesEventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesEventsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueEventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueEventFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueEventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueEventable) + } + } + return val, nil +} +// ToGetRequestInformation lists events for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesEventsRequestBuilderGetQueryParameters])(*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 *ItemItemIssuesEventsRequestBuilder when successful +func (m *ItemItemIssuesEventsRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesEventsRequestBuilder) { + return NewItemItemIssuesEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_events_with_event_escaped_item_request_builder.go b/pkg/github/repos/item_item_issues_events_with_event_escaped_item_request_builder.go new file mode 100644 index 00000000..a084e4cd --- /dev/null +++ b/pkg/github/repos/item_item_issues_events_with_event_escaped_item_request_builder.go @@ -0,0 +1,65 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemIssuesEventsWithEvent_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\events\{event_id} +type ItemItemIssuesEventsWithEvent_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemIssuesEventsWithEvent_ItemRequestBuilderInternal instantiates a new ItemItemIssuesEventsWithEvent_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesEventsWithEvent_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesEventsWithEvent_ItemRequestBuilder) { + m := &ItemItemIssuesEventsWithEvent_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/events/{event_id}", pathParameters), + } + return m +} +// NewItemItemIssuesEventsWithEvent_ItemRequestBuilder instantiates a new ItemItemIssuesEventsWithEvent_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesEventsWithEvent_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesEventsWithEvent_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesEventsWithEvent_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a single event by the event id. +// returns a IssueEventable 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 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/events#get-an-issue-event +func (m *ItemItemIssuesEventsWithEvent_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueEventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueEventFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueEventable), nil +} +// ToGetRequestInformation gets a single event by the event id. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesEventsWithEvent_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemIssuesEventsWithEvent_ItemRequestBuilder when successful +func (m *ItemItemIssuesEventsWithEvent_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesEventsWithEvent_ItemRequestBuilder) { + return NewItemItemIssuesEventsWithEvent_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_item_assignees_delete_request_body.go b/pkg/github/repos/item_item_issues_item_assignees_delete_request_body.go new file mode 100644 index 00000000..4fb7a2dc --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_assignees_delete_request_body.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemAssigneesDeleteRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ + assignees []string +} +// NewItemItemIssuesItemAssigneesDeleteRequestBody instantiates a new ItemItemIssuesItemAssigneesDeleteRequestBody and sets the default values. +func NewItemItemIssuesItemAssigneesDeleteRequestBody()(*ItemItemIssuesItemAssigneesDeleteRequestBody) { + m := &ItemItemIssuesItemAssigneesDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemAssigneesDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemAssigneesDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemAssigneesDeleteRequestBody(), 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 *ItemItemIssuesItemAssigneesDeleteRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignees gets the assignees property value. Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ +// returns a []string when successful +func (m *ItemItemIssuesItemAssigneesDeleteRequestBody) GetAssignees()([]string) { + return m.assignees +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemAssigneesDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["assignees"] = 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.SetAssignees(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemAssigneesDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAssignees() != nil { + err := writer.WriteCollectionOfStringValues("assignees", m.GetAssignees()) + 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 *ItemItemIssuesItemAssigneesDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignees sets the assignees property value. Usernames of assignees to remove from an issue. _NOTE: Only users with push access can remove assignees from an issue. Assignees are silently ignored otherwise._ +func (m *ItemItemIssuesItemAssigneesDeleteRequestBody) SetAssignees(value []string)() { + m.assignees = value +} +type ItemItemIssuesItemAssigneesDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignees()([]string) + SetAssignees(value []string)() +} diff --git a/pkg/github/repos/item_item_issues_item_assignees_post_request_body.go b/pkg/github/repos/item_item_issues_item_assignees_post_request_body.go new file mode 100644 index 00000000..7ae722e9 --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_assignees_post_request_body.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemAssigneesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ + assignees []string +} +// NewItemItemIssuesItemAssigneesPostRequestBody instantiates a new ItemItemIssuesItemAssigneesPostRequestBody and sets the default values. +func NewItemItemIssuesItemAssigneesPostRequestBody()(*ItemItemIssuesItemAssigneesPostRequestBody) { + m := &ItemItemIssuesItemAssigneesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemAssigneesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemAssigneesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemAssigneesPostRequestBody(), 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 *ItemItemIssuesItemAssigneesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignees gets the assignees property value. Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ +// returns a []string when successful +func (m *ItemItemIssuesItemAssigneesPostRequestBody) GetAssignees()([]string) { + return m.assignees +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemAssigneesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["assignees"] = 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.SetAssignees(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemAssigneesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAssignees() != nil { + err := writer.WriteCollectionOfStringValues("assignees", m.GetAssignees()) + 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 *ItemItemIssuesItemAssigneesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignees sets the assignees property value. Usernames of people to assign this issue to. _NOTE: Only users with push access can add assignees to an issue. Assignees are silently ignored otherwise._ +func (m *ItemItemIssuesItemAssigneesPostRequestBody) SetAssignees(value []string)() { + m.assignees = value +} +type ItemItemIssuesItemAssigneesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignees()([]string) + SetAssignees(value []string)() +} diff --git a/pkg/github/repos/item_item_issues_item_assignees_request_builder.go b/pkg/github/repos/item_item_issues_item_assignees_request_builder.go new file mode 100644 index 00000000..2cfe501f --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_assignees_request_builder.go @@ -0,0 +1,104 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemIssuesItemAssigneesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\assignees +type ItemItemIssuesItemAssigneesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByAssignee gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.issues.item.assignees.item collection +// returns a *ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder when successful +func (m *ItemItemIssuesItemAssigneesRequestBuilder) ByAssignee(assignee string)(*ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if assignee != "" { + urlTplParams["assignee"] = assignee + } + return NewItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesItemAssigneesRequestBuilderInternal instantiates a new ItemItemIssuesItemAssigneesRequestBuilder and sets the default values. +func NewItemItemIssuesItemAssigneesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemAssigneesRequestBuilder) { + m := &ItemItemIssuesItemAssigneesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/assignees", pathParameters), + } + return m +} +// NewItemItemIssuesItemAssigneesRequestBuilder instantiates a new ItemItemIssuesItemAssigneesRequestBuilder and sets the default values. +func NewItemItemIssuesItemAssigneesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemAssigneesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemAssigneesRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes one or more assignees from an issue. +// returns a Issueable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/assignees#remove-assignees-from-an-issue +func (m *ItemItemIssuesItemAssigneesRequestBuilder) Delete(ctx context.Context, body ItemItemIssuesItemAssigneesDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable), nil +} +// Post adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. +// returns a Issueable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/assignees#add-assignees-to-an-issue +func (m *ItemItemIssuesItemAssigneesRequestBuilder) Post(ctx context.Context, body ItemItemIssuesItemAssigneesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable), nil +} +// ToDeleteRequestInformation removes one or more assignees from an issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemAssigneesRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ItemItemIssuesItemAssigneesDeleteRequestBodyable, 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") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPostRequestInformation adds up to 10 assignees to an issue. Users already assigned to an issue are not replaced. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemAssigneesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemIssuesItemAssigneesPostRequestBodyable, 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 *ItemItemIssuesItemAssigneesRequestBuilder when successful +func (m *ItemItemIssuesItemAssigneesRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemAssigneesRequestBuilder) { + return NewItemItemIssuesItemAssigneesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_item_assignees_with_assignee_item_request_builder.go b/pkg/github/repos/item_item_issues_item_assignees_with_assignee_item_request_builder.go new file mode 100644 index 00000000..f8f3c333 --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_assignees_with_assignee_item_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\assignees\{assignee} +type ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilderInternal instantiates a new ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder and sets the default values. +func NewItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder) { + m := &ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/assignees/{assignee}", pathParameters), + } + return m +} +// NewItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder instantiates a new ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder and sets the default values. +func NewItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get checks if a user has permission to be assigned to a specific issue.If the `assignee` can be assigned to this issue, a `204` status code with no content is returned.Otherwise a `404` status code is returned. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/assignees#check-if-a-user-can-be-assigned-to-a-issue +func (m *ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation checks if a user has permission to be assigned to a specific issue.If the `assignee` can be assigned to this issue, a `204` status code with no content is returned.Otherwise a `404` status code is returned. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder) 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 *ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder when successful +func (m *ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder) { + return NewItemItemIssuesItemAssigneesWithAssigneeItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_item_comments_post_request_body.go b/pkg/github/repos/item_item_issues_item_comments_post_request_body.go new file mode 100644 index 00000000..c85f841d --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_comments_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemCommentsPostRequestBody 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 contents of the comment. + body *string +} +// NewItemItemIssuesItemCommentsPostRequestBody instantiates a new ItemItemIssuesItemCommentsPostRequestBody and sets the default values. +func NewItemItemIssuesItemCommentsPostRequestBody()(*ItemItemIssuesItemCommentsPostRequestBody) { + m := &ItemItemIssuesItemCommentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemCommentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemCommentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemCommentsPostRequestBody(), 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 *ItemItemIssuesItemCommentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The contents of the comment. +// returns a *string when successful +func (m *ItemItemIssuesItemCommentsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemCommentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemCommentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemItemIssuesItemCommentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The contents of the comment. +func (m *ItemItemIssuesItemCommentsPostRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemItemIssuesItemCommentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/pkg/github/repos/item_item_issues_item_comments_request_builder.go b/pkg/github/repos/item_item_issues_item_comments_request_builder.go new file mode 100644 index 00000000..14a95516 --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_comments_request_builder.go @@ -0,0 +1,117 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemIssuesItemCommentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\comments +type ItemItemIssuesItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesItemCommentsRequestBuilderGetQueryParameters you can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.Issue comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemIssuesItemCommentsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// NewItemItemIssuesItemCommentsRequestBuilderInternal instantiates a new ItemItemIssuesItemCommentsRequestBuilder and sets the default values. +func NewItemItemIssuesItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemCommentsRequestBuilder) { + m := &ItemItemIssuesItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/comments{?page*,per_page*,since*}", pathParameters), + } + return m +} +// NewItemItemIssuesItemCommentsRequestBuilder instantiates a new ItemItemIssuesItemCommentsRequestBuilder and sets the default values. +func NewItemItemIssuesItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get you can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.Issue comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []IssueCommentable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/comments#list-issue-comments +func (m *ItemItemIssuesItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemCommentsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueCommentable) + } + } + return val, nil +} +// Post you can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications).Creating content too quickly using this endpoint may result in secondary rate limiting.For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a IssueCommentable 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 410 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/comments#create-an-issue-comment +func (m *ItemItemIssuesItemCommentsRequestBuilder) Post(ctx context.Context, body ItemItemIssuesItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueCommentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueCommentable), nil +} +// ToGetRequestInformation you can use the REST API to list comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.Issue comments are ordered by ascending ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemCommentsRequestBuilderGetQueryParameters])(*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 you can use the REST API to create comments on issues and pull requests. Every pull request is an issue, but not every issue is a pull request.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications).Creating content too quickly using this endpoint may result in secondary rate limiting.For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemCommentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemIssuesItemCommentsPostRequestBodyable, 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 *ItemItemIssuesItemCommentsRequestBuilder when successful +func (m *ItemItemIssuesItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemCommentsRequestBuilder) { + return NewItemItemIssuesItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_item_events_request_builder.go b/pkg/github/repos/item_item_issues_item_events_request_builder.go new file mode 100644 index 00000000..b19fde02 --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_events_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemIssuesItemEventsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\events +type ItemItemIssuesItemEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesItemEventsRequestBuilderGetQueryParameters lists all events for an issue. +type ItemItemIssuesItemEventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemIssuesItemEventsRequestBuilderInternal instantiates a new ItemItemIssuesItemEventsRequestBuilder and sets the default values. +func NewItemItemIssuesItemEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemEventsRequestBuilder) { + m := &ItemItemIssuesItemEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/events{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemIssuesItemEventsRequestBuilder instantiates a new ItemItemIssuesItemEventsRequestBuilder and sets the default values. +func NewItemItemIssuesItemEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all events for an issue. +// returns a []IssueEventForIssueable when successful +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/events#list-issue-events +func (m *ItemItemIssuesItemEventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemEventsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueEventForIssueable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueEventForIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueEventForIssueable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueEventForIssueable) + } + } + return val, nil +} +// ToGetRequestInformation lists all events for an issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemEventsRequestBuilderGetQueryParameters])(*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 *ItemItemIssuesItemEventsRequestBuilder when successful +func (m *ItemItemIssuesItemEventsRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemEventsRequestBuilder) { + return NewItemItemIssuesItemEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_item_labels_post_request_body_member1.go b/pkg/github/repos/item_item_issues_item_labels_post_request_body_member1.go new file mode 100644 index 00000000..5637e667 --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_labels_post_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPostRequestBodyMember1 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 names of the labels to add to the issue's existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also replace all of the labels for an issue. For more information, see "[Set labels for an issue](https://docs.github.com/enterprise-server@3.14/rest/issues/labels#set-labels-for-an-issue)." + labels []string +} +// NewItemItemIssuesItemLabelsPostRequestBodyMember1 instantiates a new ItemItemIssuesItemLabelsPostRequestBodyMember1 and sets the default values. +func NewItemItemIssuesItemLabelsPostRequestBodyMember1()(*ItemItemIssuesItemLabelsPostRequestBodyMember1) { + m := &ItemItemIssuesItemLabelsPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPostRequestBodyMember1(), 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 *ItemItemIssuesItemLabelsPostRequestBodyMember1) 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 *ItemItemIssuesItemLabelsPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = 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.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the labels to add to the issue's existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also replace all of the labels for an issue. For more information, see "[Set labels for an issue](https://docs.github.com/enterprise-server@3.14/rest/issues/labels#set-labels-for-an-issue)." +// returns a []string when successful +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember1) GetLabels()([]string) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + 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 *ItemItemIssuesItemLabelsPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the labels to add to the issue's existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also replace all of the labels for an issue. For more information, see "[Set labels for an issue](https://docs.github.com/enterprise-server@3.14/rest/issues/labels#set-labels-for-an-issue)." +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember1) SetLabels(value []string)() { + m.labels = value +} +type ItemItemIssuesItemLabelsPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + SetLabels(value []string)() +} diff --git a/pkg/github/repos/item_item_issues_item_labels_post_request_body_member2.go b/pkg/github/repos/item_item_issues_item_labels_post_request_body_member2.go new file mode 100644 index 00000000..ea62452b --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_labels_post_request_body_member2.go @@ -0,0 +1,92 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPostRequestBodyMember2 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 labels property + labels []ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable +} +// NewItemItemIssuesItemLabelsPostRequestBodyMember2 instantiates a new ItemItemIssuesItemLabelsPostRequestBodyMember2 and sets the default values. +func NewItemItemIssuesItemLabelsPostRequestBodyMember2()(*ItemItemIssuesItemLabelsPostRequestBodyMember2) { + m := &ItemItemIssuesItemLabelsPostRequestBodyMember2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPostRequestBodyMember2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPostRequestBodyMember2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPostRequestBodyMember2(), 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 *ItemItemIssuesItemLabelsPostRequestBodyMember2) 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 *ItemItemIssuesItemLabelsPostRequestBodyMember2) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemIssuesItemLabelsPostRequestBodyMember2_labelsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable) + } + } + m.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The labels property +// returns a []ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable when successful +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2) GetLabels()([]ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemItemIssuesItemLabelsPostRequestBodyMember2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2) SetLabels(value []ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable)() { + m.labels = value +} +type ItemItemIssuesItemLabelsPostRequestBodyMember2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable) + SetLabels(value []ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable)() +} diff --git a/pkg/github/repos/item_item_issues_item_labels_post_request_body_member2_escaped_labels.go b/pkg/github/repos/item_item_issues_item_labels_post_request_body_member2_escaped_labels.go new file mode 100644 index 00000000..444ea9a9 --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_labels_post_request_body_member2_escaped_labels.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPostRequestBodyMember2_labels 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 name property + name *string +} +// NewItemItemIssuesItemLabelsPostRequestBodyMember2_labels instantiates a new ItemItemIssuesItemLabelsPostRequestBodyMember2_labels and sets the default values. +func NewItemItemIssuesItemLabelsPostRequestBodyMember2_labels()(*ItemItemIssuesItemLabelsPostRequestBodyMember2_labels) { + m := &ItemItemIssuesItemLabelsPostRequestBodyMember2_labels{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPostRequestBodyMember2_labelsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPostRequestBodyMember2_labelsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPostRequestBodyMember2_labels(), 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 *ItemItemIssuesItemLabelsPostRequestBodyMember2_labels) 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 *ItemItemIssuesItemLabelsPostRequestBodyMember2_labels) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 property +// returns a *string when successful +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2_labels) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2_labels) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemIssuesItemLabelsPostRequestBodyMember2_labels) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name property +func (m *ItemItemIssuesItemLabelsPostRequestBodyMember2_labels) SetName(value *string)() { + m.name = value +} +type ItemItemIssuesItemLabelsPostRequestBodyMember2_labelsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + SetName(value *string)() +} diff --git a/pkg/github/repos/item_item_issues_item_labels_post_request_body_member3.go b/pkg/github/repos/item_item_issues_item_labels_post_request_body_member3.go new file mode 100644 index 00000000..5495d2d0 --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_labels_post_request_body_member3.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPostRequestBodyMember3 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemIssuesItemLabelsPostRequestBodyMember3 instantiates a new ItemItemIssuesItemLabelsPostRequestBodyMember3 and sets the default values. +func NewItemItemIssuesItemLabelsPostRequestBodyMember3()(*ItemItemIssuesItemLabelsPostRequestBodyMember3) { + m := &ItemItemIssuesItemLabelsPostRequestBodyMember3{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPostRequestBodyMember3FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPostRequestBodyMember3FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPostRequestBodyMember3(), 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 *ItemItemIssuesItemLabelsPostRequestBodyMember3) 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 *ItemItemIssuesItemLabelsPostRequestBodyMember3) 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 *ItemItemIssuesItemLabelsPostRequestBodyMember3) 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 *ItemItemIssuesItemLabelsPostRequestBodyMember3) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemIssuesItemLabelsPostRequestBodyMember3able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_issues_item_labels_put_request_body_member1.go b/pkg/github/repos/item_item_issues_item_labels_put_request_body_member1.go new file mode 100644 index 00000000..b0dcb7db --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_labels_put_request_body_member1.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPutRequestBodyMember1 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 names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/enterprise-server@3.14/rest/issues/labels#add-labels-to-an-issue)." + labels []string +} +// NewItemItemIssuesItemLabelsPutRequestBodyMember1 instantiates a new ItemItemIssuesItemLabelsPutRequestBodyMember1 and sets the default values. +func NewItemItemIssuesItemLabelsPutRequestBodyMember1()(*ItemItemIssuesItemLabelsPutRequestBodyMember1) { + m := &ItemItemIssuesItemLabelsPutRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPutRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPutRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPutRequestBodyMember1(), 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 *ItemItemIssuesItemLabelsPutRequestBodyMember1) 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 *ItemItemIssuesItemLabelsPutRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = 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.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/enterprise-server@3.14/rest/issues/labels#add-labels-to-an-issue)." +// returns a []string when successful +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember1) GetLabels()([]string) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + 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 *ItemItemIssuesItemLabelsPutRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The names of the labels to set for the issue. The labels you set replace any existing labels. You can pass an empty array to remove all labels. Alternatively, you can pass a single label as a `string` or an `array` of labels directly, but GitHub recommends passing an object with the `labels` key. You can also add labels to the existing labels for an issue. For more information, see "[Add labels to an issue](https://docs.github.com/enterprise-server@3.14/rest/issues/labels#add-labels-to-an-issue)." +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember1) SetLabels(value []string)() { + m.labels = value +} +type ItemItemIssuesItemLabelsPutRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]string) + SetLabels(value []string)() +} diff --git a/pkg/github/repos/item_item_issues_item_labels_put_request_body_member2.go b/pkg/github/repos/item_item_issues_item_labels_put_request_body_member2.go new file mode 100644 index 00000000..5d5c56e0 --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_labels_put_request_body_member2.go @@ -0,0 +1,92 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPutRequestBodyMember2 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 labels property + labels []ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable +} +// NewItemItemIssuesItemLabelsPutRequestBodyMember2 instantiates a new ItemItemIssuesItemLabelsPutRequestBodyMember2 and sets the default values. +func NewItemItemIssuesItemLabelsPutRequestBodyMember2()(*ItemItemIssuesItemLabelsPutRequestBodyMember2) { + m := &ItemItemIssuesItemLabelsPutRequestBodyMember2{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPutRequestBodyMember2FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPutRequestBodyMember2FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPutRequestBodyMember2(), 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 *ItemItemIssuesItemLabelsPutRequestBodyMember2) 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 *ItemItemIssuesItemLabelsPutRequestBodyMember2) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["labels"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemIssuesItemLabelsPutRequestBodyMember2_labelsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable) + } + } + m.SetLabels(res) + } + return nil + } + return res +} +// GetLabels gets the labels property value. The labels property +// returns a []ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable when successful +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2) GetLabels()([]ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable) { + return m.labels +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetLabels() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabels())) + for i, v := range m.GetLabels() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("labels", 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 *ItemItemIssuesItemLabelsPutRequestBodyMember2) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabels sets the labels property value. The labels property +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2) SetLabels(value []ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable)() { + m.labels = value +} +type ItemItemIssuesItemLabelsPutRequestBodyMember2able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabels()([]ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable) + SetLabels(value []ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable)() +} diff --git a/pkg/github/repos/item_item_issues_item_labels_put_request_body_member2_escaped_labels.go b/pkg/github/repos/item_item_issues_item_labels_put_request_body_member2_escaped_labels.go new file mode 100644 index 00000000..4aac85db --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_labels_put_request_body_member2_escaped_labels.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPutRequestBodyMember2_labels 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 name property + name *string +} +// NewItemItemIssuesItemLabelsPutRequestBodyMember2_labels instantiates a new ItemItemIssuesItemLabelsPutRequestBodyMember2_labels and sets the default values. +func NewItemItemIssuesItemLabelsPutRequestBodyMember2_labels()(*ItemItemIssuesItemLabelsPutRequestBodyMember2_labels) { + m := &ItemItemIssuesItemLabelsPutRequestBodyMember2_labels{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPutRequestBodyMember2_labelsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPutRequestBodyMember2_labelsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPutRequestBodyMember2_labels(), 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 *ItemItemIssuesItemLabelsPutRequestBodyMember2_labels) 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 *ItemItemIssuesItemLabelsPutRequestBodyMember2_labels) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 property +// returns a *string when successful +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2_labels) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2_labels) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemIssuesItemLabelsPutRequestBodyMember2_labels) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetName sets the name property value. The name property +func (m *ItemItemIssuesItemLabelsPutRequestBodyMember2_labels) SetName(value *string)() { + m.name = value +} +type ItemItemIssuesItemLabelsPutRequestBodyMember2_labelsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetName()(*string) + SetName(value *string)() +} diff --git a/pkg/github/repos/item_item_issues_item_labels_put_request_body_member3.go b/pkg/github/repos/item_item_issues_item_labels_put_request_body_member3.go new file mode 100644 index 00000000..dd7c1f5e --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_labels_put_request_body_member3.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLabelsPutRequestBodyMember3 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemIssuesItemLabelsPutRequestBodyMember3 instantiates a new ItemItemIssuesItemLabelsPutRequestBodyMember3 and sets the default values. +func NewItemItemIssuesItemLabelsPutRequestBodyMember3()(*ItemItemIssuesItemLabelsPutRequestBodyMember3) { + m := &ItemItemIssuesItemLabelsPutRequestBodyMember3{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLabelsPutRequestBodyMember3FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLabelsPutRequestBodyMember3FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLabelsPutRequestBodyMember3(), 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 *ItemItemIssuesItemLabelsPutRequestBodyMember3) 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 *ItemItemIssuesItemLabelsPutRequestBodyMember3) 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 *ItemItemIssuesItemLabelsPutRequestBodyMember3) 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 *ItemItemIssuesItemLabelsPutRequestBodyMember3) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemIssuesItemLabelsPutRequestBodyMember3able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_issues_item_labels_request_builder.go b/pkg/github/repos/item_item_issues_item_labels_request_builder.go new file mode 100644 index 00000000..db6f93ed --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_labels_request_builder.go @@ -0,0 +1,671 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemIssuesItemLabelsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\labels +type ItemItemIssuesItemLabelsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesItemLabelsRequestBuilderGetQueryParameters lists all labels for an issue. +type ItemItemIssuesItemLabelsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// LabelsPostRequestBody composed type wrapper for classes ItemItemIssuesItemLabelsPostRequestBodyMember1able, ItemItemIssuesItemLabelsPostRequestBodyMember2able, string, []ItemItemIssuesItemLabelsPostRequestBodyMember3able +type LabelsPostRequestBody struct { + // Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember1able + itemItemIssuesItemLabelsPostRequestBodyMember1 ItemItemIssuesItemLabelsPostRequestBodyMember1able + // Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember2able + itemItemIssuesItemLabelsPostRequestBodyMember2 ItemItemIssuesItemLabelsPostRequestBodyMember2able + // Composed type representation for type []ItemItemIssuesItemLabelsPostRequestBodyMember3able + itemItemIssuesItemLabelsPostRequestBodyMember3 []ItemItemIssuesItemLabelsPostRequestBodyMember3able + // Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember1able + labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1 ItemItemIssuesItemLabelsPostRequestBodyMember1able + // Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember2able + labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2 ItemItemIssuesItemLabelsPostRequestBodyMember2able + // Composed type representation for type []ItemItemIssuesItemLabelsPostRequestBodyMember3able + labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3 []ItemItemIssuesItemLabelsPostRequestBodyMember3able + // Composed type representation for type string + labelsPostRequestBodyString *string + // Composed type representation for type string + string *string +} +// NewLabelsPostRequestBody instantiates a new LabelsPostRequestBody and sets the default values. +func NewLabelsPostRequestBody()(*LabelsPostRequestBody) { + m := &LabelsPostRequestBody{ + } + return m +} +// CreateLabelsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabelsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewLabelsPostRequestBody() + 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.SetLabelsPostRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } else if val, err := parseNode.GetCollectionOfObjectValues(CreateItemItemIssuesItemLabelsPostRequestBodyMember3FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemItemIssuesItemLabelsPostRequestBodyMember3able, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemItemIssuesItemLabelsPostRequestBodyMember3able) + } + } + result.SetItemItemIssuesItemLabelsPostRequestBodyMember3(cast) + } else if val, err := parseNode.GetCollectionOfObjectValues(CreateItemItemIssuesItemLabelsPostRequestBodyMember3FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemItemIssuesItemLabelsPostRequestBodyMember3able, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemItemIssuesItemLabelsPostRequestBodyMember3able) + } + } + result.SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3(cast) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LabelsPostRequestBody) 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 *LabelsPostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemIssuesItemLabelsPostRequestBodyMember1 gets the ItemItemIssuesItemLabelsPostRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember1able +// returns a ItemItemIssuesItemLabelsPostRequestBodyMember1able when successful +func (m *LabelsPostRequestBody) GetItemItemIssuesItemLabelsPostRequestBodyMember1()(ItemItemIssuesItemLabelsPostRequestBodyMember1able) { + return m.itemItemIssuesItemLabelsPostRequestBodyMember1 +} +// GetItemItemIssuesItemLabelsPostRequestBodyMember2 gets the ItemItemIssuesItemLabelsPostRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember2able +// returns a ItemItemIssuesItemLabelsPostRequestBodyMember2able when successful +func (m *LabelsPostRequestBody) GetItemItemIssuesItemLabelsPostRequestBodyMember2()(ItemItemIssuesItemLabelsPostRequestBodyMember2able) { + return m.itemItemIssuesItemLabelsPostRequestBodyMember2 +} +// GetItemItemIssuesItemLabelsPostRequestBodyMember3 gets the ItemItemIssuesItemLabelsPostRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPostRequestBodyMember3able +// returns a []ItemItemIssuesItemLabelsPostRequestBodyMember3able when successful +func (m *LabelsPostRequestBody) GetItemItemIssuesItemLabelsPostRequestBodyMember3()([]ItemItemIssuesItemLabelsPostRequestBodyMember3able) { + return m.itemItemIssuesItemLabelsPostRequestBodyMember3 +} +// GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1 gets the ItemItemIssuesItemLabelsPostRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember1able +// returns a ItemItemIssuesItemLabelsPostRequestBodyMember1able when successful +func (m *LabelsPostRequestBody) GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1()(ItemItemIssuesItemLabelsPostRequestBodyMember1able) { + return m.labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1 +} +// GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2 gets the ItemItemIssuesItemLabelsPostRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember2able +// returns a ItemItemIssuesItemLabelsPostRequestBodyMember2able when successful +func (m *LabelsPostRequestBody) GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2()(ItemItemIssuesItemLabelsPostRequestBodyMember2able) { + return m.labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2 +} +// GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3 gets the ItemItemIssuesItemLabelsPostRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPostRequestBodyMember3able +// returns a []ItemItemIssuesItemLabelsPostRequestBodyMember3able when successful +func (m *LabelsPostRequestBody) GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3()([]ItemItemIssuesItemLabelsPostRequestBodyMember3able) { + return m.labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3 +} +// GetLabelsPostRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *LabelsPostRequestBody) GetLabelsPostRequestBodyString()(*string) { + return m.labelsPostRequestBodyString +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *LabelsPostRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *LabelsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemIssuesItemLabelsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemIssuesItemLabelsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemIssuesItemLabelsPostRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetItemItemIssuesItemLabelsPostRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetLabelsPostRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetLabelsPostRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetItemItemIssuesItemLabelsPostRequestBodyMember3() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItemItemIssuesItemLabelsPostRequestBodyMember3())) + for i, v := range m.GetItemItemIssuesItemLabelsPostRequestBodyMember3() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } else if m.GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3())) + for i, v := range m.GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } + return nil +} +// SetItemItemIssuesItemLabelsPostRequestBodyMember1 sets the ItemItemIssuesItemLabelsPostRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember1able +func (m *LabelsPostRequestBody) SetItemItemIssuesItemLabelsPostRequestBodyMember1(value ItemItemIssuesItemLabelsPostRequestBodyMember1able)() { + m.itemItemIssuesItemLabelsPostRequestBodyMember1 = value +} +// SetItemItemIssuesItemLabelsPostRequestBodyMember2 sets the ItemItemIssuesItemLabelsPostRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember2able +func (m *LabelsPostRequestBody) SetItemItemIssuesItemLabelsPostRequestBodyMember2(value ItemItemIssuesItemLabelsPostRequestBodyMember2able)() { + m.itemItemIssuesItemLabelsPostRequestBodyMember2 = value +} +// SetItemItemIssuesItemLabelsPostRequestBodyMember3 sets the ItemItemIssuesItemLabelsPostRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPostRequestBodyMember3able +func (m *LabelsPostRequestBody) SetItemItemIssuesItemLabelsPostRequestBodyMember3(value []ItemItemIssuesItemLabelsPostRequestBodyMember3able)() { + m.itemItemIssuesItemLabelsPostRequestBodyMember3 = value +} +// SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1 sets the ItemItemIssuesItemLabelsPostRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember1able +func (m *LabelsPostRequestBody) SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1(value ItemItemIssuesItemLabelsPostRequestBodyMember1able)() { + m.labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1 = value +} +// SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2 sets the ItemItemIssuesItemLabelsPostRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPostRequestBodyMember2able +func (m *LabelsPostRequestBody) SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2(value ItemItemIssuesItemLabelsPostRequestBodyMember2able)() { + m.labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2 = value +} +// SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3 sets the ItemItemIssuesItemLabelsPostRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPostRequestBodyMember3able +func (m *LabelsPostRequestBody) SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3(value []ItemItemIssuesItemLabelsPostRequestBodyMember3able)() { + m.labelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3 = value +} +// SetLabelsPostRequestBodyString sets the string property value. Composed type representation for type string +func (m *LabelsPostRequestBody) SetLabelsPostRequestBodyString(value *string)() { + m.labelsPostRequestBodyString = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *LabelsPostRequestBody) SetString(value *string)() { + m.string = value +} +// LabelsPutRequestBody composed type wrapper for classes ItemItemIssuesItemLabelsPutRequestBodyMember1able, ItemItemIssuesItemLabelsPutRequestBodyMember2able, string, []ItemItemIssuesItemLabelsPutRequestBodyMember3able +type LabelsPutRequestBody struct { + // Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember1able + itemItemIssuesItemLabelsPutRequestBodyMember1 ItemItemIssuesItemLabelsPutRequestBodyMember1able + // Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember2able + itemItemIssuesItemLabelsPutRequestBodyMember2 ItemItemIssuesItemLabelsPutRequestBodyMember2able + // Composed type representation for type []ItemItemIssuesItemLabelsPutRequestBodyMember3able + itemItemIssuesItemLabelsPutRequestBodyMember3 []ItemItemIssuesItemLabelsPutRequestBodyMember3able + // Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember1able + labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1 ItemItemIssuesItemLabelsPutRequestBodyMember1able + // Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember2able + labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2 ItemItemIssuesItemLabelsPutRequestBodyMember2able + // Composed type representation for type []ItemItemIssuesItemLabelsPutRequestBodyMember3able + labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3 []ItemItemIssuesItemLabelsPutRequestBodyMember3able + // Composed type representation for type string + labelsPutRequestBodyString *string + // Composed type representation for type string + string *string +} +// NewLabelsPutRequestBody instantiates a new LabelsPutRequestBody and sets the default values. +func NewLabelsPutRequestBody()(*LabelsPutRequestBody) { + m := &LabelsPutRequestBody{ + } + return m +} +// CreateLabelsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabelsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewLabelsPutRequestBody() + 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.SetLabelsPutRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } else if val, err := parseNode.GetCollectionOfObjectValues(CreateItemItemIssuesItemLabelsPutRequestBodyMember3FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemItemIssuesItemLabelsPutRequestBodyMember3able, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemItemIssuesItemLabelsPutRequestBodyMember3able) + } + } + result.SetItemItemIssuesItemLabelsPutRequestBodyMember3(cast) + } else if val, err := parseNode.GetCollectionOfObjectValues(CreateItemItemIssuesItemLabelsPutRequestBodyMember3FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemItemIssuesItemLabelsPutRequestBodyMember3able, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemItemIssuesItemLabelsPutRequestBodyMember3able) + } + } + result.SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3(cast) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *LabelsPutRequestBody) 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 *LabelsPutRequestBody) GetIsComposedType()(bool) { + return true +} +// GetItemItemIssuesItemLabelsPutRequestBodyMember1 gets the ItemItemIssuesItemLabelsPutRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember1able +// returns a ItemItemIssuesItemLabelsPutRequestBodyMember1able when successful +func (m *LabelsPutRequestBody) GetItemItemIssuesItemLabelsPutRequestBodyMember1()(ItemItemIssuesItemLabelsPutRequestBodyMember1able) { + return m.itemItemIssuesItemLabelsPutRequestBodyMember1 +} +// GetItemItemIssuesItemLabelsPutRequestBodyMember2 gets the ItemItemIssuesItemLabelsPutRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember2able +// returns a ItemItemIssuesItemLabelsPutRequestBodyMember2able when successful +func (m *LabelsPutRequestBody) GetItemItemIssuesItemLabelsPutRequestBodyMember2()(ItemItemIssuesItemLabelsPutRequestBodyMember2able) { + return m.itemItemIssuesItemLabelsPutRequestBodyMember2 +} +// GetItemItemIssuesItemLabelsPutRequestBodyMember3 gets the ItemItemIssuesItemLabelsPutRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPutRequestBodyMember3able +// returns a []ItemItemIssuesItemLabelsPutRequestBodyMember3able when successful +func (m *LabelsPutRequestBody) GetItemItemIssuesItemLabelsPutRequestBodyMember3()([]ItemItemIssuesItemLabelsPutRequestBodyMember3able) { + return m.itemItemIssuesItemLabelsPutRequestBodyMember3 +} +// GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1 gets the ItemItemIssuesItemLabelsPutRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember1able +// returns a ItemItemIssuesItemLabelsPutRequestBodyMember1able when successful +func (m *LabelsPutRequestBody) GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1()(ItemItemIssuesItemLabelsPutRequestBodyMember1able) { + return m.labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1 +} +// GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2 gets the ItemItemIssuesItemLabelsPutRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember2able +// returns a ItemItemIssuesItemLabelsPutRequestBodyMember2able when successful +func (m *LabelsPutRequestBody) GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2()(ItemItemIssuesItemLabelsPutRequestBodyMember2able) { + return m.labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2 +} +// GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3 gets the ItemItemIssuesItemLabelsPutRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPutRequestBodyMember3able +// returns a []ItemItemIssuesItemLabelsPutRequestBodyMember3able when successful +func (m *LabelsPutRequestBody) GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3()([]ItemItemIssuesItemLabelsPutRequestBodyMember3able) { + return m.labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3 +} +// GetLabelsPutRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *LabelsPutRequestBody) GetLabelsPutRequestBodyString()(*string) { + return m.labelsPutRequestBodyString +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *LabelsPutRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *LabelsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemIssuesItemLabelsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemIssuesItemLabelsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetItemItemIssuesItemLabelsPutRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetItemItemIssuesItemLabelsPutRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2() != nil { + err := writer.WriteObjectValue("", m.GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2()) + if err != nil { + return err + } + } else if m.GetLabelsPutRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetLabelsPutRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetItemItemIssuesItemLabelsPutRequestBodyMember3() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItemItemIssuesItemLabelsPutRequestBodyMember3())) + for i, v := range m.GetItemItemIssuesItemLabelsPutRequestBodyMember3() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } else if m.GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3())) + for i, v := range m.GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } + return nil +} +// SetItemItemIssuesItemLabelsPutRequestBodyMember1 sets the ItemItemIssuesItemLabelsPutRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember1able +func (m *LabelsPutRequestBody) SetItemItemIssuesItemLabelsPutRequestBodyMember1(value ItemItemIssuesItemLabelsPutRequestBodyMember1able)() { + m.itemItemIssuesItemLabelsPutRequestBodyMember1 = value +} +// SetItemItemIssuesItemLabelsPutRequestBodyMember2 sets the ItemItemIssuesItemLabelsPutRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember2able +func (m *LabelsPutRequestBody) SetItemItemIssuesItemLabelsPutRequestBodyMember2(value ItemItemIssuesItemLabelsPutRequestBodyMember2able)() { + m.itemItemIssuesItemLabelsPutRequestBodyMember2 = value +} +// SetItemItemIssuesItemLabelsPutRequestBodyMember3 sets the ItemItemIssuesItemLabelsPutRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPutRequestBodyMember3able +func (m *LabelsPutRequestBody) SetItemItemIssuesItemLabelsPutRequestBodyMember3(value []ItemItemIssuesItemLabelsPutRequestBodyMember3able)() { + m.itemItemIssuesItemLabelsPutRequestBodyMember3 = value +} +// SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1 sets the ItemItemIssuesItemLabelsPutRequestBodyMember1 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember1able +func (m *LabelsPutRequestBody) SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1(value ItemItemIssuesItemLabelsPutRequestBodyMember1able)() { + m.labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1 = value +} +// SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2 sets the ItemItemIssuesItemLabelsPutRequestBodyMember2 property value. Composed type representation for type ItemItemIssuesItemLabelsPutRequestBodyMember2able +func (m *LabelsPutRequestBody) SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2(value ItemItemIssuesItemLabelsPutRequestBodyMember2able)() { + m.labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2 = value +} +// SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3 sets the ItemItemIssuesItemLabelsPutRequestBodyMember3 property value. Composed type representation for type []ItemItemIssuesItemLabelsPutRequestBodyMember3able +func (m *LabelsPutRequestBody) SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3(value []ItemItemIssuesItemLabelsPutRequestBodyMember3able)() { + m.labelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3 = value +} +// SetLabelsPutRequestBodyString sets the string property value. Composed type representation for type string +func (m *LabelsPutRequestBody) SetLabelsPutRequestBodyString(value *string)() { + m.labelsPutRequestBodyString = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *LabelsPutRequestBody) SetString(value *string)() { + m.string = value +} +type LabelsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemIssuesItemLabelsPostRequestBodyMember1()(ItemItemIssuesItemLabelsPostRequestBodyMember1able) + GetItemItemIssuesItemLabelsPostRequestBodyMember2()(ItemItemIssuesItemLabelsPostRequestBodyMember2able) + GetItemItemIssuesItemLabelsPostRequestBodyMember3()([]ItemItemIssuesItemLabelsPostRequestBodyMember3able) + GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1()(ItemItemIssuesItemLabelsPostRequestBodyMember1able) + GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2()(ItemItemIssuesItemLabelsPostRequestBodyMember2able) + GetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3()([]ItemItemIssuesItemLabelsPostRequestBodyMember3able) + GetLabelsPostRequestBodyString()(*string) + GetString()(*string) + SetItemItemIssuesItemLabelsPostRequestBodyMember1(value ItemItemIssuesItemLabelsPostRequestBodyMember1able)() + SetItemItemIssuesItemLabelsPostRequestBodyMember2(value ItemItemIssuesItemLabelsPostRequestBodyMember2able)() + SetItemItemIssuesItemLabelsPostRequestBodyMember3(value []ItemItemIssuesItemLabelsPostRequestBodyMember3able)() + SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember1(value ItemItemIssuesItemLabelsPostRequestBodyMember1able)() + SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember2(value ItemItemIssuesItemLabelsPostRequestBodyMember2able)() + SetLabelsPostRequestBodyItemItemIssuesItemLabelsPostRequestBodyMember3(value []ItemItemIssuesItemLabelsPostRequestBodyMember3able)() + SetLabelsPostRequestBodyString(value *string)() + SetString(value *string)() +} +type LabelsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemIssuesItemLabelsPutRequestBodyMember1()(ItemItemIssuesItemLabelsPutRequestBodyMember1able) + GetItemItemIssuesItemLabelsPutRequestBodyMember2()(ItemItemIssuesItemLabelsPutRequestBodyMember2able) + GetItemItemIssuesItemLabelsPutRequestBodyMember3()([]ItemItemIssuesItemLabelsPutRequestBodyMember3able) + GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1()(ItemItemIssuesItemLabelsPutRequestBodyMember1able) + GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2()(ItemItemIssuesItemLabelsPutRequestBodyMember2able) + GetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3()([]ItemItemIssuesItemLabelsPutRequestBodyMember3able) + GetLabelsPutRequestBodyString()(*string) + GetString()(*string) + SetItemItemIssuesItemLabelsPutRequestBodyMember1(value ItemItemIssuesItemLabelsPutRequestBodyMember1able)() + SetItemItemIssuesItemLabelsPutRequestBodyMember2(value ItemItemIssuesItemLabelsPutRequestBodyMember2able)() + SetItemItemIssuesItemLabelsPutRequestBodyMember3(value []ItemItemIssuesItemLabelsPutRequestBodyMember3able)() + SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember1(value ItemItemIssuesItemLabelsPutRequestBodyMember1able)() + SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember2(value ItemItemIssuesItemLabelsPutRequestBodyMember2able)() + SetLabelsPutRequestBodyItemItemIssuesItemLabelsPutRequestBodyMember3(value []ItemItemIssuesItemLabelsPutRequestBodyMember3able)() + SetLabelsPutRequestBodyString(value *string)() + SetString(value *string)() +} +// ByName gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.issues.item.labels.item collection +// returns a *ItemItemIssuesItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemItemIssuesItemLabelsRequestBuilder) ByName(name string)(*ItemItemIssuesItemLabelsWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemItemIssuesItemLabelsWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesItemLabelsRequestBuilderInternal instantiates a new ItemItemIssuesItemLabelsRequestBuilder and sets the default values. +func NewItemItemIssuesItemLabelsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemLabelsRequestBuilder) { + m := &ItemItemIssuesItemLabelsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/labels{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemIssuesItemLabelsRequestBuilder instantiates a new ItemItemIssuesItemLabelsRequestBuilder and sets the default values. +func NewItemItemIssuesItemLabelsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemLabelsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemLabelsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes all labels from an issue. +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/labels#remove-all-labels-from-an-issue +func (m *ItemItemIssuesItemLabelsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get lists all labels for an issue. +// returns a []Labelable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/labels#list-labels-for-an-issue +func (m *ItemItemIssuesItemLabelsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemLabelsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLabelFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable) + } + } + return val, nil +} +// Post adds labels to an issue. If you provide an empty array of labels, all labels are removed from the issue. +// returns a []Labelable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/labels#add-labels-to-an-issue +func (m *ItemItemIssuesItemLabelsRequestBuilder) Post(ctx context.Context, body LabelsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLabelFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable) + } + } + return val, nil +} +// Put removes any previous labels and sets the new labels for an issue. +// returns a []Labelable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/labels#set-labels-for-an-issue +func (m *ItemItemIssuesItemLabelsRequestBuilder) Put(ctx context.Context, body LabelsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLabelFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable) + } + } + return val, nil +} +// ToDeleteRequestInformation removes all labels from an issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemLabelsRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation lists all labels for an issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemLabelsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemLabelsRequestBuilderGetQueryParameters])(*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 adds labels to an issue. If you provide an empty array of labels, all labels are removed from the issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemLabelsRequestBuilder) ToPostRequestInformation(ctx context.Context, body LabelsPostRequestBodyable, 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 +} +// ToPutRequestInformation removes any previous labels and sets the new labels for an issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemLabelsRequestBuilder) ToPutRequestInformation(ctx context.Context, body LabelsPutRequestBodyable, 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 *ItemItemIssuesItemLabelsRequestBuilder when successful +func (m *ItemItemIssuesItemLabelsRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemLabelsRequestBuilder) { + return NewItemItemIssuesItemLabelsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_item_labels_with_name_item_request_builder.go b/pkg/github/repos/item_item_issues_item_labels_with_name_item_request_builder.go new file mode 100644 index 00000000..1bc56b74 --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_labels_with_name_item_request_builder.go @@ -0,0 +1,66 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemIssuesItemLabelsWithNameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\labels\{name} +type ItemItemIssuesItemLabelsWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemIssuesItemLabelsWithNameItemRequestBuilderInternal instantiates a new ItemItemIssuesItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemItemIssuesItemLabelsWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemLabelsWithNameItemRequestBuilder) { + m := &ItemItemIssuesItemLabelsWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/labels/{name}", pathParameters), + } + return m +} +// NewItemItemIssuesItemLabelsWithNameItemRequestBuilder instantiates a new ItemItemIssuesItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemItemIssuesItemLabelsWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemLabelsWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemLabelsWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist. +// returns a []Labelable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/labels#remove-a-label-from-an-issue +func (m *ItemItemIssuesItemLabelsWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLabelFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable) + } + } + return val, nil +} +// ToDeleteRequestInformation removes the specified label from the issue, and returns the remaining labels on the issue. This endpoint returns a `404 Not Found` status if the label does not exist. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemLabelsWithNameItemRequestBuilder) 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") + 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 *ItemItemIssuesItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemItemIssuesItemLabelsWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemLabelsWithNameItemRequestBuilder) { + return NewItemItemIssuesItemLabelsWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_item_lock_put_request_body.go b/pkg/github/repos/item_item_issues_item_lock_put_request_body.go new file mode 100644 index 00000000..9a8d2dbe --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_lock_put_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemLockPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemIssuesItemLockPutRequestBody instantiates a new ItemItemIssuesItemLockPutRequestBody and sets the default values. +func NewItemItemIssuesItemLockPutRequestBody()(*ItemItemIssuesItemLockPutRequestBody) { + m := &ItemItemIssuesItemLockPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemLockPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemLockPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemLockPutRequestBody(), 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 *ItemItemIssuesItemLockPutRequestBody) 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 *ItemItemIssuesItemLockPutRequestBody) 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 *ItemItemIssuesItemLockPutRequestBody) 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 *ItemItemIssuesItemLockPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemIssuesItemLockPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_issues_item_lock_request_builder.go b/pkg/github/repos/item_item_issues_item_lock_request_builder.go new file mode 100644 index 00000000..034703c2 --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_lock_request_builder.go @@ -0,0 +1,96 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemIssuesItemLockRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\lock +type ItemItemIssuesItemLockRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemIssuesItemLockRequestBuilderInternal instantiates a new ItemItemIssuesItemLockRequestBuilder and sets the default values. +func NewItemItemIssuesItemLockRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemLockRequestBuilder) { + m := &ItemItemIssuesItemLockRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/lock", pathParameters), + } + return m +} +// NewItemItemIssuesItemLockRequestBuilder instantiates a new ItemItemIssuesItemLockRequestBuilder and sets the default values. +func NewItemItemIssuesItemLockRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemLockRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemLockRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete users with push access can unlock an issue's conversation. +// 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/enterprise-server@3.14/rest/issues/issues#unlock-an-issue +func (m *ItemItemIssuesItemLockRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put users with push access can lock an issue or pull request's conversation.Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// 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 410 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/issues#lock-an-issue +func (m *ItemItemIssuesItemLockRequestBuilder) Put(ctx context.Context, body ItemItemIssuesItemLockPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation users with push access can unlock an issue's conversation. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemLockRequestBuilder) 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") + return requestInfo, nil +} +// ToPutRequestInformation users with push access can lock an issue or pull request's conversation.Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemLockRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemIssuesItemLockPutRequestBodyable, 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 *ItemItemIssuesItemLockRequestBuilder when successful +func (m *ItemItemIssuesItemLockRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemLockRequestBuilder) { + return NewItemItemIssuesItemLockRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_item_reactions_post_request_body.go b/pkg/github/repos/item_item_issues_item_reactions_post_request_body.go new file mode 100644 index 00000000..f0d00024 --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemIssuesItemReactionsPostRequestBody instantiates a new ItemItemIssuesItemReactionsPostRequestBody and sets the default values. +func NewItemItemIssuesItemReactionsPostRequestBody()(*ItemItemIssuesItemReactionsPostRequestBody) { + m := &ItemItemIssuesItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemReactionsPostRequestBody(), 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 *ItemItemIssuesItemReactionsPostRequestBody) 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 *ItemItemIssuesItemReactionsPostRequestBody) 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 *ItemItemIssuesItemReactionsPostRequestBody) 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 *ItemItemIssuesItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemIssuesItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_issues_item_reactions_request_builder.go b/pkg/github/repos/item_item_issues_item_reactions_request_builder.go new file mode 100644 index 00000000..33512e54 --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_reactions_request_builder.go @@ -0,0 +1,122 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i8a5daa8f7f9e57c6b4dc0d8983a565b7f182640fb87e4346a14aad4f65f0cf2e "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/issues/item/reactions" +) + +// ItemItemIssuesItemReactionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\reactions +type ItemItemIssuesItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesItemReactionsRequestBuilderGetQueryParameters list the reactions to an [issue](https://docs.github.com/enterprise-server@3.14/rest/issues/issues#get-an-issue). +type ItemItemIssuesItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to an issue. + Content *i8a5daa8f7f9e57c6b4dc0d8983a565b7f182640fb87e4346a14aad4f65f0cf2e.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReaction_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.issues.item.reactions.item collection +// returns a *ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemIssuesItemReactionsRequestBuilder) ByReaction_id(reaction_id int32)(*ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["reaction_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(reaction_id), 10) + return NewItemItemIssuesItemReactionsWithReaction_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesItemReactionsRequestBuilderInternal instantiates a new ItemItemIssuesItemReactionsRequestBuilder and sets the default values. +func NewItemItemIssuesItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemReactionsRequestBuilder) { + m := &ItemItemIssuesItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemIssuesItemReactionsRequestBuilder instantiates a new ItemItemIssuesItemReactionsRequestBuilder and sets the default values. +func NewItemItemIssuesItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the reactions to an [issue](https://docs.github.com/enterprise-server@3.14/rest/issues/issues#get-an-issue). +// returns a []Reactionable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-an-issue +func (m *ItemItemIssuesItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemReactionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable) + } + } + return val, nil +} +// Post create a reaction to an [issue](https://docs.github.com/enterprise-server@3.14/rest/issues/issues#get-an-issue). A response with an HTTP `200` status means that you already added the reaction type to this issue. +// returns a Reactionable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#create-reaction-for-an-issue +func (m *ItemItemIssuesItemReactionsRequestBuilder) Post(ctx context.Context, body ItemItemIssuesItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable), nil +} +// ToGetRequestInformation list the reactions to an [issue](https://docs.github.com/enterprise-server@3.14/rest/issues/issues#get-an-issue). +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemReactionsRequestBuilderGetQueryParameters])(*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 create a reaction to an [issue](https://docs.github.com/enterprise-server@3.14/rest/issues/issues#get-an-issue). A response with an HTTP `200` status means that you already added the reaction type to this issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemIssuesItemReactionsPostRequestBodyable, 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 *ItemItemIssuesItemReactionsRequestBuilder when successful +func (m *ItemItemIssuesItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemReactionsRequestBuilder) { + return NewItemItemIssuesItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_item_reactions_with_reaction_escaped_item_request_builder.go b/pkg/github/repos/item_item_issues_item_reactions_with_reaction_escaped_item_request_builder.go new file mode 100644 index 00000000..6acad45f --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_reactions_with_reaction_escaped_item_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\reactions\{reaction_id} +type ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemIssuesItemReactionsWithReaction_ItemRequestBuilderInternal instantiates a new ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesItemReactionsWithReaction_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder) { + m := &ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/reactions/{reaction_id}", pathParameters), + } + return m +} +// NewItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder instantiates a new ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemReactionsWithReaction_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!NOTE]> You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`.Delete a reaction to an [issue](https://docs.github.com/enterprise-server@3.14/rest/issues/issues#get-an-issue). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#delete-an-issue-reaction +func (m *ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation > [!NOTE]> You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/issues/:issue_number/reactions/:reaction_id`.Delete a reaction to an [issue](https://docs.github.com/enterprise-server@3.14/rest/issues/issues#get-an-issue). +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemReactionsWithReaction_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) + 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 *ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder) { + return NewItemItemIssuesItemReactionsWithReaction_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_item_timeline_request_builder.go b/pkg/github/repos/item_item_issues_item_timeline_request_builder.go new file mode 100644 index 00000000..e8b4c8d6 --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_timeline_request_builder.go @@ -0,0 +1,73 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemIssuesItemTimelineRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number}\timeline +type ItemItemIssuesItemTimelineRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesItemTimelineRequestBuilderGetQueryParameters list all timeline events for an issue. +type ItemItemIssuesItemTimelineRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemIssuesItemTimelineRequestBuilderInternal instantiates a new ItemItemIssuesItemTimelineRequestBuilder and sets the default values. +func NewItemItemIssuesItemTimelineRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemTimelineRequestBuilder) { + m := &ItemItemIssuesItemTimelineRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}/timeline{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemIssuesItemTimelineRequestBuilder instantiates a new ItemItemIssuesItemTimelineRequestBuilder and sets the default values. +func NewItemItemIssuesItemTimelineRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesItemTimelineRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesItemTimelineRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all timeline events for an issue. +// returns a []TimelineIssueEventsable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/timeline#list-timeline-events-for-an-issue +func (m *ItemItemIssuesItemTimelineRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemTimelineRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TimelineIssueEventsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTimelineIssueEventsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TimelineIssueEventsable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TimelineIssueEventsable) + } + } + return val, nil +} +// ToGetRequestInformation list all timeline events for an issue. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesItemTimelineRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesItemTimelineRequestBuilderGetQueryParameters])(*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 *ItemItemIssuesItemTimelineRequestBuilder when successful +func (m *ItemItemIssuesItemTimelineRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesItemTimelineRequestBuilder) { + return NewItemItemIssuesItemTimelineRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_item_with_issue_escaped_number_patch_request_body.go b/pkg/github/repos/item_item_issues_item_with_issue_escaped_number_patch_request_body.go new file mode 100644 index 00000000..237c669b --- /dev/null +++ b/pkg/github/repos/item_item_issues_item_with_issue_escaped_number_patch_request_body.go @@ -0,0 +1,425 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesItemWithIssue_numberPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Username to assign to this issue. **This field is deprecated.** + assignee *string + // Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. + assignees []string + // The contents of the issue. + body *string + // Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. + labels []string + // The milestone property + milestone ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable + // The title of the issue. + title ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable +} +// ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone composed type wrapper for classes int32, string +type ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone struct { + // Composed type representation for type int32 + integer *int32 + // Composed type representation for type string + string *string +} +// NewItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone instantiates a new ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone and sets the default values. +func NewItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone()(*ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) { + m := &ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone{ + } + return m +} +// CreateItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone() + 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.GetInt32Value(); val != nil { + if err != nil { + return nil, err + } + result.SetInteger(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetInteger gets the integer property value. Composed type representation for type int32 +// returns a *int32 when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) GetInteger()(*int32) { + return m.integer +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInteger() != nil { + err := writer.WriteInt32Value("", m.GetInteger()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetInteger sets the integer property value. Composed type representation for type int32 +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) SetInteger(value *int32)() { + m.integer = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestone) SetString(value *string)() { + m.string = value +} +// ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title composed type wrapper for classes int32, string +type ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title struct { + // Composed type representation for type int32 + integer *int32 + // Composed type representation for type string + string *string +} +// NewItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title instantiates a new ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title and sets the default values. +func NewItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title()(*ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) { + m := &ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title{ + } + return m +} +// CreateItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title() + 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.GetInt32Value(); val != nil { + if err != nil { + return nil, err + } + result.SetInteger(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetInteger gets the integer property value. Composed type representation for type int32 +// returns a *int32 when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) GetInteger()(*int32) { + return m.integer +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInteger() != nil { + err := writer.WriteInt32Value("", m.GetInteger()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetInteger sets the integer property value. Composed type representation for type int32 +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) SetInteger(value *int32)() { + m.integer = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_title) SetString(value *string)() { + m.string = value +} +type ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInteger()(*int32) + GetString()(*string) + SetInteger(value *int32)() + SetString(value *string)() +} +type ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInteger()(*int32) + GetString()(*string) + SetInteger(value *int32)() + SetString(value *string)() +} +// NewItemItemIssuesItemWithIssue_numberPatchRequestBody instantiates a new ItemItemIssuesItemWithIssue_numberPatchRequestBody and sets the default values. +func NewItemItemIssuesItemWithIssue_numberPatchRequestBody()(*ItemItemIssuesItemWithIssue_numberPatchRequestBody) { + m := &ItemItemIssuesItemWithIssue_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesItemWithIssue_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesItemWithIssue_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesItemWithIssue_numberPatchRequestBody(), 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 *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. Username to assign to this issue. **This field is deprecated.** +// returns a *string when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetAssignee()(*string) { + return m.assignee +} +// GetAssignees gets the assignees property value. Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. +// returns a []string when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetAssignees()([]string) { + return m.assignees +} +// GetBody gets the body property value. The contents of the issue. +// returns a *string when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val) + } + return nil + } + res["assignees"] = 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.SetAssignees(res) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["labels"] = 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.SetLabels(res) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable)) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTitle(val.(ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable)) + } + return nil + } + return res +} +// GetLabels gets the labels property value. Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. +// returns a []string when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetLabels()([]string) { + return m.labels +} +// GetMilestone gets the milestone property value. The milestone property +// returns a ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetMilestone()(ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable) { + return m.milestone +} +// GetTitle gets the title property value. The title of the issue. +// returns a ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable when successful +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) GetTitle()(ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + if m.GetAssignees() != nil { + err := writer.WriteCollectionOfStringValues("assignees", m.GetAssignees()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("title", m.GetTitle()) + 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 *ItemItemIssuesItemWithIssue_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. Username to assign to this issue. **This field is deprecated.** +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) SetAssignee(value *string)() { + m.assignee = value +} +// SetAssignees sets the assignees property value. Usernames to assign to this issue. Pass one or more user logins to _replace_ the set of assignees on this issue. Send an empty array (`[]`) to clear all assignees from the issue. Only users with push access can set assignees for new issues. Without push access to the repository, assignee changes are silently dropped. +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) SetAssignees(value []string)() { + m.assignees = value +} +// SetBody sets the body property value. The contents of the issue. +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) SetBody(value *string)() { + m.body = value +} +// SetLabels sets the labels property value. Labels to associate with this issue. Pass one or more labels to _replace_ the set of labels on this issue. Send an empty array (`[]`) to clear all labels from the issue. Only users with push access can set labels for issues. Without push access to the repository, label changes are silently dropped. +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) SetLabels(value []string)() { + m.labels = value +} +// SetMilestone sets the milestone property value. The milestone property +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) SetMilestone(value ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable)() { + m.milestone = value +} +// SetTitle sets the title property value. The title of the issue. +func (m *ItemItemIssuesItemWithIssue_numberPatchRequestBody) SetTitle(value ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable)() { + m.title = value +} +type ItemItemIssuesItemWithIssue_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignee()(*string) + GetAssignees()([]string) + GetBody()(*string) + GetLabels()([]string) + GetMilestone()(ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable) + GetTitle()(ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable) + SetAssignee(value *string)() + SetAssignees(value []string)() + SetBody(value *string)() + SetLabels(value []string)() + SetMilestone(value ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_milestoneable)() + SetTitle(value ItemItemIssuesItemWithIssue_numberPatchRequestBody_WithIssue_numberPatchRequestBody_titleable)() +} diff --git a/pkg/github/repos/item_item_issues_post_request_body.go b/pkg/github/repos/item_item_issues_post_request_body.go new file mode 100644 index 00000000..cb506427 --- /dev/null +++ b/pkg/github/repos/item_item_issues_post_request_body.go @@ -0,0 +1,425 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemIssuesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ + assignee *string + // Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ + assignees []string + // The contents of the issue. + body *string + // Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ + labels []string + // The milestone property + milestone ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable + // The title of the issue. + title ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable +} +// ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone composed type wrapper for classes int32, string +type ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone struct { + // Composed type representation for type int32 + integer *int32 + // Composed type representation for type string + string *string +} +// NewItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone instantiates a new ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone and sets the default values. +func NewItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone()(*ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) { + m := &ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone{ + } + return m +} +// CreateItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone() + 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.GetInt32Value(); val != nil { + if err != nil { + return nil, err + } + result.SetInteger(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetInteger gets the integer property value. Composed type representation for type int32 +// returns a *int32 when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) GetInteger()(*int32) { + return m.integer +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInteger() != nil { + err := writer.WriteInt32Value("", m.GetInteger()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetInteger sets the integer property value. Composed type representation for type int32 +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) SetInteger(value *int32)() { + m.integer = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestone) SetString(value *string)() { + m.string = value +} +// ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title composed type wrapper for classes int32, string +type ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title struct { + // Composed type representation for type int32 + integer *int32 + // Composed type representation for type string + string *string +} +// NewItemItemIssuesPostRequestBody_IssuesPostRequestBody_title instantiates a new ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title and sets the default values. +func NewItemItemIssuesPostRequestBody_IssuesPostRequestBody_title()(*ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) { + m := &ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title{ + } + return m +} +// CreateItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewItemItemIssuesPostRequestBody_IssuesPostRequestBody_title() + 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.GetInt32Value(); val != nil { + if err != nil { + return nil, err + } + result.SetInteger(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + return make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) +} +// GetInteger gets the integer property value. Composed type representation for type int32 +// returns a *int32 when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) GetInteger()(*int32) { + return m.integer +} +// GetIsComposedType determines if the current object is a wrapper around a composed type +// returns a bool when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInteger() != nil { + err := writer.WriteInt32Value("", m.GetInteger()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetInteger sets the integer property value. Composed type representation for type int32 +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) SetInteger(value *int32)() { + m.integer = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ItemItemIssuesPostRequestBody_IssuesPostRequestBody_title) SetString(value *string)() { + m.string = value +} +type ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInteger()(*int32) + GetString()(*string) + SetInteger(value *int32)() + SetString(value *string)() +} +type ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInteger()(*int32) + GetString()(*string) + SetInteger(value *int32)() + SetString(value *string)() +} +// NewItemItemIssuesPostRequestBody instantiates a new ItemItemIssuesPostRequestBody and sets the default values. +func NewItemItemIssuesPostRequestBody()(*ItemItemIssuesPostRequestBody) { + m := &ItemItemIssuesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemIssuesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemIssuesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemIssuesPostRequestBody(), 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 *ItemItemIssuesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAssignee gets the assignee property value. Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ +// returns a *string when successful +func (m *ItemItemIssuesPostRequestBody) GetAssignee()(*string) { + return m.assignee +} +// GetAssignees gets the assignees property value. Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ +// returns a []string when successful +func (m *ItemItemIssuesPostRequestBody) GetAssignees()([]string) { + return m.assignees +} +// GetBody gets the body property value. The contents of the issue. +// returns a *string when successful +func (m *ItemItemIssuesPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemIssuesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["assignee"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAssignee(val) + } + return nil + } + res["assignees"] = 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.SetAssignees(res) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["labels"] = 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.SetLabels(res) + } + return nil + } + res["milestone"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetMilestone(val.(ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable)) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetTitle(val.(ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable)) + } + return nil + } + return res +} +// GetLabels gets the labels property value. Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ +// returns a []string when successful +func (m *ItemItemIssuesPostRequestBody) GetLabels()([]string) { + return m.labels +} +// GetMilestone gets the milestone property value. The milestone property +// returns a ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable when successful +func (m *ItemItemIssuesPostRequestBody) GetMilestone()(ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable) { + return m.milestone +} +// GetTitle gets the title property value. The title of the issue. +// returns a ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable when successful +func (m *ItemItemIssuesPostRequestBody) GetTitle()(ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemItemIssuesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("assignee", m.GetAssignee()) + if err != nil { + return err + } + } + if m.GetAssignees() != nil { + err := writer.WriteCollectionOfStringValues("assignees", m.GetAssignees()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + if m.GetLabels() != nil { + err := writer.WriteCollectionOfStringValues("labels", m.GetLabels()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("milestone", m.GetMilestone()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("title", m.GetTitle()) + 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 *ItemItemIssuesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAssignee sets the assignee property value. Login for the user that this issue should be assigned to. _NOTE: Only users with push access can set the assignee for new issues. The assignee is silently dropped otherwise. **This field is deprecated.**_ +func (m *ItemItemIssuesPostRequestBody) SetAssignee(value *string)() { + m.assignee = value +} +// SetAssignees sets the assignees property value. Logins for Users to assign to this issue. _NOTE: Only users with push access can set assignees for new issues. Assignees are silently dropped otherwise._ +func (m *ItemItemIssuesPostRequestBody) SetAssignees(value []string)() { + m.assignees = value +} +// SetBody sets the body property value. The contents of the issue. +func (m *ItemItemIssuesPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetLabels sets the labels property value. Labels to associate with this issue. _NOTE: Only users with push access can set labels for new issues. Labels are silently dropped otherwise._ +func (m *ItemItemIssuesPostRequestBody) SetLabels(value []string)() { + m.labels = value +} +// SetMilestone sets the milestone property value. The milestone property +func (m *ItemItemIssuesPostRequestBody) SetMilestone(value ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable)() { + m.milestone = value +} +// SetTitle sets the title property value. The title of the issue. +func (m *ItemItemIssuesPostRequestBody) SetTitle(value ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable)() { + m.title = value +} +type ItemItemIssuesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAssignee()(*string) + GetAssignees()([]string) + GetBody()(*string) + GetLabels()([]string) + GetMilestone()(ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable) + GetTitle()(ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable) + SetAssignee(value *string)() + SetAssignees(value []string)() + SetBody(value *string)() + SetLabels(value []string)() + SetMilestone(value ItemItemIssuesPostRequestBody_IssuesPostRequestBody_milestoneable)() + SetTitle(value ItemItemIssuesPostRequestBody_IssuesPostRequestBody_titleable)() +} diff --git a/pkg/github/repos/item_item_issues_request_builder.go b/pkg/github/repos/item_item_issues_request_builder.go new file mode 100644 index 00000000..72e2b1cd --- /dev/null +++ b/pkg/github/repos/item_item_issues_request_builder.go @@ -0,0 +1,159 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i7e4c62d8268966954a5c0ac9afd824b3b6979d9f8715928af4b65a3e87a07c54 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/issues" +) + +// ItemItemIssuesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues +type ItemItemIssuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemIssuesRequestBuilderGetQueryParameters list issues in a repository. Only open issues will be listed.> [!NOTE]> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemIssuesRequestBuilderGetQueryParameters struct { + // Can be the name of a user. Pass in `none` for issues with no assigned user, and `*` for issues assigned to any user. + Assignee *string `uriparametername:"assignee"` + // The user that created the issue. + Creator *string `uriparametername:"creator"` + // The direction to sort the results by. + Direction *i7e4c62d8268966954a5c0ac9afd824b3b6979d9f8715928af4b65a3e87a07c54.GetDirectionQueryParameterType `uriparametername:"direction"` + // A list of comma separated label names. Example: `bug,ui,@high` + Labels *string `uriparametername:"labels"` + // A user that's mentioned in the issue. + Mentioned *string `uriparametername:"mentioned"` + // If an `integer` is passed, it should refer to a milestone by its `number` field. If the string `*` is passed, issues with any milestone are accepted. If the string `none` is passed, issues without milestones are returned. + Milestone *string `uriparametername:"milestone"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // What to sort results by. + Sort *i7e4c62d8268966954a5c0ac9afd824b3b6979d9f8715928af4b65a3e87a07c54.GetSortQueryParameterType `uriparametername:"sort"` + // Indicates the state of the issues to return. + State *i7e4c62d8268966954a5c0ac9afd824b3b6979d9f8715928af4b65a3e87a07c54.GetStateQueryParameterType `uriparametername:"state"` +} +// ByIssue_number gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.issues.item collection +// returns a *ItemItemIssuesWithIssue_numberItemRequestBuilder when successful +func (m *ItemItemIssuesRequestBuilder) ByIssue_number(issue_number int32)(*ItemItemIssuesWithIssue_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["issue_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(issue_number), 10) + return NewItemItemIssuesWithIssue_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemItemIssuesCommentsRequestBuilder when successful +func (m *ItemItemIssuesRequestBuilder) Comments()(*ItemItemIssuesCommentsRequestBuilder) { + return NewItemItemIssuesCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesRequestBuilderInternal instantiates a new ItemItemIssuesRequestBuilder and sets the default values. +func NewItemItemIssuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesRequestBuilder) { + m := &ItemItemIssuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues{?assignee*,creator*,direction*,labels*,mentioned*,milestone*,page*,per_page*,since*,sort*,state*}", pathParameters), + } + return m +} +// NewItemItemIssuesRequestBuilder instantiates a new ItemItemIssuesRequestBuilder and sets the default values. +func NewItemItemIssuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Events the events property +// returns a *ItemItemIssuesEventsRequestBuilder when successful +func (m *ItemItemIssuesRequestBuilder) Events()(*ItemItemIssuesEventsRequestBuilder) { + return NewItemItemIssuesEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get list issues in a repository. Only open issues will be listed.> [!NOTE]> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []Issueable 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/enterprise-server@3.14/rest/issues/issues#list-repository-issues +func (m *ItemItemIssuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable) + } + } + return val, nil +} +// Post any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://docs.github.com/enterprise-server@3.14/articles/disabling-issues/), the API returns a `410 Gone` status.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a Issueable 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 BasicError error when the service returns a 410 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a Issue503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/issues#create-an-issue +func (m *ItemItemIssuesRequestBuilder) Post(ctx context.Context, body ItemItemIssuesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssue503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable), nil +} +// ToGetRequestInformation list issues in a repository. Only open issues will be listed.> [!NOTE]> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemIssuesRequestBuilderGetQueryParameters])(*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 any user with pull access to a repository can create an issue. If [issues are disabled in the repository](https://docs.github.com/enterprise-server@3.14/articles/disabling-issues/), the API returns a `410 Gone` status.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemIssuesPostRequestBodyable, 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 *ItemItemIssuesRequestBuilder when successful +func (m *ItemItemIssuesRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesRequestBuilder) { + return NewItemItemIssuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_issues_with_issue_escaped_number_item_request_builder.go b/pkg/github/repos/item_item_issues_with_issue_escaped_number_item_request_builder.go new file mode 100644 index 00000000..4bf348bb --- /dev/null +++ b/pkg/github/repos/item_item_issues_with_issue_escaped_number_item_request_builder.go @@ -0,0 +1,141 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemIssuesWithIssue_numberItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\issues\{issue_number} +type ItemItemIssuesWithIssue_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Assignees the assignees property +// returns a *ItemItemIssuesItemAssigneesRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Assignees()(*ItemItemIssuesItemAssigneesRequestBuilder) { + return NewItemItemIssuesItemAssigneesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemItemIssuesItemCommentsRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Comments()(*ItemItemIssuesItemCommentsRequestBuilder) { + return NewItemItemIssuesItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemIssuesWithIssue_numberItemRequestBuilderInternal instantiates a new ItemItemIssuesWithIssue_numberItemRequestBuilder and sets the default values. +func NewItemItemIssuesWithIssue_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesWithIssue_numberItemRequestBuilder) { + m := &ItemItemIssuesWithIssue_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/issues/{issue_number}", pathParameters), + } + return m +} +// NewItemItemIssuesWithIssue_numberItemRequestBuilder instantiates a new ItemItemIssuesWithIssue_numberItemRequestBuilder and sets the default values. +func NewItemItemIssuesWithIssue_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemIssuesWithIssue_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemIssuesWithIssue_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Events the events property +// returns a *ItemItemIssuesItemEventsRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Events()(*ItemItemIssuesItemEventsRequestBuilder) { + return NewItemItemIssuesItemEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get the API returns a [`301 Moved Permanently` status](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api#follow-redirects) if the issue was[transferred](https://docs.github.com/enterprise-server@3.14/articles/transferring-an-issue-to-another-repository/) to another repository. Ifthe issue was transferred to or deleted from a repository where the authenticated user lacks read access, the APIreturns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has readaccess, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribeto the [`issues`](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#issues) webhook.> [!NOTE]> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a Issueable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 410 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/issues#get-an-issue +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable), nil +} +// Labels the labels property +// returns a *ItemItemIssuesItemLabelsRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Labels()(*ItemItemIssuesItemLabelsRequestBuilder) { + return NewItemItemIssuesItemLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Lock the lock property +// returns a *ItemItemIssuesItemLockRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Lock()(*ItemItemIssuesItemLockRequestBuilder) { + return NewItemItemIssuesItemLockRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch issue owners and users with push access can edit an issue.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a Issueable 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 410 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a Issue503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/issues#update-an-issue +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Patch(ctx context.Context, body ItemItemIssuesItemWithIssue_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssue503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable), nil +} +// Reactions the reactions property +// returns a *ItemItemIssuesItemReactionsRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Reactions()(*ItemItemIssuesItemReactionsRequestBuilder) { + return NewItemItemIssuesItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Timeline the timeline property +// returns a *ItemItemIssuesItemTimelineRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) Timeline()(*ItemItemIssuesItemTimelineRequestBuilder) { + return NewItemItemIssuesItemTimelineRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation the API returns a [`301 Moved Permanently` status](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api#follow-redirects) if the issue was[transferred](https://docs.github.com/enterprise-server@3.14/articles/transferring-an-issue-to-another-repository/) to another repository. Ifthe issue was transferred to or deleted from a repository where the authenticated user lacks read access, the APIreturns a `404 Not Found` status. If the issue was deleted from a repository where the authenticated user has readaccess, the API returns a `410 Gone` status. To receive webhook events for transferred and deleted issues, subscribeto the [`issues`](https://docs.github.com/enterprise-server@3.14/webhooks/event-payloads/#issues) webhook.> [!NOTE]> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) 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 issue owners and users with push access can edit an issue.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemIssuesItemWithIssue_numberPatchRequestBodyable, 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 *ItemItemIssuesWithIssue_numberItemRequestBuilder when successful +func (m *ItemItemIssuesWithIssue_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemIssuesWithIssue_numberItemRequestBuilder) { + return NewItemItemIssuesWithIssue_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_keys_post_request_body.go b/pkg/github/repos/item_item_keys_post_request_body.go new file mode 100644 index 00000000..fb0208ac --- /dev/null +++ b/pkg/github/repos/item_item_keys_post_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemKeysPostRequestBody 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 contents of the key. + key *string + // If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "[Repository permission levels for an organization](https://docs.github.com/enterprise-server@3.14/articles/repository-permission-levels-for-an-organization/)" and "[Permission levels for a user account repository](https://docs.github.com/enterprise-server@3.14/articles/permission-levels-for-a-user-account-repository/)." + read_only *bool + // A name for the key. + title *string +} +// NewItemItemKeysPostRequestBody instantiates a new ItemItemKeysPostRequestBody and sets the default values. +func NewItemItemKeysPostRequestBody()(*ItemItemKeysPostRequestBody) { + m := &ItemItemKeysPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemKeysPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemKeysPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemKeysPostRequestBody(), 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 *ItemItemKeysPostRequestBody) 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 *ItemItemKeysPostRequestBody) 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["read_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetReadOnly(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The contents of the key. +// returns a *string when successful +func (m *ItemItemKeysPostRequestBody) GetKey()(*string) { + return m.key +} +// GetReadOnly gets the read_only property value. If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "[Repository permission levels for an organization](https://docs.github.com/enterprise-server@3.14/articles/repository-permission-levels-for-an-organization/)" and "[Permission levels for a user account repository](https://docs.github.com/enterprise-server@3.14/articles/permission-levels-for-a-user-account-repository/)." +// returns a *bool when successful +func (m *ItemItemKeysPostRequestBody) GetReadOnly()(*bool) { + return m.read_only +} +// GetTitle gets the title property value. A name for the key. +// returns a *string when successful +func (m *ItemItemKeysPostRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemItemKeysPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("read_only", m.GetReadOnly()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemItemKeysPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The contents of the key. +func (m *ItemItemKeysPostRequestBody) SetKey(value *string)() { + m.key = value +} +// SetReadOnly sets the read_only property value. If `true`, the key will only be able to read repository contents. Otherwise, the key will be able to read and write. Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. For more information, see "[Repository permission levels for an organization](https://docs.github.com/enterprise-server@3.14/articles/repository-permission-levels-for-an-organization/)" and "[Permission levels for a user account repository](https://docs.github.com/enterprise-server@3.14/articles/permission-levels-for-a-user-account-repository/)." +func (m *ItemItemKeysPostRequestBody) SetReadOnly(value *bool)() { + m.read_only = value +} +// SetTitle sets the title property value. A name for the key. +func (m *ItemItemKeysPostRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemItemKeysPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetReadOnly()(*bool) + GetTitle()(*string) + SetKey(value *string)() + SetReadOnly(value *bool)() + SetTitle(value *string)() +} diff --git a/pkg/github/repos/item_item_keys_request_builder.go b/pkg/github/repos/item_item_keys_request_builder.go new file mode 100644 index 00000000..98814d7c --- /dev/null +++ b/pkg/github/repos/item_item_keys_request_builder.go @@ -0,0 +1,112 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemKeysRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\keys +type ItemItemKeysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemKeysRequestBuilderGetQueryParameters list deploy keys +type ItemItemKeysRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByKey_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.keys.item collection +// returns a *ItemItemKeysWithKey_ItemRequestBuilder when successful +func (m *ItemItemKeysRequestBuilder) ByKey_id(key_id int32)(*ItemItemKeysWithKey_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["key_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(key_id), 10) + return NewItemItemKeysWithKey_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemKeysRequestBuilderInternal instantiates a new ItemItemKeysRequestBuilder and sets the default values. +func NewItemItemKeysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemKeysRequestBuilder) { + m := &ItemItemKeysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/keys{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemKeysRequestBuilder instantiates a new ItemItemKeysRequestBuilder and sets the default values. +func NewItemItemKeysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemKeysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemKeysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list deploy keys +// returns a []DeployKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deploy-keys/deploy-keys#list-deploy-keys +func (m *ItemItemKeysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemKeysRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeployKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeployKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeployKeyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeployKeyable) + } + } + return val, nil +} +// Post you can create a read-only deploy key. +// returns a DeployKeyable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deploy-keys/deploy-keys#create-a-deploy-key +func (m *ItemItemKeysRequestBuilder) Post(ctx context.Context, body ItemItemKeysPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeployKeyable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeployKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeployKeyable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemKeysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemKeysRequestBuilderGetQueryParameters])(*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 you can create a read-only deploy key. +// returns a *RequestInformation when successful +func (m *ItemItemKeysRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemKeysPostRequestBodyable, 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 *ItemItemKeysRequestBuilder when successful +func (m *ItemItemKeysRequestBuilder) WithUrl(rawUrl string)(*ItemItemKeysRequestBuilder) { + return NewItemItemKeysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_keys_with_key_escaped_item_request_builder.go b/pkg/github/repos/item_item_keys_with_key_escaped_item_request_builder.go new file mode 100644 index 00000000..f80cbdfb --- /dev/null +++ b/pkg/github/repos/item_item_keys_with_key_escaped_item_request_builder.go @@ -0,0 +1,82 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemKeysWithKey_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\keys\{key_id} +type ItemItemKeysWithKey_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemKeysWithKey_ItemRequestBuilderInternal instantiates a new ItemItemKeysWithKey_ItemRequestBuilder and sets the default values. +func NewItemItemKeysWithKey_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemKeysWithKey_ItemRequestBuilder) { + m := &ItemItemKeysWithKey_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/keys/{key_id}", pathParameters), + } + return m +} +// NewItemItemKeysWithKey_ItemRequestBuilder instantiates a new ItemItemKeysWithKey_ItemRequestBuilder and sets the default values. +func NewItemItemKeysWithKey_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemKeysWithKey_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemKeysWithKey_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deploy-keys/deploy-keys#delete-a-deploy-key +func (m *ItemItemKeysWithKey_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get get a deploy key +// returns a DeployKeyable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/deploy-keys/deploy-keys#get-a-deploy-key +func (m *ItemItemKeysWithKey_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeployKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDeployKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DeployKeyable), nil +} +// ToDeleteRequestInformation deploy keys are immutable. If you need to update a key, remove the key and create a new one instead. +// returns a *RequestInformation when successful +func (m *ItemItemKeysWithKey_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) + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ItemItemKeysWithKey_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemKeysWithKey_ItemRequestBuilder when successful +func (m *ItemItemKeysWithKey_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemKeysWithKey_ItemRequestBuilder) { + return NewItemItemKeysWithKey_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_labels_item_with_name_patch_request_body.go b/pkg/github/repos/item_item_labels_item_with_name_patch_request_body.go new file mode 100644 index 00000000..3b1e16a5 --- /dev/null +++ b/pkg/github/repos/item_item_labels_item_with_name_patch_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemLabelsItemWithNamePatchRequestBody 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 [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. + color *string + // A short description of the label. Must be 100 characters or fewer. + description *string + // The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." + new_name *string +} +// NewItemItemLabelsItemWithNamePatchRequestBody instantiates a new ItemItemLabelsItemWithNamePatchRequestBody and sets the default values. +func NewItemItemLabelsItemWithNamePatchRequestBody()(*ItemItemLabelsItemWithNamePatchRequestBody) { + m := &ItemItemLabelsItemWithNamePatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemLabelsItemWithNamePatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemLabelsItemWithNamePatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemLabelsItemWithNamePatchRequestBody(), 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 *ItemItemLabelsItemWithNamePatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. +// returns a *string when successful +func (m *ItemItemLabelsItemWithNamePatchRequestBody) GetColor()(*string) { + return m.color +} +// GetDescription gets the description property value. A short description of the label. Must be 100 characters or fewer. +// returns a *string when successful +func (m *ItemItemLabelsItemWithNamePatchRequestBody) 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 *ItemItemLabelsItemWithNamePatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + 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["new_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNewName(val) + } + return nil + } + return res +} +// GetNewName gets the new_name property value. The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." +// returns a *string when successful +func (m *ItemItemLabelsItemWithNamePatchRequestBody) GetNewName()(*string) { + return m.new_name +} +// Serialize serializes information the current object +func (m *ItemItemLabelsItemWithNamePatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("new_name", m.GetNewName()) + 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 *ItemItemLabelsItemWithNamePatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. +func (m *ItemItemLabelsItemWithNamePatchRequestBody) SetColor(value *string)() { + m.color = value +} +// SetDescription sets the description property value. A short description of the label. Must be 100 characters or fewer. +func (m *ItemItemLabelsItemWithNamePatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetNewName sets the new_name property value. The new name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." +func (m *ItemItemLabelsItemWithNamePatchRequestBody) SetNewName(value *string)() { + m.new_name = value +} +type ItemItemLabelsItemWithNamePatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetDescription()(*string) + GetNewName()(*string) + SetColor(value *string)() + SetDescription(value *string)() + SetNewName(value *string)() +} diff --git a/pkg/github/repos/item_item_labels_post_request_body.go b/pkg/github/repos/item_item_labels_post_request_body.go new file mode 100644 index 00000000..aced5da3 --- /dev/null +++ b/pkg/github/repos/item_item_labels_post_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemLabelsPostRequestBody 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 [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. + color *string + // A short description of the label. Must be 100 characters or fewer. + description *string + // The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." + name *string +} +// NewItemItemLabelsPostRequestBody instantiates a new ItemItemLabelsPostRequestBody and sets the default values. +func NewItemItemLabelsPostRequestBody()(*ItemItemLabelsPostRequestBody) { + m := &ItemItemLabelsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemLabelsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemLabelsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemLabelsPostRequestBody(), 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 *ItemItemLabelsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetColor gets the color property value. The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. +// returns a *string when successful +func (m *ItemItemLabelsPostRequestBody) GetColor()(*string) { + return m.color +} +// GetDescription gets the description property value. A short description of the label. Must be 100 characters or fewer. +// returns a *string when successful +func (m *ItemItemLabelsPostRequestBody) 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 *ItemItemLabelsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["color"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetColor(val) + } + 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 label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." +// returns a *string when successful +func (m *ItemItemLabelsPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemLabelsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("color", m.GetColor()) + 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 + } + } + { + 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 *ItemItemLabelsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetColor sets the color property value. The [hexadecimal color code](http://www.color-hex.com/) for the label, without the leading `#`. +func (m *ItemItemLabelsPostRequestBody) SetColor(value *string)() { + m.color = value +} +// SetDescription sets the description property value. A short description of the label. Must be 100 characters or fewer. +func (m *ItemItemLabelsPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name of the label. Emoji can be added to label names, using either native emoji or colon-style markup. For example, typing `:strawberry:` will render the emoji ![:strawberry:](https://github.githubassets.com/images/icons/emoji/unicode/1f353.png ":strawberry:"). For a full list of available emoji and codes, see "[Emoji cheat sheet](https://github.com/ikatyang/emoji-cheat-sheet)." +func (m *ItemItemLabelsPostRequestBody) SetName(value *string)() { + m.name = value +} +type ItemItemLabelsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetColor()(*string) + GetDescription()(*string) + GetName()(*string) + SetColor(value *string)() + SetDescription(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/repos/item_item_labels_request_builder.go b/pkg/github/repos/item_item_labels_request_builder.go new file mode 100644 index 00000000..2bdc6210 --- /dev/null +++ b/pkg/github/repos/item_item_labels_request_builder.go @@ -0,0 +1,120 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemLabelsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\labels +type ItemItemLabelsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemLabelsRequestBuilderGetQueryParameters lists all labels for a repository. +type ItemItemLabelsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByName gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.labels.item collection +// returns a *ItemItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemItemLabelsRequestBuilder) ByName(name string)(*ItemItemLabelsWithNameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if name != "" { + urlTplParams["name"] = name + } + return NewItemItemLabelsWithNameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemLabelsRequestBuilderInternal instantiates a new ItemItemLabelsRequestBuilder and sets the default values. +func NewItemItemLabelsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLabelsRequestBuilder) { + m := &ItemItemLabelsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/labels{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemLabelsRequestBuilder instantiates a new ItemItemLabelsRequestBuilder and sets the default values. +func NewItemItemLabelsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLabelsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemLabelsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all labels for a repository. +// returns a []Labelable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/labels#list-labels-for-a-repository +func (m *ItemItemLabelsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemLabelsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLabelFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable) + } + } + return val, nil +} +// Post creates a label for the specified repository with the given name and color. The name and color parameters are required. The color must be a valid [hexadecimal color code](http://www.color-hex.com/). +// returns a Labelable 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/enterprise-server@3.14/rest/issues/labels#create-a-label +func (m *ItemItemLabelsRequestBuilder) Post(ctx context.Context, body ItemItemLabelsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLabelFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable), nil +} +// ToGetRequestInformation lists all labels for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemLabelsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemLabelsRequestBuilderGetQueryParameters])(*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 label for the specified repository with the given name and color. The name and color parameters are required. The color must be a valid [hexadecimal color code](http://www.color-hex.com/). +// returns a *RequestInformation when successful +func (m *ItemItemLabelsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemLabelsPostRequestBodyable, 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 *ItemItemLabelsRequestBuilder when successful +func (m *ItemItemLabelsRequestBuilder) WithUrl(rawUrl string)(*ItemItemLabelsRequestBuilder) { + return NewItemItemLabelsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_labels_with_name_item_request_builder.go b/pkg/github/repos/item_item_labels_with_name_item_request_builder.go new file mode 100644 index 00000000..c75d9216 --- /dev/null +++ b/pkg/github/repos/item_item_labels_with_name_item_request_builder.go @@ -0,0 +1,114 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemLabelsWithNameItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\labels\{name} +type ItemItemLabelsWithNameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemLabelsWithNameItemRequestBuilderInternal instantiates a new ItemItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemItemLabelsWithNameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLabelsWithNameItemRequestBuilder) { + m := &ItemItemLabelsWithNameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/labels/{name}", pathParameters), + } + return m +} +// NewItemItemLabelsWithNameItemRequestBuilder instantiates a new ItemItemLabelsWithNameItemRequestBuilder and sets the default values. +func NewItemItemLabelsWithNameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLabelsWithNameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemLabelsWithNameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a label using the given label name. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/labels#delete-a-label +func (m *ItemItemLabelsWithNameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a label using the given name. +// returns a Labelable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/labels#get-a-label +func (m *ItemItemLabelsWithNameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLabelFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable), nil +} +// Patch updates a label using the given label name. +// returns a Labelable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/labels#update-a-label +func (m *ItemItemLabelsWithNameItemRequestBuilder) Patch(ctx context.Context, body ItemItemLabelsItemWithNamePatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLabelFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable), nil +} +// ToDeleteRequestInformation deletes a label using the given label name. +// returns a *RequestInformation when successful +func (m *ItemItemLabelsWithNameItemRequestBuilder) 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 +} +// ToGetRequestInformation gets a label using the given name. +// returns a *RequestInformation when successful +func (m *ItemItemLabelsWithNameItemRequestBuilder) 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 label using the given label name. +// returns a *RequestInformation when successful +func (m *ItemItemLabelsWithNameItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemLabelsItemWithNamePatchRequestBodyable, 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 *ItemItemLabelsWithNameItemRequestBuilder when successful +func (m *ItemItemLabelsWithNameItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemLabelsWithNameItemRequestBuilder) { + return NewItemItemLabelsWithNameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_languages_request_builder.go b/pkg/github/repos/item_item_languages_request_builder.go new file mode 100644 index 00000000..3bffe7a5 --- /dev/null +++ b/pkg/github/repos/item_item_languages_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemLanguagesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\languages +type ItemItemLanguagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemLanguagesRequestBuilderInternal instantiates a new ItemItemLanguagesRequestBuilder and sets the default values. +func NewItemItemLanguagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLanguagesRequestBuilder) { + m := &ItemItemLanguagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/languages", pathParameters), + } + return m +} +// NewItemItemLanguagesRequestBuilder instantiates a new ItemItemLanguagesRequestBuilder and sets the default values. +func NewItemItemLanguagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLanguagesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemLanguagesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language. +// returns a Languageable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#list-repository-languages +func (m *ItemItemLanguagesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Languageable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLanguageFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Languageable), nil +} +// ToGetRequestInformation lists languages for the specified repository. The value shown for each language is the number of bytes of code written in that language. +// returns a *RequestInformation when successful +func (m *ItemItemLanguagesRequestBuilder) 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 *ItemItemLanguagesRequestBuilder when successful +func (m *ItemItemLanguagesRequestBuilder) WithUrl(rawUrl string)(*ItemItemLanguagesRequestBuilder) { + return NewItemItemLanguagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_lfs_put_response.go b/pkg/github/repos/item_item_lfs_put_response.go new file mode 100644 index 00000000..b3a8edee --- /dev/null +++ b/pkg/github/repos/item_item_lfs_put_response.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemLfsPutResponse struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemLfsPutResponse instantiates a new ItemItemLfsPutResponse and sets the default values. +func NewItemItemLfsPutResponse()(*ItemItemLfsPutResponse) { + m := &ItemItemLfsPutResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemLfsPutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemLfsPutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemLfsPutResponse(), 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 *ItemItemLfsPutResponse) 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 *ItemItemLfsPutResponse) 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 *ItemItemLfsPutResponse) 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 *ItemItemLfsPutResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemLfsPutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_lfs_request_builder.go b/pkg/github/repos/item_item_lfs_request_builder.go new file mode 100644 index 00000000..63a7e9b0 --- /dev/null +++ b/pkg/github/repos/item_item_lfs_request_builder.go @@ -0,0 +1,78 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemLfsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\lfs +type ItemItemLfsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemLfsRequestBuilderInternal instantiates a new ItemItemLfsRequestBuilder and sets the default values. +func NewItemItemLfsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLfsRequestBuilder) { + m := &ItemItemLfsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/lfs", pathParameters), + } + return m +} +// NewItemItemLfsRequestBuilder instantiates a new ItemItemLfsRequestBuilder and sets the default values. +func NewItemItemLfsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLfsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemLfsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete disables Git LFS for a repository.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/lfs#disable-git-lfs-for-a-repository +func (m *ItemItemLfsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put enables Git LFS for a repository.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a ItemItemLfsPutResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/lfs#enable-git-lfs-for-a-repository +func (m *ItemItemLfsRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemLfsPutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemLfsPutResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemLfsPutResponseable), nil +} +// ToDeleteRequestInformation disables Git LFS for a repository.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemLfsRequestBuilder) 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 enables Git LFS for a repository.OAuth app tokens and personal access tokens (classic) need the `admin:enterprise` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemLfsRequestBuilder) ToPutRequestInformation(ctx context.Context, 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") + 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 *ItemItemLfsRequestBuilder when successful +func (m *ItemItemLfsRequestBuilder) WithUrl(rawUrl string)(*ItemItemLfsRequestBuilder) { + return NewItemItemLfsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_license_request_builder.go b/pkg/github/repos/item_item_license_request_builder.go new file mode 100644 index 00000000..740552ab --- /dev/null +++ b/pkg/github/repos/item_item_license_request_builder.go @@ -0,0 +1,66 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemLicenseRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\license +type ItemItemLicenseRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemLicenseRequestBuilderGetQueryParameters this method returns the contents of the repository's license file, if one is detected.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw contents of the license.- **`application/vnd.github.html+json`**: Returns the license contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +type ItemItemLicenseRequestBuilderGetQueryParameters struct { + // The Git reference for the results you want to list. The `ref` for a branch can be formatted either as `refs/heads/` or simply ``. To reference a pull request use `refs/pull//merge`. + Ref *string `uriparametername:"ref"` +} +// NewItemItemLicenseRequestBuilderInternal instantiates a new ItemItemLicenseRequestBuilder and sets the default values. +func NewItemItemLicenseRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLicenseRequestBuilder) { + m := &ItemItemLicenseRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/license{?ref*}", pathParameters), + } + return m +} +// NewItemItemLicenseRequestBuilder instantiates a new ItemItemLicenseRequestBuilder and sets the default values. +func NewItemItemLicenseRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemLicenseRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemLicenseRequestBuilderInternal(urlParams, requestAdapter) +} +// Get this method returns the contents of the repository's license file, if one is detected.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw contents of the license.- **`application/vnd.github.html+json`**: Returns the license contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +// returns a LicenseContentable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/licenses/licenses#get-the-license-for-a-repository +func (m *ItemItemLicenseRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemLicenseRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LicenseContentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLicenseContentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LicenseContentable), nil +} +// ToGetRequestInformation this method returns the contents of the repository's license file, if one is detected.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw contents of the license.- **`application/vnd.github.html+json`**: Returns the license contents in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +// returns a *RequestInformation when successful +func (m *ItemItemLicenseRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemLicenseRequestBuilderGetQueryParameters])(*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 *ItemItemLicenseRequestBuilder when successful +func (m *ItemItemLicenseRequestBuilder) WithUrl(rawUrl string)(*ItemItemLicenseRequestBuilder) { + return NewItemItemLicenseRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_merge_upstream_post_request_body.go b/pkg/github/repos/item_item_merge_upstream_post_request_body.go new file mode 100644 index 00000000..72115ee7 --- /dev/null +++ b/pkg/github/repos/item_item_merge_upstream_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemMergeUpstreamPostRequestBody 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 name of the branch which should be updated to match upstream. + branch *string +} +// NewItemItemMergeUpstreamPostRequestBody instantiates a new ItemItemMergeUpstreamPostRequestBody and sets the default values. +func NewItemItemMergeUpstreamPostRequestBody()(*ItemItemMergeUpstreamPostRequestBody) { + m := &ItemItemMergeUpstreamPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemMergeUpstreamPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemMergeUpstreamPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemMergeUpstreamPostRequestBody(), 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 *ItemItemMergeUpstreamPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBranch gets the branch property value. The name of the branch which should be updated to match upstream. +// returns a *string when successful +func (m *ItemItemMergeUpstreamPostRequestBody) GetBranch()(*string) { + return m.branch +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemMergeUpstreamPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranch(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemMergeUpstreamPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("branch", m.GetBranch()) + 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 *ItemItemMergeUpstreamPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBranch sets the branch property value. The name of the branch which should be updated to match upstream. +func (m *ItemItemMergeUpstreamPostRequestBody) SetBranch(value *string)() { + m.branch = value +} +type ItemItemMergeUpstreamPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBranch()(*string) + SetBranch(value *string)() +} diff --git a/pkg/github/repos/item_item_merge_upstream_request_builder.go b/pkg/github/repos/item_item_merge_upstream_request_builder.go new file mode 100644 index 00000000..9e8c85bc --- /dev/null +++ b/pkg/github/repos/item_item_merge_upstream_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemMergeUpstreamRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\merge-upstream +type ItemItemMergeUpstreamRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemMergeUpstreamRequestBuilderInternal instantiates a new ItemItemMergeUpstreamRequestBuilder and sets the default values. +func NewItemItemMergeUpstreamRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMergeUpstreamRequestBuilder) { + m := &ItemItemMergeUpstreamRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/merge-upstream", pathParameters), + } + return m +} +// NewItemItemMergeUpstreamRequestBuilder instantiates a new ItemItemMergeUpstreamRequestBuilder and sets the default values. +func NewItemItemMergeUpstreamRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMergeUpstreamRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemMergeUpstreamRequestBuilderInternal(urlParams, requestAdapter) +} +// Post sync a branch of a forked repository to keep it up-to-date with the upstream repository. +// returns a MergedUpstreamable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branches#sync-a-fork-branch-with-the-upstream-repository +func (m *ItemItemMergeUpstreamRequestBuilder) Post(ctx context.Context, body ItemItemMergeUpstreamPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MergedUpstreamable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMergedUpstreamFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MergedUpstreamable), nil +} +// ToPostRequestInformation sync a branch of a forked repository to keep it up-to-date with the upstream repository. +// returns a *RequestInformation when successful +func (m *ItemItemMergeUpstreamRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemMergeUpstreamPostRequestBodyable, 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 *ItemItemMergeUpstreamRequestBuilder when successful +func (m *ItemItemMergeUpstreamRequestBuilder) WithUrl(rawUrl string)(*ItemItemMergeUpstreamRequestBuilder) { + return NewItemItemMergeUpstreamRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_merges_post_request_body.go b/pkg/github/repos/item_item_merges_post_request_body.go new file mode 100644 index 00000000..cb297264 --- /dev/null +++ b/pkg/github/repos/item_item_merges_post_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemMergesPostRequestBody 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 name of the base branch that the head will be merged into. + base *string + // Commit message to use for the merge commit. If omitted, a default message will be used. + commit_message *string + // The head to merge. This can be a branch name or a commit SHA1. + head *string +} +// NewItemItemMergesPostRequestBody instantiates a new ItemItemMergesPostRequestBody and sets the default values. +func NewItemItemMergesPostRequestBody()(*ItemItemMergesPostRequestBody) { + m := &ItemItemMergesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemMergesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemMergesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemMergesPostRequestBody(), 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 *ItemItemMergesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBase gets the base property value. The name of the base branch that the head will be merged into. +// returns a *string when successful +func (m *ItemItemMergesPostRequestBody) GetBase()(*string) { + return m.base +} +// GetCommitMessage gets the commit_message property value. Commit message to use for the merge commit. If omitted, a default message will be used. +// returns a *string when successful +func (m *ItemItemMergesPostRequestBody) GetCommitMessage()(*string) { + return m.commit_message +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemMergesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBase(val) + } + return nil + } + res["commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitMessage(val) + } + return nil + } + res["head"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHead(val) + } + return nil + } + return res +} +// GetHead gets the head property value. The head to merge. This can be a branch name or a commit SHA1. +// returns a *string when successful +func (m *ItemItemMergesPostRequestBody) GetHead()(*string) { + return m.head +} +// Serialize serializes information the current object +func (m *ItemItemMergesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("base", m.GetBase()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_message", m.GetCommitMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head", m.GetHead()) + 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 *ItemItemMergesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBase sets the base property value. The name of the base branch that the head will be merged into. +func (m *ItemItemMergesPostRequestBody) SetBase(value *string)() { + m.base = value +} +// SetCommitMessage sets the commit_message property value. Commit message to use for the merge commit. If omitted, a default message will be used. +func (m *ItemItemMergesPostRequestBody) SetCommitMessage(value *string)() { + m.commit_message = value +} +// SetHead sets the head property value. The head to merge. This can be a branch name or a commit SHA1. +func (m *ItemItemMergesPostRequestBody) SetHead(value *string)() { + m.head = value +} +type ItemItemMergesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBase()(*string) + GetCommitMessage()(*string) + GetHead()(*string) + SetBase(value *string)() + SetCommitMessage(value *string)() + SetHead(value *string)() +} diff --git a/pkg/github/repos/item_item_merges_request_builder.go b/pkg/github/repos/item_item_merges_request_builder.go new file mode 100644 index 00000000..5868e90c --- /dev/null +++ b/pkg/github/repos/item_item_merges_request_builder.go @@ -0,0 +1,66 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemMergesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\merges +type ItemItemMergesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemMergesRequestBuilderInternal instantiates a new ItemItemMergesRequestBuilder and sets the default values. +func NewItemItemMergesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMergesRequestBuilder) { + m := &ItemItemMergesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/merges", pathParameters), + } + return m +} +// NewItemItemMergesRequestBuilder instantiates a new ItemItemMergesRequestBuilder and sets the default values. +func NewItemItemMergesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMergesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemMergesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post merge a branch +// returns a Commitable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/branches/branches#merge-a-branch +func (m *ItemItemMergesRequestBuilder) Post(ctx context.Context, body ItemItemMergesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Commitable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCommitFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Commitable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemMergesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemMergesPostRequestBodyable, 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 *ItemItemMergesRequestBuilder when successful +func (m *ItemItemMergesRequestBuilder) WithUrl(rawUrl string)(*ItemItemMergesRequestBuilder) { + return NewItemItemMergesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_milestones_item_labels_request_builder.go b/pkg/github/repos/item_item_milestones_item_labels_request_builder.go new file mode 100644 index 00000000..2b860697 --- /dev/null +++ b/pkg/github/repos/item_item_milestones_item_labels_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemMilestonesItemLabelsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\milestones\{milestone_number}\labels +type ItemItemMilestonesItemLabelsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemMilestonesItemLabelsRequestBuilderGetQueryParameters lists labels for issues in a milestone. +type ItemItemMilestonesItemLabelsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemMilestonesItemLabelsRequestBuilderInternal instantiates a new ItemItemMilestonesItemLabelsRequestBuilder and sets the default values. +func NewItemItemMilestonesItemLabelsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMilestonesItemLabelsRequestBuilder) { + m := &ItemItemMilestonesItemLabelsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/milestones/{milestone_number}/labels{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemMilestonesItemLabelsRequestBuilder instantiates a new ItemItemMilestonesItemLabelsRequestBuilder and sets the default values. +func NewItemItemMilestonesItemLabelsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMilestonesItemLabelsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemMilestonesItemLabelsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists labels for issues in a milestone. +// returns a []Labelable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/labels#list-labels-for-issues-in-a-milestone +func (m *ItemItemMilestonesItemLabelsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemMilestonesItemLabelsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLabelFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Labelable) + } + } + return val, nil +} +// ToGetRequestInformation lists labels for issues in a milestone. +// returns a *RequestInformation when successful +func (m *ItemItemMilestonesItemLabelsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemMilestonesItemLabelsRequestBuilderGetQueryParameters])(*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 *ItemItemMilestonesItemLabelsRequestBuilder when successful +func (m *ItemItemMilestonesItemLabelsRequestBuilder) WithUrl(rawUrl string)(*ItemItemMilestonesItemLabelsRequestBuilder) { + return NewItemItemMilestonesItemLabelsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_milestones_item_with_milestone_escaped_number_patch_request_body.go b/pkg/github/repos/item_item_milestones_item_with_milestone_escaped_number_patch_request_body.go new file mode 100644 index 00000000..5794f09d --- /dev/null +++ b/pkg/github/repos/item_item_milestones_item_with_milestone_escaped_number_patch_request_body.go @@ -0,0 +1,139 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemMilestonesItemWithMilestone_numberPatchRequestBody 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 description of the milestone. + description *string + // The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + due_on *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The title of the milestone. + title *string +} +// NewItemItemMilestonesItemWithMilestone_numberPatchRequestBody instantiates a new ItemItemMilestonesItemWithMilestone_numberPatchRequestBody and sets the default values. +func NewItemItemMilestonesItemWithMilestone_numberPatchRequestBody()(*ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) { + m := &ItemItemMilestonesItemWithMilestone_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemMilestonesItemWithMilestone_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemMilestonesItemWithMilestone_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemMilestonesItemWithMilestone_numberPatchRequestBody(), 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 *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. A description of the milestone. +// returns a *string when successful +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) GetDescription()(*string) { + return m.description +} +// GetDueOn gets the due_on property value. The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.due_on +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) 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["due_on"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDueOn(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetTitle gets the title property value. The title of the milestone. +// returns a *string when successful +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("due_on", m.GetDueOn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. A description of the milestone. +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetDueOn sets the due_on property value. The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.due_on = value +} +// SetTitle sets the title property value. The title of the milestone. +func (m *ItemItemMilestonesItemWithMilestone_numberPatchRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemItemMilestonesItemWithMilestone_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTitle()(*string) + SetDescription(value *string)() + SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTitle(value *string)() +} diff --git a/pkg/github/repos/item_item_milestones_post_request_body.go b/pkg/github/repos/item_item_milestones_post_request_body.go new file mode 100644 index 00000000..25cae052 --- /dev/null +++ b/pkg/github/repos/item_item_milestones_post_request_body.go @@ -0,0 +1,139 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemMilestonesPostRequestBody 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 description of the milestone. + description *string + // The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + due_on *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time + // The title of the milestone. + title *string +} +// NewItemItemMilestonesPostRequestBody instantiates a new ItemItemMilestonesPostRequestBody and sets the default values. +func NewItemItemMilestonesPostRequestBody()(*ItemItemMilestonesPostRequestBody) { + m := &ItemItemMilestonesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemMilestonesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemMilestonesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemMilestonesPostRequestBody(), 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 *ItemItemMilestonesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. A description of the milestone. +// returns a *string when successful +func (m *ItemItemMilestonesPostRequestBody) GetDescription()(*string) { + return m.description +} +// GetDueOn gets the due_on property value. The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +// returns a *Time when successful +func (m *ItemItemMilestonesPostRequestBody) GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.due_on +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemMilestonesPostRequestBody) 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["due_on"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetDueOn(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetTitle gets the title property value. The title of the milestone. +// returns a *string when successful +func (m *ItemItemMilestonesPostRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemItemMilestonesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteTimeValue("due_on", m.GetDueOn()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemItemMilestonesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. A description of the milestone. +func (m *ItemItemMilestonesPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetDueOn sets the due_on property value. The milestone due date. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. +func (m *ItemItemMilestonesPostRequestBody) SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.due_on = value +} +// SetTitle sets the title property value. The title of the milestone. +func (m *ItemItemMilestonesPostRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemItemMilestonesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetDueOn()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + GetTitle()(*string) + SetDescription(value *string)() + SetDueOn(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() + SetTitle(value *string)() +} diff --git a/pkg/github/repos/item_item_milestones_request_builder.go b/pkg/github/repos/item_item_milestones_request_builder.go new file mode 100644 index 00000000..519d2376 --- /dev/null +++ b/pkg/github/repos/item_item_milestones_request_builder.go @@ -0,0 +1,126 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i158d2368c7280b10f1c6d8a86f6e2ae0e0ab01ce5ce9a5d8fba4ab999f60e91d "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/milestones" +) + +// ItemItemMilestonesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\milestones +type ItemItemMilestonesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemMilestonesRequestBuilderGetQueryParameters lists milestones for a repository. +type ItemItemMilestonesRequestBuilderGetQueryParameters struct { + // The direction of the sort. Either `asc` or `desc`. + Direction *i158d2368c7280b10f1c6d8a86f6e2ae0e0ab01ce5ce9a5d8fba4ab999f60e91d.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // What to sort results by. Either `due_on` or `completeness`. + Sort *i158d2368c7280b10f1c6d8a86f6e2ae0e0ab01ce5ce9a5d8fba4ab999f60e91d.GetSortQueryParameterType `uriparametername:"sort"` + // The state of the milestone. Either `open`, `closed`, or `all`. + State *i158d2368c7280b10f1c6d8a86f6e2ae0e0ab01ce5ce9a5d8fba4ab999f60e91d.GetStateQueryParameterType `uriparametername:"state"` +} +// ByMilestone_number gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.milestones.item collection +// returns a *ItemItemMilestonesWithMilestone_numberItemRequestBuilder when successful +func (m *ItemItemMilestonesRequestBuilder) ByMilestone_number(milestone_number int32)(*ItemItemMilestonesWithMilestone_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["milestone_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(milestone_number), 10) + return NewItemItemMilestonesWithMilestone_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemMilestonesRequestBuilderInternal instantiates a new ItemItemMilestonesRequestBuilder and sets the default values. +func NewItemItemMilestonesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMilestonesRequestBuilder) { + m := &ItemItemMilestonesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/milestones{?direction*,page*,per_page*,sort*,state*}", pathParameters), + } + return m +} +// NewItemItemMilestonesRequestBuilder instantiates a new ItemItemMilestonesRequestBuilder and sets the default values. +func NewItemItemMilestonesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMilestonesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemMilestonesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists milestones for a repository. +// returns a []Milestoneable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/milestones#list-milestones +func (m *ItemItemMilestonesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemMilestonesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Milestoneable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMilestoneFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Milestoneable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Milestoneable) + } + } + return val, nil +} +// Post creates a milestone. +// returns a Milestoneable 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/enterprise-server@3.14/rest/issues/milestones#create-a-milestone +func (m *ItemItemMilestonesRequestBuilder) Post(ctx context.Context, body ItemItemMilestonesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Milestoneable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMilestoneFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Milestoneable), nil +} +// ToGetRequestInformation lists milestones for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemMilestonesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemMilestonesRequestBuilderGetQueryParameters])(*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 milestone. +// returns a *RequestInformation when successful +func (m *ItemItemMilestonesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemMilestonesPostRequestBodyable, 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 *ItemItemMilestonesRequestBuilder when successful +func (m *ItemItemMilestonesRequestBuilder) WithUrl(rawUrl string)(*ItemItemMilestonesRequestBuilder) { + return NewItemItemMilestonesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_milestones_with_milestone_escaped_number_item_request_builder.go b/pkg/github/repos/item_item_milestones_with_milestone_escaped_number_item_request_builder.go new file mode 100644 index 00000000..032103df --- /dev/null +++ b/pkg/github/repos/item_item_milestones_with_milestone_escaped_number_item_request_builder.go @@ -0,0 +1,123 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemMilestonesWithMilestone_numberItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\milestones\{milestone_number} +type ItemItemMilestonesWithMilestone_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemMilestonesWithMilestone_numberItemRequestBuilderInternal instantiates a new ItemItemMilestonesWithMilestone_numberItemRequestBuilder and sets the default values. +func NewItemItemMilestonesWithMilestone_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMilestonesWithMilestone_numberItemRequestBuilder) { + m := &ItemItemMilestonesWithMilestone_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/milestones/{milestone_number}", pathParameters), + } + return m +} +// NewItemItemMilestonesWithMilestone_numberItemRequestBuilder instantiates a new ItemItemMilestonesWithMilestone_numberItemRequestBuilder and sets the default values. +func NewItemItemMilestonesWithMilestone_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemMilestonesWithMilestone_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemMilestonesWithMilestone_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a milestone using the given milestone number. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/milestones#delete-a-milestone +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a milestone using the given milestone number. +// returns a Milestoneable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/milestones#get-a-milestone +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Milestoneable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMilestoneFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Milestoneable), nil +} +// Labels the labels property +// returns a *ItemItemMilestonesItemLabelsRequestBuilder when successful +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) Labels()(*ItemItemMilestonesItemLabelsRequestBuilder) { + return NewItemItemMilestonesItemLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch update a milestone +// returns a Milestoneable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/milestones#update-a-milestone +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) Patch(ctx context.Context, body ItemItemMilestonesItemWithMilestone_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Milestoneable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMilestoneFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Milestoneable), nil +} +// ToDeleteRequestInformation deletes a milestone using the given milestone number. +// returns a *RequestInformation when successful +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation gets a milestone using the given milestone number. +// returns a *RequestInformation when successful +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) 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 +} +// returns a *RequestInformation when successful +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemMilestonesItemWithMilestone_numberPatchRequestBodyable, 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 *ItemItemMilestonesWithMilestone_numberItemRequestBuilder when successful +func (m *ItemItemMilestonesWithMilestone_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemMilestonesWithMilestone_numberItemRequestBuilder) { + return NewItemItemMilestonesWithMilestone_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_notifications_put_request_body.go b/pkg/github/repos/item_item_notifications_put_request_body.go new file mode 100644 index 00000000..79d00d44 --- /dev/null +++ b/pkg/github/repos/item_item_notifications_put_request_body.go @@ -0,0 +1,81 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemNotificationsPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. + last_read_at *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewItemItemNotificationsPutRequestBody instantiates a new ItemItemNotificationsPutRequestBody and sets the default values. +func NewItemItemNotificationsPutRequestBody()(*ItemItemNotificationsPutRequestBody) { + m := &ItemItemNotificationsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemNotificationsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemNotificationsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemNotificationsPutRequestBody(), 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 *ItemItemNotificationsPutRequestBody) 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 *ItemItemNotificationsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["last_read_at"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastReadAt(val) + } + return nil + } + return res +} +// GetLastReadAt gets the last_read_at property value. Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. +// returns a *Time when successful +func (m *ItemItemNotificationsPutRequestBody) GetLastReadAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_read_at +} +// Serialize serializes information the current object +func (m *ItemItemNotificationsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("last_read_at", m.GetLastReadAt()) + 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 *ItemItemNotificationsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLastReadAt sets the last_read_at property value. Describes the last point that notifications were checked. Anything updated since this time will not be marked as read. If you omit this parameter, all notifications are marked as read. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. Default: The current timestamp. +func (m *ItemItemNotificationsPutRequestBody) SetLastReadAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_read_at = value +} +type ItemItemNotificationsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLastReadAt()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetLastReadAt(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/repos/item_item_notifications_put_response.go b/pkg/github/repos/item_item_notifications_put_response.go new file mode 100644 index 00000000..9e60f7ac --- /dev/null +++ b/pkg/github/repos/item_item_notifications_put_response.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemNotificationsPutResponse 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 message property + message *string + // The url property + url *string +} +// NewItemItemNotificationsPutResponse instantiates a new ItemItemNotificationsPutResponse and sets the default values. +func NewItemItemNotificationsPutResponse()(*ItemItemNotificationsPutResponse) { + m := &ItemItemNotificationsPutResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemNotificationsPutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemNotificationsPutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemNotificationsPutResponse(), 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 *ItemItemNotificationsPutResponse) 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 *ItemItemNotificationsPutResponse) 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ItemItemNotificationsPutResponse) GetMessage()(*string) { + return m.message +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ItemItemNotificationsPutResponse) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ItemItemNotificationsPutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ItemItemNotificationsPutResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The message property +func (m *ItemItemNotificationsPutResponse) SetMessage(value *string)() { + m.message = value +} +// SetUrl sets the url property value. The url property +func (m *ItemItemNotificationsPutResponse) SetUrl(value *string)() { + m.url = value +} +type ItemItemNotificationsPutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + GetUrl()(*string) + SetMessage(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/repos/item_item_notifications_request_builder.go b/pkg/github/repos/item_item_notifications_request_builder.go new file mode 100644 index 00000000..3c9cef55 --- /dev/null +++ b/pkg/github/repos/item_item_notifications_request_builder.go @@ -0,0 +1,107 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemNotificationsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\notifications +type ItemItemNotificationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemNotificationsRequestBuilderGetQueryParameters lists all notifications for the current user in the specified repository. +type ItemItemNotificationsRequestBuilderGetQueryParameters struct { + // If `true`, show notifications marked as read. + All *bool `uriparametername:"all"` + // Only show notifications updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Before *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"before"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Page *int32 `uriparametername:"page"` + // If `true`, only shows notifications in which the user is directly participating or mentioned. + Participating *bool `uriparametername:"participating"` + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// NewItemItemNotificationsRequestBuilderInternal instantiates a new ItemItemNotificationsRequestBuilder and sets the default values. +func NewItemItemNotificationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemNotificationsRequestBuilder) { + m := &ItemItemNotificationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/notifications{?all*,before*,page*,participating*,per_page*,since*}", pathParameters), + } + return m +} +// NewItemItemNotificationsRequestBuilder instantiates a new ItemItemNotificationsRequestBuilder and sets the default values. +func NewItemItemNotificationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemNotificationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemNotificationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all notifications for the current user in the specified repository. +// returns a []Threadable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user +func (m *ItemItemNotificationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemNotificationsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Threadable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateThreadFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Threadable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Threadable) + } + } + return val, nil +} +// Put marks all notifications in a repository as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub Enterprise Server will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. +// returns a ItemItemNotificationsPutResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#mark-repository-notifications-as-read +func (m *ItemItemNotificationsRequestBuilder) Put(ctx context.Context, body ItemItemNotificationsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemNotificationsPutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemNotificationsPutResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemNotificationsPutResponseable), nil +} +// ToGetRequestInformation lists all notifications for the current user in the specified repository. +// returns a *RequestInformation when successful +func (m *ItemItemNotificationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemNotificationsRequestBuilderGetQueryParameters])(*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 +} +// ToPutRequestInformation marks all notifications in a repository as "read" for the current user. If the number of notifications is too large to complete in one request, you will receive a `202 Accepted` status and GitHub Enterprise Server will run an asynchronous process to mark notifications as "read." To check whether any "unread" notifications remain, you can use the [List repository notifications for the authenticated user](https://docs.github.com/enterprise-server@3.14/rest/activity/notifications#list-repository-notifications-for-the-authenticated-user) endpoint and pass the query parameter `all=false`. +// returns a *RequestInformation when successful +func (m *ItemItemNotificationsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemNotificationsPutRequestBodyable, 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 *ItemItemNotificationsRequestBuilder when successful +func (m *ItemItemNotificationsRequestBuilder) WithUrl(rawUrl string)(*ItemItemNotificationsRequestBuilder) { + return NewItemItemNotificationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pages_builds_latest_request_builder.go b/pkg/github/repos/item_item_pages_builds_latest_request_builder.go new file mode 100644 index 00000000..fbae2890 --- /dev/null +++ b/pkg/github/repos/item_item_pages_builds_latest_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPagesBuildsLatestRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages\builds\latest +type ItemItemPagesBuildsLatestRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPagesBuildsLatestRequestBuilderInternal instantiates a new ItemItemPagesBuildsLatestRequestBuilder and sets the default values. +func NewItemItemPagesBuildsLatestRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesBuildsLatestRequestBuilder) { + m := &ItemItemPagesBuildsLatestRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages/builds/latest", pathParameters), + } + return m +} +// NewItemItemPagesBuildsLatestRequestBuilder instantiates a new ItemItemPagesBuildsLatestRequestBuilder and sets the default values. +func NewItemItemPagesBuildsLatestRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesBuildsLatestRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesBuildsLatestRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets information about the single most recent build of a GitHub Enterprise Server Pages site.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a PageBuildable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pages/pages#get-latest-pages-build +func (m *ItemItemPagesBuildsLatestRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PageBuildable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePageBuildFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PageBuildable), nil +} +// ToGetRequestInformation gets information about the single most recent build of a GitHub Enterprise Server Pages site.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesBuildsLatestRequestBuilder) 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 *ItemItemPagesBuildsLatestRequestBuilder when successful +func (m *ItemItemPagesBuildsLatestRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesBuildsLatestRequestBuilder) { + return NewItemItemPagesBuildsLatestRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pages_builds_request_builder.go b/pkg/github/repos/item_item_pages_builds_request_builder.go new file mode 100644 index 00000000..ed6f517d --- /dev/null +++ b/pkg/github/repos/item_item_pages_builds_request_builder.go @@ -0,0 +1,110 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPagesBuildsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages\builds +type ItemItemPagesBuildsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPagesBuildsRequestBuilderGetQueryParameters lists builts of a GitHub Enterprise Server Pages site.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemItemPagesBuildsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByBuild_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.pages.builds.item collection +// returns a *ItemItemPagesBuildsWithBuild_ItemRequestBuilder when successful +func (m *ItemItemPagesBuildsRequestBuilder) ByBuild_id(build_id int32)(*ItemItemPagesBuildsWithBuild_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["build_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(build_id), 10) + return NewItemItemPagesBuildsWithBuild_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPagesBuildsRequestBuilderInternal instantiates a new ItemItemPagesBuildsRequestBuilder and sets the default values. +func NewItemItemPagesBuildsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesBuildsRequestBuilder) { + m := &ItemItemPagesBuildsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages/builds{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemPagesBuildsRequestBuilder instantiates a new ItemItemPagesBuildsRequestBuilder and sets the default values. +func NewItemItemPagesBuildsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesBuildsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesBuildsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists builts of a GitHub Enterprise Server Pages site.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a []PageBuildable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pages/pages#list-apiname-pages-builds +func (m *ItemItemPagesBuildsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPagesBuildsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PageBuildable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePageBuildFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PageBuildable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PageBuildable) + } + } + return val, nil +} +// Latest the latest property +// returns a *ItemItemPagesBuildsLatestRequestBuilder when successful +func (m *ItemItemPagesBuildsRequestBuilder) Latest()(*ItemItemPagesBuildsLatestRequestBuilder) { + return NewItemItemPagesBuildsLatestRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Post you can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. +// returns a PageBuildStatusable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pages/pages#request-a-apiname-pages-build +func (m *ItemItemPagesBuildsRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PageBuildStatusable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePageBuildStatusFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PageBuildStatusable), nil +} +// ToGetRequestInformation lists builts of a GitHub Enterprise Server Pages site.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesBuildsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPagesBuildsRequestBuilderGetQueryParameters])(*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 you can request that your site be built from the latest revision on the default branch. This has the same effect as pushing a commit to your default branch, but does not require an additional commit. Manually triggering page builds can be helpful when diagnosing build warnings and failures.Build requests are limited to one concurrent build per repository and one concurrent build per requester. If you request a build while another is still in progress, the second request will be queued until the first completes. +// returns a *RequestInformation when successful +func (m *ItemItemPagesBuildsRequestBuilder) 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 *ItemItemPagesBuildsRequestBuilder when successful +func (m *ItemItemPagesBuildsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesBuildsRequestBuilder) { + return NewItemItemPagesBuildsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pages_builds_with_build_escaped_item_request_builder.go b/pkg/github/repos/item_item_pages_builds_with_build_escaped_item_request_builder.go new file mode 100644 index 00000000..935688df --- /dev/null +++ b/pkg/github/repos/item_item_pages_builds_with_build_escaped_item_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPagesBuildsWithBuild_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages\builds\{build_id} +type ItemItemPagesBuildsWithBuild_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPagesBuildsWithBuild_ItemRequestBuilderInternal instantiates a new ItemItemPagesBuildsWithBuild_ItemRequestBuilder and sets the default values. +func NewItemItemPagesBuildsWithBuild_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesBuildsWithBuild_ItemRequestBuilder) { + m := &ItemItemPagesBuildsWithBuild_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages/builds/{build_id}", pathParameters), + } + return m +} +// NewItemItemPagesBuildsWithBuild_ItemRequestBuilder instantiates a new ItemItemPagesBuildsWithBuild_ItemRequestBuilder and sets the default values. +func NewItemItemPagesBuildsWithBuild_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesBuildsWithBuild_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesBuildsWithBuild_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets information about a GitHub Enterprise Server Pages build.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a PageBuildable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pages/pages#get-apiname-pages-build +func (m *ItemItemPagesBuildsWithBuild_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PageBuildable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePageBuildFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PageBuildable), nil +} +// ToGetRequestInformation gets information about a GitHub Enterprise Server Pages build.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesBuildsWithBuild_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPagesBuildsWithBuild_ItemRequestBuilder when successful +func (m *ItemItemPagesBuildsWithBuild_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesBuildsWithBuild_ItemRequestBuilder) { + return NewItemItemPagesBuildsWithBuild_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pages_deployments_item_cancel_request_builder.go b/pkg/github/repos/item_item_pages_deployments_item_cancel_request_builder.go new file mode 100644 index 00000000..babb69d1 --- /dev/null +++ b/pkg/github/repos/item_item_pages_deployments_item_cancel_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPagesDeploymentsItemCancelRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages\deployments\{pages_deployment_id}\cancel +type ItemItemPagesDeploymentsItemCancelRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPagesDeploymentsItemCancelRequestBuilderInternal instantiates a new ItemItemPagesDeploymentsItemCancelRequestBuilder and sets the default values. +func NewItemItemPagesDeploymentsItemCancelRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesDeploymentsItemCancelRequestBuilder) { + m := &ItemItemPagesDeploymentsItemCancelRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages/deployments/{pages_deployment_id}/cancel", pathParameters), + } + return m +} +// NewItemItemPagesDeploymentsItemCancelRequestBuilder instantiates a new ItemItemPagesDeploymentsItemCancelRequestBuilder and sets the default values. +func NewItemItemPagesDeploymentsItemCancelRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesDeploymentsItemCancelRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesDeploymentsItemCancelRequestBuilderInternal(urlParams, requestAdapter) +} +// Post cancels a GitHub Pages deployment.The authenticated user must have write permissions for the GitHub Pages site. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pages/pages#cancel-a-github-pages-deployment +func (m *ItemItemPagesDeploymentsItemCancelRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation cancels a GitHub Pages deployment.The authenticated user must have write permissions for the GitHub Pages site. +// returns a *RequestInformation when successful +func (m *ItemItemPagesDeploymentsItemCancelRequestBuilder) 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 *ItemItemPagesDeploymentsItemCancelRequestBuilder when successful +func (m *ItemItemPagesDeploymentsItemCancelRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesDeploymentsItemCancelRequestBuilder) { + return NewItemItemPagesDeploymentsItemCancelRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pages_deployments_post_request_body.go b/pkg/github/repos/item_item_pages_deployments_post_request_body.go new file mode 100644 index 00000000..855a07d6 --- /dev/null +++ b/pkg/github/repos/item_item_pages_deployments_post_request_body.go @@ -0,0 +1,172 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemPagesDeploymentsPostRequestBody the object used to create GitHub Pages deployment +type ItemItemPagesDeploymentsPostRequestBody 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 URL of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. + artifact_url *string + // The target environment for this GitHub Pages deployment. + environment *string + // The OIDC token issued by GitHub Actions certifying the origin of the deployment. + oidc_token *string + // A unique string that represents the version of the build for this deployment. + pages_build_version *string +} +// NewItemItemPagesDeploymentsPostRequestBody instantiates a new ItemItemPagesDeploymentsPostRequestBody and sets the default values. +func NewItemItemPagesDeploymentsPostRequestBody()(*ItemItemPagesDeploymentsPostRequestBody) { + m := &ItemItemPagesDeploymentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + environmentValue := "github-pages" + m.SetEnvironment(&environmentValue) + pages_build_versionValue := "GITHUB_SHA" + m.SetPagesBuildVersion(&pages_build_versionValue) + return m +} +// CreateItemItemPagesDeploymentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPagesDeploymentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPagesDeploymentsPostRequestBody(), 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 *ItemItemPagesDeploymentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArtifactUrl gets the artifact_url property value. The URL of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. +// returns a *string when successful +func (m *ItemItemPagesDeploymentsPostRequestBody) GetArtifactUrl()(*string) { + return m.artifact_url +} +// GetEnvironment gets the environment property value. The target environment for this GitHub Pages deployment. +// returns a *string when successful +func (m *ItemItemPagesDeploymentsPostRequestBody) GetEnvironment()(*string) { + return m.environment +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPagesDeploymentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["artifact_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArtifactUrl(val) + } + return nil + } + res["environment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEnvironment(val) + } + return nil + } + res["oidc_token"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetOidcToken(val) + } + return nil + } + res["pages_build_version"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPagesBuildVersion(val) + } + return nil + } + return res +} +// GetOidcToken gets the oidc_token property value. The OIDC token issued by GitHub Actions certifying the origin of the deployment. +// returns a *string when successful +func (m *ItemItemPagesDeploymentsPostRequestBody) GetOidcToken()(*string) { + return m.oidc_token +} +// GetPagesBuildVersion gets the pages_build_version property value. A unique string that represents the version of the build for this deployment. +// returns a *string when successful +func (m *ItemItemPagesDeploymentsPostRequestBody) GetPagesBuildVersion()(*string) { + return m.pages_build_version +} +// Serialize serializes information the current object +func (m *ItemItemPagesDeploymentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("artifact_url", m.GetArtifactUrl()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("environment", m.GetEnvironment()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("oidc_token", m.GetOidcToken()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("pages_build_version", m.GetPagesBuildVersion()) + 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 *ItemItemPagesDeploymentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArtifactUrl sets the artifact_url property value. The URL of an artifact that contains the .zip or .tar of static assets to deploy. The artifact belongs to the repository. +func (m *ItemItemPagesDeploymentsPostRequestBody) SetArtifactUrl(value *string)() { + m.artifact_url = value +} +// SetEnvironment sets the environment property value. The target environment for this GitHub Pages deployment. +func (m *ItemItemPagesDeploymentsPostRequestBody) SetEnvironment(value *string)() { + m.environment = value +} +// SetOidcToken sets the oidc_token property value. The OIDC token issued by GitHub Actions certifying the origin of the deployment. +func (m *ItemItemPagesDeploymentsPostRequestBody) SetOidcToken(value *string)() { + m.oidc_token = value +} +// SetPagesBuildVersion sets the pages_build_version property value. A unique string that represents the version of the build for this deployment. +func (m *ItemItemPagesDeploymentsPostRequestBody) SetPagesBuildVersion(value *string)() { + m.pages_build_version = value +} +type ItemItemPagesDeploymentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArtifactUrl()(*string) + GetEnvironment()(*string) + GetOidcToken()(*string) + GetPagesBuildVersion()(*string) + SetArtifactUrl(value *string)() + SetEnvironment(value *string)() + SetOidcToken(value *string)() + SetPagesBuildVersion(value *string)() +} diff --git a/pkg/github/repos/item_item_pages_deployments_request_builder.go b/pkg/github/repos/item_item_pages_deployments_request_builder.go new file mode 100644 index 00000000..98177710 --- /dev/null +++ b/pkg/github/repos/item_item_pages_deployments_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPagesDeploymentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages\deployments +type ItemItemPagesDeploymentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByPages_deployment_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.pages.deployments.item collection +// returns a *ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder when successful +func (m *ItemItemPagesDeploymentsRequestBuilder) ByPages_deployment_id(pages_deployment_id int32)(*ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["pages_deployment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(pages_deployment_id), 10) + return NewItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPagesDeploymentsRequestBuilderInternal instantiates a new ItemItemPagesDeploymentsRequestBuilder and sets the default values. +func NewItemItemPagesDeploymentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesDeploymentsRequestBuilder) { + m := &ItemItemPagesDeploymentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages/deployments", pathParameters), + } + return m +} +// NewItemItemPagesDeploymentsRequestBuilder instantiates a new ItemItemPagesDeploymentsRequestBuilder and sets the default values. +func NewItemItemPagesDeploymentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesDeploymentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesDeploymentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post create a GitHub Pages deployment for a repository.The authenticated user must have write permission to the repository. +// returns a PageDeploymentable 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 +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pages/pages#create-a-github-pages-deployment +func (m *ItemItemPagesDeploymentsRequestBuilder) Post(ctx context.Context, body ItemItemPagesDeploymentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PageDeploymentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePageDeploymentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PageDeploymentable), nil +} +// ToPostRequestInformation create a GitHub Pages deployment for a repository.The authenticated user must have write permission to the repository. +// returns a *RequestInformation when successful +func (m *ItemItemPagesDeploymentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPagesDeploymentsPostRequestBodyable, 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 *ItemItemPagesDeploymentsRequestBuilder when successful +func (m *ItemItemPagesDeploymentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesDeploymentsRequestBuilder) { + return NewItemItemPagesDeploymentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pages_deployments_with_pages_escaped_deployment_escaped_item_request_builder.go b/pkg/github/repos/item_item_pages_deployments_with_pages_escaped_deployment_escaped_item_request_builder.go new file mode 100644 index 00000000..4eb50616 --- /dev/null +++ b/pkg/github/repos/item_item_pages_deployments_with_pages_escaped_deployment_escaped_item_request_builder.go @@ -0,0 +1,66 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages\deployments\{pages_deployment_id} +type ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Cancel the cancel property +// returns a *ItemItemPagesDeploymentsItemCancelRequestBuilder when successful +func (m *ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) Cancel()(*ItemItemPagesDeploymentsItemCancelRequestBuilder) { + return NewItemItemPagesDeploymentsItemCancelRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilderInternal instantiates a new ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder and sets the default values. +func NewItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) { + m := &ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages/deployments/{pages_deployment_id}", pathParameters), + } + return m +} +// NewItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder instantiates a new ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder and sets the default values. +func NewItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the current status of a GitHub Pages deployment.The authenticated user must have read permission for the GitHub Pages site. +// returns a PagesDeploymentStatusable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pages/pages#get-the-status-of-a-github-pages-deployment +func (m *ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PagesDeploymentStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePagesDeploymentStatusFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PagesDeploymentStatusable), nil +} +// ToGetRequestInformation gets the current status of a GitHub Pages deployment.The authenticated user must have read permission for the GitHub Pages site. +// returns a *RequestInformation when successful +func (m *ItemItemPagesDeploymentsWithPages_deployment_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder when successful +func (m *ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder) { + return NewItemItemPagesDeploymentsWithPages_deployment_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pages_post_request_body.go b/pkg/github/repos/item_item_pages_post_request_body.go new file mode 100644 index 00000000..ed62902d --- /dev/null +++ b/pkg/github/repos/item_item_pages_post_request_body.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemPagesPostRequestBody the source branch and directory used to publish your Pages site. +type ItemItemPagesPostRequestBody 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 source branch and directory used to publish your Pages site. + source ItemItemPagesPostRequestBody_sourceable +} +// NewItemItemPagesPostRequestBody instantiates a new ItemItemPagesPostRequestBody and sets the default values. +func NewItemItemPagesPostRequestBody()(*ItemItemPagesPostRequestBody) { + m := &ItemItemPagesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPagesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPagesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPagesPostRequestBody(), 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 *ItemItemPagesPostRequestBody) 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 *ItemItemPagesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemPagesPostRequestBody_sourceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSource(val.(ItemItemPagesPostRequestBody_sourceable)) + } + return nil + } + return res +} +// GetSource gets the source property value. The source branch and directory used to publish your Pages site. +// returns a ItemItemPagesPostRequestBody_sourceable when successful +func (m *ItemItemPagesPostRequestBody) GetSource()(ItemItemPagesPostRequestBody_sourceable) { + return m.source +} +// Serialize serializes information the current object +func (m *ItemItemPagesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("source", m.GetSource()) + 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 *ItemItemPagesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSource sets the source property value. The source branch and directory used to publish your Pages site. +func (m *ItemItemPagesPostRequestBody) SetSource(value ItemItemPagesPostRequestBody_sourceable)() { + m.source = value +} +type ItemItemPagesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSource()(ItemItemPagesPostRequestBody_sourceable) + SetSource(value ItemItemPagesPostRequestBody_sourceable)() +} diff --git a/pkg/github/repos/item_item_pages_post_request_body_escaped_source.go b/pkg/github/repos/item_item_pages_post_request_body_escaped_source.go new file mode 100644 index 00000000..7ae5f6c3 --- /dev/null +++ b/pkg/github/repos/item_item_pages_post_request_body_escaped_source.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemPagesPostRequestBody_source the source branch and directory used to publish your Pages site. +type ItemItemPagesPostRequestBody_source 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 repository branch used to publish your site's source files. + branch *string +} +// NewItemItemPagesPostRequestBody_source instantiates a new ItemItemPagesPostRequestBody_source and sets the default values. +func NewItemItemPagesPostRequestBody_source()(*ItemItemPagesPostRequestBody_source) { + m := &ItemItemPagesPostRequestBody_source{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPagesPostRequestBody_sourceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPagesPostRequestBody_sourceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPagesPostRequestBody_source(), 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 *ItemItemPagesPostRequestBody_source) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBranch gets the branch property value. The repository branch used to publish your site's source files. +// returns a *string when successful +func (m *ItemItemPagesPostRequestBody_source) GetBranch()(*string) { + return m.branch +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPagesPostRequestBody_source) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranch(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPagesPostRequestBody_source) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("branch", m.GetBranch()) + 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 *ItemItemPagesPostRequestBody_source) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBranch sets the branch property value. The repository branch used to publish your site's source files. +func (m *ItemItemPagesPostRequestBody_source) SetBranch(value *string)() { + m.branch = value +} +type ItemItemPagesPostRequestBody_sourceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBranch()(*string) + SetBranch(value *string)() +} diff --git a/pkg/github/repos/item_item_pages_put_request_body.go b/pkg/github/repos/item_item_pages_put_request_body.go new file mode 100644 index 00000000..7bce0740 --- /dev/null +++ b/pkg/github/repos/item_item_pages_put_request_body.go @@ -0,0 +1,222 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPagesPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Specify a custom domain for the repository. Sending a `null` value will remove the custom domain. For more about custom domains, see "[Using a custom domain with GitHub Pages](https://docs.github.com/enterprise-server@3.14/pages/configuring-a-custom-domain-for-your-github-pages-site)." + cname *string + // Specify whether HTTPS should be enforced for the repository. + https_enforced *bool + // The source property + source ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable +} +// ItemItemPagesPutRequestBody_PagesPutRequestBody_source composed type wrapper for classes ItemItemPagesPutRequestBody_sourceMember1able, string +type ItemItemPagesPutRequestBody_PagesPutRequestBody_source struct { + // Composed type representation for type ItemItemPagesPutRequestBody_sourceMember1able + itemItemPagesPutRequestBody_sourceMember1 ItemItemPagesPutRequestBody_sourceMember1able + // Composed type representation for type string + string *string +} +// NewItemItemPagesPutRequestBody_PagesPutRequestBody_source instantiates a new ItemItemPagesPutRequestBody_PagesPutRequestBody_source and sets the default values. +func NewItemItemPagesPutRequestBody_PagesPutRequestBody_source()(*ItemItemPagesPutRequestBody_PagesPutRequestBody_source) { + m := &ItemItemPagesPutRequestBody_PagesPutRequestBody_source{ + } + return m +} +// CreateItemItemPagesPutRequestBody_PagesPutRequestBody_sourceFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPagesPutRequestBody_PagesPutRequestBody_sourceFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewItemItemPagesPutRequestBody_PagesPutRequestBody_source() + if parseNode != nil { + if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } else if val, err := parseNode.GetObjectValue(CreateItemItemPagesPutRequestBody_sourceMember1FromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + if cast, ok := val.(ItemItemPagesPutRequestBody_sourceMember1able); ok { + result.SetItemItemPagesPutRequestBodySourceMember1(cast) + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPagesPutRequestBody_PagesPutRequestBody_source) 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 *ItemItemPagesPutRequestBody_PagesPutRequestBody_source) GetIsComposedType()(bool) { + return true +} +// GetItemItemPagesPutRequestBodySourceMember1 gets the ItemItemPagesPutRequestBody_sourceMember1 property value. Composed type representation for type ItemItemPagesPutRequestBody_sourceMember1able +// returns a ItemItemPagesPutRequestBody_sourceMember1able when successful +func (m *ItemItemPagesPutRequestBody_PagesPutRequestBody_source) GetItemItemPagesPutRequestBodySourceMember1()(ItemItemPagesPutRequestBody_sourceMember1able) { + return m.itemItemPagesPutRequestBody_sourceMember1 +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *ItemItemPagesPutRequestBody_PagesPutRequestBody_source) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *ItemItemPagesPutRequestBody_PagesPutRequestBody_source) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } else if m.GetItemItemPagesPutRequestBodySourceMember1() != nil { + err := writer.WriteObjectValue("", m.GetItemItemPagesPutRequestBodySourceMember1()) + if err != nil { + return err + } + } + return nil +} +// SetItemItemPagesPutRequestBodySourceMember1 sets the ItemItemPagesPutRequestBody_sourceMember1 property value. Composed type representation for type ItemItemPagesPutRequestBody_sourceMember1able +func (m *ItemItemPagesPutRequestBody_PagesPutRequestBody_source) SetItemItemPagesPutRequestBodySourceMember1(value ItemItemPagesPutRequestBody_sourceMember1able)() { + m.itemItemPagesPutRequestBody_sourceMember1 = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *ItemItemPagesPutRequestBody_PagesPutRequestBody_source) SetString(value *string)() { + m.string = value +} +type ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemPagesPutRequestBodySourceMember1()(ItemItemPagesPutRequestBody_sourceMember1able) + GetString()(*string) + SetItemItemPagesPutRequestBodySourceMember1(value ItemItemPagesPutRequestBody_sourceMember1able)() + SetString(value *string)() +} +// NewItemItemPagesPutRequestBody instantiates a new ItemItemPagesPutRequestBody and sets the default values. +func NewItemItemPagesPutRequestBody()(*ItemItemPagesPutRequestBody) { + m := &ItemItemPagesPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPagesPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPagesPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPagesPutRequestBody(), 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 *ItemItemPagesPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCname gets the cname property value. Specify a custom domain for the repository. Sending a `null` value will remove the custom domain. For more about custom domains, see "[Using a custom domain with GitHub Pages](https://docs.github.com/enterprise-server@3.14/pages/configuring-a-custom-domain-for-your-github-pages-site)." +// returns a *string when successful +func (m *ItemItemPagesPutRequestBody) GetCname()(*string) { + return m.cname +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPagesPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["cname"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCname(val) + } + return nil + } + res["https_enforced"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHttpsEnforced(val) + } + return nil + } + res["source"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemPagesPutRequestBody_PagesPutRequestBody_sourceFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSource(val.(ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable)) + } + return nil + } + return res +} +// GetHttpsEnforced gets the https_enforced property value. Specify whether HTTPS should be enforced for the repository. +// returns a *bool when successful +func (m *ItemItemPagesPutRequestBody) GetHttpsEnforced()(*bool) { + return m.https_enforced +} +// GetSource gets the source property value. The source property +// returns a ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable when successful +func (m *ItemItemPagesPutRequestBody) GetSource()(ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable) { + return m.source +} +// Serialize serializes information the current object +func (m *ItemItemPagesPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("cname", m.GetCname()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("https_enforced", m.GetHttpsEnforced()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("source", m.GetSource()) + 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 *ItemItemPagesPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCname sets the cname property value. Specify a custom domain for the repository. Sending a `null` value will remove the custom domain. For more about custom domains, see "[Using a custom domain with GitHub Pages](https://docs.github.com/enterprise-server@3.14/pages/configuring-a-custom-domain-for-your-github-pages-site)." +func (m *ItemItemPagesPutRequestBody) SetCname(value *string)() { + m.cname = value +} +// SetHttpsEnforced sets the https_enforced property value. Specify whether HTTPS should be enforced for the repository. +func (m *ItemItemPagesPutRequestBody) SetHttpsEnforced(value *bool)() { + m.https_enforced = value +} +// SetSource sets the source property value. The source property +func (m *ItemItemPagesPutRequestBody) SetSource(value ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable)() { + m.source = value +} +type ItemItemPagesPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCname()(*string) + GetHttpsEnforced()(*bool) + GetSource()(ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable) + SetCname(value *string)() + SetHttpsEnforced(value *bool)() + SetSource(value ItemItemPagesPutRequestBody_PagesPutRequestBody_sourceable)() +} diff --git a/pkg/github/repos/item_item_pages_put_request_body_escaped_source_member1.go b/pkg/github/repos/item_item_pages_put_request_body_escaped_source_member1.go new file mode 100644 index 00000000..a4f38951 --- /dev/null +++ b/pkg/github/repos/item_item_pages_put_request_body_escaped_source_member1.go @@ -0,0 +1,81 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemPagesPutRequestBody_sourceMember1 update the source for the repository. Must include the branch name and path. +type ItemItemPagesPutRequestBody_sourceMember1 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 repository branch used to publish your site's source files. + branch *string +} +// NewItemItemPagesPutRequestBody_sourceMember1 instantiates a new ItemItemPagesPutRequestBody_sourceMember1 and sets the default values. +func NewItemItemPagesPutRequestBody_sourceMember1()(*ItemItemPagesPutRequestBody_sourceMember1) { + m := &ItemItemPagesPutRequestBody_sourceMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPagesPutRequestBody_sourceMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPagesPutRequestBody_sourceMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPagesPutRequestBody_sourceMember1(), 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 *ItemItemPagesPutRequestBody_sourceMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBranch gets the branch property value. The repository branch used to publish your site's source files. +// returns a *string when successful +func (m *ItemItemPagesPutRequestBody_sourceMember1) GetBranch()(*string) { + return m.branch +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPagesPutRequestBody_sourceMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBranch(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPagesPutRequestBody_sourceMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("branch", m.GetBranch()) + 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 *ItemItemPagesPutRequestBody_sourceMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBranch sets the branch property value. The repository branch used to publish your site's source files. +func (m *ItemItemPagesPutRequestBody_sourceMember1) SetBranch(value *string)() { + m.branch = value +} +type ItemItemPagesPutRequestBody_sourceMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBranch()(*string) + SetBranch(value *string)() +} diff --git a/pkg/github/repos/item_item_pages_request_builder.go b/pkg/github/repos/item_item_pages_request_builder.go new file mode 100644 index 00000000..c55587c8 --- /dev/null +++ b/pkg/github/repos/item_item_pages_request_builder.go @@ -0,0 +1,174 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPagesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pages +type ItemItemPagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Builds the builds property +// returns a *ItemItemPagesBuildsRequestBuilder when successful +func (m *ItemItemPagesRequestBuilder) Builds()(*ItemItemPagesBuildsRequestBuilder) { + return NewItemItemPagesBuildsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPagesRequestBuilderInternal instantiates a new ItemItemPagesRequestBuilder and sets the default values. +func NewItemItemPagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesRequestBuilder) { + m := &ItemItemPagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pages", pathParameters), + } + return m +} +// NewItemItemPagesRequestBuilder instantiates a new ItemItemPagesRequestBuilder and sets the default values. +func NewItemItemPagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPagesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPagesRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a GitHub Enterprise Server Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages).The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pages/pages#delete-a-apiname-pages-site +func (m *ItemItemPagesRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Deployments the deployments property +// returns a *ItemItemPagesDeploymentsRequestBuilder when successful +func (m *ItemItemPagesRequestBuilder) Deployments()(*ItemItemPagesDeploymentsRequestBuilder) { + return NewItemItemPagesDeploymentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get gets information about a GitHub Enterprise Server Pages site.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a Pageable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pages/pages#get-a-apiname-pages-site +func (m *ItemItemPagesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Pageable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePageFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Pageable), nil +} +// Post configures a GitHub Enterprise Server Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)."The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a Pageable when successful +// returns a BasicError error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pages/pages#create-a-apiname-pages-site +func (m *ItemItemPagesRequestBuilder) Post(ctx context.Context, body ItemItemPagesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Pageable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePageFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Pageable), nil +} +// Put updates information for a GitHub Enterprise Server Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages).The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.OAuth app tokens and personal access tokens (classic) need the `repo` 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 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pages/pages#update-information-about-a-apiname-pages-site +func (m *ItemItemPagesRequestBuilder) Put(ctx context.Context, body ItemItemPagesPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation deletes a GitHub Enterprise Server Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages).The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation gets information about a GitHub Enterprise Server Pages site.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesRequestBuilder) 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 configures a GitHub Enterprise Server Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages)."The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPagesPostRequestBodyable, 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 +} +// ToPutRequestInformation updates information for a GitHub Enterprise Server Pages site. For more information, see "[About GitHub Pages](/github/working-with-github-pages/about-github-pages).The authenticated user must be a repository administrator, maintainer, or have the 'manage GitHub Pages settings' permission.OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPagesRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemPagesPutRequestBodyable, 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, application/scim+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 *ItemItemPagesRequestBuilder when successful +func (m *ItemItemPagesRequestBuilder) WithUrl(rawUrl string)(*ItemItemPagesRequestBuilder) { + return NewItemItemPagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pre_receive_hooks_item_with_pre_escaped_receive_escaped_hook_escaped_patch_request_body.go b/pkg/github/repos/item_item_pre_receive_hooks_item_with_pre_escaped_receive_escaped_hook_escaped_patch_request_body.go new file mode 100644 index 00000000..fcf6df60 --- /dev/null +++ b/pkg/github/repos/item_item_pre_receive_hooks_item_with_pre_escaped_receive_escaped_hook_escaped_patch_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody instantiates a new ItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody and sets the default values. +func NewItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody()(*ItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) { + m := &ItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody(), 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 *ItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) 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 *ItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) 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 *ItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) 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 *ItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_pre_receive_hooks_request_builder.go b/pkg/github/repos/item_item_pre_receive_hooks_request_builder.go new file mode 100644 index 00000000..a87bd146 --- /dev/null +++ b/pkg/github/repos/item_item_pre_receive_hooks_request_builder.go @@ -0,0 +1,82 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ica6934b4a373fa1659e9f86c88392ef5c7c24513cb1e02c6bad9849147d46e61 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/prereceivehooks" +) + +// ItemItemPreReceiveHooksRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pre-receive-hooks +type ItemItemPreReceiveHooksRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPreReceiveHooksRequestBuilderGetQueryParameters list all pre-receive hooks that are enabled or testing for this repository as well as any disabled hooks that are allowed to be enabled at the repository level. Pre-receive hooks that are disabled at a higher level and are not configurable will not be listed. +type ItemItemPreReceiveHooksRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *ica6934b4a373fa1659e9f86c88392ef5c7c24513cb1e02c6bad9849147d46e61.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + Sort *ica6934b4a373fa1659e9f86c88392ef5c7c24513cb1e02c6bad9849147d46e61.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByPre_receive_hook_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.preReceiveHooks.item collection +// returns a *ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder when successful +func (m *ItemItemPreReceiveHooksRequestBuilder) ByPre_receive_hook_id(pre_receive_hook_id int32)(*ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["pre_receive_hook_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(pre_receive_hook_id), 10) + return NewItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPreReceiveHooksRequestBuilderInternal instantiates a new ItemItemPreReceiveHooksRequestBuilder and sets the default values. +func NewItemItemPreReceiveHooksRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPreReceiveHooksRequestBuilder) { + m := &ItemItemPreReceiveHooksRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pre-receive-hooks{?direction*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewItemItemPreReceiveHooksRequestBuilder instantiates a new ItemItemPreReceiveHooksRequestBuilder and sets the default values. +func NewItemItemPreReceiveHooksRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPreReceiveHooksRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPreReceiveHooksRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all pre-receive hooks that are enabled or testing for this repository as well as any disabled hooks that are allowed to be enabled at the repository level. Pre-receive hooks that are disabled at a higher level and are not configurable will not be listed. +// returns a []RepositoryPreReceiveHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#list-pre-receive-hooks-for-a-repository +func (m *ItemItemPreReceiveHooksRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPreReceiveHooksRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryPreReceiveHookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryPreReceiveHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryPreReceiveHookable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryPreReceiveHookable) + } + } + return val, nil +} +// ToGetRequestInformation list all pre-receive hooks that are enabled or testing for this repository as well as any disabled hooks that are allowed to be enabled at the repository level. Pre-receive hooks that are disabled at a higher level and are not configurable will not be listed. +// returns a *RequestInformation when successful +func (m *ItemItemPreReceiveHooksRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPreReceiveHooksRequestBuilderGetQueryParameters])(*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 *ItemItemPreReceiveHooksRequestBuilder when successful +func (m *ItemItemPreReceiveHooksRequestBuilder) WithUrl(rawUrl string)(*ItemItemPreReceiveHooksRequestBuilder) { + return NewItemItemPreReceiveHooksRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pre_receive_hooks_with_pre_escaped_receive_escaped_hook_escaped_item_request_builder.go b/pkg/github/repos/item_item_pre_receive_hooks_with_pre_escaped_receive_escaped_hook_escaped_item_request_builder.go new file mode 100644 index 00000000..81aa92d6 --- /dev/null +++ b/pkg/github/repos/item_item_pre_receive_hooks_with_pre_escaped_receive_escaped_hook_escaped_item_request_builder.go @@ -0,0 +1,114 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pre-receive-hooks\{pre_receive_hook_id} +type ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilderInternal instantiates a new ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder and sets the default values. +func NewItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) { + m := &ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pre-receive-hooks/{pre_receive_hook_id}", pathParameters), + } + return m +} +// NewItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder instantiates a new ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder and sets the default values. +func NewItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes any overridden enforcement on this repository for the specified hook.Responds with effective values inherited from owner and/or global level. +// returns a RepositoryPreReceiveHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#remove-pre-receive-hook-enforcement-for-a-repository +func (m *ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryPreReceiveHookable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryPreReceiveHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryPreReceiveHookable), nil +} +// Get get a pre-receive hook for a repository +// returns a RepositoryPreReceiveHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#get-a-pre-receive-hook-for-a-repository +func (m *ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryPreReceiveHookable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryPreReceiveHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryPreReceiveHookable), nil +} +// Patch for pre-receive hooks which are allowed to be configured at the repo level, you can set `enforcement` +// returns a RepositoryPreReceiveHookable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/repo-pre-receive-hooks#update-pre-receive-hook-enforcement-for-a-repository +func (m *ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemPreReceiveHooksItemWithPre_receive_hook_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryPreReceiveHookable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryPreReceiveHookFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryPreReceiveHookable), nil +} +// ToDeleteRequestInformation deletes any overridden enforcement on this repository for the specified hook.Responds with effective values inherited from owner and/or global level. +// returns a *RequestInformation when successful +func (m *ItemItemPreReceiveHooksWithPre_receive_hook_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") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ItemItemPreReceiveHooksWithPre_receive_hook_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 for pre-receive hooks which are allowed to be configured at the repo level, you can set `enforcement` +// returns a *RequestInformation when successful +func (m *ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemPreReceiveHooksItemWithPre_receive_hook_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 *ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder when successful +func (m *ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder) { + return NewItemItemPreReceiveHooksWithPre_receive_hook_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_projects_post_request_body.go b/pkg/github/repos/item_item_projects_post_request_body.go new file mode 100644 index 00000000..8e34c902 --- /dev/null +++ b/pkg/github/repos/item_item_projects_post_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemProjectsPostRequestBody 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 the project. + body *string + // The name of the project. + name *string +} +// NewItemItemProjectsPostRequestBody instantiates a new ItemItemProjectsPostRequestBody and sets the default values. +func NewItemItemProjectsPostRequestBody()(*ItemItemProjectsPostRequestBody) { + m := &ItemItemProjectsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemProjectsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemProjectsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemProjectsPostRequestBody(), 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 *ItemItemProjectsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The description of the project. +// returns a *string when successful +func (m *ItemItemProjectsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemProjectsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(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 project. +// returns a *string when successful +func (m *ItemItemProjectsPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ItemItemProjectsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ItemItemProjectsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The description of the project. +func (m *ItemItemProjectsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetName sets the name property value. The name of the project. +func (m *ItemItemProjectsPostRequestBody) SetName(value *string)() { + m.name = value +} +type ItemItemProjectsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetName()(*string) + SetBody(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/repos/item_item_projects_request_builder.go b/pkg/github/repos/item_item_projects_request_builder.go new file mode 100644 index 00000000..ec6dc5c4 --- /dev/null +++ b/pkg/github/repos/item_item_projects_request_builder.go @@ -0,0 +1,125 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + iee5b7c7d9113cd9ef49922d6bc12f95d04aa74a59ef7ea6ccd6fa7b396d7923b "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/projects" +) + +// ItemItemProjectsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\projects +type ItemItemProjectsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemProjectsRequestBuilderGetQueryParameters lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +type ItemItemProjectsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Indicates the state of the projects to return. + State *iee5b7c7d9113cd9ef49922d6bc12f95d04aa74a59ef7ea6ccd6fa7b396d7923b.GetStateQueryParameterType `uriparametername:"state"` +} +// NewItemItemProjectsRequestBuilderInternal instantiates a new ItemItemProjectsRequestBuilder and sets the default values. +func NewItemItemProjectsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemProjectsRequestBuilder) { + m := &ItemItemProjectsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/projects{?page*,per_page*,state*}", pathParameters), + } + return m +} +// NewItemItemProjectsRequestBuilder instantiates a new ItemItemProjectsRequestBuilder and sets the default values. +func NewItemItemProjectsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemProjectsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemProjectsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a []Projectable 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 410 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/projects#list-repository-projects +func (m *ItemItemProjectsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemProjectsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable) + } + } + return val, nil +} +// Post creates a repository project board. Returns a `410 Gone` status if projects are disabled in the repository or if the repository does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a Projectable 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 410 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/projects#create-a-repository-project +func (m *ItemItemProjectsRequestBuilder) Post(ctx context.Context, body ItemItemProjectsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "410": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable), nil +} +// ToGetRequestInformation lists the projects in a repository. Returns a `404 Not Found` status if projects are disabled in the repository. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a *RequestInformation when successful +func (m *ItemItemProjectsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemProjectsRequestBuilderGetQueryParameters])(*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 repository project board. Returns a `410 Gone` status if projects are disabled in the repository or if the repository does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a *RequestInformation when successful +func (m *ItemItemProjectsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemProjectsPostRequestBodyable, 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 *ItemItemProjectsRequestBuilder when successful +func (m *ItemItemProjectsRequestBuilder) WithUrl(rawUrl string)(*ItemItemProjectsRequestBuilder) { + return NewItemItemProjectsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_properties_request_builder.go b/pkg/github/repos/item_item_properties_request_builder.go new file mode 100644 index 00000000..0ed8e862 --- /dev/null +++ b/pkg/github/repos/item_item_properties_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemPropertiesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\properties +type ItemItemPropertiesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPropertiesRequestBuilderInternal instantiates a new ItemItemPropertiesRequestBuilder and sets the default values. +func NewItemItemPropertiesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPropertiesRequestBuilder) { + m := &ItemItemPropertiesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/properties", pathParameters), + } + return m +} +// NewItemItemPropertiesRequestBuilder instantiates a new ItemItemPropertiesRequestBuilder and sets the default values. +func NewItemItemPropertiesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPropertiesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPropertiesRequestBuilderInternal(urlParams, requestAdapter) +} +// Values the values property +// returns a *ItemItemPropertiesValuesRequestBuilder when successful +func (m *ItemItemPropertiesRequestBuilder) Values()(*ItemItemPropertiesValuesRequestBuilder) { + return NewItemItemPropertiesValuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/repos/item_item_properties_values_patch_request_body.go b/pkg/github/repos/item_item_properties_values_patch_request_body.go new file mode 100644 index 00000000..cfb736c7 --- /dev/null +++ b/pkg/github/repos/item_item_properties_values_patch_request_body.go @@ -0,0 +1,93 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemPropertiesValuesPatchRequestBody 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 list of custom property names and associated values to apply to the repositories. + properties []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable +} +// NewItemItemPropertiesValuesPatchRequestBody instantiates a new ItemItemPropertiesValuesPatchRequestBody and sets the default values. +func NewItemItemPropertiesValuesPatchRequestBody()(*ItemItemPropertiesValuesPatchRequestBody) { + m := &ItemItemPropertiesValuesPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPropertiesValuesPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPropertiesValuesPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPropertiesValuesPatchRequestBody(), 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 *ItemItemPropertiesValuesPatchRequestBody) 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 *ItemItemPropertiesValuesPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["properties"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCustomPropertyValueFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable) + } + } + m.SetProperties(res) + } + return nil + } + return res +} +// GetProperties gets the properties property value. A list of custom property names and associated values to apply to the repositories. +// returns a []CustomPropertyValueable when successful +func (m *ItemItemPropertiesValuesPatchRequestBody) GetProperties()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable) { + return m.properties +} +// Serialize serializes information the current object +func (m *ItemItemPropertiesValuesPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetProperties() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetProperties())) + for i, v := range m.GetProperties() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("properties", 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 *ItemItemPropertiesValuesPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetProperties sets the properties property value. A list of custom property names and associated values to apply to the repositories. +func (m *ItemItemPropertiesValuesPatchRequestBody) SetProperties(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable)() { + m.properties = value +} +type ItemItemPropertiesValuesPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetProperties()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable) + SetProperties(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable)() +} diff --git a/pkg/github/repos/item_item_properties_values_request_builder.go b/pkg/github/repos/item_item_properties_values_request_builder.go new file mode 100644 index 00000000..a13a714f --- /dev/null +++ b/pkg/github/repos/item_item_properties_values_request_builder.go @@ -0,0 +1,101 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPropertiesValuesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\properties\values +type ItemItemPropertiesValuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPropertiesValuesRequestBuilderInternal instantiates a new ItemItemPropertiesValuesRequestBuilder and sets the default values. +func NewItemItemPropertiesValuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPropertiesValuesRequestBuilder) { + m := &ItemItemPropertiesValuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/properties/values", pathParameters), + } + return m +} +// NewItemItemPropertiesValuesRequestBuilder instantiates a new ItemItemPropertiesValuesRequestBuilder and sets the default values. +func NewItemItemPropertiesValuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPropertiesValuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPropertiesValuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets all custom property values that are set for a repository.Users with read access to the repository can use this endpoint. +// returns a []CustomPropertyValueable 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/enterprise-server@3.14/rest/repos/custom-properties#get-all-custom-property-values-for-a-repository +func (m *ItemItemPropertiesValuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCustomPropertyValueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CustomPropertyValueable) + } + } + return val, nil +} +// Patch create new or update existing custom property values for a repository.Using a value of `null` for a custom property will remove or 'unset' the property value from the repository.Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. +// 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/custom-properties#create-or-update-custom-property-values-for-a-repository +func (m *ItemItemPropertiesValuesRequestBuilder) Patch(ctx context.Context, body ItemItemPropertiesValuesPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets all custom property values that are set for a repository.Users with read access to the repository can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPropertiesValuesRequestBuilder) 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 create new or update existing custom property values for a repository.Using a value of `null` for a custom property will remove or 'unset' the property value from the repository.Repository admins and other users with the repository-level "edit custom property values" fine-grained permission can use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemItemPropertiesValuesRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemPropertiesValuesPatchRequestBodyable, 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 *ItemItemPropertiesValuesRequestBuilder when successful +func (m *ItemItemPropertiesValuesRequestBuilder) WithUrl(rawUrl string)(*ItemItemPropertiesValuesRequestBuilder) { + return NewItemItemPropertiesValuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_comments_item_reactions_post_request_body.go b/pkg/github/repos/item_item_pulls_comments_item_reactions_post_request_body.go new file mode 100644 index 00000000..27ac2c6a --- /dev/null +++ b/pkg/github/repos/item_item_pulls_comments_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsCommentsItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemPullsCommentsItemReactionsPostRequestBody instantiates a new ItemItemPullsCommentsItemReactionsPostRequestBody and sets the default values. +func NewItemItemPullsCommentsItemReactionsPostRequestBody()(*ItemItemPullsCommentsItemReactionsPostRequestBody) { + m := &ItemItemPullsCommentsItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsCommentsItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsCommentsItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsCommentsItemReactionsPostRequestBody(), 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 *ItemItemPullsCommentsItemReactionsPostRequestBody) 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 *ItemItemPullsCommentsItemReactionsPostRequestBody) 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 *ItemItemPullsCommentsItemReactionsPostRequestBody) 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 *ItemItemPullsCommentsItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemPullsCommentsItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_pulls_comments_item_reactions_request_builder.go b/pkg/github/repos/item_item_pulls_comments_item_reactions_request_builder.go new file mode 100644 index 00000000..a1463e6b --- /dev/null +++ b/pkg/github/repos/item_item_pulls_comments_item_reactions_request_builder.go @@ -0,0 +1,120 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i2cc6c579dc277888675f0cc7051bb5ee29007a09fd9058528d4f5ef3fcebd37b "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/pulls/comments/item/reactions" +) + +// ItemItemPullsCommentsItemReactionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\comments\{comment_id}\reactions +type ItemItemPullsCommentsItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsCommentsItemReactionsRequestBuilderGetQueryParameters list the reactions to a [pull request review comment](https://docs.github.com/enterprise-server@3.14/rest/pulls/comments#get-a-review-comment-for-a-pull-request). +type ItemItemPullsCommentsItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a pull request review comment. + Content *i2cc6c579dc277888675f0cc7051bb5ee29007a09fd9058528d4f5ef3fcebd37b.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReaction_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.pulls.comments.item.reactions.item collection +// returns a *ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemPullsCommentsItemReactionsRequestBuilder) ByReaction_id(reaction_id int32)(*ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["reaction_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(reaction_id), 10) + return NewItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPullsCommentsItemReactionsRequestBuilderInternal instantiates a new ItemItemPullsCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemItemPullsCommentsItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsItemReactionsRequestBuilder) { + m := &ItemItemPullsCommentsItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/comments/{comment_id}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemPullsCommentsItemReactionsRequestBuilder instantiates a new ItemItemPullsCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemItemPullsCommentsItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsCommentsItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the reactions to a [pull request review comment](https://docs.github.com/enterprise-server@3.14/rest/pulls/comments#get-a-review-comment-for-a-pull-request). +// returns a []Reactionable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-a-pull-request-review-comment +func (m *ItemItemPullsCommentsItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsCommentsItemReactionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable) + } + } + return val, nil +} +// Post create a reaction to a [pull request review comment](https://docs.github.com/enterprise-server@3.14/rest/pulls/comments#get-a-review-comment-for-a-pull-request). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment. +// returns a Reactionable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#create-reaction-for-a-pull-request-review-comment +func (m *ItemItemPullsCommentsItemReactionsRequestBuilder) Post(ctx context.Context, body ItemItemPullsCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable), nil +} +// ToGetRequestInformation list the reactions to a [pull request review comment](https://docs.github.com/enterprise-server@3.14/rest/pulls/comments#get-a-review-comment-for-a-pull-request). +// returns a *RequestInformation when successful +func (m *ItemItemPullsCommentsItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsCommentsItemReactionsRequestBuilderGetQueryParameters])(*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 create a reaction to a [pull request review comment](https://docs.github.com/enterprise-server@3.14/rest/pulls/comments#get-a-review-comment-for-a-pull-request). A response with an HTTP `200` status means that you already added the reaction type to this pull request review comment. +// returns a *RequestInformation when successful +func (m *ItemItemPullsCommentsItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsCommentsItemReactionsPostRequestBodyable, 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 *ItemItemPullsCommentsItemReactionsRequestBuilder when successful +func (m *ItemItemPullsCommentsItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsCommentsItemReactionsRequestBuilder) { + return NewItemItemPullsCommentsItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_comments_item_reactions_with_reaction_escaped_item_request_builder.go b/pkg/github/repos/item_item_pulls_comments_item_reactions_with_reaction_escaped_item_request_builder.go new file mode 100644 index 00000000..c4c4f8cd --- /dev/null +++ b/pkg/github/repos/item_item_pulls_comments_item_reactions_with_reaction_escaped_item_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\comments\{comment_id}\reactions\{reaction_id} +type ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilderInternal instantiates a new ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder) { + m := &ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/comments/{comment_id}/reactions/{reaction_id}", pathParameters), + } + return m +} +// NewItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder instantiates a new ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!NOTE]> You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.`Delete a reaction to a [pull request review comment](https://docs.github.com/enterprise-server@3.14/rest/pulls/comments#get-a-review-comment-for-a-pull-request). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#delete-a-pull-request-comment-reaction +func (m *ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation > [!NOTE]> You can also specify a repository by `repository_id` using the route `DELETE /repositories/:repository_id/pulls/comments/:comment_id/reactions/:reaction_id.`Delete a reaction to a [pull request review comment](https://docs.github.com/enterprise-server@3.14/rest/pulls/comments#get-a-review-comment-for-a-pull-request). +// returns a *RequestInformation when successful +func (m *ItemItemPullsCommentsItemReactionsWithReaction_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) + 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 *ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder) { + return NewItemItemPullsCommentsItemReactionsWithReaction_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_comments_item_with_comment_escaped_patch_request_body.go b/pkg/github/repos/item_item_pulls_comments_item_with_comment_escaped_patch_request_body.go new file mode 100644 index 00000000..60c34fe0 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_comments_item_with_comment_escaped_patch_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsCommentsItemWithComment_PatchRequestBody 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 text of the reply to the review comment. + body *string +} +// NewItemItemPullsCommentsItemWithComment_PatchRequestBody instantiates a new ItemItemPullsCommentsItemWithComment_PatchRequestBody and sets the default values. +func NewItemItemPullsCommentsItemWithComment_PatchRequestBody()(*ItemItemPullsCommentsItemWithComment_PatchRequestBody) { + m := &ItemItemPullsCommentsItemWithComment_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsCommentsItemWithComment_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsCommentsItemWithComment_PatchRequestBody(), 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 *ItemItemPullsCommentsItemWithComment_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The text of the reply to the review comment. +// returns a *string when successful +func (m *ItemItemPullsCommentsItemWithComment_PatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsCommentsItemWithComment_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPullsCommentsItemWithComment_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemItemPullsCommentsItemWithComment_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The text of the reply to the review comment. +func (m *ItemItemPullsCommentsItemWithComment_PatchRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemItemPullsCommentsItemWithComment_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/pkg/github/repos/item_item_pulls_comments_request_builder.go b/pkg/github/repos/item_item_pulls_comments_request_builder.go new file mode 100644 index 00000000..b0f57b32 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_comments_request_builder.go @@ -0,0 +1,85 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i1eb32cedc15edbe9c5f3a16c68b36f7841c39f3e9f6da62524bd9ebb3b990733 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/pulls/comments" +) + +// ItemItemPullsCommentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\comments +type ItemItemPullsCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsCommentsRequestBuilderGetQueryParameters lists review comments for all pull requests in a repository. By default,review comments are in ascending order by ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemPullsCommentsRequestBuilderGetQueryParameters struct { + // The direction to sort results. Ignored without `sort` parameter. + Direction *i1eb32cedc15edbe9c5f3a16c68b36f7841c39f3e9f6da62524bd9ebb3b990733.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + Sort *i1eb32cedc15edbe9c5f3a16c68b36f7841c39f3e9f6da62524bd9ebb3b990733.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByComment_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.pulls.comments.item collection +// returns a *ItemItemPullsCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemItemPullsCommentsRequestBuilder) ByComment_id(comment_id int64)(*ItemItemPullsCommentsWithComment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["comment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(comment_id, 10) + return NewItemItemPullsCommentsWithComment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPullsCommentsRequestBuilderInternal instantiates a new ItemItemPullsCommentsRequestBuilder and sets the default values. +func NewItemItemPullsCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsRequestBuilder) { + m := &ItemItemPullsCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/comments{?direction*,page*,per_page*,since*,sort*}", pathParameters), + } + return m +} +// NewItemItemPullsCommentsRequestBuilder instantiates a new ItemItemPullsCommentsRequestBuilder and sets the default values. +func NewItemItemPullsCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists review comments for all pull requests in a repository. By default,review comments are in ascending order by ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []PullRequestReviewCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/comments#list-review-comments-in-a-repository +func (m *ItemItemPullsCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsCommentsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestReviewCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewCommentable) + } + } + return val, nil +} +// ToGetRequestInformation lists review comments for all pull requests in a repository. By default,review comments are in ascending order by ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsCommentsRequestBuilderGetQueryParameters])(*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 *ItemItemPullsCommentsRequestBuilder when successful +func (m *ItemItemPullsCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsCommentsRequestBuilder) { + return NewItemItemPullsCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_comments_with_comment_escaped_item_request_builder.go b/pkg/github/repos/item_item_pulls_comments_with_comment_escaped_item_request_builder.go new file mode 100644 index 00000000..16754823 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_comments_with_comment_escaped_item_request_builder.go @@ -0,0 +1,124 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPullsCommentsWithComment_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\comments\{comment_id} +type ItemItemPullsCommentsWithComment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsCommentsWithComment_ItemRequestBuilderInternal instantiates a new ItemItemPullsCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemPullsCommentsWithComment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsWithComment_ItemRequestBuilder) { + m := &ItemItemPullsCommentsWithComment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/comments/{comment_id}", pathParameters), + } + return m +} +// NewItemItemPullsCommentsWithComment_ItemRequestBuilder instantiates a new ItemItemPullsCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemPullsCommentsWithComment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsCommentsWithComment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsCommentsWithComment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a review comment. +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/comments#delete-a-review-comment-for-a-pull-request +func (m *ItemItemPullsCommentsWithComment_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 { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get provides details for a specified review comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewCommentable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/comments#get-a-review-comment-for-a-pull-request +func (m *ItemItemPullsCommentsWithComment_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestReviewCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewCommentable), nil +} +// Patch edits the content of a specified review comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/comments#update-a-review-comment-for-a-pull-request +func (m *ItemItemPullsCommentsWithComment_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemPullsCommentsItemWithComment_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewCommentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestReviewCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewCommentable), nil +} +// Reactions the reactions property +// returns a *ItemItemPullsCommentsItemReactionsRequestBuilder when successful +func (m *ItemItemPullsCommentsWithComment_ItemRequestBuilder) Reactions()(*ItemItemPullsCommentsItemReactionsRequestBuilder) { + return NewItemItemPullsCommentsItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a review comment. +// returns a *RequestInformation when successful +func (m *ItemItemPullsCommentsWithComment_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") + return requestInfo, nil +} +// ToGetRequestInformation provides details for a specified review comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsCommentsWithComment_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 edits the content of a specified review comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsCommentsWithComment_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemPullsCommentsItemWithComment_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 *ItemItemPullsCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemItemPullsCommentsWithComment_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsCommentsWithComment_ItemRequestBuilder) { + return NewItemItemPullsCommentsWithComment_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_item_comments_item_replies_post_request_body.go b/pkg/github/repos/item_item_pulls_item_comments_item_replies_post_request_body.go new file mode 100644 index 00000000..fb82874a --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_comments_item_replies_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemCommentsItemRepliesPostRequestBody 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 text of the review comment. + body *string +} +// NewItemItemPullsItemCommentsItemRepliesPostRequestBody instantiates a new ItemItemPullsItemCommentsItemRepliesPostRequestBody and sets the default values. +func NewItemItemPullsItemCommentsItemRepliesPostRequestBody()(*ItemItemPullsItemCommentsItemRepliesPostRequestBody) { + m := &ItemItemPullsItemCommentsItemRepliesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemCommentsItemRepliesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemCommentsItemRepliesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemCommentsItemRepliesPostRequestBody(), 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 *ItemItemPullsItemCommentsItemRepliesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The text of the review comment. +// returns a *string when successful +func (m *ItemItemPullsItemCommentsItemRepliesPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemCommentsItemRepliesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemCommentsItemRepliesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemItemPullsItemCommentsItemRepliesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The text of the review comment. +func (m *ItemItemPullsItemCommentsItemRepliesPostRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemItemPullsItemCommentsItemRepliesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/pkg/github/repos/item_item_pulls_item_comments_item_replies_request_builder.go b/pkg/github/repos/item_item_pulls_item_comments_item_replies_request_builder.go new file mode 100644 index 00000000..597c5589 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_comments_item_replies_request_builder.go @@ -0,0 +1,65 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPullsItemCommentsItemRepliesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\comments\{comment_id}\replies +type ItemItemPullsItemCommentsItemRepliesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemCommentsItemRepliesRequestBuilderInternal instantiates a new ItemItemPullsItemCommentsItemRepliesRequestBuilder and sets the default values. +func NewItemItemPullsItemCommentsItemRepliesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommentsItemRepliesRequestBuilder) { + m := &ItemItemPullsItemCommentsItemRepliesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/comments/{comment_id}/replies", pathParameters), + } + return m +} +// NewItemItemPullsItemCommentsItemRepliesRequestBuilder instantiates a new ItemItemPullsItemCommentsItemRepliesRequestBuilder and sets the default values. +func NewItemItemPullsItemCommentsItemRepliesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommentsItemRepliesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemCommentsItemRepliesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a reply to a review comment for a pull request. For the `comment_id`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewCommentable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/comments#create-a-reply-for-a-review-comment +func (m *ItemItemPullsItemCommentsItemRepliesRequestBuilder) Post(ctx context.Context, body ItemItemPullsItemCommentsItemRepliesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewCommentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestReviewCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewCommentable), nil +} +// ToPostRequestInformation creates a reply to a review comment for a pull request. For the `comment_id`, provide the ID of the review comment you are replying to. This must be the ID of a _top-level review comment_, not a reply to that comment. Replies to replies are not supported.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemCommentsItemRepliesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsItemCommentsItemRepliesPostRequestBodyable, 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 *ItemItemPullsItemCommentsItemRepliesRequestBuilder when successful +func (m *ItemItemPullsItemCommentsItemRepliesRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemCommentsItemRepliesRequestBuilder) { + return NewItemItemPullsItemCommentsItemRepliesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_item_comments_post_request_body.go b/pkg/github/repos/item_item_pulls_item_comments_post_request_body.go new file mode 100644 index 00000000..c1503a5f --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_comments_post_request_body.go @@ -0,0 +1,257 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemCommentsPostRequestBody 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 text of the review comment. + body *string + // The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the `position`. + commit_id *string + // The ID of the review comment to reply to. To find the ID of a review comment with ["List review comments on a pull request"](#list-review-comments-on-a-pull-request). When specified, all parameters other than `body` in the request body are ignored. + in_reply_to *int32 + // **Required unless using `subject_type:file`**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to. + line *int32 + // The relative path to the file that necessitates a comment. + path *string + // **This parameter is deprecated. Use `line` instead**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. + // Deprecated: + position *int32 + // **Required when using multi-line comments unless using `in_reply_to`**. The `start_line` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see "[Commenting on a pull request](https://docs.github.com/enterprise-server@3.14/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. + start_line *int32 +} +// NewItemItemPullsItemCommentsPostRequestBody instantiates a new ItemItemPullsItemCommentsPostRequestBody and sets the default values. +func NewItemItemPullsItemCommentsPostRequestBody()(*ItemItemPullsItemCommentsPostRequestBody) { + m := &ItemItemPullsItemCommentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemCommentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemCommentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemCommentsPostRequestBody(), 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 *ItemItemPullsItemCommentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The text of the review comment. +// returns a *string when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetCommitId gets the commit_id property value. The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the `position`. +// returns a *string when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetCommitId()(*string) { + return m.commit_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + res["in_reply_to"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetInReplyTo(val) + } + return nil + } + res["line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLine(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + return res +} +// GetInReplyTo gets the in_reply_to property value. The ID of the review comment to reply to. To find the ID of a review comment with ["List review comments on a pull request"](#list-review-comments-on-a-pull-request). When specified, all parameters other than `body` in the request body are ignored. +// returns a *int32 when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetInReplyTo()(*int32) { + return m.in_reply_to +} +// GetLine gets the line property value. **Required unless using `subject_type:file`**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to. +// returns a *int32 when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetLine()(*int32) { + return m.line +} +// GetPath gets the path property value. The relative path to the file that necessitates a comment. +// returns a *string when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetPath()(*string) { + return m.path +} +// GetPosition gets the position property value. **This parameter is deprecated. Use `line` instead**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. +// Deprecated: +// returns a *int32 when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetPosition()(*int32) { + return m.position +} +// GetStartLine gets the start_line property value. **Required when using multi-line comments unless using `in_reply_to`**. The `start_line` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see "[Commenting on a pull request](https://docs.github.com/enterprise-server@3.14/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. +// returns a *int32 when successful +func (m *ItemItemPullsItemCommentsPostRequestBody) GetStartLine()(*int32) { + return m.start_line +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemCommentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("in_reply_to", m.GetInReplyTo()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("line", m.GetLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("position", m.GetPosition()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("start_line", m.GetStartLine()) + 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 *ItemItemPullsItemCommentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The text of the review comment. +func (m *ItemItemPullsItemCommentsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetCommitId sets the commit_id property value. The SHA of the commit needing a comment. Not using the latest commit SHA may render your comment outdated if a subsequent commit modifies the line you specify as the `position`. +func (m *ItemItemPullsItemCommentsPostRequestBody) SetCommitId(value *string)() { + m.commit_id = value +} +// SetInReplyTo sets the in_reply_to property value. The ID of the review comment to reply to. To find the ID of a review comment with ["List review comments on a pull request"](#list-review-comments-on-a-pull-request). When specified, all parameters other than `body` in the request body are ignored. +func (m *ItemItemPullsItemCommentsPostRequestBody) SetInReplyTo(value *int32)() { + m.in_reply_to = value +} +// SetLine sets the line property value. **Required unless using `subject_type:file`**. The line of the blob in the pull request diff that the comment applies to. For a multi-line comment, the last line of the range that your comment applies to. +func (m *ItemItemPullsItemCommentsPostRequestBody) SetLine(value *int32)() { + m.line = value +} +// SetPath sets the path property value. The relative path to the file that necessitates a comment. +func (m *ItemItemPullsItemCommentsPostRequestBody) SetPath(value *string)() { + m.path = value +} +// SetPosition sets the position property value. **This parameter is deprecated. Use `line` instead**. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The position value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. +// Deprecated: +func (m *ItemItemPullsItemCommentsPostRequestBody) SetPosition(value *int32)() { + m.position = value +} +// SetStartLine sets the start_line property value. **Required when using multi-line comments unless using `in_reply_to`**. The `start_line` is the first line in the pull request diff that your multi-line comment applies to. To learn more about multi-line comments, see "[Commenting on a pull request](https://docs.github.com/enterprise-server@3.14/articles/commenting-on-a-pull-request#adding-line-comments-to-a-pull-request)" in the GitHub Help documentation. +func (m *ItemItemPullsItemCommentsPostRequestBody) SetStartLine(value *int32)() { + m.start_line = value +} +type ItemItemPullsItemCommentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetCommitId()(*string) + GetInReplyTo()(*int32) + GetLine()(*int32) + GetPath()(*string) + GetPosition()(*int32) + GetStartLine()(*int32) + SetBody(value *string)() + SetCommitId(value *string)() + SetInReplyTo(value *int32)() + SetLine(value *int32)() + SetPath(value *string)() + SetPosition(value *int32)() + SetStartLine(value *int32)() +} diff --git a/pkg/github/repos/item_item_pulls_item_comments_request_builder.go b/pkg/github/repos/item_item_pulls_item_comments_request_builder.go new file mode 100644 index 00000000..11bb4f45 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_comments_request_builder.go @@ -0,0 +1,123 @@ +package repos + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ie2c5763c9cea95b2990b652292748d85a24bcc0c195a44fb88e497f5c49371b9 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/pulls/item/comments" +) + +// ItemItemPullsItemCommentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\comments +type ItemItemPullsItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsItemCommentsRequestBuilderGetQueryParameters lists all review comments for a specified pull request. By default, review commentsare in ascending order by ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemPullsItemCommentsRequestBuilderGetQueryParameters struct { + // The direction to sort results. Ignored without `sort` parameter. + Direction *ie2c5763c9cea95b2990b652292748d85a24bcc0c195a44fb88e497f5c49371b9.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // The property to sort the results by. + Sort *ie2c5763c9cea95b2990b652292748d85a24bcc0c195a44fb88e497f5c49371b9.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByComment_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.pulls.item.comments.item collection +// returns a *ItemItemPullsItemCommentsWithComment_ItemRequestBuilder when successful +func (m *ItemItemPullsItemCommentsRequestBuilder) ByComment_id(comment_id int64)(*ItemItemPullsItemCommentsWithComment_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["comment_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(comment_id, 10) + return NewItemItemPullsItemCommentsWithComment_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPullsItemCommentsRequestBuilderInternal instantiates a new ItemItemPullsItemCommentsRequestBuilder and sets the default values. +func NewItemItemPullsItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommentsRequestBuilder) { + m := &ItemItemPullsItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/comments{?direction*,page*,per_page*,since*,sort*}", pathParameters), + } + return m +} +// NewItemItemPullsItemCommentsRequestBuilder instantiates a new ItemItemPullsItemCommentsRequestBuilder and sets the default values. +func NewItemItemPullsItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all review comments for a specified pull request. By default, review commentsare in ascending order by ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []PullRequestReviewCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/comments#list-review-comments-on-a-pull-request +func (m *ItemItemPullsItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemCommentsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestReviewCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewCommentable) + } + } + return val, nil +} +// Post creates a review comment on the diff of a specified pull request. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/enterprise-server@3.14/rest/issues/comments#create-an-issue-comment)."If your comment applies to more than one line in the pull request diff, you should use the parameters `line`, `side`, and optionally `start_line` and `start_side` in your request.The `position` parameter is deprecated. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewCommentable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/comments#create-a-review-comment-for-a-pull-request +func (m *ItemItemPullsItemCommentsRequestBuilder) Post(ctx context.Context, body ItemItemPullsItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewCommentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestReviewCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewCommentable), nil +} +// ToGetRequestInformation lists all review comments for a specified pull request. By default, review commentsare in ascending order by ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemCommentsRequestBuilderGetQueryParameters])(*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 review comment on the diff of a specified pull request. To add a regular comment to a pull request timeline, see "[Create an issue comment](https://docs.github.com/enterprise-server@3.14/rest/issues/comments#create-an-issue-comment)."If your comment applies to more than one line in the pull request diff, you should use the parameters `line`, `side`, and optionally `start_line` and `start_side` in your request.The `position` parameter is deprecated. If you use `position`, the `line`, `side`, `start_line`, and `start_side` parameters are not required.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)"and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemCommentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsItemCommentsPostRequestBodyable, 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 *ItemItemPullsItemCommentsRequestBuilder when successful +func (m *ItemItemPullsItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemCommentsRequestBuilder) { + return NewItemItemPullsItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_item_comments_with_comment_escaped_item_request_builder.go b/pkg/github/repos/item_item_pulls_item_comments_with_comment_escaped_item_request_builder.go new file mode 100644 index 00000000..9ab0a753 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_comments_with_comment_escaped_item_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemPullsItemCommentsWithComment_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\comments\{comment_id} +type ItemItemPullsItemCommentsWithComment_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemCommentsWithComment_ItemRequestBuilderInternal instantiates a new ItemItemPullsItemCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemPullsItemCommentsWithComment_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommentsWithComment_ItemRequestBuilder) { + m := &ItemItemPullsItemCommentsWithComment_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/comments/{comment_id}", pathParameters), + } + return m +} +// NewItemItemPullsItemCommentsWithComment_ItemRequestBuilder instantiates a new ItemItemPullsItemCommentsWithComment_ItemRequestBuilder and sets the default values. +func NewItemItemPullsItemCommentsWithComment_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommentsWithComment_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemCommentsWithComment_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Replies the replies property +// returns a *ItemItemPullsItemCommentsItemRepliesRequestBuilder when successful +func (m *ItemItemPullsItemCommentsWithComment_ItemRequestBuilder) Replies()(*ItemItemPullsItemCommentsItemRepliesRequestBuilder) { + return NewItemItemPullsItemCommentsItemRepliesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/repos/item_item_pulls_item_commits_request_builder.go b/pkg/github/repos/item_item_pulls_item_commits_request_builder.go new file mode 100644 index 00000000..80adbe84 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_commits_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPullsItemCommitsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\commits +type ItemItemPullsItemCommitsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsItemCommitsRequestBuilderGetQueryParameters lists a maximum of 250 commits for a pull request. To receive a completecommit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/enterprise-server@3.14/rest/commits/commits#list-commits)endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemPullsItemCommitsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemPullsItemCommitsRequestBuilderInternal instantiates a new ItemItemPullsItemCommitsRequestBuilder and sets the default values. +func NewItemItemPullsItemCommitsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommitsRequestBuilder) { + m := &ItemItemPullsItemCommitsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/commits{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemPullsItemCommitsRequestBuilder instantiates a new ItemItemPullsItemCommitsRequestBuilder and sets the default values. +func NewItemItemPullsItemCommitsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemCommitsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemCommitsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists a maximum of 250 commits for a pull request. To receive a completecommit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/enterprise-server@3.14/rest/commits/commits#list-commits)endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []Commitable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-commits-on-a-pull-request +func (m *ItemItemPullsItemCommitsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemCommitsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Commitable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCommitFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Commitable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Commitable) + } + } + return val, nil +} +// ToGetRequestInformation lists a maximum of 250 commits for a pull request. To receive a completecommit list for pull requests with more than 250 commits, use the [List commits](https://docs.github.com/enterprise-server@3.14/rest/commits/commits#list-commits)endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemCommitsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemCommitsRequestBuilderGetQueryParameters])(*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 *ItemItemPullsItemCommitsRequestBuilder when successful +func (m *ItemItemPullsItemCommitsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemCommitsRequestBuilder) { + return NewItemItemPullsItemCommitsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_item_files_request_builder.go b/pkg/github/repos/item_item_pulls_item_files_request_builder.go new file mode 100644 index 00000000..1edc7057 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_files_request_builder.go @@ -0,0 +1,75 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPullsItemFilesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\files +type ItemItemPullsItemFilesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsItemFilesRequestBuilderGetQueryParameters lists the files in a specified pull request.> [!NOTE]> Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemPullsItemFilesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemPullsItemFilesRequestBuilderInternal instantiates a new ItemItemPullsItemFilesRequestBuilder and sets the default values. +func NewItemItemPullsItemFilesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemFilesRequestBuilder) { + m := &ItemItemPullsItemFilesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/files{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemPullsItemFilesRequestBuilder instantiates a new ItemItemPullsItemFilesRequestBuilder and sets the default values. +func NewItemItemPullsItemFilesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemFilesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemFilesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the files in a specified pull request.> [!NOTE]> Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []DiffEntryable when successful +// returns a ValidationError error when the service returns a 422 status code +// returns a BasicError error when the service returns a 500 status code +// returns a Files503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests-files +func (m *ItemItemPullsItemFilesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemFilesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DiffEntryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateFiles503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateDiffEntryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DiffEntryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.DiffEntryable) + } + } + return val, nil +} +// ToGetRequestInformation lists the files in a specified pull request.> [!NOTE]> Responses include a maximum of 3000 files. The paginated response returns 30 files per page by default.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemFilesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemFilesRequestBuilderGetQueryParameters])(*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 *ItemItemPullsItemFilesRequestBuilder when successful +func (m *ItemItemPullsItemFilesRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemFilesRequestBuilder) { + return NewItemItemPullsItemFilesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_item_merge_put_request_body.go b/pkg/github/repos/item_item_pulls_item_merge_put_request_body.go new file mode 100644 index 00000000..f1a9d485 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_merge_put_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemMergePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Extra detail to append to automatic commit message. + commit_message *string + // Title for the automatic commit message. + commit_title *string + // SHA that pull request head must match to allow merge. + sha *string +} +// NewItemItemPullsItemMergePutRequestBody instantiates a new ItemItemPullsItemMergePutRequestBody and sets the default values. +func NewItemItemPullsItemMergePutRequestBody()(*ItemItemPullsItemMergePutRequestBody) { + m := &ItemItemPullsItemMergePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemMergePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemMergePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemMergePutRequestBody(), 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 *ItemItemPullsItemMergePutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetCommitMessage gets the commit_message property value. Extra detail to append to automatic commit message. +// returns a *string when successful +func (m *ItemItemPullsItemMergePutRequestBody) GetCommitMessage()(*string) { + return m.commit_message +} +// GetCommitTitle gets the commit_title property value. Title for the automatic commit message. +// returns a *string when successful +func (m *ItemItemPullsItemMergePutRequestBody) GetCommitTitle()(*string) { + return m.commit_title +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemMergePutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["commit_message"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitMessage(val) + } + return nil + } + res["commit_title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitTitle(val) + } + return nil + } + res["sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSha(val) + } + return nil + } + return res +} +// GetSha gets the sha property value. SHA that pull request head must match to allow merge. +// returns a *string when successful +func (m *ItemItemPullsItemMergePutRequestBody) GetSha()(*string) { + return m.sha +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemMergePutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("commit_message", m.GetCommitMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_title", m.GetCommitTitle()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("sha", m.GetSha()) + 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 *ItemItemPullsItemMergePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetCommitMessage sets the commit_message property value. Extra detail to append to automatic commit message. +func (m *ItemItemPullsItemMergePutRequestBody) SetCommitMessage(value *string)() { + m.commit_message = value +} +// SetCommitTitle sets the commit_title property value. Title for the automatic commit message. +func (m *ItemItemPullsItemMergePutRequestBody) SetCommitTitle(value *string)() { + m.commit_title = value +} +// SetSha sets the sha property value. SHA that pull request head must match to allow merge. +func (m *ItemItemPullsItemMergePutRequestBody) SetSha(value *string)() { + m.sha = value +} +type ItemItemPullsItemMergePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetCommitMessage()(*string) + GetCommitTitle()(*string) + GetSha()(*string) + SetCommitMessage(value *string)() + SetCommitTitle(value *string)() + SetSha(value *string)() +} diff --git a/pkg/github/repos/item_item_pulls_item_merge_request_builder.go b/pkg/github/repos/item_item_pulls_item_merge_request_builder.go new file mode 100644 index 00000000..827a47b9 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_merge_request_builder.go @@ -0,0 +1,95 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPullsItemMergeRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\merge +type ItemItemPullsItemMergeRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemMergeRequestBuilderInternal instantiates a new ItemItemPullsItemMergeRequestBuilder and sets the default values. +func NewItemItemPullsItemMergeRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemMergeRequestBuilder) { + m := &ItemItemPullsItemMergeRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/merge", pathParameters), + } + return m +} +// NewItemItemPullsItemMergeRequestBuilder instantiates a new ItemItemPullsItemMergeRequestBuilder and sets the default values. +func NewItemItemPullsItemMergeRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemMergeRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemMergeRequestBuilderInternal(urlParams, requestAdapter) +} +// Get checks if a pull request has been merged into the base branch. The HTTP status of the response indicates whether or not the pull request has been merged; the response body is empty. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#check-if-a-pull-request-has-been-merged +func (m *ItemItemPullsItemMergeRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put merges a pull request into the base branch.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)." +// returns a PullRequestMergeResultable 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 ItemItemPullsItemPullRequestMergeResult405Error error when the service returns a 405 status code +// returns a ItemItemPullsItemPullRequestMergeResult409Error error when the service returns a 409 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#merge-a-pull-request +func (m *ItemItemPullsItemMergeRequestBuilder) Put(ctx context.Context, body ItemItemPullsItemMergePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestMergeResultable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "405": CreateItemItemPullsItemPullRequestMergeResult405ErrorFromDiscriminatorValue, + "409": CreateItemItemPullsItemPullRequestMergeResult409ErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestMergeResultFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestMergeResultable), nil +} +// ToGetRequestInformation checks if a pull request has been merged into the base branch. The HTTP status of the response indicates whether or not the pull request has been merged; the response body is empty. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemMergeRequestBuilder) 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) + return requestInfo, nil +} +// ToPutRequestInformation merges a pull request into the base branch.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)." +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemMergeRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemPullsItemMergePutRequestBodyable, 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 *ItemItemPullsItemMergeRequestBuilder when successful +func (m *ItemItemPullsItemMergeRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemMergeRequestBuilder) { + return NewItemItemPullsItemMergeRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_item_pull_request_merge_result405_error.go b/pkg/github/repos/item_item_pulls_item_pull_request_merge_result405_error.go new file mode 100644 index 00000000..81a20746 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_pull_request_merge_result405_error.go @@ -0,0 +1,117 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemPullRequestMergeResult405Error 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 documentation_url property + documentation_url *string + // The message property + message *string +} +// NewItemItemPullsItemPullRequestMergeResult405Error instantiates a new ItemItemPullsItemPullRequestMergeResult405Error and sets the default values. +func NewItemItemPullsItemPullRequestMergeResult405Error()(*ItemItemPullsItemPullRequestMergeResult405Error) { + m := &ItemItemPullsItemPullRequestMergeResult405Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemPullRequestMergeResult405ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemPullRequestMergeResult405ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemPullRequestMergeResult405Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemItemPullsItemPullRequestMergeResult405Error) 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 *ItemItemPullsItemPullRequestMergeResult405Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemItemPullsItemPullRequestMergeResult405Error) 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 *ItemItemPullsItemPullRequestMergeResult405Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 *ItemItemPullsItemPullRequestMergeResult405Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemPullRequestMergeResult405Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemPullsItemPullRequestMergeResult405Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemItemPullsItemPullRequestMergeResult405Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ItemItemPullsItemPullRequestMergeResult405Error) SetMessage(value *string)() { + m.message = value +} +type ItemItemPullsItemPullRequestMergeResult405Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/pkg/github/repos/item_item_pulls_item_pull_request_merge_result409_error.go b/pkg/github/repos/item_item_pulls_item_pull_request_merge_result409_error.go new file mode 100644 index 00000000..0ffb26f6 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_pull_request_merge_result409_error.go @@ -0,0 +1,117 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemPullRequestMergeResult409Error 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 documentation_url property + documentation_url *string + // The message property + message *string +} +// NewItemItemPullsItemPullRequestMergeResult409Error instantiates a new ItemItemPullsItemPullRequestMergeResult409Error and sets the default values. +func NewItemItemPullsItemPullRequestMergeResult409Error()(*ItemItemPullsItemPullRequestMergeResult409Error) { + m := &ItemItemPullsItemPullRequestMergeResult409Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemPullRequestMergeResult409ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemPullRequestMergeResult409ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemPullRequestMergeResult409Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemItemPullsItemPullRequestMergeResult409Error) 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 *ItemItemPullsItemPullRequestMergeResult409Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemItemPullsItemPullRequestMergeResult409Error) 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 *ItemItemPullsItemPullRequestMergeResult409Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 *ItemItemPullsItemPullRequestMergeResult409Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemPullRequestMergeResult409Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemPullsItemPullRequestMergeResult409Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemItemPullsItemPullRequestMergeResult409Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ItemItemPullsItemPullRequestMergeResult409Error) SetMessage(value *string)() { + m.message = value +} +type ItemItemPullsItemPullRequestMergeResult409Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/pkg/github/repos/item_item_pulls_item_requested_escaped_reviewers_delete_request_body.go b/pkg/github/repos/item_item_pulls_item_requested_escaped_reviewers_delete_request_body.go new file mode 100644 index 00000000..c463cd16 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_requested_escaped_reviewers_delete_request_body.go @@ -0,0 +1,121 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemRequested_reviewersDeleteRequestBody 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 array of user `login`s that will be removed. + reviewers []string + // An array of team `slug`s that will be removed. + team_reviewers []string +} +// NewItemItemPullsItemRequested_reviewersDeleteRequestBody instantiates a new ItemItemPullsItemRequested_reviewersDeleteRequestBody and sets the default values. +func NewItemItemPullsItemRequested_reviewersDeleteRequestBody()(*ItemItemPullsItemRequested_reviewersDeleteRequestBody) { + m := &ItemItemPullsItemRequested_reviewersDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemRequested_reviewersDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemRequested_reviewersDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemRequested_reviewersDeleteRequestBody(), 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 *ItemItemPullsItemRequested_reviewersDeleteRequestBody) 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 *ItemItemPullsItemRequested_reviewersDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["reviewers"] = 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.SetReviewers(res) + } + return nil + } + res["team_reviewers"] = 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.SetTeamReviewers(res) + } + return nil + } + return res +} +// GetReviewers gets the reviewers property value. An array of user `login`s that will be removed. +// returns a []string when successful +func (m *ItemItemPullsItemRequested_reviewersDeleteRequestBody) GetReviewers()([]string) { + return m.reviewers +} +// GetTeamReviewers gets the team_reviewers property value. An array of team `slug`s that will be removed. +// returns a []string when successful +func (m *ItemItemPullsItemRequested_reviewersDeleteRequestBody) GetTeamReviewers()([]string) { + return m.team_reviewers +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemRequested_reviewersDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetReviewers() != nil { + err := writer.WriteCollectionOfStringValues("reviewers", m.GetReviewers()) + if err != nil { + return err + } + } + if m.GetTeamReviewers() != nil { + err := writer.WriteCollectionOfStringValues("team_reviewers", m.GetTeamReviewers()) + 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 *ItemItemPullsItemRequested_reviewersDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetReviewers sets the reviewers property value. An array of user `login`s that will be removed. +func (m *ItemItemPullsItemRequested_reviewersDeleteRequestBody) SetReviewers(value []string)() { + m.reviewers = value +} +// SetTeamReviewers sets the team_reviewers property value. An array of team `slug`s that will be removed. +func (m *ItemItemPullsItemRequested_reviewersDeleteRequestBody) SetTeamReviewers(value []string)() { + m.team_reviewers = value +} +type ItemItemPullsItemRequested_reviewersDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetReviewers()([]string) + GetTeamReviewers()([]string) + SetReviewers(value []string)() + SetTeamReviewers(value []string)() +} diff --git a/pkg/github/repos/item_item_pulls_item_requested_escaped_reviewers_post_request_body.go b/pkg/github/repos/item_item_pulls_item_requested_escaped_reviewers_post_request_body.go new file mode 100644 index 00000000..878559f9 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_requested_escaped_reviewers_post_request_body.go @@ -0,0 +1,121 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemRequested_reviewersPostRequestBody 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 array of user `login`s that will be requested. + reviewers []string + // An array of team `slug`s that will be requested. + team_reviewers []string +} +// NewItemItemPullsItemRequested_reviewersPostRequestBody instantiates a new ItemItemPullsItemRequested_reviewersPostRequestBody and sets the default values. +func NewItemItemPullsItemRequested_reviewersPostRequestBody()(*ItemItemPullsItemRequested_reviewersPostRequestBody) { + m := &ItemItemPullsItemRequested_reviewersPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemRequested_reviewersPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemRequested_reviewersPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemRequested_reviewersPostRequestBody(), 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 *ItemItemPullsItemRequested_reviewersPostRequestBody) 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 *ItemItemPullsItemRequested_reviewersPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["reviewers"] = 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.SetReviewers(res) + } + return nil + } + res["team_reviewers"] = 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.SetTeamReviewers(res) + } + return nil + } + return res +} +// GetReviewers gets the reviewers property value. An array of user `login`s that will be requested. +// returns a []string when successful +func (m *ItemItemPullsItemRequested_reviewersPostRequestBody) GetReviewers()([]string) { + return m.reviewers +} +// GetTeamReviewers gets the team_reviewers property value. An array of team `slug`s that will be requested. +// returns a []string when successful +func (m *ItemItemPullsItemRequested_reviewersPostRequestBody) GetTeamReviewers()([]string) { + return m.team_reviewers +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemRequested_reviewersPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetReviewers() != nil { + err := writer.WriteCollectionOfStringValues("reviewers", m.GetReviewers()) + if err != nil { + return err + } + } + if m.GetTeamReviewers() != nil { + err := writer.WriteCollectionOfStringValues("team_reviewers", m.GetTeamReviewers()) + 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 *ItemItemPullsItemRequested_reviewersPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetReviewers sets the reviewers property value. An array of user `login`s that will be requested. +func (m *ItemItemPullsItemRequested_reviewersPostRequestBody) SetReviewers(value []string)() { + m.reviewers = value +} +// SetTeamReviewers sets the team_reviewers property value. An array of team `slug`s that will be requested. +func (m *ItemItemPullsItemRequested_reviewersPostRequestBody) SetTeamReviewers(value []string)() { + m.team_reviewers = value +} +type ItemItemPullsItemRequested_reviewersPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetReviewers()([]string) + GetTeamReviewers()([]string) + SetReviewers(value []string)() + SetTeamReviewers(value []string)() +} diff --git a/pkg/github/repos/item_item_pulls_item_requested_escaped_reviewers_request_builder.go b/pkg/github/repos/item_item_pulls_item_requested_escaped_reviewers_request_builder.go new file mode 100644 index 00000000..eb8a55bf --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_requested_escaped_reviewers_request_builder.go @@ -0,0 +1,127 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPullsItemRequested_reviewersRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\requested_reviewers +type ItemItemPullsItemRequested_reviewersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemRequested_reviewersRequestBuilderInternal instantiates a new ItemItemPullsItemRequested_reviewersRequestBuilder and sets the default values. +func NewItemItemPullsItemRequested_reviewersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemRequested_reviewersRequestBuilder) { + m := &ItemItemPullsItemRequested_reviewersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/requested_reviewers", pathParameters), + } + return m +} +// NewItemItemPullsItemRequested_reviewersRequestBuilder instantiates a new ItemItemPullsItemRequested_reviewersRequestBuilder and sets the default values. +func NewItemItemPullsItemRequested_reviewersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemRequested_reviewersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemRequested_reviewersRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes review requests from a pull request for a given set of users and/or teams. +// returns a PullRequestSimpleable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/review-requests#remove-requested-reviewers-from-a-pull-request +func (m *ItemItemPullsItemRequested_reviewersRequestBuilder) Delete(ctx context.Context, body ItemItemPullsItemRequested_reviewersDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestSimpleable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestSimpleable), nil +} +// Get gets the users or teams whose review is requested for a pull request. Once a requested reviewer submits a review, they are no longer considered a requested reviewer. Their review will instead be returned by the [List reviews for a pull request](https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#list-reviews-for-a-pull-request) operation. +// returns a PullRequestReviewRequestable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/review-requests#get-all-requested-reviewers-for-a-pull-request +func (m *ItemItemPullsItemRequested_reviewersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewRequestable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestReviewRequestFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewRequestable), nil +} +// Post requests reviews for a pull request from a given set of users and/or teams.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)." +// returns a PullRequestSimpleable when successful +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/review-requests#request-reviewers-for-a-pull-request +func (m *ItemItemPullsItemRequested_reviewersRequestBuilder) Post(ctx context.Context, body ItemItemPullsItemRequested_reviewersPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestSimpleable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestSimpleable), nil +} +// ToDeleteRequestInformation removes review requests from a pull request for a given set of users and/or teams. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemRequested_reviewersRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ItemItemPullsItemRequested_reviewersDeleteRequestBodyable, 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") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation gets the users or teams whose review is requested for a pull request. Once a requested reviewer submits a review, they are no longer considered a requested reviewer. Their review will instead be returned by the [List reviews for a pull request](https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#list-reviews-for-a-pull-request) operation. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemRequested_reviewersRequestBuilder) 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 requests reviews for a pull request from a given set of users and/or teams.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)." +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemRequested_reviewersRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsItemRequested_reviewersPostRequestBodyable, 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 *ItemItemPullsItemRequested_reviewersRequestBuilder when successful +func (m *ItemItemPullsItemRequested_reviewersRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemRequested_reviewersRequestBuilder) { + return NewItemItemPullsItemRequested_reviewersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_item_reviews_item_comments_request_builder.go b/pkg/github/repos/item_item_pulls_item_reviews_item_comments_request_builder.go new file mode 100644 index 00000000..9240e40d --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_reviews_item_comments_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPullsItemReviewsItemCommentsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\reviews\{review_id}\comments +type ItemItemPullsItemReviewsItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsItemReviewsItemCommentsRequestBuilderGetQueryParameters lists comments for a specific pull request review.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemPullsItemReviewsItemCommentsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemPullsItemReviewsItemCommentsRequestBuilderInternal instantiates a new ItemItemPullsItemReviewsItemCommentsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsItemCommentsRequestBuilder) { + m := &ItemItemPullsItemReviewsItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/reviews/{review_id}/comments{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemPullsItemReviewsItemCommentsRequestBuilder instantiates a new ItemItemPullsItemReviewsItemCommentsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemReviewsItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists comments for a specific pull request review.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []ReviewCommentable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#list-comments-for-a-pull-request-review +func (m *ItemItemPullsItemReviewsItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemReviewsItemCommentsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReviewCommentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReviewCommentable) + } + } + return val, nil +} +// ToGetRequestInformation lists comments for a specific pull request review.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemReviewsItemCommentsRequestBuilderGetQueryParameters])(*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 *ItemItemPullsItemReviewsItemCommentsRequestBuilder when successful +func (m *ItemItemPullsItemReviewsItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemReviewsItemCommentsRequestBuilder) { + return NewItemItemPullsItemReviewsItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_item_reviews_item_dismissals_put_request_body.go b/pkg/github/repos/item_item_pulls_item_reviews_item_dismissals_put_request_body.go new file mode 100644 index 00000000..729c18a0 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_reviews_item_dismissals_put_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemReviewsItemDismissalsPutRequestBody 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 message for the pull request review dismissal + message *string +} +// NewItemItemPullsItemReviewsItemDismissalsPutRequestBody instantiates a new ItemItemPullsItemReviewsItemDismissalsPutRequestBody and sets the default values. +func NewItemItemPullsItemReviewsItemDismissalsPutRequestBody()(*ItemItemPullsItemReviewsItemDismissalsPutRequestBody) { + m := &ItemItemPullsItemReviewsItemDismissalsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemReviewsItemDismissalsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemReviewsItemDismissalsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemReviewsItemDismissalsPutRequestBody(), 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 *ItemItemPullsItemReviewsItemDismissalsPutRequestBody) 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 *ItemItemPullsItemReviewsItemDismissalsPutRequestBody) 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 + } + return res +} +// GetMessage gets the message property value. The message for the pull request review dismissal +// returns a *string when successful +func (m *ItemItemPullsItemReviewsItemDismissalsPutRequestBody) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemReviewsItemDismissalsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemPullsItemReviewsItemDismissalsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The message for the pull request review dismissal +func (m *ItemItemPullsItemReviewsItemDismissalsPutRequestBody) SetMessage(value *string)() { + m.message = value +} +type ItemItemPullsItemReviewsItemDismissalsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + SetMessage(value *string)() +} diff --git a/pkg/github/repos/item_item_pulls_item_reviews_item_dismissals_request_builder.go b/pkg/github/repos/item_item_pulls_item_reviews_item_dismissals_request_builder.go new file mode 100644 index 00000000..01d7203c --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_reviews_item_dismissals_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPullsItemReviewsItemDismissalsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\reviews\{review_id}\dismissals +type ItemItemPullsItemReviewsItemDismissalsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemReviewsItemDismissalsRequestBuilderInternal instantiates a new ItemItemPullsItemReviewsItemDismissalsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsItemDismissalsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsItemDismissalsRequestBuilder) { + m := &ItemItemPullsItemReviewsItemDismissalsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/reviews/{review_id}/dismissals", pathParameters), + } + return m +} +// NewItemItemPullsItemReviewsItemDismissalsRequestBuilder instantiates a new ItemItemPullsItemReviewsItemDismissalsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsItemDismissalsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsItemDismissalsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemReviewsItemDismissalsRequestBuilderInternal(urlParams, requestAdapter) +} +// Put dismisses a specified review on a pull request.> [!NOTE]> To dismiss a pull request review on a [protected branch](https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#dismiss-a-review-for-a-pull-request +func (m *ItemItemPullsItemReviewsItemDismissalsRequestBuilder) Put(ctx context.Context, body ItemItemPullsItemReviewsItemDismissalsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestReviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable), nil +} +// ToPutRequestInformation dismisses a specified review on a pull request.> [!NOTE]> To dismiss a pull request review on a [protected branch](https://docs.github.com/enterprise-server@3.14/rest/branches/branch-protection), you must be a repository administrator or be included in the list of people or teams who can dismiss pull request reviews.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsItemDismissalsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemPullsItemReviewsItemDismissalsPutRequestBodyable, 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 *ItemItemPullsItemReviewsItemDismissalsRequestBuilder when successful +func (m *ItemItemPullsItemReviewsItemDismissalsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemReviewsItemDismissalsRequestBuilder) { + return NewItemItemPullsItemReviewsItemDismissalsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_item_reviews_item_events_post_request_body.go b/pkg/github/repos/item_item_pulls_item_reviews_item_events_post_request_body.go new file mode 100644 index 00000000..fb650795 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_reviews_item_events_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemReviewsItemEventsPostRequestBody 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 body text of the pull request review + body *string +} +// NewItemItemPullsItemReviewsItemEventsPostRequestBody instantiates a new ItemItemPullsItemReviewsItemEventsPostRequestBody and sets the default values. +func NewItemItemPullsItemReviewsItemEventsPostRequestBody()(*ItemItemPullsItemReviewsItemEventsPostRequestBody) { + m := &ItemItemPullsItemReviewsItemEventsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemReviewsItemEventsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemReviewsItemEventsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemReviewsItemEventsPostRequestBody(), 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 *ItemItemPullsItemReviewsItemEventsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The body text of the pull request review +// returns a *string when successful +func (m *ItemItemPullsItemReviewsItemEventsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemReviewsItemEventsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemReviewsItemEventsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemItemPullsItemReviewsItemEventsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The body text of the pull request review +func (m *ItemItemPullsItemReviewsItemEventsPostRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemItemPullsItemReviewsItemEventsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/pkg/github/repos/item_item_pulls_item_reviews_item_events_request_builder.go b/pkg/github/repos/item_item_pulls_item_reviews_item_events_request_builder.go new file mode 100644 index 00000000..7d75896b --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_reviews_item_events_request_builder.go @@ -0,0 +1,69 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPullsItemReviewsItemEventsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\reviews\{review_id}\events +type ItemItemPullsItemReviewsItemEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemReviewsItemEventsRequestBuilderInternal instantiates a new ItemItemPullsItemReviewsItemEventsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsItemEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsItemEventsRequestBuilder) { + m := &ItemItemPullsItemReviewsItemEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/reviews/{review_id}/events", pathParameters), + } + return m +} +// NewItemItemPullsItemReviewsItemEventsRequestBuilder instantiates a new ItemItemPullsItemReviewsItemEventsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsItemEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsItemEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemReviewsItemEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post submits a pending review for a pull request. For more information about creating a pending review for a pull request, see "[Create a review for a pull request](https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#create-a-review-for-a-pull-request)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewable 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 ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#submit-a-review-for-a-pull-request +func (m *ItemItemPullsItemReviewsItemEventsRequestBuilder) Post(ctx context.Context, body ItemItemPullsItemReviewsItemEventsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestReviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable), nil +} +// ToPostRequestInformation submits a pending review for a pull request. For more information about creating a pending review for a pull request, see "[Create a review for a pull request](https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#create-a-review-for-a-pull-request)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsItemEventsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsItemReviewsItemEventsPostRequestBodyable, 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 *ItemItemPullsItemReviewsItemEventsRequestBuilder when successful +func (m *ItemItemPullsItemReviewsItemEventsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemReviewsItemEventsRequestBuilder) { + return NewItemItemPullsItemReviewsItemEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_item_reviews_item_with_review_escaped_put_request_body.go b/pkg/github/repos/item_item_pulls_item_reviews_item_with_review_escaped_put_request_body.go new file mode 100644 index 00000000..455fee42 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_reviews_item_with_review_escaped_put_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemReviewsItemWithReview_PutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The body text of the pull request review. + body *string +} +// NewItemItemPullsItemReviewsItemWithReview_PutRequestBody instantiates a new ItemItemPullsItemReviewsItemWithReview_PutRequestBody and sets the default values. +func NewItemItemPullsItemReviewsItemWithReview_PutRequestBody()(*ItemItemPullsItemReviewsItemWithReview_PutRequestBody) { + m := &ItemItemPullsItemReviewsItemWithReview_PutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemReviewsItemWithReview_PutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemReviewsItemWithReview_PutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemReviewsItemWithReview_PutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemPullsItemReviewsItemWithReview_PutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The body text of the pull request review. +// returns a *string when successful +func (m *ItemItemPullsItemReviewsItemWithReview_PutRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemReviewsItemWithReview_PutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemReviewsItemWithReview_PutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemItemPullsItemReviewsItemWithReview_PutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The body text of the pull request review. +func (m *ItemItemPullsItemReviewsItemWithReview_PutRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemItemPullsItemReviewsItemWithReview_PutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/pkg/github/repos/item_item_pulls_item_reviews_post_request_body.go b/pkg/github/repos/item_item_pulls_item_reviews_post_request_body.go new file mode 100644 index 00000000..0f0449bf --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_reviews_post_request_body.go @@ -0,0 +1,150 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemReviewsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // **Required** when using `REQUEST_CHANGES` or `COMMENT` for the `event` parameter. The body text of the pull request review. + body *string + // Use the following table to specify the location, destination, and contents of the draft review comment. + comments []ItemItemPullsItemReviewsPostRequestBody_commentsable + // The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the `position`. Defaults to the most recent commit in the pull request when you do not specify a value. + commit_id *string +} +// NewItemItemPullsItemReviewsPostRequestBody instantiates a new ItemItemPullsItemReviewsPostRequestBody and sets the default values. +func NewItemItemPullsItemReviewsPostRequestBody()(*ItemItemPullsItemReviewsPostRequestBody) { + m := &ItemItemPullsItemReviewsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemReviewsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemReviewsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemReviewsPostRequestBody(), 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 *ItemItemPullsItemReviewsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. **Required** when using `REQUEST_CHANGES` or `COMMENT` for the `event` parameter. The body text of the pull request review. +// returns a *string when successful +func (m *ItemItemPullsItemReviewsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetComments gets the comments property value. Use the following table to specify the location, destination, and contents of the draft review comment. +// returns a []ItemItemPullsItemReviewsPostRequestBody_commentsable when successful +func (m *ItemItemPullsItemReviewsPostRequestBody) GetComments()([]ItemItemPullsItemReviewsPostRequestBody_commentsable) { + return m.comments +} +// GetCommitId gets the commit_id property value. The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the `position`. Defaults to the most recent commit in the pull request when you do not specify a value. +// returns a *string when successful +func (m *ItemItemPullsItemReviewsPostRequestBody) GetCommitId()(*string) { + return m.commit_id +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemReviewsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["comments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(CreateItemItemPullsItemReviewsPostRequestBody_commentsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ItemItemPullsItemReviewsPostRequestBody_commentsable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ItemItemPullsItemReviewsPostRequestBody_commentsable) + } + } + m.SetComments(res) + } + return nil + } + res["commit_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCommitId(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemReviewsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + if m.GetComments() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetComments())) + for i, v := range m.GetComments() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("comments", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("commit_id", m.GetCommitId()) + 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 *ItemItemPullsItemReviewsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. **Required** when using `REQUEST_CHANGES` or `COMMENT` for the `event` parameter. The body text of the pull request review. +func (m *ItemItemPullsItemReviewsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetComments sets the comments property value. Use the following table to specify the location, destination, and contents of the draft review comment. +func (m *ItemItemPullsItemReviewsPostRequestBody) SetComments(value []ItemItemPullsItemReviewsPostRequestBody_commentsable)() { + m.comments = value +} +// SetCommitId sets the commit_id property value. The SHA of the commit that needs a review. Not using the latest commit SHA may render your review comment outdated if a subsequent commit modifies the line you specify as the `position`. Defaults to the most recent commit in the pull request when you do not specify a value. +func (m *ItemItemPullsItemReviewsPostRequestBody) SetCommitId(value *string)() { + m.commit_id = value +} +type ItemItemPullsItemReviewsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetComments()([]ItemItemPullsItemReviewsPostRequestBody_commentsable) + GetCommitId()(*string) + SetBody(value *string)() + SetComments(value []ItemItemPullsItemReviewsPostRequestBody_commentsable)() + SetCommitId(value *string)() +} diff --git a/pkg/github/repos/item_item_pulls_item_reviews_post_request_body_escaped_comments.go b/pkg/github/repos/item_item_pulls_item_reviews_post_request_body_escaped_comments.go new file mode 100644 index 00000000..23a8e03c --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_reviews_post_request_body_escaped_comments.go @@ -0,0 +1,254 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemReviewsPostRequestBody_comments struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Text of the review comment. + body *string + // The line property + line *int32 + // The relative path to the file that necessitates a review comment. + path *string + // The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. + position *int32 + // The side property + side *string + // The start_line property + start_line *int32 + // The start_side property + start_side *string +} +// NewItemItemPullsItemReviewsPostRequestBody_comments instantiates a new ItemItemPullsItemReviewsPostRequestBody_comments and sets the default values. +func NewItemItemPullsItemReviewsPostRequestBody_comments()(*ItemItemPullsItemReviewsPostRequestBody_comments) { + m := &ItemItemPullsItemReviewsPostRequestBody_comments{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemReviewsPostRequestBody_commentsFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemReviewsPostRequestBody_commentsFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemReviewsPostRequestBody_comments(), 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 *ItemItemPullsItemReviewsPostRequestBody_comments) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. Text of the review comment. +// returns a *string when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetLine(val) + } + return nil + } + res["path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPath(val) + } + return nil + } + res["position"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetPosition(val) + } + return nil + } + res["side"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSide(val) + } + return nil + } + res["start_line"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetStartLine(val) + } + return nil + } + res["start_side"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetStartSide(val) + } + return nil + } + return res +} +// GetLine gets the line property value. The line property +// returns a *int32 when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetLine()(*int32) { + return m.line +} +// GetPath gets the path property value. The relative path to the file that necessitates a review comment. +// returns a *string when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetPath()(*string) { + return m.path +} +// GetPosition gets the position property value. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. +// returns a *int32 when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetPosition()(*int32) { + return m.position +} +// GetSide gets the side property value. The side property +// returns a *string when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetSide()(*string) { + return m.side +} +// GetStartLine gets the start_line property value. The start_line property +// returns a *int32 when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetStartLine()(*int32) { + return m.start_line +} +// GetStartSide gets the start_side property value. The start_side property +// returns a *string when successful +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) GetStartSide()(*string) { + return m.start_side +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("line", m.GetLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("path", m.GetPath()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("position", m.GetPosition()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("side", m.GetSide()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("start_line", m.GetStartLine()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("start_side", m.GetStartSide()) + 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 *ItemItemPullsItemReviewsPostRequestBody_comments) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. Text of the review comment. +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) SetBody(value *string)() { + m.body = value +} +// SetLine sets the line property value. The line property +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) SetLine(value *int32)() { + m.line = value +} +// SetPath sets the path property value. The relative path to the file that necessitates a review comment. +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) SetPath(value *string)() { + m.path = value +} +// SetPosition sets the position property value. The position in the diff where you want to add a review comment. Note this value is not the same as the line number in the file. The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file. +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) SetPosition(value *int32)() { + m.position = value +} +// SetSide sets the side property value. The side property +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) SetSide(value *string)() { + m.side = value +} +// SetStartLine sets the start_line property value. The start_line property +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) SetStartLine(value *int32)() { + m.start_line = value +} +// SetStartSide sets the start_side property value. The start_side property +func (m *ItemItemPullsItemReviewsPostRequestBody_comments) SetStartSide(value *string)() { + m.start_side = value +} +type ItemItemPullsItemReviewsPostRequestBody_commentsable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetLine()(*int32) + GetPath()(*string) + GetPosition()(*int32) + GetSide()(*string) + GetStartLine()(*int32) + GetStartSide()(*string) + SetBody(value *string)() + SetLine(value *int32)() + SetPath(value *string)() + SetPosition(value *int32)() + SetSide(value *string)() + SetStartLine(value *int32)() + SetStartSide(value *string)() +} diff --git a/pkg/github/repos/item_item_pulls_item_reviews_request_builder.go b/pkg/github/repos/item_item_pulls_item_reviews_request_builder.go new file mode 100644 index 00000000..6fcec78b --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_reviews_request_builder.go @@ -0,0 +1,115 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPullsItemReviewsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\reviews +type ItemItemPullsItemReviewsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsItemReviewsRequestBuilderGetQueryParameters lists all reviews for a specified pull request. The list of reviews returns in chronological order.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemPullsItemReviewsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReview_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.pulls.item.reviews.item collection +// returns a *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder when successful +func (m *ItemItemPullsItemReviewsRequestBuilder) ByReview_id(review_id int32)(*ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["review_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(review_id), 10) + return NewItemItemPullsItemReviewsWithReview_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPullsItemReviewsRequestBuilderInternal instantiates a new ItemItemPullsItemReviewsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsRequestBuilder) { + m := &ItemItemPullsItemReviewsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/reviews{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemPullsItemReviewsRequestBuilder instantiates a new ItemItemPullsItemReviewsRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemReviewsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all reviews for a specified pull request. The list of reviews returns in chronological order.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []PullRequestReviewable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#list-reviews-for-a-pull-request +func (m *ItemItemPullsItemReviewsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemReviewsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestReviewFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable) + } + } + return val, nil +} +// Post creates a review on a specified pull request.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."Pull request reviews created in the `PENDING` state are not submitted and therefore do not include the `submitted_at` property in the response. To create a pending review for a pull request, leave the `event` parameter blank. For more information about submitting a `PENDING` review, see "[Submit a review for a pull request](https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#submit-a-review-for-a-pull-request)."> [!NOTE]> To comment on a specific line in a file, you need to first determine the position of that line in the diff. To see a pull request diff, add the `application/vnd.github.v3.diff` media type to the `Accept` header of a call to the [Get a pull request](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#get-a-pull-request) endpoint.The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#create-a-review-for-a-pull-request +func (m *ItemItemPullsItemReviewsRequestBuilder) Post(ctx context.Context, body ItemItemPullsItemReviewsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestReviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable), nil +} +// ToGetRequestInformation lists all reviews for a specified pull request. The list of reviews returns in chronological order.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsItemReviewsRequestBuilderGetQueryParameters])(*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 review on a specified pull request.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."Pull request reviews created in the `PENDING` state are not submitted and therefore do not include the `submitted_at` property in the response. To create a pending review for a pull request, leave the `event` parameter blank. For more information about submitting a `PENDING` review, see "[Submit a review for a pull request](https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#submit-a-review-for-a-pull-request)."> [!NOTE]> To comment on a specific line in a file, you need to first determine the position of that line in the diff. To see a pull request diff, add the `application/vnd.github.v3.diff` media type to the `Accept` header of a call to the [Get a pull request](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#get-a-pull-request) endpoint.The `position` value equals the number of lines down from the first "@@" hunk header in the file you want to add a comment. The line just below the "@@" line is position 1, the next line is position 2, and so on. The position in the diff continues to increase through lines of whitespace and additional hunks until the beginning of a new file.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsItemReviewsPostRequestBodyable, 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 *ItemItemPullsItemReviewsRequestBuilder when successful +func (m *ItemItemPullsItemReviewsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemReviewsRequestBuilder) { + return NewItemItemPullsItemReviewsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_item_reviews_with_review_escaped_item_request_builder.go b/pkg/github/repos/item_item_pulls_item_reviews_with_review_escaped_item_request_builder.go new file mode 100644 index 00000000..114a51cc --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_reviews_with_review_escaped_item_request_builder.go @@ -0,0 +1,144 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPullsItemReviewsWithReview_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\reviews\{review_id} +type ItemItemPullsItemReviewsWithReview_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Comments the comments property +// returns a *ItemItemPullsItemReviewsItemCommentsRequestBuilder when successful +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) Comments()(*ItemItemPullsItemReviewsItemCommentsRequestBuilder) { + return NewItemItemPullsItemReviewsItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPullsItemReviewsWithReview_ItemRequestBuilderInternal instantiates a new ItemItemPullsItemReviewsWithReview_ItemRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsWithReview_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) { + m := &ItemItemPullsItemReviewsWithReview_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/reviews/{review_id}", pathParameters), + } + return m +} +// NewItemItemPullsItemReviewsWithReview_ItemRequestBuilder instantiates a new ItemItemPullsItemReviewsWithReview_ItemRequestBuilder and sets the default values. +func NewItemItemPullsItemReviewsWithReview_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemReviewsWithReview_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a pull request review that has not been submitted. Submitted reviews cannot be deleted.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#delete-a-pending-review-for-a-pull-request +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestReviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable), nil +} +// Dismissals the dismissals property +// returns a *ItemItemPullsItemReviewsItemDismissalsRequestBuilder when successful +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) Dismissals()(*ItemItemPullsItemReviewsItemDismissalsRequestBuilder) { + return NewItemItemPullsItemReviewsItemDismissalsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Events the events property +// returns a *ItemItemPullsItemReviewsItemEventsRequestBuilder when successful +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) Events()(*ItemItemPullsItemReviewsItemEventsRequestBuilder) { + return NewItemItemPullsItemReviewsItemEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get retrieves a pull request review by its ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#get-a-review-for-a-pull-request +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestReviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable), nil +} +// Put updates the contents of a specified review summary comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestReviewable when successful +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/reviews#update-a-review-for-a-pull-request +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) Put(ctx context.Context, body ItemItemPullsItemReviewsItemWithReview_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestReviewFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestReviewable), nil +} +// ToDeleteRequestInformation deletes a pull request review that has not been submitted. Submitted reviews cannot be deleted.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsWithReview_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") + return requestInfo, nil +} +// ToGetRequestInformation retrieves a pull request review by its ID.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsWithReview_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 +} +// ToPutRequestInformation updates the contents of a specified review summary comment.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github-commitcomment.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github-commitcomment.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github-commitcomment.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github-commitcomment.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemPullsItemReviewsItemWithReview_PutRequestBodyable, 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 *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder when successful +func (m *ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemReviewsWithReview_ItemRequestBuilder) { + return NewItemItemPullsItemReviewsWithReview_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_item_update_branch_put_request_body.go b/pkg/github/repos/item_item_pulls_item_update_branch_put_request_body.go new file mode 100644 index 00000000..8793644a --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_update_branch_put_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemUpdateBranchPutRequestBody 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 expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a `422 Unprocessable Entity` status. You can use the "[List commits](https://docs.github.com/enterprise-server@3.14/rest/commits/commits#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. + expected_head_sha *string +} +// NewItemItemPullsItemUpdateBranchPutRequestBody instantiates a new ItemItemPullsItemUpdateBranchPutRequestBody and sets the default values. +func NewItemItemPullsItemUpdateBranchPutRequestBody()(*ItemItemPullsItemUpdateBranchPutRequestBody) { + m := &ItemItemPullsItemUpdateBranchPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemUpdateBranchPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemUpdateBranchPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemUpdateBranchPutRequestBody(), 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 *ItemItemPullsItemUpdateBranchPutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExpectedHeadSha gets the expected_head_sha property value. The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a `422 Unprocessable Entity` status. You can use the "[List commits](https://docs.github.com/enterprise-server@3.14/rest/commits/commits#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. +// returns a *string when successful +func (m *ItemItemPullsItemUpdateBranchPutRequestBody) GetExpectedHeadSha()(*string) { + return m.expected_head_sha +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemUpdateBranchPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["expected_head_sha"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetExpectedHeadSha(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemUpdateBranchPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("expected_head_sha", m.GetExpectedHeadSha()) + 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 *ItemItemPullsItemUpdateBranchPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExpectedHeadSha sets the expected_head_sha property value. The expected SHA of the pull request's HEAD ref. This is the most recent commit on the pull request's branch. If the expected SHA does not match the pull request's HEAD, you will receive a `422 Unprocessable Entity` status. You can use the "[List commits](https://docs.github.com/enterprise-server@3.14/rest/commits/commits#list-commits)" endpoint to find the most recent commit SHA. Default: SHA of the pull request's current HEAD ref. +func (m *ItemItemPullsItemUpdateBranchPutRequestBody) SetExpectedHeadSha(value *string)() { + m.expected_head_sha = value +} +type ItemItemPullsItemUpdateBranchPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExpectedHeadSha()(*string) + SetExpectedHeadSha(value *string)() +} diff --git a/pkg/github/repos/item_item_pulls_item_update_branch_put_response.go b/pkg/github/repos/item_item_pulls_item_update_branch_put_response.go new file mode 100644 index 00000000..56409bc4 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_update_branch_put_response.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemUpdateBranchPutResponse 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 message property + message *string + // The url property + url *string +} +// NewItemItemPullsItemUpdateBranchPutResponse instantiates a new ItemItemPullsItemUpdateBranchPutResponse and sets the default values. +func NewItemItemPullsItemUpdateBranchPutResponse()(*ItemItemPullsItemUpdateBranchPutResponse) { + m := &ItemItemPullsItemUpdateBranchPutResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemUpdateBranchPutResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemUpdateBranchPutResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemUpdateBranchPutResponse(), 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 *ItemItemPullsItemUpdateBranchPutResponse) 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 *ItemItemPullsItemUpdateBranchPutResponse) 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["url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetUrl(val) + } + return nil + } + return res +} +// GetMessage gets the message property value. The message property +// returns a *string when successful +func (m *ItemItemPullsItemUpdateBranchPutResponse) GetMessage()(*string) { + return m.message +} +// GetUrl gets the url property value. The url property +// returns a *string when successful +func (m *ItemItemPullsItemUpdateBranchPutResponse) GetUrl()(*string) { + return m.url +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemUpdateBranchPutResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("message", m.GetMessage()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("url", m.GetUrl()) + 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 *ItemItemPullsItemUpdateBranchPutResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMessage sets the message property value. The message property +func (m *ItemItemPullsItemUpdateBranchPutResponse) SetMessage(value *string)() { + m.message = value +} +// SetUrl sets the url property value. The url property +func (m *ItemItemPullsItemUpdateBranchPutResponse) SetUrl(value *string)() { + m.url = value +} +type ItemItemPullsItemUpdateBranchPutResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMessage()(*string) + GetUrl()(*string) + SetMessage(value *string)() + SetUrl(value *string)() +} diff --git a/pkg/github/repos/item_item_pulls_item_update_branch_request_builder.go b/pkg/github/repos/item_item_pulls_item_update_branch_request_builder.go new file mode 100644 index 00000000..c6ba06a3 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_update_branch_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPullsItemUpdateBranchRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number}\update-branch +type ItemItemPullsItemUpdateBranchRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemPullsItemUpdateBranchRequestBuilderInternal instantiates a new ItemItemPullsItemUpdateBranchRequestBuilder and sets the default values. +func NewItemItemPullsItemUpdateBranchRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemUpdateBranchRequestBuilder) { + m := &ItemItemPullsItemUpdateBranchRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}/update-branch", pathParameters), + } + return m +} +// NewItemItemPullsItemUpdateBranchRequestBuilder instantiates a new ItemItemPullsItemUpdateBranchRequestBuilder and sets the default values. +func NewItemItemPullsItemUpdateBranchRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsItemUpdateBranchRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsItemUpdateBranchRequestBuilderInternal(urlParams, requestAdapter) +} +// Put updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. +// returns a ItemItemPullsItemUpdateBranchPutResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#update-a-pull-request-branch +func (m *ItemItemPullsItemUpdateBranchRequestBuilder) Put(ctx context.Context, body ItemItemPullsItemUpdateBranchPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ItemItemPullsItemUpdateBranchPutResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateItemItemPullsItemUpdateBranchPutResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ItemItemPullsItemUpdateBranchPutResponseable), nil +} +// ToPutRequestInformation updates the pull request branch with the latest upstream changes by merging HEAD from the base branch into the pull request branch. +// returns a *RequestInformation when successful +func (m *ItemItemPullsItemUpdateBranchRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemPullsItemUpdateBranchPutRequestBodyable, 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 *ItemItemPullsItemUpdateBranchRequestBuilder when successful +func (m *ItemItemPullsItemUpdateBranchRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsItemUpdateBranchRequestBuilder) { + return NewItemItemPullsItemUpdateBranchRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_item_with_pull_escaped_number_patch_request_body.go b/pkg/github/repos/item_item_pulls_item_with_pull_escaped_number_patch_request_body.go new file mode 100644 index 00000000..34e63b06 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_item_with_pull_escaped_number_patch_request_body.go @@ -0,0 +1,167 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsItemWithPull_numberPatchRequestBody 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 name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository. + base *string + // The contents of the pull request. + body *string + // Indicates whether [maintainers can modify](https://docs.github.com/enterprise-server@3.14/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. + maintainer_can_modify *bool + // The title of the pull request. + title *string +} +// NewItemItemPullsItemWithPull_numberPatchRequestBody instantiates a new ItemItemPullsItemWithPull_numberPatchRequestBody and sets the default values. +func NewItemItemPullsItemWithPull_numberPatchRequestBody()(*ItemItemPullsItemWithPull_numberPatchRequestBody) { + m := &ItemItemPullsItemWithPull_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsItemWithPull_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsItemWithPull_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsItemWithPull_numberPatchRequestBody(), 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 *ItemItemPullsItemWithPull_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBase gets the base property value. The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository. +// returns a *string when successful +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) GetBase()(*string) { + return m.base +} +// GetBody gets the body property value. The contents of the pull request. +// returns a *string when successful +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBase(val) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["maintainer_can_modify"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintainerCanModify(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetMaintainerCanModify gets the maintainer_can_modify property value. Indicates whether [maintainers can modify](https://docs.github.com/enterprise-server@3.14/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. +// returns a *bool when successful +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) GetMaintainerCanModify()(*bool) { + return m.maintainer_can_modify +} +// GetTitle gets the title property value. The title of the pull request. +// returns a *string when successful +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("base", m.GetBase()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintainer_can_modify", m.GetMaintainerCanModify()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemItemPullsItemWithPull_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBase sets the base property value. The name of the branch you want your changes pulled into. This should be an existing branch on the current repository. You cannot update the base branch on a pull request to point to another repository. +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) SetBase(value *string)() { + m.base = value +} +// SetBody sets the body property value. The contents of the pull request. +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) SetBody(value *string)() { + m.body = value +} +// SetMaintainerCanModify sets the maintainer_can_modify property value. Indicates whether [maintainers can modify](https://docs.github.com/enterprise-server@3.14/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) SetMaintainerCanModify(value *bool)() { + m.maintainer_can_modify = value +} +// SetTitle sets the title property value. The title of the pull request. +func (m *ItemItemPullsItemWithPull_numberPatchRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemItemPullsItemWithPull_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBase()(*string) + GetBody()(*string) + GetMaintainerCanModify()(*bool) + GetTitle()(*string) + SetBase(value *string)() + SetBody(value *string)() + SetMaintainerCanModify(value *bool)() + SetTitle(value *string)() +} diff --git a/pkg/github/repos/item_item_pulls_post_request_body.go b/pkg/github/repos/item_item_pulls_post_request_body.go new file mode 100644 index 00000000..19d39a07 --- /dev/null +++ b/pkg/github/repos/item_item_pulls_post_request_body.go @@ -0,0 +1,283 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemPullsPostRequestBody 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 name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository. + base *string + // The contents of the pull request. + body *string + // Indicates whether the pull request is a draft. See "[Draft Pull Requests](https://docs.github.com/enterprise-server@3.14/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. + draft *bool + // The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace `head` with a user like this: `username:branch`. + head *string + // The name of the repository where the changes in the pull request were made. This field is required for cross-repository pull requests if both repositories are owned by the same organization. + head_repo *string + // An issue in the repository to convert to a pull request. The issue title, body, and comments will become the title, body, and comments on the new pull request. Required unless `title` is specified. + issue *int64 + // Indicates whether [maintainers can modify](https://docs.github.com/enterprise-server@3.14/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. + maintainer_can_modify *bool + // The title of the new pull request. Required unless `issue` is specified. + title *string +} +// NewItemItemPullsPostRequestBody instantiates a new ItemItemPullsPostRequestBody and sets the default values. +func NewItemItemPullsPostRequestBody()(*ItemItemPullsPostRequestBody) { + m := &ItemItemPullsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemPullsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemPullsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemPullsPostRequestBody(), 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 *ItemItemPullsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBase gets the base property value. The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository. +// returns a *string when successful +func (m *ItemItemPullsPostRequestBody) GetBase()(*string) { + return m.base +} +// GetBody gets the body property value. The contents of the pull request. +// returns a *string when successful +func (m *ItemItemPullsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetDraft gets the draft property value. Indicates whether the pull request is a draft. See "[Draft Pull Requests](https://docs.github.com/enterprise-server@3.14/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. +// returns a *bool when successful +func (m *ItemItemPullsPostRequestBody) GetDraft()(*bool) { + return m.draft +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemPullsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["base"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBase(val) + } + return nil + } + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["head"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHead(val) + } + return nil + } + res["head_repo"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHeadRepo(val) + } + return nil + } + res["issue"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt64Value() + if err != nil { + return err + } + if val != nil { + m.SetIssue(val) + } + return nil + } + res["maintainer_can_modify"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintainerCanModify(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetHead gets the head property value. The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace `head` with a user like this: `username:branch`. +// returns a *string when successful +func (m *ItemItemPullsPostRequestBody) GetHead()(*string) { + return m.head +} +// GetHeadRepo gets the head_repo property value. The name of the repository where the changes in the pull request were made. This field is required for cross-repository pull requests if both repositories are owned by the same organization. +// returns a *string when successful +func (m *ItemItemPullsPostRequestBody) GetHeadRepo()(*string) { + return m.head_repo +} +// GetIssue gets the issue property value. An issue in the repository to convert to a pull request. The issue title, body, and comments will become the title, body, and comments on the new pull request. Required unless `title` is specified. +// returns a *int64 when successful +func (m *ItemItemPullsPostRequestBody) GetIssue()(*int64) { + return m.issue +} +// GetMaintainerCanModify gets the maintainer_can_modify property value. Indicates whether [maintainers can modify](https://docs.github.com/enterprise-server@3.14/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. +// returns a *bool when successful +func (m *ItemItemPullsPostRequestBody) GetMaintainerCanModify()(*bool) { + return m.maintainer_can_modify +} +// GetTitle gets the title property value. The title of the new pull request. Required unless `issue` is specified. +// returns a *string when successful +func (m *ItemItemPullsPostRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemItemPullsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("base", m.GetBase()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head", m.GetHead()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("head_repo", m.GetHeadRepo()) + if err != nil { + return err + } + } + { + err := writer.WriteInt64Value("issue", m.GetIssue()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("maintainer_can_modify", m.GetMaintainerCanModify()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemItemPullsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBase sets the base property value. The name of the branch you want the changes pulled into. This should be an existing branch on the current repository. You cannot submit a pull request to one repository that requests a merge to a base of another repository. +func (m *ItemItemPullsPostRequestBody) SetBase(value *string)() { + m.base = value +} +// SetBody sets the body property value. The contents of the pull request. +func (m *ItemItemPullsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetDraft sets the draft property value. Indicates whether the pull request is a draft. See "[Draft Pull Requests](https://docs.github.com/enterprise-server@3.14/articles/about-pull-requests#draft-pull-requests)" in the GitHub Help documentation to learn more. +func (m *ItemItemPullsPostRequestBody) SetDraft(value *bool)() { + m.draft = value +} +// SetHead sets the head property value. The name of the branch where your changes are implemented. For cross-repository pull requests in the same network, namespace `head` with a user like this: `username:branch`. +func (m *ItemItemPullsPostRequestBody) SetHead(value *string)() { + m.head = value +} +// SetHeadRepo sets the head_repo property value. The name of the repository where the changes in the pull request were made. This field is required for cross-repository pull requests if both repositories are owned by the same organization. +func (m *ItemItemPullsPostRequestBody) SetHeadRepo(value *string)() { + m.head_repo = value +} +// SetIssue sets the issue property value. An issue in the repository to convert to a pull request. The issue title, body, and comments will become the title, body, and comments on the new pull request. Required unless `title` is specified. +func (m *ItemItemPullsPostRequestBody) SetIssue(value *int64)() { + m.issue = value +} +// SetMaintainerCanModify sets the maintainer_can_modify property value. Indicates whether [maintainers can modify](https://docs.github.com/enterprise-server@3.14/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork/) the pull request. +func (m *ItemItemPullsPostRequestBody) SetMaintainerCanModify(value *bool)() { + m.maintainer_can_modify = value +} +// SetTitle sets the title property value. The title of the new pull request. Required unless `issue` is specified. +func (m *ItemItemPullsPostRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemItemPullsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBase()(*string) + GetBody()(*string) + GetDraft()(*bool) + GetHead()(*string) + GetHeadRepo()(*string) + GetIssue()(*int64) + GetMaintainerCanModify()(*bool) + GetTitle()(*string) + SetBase(value *string)() + SetBody(value *string)() + SetDraft(value *bool)() + SetHead(value *string)() + SetHeadRepo(value *string)() + SetIssue(value *int64)() + SetMaintainerCanModify(value *bool)() + SetTitle(value *string)() +} diff --git a/pkg/github/repos/item_item_pulls_request_builder.go b/pkg/github/repos/item_item_pulls_request_builder.go new file mode 100644 index 00000000..c0819b6a --- /dev/null +++ b/pkg/github/repos/item_item_pulls_request_builder.go @@ -0,0 +1,135 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ibbe9beac25cc33725446a292bea598f4f23a2c06d408c0c7e3674faf505b1193 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/pulls" +) + +// ItemItemPullsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls +type ItemItemPullsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemPullsRequestBuilderGetQueryParameters lists pull requests in a specified repository.Draft pull requests are available in public repositories with GitHubFree and GitHub Free for organizations, GitHub Pro, and legacy per-repository billingplans, and in public and private repositories with GitHub Team and GitHub EnterpriseCloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products)in the GitHub Help documentation.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type ItemItemPullsRequestBuilderGetQueryParameters struct { + // Filter pulls by base branch name. Example: `gh-pages`. + Base *string `uriparametername:"base"` + // The direction of the sort. Default: `desc` when sort is `created` or sort is not specified, otherwise `asc`. + Direction *ibbe9beac25cc33725446a292bea598f4f23a2c06d408c0c7e3674faf505b1193.GetDirectionQueryParameterType `uriparametername:"direction"` + // Filter pulls by head user or head organization and branch name in the format of `user:ref-name` or `organization:ref-name`. For example: `github:new-script-format` or `octocat:test-branch`. + Head *string `uriparametername:"head"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // What to sort results by. `popularity` will sort by the number of comments. `long-running` will sort by date created and will limit the results to pull requests that have been open for more than a month and have had activity within the past month. + Sort *ibbe9beac25cc33725446a292bea598f4f23a2c06d408c0c7e3674faf505b1193.GetSortQueryParameterType `uriparametername:"sort"` + // Either `open`, `closed`, or `all` to filter by state. + State *ibbe9beac25cc33725446a292bea598f4f23a2c06d408c0c7e3674faf505b1193.GetStateQueryParameterType `uriparametername:"state"` +} +// ByPull_number gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.pulls.item collection +// returns a *ItemItemPullsWithPull_numberItemRequestBuilder when successful +func (m *ItemItemPullsRequestBuilder) ByPull_number(pull_number int32)(*ItemItemPullsWithPull_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["pull_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(pull_number), 10) + return NewItemItemPullsWithPull_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemItemPullsCommentsRequestBuilder when successful +func (m *ItemItemPullsRequestBuilder) Comments()(*ItemItemPullsCommentsRequestBuilder) { + return NewItemItemPullsCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPullsRequestBuilderInternal instantiates a new ItemItemPullsRequestBuilder and sets the default values. +func NewItemItemPullsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsRequestBuilder) { + m := &ItemItemPullsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls{?base*,direction*,head*,page*,per_page*,sort*,state*}", pathParameters), + } + return m +} +// NewItemItemPullsRequestBuilder instantiates a new ItemItemPullsRequestBuilder and sets the default values. +func NewItemItemPullsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists pull requests in a specified repository.Draft pull requests are available in public repositories with GitHubFree and GitHub Free for organizations, GitHub Pro, and legacy per-repository billingplans, and in public and private repositories with GitHub Team and GitHub EnterpriseCloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products)in the GitHub Help documentation.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []PullRequestSimpleable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests +func (m *ItemItemPullsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestSimpleable) + } + } + return val, nil +} +// Post draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#create-a-pull-request +func (m *ItemItemPullsRequestBuilder) Post(ctx context.Context, body ItemItemPullsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestable), nil +} +// ToGetRequestInformation lists pull requests in a specified repository.Draft pull requests are available in public repositories with GitHubFree and GitHub Free for organizations, GitHub Pro, and legacy per-repository billingplans, and in public and private repositories with GitHub Team and GitHub EnterpriseCloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products)in the GitHub Help documentation.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemPullsRequestBuilderGetQueryParameters])(*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 draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemPullsPostRequestBodyable, 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 *ItemItemPullsRequestBuilder when successful +func (m *ItemItemPullsRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsRequestBuilder) { + return NewItemItemPullsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_pulls_with_pull_escaped_number_item_request_builder.go b/pkg/github/repos/item_item_pulls_with_pull_escaped_number_item_request_builder.go new file mode 100644 index 00000000..5f24baeb --- /dev/null +++ b/pkg/github/repos/item_item_pulls_with_pull_escaped_number_item_request_builder.go @@ -0,0 +1,139 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemPullsWithPull_numberItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\pulls\{pull_number} +type ItemItemPullsWithPull_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Comments the comments property +// returns a *ItemItemPullsItemCommentsRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Comments()(*ItemItemPullsItemCommentsRequestBuilder) { + return NewItemItemPullsItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Commits the commits property +// returns a *ItemItemPullsItemCommitsRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Commits()(*ItemItemPullsItemCommitsRequestBuilder) { + return NewItemItemPullsItemCommitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemPullsWithPull_numberItemRequestBuilderInternal instantiates a new ItemItemPullsWithPull_numberItemRequestBuilder and sets the default values. +func NewItemItemPullsWithPull_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsWithPull_numberItemRequestBuilder) { + m := &ItemItemPullsWithPull_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/pulls/{pull_number}", pathParameters), + } + return m +} +// NewItemItemPullsWithPull_numberItemRequestBuilder instantiates a new ItemItemPullsWithPull_numberItemRequestBuilder and sets the default values. +func NewItemItemPullsWithPull_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemPullsWithPull_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemPullsWithPull_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Files the files property +// returns a *ItemItemPullsItemFilesRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Files()(*ItemItemPullsItemFilesRequestBuilder) { + return NewItemItemPullsItemFilesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists details of a pull request by providing its number.When you get, [create](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls/#create-a-pull-request), or [edit](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#update-a-pull-request) a pull request, GitHub Enterprise Server creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".The value of the `mergeable` attribute can be `true`, `false`, or `null`. If the value is `null`, then GitHub Enterprise Server has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-`null` value for the `mergeable` attribute in the response. If `mergeable` is `true`, then `merge_commit_sha` will be the SHA of the _test_ merge commit.The value of the `merge_commit_sha` attribute changes depending on the state of the pull request. Before merging a pull request, the `merge_commit_sha` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the `merge_commit_sha` attribute changes depending on how you merged the pull request:* If merged as a [merge commit](https://docs.github.com/enterprise-server@3.14/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit.* If merged via a [squash](https://docs.github.com/enterprise-server@3.14/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch.* If [rebased](https://docs.github.com/enterprise-server@3.14/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to.Pass the appropriate [media type](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types) to fetch diff and patch formats.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.- **`application/vnd.github.diff`**: For more information, see "[git-diff](https://git-scm.com/docs/git-diff)" in the Git documentation. If a diff is corrupt, contact us through the [GitHub Support portal](https://support.github.com/). Include the repository name and pull request ID in your message. +// returns a PullRequestable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a BasicError error when the service returns a 406 status code +// returns a BasicError error when the service returns a 500 status code +// returns a PullRequest503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#get-a-pull-request +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "406": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequest503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestable), nil +} +// Merge the merge property +// returns a *ItemItemPullsItemMergeRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Merge()(*ItemItemPullsItemMergeRequestBuilder) { + return NewItemItemPullsItemMergeRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a PullRequestable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#update-a-pull-request +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Patch(ctx context.Context, body ItemItemPullsItemWithPull_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePullRequestFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PullRequestable), nil +} +// Requested_reviewers the requested_reviewers property +// returns a *ItemItemPullsItemRequested_reviewersRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Requested_reviewers()(*ItemItemPullsItemRequested_reviewersRequestBuilder) { + return NewItemItemPullsItemRequested_reviewersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Reviews the reviews property +// returns a *ItemItemPullsItemReviewsRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) Reviews()(*ItemItemPullsItemReviewsRequestBuilder) { + return NewItemItemPullsItemReviewsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.Lists details of a pull request by providing its number.When you get, [create](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls/#create-a-pull-request), or [edit](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#update-a-pull-request) a pull request, GitHub Enterprise Server creates a merge commit to test whether the pull request can be automatically merged into the base branch. This test commit is not added to the base branch or the head branch. You can review the status of the test commit using the `mergeable` key. For more information, see "[Checking mergeability of pull requests](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-git-database-api#checking-mergeability-of-pull-requests)".The value of the `mergeable` attribute can be `true`, `false`, or `null`. If the value is `null`, then GitHub Enterprise Server has started a background job to compute the mergeability. After giving the job time to complete, resubmit the request. When the job finishes, you will see a non-`null` value for the `mergeable` attribute in the response. If `mergeable` is `true`, then `merge_commit_sha` will be the SHA of the _test_ merge commit.The value of the `merge_commit_sha` attribute changes depending on the state of the pull request. Before merging a pull request, the `merge_commit_sha` attribute holds the SHA of the _test_ merge commit. After merging a pull request, the `merge_commit_sha` attribute changes depending on how you merged the pull request:* If merged as a [merge commit](https://docs.github.com/enterprise-server@3.14/articles/about-merge-methods-on-github/), `merge_commit_sha` represents the SHA of the merge commit.* If merged via a [squash](https://docs.github.com/enterprise-server@3.14/articles/about-merge-methods-on-github/#squashing-your-merge-commits), `merge_commit_sha` represents the SHA of the squashed commit on the base branch.* If [rebased](https://docs.github.com/enterprise-server@3.14/articles/about-merge-methods-on-github/#rebasing-and-merging-your-commits), `merge_commit_sha` represents the commit that the base branch was updated to.Pass the appropriate [media type](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types) to fetch diff and patch formats.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`.- **`application/vnd.github.diff`**: For more information, see "[git-diff](https://git-scm.com/docs/git-diff)" in the Git documentation. If a diff is corrupt, contact us through the [GitHub Support portal](https://support.github.com/). Include the repository name and pull request ID in your message. +// returns a *RequestInformation when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) 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 draft pull requests are available in public repositories with GitHub Free and GitHub Free for organizations, GitHub Pro, and legacy per-repository billing plans, and in public and private repositories with GitHub Team and GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To open or update a pull request in a public repository, you must have write access to the head or the source branch. For organization-owned repositories, you must be a member of the organization that owns the repository to open or update a pull request.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemPullsItemWithPull_numberPatchRequestBodyable, 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 +} +// UpdateBranch the updateBranch property +// returns a *ItemItemPullsItemUpdateBranchRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) UpdateBranch()(*ItemItemPullsItemUpdateBranchRequestBuilder) { + return NewItemItemPullsItemUpdateBranchRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemPullsWithPull_numberItemRequestBuilder when successful +func (m *ItemItemPullsWithPull_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemPullsWithPull_numberItemRequestBuilder) { + return NewItemItemPullsWithPull_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_readme_request_builder.go b/pkg/github/repos/item_item_readme_request_builder.go new file mode 100644 index 00000000..5b0637c8 --- /dev/null +++ b/pkg/github/repos/item_item_readme_request_builder.go @@ -0,0 +1,80 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemReadmeRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\readme +type ItemItemReadmeRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemReadmeRequestBuilderGetQueryParameters gets the preferred README for a repository.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type.- **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +type ItemItemReadmeRequestBuilderGetQueryParameters struct { + // The name of the commit/branch/tag. Default: the repository’s default branch. + Ref *string `uriparametername:"ref"` +} +// ByDir gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.readme.item collection +// returns a *ItemItemReadmeWithDirItemRequestBuilder when successful +func (m *ItemItemReadmeRequestBuilder) ByDir(dir string)(*ItemItemReadmeWithDirItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if dir != "" { + urlTplParams["dir"] = dir + } + return NewItemItemReadmeWithDirItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemReadmeRequestBuilderInternal instantiates a new ItemItemReadmeRequestBuilder and sets the default values. +func NewItemItemReadmeRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReadmeRequestBuilder) { + m := &ItemItemReadmeRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/readme{?ref*}", pathParameters), + } + return m +} +// NewItemItemReadmeRequestBuilder instantiates a new ItemItemReadmeRequestBuilder and sets the default values. +func NewItemItemReadmeRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReadmeRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReadmeRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the preferred README for a repository.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type.- **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +// returns a ContentFileable 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/enterprise-server@3.14/rest/repos/contents#get-a-repository-readme +func (m *ItemItemReadmeRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReadmeRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentFileable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateContentFileFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentFileable), nil +} +// ToGetRequestInformation gets the preferred README for a repository.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type.- **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +// returns a *RequestInformation when successful +func (m *ItemItemReadmeRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReadmeRequestBuilderGetQueryParameters])(*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 *ItemItemReadmeRequestBuilder when successful +func (m *ItemItemReadmeRequestBuilder) WithUrl(rawUrl string)(*ItemItemReadmeRequestBuilder) { + return NewItemItemReadmeRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_readme_with_dir_item_request_builder.go b/pkg/github/repos/item_item_readme_with_dir_item_request_builder.go new file mode 100644 index 00000000..1da09372 --- /dev/null +++ b/pkg/github/repos/item_item_readme_with_dir_item_request_builder.go @@ -0,0 +1,68 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemReadmeWithDirItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\readme\{dir} +type ItemItemReadmeWithDirItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemReadmeWithDirItemRequestBuilderGetQueryParameters gets the README from a repository directory.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type.- **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +type ItemItemReadmeWithDirItemRequestBuilderGetQueryParameters struct { + // The name of the commit/branch/tag. Default: the repository’s default branch. + Ref *string `uriparametername:"ref"` +} +// NewItemItemReadmeWithDirItemRequestBuilderInternal instantiates a new ItemItemReadmeWithDirItemRequestBuilder and sets the default values. +func NewItemItemReadmeWithDirItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReadmeWithDirItemRequestBuilder) { + m := &ItemItemReadmeWithDirItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/readme/{dir}{?ref*}", pathParameters), + } + return m +} +// NewItemItemReadmeWithDirItemRequestBuilder instantiates a new ItemItemReadmeWithDirItemRequestBuilder and sets the default values. +func NewItemItemReadmeWithDirItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReadmeWithDirItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReadmeWithDirItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the README from a repository directory.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type.- **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +// returns a ContentFileable 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/enterprise-server@3.14/rest/repos/contents#get-a-repository-readme-for-a-directory +func (m *ItemItemReadmeWithDirItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReadmeWithDirItemRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentFileable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateContentFileFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContentFileable), nil +} +// ToGetRequestInformation gets the README from a repository directory.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw file contents. This is the default if you do not specify a media type.- **`application/vnd.github.html+json`**: Returns the README in HTML. Markup languages are rendered to HTML using GitHub's open-source [Markup library](https://github.com/github/markup). +// returns a *RequestInformation when successful +func (m *ItemItemReadmeWithDirItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReadmeWithDirItemRequestBuilderGetQueryParameters])(*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 *ItemItemReadmeWithDirItemRequestBuilder when successful +func (m *ItemItemReadmeWithDirItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemReadmeWithDirItemRequestBuilder) { + return NewItemItemReadmeWithDirItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_releases_assets_item_with_asset_escaped_patch_request_body.go b/pkg/github/repos/item_item_releases_assets_item_with_asset_escaped_patch_request_body.go new file mode 100644 index 00000000..75327c7e --- /dev/null +++ b/pkg/github/repos/item_item_releases_assets_item_with_asset_escaped_patch_request_body.go @@ -0,0 +1,138 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemReleasesAssetsItemWithAsset_PatchRequestBody 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 alternate short description of the asset. Used in place of the filename. + label *string + // The file name of the asset. + name *string + // The state property + state *string +} +// NewItemItemReleasesAssetsItemWithAsset_PatchRequestBody instantiates a new ItemItemReleasesAssetsItemWithAsset_PatchRequestBody and sets the default values. +func NewItemItemReleasesAssetsItemWithAsset_PatchRequestBody()(*ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) { + m := &ItemItemReleasesAssetsItemWithAsset_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemReleasesAssetsItemWithAsset_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemReleasesAssetsItemWithAsset_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemReleasesAssetsItemWithAsset_PatchRequestBody(), 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 *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) 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 *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["label"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLabel(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["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetState(val) + } + return nil + } + return res +} +// GetLabel gets the label property value. An alternate short description of the asset. Used in place of the filename. +// returns a *string when successful +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) GetLabel()(*string) { + return m.label +} +// GetName gets the name property value. The file name of the asset. +// returns a *string when successful +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) GetName()(*string) { + return m.name +} +// GetState gets the state property value. The state property +// returns a *string when successful +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) GetState()(*string) { + return m.state +} +// Serialize serializes information the current object +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("label", m.GetLabel()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("state", m.GetState()) + 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 *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLabel sets the label property value. An alternate short description of the asset. Used in place of the filename. +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) SetLabel(value *string)() { + m.label = value +} +// SetName sets the name property value. The file name of the asset. +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetState sets the state property value. The state property +func (m *ItemItemReleasesAssetsItemWithAsset_PatchRequestBody) SetState(value *string)() { + m.state = value +} +type ItemItemReleasesAssetsItemWithAsset_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLabel()(*string) + GetName()(*string) + GetState()(*string) + SetLabel(value *string)() + SetName(value *string)() + SetState(value *string)() +} diff --git a/pkg/github/repos/item_item_releases_assets_request_builder.go b/pkg/github/repos/item_item_releases_assets_request_builder.go new file mode 100644 index 00000000..4e229868 --- /dev/null +++ b/pkg/github/repos/item_item_releases_assets_request_builder.go @@ -0,0 +1,34 @@ +package repos + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemReleasesAssetsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\assets +type ItemItemReleasesAssetsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByAsset_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.releases.assets.item collection +// returns a *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder when successful +func (m *ItemItemReleasesAssetsRequestBuilder) ByAsset_id(asset_id int32)(*ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["asset_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(asset_id), 10) + return NewItemItemReleasesAssetsWithAsset_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemReleasesAssetsRequestBuilderInternal instantiates a new ItemItemReleasesAssetsRequestBuilder and sets the default values. +func NewItemItemReleasesAssetsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesAssetsRequestBuilder) { + m := &ItemItemReleasesAssetsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/assets", pathParameters), + } + return m +} +// NewItemItemReleasesAssetsRequestBuilder instantiates a new ItemItemReleasesAssetsRequestBuilder and sets the default values. +func NewItemItemReleasesAssetsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesAssetsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesAssetsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_releases_assets_with_asset_escaped_item_request_builder.go b/pkg/github/repos/item_item_releases_assets_with_asset_escaped_item_request_builder.go new file mode 100644 index 00000000..3af793b4 --- /dev/null +++ b/pkg/github/repos/item_item_releases_assets_with_asset_escaped_item_request_builder.go @@ -0,0 +1,113 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemReleasesAssetsWithAsset_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\assets\{asset_id} +type ItemItemReleasesAssetsWithAsset_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemReleasesAssetsWithAsset_ItemRequestBuilderInternal instantiates a new ItemItemReleasesAssetsWithAsset_ItemRequestBuilder and sets the default values. +func NewItemItemReleasesAssetsWithAsset_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) { + m := &ItemItemReleasesAssetsWithAsset_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/assets/{asset_id}", pathParameters), + } + return m +} +// NewItemItemReleasesAssetsWithAsset_ItemRequestBuilder instantiates a new ItemItemReleasesAssetsWithAsset_ItemRequestBuilder and sets the default values. +func NewItemItemReleasesAssetsWithAsset_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesAssetsWithAsset_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a release asset +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/releases/assets#delete-a-release-asset +func (m *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get to download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. +// returns a ReleaseAssetable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/releases/assets#get-a-release-asset +func (m *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReleaseAssetable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReleaseAssetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReleaseAssetable), nil +} +// Patch users with push access to the repository can edit a release asset. +// returns a ReleaseAssetable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/releases/assets#update-a-release-asset +func (m *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemReleasesAssetsItemWithAsset_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReleaseAssetable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReleaseAssetFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReleaseAssetable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemReleasesAssetsWithAsset_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) + return requestInfo, nil +} +// ToGetRequestInformation to download the asset's binary content, set the `Accept` header of the request to [`application/octet-stream`](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types). The API will either redirect the client to the location, or stream it directly if possible. API clients should handle both a `200` or `302` response. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesAssetsWithAsset_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 users with push access to the repository can edit a release asset. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemReleasesAssetsItemWithAsset_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 *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder when successful +func (m *ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesAssetsWithAsset_ItemRequestBuilder) { + return NewItemItemReleasesAssetsWithAsset_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_releases_generate_notes_post_request_body.go b/pkg/github/repos/item_item_releases_generate_notes_post_request_body.go new file mode 100644 index 00000000..2f1db063 --- /dev/null +++ b/pkg/github/repos/item_item_releases_generate_notes_post_request_body.go @@ -0,0 +1,167 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemReleasesGenerateNotesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Specifies a path to a file in the repository containing configuration settings used for generating the release notes. If unspecified, the configuration file located in the repository at '.github/release.yml' or '.github/release.yaml' will be used. If that is not present, the default configuration will be used. + configuration_file_path *string + // The name of the previous tag to use as the starting point for the release notes. Use to manually specify the range for the set of changes considered as part this release. + previous_tag_name *string + // The tag name for the release. This can be an existing tag or a new one. + tag_name *string + // Specifies the commitish value that will be the target for the release's tag. Required if the supplied tag_name does not reference an existing tag. Ignored if the tag_name already exists. + target_commitish *string +} +// NewItemItemReleasesGenerateNotesPostRequestBody instantiates a new ItemItemReleasesGenerateNotesPostRequestBody and sets the default values. +func NewItemItemReleasesGenerateNotesPostRequestBody()(*ItemItemReleasesGenerateNotesPostRequestBody) { + m := &ItemItemReleasesGenerateNotesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemReleasesGenerateNotesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemReleasesGenerateNotesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemReleasesGenerateNotesPostRequestBody(), 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 *ItemItemReleasesGenerateNotesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetConfigurationFilePath gets the configuration_file_path property value. Specifies a path to a file in the repository containing configuration settings used for generating the release notes. If unspecified, the configuration file located in the repository at '.github/release.yml' or '.github/release.yaml' will be used. If that is not present, the default configuration will be used. +// returns a *string when successful +func (m *ItemItemReleasesGenerateNotesPostRequestBody) GetConfigurationFilePath()(*string) { + return m.configuration_file_path +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemReleasesGenerateNotesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["configuration_file_path"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetConfigurationFilePath(val) + } + return nil + } + res["previous_tag_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPreviousTagName(val) + } + return nil + } + res["tag_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagName(val) + } + return nil + } + res["target_commitish"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetCommitish(val) + } + return nil + } + return res +} +// GetPreviousTagName gets the previous_tag_name property value. The name of the previous tag to use as the starting point for the release notes. Use to manually specify the range for the set of changes considered as part this release. +// returns a *string when successful +func (m *ItemItemReleasesGenerateNotesPostRequestBody) GetPreviousTagName()(*string) { + return m.previous_tag_name +} +// GetTagName gets the tag_name property value. The tag name for the release. This can be an existing tag or a new one. +// returns a *string when successful +func (m *ItemItemReleasesGenerateNotesPostRequestBody) GetTagName()(*string) { + return m.tag_name +} +// GetTargetCommitish gets the target_commitish property value. Specifies the commitish value that will be the target for the release's tag. Required if the supplied tag_name does not reference an existing tag. Ignored if the tag_name already exists. +// returns a *string when successful +func (m *ItemItemReleasesGenerateNotesPostRequestBody) GetTargetCommitish()(*string) { + return m.target_commitish +} +// Serialize serializes information the current object +func (m *ItemItemReleasesGenerateNotesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("configuration_file_path", m.GetConfigurationFilePath()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("previous_tag_name", m.GetPreviousTagName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tag_name", m.GetTagName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_commitish", m.GetTargetCommitish()) + 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 *ItemItemReleasesGenerateNotesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetConfigurationFilePath sets the configuration_file_path property value. Specifies a path to a file in the repository containing configuration settings used for generating the release notes. If unspecified, the configuration file located in the repository at '.github/release.yml' or '.github/release.yaml' will be used. If that is not present, the default configuration will be used. +func (m *ItemItemReleasesGenerateNotesPostRequestBody) SetConfigurationFilePath(value *string)() { + m.configuration_file_path = value +} +// SetPreviousTagName sets the previous_tag_name property value. The name of the previous tag to use as the starting point for the release notes. Use to manually specify the range for the set of changes considered as part this release. +func (m *ItemItemReleasesGenerateNotesPostRequestBody) SetPreviousTagName(value *string)() { + m.previous_tag_name = value +} +// SetTagName sets the tag_name property value. The tag name for the release. This can be an existing tag or a new one. +func (m *ItemItemReleasesGenerateNotesPostRequestBody) SetTagName(value *string)() { + m.tag_name = value +} +// SetTargetCommitish sets the target_commitish property value. Specifies the commitish value that will be the target for the release's tag. Required if the supplied tag_name does not reference an existing tag. Ignored if the tag_name already exists. +func (m *ItemItemReleasesGenerateNotesPostRequestBody) SetTargetCommitish(value *string)() { + m.target_commitish = value +} +type ItemItemReleasesGenerateNotesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetConfigurationFilePath()(*string) + GetPreviousTagName()(*string) + GetTagName()(*string) + GetTargetCommitish()(*string) + SetConfigurationFilePath(value *string)() + SetPreviousTagName(value *string)() + SetTagName(value *string)() + SetTargetCommitish(value *string)() +} diff --git a/pkg/github/repos/item_item_releases_generate_notes_request_builder.go b/pkg/github/repos/item_item_releases_generate_notes_request_builder.go new file mode 100644 index 00000000..78f7d945 --- /dev/null +++ b/pkg/github/repos/item_item_releases_generate_notes_request_builder.go @@ -0,0 +1,65 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemReleasesGenerateNotesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\generate-notes +type ItemItemReleasesGenerateNotesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemReleasesGenerateNotesRequestBuilderInternal instantiates a new ItemItemReleasesGenerateNotesRequestBuilder and sets the default values. +func NewItemItemReleasesGenerateNotesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesGenerateNotesRequestBuilder) { + m := &ItemItemReleasesGenerateNotesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/generate-notes", pathParameters), + } + return m +} +// NewItemItemReleasesGenerateNotesRequestBuilder instantiates a new ItemItemReleasesGenerateNotesRequestBuilder and sets the default values. +func NewItemItemReleasesGenerateNotesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesGenerateNotesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesGenerateNotesRequestBuilderInternal(urlParams, requestAdapter) +} +// Post generate a name and body describing a [release](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-a-release). The body content will be markdown formatted and contain information like the changes since last release and users who contributed. The generated release notes are not saved anywhere. They are intended to be generated and used when creating a new release. +// returns a ReleaseNotesContentable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/releases/releases#generate-release-notes-content-for-a-release +func (m *ItemItemReleasesGenerateNotesRequestBuilder) Post(ctx context.Context, body ItemItemReleasesGenerateNotesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReleaseNotesContentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReleaseNotesContentFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReleaseNotesContentable), nil +} +// ToPostRequestInformation generate a name and body describing a [release](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-a-release). The body content will be markdown formatted and contain information like the changes since last release and users who contributed. The generated release notes are not saved anywhere. They are intended to be generated and used when creating a new release. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesGenerateNotesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemReleasesGenerateNotesPostRequestBodyable, 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 *ItemItemReleasesGenerateNotesRequestBuilder when successful +func (m *ItemItemReleasesGenerateNotesRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesGenerateNotesRequestBuilder) { + return NewItemItemReleasesGenerateNotesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_releases_item_assets_request_builder.go b/pkg/github/repos/item_item_releases_item_assets_request_builder.go new file mode 100644 index 00000000..0cdc06ab --- /dev/null +++ b/pkg/github/repos/item_item_releases_item_assets_request_builder.go @@ -0,0 +1,99 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemReleasesItemAssetsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\{release_id}\assets +type ItemItemReleasesItemAssetsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemReleasesItemAssetsRequestBuilderGetQueryParameters list release assets +type ItemItemReleasesItemAssetsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ItemItemReleasesItemAssetsRequestBuilderPostQueryParameters this endpoint makes use of a [Hypermedia relation](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned inthe response of the [Create a release endpoint](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#create-a-release) to upload a release asset.You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint.Most libraries will set the required `Content-Length` header automatically. Use the required `Content-Type` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: `application/zip`GitHub Enterprise Server expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example,you'll still need to pass your authentication to be able to upload an asset.When an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted.**Notes:*** GitHub Enterprise Server renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List release assets](https://docs.github.com/enterprise-server@3.14/rest/releases/assets#list-release-assets)"endpoint lists the renamed filenames. For more information and help, contact [GitHub Enterprise Server Support](https://support.github.com/contact?tags=dotcom-rest-api).* To find the `release_id` query the [`GET /repos/{owner}/{repo}/releases/latest` endpoint](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-the-latest-release). * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. +type ItemItemReleasesItemAssetsRequestBuilderPostQueryParameters struct { + Label *string `uriparametername:"label"` + Name *string `uriparametername:"name"` +} +// NewItemItemReleasesItemAssetsRequestBuilderInternal instantiates a new ItemItemReleasesItemAssetsRequestBuilder and sets the default values. +func NewItemItemReleasesItemAssetsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesItemAssetsRequestBuilder) { + m := &ItemItemReleasesItemAssetsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/{release_id}/assets?name={name}{&label*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemReleasesItemAssetsRequestBuilder instantiates a new ItemItemReleasesItemAssetsRequestBuilder and sets the default values. +func NewItemItemReleasesItemAssetsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesItemAssetsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesItemAssetsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list release assets +// returns a []ReleaseAssetable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/releases/assets#list-release-assets +func (m *ItemItemReleasesItemAssetsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesItemAssetsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReleaseAssetable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReleaseAssetFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReleaseAssetable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReleaseAssetable) + } + } + return val, nil +} +// Post this endpoint makes use of a [Hypermedia relation](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned inthe response of the [Create a release endpoint](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#create-a-release) to upload a release asset.You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint.Most libraries will set the required `Content-Length` header automatically. Use the required `Content-Type` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: `application/zip`GitHub Enterprise Server expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example,you'll still need to pass your authentication to be able to upload an asset.When an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted.**Notes:*** GitHub Enterprise Server renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List release assets](https://docs.github.com/enterprise-server@3.14/rest/releases/assets#list-release-assets)"endpoint lists the renamed filenames. For more information and help, contact [GitHub Enterprise Server Support](https://support.github.com/contact?tags=dotcom-rest-api).* To find the `release_id` query the [`GET /repos/{owner}/{repo}/releases/latest` endpoint](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-the-latest-release). * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. +// returns a ReleaseAssetable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/releases/assets#upload-a-release-asset +func (m *ItemItemReleasesItemAssetsRequestBuilder) Post(ctx context.Context, body []byte, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesItemAssetsRequestBuilderPostQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReleaseAssetable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReleaseAssetFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ReleaseAssetable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemReleasesItemAssetsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesItemAssetsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/{release_id}/assets{?page*,per_page*}", m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + return requestInfo, nil +} +// ToPostRequestInformation this endpoint makes use of a [Hypermedia relation](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia) to determine which URL to access. The endpoint you call to upload release assets is specific to your release. Use the `upload_url` returned inthe response of the [Create a release endpoint](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#create-a-release) to upload a release asset.You need to use an HTTP client which supports [SNI](http://en.wikipedia.org/wiki/Server_Name_Indication) to make calls to this endpoint.Most libraries will set the required `Content-Length` header automatically. Use the required `Content-Type` header to provide the media type of the asset. For a list of media types, see [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml). For example: `application/zip`GitHub Enterprise Server expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example,you'll still need to pass your authentication to be able to upload an asset.When an upstream failure occurs, you will receive a `502 Bad Gateway` status. This may leave an empty asset with a state of `starter`. It can be safely deleted.**Notes:*** GitHub Enterprise Server renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "[List release assets](https://docs.github.com/enterprise-server@3.14/rest/releases/assets#list-release-assets)"endpoint lists the renamed filenames. For more information and help, contact [GitHub Enterprise Server Support](https://support.github.com/contact?tags=dotcom-rest-api).* To find the `release_id` query the [`GET /repos/{owner}/{repo}/releases/latest` endpoint](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-the-latest-release). * If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete the old file before you can re-upload the new asset. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesItemAssetsRequestBuilder) ToPostRequestInformation(ctx context.Context, body []byte, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesItemAssetsRequestBuilderPostQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/{release_id}/assets?name={name}{&label*}", m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/json") + requestInfo.SetStreamContentAndContentType(body, "application/octet-stream") + 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 *ItemItemReleasesItemAssetsRequestBuilder when successful +func (m *ItemItemReleasesItemAssetsRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesItemAssetsRequestBuilder) { + return NewItemItemReleasesItemAssetsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_releases_item_reactions_post_request_body.go b/pkg/github/repos/item_item_releases_item_reactions_post_request_body.go new file mode 100644 index 00000000..a7a44a27 --- /dev/null +++ b/pkg/github/repos/item_item_releases_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemReleasesItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemReleasesItemReactionsPostRequestBody instantiates a new ItemItemReleasesItemReactionsPostRequestBody and sets the default values. +func NewItemItemReleasesItemReactionsPostRequestBody()(*ItemItemReleasesItemReactionsPostRequestBody) { + m := &ItemItemReleasesItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemReleasesItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemReleasesItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemReleasesItemReactionsPostRequestBody(), 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 *ItemItemReleasesItemReactionsPostRequestBody) 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 *ItemItemReleasesItemReactionsPostRequestBody) 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 *ItemItemReleasesItemReactionsPostRequestBody) 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 *ItemItemReleasesItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemReleasesItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_releases_item_reactions_request_builder.go b/pkg/github/repos/item_item_releases_item_reactions_request_builder.go new file mode 100644 index 00000000..e17894a7 --- /dev/null +++ b/pkg/github/repos/item_item_releases_item_reactions_request_builder.go @@ -0,0 +1,120 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i58e7f47a46769008691a89c3902fe93a2a8e6b09b2c27e4de9a7f519666ac956 "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/releases/item/reactions" +) + +// ItemItemReleasesItemReactionsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\{release_id}\reactions +type ItemItemReleasesItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemReleasesItemReactionsRequestBuilderGetQueryParameters list the reactions to a [release](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-a-release). +type ItemItemReleasesItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a release. + Content *i58e7f47a46769008691a89c3902fe93a2a8e6b09b2c27e4de9a7f519666ac956.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByReaction_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.releases.item.reactions.item collection +// returns a *ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemReleasesItemReactionsRequestBuilder) ByReaction_id(reaction_id int32)(*ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["reaction_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(reaction_id), 10) + return NewItemItemReleasesItemReactionsWithReaction_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemReleasesItemReactionsRequestBuilderInternal instantiates a new ItemItemReleasesItemReactionsRequestBuilder and sets the default values. +func NewItemItemReleasesItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesItemReactionsRequestBuilder) { + m := &ItemItemReleasesItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/{release_id}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemReleasesItemReactionsRequestBuilder instantiates a new ItemItemReleasesItemReactionsRequestBuilder and sets the default values. +func NewItemItemReleasesItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list the reactions to a [release](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-a-release). +// returns a []Reactionable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-a-release +func (m *ItemItemReleasesItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesItemReactionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable) + } + } + return val, nil +} +// Post create a reaction to a [release](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-a-release). A response with a `Status: 200 OK` means that you already added the reaction type to this release. +// returns a Reactionable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#create-reaction-for-a-release +func (m *ItemItemReleasesItemReactionsRequestBuilder) Post(ctx context.Context, body ItemItemReleasesItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable), nil +} +// ToGetRequestInformation list the reactions to a [release](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-a-release). +// returns a *RequestInformation when successful +func (m *ItemItemReleasesItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesItemReactionsRequestBuilderGetQueryParameters])(*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 create a reaction to a [release](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-a-release). A response with a `Status: 200 OK` means that you already added the reaction type to this release. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemReleasesItemReactionsPostRequestBodyable, 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 *ItemItemReleasesItemReactionsRequestBuilder when successful +func (m *ItemItemReleasesItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesItemReactionsRequestBuilder) { + return NewItemItemReleasesItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_releases_item_reactions_with_reaction_escaped_item_request_builder.go b/pkg/github/repos/item_item_releases_item_reactions_with_reaction_escaped_item_request_builder.go new file mode 100644 index 00000000..bcf9aacd --- /dev/null +++ b/pkg/github/repos/item_item_releases_item_reactions_with_reaction_escaped_item_request_builder.go @@ -0,0 +1,51 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\{release_id}\reactions\{reaction_id} +type ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemReleasesItemReactionsWithReaction_ItemRequestBuilderInternal instantiates a new ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemReleasesItemReactionsWithReaction_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder) { + m := &ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/{release_id}/reactions/{reaction_id}", pathParameters), + } + return m +} +// NewItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder instantiates a new ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder and sets the default values. +func NewItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesItemReactionsWithReaction_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!NOTE]> You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id`.Delete a reaction to a [release](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-a-release). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#delete-a-release-reaction +func (m *ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation > [!NOTE]> You can also specify a repository by `repository_id` using the route `DELETE delete /repositories/:repository_id/releases/:release_id/reactions/:reaction_id`.Delete a reaction to a [release](https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-a-release). +// returns a *RequestInformation when successful +func (m *ItemItemReleasesItemReactionsWithReaction_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) + 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 *ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder when successful +func (m *ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder) { + return NewItemItemReleasesItemReactionsWithReaction_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_releases_item_with_release_escaped_patch_request_body.go b/pkg/github/repos/item_item_releases_item_with_release_escaped_patch_request_body.go new file mode 100644 index 00000000..766bd988 --- /dev/null +++ b/pkg/github/repos/item_item_releases_item_with_release_escaped_patch_request_body.go @@ -0,0 +1,225 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemReleasesItemWithRelease_PatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Text describing the contents of the tag. + body *string + // `true` makes the release a draft, and `false` publishes the release. + draft *bool + // The name of the release. + name *string + // `true` to identify the release as a prerelease, `false` to identify the release as a full release. + prerelease *bool + // The name of the tag. + tag_name *string + // Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch. + target_commitish *string +} +// NewItemItemReleasesItemWithRelease_PatchRequestBody instantiates a new ItemItemReleasesItemWithRelease_PatchRequestBody and sets the default values. +func NewItemItemReleasesItemWithRelease_PatchRequestBody()(*ItemItemReleasesItemWithRelease_PatchRequestBody) { + m := &ItemItemReleasesItemWithRelease_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemReleasesItemWithRelease_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemReleasesItemWithRelease_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemReleasesItemWithRelease_PatchRequestBody(), 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 *ItemItemReleasesItemWithRelease_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. Text describing the contents of the tag. +// returns a *string when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetBody()(*string) { + return m.body +} +// GetDraft gets the draft property value. `true` makes the release a draft, and `false` publishes the release. +// returns a *bool when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetDraft()(*bool) { + return m.draft +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(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["prerelease"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrerelease(val) + } + return nil + } + res["tag_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagName(val) + } + return nil + } + res["target_commitish"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetCommitish(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the release. +// returns a *string when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetName()(*string) { + return m.name +} +// GetPrerelease gets the prerelease property value. `true` to identify the release as a prerelease, `false` to identify the release as a full release. +// returns a *bool when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetPrerelease()(*bool) { + return m.prerelease +} +// GetTagName gets the tag_name property value. The name of the tag. +// returns a *string when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetTagName()(*string) { + return m.tag_name +} +// GetTargetCommitish gets the target_commitish property value. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch. +// returns a *string when successful +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) GetTargetCommitish()(*string) { + return m.target_commitish +} +// Serialize serializes information the current object +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("prerelease", m.GetPrerelease()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tag_name", m.GetTagName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_commitish", m.GetTargetCommitish()) + 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 *ItemItemReleasesItemWithRelease_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. Text describing the contents of the tag. +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) SetBody(value *string)() { + m.body = value +} +// SetDraft sets the draft property value. `true` makes the release a draft, and `false` publishes the release. +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) SetDraft(value *bool)() { + m.draft = value +} +// SetName sets the name property value. The name of the release. +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrerelease sets the prerelease property value. `true` to identify the release as a prerelease, `false` to identify the release as a full release. +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) SetPrerelease(value *bool)() { + m.prerelease = value +} +// SetTagName sets the tag_name property value. The name of the tag. +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) SetTagName(value *string)() { + m.tag_name = value +} +// SetTargetCommitish sets the target_commitish property value. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch. +func (m *ItemItemReleasesItemWithRelease_PatchRequestBody) SetTargetCommitish(value *string)() { + m.target_commitish = value +} +type ItemItemReleasesItemWithRelease_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetDraft()(*bool) + GetName()(*string) + GetPrerelease()(*bool) + GetTagName()(*string) + GetTargetCommitish()(*string) + SetBody(value *string)() + SetDraft(value *bool)() + SetName(value *string)() + SetPrerelease(value *bool)() + SetTagName(value *string)() + SetTargetCommitish(value *string)() +} diff --git a/pkg/github/repos/item_item_releases_latest_request_builder.go b/pkg/github/repos/item_item_releases_latest_request_builder.go new file mode 100644 index 00000000..616850f9 --- /dev/null +++ b/pkg/github/repos/item_item_releases_latest_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemReleasesLatestRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\latest +type ItemItemReleasesLatestRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemReleasesLatestRequestBuilderInternal instantiates a new ItemItemReleasesLatestRequestBuilder and sets the default values. +func NewItemItemReleasesLatestRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesLatestRequestBuilder) { + m := &ItemItemReleasesLatestRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/latest", pathParameters), + } + return m +} +// NewItemItemReleasesLatestRequestBuilder instantiates a new ItemItemReleasesLatestRequestBuilder and sets the default values. +func NewItemItemReleasesLatestRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesLatestRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesLatestRequestBuilderInternal(urlParams, requestAdapter) +} +// Get view the latest published full release for the repository.The latest release is the most recent non-prerelease, non-draft release, sorted by the `created_at` attribute. The `created_at` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. +// returns a Releaseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-the-latest-release +func (m *ItemItemReleasesLatestRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Releaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReleaseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Releaseable), nil +} +// ToGetRequestInformation view the latest published full release for the repository.The latest release is the most recent non-prerelease, non-draft release, sorted by the `created_at` attribute. The `created_at` attribute is the date of the commit used for the release, and not the date when the release was drafted or published. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesLatestRequestBuilder) 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 *ItemItemReleasesLatestRequestBuilder when successful +func (m *ItemItemReleasesLatestRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesLatestRequestBuilder) { + return NewItemItemReleasesLatestRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_releases_post_request_body.go b/pkg/github/repos/item_item_releases_post_request_body.go new file mode 100644 index 00000000..2874a0f4 --- /dev/null +++ b/pkg/github/repos/item_item_releases_post_request_body.go @@ -0,0 +1,254 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemReleasesPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Text describing the contents of the tag. + body *string + // `true` to create a draft (unpublished) release, `false` to create a published one. + draft *bool + // Whether to automatically generate the name and body for this release. If `name` is specified, the specified name will be used; otherwise, a name will be automatically generated. If `body` is specified, the body will be pre-pended to the automatically generated notes. + generate_release_notes *bool + // The name of the release. + name *string + // `true` to identify the release as a prerelease. `false` to identify the release as a full release. + prerelease *bool + // The name of the tag. + tag_name *string + // Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch. + target_commitish *string +} +// NewItemItemReleasesPostRequestBody instantiates a new ItemItemReleasesPostRequestBody and sets the default values. +func NewItemItemReleasesPostRequestBody()(*ItemItemReleasesPostRequestBody) { + m := &ItemItemReleasesPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemReleasesPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemReleasesPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemReleasesPostRequestBody(), 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 *ItemItemReleasesPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. Text describing the contents of the tag. +// returns a *string when successful +func (m *ItemItemReleasesPostRequestBody) GetBody()(*string) { + return m.body +} +// GetDraft gets the draft property value. `true` to create a draft (unpublished) release, `false` to create a published one. +// returns a *bool when successful +func (m *ItemItemReleasesPostRequestBody) GetDraft()(*bool) { + return m.draft +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemReleasesPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["draft"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDraft(val) + } + return nil + } + res["generate_release_notes"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetGenerateReleaseNotes(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["prerelease"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrerelease(val) + } + return nil + } + res["tag_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTagName(val) + } + return nil + } + res["target_commitish"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetCommitish(val) + } + return nil + } + return res +} +// GetGenerateReleaseNotes gets the generate_release_notes property value. Whether to automatically generate the name and body for this release. If `name` is specified, the specified name will be used; otherwise, a name will be automatically generated. If `body` is specified, the body will be pre-pended to the automatically generated notes. +// returns a *bool when successful +func (m *ItemItemReleasesPostRequestBody) GetGenerateReleaseNotes()(*bool) { + return m.generate_release_notes +} +// GetName gets the name property value. The name of the release. +// returns a *string when successful +func (m *ItemItemReleasesPostRequestBody) GetName()(*string) { + return m.name +} +// GetPrerelease gets the prerelease property value. `true` to identify the release as a prerelease. `false` to identify the release as a full release. +// returns a *bool when successful +func (m *ItemItemReleasesPostRequestBody) GetPrerelease()(*bool) { + return m.prerelease +} +// GetTagName gets the tag_name property value. The name of the tag. +// returns a *string when successful +func (m *ItemItemReleasesPostRequestBody) GetTagName()(*string) { + return m.tag_name +} +// GetTargetCommitish gets the target_commitish property value. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch. +// returns a *string when successful +func (m *ItemItemReleasesPostRequestBody) GetTargetCommitish()(*string) { + return m.target_commitish +} +// Serialize serializes information the current object +func (m *ItemItemReleasesPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("draft", m.GetDraft()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("generate_release_notes", m.GetGenerateReleaseNotes()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("prerelease", m.GetPrerelease()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("tag_name", m.GetTagName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_commitish", m.GetTargetCommitish()) + 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 *ItemItemReleasesPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. Text describing the contents of the tag. +func (m *ItemItemReleasesPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetDraft sets the draft property value. `true` to create a draft (unpublished) release, `false` to create a published one. +func (m *ItemItemReleasesPostRequestBody) SetDraft(value *bool)() { + m.draft = value +} +// SetGenerateReleaseNotes sets the generate_release_notes property value. Whether to automatically generate the name and body for this release. If `name` is specified, the specified name will be used; otherwise, a name will be automatically generated. If `body` is specified, the body will be pre-pended to the automatically generated notes. +func (m *ItemItemReleasesPostRequestBody) SetGenerateReleaseNotes(value *bool)() { + m.generate_release_notes = value +} +// SetName sets the name property value. The name of the release. +func (m *ItemItemReleasesPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrerelease sets the prerelease property value. `true` to identify the release as a prerelease. `false` to identify the release as a full release. +func (m *ItemItemReleasesPostRequestBody) SetPrerelease(value *bool)() { + m.prerelease = value +} +// SetTagName sets the tag_name property value. The name of the tag. +func (m *ItemItemReleasesPostRequestBody) SetTagName(value *string)() { + m.tag_name = value +} +// SetTargetCommitish sets the target_commitish property value. Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch. +func (m *ItemItemReleasesPostRequestBody) SetTargetCommitish(value *string)() { + m.target_commitish = value +} +type ItemItemReleasesPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetDraft()(*bool) + GetGenerateReleaseNotes()(*bool) + GetName()(*string) + GetPrerelease()(*bool) + GetTagName()(*string) + GetTargetCommitish()(*string) + SetBody(value *string)() + SetDraft(value *bool)() + SetGenerateReleaseNotes(value *bool)() + SetName(value *string)() + SetPrerelease(value *bool)() + SetTagName(value *string)() + SetTargetCommitish(value *string)() +} diff --git a/pkg/github/repos/item_item_releases_request_builder.go b/pkg/github/repos/item_item_releases_request_builder.go new file mode 100644 index 00000000..419fd846 --- /dev/null +++ b/pkg/github/repos/item_item_releases_request_builder.go @@ -0,0 +1,137 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemReleasesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases +type ItemItemReleasesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemReleasesRequestBuilderGetQueryParameters this returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/enterprise-server@3.14/rest/repos/repos#list-repository-tags).Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. +type ItemItemReleasesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// Assets the assets property +// returns a *ItemItemReleasesAssetsRequestBuilder when successful +func (m *ItemItemReleasesRequestBuilder) Assets()(*ItemItemReleasesAssetsRequestBuilder) { + return NewItemItemReleasesAssetsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ByRelease_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.releases.item collection +// returns a *ItemItemReleasesWithRelease_ItemRequestBuilder when successful +func (m *ItemItemReleasesRequestBuilder) ByRelease_id(release_id int32)(*ItemItemReleasesWithRelease_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["release_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(release_id), 10) + return NewItemItemReleasesWithRelease_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemReleasesRequestBuilderInternal instantiates a new ItemItemReleasesRequestBuilder and sets the default values. +func NewItemItemReleasesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesRequestBuilder) { + m := &ItemItemReleasesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemReleasesRequestBuilder instantiates a new ItemItemReleasesRequestBuilder and sets the default values. +func NewItemItemReleasesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesRequestBuilderInternal(urlParams, requestAdapter) +} +// GenerateNotes the generateNotes property +// returns a *ItemItemReleasesGenerateNotesRequestBuilder when successful +func (m *ItemItemReleasesRequestBuilder) GenerateNotes()(*ItemItemReleasesGenerateNotesRequestBuilder) { + return NewItemItemReleasesGenerateNotesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get this returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/enterprise-server@3.14/rest/repos/repos#list-repository-tags).Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. +// returns a []Releaseable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/releases/releases#list-releases +func (m *ItemItemReleasesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Releaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReleaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Releaseable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Releaseable) + } + } + return val, nil +} +// Latest the latest property +// returns a *ItemItemReleasesLatestRequestBuilder when successful +func (m *ItemItemReleasesRequestBuilder) Latest()(*ItemItemReleasesLatestRequestBuilder) { + return NewItemItemReleasesLatestRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Post users with push access to the repository can create a release.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)." +// returns a Releaseable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/releases/releases#create-a-release +func (m *ItemItemReleasesRequestBuilder) Post(ctx context.Context, body ItemItemReleasesPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Releaseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReleaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Releaseable), nil +} +// Tags the tags property +// returns a *ItemItemReleasesTagsRequestBuilder when successful +func (m *ItemItemReleasesRequestBuilder) Tags()(*ItemItemReleasesTagsRequestBuilder) { + return NewItemItemReleasesTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation this returns a list of releases, which does not include regular Git tags that have not been associated with a release. To get a list of Git tags, use the [Repository Tags API](https://docs.github.com/enterprise-server@3.14/rest/repos/repos#list-repository-tags).Information about published releases are available to everyone. Only users with push access will receive listings for draft releases. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReleasesRequestBuilderGetQueryParameters])(*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 users with push access to the repository can create a release.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)." +// returns a *RequestInformation when successful +func (m *ItemItemReleasesRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemReleasesPostRequestBodyable, 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 *ItemItemReleasesRequestBuilder when successful +func (m *ItemItemReleasesRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesRequestBuilder) { + return NewItemItemReleasesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_releases_tags_request_builder.go b/pkg/github/repos/item_item_releases_tags_request_builder.go new file mode 100644 index 00000000..d9ea9e7a --- /dev/null +++ b/pkg/github/repos/item_item_releases_tags_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemReleasesTagsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\tags +type ItemItemReleasesTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTag gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.releases.tags.item collection +// returns a *ItemItemReleasesTagsWithTagItemRequestBuilder when successful +func (m *ItemItemReleasesTagsRequestBuilder) ByTag(tag string)(*ItemItemReleasesTagsWithTagItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if tag != "" { + urlTplParams["tag"] = tag + } + return NewItemItemReleasesTagsWithTagItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemReleasesTagsRequestBuilderInternal instantiates a new ItemItemReleasesTagsRequestBuilder and sets the default values. +func NewItemItemReleasesTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesTagsRequestBuilder) { + m := &ItemItemReleasesTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/tags", pathParameters), + } + return m +} +// NewItemItemReleasesTagsRequestBuilder instantiates a new ItemItemReleasesTagsRequestBuilder and sets the default values. +func NewItemItemReleasesTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesTagsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesTagsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_releases_tags_with_tag_item_request_builder.go b/pkg/github/repos/item_item_releases_tags_with_tag_item_request_builder.go new file mode 100644 index 00000000..27d98850 --- /dev/null +++ b/pkg/github/repos/item_item_releases_tags_with_tag_item_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemReleasesTagsWithTagItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\tags\{tag} +type ItemItemReleasesTagsWithTagItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemReleasesTagsWithTagItemRequestBuilderInternal instantiates a new ItemItemReleasesTagsWithTagItemRequestBuilder and sets the default values. +func NewItemItemReleasesTagsWithTagItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesTagsWithTagItemRequestBuilder) { + m := &ItemItemReleasesTagsWithTagItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/tags/{tag}", pathParameters), + } + return m +} +// NewItemItemReleasesTagsWithTagItemRequestBuilder instantiates a new ItemItemReleasesTagsWithTagItemRequestBuilder and sets the default values. +func NewItemItemReleasesTagsWithTagItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesTagsWithTagItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesTagsWithTagItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get a published release with the specified tag. +// returns a Releaseable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-a-release-by-tag-name +func (m *ItemItemReleasesTagsWithTagItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Releaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReleaseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Releaseable), nil +} +// ToGetRequestInformation get a published release with the specified tag. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesTagsWithTagItemRequestBuilder) 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 *ItemItemReleasesTagsWithTagItemRequestBuilder when successful +func (m *ItemItemReleasesTagsWithTagItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesTagsWithTagItemRequestBuilder) { + return NewItemItemReleasesTagsWithTagItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_releases_with_release_escaped_item_request_builder.go b/pkg/github/repos/item_item_releases_with_release_escaped_item_request_builder.go new file mode 100644 index 00000000..dcfb84e3 --- /dev/null +++ b/pkg/github/repos/item_item_releases_with_release_escaped_item_request_builder.go @@ -0,0 +1,120 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemReleasesWithRelease_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\releases\{release_id} +type ItemItemReleasesWithRelease_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Assets the assets property +// returns a *ItemItemReleasesItemAssetsRequestBuilder when successful +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) Assets()(*ItemItemReleasesItemAssetsRequestBuilder) { + return NewItemItemReleasesItemAssetsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemReleasesWithRelease_ItemRequestBuilderInternal instantiates a new ItemItemReleasesWithRelease_ItemRequestBuilder and sets the default values. +func NewItemItemReleasesWithRelease_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesWithRelease_ItemRequestBuilder) { + m := &ItemItemReleasesWithRelease_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/releases/{release_id}", pathParameters), + } + return m +} +// NewItemItemReleasesWithRelease_ItemRequestBuilder instantiates a new ItemItemReleasesWithRelease_ItemRequestBuilder and sets the default values. +func NewItemItemReleasesWithRelease_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReleasesWithRelease_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReleasesWithRelease_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete users with push access to the repository can delete a release. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/releases/releases#delete-a-release +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets a public release with the specified release ID.> [!NOTE]> This returns an `upload_url` key corresponding to the endpoint for uploading release assets. This key is a hypermedia resource. For more information, see "[Getting started with the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia)." +// returns a Releaseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/releases/releases#get-a-release +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Releaseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReleaseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Releaseable), nil +} +// Patch users with push access to the repository can edit a release. +// returns a Releaseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/releases/releases#update-a-release +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) Patch(ctx context.Context, body ItemItemReleasesItemWithRelease_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Releaseable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReleaseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Releaseable), nil +} +// Reactions the reactions property +// returns a *ItemItemReleasesItemReactionsRequestBuilder when successful +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) Reactions()(*ItemItemReleasesItemReactionsRequestBuilder) { + return NewItemItemReleasesItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation users with push access to the repository can delete a release. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesWithRelease_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) + return requestInfo, nil +} +// ToGetRequestInformation gets a public release with the specified release ID.> [!NOTE]> This returns an `upload_url` key corresponding to the endpoint for uploading release assets. This key is a hypermedia resource. For more information, see "[Getting started with the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#hypermedia)." +// returns a *RequestInformation when successful +func (m *ItemItemReleasesWithRelease_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 users with push access to the repository can edit a release. +// returns a *RequestInformation when successful +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemReleasesItemWithRelease_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 *ItemItemReleasesWithRelease_ItemRequestBuilder when successful +func (m *ItemItemReleasesWithRelease_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemReleasesWithRelease_ItemRequestBuilder) { + return NewItemItemReleasesWithRelease_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_replicas_caches.go b/pkg/github/repos/item_item_replicas_caches.go new file mode 100644 index 00000000..358e8965 --- /dev/null +++ b/pkg/github/repos/item_item_replicas_caches.go @@ -0,0 +1,139 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemReplicasCaches status for a cache replica +type ItemItemReplicasCaches 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 git property + git ItemItemReplicasCaches_gitable + // The host property + host *string + // The location property + location *string +} +// NewItemItemReplicasCaches instantiates a new ItemItemReplicasCaches and sets the default values. +func NewItemItemReplicasCaches()(*ItemItemReplicasCaches) { + m := &ItemItemReplicasCaches{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemReplicasCachesFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemReplicasCachesFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemReplicasCaches(), 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 *ItemItemReplicasCaches) 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 *ItemItemReplicasCaches) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["git"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemReplicasCaches_gitFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetGit(val.(ItemItemReplicasCaches_gitable)) + } + return nil + } + res["host"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHost(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(val) + } + return nil + } + return res +} +// GetGit gets the git property value. The git property +// returns a ItemItemReplicasCaches_gitable when successful +func (m *ItemItemReplicasCaches) GetGit()(ItemItemReplicasCaches_gitable) { + return m.git +} +// GetHost gets the host property value. The host property +// returns a *string when successful +func (m *ItemItemReplicasCaches) GetHost()(*string) { + return m.host +} +// GetLocation gets the location property value. The location property +// returns a *string when successful +func (m *ItemItemReplicasCaches) GetLocation()(*string) { + return m.location +} +// Serialize serializes information the current object +func (m *ItemItemReplicasCaches) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("git", m.GetGit()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("host", m.GetHost()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + 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 *ItemItemReplicasCaches) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetGit sets the git property value. The git property +func (m *ItemItemReplicasCaches) SetGit(value ItemItemReplicasCaches_gitable)() { + m.git = value +} +// SetHost sets the host property value. The host property +func (m *ItemItemReplicasCaches) SetHost(value *string)() { + m.host = value +} +// SetLocation sets the location property value. The location property +func (m *ItemItemReplicasCaches) SetLocation(value *string)() { + m.location = value +} +type ItemItemReplicasCachesable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetGit()(ItemItemReplicasCaches_gitable) + GetHost()(*string) + GetLocation()(*string) + SetGit(value ItemItemReplicasCaches_gitable)() + SetHost(value *string)() + SetLocation(value *string)() +} diff --git a/pkg/github/repos/item_item_replicas_caches_escaped_git.go b/pkg/github/repos/item_item_replicas_caches_escaped_git.go new file mode 100644 index 00000000..156cb6d6 --- /dev/null +++ b/pkg/github/repos/item_item_replicas_caches_escaped_git.go @@ -0,0 +1,81 @@ +package repos + +import ( + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemReplicasCaches_git 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 last_sync property + last_sync *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time +} +// NewItemItemReplicasCaches_git instantiates a new ItemItemReplicasCaches_git and sets the default values. +func NewItemItemReplicasCaches_git()(*ItemItemReplicasCaches_git) { + m := &ItemItemReplicasCaches_git{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemReplicasCaches_gitFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemReplicasCaches_gitFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemReplicasCaches_git(), 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 *ItemItemReplicasCaches_git) 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 *ItemItemReplicasCaches_git) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["last_sync"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetTimeValue() + if err != nil { + return err + } + if val != nil { + m.SetLastSync(val) + } + return nil + } + return res +} +// GetLastSync gets the last_sync property value. The last_sync property +// returns a *Time when successful +func (m *ItemItemReplicasCaches_git) GetLastSync()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) { + return m.last_sync +} +// Serialize serializes information the current object +func (m *ItemItemReplicasCaches_git) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteTimeValue("last_sync", m.GetLastSync()) + 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 *ItemItemReplicasCaches_git) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLastSync sets the last_sync property value. The last_sync property +func (m *ItemItemReplicasCaches_git) SetLastSync(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() { + m.last_sync = value +} +type ItemItemReplicasCaches_gitable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLastSync()(*i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time) + SetLastSync(value *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time)() +} diff --git a/pkg/github/repos/item_item_replicas_caches_request_builder.go b/pkg/github/repos/item_item_replicas_caches_request_builder.go new file mode 100644 index 00000000..985623da --- /dev/null +++ b/pkg/github/repos/item_item_replicas_caches_request_builder.go @@ -0,0 +1,73 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemReplicasCachesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\replicas\caches +type ItemItemReplicasCachesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemReplicasCachesRequestBuilderGetQueryParameters lists the status of each repository cache replica. +type ItemItemReplicasCachesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemReplicasCachesRequestBuilderInternal instantiates a new ItemItemReplicasCachesRequestBuilder and sets the default values. +func NewItemItemReplicasCachesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReplicasCachesRequestBuilder) { + m := &ItemItemReplicasCachesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/replicas/caches{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemReplicasCachesRequestBuilder instantiates a new ItemItemReplicasCachesRequestBuilder and sets the default values. +func NewItemItemReplicasCachesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReplicasCachesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReplicasCachesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the status of each repository cache replica. +// returns a []ItemItemReplicasCachesable 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/enterprise-server@3.14/rest/repos/repos#list-repository-cache-replication-status +func (m *ItemItemReplicasCachesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReplicasCachesRequestBuilderGetQueryParameters])([]ItemItemReplicasCachesable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, CreateItemItemReplicasCachesFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ItemItemReplicasCachesable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ItemItemReplicasCachesable) + } + } + return val, nil +} +// ToGetRequestInformation lists the status of each repository cache replica. +// returns a *RequestInformation when successful +func (m *ItemItemReplicasCachesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemReplicasCachesRequestBuilderGetQueryParameters])(*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 *ItemItemReplicasCachesRequestBuilder when successful +func (m *ItemItemReplicasCachesRequestBuilder) WithUrl(rawUrl string)(*ItemItemReplicasCachesRequestBuilder) { + return NewItemItemReplicasCachesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_replicas_request_builder.go b/pkg/github/repos/item_item_replicas_request_builder.go new file mode 100644 index 00000000..3eb8ccb1 --- /dev/null +++ b/pkg/github/repos/item_item_replicas_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemReplicasRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\replicas +type ItemItemReplicasRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Caches the caches property +// returns a *ItemItemReplicasCachesRequestBuilder when successful +func (m *ItemItemReplicasRequestBuilder) Caches()(*ItemItemReplicasCachesRequestBuilder) { + return NewItemItemReplicasCachesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemReplicasRequestBuilderInternal instantiates a new ItemItemReplicasRequestBuilder and sets the default values. +func NewItemItemReplicasRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReplicasRequestBuilder) { + m := &ItemItemReplicasRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/replicas", pathParameters), + } + return m +} +// NewItemItemReplicasRequestBuilder instantiates a new ItemItemReplicasRequestBuilder and sets the default values. +func NewItemItemReplicasRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemReplicasRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemReplicasRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_repo403_error.go b/pkg/github/repos/item_item_repo403_error.go new file mode 100644 index 00000000..6e1369f7 --- /dev/null +++ b/pkg/github/repos/item_item_repo403_error.go @@ -0,0 +1,117 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemRepo403Error 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 documentation_url property + documentation_url *string + // The message property + message *string +} +// NewItemItemRepo403Error instantiates a new ItemItemRepo403Error and sets the default values. +func NewItemItemRepo403Error()(*ItemItemRepo403Error) { + m := &ItemItemRepo403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRepo403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRepo403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRepo403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemItemRepo403Error) 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 *ItemItemRepo403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemItemRepo403Error) 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 *ItemItemRepo403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 *ItemItemRepo403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemItemRepo403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemItemRepo403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemItemRepo403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ItemItemRepo403Error) SetMessage(value *string)() { + m.message = value +} +type ItemItemRepo403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/pkg/github/repos/item_item_repo_patch_request_body.go b/pkg/github/repos/item_item_repo_patch_request_body.go new file mode 100644 index 00000000..315a505d --- /dev/null +++ b/pkg/github/repos/item_item_repo_patch_request_body.go @@ -0,0 +1,605 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemRepoPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Either `true` to allow private forks, or `false` to prevent private forks. + allow_forking *bool + // Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. + allow_merge_commit *bool + // Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. + allow_rebase_merge *bool + // Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. + allow_squash_merge *bool + // Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise. + allow_update_branch *bool + // Whether to archive this repository. `false` will unarchive a previously archived repository. + archived *bool + // Updates the default branch for this repository. + default_branch *string + // Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. + delete_branch_on_merge *bool + // A short description of the repository. + description *string + // Either `true` to enable issues for this repository or `false` to disable them. + has_issues *bool + // Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. + has_projects *bool + // Either `true` to enable the wiki for this repository or `false` to disable it. + has_wiki *bool + // A URL with more information about the repository. + homepage *string + // Either `true` to make this repo available as a template repository or `false` to prevent it. + is_template *bool + // The name of the repository. + name *string + // Either `true` to make the repository private or `false` to make it public. Default: `false`. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/enterprise-server@3.14/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. + private *bool + // Specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. + security_and_analysis ItemItemRepoPatchRequestBody_security_and_analysisable + // Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. + // Deprecated: + use_squash_pr_title_as_default *bool + // Either `true` to require contributors to sign off on web-based commits, or `false` to not require contributors to sign off on web-based commits. + web_commit_signoff_required *bool +} +// NewItemItemRepoPatchRequestBody instantiates a new ItemItemRepoPatchRequestBody and sets the default values. +func NewItemItemRepoPatchRequestBody()(*ItemItemRepoPatchRequestBody) { + m := &ItemItemRepoPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRepoPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRepoPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRepoPatchRequestBody(), 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 *ItemItemRepoPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowForking gets the allow_forking property value. Either `true` to allow private forks, or `false` to prevent private forks. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetAllowForking()(*bool) { + return m.allow_forking +} +// GetAllowMergeCommit gets the allow_merge_commit property value. Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAllowUpdateBranch gets the allow_update_branch property value. Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetAllowUpdateBranch()(*bool) { + return m.allow_update_branch +} +// GetArchived gets the archived property value. Whether to archive this repository. `false` will unarchive a previously archived repository. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetArchived()(*bool) { + return m.archived +} +// GetDefaultBranch gets the default_branch property value. Updates the default branch for this repository. +// returns a *string when successful +func (m *ItemItemRepoPatchRequestBody) GetDefaultBranch()(*string) { + return m.default_branch +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDescription gets the description property value. A short description of the repository. +// returns a *string when successful +func (m *ItemItemRepoPatchRequestBody) 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 *ItemItemRepoPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_forking"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowForking(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["allow_update_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowUpdateBranch(val) + } + return nil + } + res["archived"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetArchived(val) + } + return nil + } + res["default_branch"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetDefaultBranch(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + 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["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(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["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["security_and_analysis"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemRepoPatchRequestBody_security_and_analysisFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecurityAndAnalysis(val.(ItemItemRepoPatchRequestBody_security_and_analysisable)) + } + return nil + } + res["use_squash_pr_title_as_default"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetUseSquashPrTitleAsDefault(val) + } + return nil + } + res["web_commit_signoff_required"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetWebCommitSignoffRequired(val) + } + return nil + } + return res +} +// GetHasIssues gets the has_issues property value. Either `true` to enable issues for this repository or `false` to disable them. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasProjects gets the has_projects property value. Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. Either `true` to enable the wiki for this repository or `false` to disable it. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. A URL with more information about the repository. +// returns a *string when successful +func (m *ItemItemRepoPatchRequestBody) GetHomepage()(*string) { + return m.homepage +} +// GetIsTemplate gets the is_template property value. Either `true` to make this repo available as a template repository or `false` to prevent it. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetIsTemplate()(*bool) { + return m.is_template +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *ItemItemRepoPatchRequestBody) GetName()(*string) { + return m.name +} +// GetPrivate gets the private property value. Either `true` to make the repository private or `false` to make it public. Default: `false`. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/enterprise-server@3.14/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetPrivate()(*bool) { + return m.private +} +// GetSecurityAndAnalysis gets the security_and_analysis property value. Specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. +// returns a ItemItemRepoPatchRequestBody_security_and_analysisable when successful +func (m *ItemItemRepoPatchRequestBody) GetSecurityAndAnalysis()(ItemItemRepoPatchRequestBody_security_and_analysisable) { + return m.security_and_analysis +} +// GetUseSquashPrTitleAsDefault gets the use_squash_pr_title_as_default property value. Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetUseSquashPrTitleAsDefault()(*bool) { + return m.use_squash_pr_title_as_default +} +// GetWebCommitSignoffRequired gets the web_commit_signoff_required property value. Either `true` to require contributors to sign off on web-based commits, or `false` to not require contributors to sign off on web-based commits. +// returns a *bool when successful +func (m *ItemItemRepoPatchRequestBody) GetWebCommitSignoffRequired()(*bool) { + return m.web_commit_signoff_required +} +// Serialize serializes information the current object +func (m *ItemItemRepoPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_forking", m.GetAllowForking()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_update_branch", m.GetAllowUpdateBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("archived", m.GetArchived()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("default_branch", m.GetDefaultBranch()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("security_and_analysis", m.GetSecurityAndAnalysis()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("use_squash_pr_title_as_default", m.GetUseSquashPrTitleAsDefault()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("web_commit_signoff_required", m.GetWebCommitSignoffRequired()) + 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 *ItemItemRepoPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowForking sets the allow_forking property value. Either `true` to allow private forks, or `false` to prevent private forks. +func (m *ItemItemRepoPatchRequestBody) SetAllowForking(value *bool)() { + m.allow_forking = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. Either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. +func (m *ItemItemRepoPatchRequestBody) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. Either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. +func (m *ItemItemRepoPatchRequestBody) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. Either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. +func (m *ItemItemRepoPatchRequestBody) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAllowUpdateBranch sets the allow_update_branch property value. Either `true` to always allow a pull request head branch that is behind its base branch to be updated even if it is not required to be up to date before merging, or false otherwise. +func (m *ItemItemRepoPatchRequestBody) SetAllowUpdateBranch(value *bool)() { + m.allow_update_branch = value +} +// SetArchived sets the archived property value. Whether to archive this repository. `false` will unarchive a previously archived repository. +func (m *ItemItemRepoPatchRequestBody) SetArchived(value *bool)() { + m.archived = value +} +// SetDefaultBranch sets the default_branch property value. Updates the default branch for this repository. +func (m *ItemItemRepoPatchRequestBody) SetDefaultBranch(value *string)() { + m.default_branch = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Either `true` to allow automatically deleting head branches when pull requests are merged, or `false` to prevent automatic deletion. +func (m *ItemItemRepoPatchRequestBody) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDescription sets the description property value. A short description of the repository. +func (m *ItemItemRepoPatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetHasIssues sets the has_issues property value. Either `true` to enable issues for this repository or `false` to disable them. +func (m *ItemItemRepoPatchRequestBody) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasProjects sets the has_projects property value. Either `true` to enable projects for this repository or `false` to disable them. **Note:** If you're creating a repository in an organization that has disabled repository projects, the default is `false`, and if you pass `true`, the API returns an error. +func (m *ItemItemRepoPatchRequestBody) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. Either `true` to enable the wiki for this repository or `false` to disable it. +func (m *ItemItemRepoPatchRequestBody) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. A URL with more information about the repository. +func (m *ItemItemRepoPatchRequestBody) SetHomepage(value *string)() { + m.homepage = value +} +// SetIsTemplate sets the is_template property value. Either `true` to make this repo available as a template repository or `false` to prevent it. +func (m *ItemItemRepoPatchRequestBody) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetName sets the name property value. The name of the repository. +func (m *ItemItemRepoPatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrivate sets the private property value. Either `true` to make the repository private or `false` to make it public. Default: `false`. **Note**: You will get a `422` error if the organization restricts [changing repository visibility](https://docs.github.com/enterprise-server@3.14/articles/repository-permission-levels-for-an-organization#changing-the-visibility-of-repositories) to organization owners and a non-owner tries to change the value of private. +func (m *ItemItemRepoPatchRequestBody) SetPrivate(value *bool)() { + m.private = value +} +// SetSecurityAndAnalysis sets the security_and_analysis property value. Specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. +func (m *ItemItemRepoPatchRequestBody) SetSecurityAndAnalysis(value ItemItemRepoPatchRequestBody_security_and_analysisable)() { + m.security_and_analysis = value +} +// SetUseSquashPrTitleAsDefault sets the use_squash_pr_title_as_default property value. Either `true` to allow squash-merge commits to use pull request title, or `false` to use commit message. **This property has been deprecated. Please use `squash_merge_commit_title` instead. +// Deprecated: +func (m *ItemItemRepoPatchRequestBody) SetUseSquashPrTitleAsDefault(value *bool)() { + m.use_squash_pr_title_as_default = value +} +// SetWebCommitSignoffRequired sets the web_commit_signoff_required property value. Either `true` to require contributors to sign off on web-based commits, or `false` to not require contributors to sign off on web-based commits. +func (m *ItemItemRepoPatchRequestBody) SetWebCommitSignoffRequired(value *bool)() { + m.web_commit_signoff_required = value +} +type ItemItemRepoPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowForking()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAllowUpdateBranch()(*bool) + GetArchived()(*bool) + GetDefaultBranch()(*string) + GetDeleteBranchOnMerge()(*bool) + GetDescription()(*string) + GetHasIssues()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetIsTemplate()(*bool) + GetName()(*string) + GetPrivate()(*bool) + GetSecurityAndAnalysis()(ItemItemRepoPatchRequestBody_security_and_analysisable) + GetUseSquashPrTitleAsDefault()(*bool) + GetWebCommitSignoffRequired()(*bool) + SetAllowForking(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAllowUpdateBranch(value *bool)() + SetArchived(value *bool)() + SetDefaultBranch(value *string)() + SetDeleteBranchOnMerge(value *bool)() + SetDescription(value *string)() + SetHasIssues(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetIsTemplate(value *bool)() + SetName(value *string)() + SetPrivate(value *bool)() + SetSecurityAndAnalysis(value ItemItemRepoPatchRequestBody_security_and_analysisable)() + SetUseSquashPrTitleAsDefault(value *bool)() + SetWebCommitSignoffRequired(value *bool)() +} diff --git a/pkg/github/repos/item_item_repo_patch_request_body_escaped_security_escaped_and_escaped_analysis.go b/pkg/github/repos/item_item_repo_patch_request_body_escaped_security_escaped_and_escaped_analysis.go new file mode 100644 index 00000000..a0567f24 --- /dev/null +++ b/pkg/github/repos/item_item_repo_patch_request_body_escaped_security_escaped_and_escaped_analysis.go @@ -0,0 +1,139 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemRepoPatchRequestBody_security_and_analysis specify which security and analysis features to enable or disable for the repository.To use this parameter, you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."For example, to enable GitHub Advanced Security, use this data in the body of the `PATCH` request:`{ "security_and_analysis": {"advanced_security": { "status": "enabled" } } }`.You can check which security and analysis features are currently enabled by using a `GET /repos/{owner}/{repo}` request. +type ItemItemRepoPatchRequestBody_security_and_analysis struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." + advanced_security ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable + // Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." + secret_scanning ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable + // Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." + secret_scanning_push_protection ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable +} +// NewItemItemRepoPatchRequestBody_security_and_analysis instantiates a new ItemItemRepoPatchRequestBody_security_and_analysis and sets the default values. +func NewItemItemRepoPatchRequestBody_security_and_analysis()(*ItemItemRepoPatchRequestBody_security_and_analysis) { + m := &ItemItemRepoPatchRequestBody_security_and_analysis{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRepoPatchRequestBody_security_and_analysisFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRepoPatchRequestBody_security_and_analysisFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRepoPatchRequestBody_security_and_analysis(), 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 *ItemItemRepoPatchRequestBody_security_and_analysis) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAdvancedSecurity gets the advanced_security property value. Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." +// returns a ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) GetAdvancedSecurity()(ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable) { + return m.advanced_security +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["advanced_security"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetAdvancedSecurity(val.(ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable)) + } + return nil + } + res["secret_scanning"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanning(val.(ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable)) + } + return nil + } + res["secret_scanning_push_protection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(CreateItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetSecretScanningPushProtection(val.(ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable)) + } + return nil + } + return res +} +// GetSecretScanning gets the secret_scanning property value. Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." +// returns a ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) GetSecretScanning()(ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable) { + return m.secret_scanning +} +// GetSecretScanningPushProtection gets the secret_scanning_push_protection property value. Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." +// returns a ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable when successful +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) GetSecretScanningPushProtection()(ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable) { + return m.secret_scanning_push_protection +} +// Serialize serializes information the current object +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteObjectValue("advanced_security", m.GetAdvancedSecurity()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("secret_scanning", m.GetSecretScanning()) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("secret_scanning_push_protection", m.GetSecretScanningPushProtection()) + 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 *ItemItemRepoPatchRequestBody_security_and_analysis) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAdvancedSecurity sets the advanced_security property value. Use the `status` property to enable or disable GitHub Advanced Security for this repository. For more information, see "[About GitHub Advanced Security](/github/getting-started-with-github/learning-about-github/about-github-advanced-security)." +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) SetAdvancedSecurity(value ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable)() { + m.advanced_security = value +} +// SetSecretScanning sets the secret_scanning property value. Use the `status` property to enable or disable secret scanning for this repository. For more information, see "[About secret scanning](/code-security/secret-security/about-secret-scanning)." +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) SetSecretScanning(value ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable)() { + m.secret_scanning = value +} +// SetSecretScanningPushProtection sets the secret_scanning_push_protection property value. Use the `status` property to enable or disable secret scanning push protection for this repository. For more information, see "[Protecting pushes with secret scanning](/code-security/secret-scanning/protecting-pushes-with-secret-scanning)." +func (m *ItemItemRepoPatchRequestBody_security_and_analysis) SetSecretScanningPushProtection(value ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable)() { + m.secret_scanning_push_protection = value +} +type ItemItemRepoPatchRequestBody_security_and_analysisable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAdvancedSecurity()(ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable) + GetSecretScanning()(ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable) + GetSecretScanningPushProtection()(ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable) + SetAdvancedSecurity(value ItemItemRepoPatchRequestBody_security_and_analysis_advanced_securityable)() + SetSecretScanning(value ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanningable)() + SetSecretScanningPushProtection(value ItemItemRepoPatchRequestBody_security_and_analysis_secret_scanning_push_protectionable)() +} diff --git a/pkg/github/repos/item_item_rules_branches_request_builder.go b/pkg/github/repos/item_item_rules_branches_request_builder.go new file mode 100644 index 00000000..b9565b13 --- /dev/null +++ b/pkg/github/repos/item_item_rules_branches_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemRulesBranchesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\rules\branches +type ItemItemRulesBranchesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByBranch gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.rules.branches.item collection +// returns a *ItemItemRulesBranchesWithBranchItemRequestBuilder when successful +func (m *ItemItemRulesBranchesRequestBuilder) ByBranch(branch string)(*ItemItemRulesBranchesWithBranchItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if branch != "" { + urlTplParams["branch"] = branch + } + return NewItemItemRulesBranchesWithBranchItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemRulesBranchesRequestBuilderInternal instantiates a new ItemItemRulesBranchesRequestBuilder and sets the default values. +func NewItemItemRulesBranchesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesBranchesRequestBuilder) { + m := &ItemItemRulesBranchesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/rules/branches", pathParameters), + } + return m +} +// NewItemItemRulesBranchesRequestBuilder instantiates a new ItemItemRulesBranchesRequestBuilder and sets the default values. +func NewItemItemRulesBranchesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesBranchesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemRulesBranchesRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_rules_branches_with_branch_item_request_builder.go b/pkg/github/repos/item_item_rules_branches_with_branch_item_request_builder.go new file mode 100644 index 00000000..99fb11a4 --- /dev/null +++ b/pkg/github/repos/item_item_rules_branches_with_branch_item_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemRulesBranchesWithBranchItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\rules\branches\{branch} +type ItemItemRulesBranchesWithBranchItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemRulesBranchesWithBranchItemRequestBuilderGetQueryParameters returns all active rules that apply to the specified branch. The branch does not need to exist; rules that would applyto a branch with that name will be returned. All active rules that apply will be returned, regardless of the levelat which they are configured (e.g. repository or organization). Rules in rulesets with "evaluate" or "disabled"enforcement statuses are not returned. +type ItemItemRulesBranchesWithBranchItemRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemRulesBranchesWithBranchItemRequestBuilderInternal instantiates a new ItemItemRulesBranchesWithBranchItemRequestBuilder and sets the default values. +func NewItemItemRulesBranchesWithBranchItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesBranchesWithBranchItemRequestBuilder) { + m := &ItemItemRulesBranchesWithBranchItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/rules/branches/{branch}{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemRulesBranchesWithBranchItemRequestBuilder instantiates a new ItemItemRulesBranchesWithBranchItemRequestBuilder and sets the default values. +func NewItemItemRulesBranchesWithBranchItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesBranchesWithBranchItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemRulesBranchesWithBranchItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns all active rules that apply to the specified branch. The branch does not need to exist; rules that would applyto a branch with that name will be returned. All active rules that apply will be returned, regardless of the levelat which they are configured (e.g. repository or organization). Rules in rulesets with "evaluate" or "disabled"enforcement statuses are not returned. +// returns a []RepositoryRuleDetailedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/rules#get-rules-for-a-branch +func (m *ItemItemRulesBranchesWithBranchItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesBranchesWithBranchItemRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleDetailedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRuleDetailedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleDetailedable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleDetailedable) + } + } + return val, nil +} +// ToGetRequestInformation returns all active rules that apply to the specified branch. The branch does not need to exist; rules that would applyto a branch with that name will be returned. All active rules that apply will be returned, regardless of the levelat which they are configured (e.g. repository or organization). Rules in rulesets with "evaluate" or "disabled"enforcement statuses are not returned. +// returns a *RequestInformation when successful +func (m *ItemItemRulesBranchesWithBranchItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesBranchesWithBranchItemRequestBuilderGetQueryParameters])(*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 *ItemItemRulesBranchesWithBranchItemRequestBuilder when successful +func (m *ItemItemRulesBranchesWithBranchItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemRulesBranchesWithBranchItemRequestBuilder) { + return NewItemItemRulesBranchesWithBranchItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_rules_request_builder.go b/pkg/github/repos/item_item_rules_request_builder.go new file mode 100644 index 00000000..7630fade --- /dev/null +++ b/pkg/github/repos/item_item_rules_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemRulesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\rules +type ItemItemRulesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Branches the branches property +// returns a *ItemItemRulesBranchesRequestBuilder when successful +func (m *ItemItemRulesRequestBuilder) Branches()(*ItemItemRulesBranchesRequestBuilder) { + return NewItemItemRulesBranchesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemRulesRequestBuilderInternal instantiates a new ItemItemRulesRequestBuilder and sets the default values. +func NewItemItemRulesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesRequestBuilder) { + m := &ItemItemRulesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/rules", pathParameters), + } + return m +} +// NewItemItemRulesRequestBuilder instantiates a new ItemItemRulesRequestBuilder and sets the default values. +func NewItemItemRulesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemRulesRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_rulesets_item_with_ruleset_escaped_put_request_body.go b/pkg/github/repos/item_item_rulesets_item_with_ruleset_escaped_put_request_body.go new file mode 100644 index 00000000..6cb7832c --- /dev/null +++ b/pkg/github/repos/item_item_rulesets_item_with_ruleset_escaped_put_request_body.go @@ -0,0 +1,222 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemRulesetsItemWithRuleset_PutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The actors that can bypass the rules in this ruleset + bypass_actors []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable + // Parameters for a repository ruleset ref name condition + conditions ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetConditionsable + // The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page. + enforcement *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement + // The name of the ruleset. + name *string + // An array of rules within the ruleset. + rules []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable +} +// NewItemItemRulesetsItemWithRuleset_PutRequestBody instantiates a new ItemItemRulesetsItemWithRuleset_PutRequestBody and sets the default values. +func NewItemItemRulesetsItemWithRuleset_PutRequestBody()(*ItemItemRulesetsItemWithRuleset_PutRequestBody) { + m := &ItemItemRulesetsItemWithRuleset_PutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRulesetsItemWithRuleset_PutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRulesetsItemWithRuleset_PutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRulesetsItemWithRuleset_PutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassActors gets the bypass_actors property value. The actors that can bypass the rules in this ruleset +// returns a []RepositoryRulesetBypassActorable when successful +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) GetBypassActors()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable) { + return m.bypass_actors +} +// GetConditions gets the conditions property value. Parameters for a repository ruleset ref name condition +// returns a RepositoryRulesetConditionsable when successful +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) GetConditions()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetConditionsable) { + return m.conditions +} +// GetEnforcement gets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page. +// returns a *RepositoryRuleEnforcement when successful +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) GetEnforcement()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_actors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRulesetBypassActorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable) + } + } + m.SetBypassActors(res) + } + return nil + } + res["conditions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRulesetConditionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConditions(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetConditionsable)) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParseRepositoryRuleEnforcement) + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val.(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["rules"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable) + } + } + m.SetRules(res) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the ruleset. +// returns a *string when successful +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) GetName()(*string) { + return m.name +} +// GetRules gets the rules property value. An array of rules within the ruleset. +// returns a []RepositoryRuleable when successful +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) GetRules()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable) { + return m.rules +} +// Serialize serializes information the current object +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBypassActors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetBypassActors())) + for i, v := range m.GetBypassActors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("bypass_actors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("conditions", m.GetConditions()) + if err != nil { + return err + } + } + if m.GetEnforcement() != nil { + cast := (*m.GetEnforcement()).String() + err := writer.WriteStringValue("enforcement", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetRules() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRules())) + for i, v := range m.GetRules() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("rules", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassActors sets the bypass_actors property value. The actors that can bypass the rules in this ruleset +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) SetBypassActors(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable)() { + m.bypass_actors = value +} +// SetConditions sets the conditions property value. Parameters for a repository ruleset ref name condition +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) SetConditions(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetConditionsable)() { + m.conditions = value +} +// SetEnforcement sets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page. +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) SetEnforcement(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement)() { + m.enforcement = value +} +// SetName sets the name property value. The name of the ruleset. +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) SetName(value *string)() { + m.name = value +} +// SetRules sets the rules property value. An array of rules within the ruleset. +func (m *ItemItemRulesetsItemWithRuleset_PutRequestBody) SetRules(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable)() { + m.rules = value +} +type ItemItemRulesetsItemWithRuleset_PutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassActors()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable) + GetConditions()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetConditionsable) + GetEnforcement()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement) + GetName()(*string) + GetRules()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable) + SetBypassActors(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable)() + SetConditions(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetConditionsable)() + SetEnforcement(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement)() + SetName(value *string)() + SetRules(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable)() +} diff --git a/pkg/github/repos/item_item_rulesets_post_request_body.go b/pkg/github/repos/item_item_rulesets_post_request_body.go new file mode 100644 index 00000000..0a0dcd26 --- /dev/null +++ b/pkg/github/repos/item_item_rulesets_post_request_body.go @@ -0,0 +1,222 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemRulesetsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // The actors that can bypass the rules in this ruleset + bypass_actors []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable + // Parameters for a repository ruleset ref name condition + conditions ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetConditionsable + // The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page. + enforcement *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement + // The name of the ruleset. + name *string + // An array of rules within the ruleset. + rules []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable +} +// NewItemItemRulesetsPostRequestBody instantiates a new ItemItemRulesetsPostRequestBody and sets the default values. +func NewItemItemRulesetsPostRequestBody()(*ItemItemRulesetsPostRequestBody) { + m := &ItemItemRulesetsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemRulesetsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemRulesetsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemRulesetsPostRequestBody(), 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 *ItemItemRulesetsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBypassActors gets the bypass_actors property value. The actors that can bypass the rules in this ruleset +// returns a []RepositoryRulesetBypassActorable when successful +func (m *ItemItemRulesetsPostRequestBody) GetBypassActors()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable) { + return m.bypass_actors +} +// GetConditions gets the conditions property value. Parameters for a repository ruleset ref name condition +// returns a RepositoryRulesetConditionsable when successful +func (m *ItemItemRulesetsPostRequestBody) GetConditions()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetConditionsable) { + return m.conditions +} +// GetEnforcement gets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page. +// returns a *RepositoryRuleEnforcement when successful +func (m *ItemItemRulesetsPostRequestBody) GetEnforcement()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement) { + return m.enforcement +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemItemRulesetsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bypass_actors"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRulesetBypassActorFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable) + } + } + m.SetBypassActors(res) + } + return nil + } + res["conditions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetObjectValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRulesetConditionsFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + m.SetConditions(val.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetConditionsable)) + } + return nil + } + res["enforcement"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParseRepositoryRuleEnforcement) + if err != nil { + return err + } + if val != nil { + m.SetEnforcement(val.(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement)) + } + return nil + } + res["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["rules"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRuleFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable) + } + } + m.SetRules(res) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the ruleset. +// returns a *string when successful +func (m *ItemItemRulesetsPostRequestBody) GetName()(*string) { + return m.name +} +// GetRules gets the rules property value. An array of rules within the ruleset. +// returns a []RepositoryRuleable when successful +func (m *ItemItemRulesetsPostRequestBody) GetRules()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable) { + return m.rules +} +// Serialize serializes information the current object +func (m *ItemItemRulesetsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetBypassActors() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetBypassActors())) + for i, v := range m.GetBypassActors() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("bypass_actors", cast) + if err != nil { + return err + } + } + { + err := writer.WriteObjectValue("conditions", m.GetConditions()) + if err != nil { + return err + } + } + if m.GetEnforcement() != nil { + cast := (*m.GetEnforcement()).String() + err := writer.WriteStringValue("enforcement", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + if m.GetRules() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRules())) + for i, v := range m.GetRules() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("rules", cast) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAdditionalData sets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +func (m *ItemItemRulesetsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBypassActors sets the bypass_actors property value. The actors that can bypass the rules in this ruleset +func (m *ItemItemRulesetsPostRequestBody) SetBypassActors(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable)() { + m.bypass_actors = value +} +// SetConditions sets the conditions property value. Parameters for a repository ruleset ref name condition +func (m *ItemItemRulesetsPostRequestBody) SetConditions(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetConditionsable)() { + m.conditions = value +} +// SetEnforcement sets the enforcement property value. The enforcement level of the ruleset. `evaluate` allows admins to test rules before enforcing them. Admins can view insights on the Rule Insights page. +func (m *ItemItemRulesetsPostRequestBody) SetEnforcement(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement)() { + m.enforcement = value +} +// SetName sets the name property value. The name of the ruleset. +func (m *ItemItemRulesetsPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetRules sets the rules property value. An array of rules within the ruleset. +func (m *ItemItemRulesetsPostRequestBody) SetRules(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable)() { + m.rules = value +} +type ItemItemRulesetsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBypassActors()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable) + GetConditions()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetConditionsable) + GetEnforcement()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement) + GetName()(*string) + GetRules()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable) + SetBypassActors(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetBypassActorable)() + SetConditions(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetConditionsable)() + SetEnforcement(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleEnforcement)() + SetName(value *string)() + SetRules(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRuleable)() +} diff --git a/pkg/github/repos/item_item_rulesets_request_builder.go b/pkg/github/repos/item_item_rulesets_request_builder.go new file mode 100644 index 00000000..1f8818ce --- /dev/null +++ b/pkg/github/repos/item_item_rulesets_request_builder.go @@ -0,0 +1,128 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemRulesetsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\rulesets +type ItemItemRulesetsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemRulesetsRequestBuilderGetQueryParameters get all the rulesets for a repository. +type ItemItemRulesetsRequestBuilderGetQueryParameters struct { + // Include rulesets configured at higher levels that apply to this repository + Includes_parents *bool `uriparametername:"includes_parents"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRuleset_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.rulesets.item collection +// returns a *ItemItemRulesetsWithRuleset_ItemRequestBuilder when successful +func (m *ItemItemRulesetsRequestBuilder) ByRuleset_id(ruleset_id int32)(*ItemItemRulesetsWithRuleset_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["ruleset_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(ruleset_id), 10) + return NewItemItemRulesetsWithRuleset_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemRulesetsRequestBuilderInternal instantiates a new ItemItemRulesetsRequestBuilder and sets the default values. +func NewItemItemRulesetsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsRequestBuilder) { + m := &ItemItemRulesetsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/rulesets{?includes_parents*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemRulesetsRequestBuilder instantiates a new ItemItemRulesetsRequestBuilder and sets the default values. +func NewItemItemRulesetsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemRulesetsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get all the rulesets for a repository. +// returns a []RepositoryRulesetable when successful +// 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/enterprise-server@3.14/rest/repos/rules#get-all-repository-rulesets +func (m *ItemItemRulesetsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesetsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable) + } + } + return val, nil +} +// Post create a ruleset for a repository. +// returns a RepositoryRulesetable when successful +// 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/enterprise-server@3.14/rest/repos/rules#create-a-repository-ruleset +func (m *ItemItemRulesetsRequestBuilder) Post(ctx context.Context, body ItemItemRulesetsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable), nil +} +// RuleSuites the ruleSuites property +// returns a *ItemItemRulesetsRuleSuitesRequestBuilder when successful +func (m *ItemItemRulesetsRequestBuilder) RuleSuites()(*ItemItemRulesetsRuleSuitesRequestBuilder) { + return NewItemItemRulesetsRuleSuitesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation get all the rulesets for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemRulesetsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesetsRequestBuilderGetQueryParameters])(*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 create a ruleset for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemRulesetsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemRulesetsPostRequestBodyable, 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 *ItemItemRulesetsRequestBuilder when successful +func (m *ItemItemRulesetsRequestBuilder) WithUrl(rawUrl string)(*ItemItemRulesetsRequestBuilder) { + return NewItemItemRulesetsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_rulesets_rule_suites_request_builder.go b/pkg/github/repos/item_item_rulesets_rule_suites_request_builder.go new file mode 100644 index 00000000..8c5539aa --- /dev/null +++ b/pkg/github/repos/item_item_rulesets_rule_suites_request_builder.go @@ -0,0 +1,93 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i1dcba757084762da6414fd6bdcf7a0f0e2890e19d4acdeb54d695816fa2e794b "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/rulesets/rulesuites" +) + +// ItemItemRulesetsRuleSuitesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\rulesets\rule-suites +type ItemItemRulesetsRuleSuitesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemRulesetsRuleSuitesRequestBuilderGetQueryParameters lists suites of rule evaluations at the repository level.For more information, see "[Managing rulesets for a repository](https://docs.github.com/enterprise-server@3.14/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets)." +type ItemItemRulesetsRuleSuitesRequestBuilderGetQueryParameters struct { + // The handle for the GitHub user account to filter on. When specified, only rule evaluations triggered by this actor will be returned. + Actor_name *string `uriparametername:"actor_name"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The name of the ref. Cannot contain wildcard characters. When specified, only rule evaluations triggered for this ref will be returned. + Ref *string `uriparametername:"ref"` + // The rule results to filter on. When specified, only suites with this result will be returned. + Rule_suite_result *i1dcba757084762da6414fd6bdcf7a0f0e2890e19d4acdeb54d695816fa2e794b.GetRule_suite_resultQueryParameterType `uriparametername:"rule_suite_result"` + // The time period to filter by.For example, `day` will filter for rule suites that occurred in the past 24 hours, and `week` will filter for insights that occurred in the past 7 days (168 hours). + Time_period *i1dcba757084762da6414fd6bdcf7a0f0e2890e19d4acdeb54d695816fa2e794b.GetTime_periodQueryParameterType `uriparametername:"time_period"` +} +// ByRule_suite_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.rulesets.ruleSuites.item collection +// returns a *ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder when successful +func (m *ItemItemRulesetsRuleSuitesRequestBuilder) ByRule_suite_id(rule_suite_id int32)(*ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["rule_suite_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(rule_suite_id), 10) + return NewItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemRulesetsRuleSuitesRequestBuilderInternal instantiates a new ItemItemRulesetsRuleSuitesRequestBuilder and sets the default values. +func NewItemItemRulesetsRuleSuitesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsRuleSuitesRequestBuilder) { + m := &ItemItemRulesetsRuleSuitesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/rulesets/rule-suites{?actor_name*,page*,per_page*,ref*,rule_suite_result*,time_period*}", pathParameters), + } + return m +} +// NewItemItemRulesetsRuleSuitesRequestBuilder instantiates a new ItemItemRulesetsRuleSuitesRequestBuilder and sets the default values. +func NewItemItemRulesetsRuleSuitesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsRuleSuitesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemRulesetsRuleSuitesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists suites of rule evaluations at the repository level.For more information, see "[Managing rulesets for a repository](https://docs.github.com/enterprise-server@3.14/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets)." +// returns a []RuleSuitesable when successful +// 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/enterprise-server@3.14/rest/repos/rule-suites#list-repository-rule-suites +func (m *ItemItemRulesetsRuleSuitesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesetsRuleSuitesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RuleSuitesable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRuleSuitesFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RuleSuitesable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RuleSuitesable) + } + } + return val, nil +} +// ToGetRequestInformation lists suites of rule evaluations at the repository level.For more information, see "[Managing rulesets for a repository](https://docs.github.com/enterprise-server@3.14/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets)." +// returns a *RequestInformation when successful +func (m *ItemItemRulesetsRuleSuitesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesetsRuleSuitesRequestBuilderGetQueryParameters])(*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 *ItemItemRulesetsRuleSuitesRequestBuilder when successful +func (m *ItemItemRulesetsRuleSuitesRequestBuilder) WithUrl(rawUrl string)(*ItemItemRulesetsRuleSuitesRequestBuilder) { + return NewItemItemRulesetsRuleSuitesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_rulesets_rule_suites_with_rule_escaped_suite_escaped_item_request_builder.go b/pkg/github/repos/item_item_rulesets_rule_suites_with_rule_escaped_suite_escaped_item_request_builder.go new file mode 100644 index 00000000..4c2b2efe --- /dev/null +++ b/pkg/github/repos/item_item_rulesets_rule_suites_with_rule_escaped_suite_escaped_item_request_builder.go @@ -0,0 +1,63 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\rulesets\rule-suites\{rule_suite_id} +type ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal instantiates a new ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder and sets the default values. +func NewItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + m := &ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/rulesets/rule-suites/{rule_suite_id}", pathParameters), + } + return m +} +// NewItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder instantiates a new ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder and sets the default values. +func NewItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets information about a suite of rule evaluations from within a repository.For more information, see "[Managing rulesets for a repository](https://docs.github.com/enterprise-server@3.14/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets)." +// returns a RuleSuiteable when successful +// 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/enterprise-server@3.14/rest/repos/rule-suites#get-a-repository-rule-suite +func (m *ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RuleSuiteable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRuleSuiteFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RuleSuiteable), nil +} +// ToGetRequestInformation gets information about a suite of rule evaluations from within a repository.For more information, see "[Managing rulesets for a repository](https://docs.github.com/enterprise-server@3.14/repositories/configuring-branches-and-merges-in-your-repository/managing-rulesets/managing-rulesets-for-a-repository#viewing-insights-for-rulesets)." +// returns a *RequestInformation when successful +func (m *ItemItemRulesetsRuleSuitesWithRule_suite_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder when successful +func (m *ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder) { + return NewItemItemRulesetsRuleSuitesWithRule_suite_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_rulesets_with_ruleset_escaped_item_request_builder.go b/pkg/github/repos/item_item_rulesets_with_ruleset_escaped_item_request_builder.go new file mode 100644 index 00000000..6059d572 --- /dev/null +++ b/pkg/github/repos/item_item_rulesets_with_ruleset_escaped_item_request_builder.go @@ -0,0 +1,134 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemRulesetsWithRuleset_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\rulesets\{ruleset_id} +type ItemItemRulesetsWithRuleset_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemRulesetsWithRuleset_ItemRequestBuilderGetQueryParameters get a ruleset for a repository.**Note:** To prevent leaking sensitive information, the `bypass_actors` property is only returned if the usermaking the API request has write access to the ruleset. +type ItemItemRulesetsWithRuleset_ItemRequestBuilderGetQueryParameters struct { + // Include rulesets configured at higher levels that apply to this repository + Includes_parents *bool `uriparametername:"includes_parents"` +} +// NewItemItemRulesetsWithRuleset_ItemRequestBuilderInternal instantiates a new ItemItemRulesetsWithRuleset_ItemRequestBuilder and sets the default values. +func NewItemItemRulesetsWithRuleset_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsWithRuleset_ItemRequestBuilder) { + m := &ItemItemRulesetsWithRuleset_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/rulesets/{ruleset_id}{?includes_parents*}", pathParameters), + } + return m +} +// NewItemItemRulesetsWithRuleset_ItemRequestBuilder instantiates a new ItemItemRulesetsWithRuleset_ItemRequestBuilder and sets the default values. +func NewItemItemRulesetsWithRuleset_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemRulesetsWithRuleset_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemRulesetsWithRuleset_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete delete a ruleset for a repository. +// 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/enterprise-server@3.14/rest/repos/rules#delete-a-repository-ruleset +func (m *ItemItemRulesetsWithRuleset_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 { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get get a ruleset for a repository.**Note:** To prevent leaking sensitive information, the `bypass_actors` property is only returned if the usermaking the API request has write access to the ruleset. +// returns a RepositoryRulesetable when successful +// 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/enterprise-server@3.14/rest/repos/rules#get-a-repository-ruleset +func (m *ItemItemRulesetsWithRuleset_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesetsWithRuleset_ItemRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable), nil +} +// Put update a ruleset for a repository. +// returns a RepositoryRulesetable when successful +// 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/enterprise-server@3.14/rest/repos/rules#update-a-repository-ruleset +func (m *ItemItemRulesetsWithRuleset_ItemRequestBuilder) Put(ctx context.Context, body ItemItemRulesetsItemWithRuleset_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryRulesetFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryRulesetable), nil +} +// ToDeleteRequestInformation delete a ruleset for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemRulesetsWithRuleset_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") + return requestInfo, nil +} +// ToGetRequestInformation get a ruleset for a repository.**Note:** To prevent leaking sensitive information, the `bypass_actors` property is only returned if the usermaking the API request has write access to the ruleset. +// returns a *RequestInformation when successful +func (m *ItemItemRulesetsWithRuleset_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemRulesetsWithRuleset_ItemRequestBuilderGetQueryParameters])(*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 +} +// ToPutRequestInformation update a ruleset for a repository. +// returns a *RequestInformation when successful +func (m *ItemItemRulesetsWithRuleset_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemRulesetsItemWithRuleset_PutRequestBodyable, 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 *ItemItemRulesetsWithRuleset_ItemRequestBuilder when successful +func (m *ItemItemRulesetsWithRuleset_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemRulesetsWithRuleset_ItemRequestBuilder) { + return NewItemItemRulesetsWithRuleset_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_secret_scanning_alerts_item_locations_request_builder.go b/pkg/github/repos/item_item_secret_scanning_alerts_item_locations_request_builder.go new file mode 100644 index 00000000..2eca597c --- /dev/null +++ b/pkg/github/repos/item_item_secret_scanning_alerts_item_locations_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemSecretScanningAlertsItemLocationsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\secret-scanning\alerts\{alert_number}\locations +type ItemItemSecretScanningAlertsItemLocationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemSecretScanningAlertsItemLocationsRequestBuilderGetQueryParameters lists all locations for a given secret scanning alert for an eligible repository.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +type ItemItemSecretScanningAlertsItemLocationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemSecretScanningAlertsItemLocationsRequestBuilderInternal instantiates a new ItemItemSecretScanningAlertsItemLocationsRequestBuilder and sets the default values. +func NewItemItemSecretScanningAlertsItemLocationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningAlertsItemLocationsRequestBuilder) { + m := &ItemItemSecretScanningAlertsItemLocationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/secret-scanning/alerts/{alert_number}/locations{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemSecretScanningAlertsItemLocationsRequestBuilder instantiates a new ItemItemSecretScanningAlertsItemLocationsRequestBuilder and sets the default values. +func NewItemItemSecretScanningAlertsItemLocationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningAlertsItemLocationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSecretScanningAlertsItemLocationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all locations for a given secret scanning alert for an eligible repository.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a []SecretScanningLocationable when successful +// returns a Locations503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/secret-scanning/secret-scanning#list-locations-for-a-secret-scanning-alert +func (m *ItemItemSecretScanningAlertsItemLocationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemSecretScanningAlertsItemLocationsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningLocationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLocations503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSecretScanningLocationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningLocationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningLocationable) + } + } + return val, nil +} +// ToGetRequestInformation lists all locations for a given secret scanning alert for an eligible repository.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemItemSecretScanningAlertsItemLocationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemSecretScanningAlertsItemLocationsRequestBuilderGetQueryParameters])(*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 *ItemItemSecretScanningAlertsItemLocationsRequestBuilder when successful +func (m *ItemItemSecretScanningAlertsItemLocationsRequestBuilder) WithUrl(rawUrl string)(*ItemItemSecretScanningAlertsItemLocationsRequestBuilder) { + return NewItemItemSecretScanningAlertsItemLocationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_secret_scanning_alerts_item_with_alert_escaped_number_patch_request_body.go b/pkg/github/repos/item_item_secret_scanning_alerts_item_with_alert_escaped_number_patch_request_body.go new file mode 100644 index 00000000..a5a5c00d --- /dev/null +++ b/pkg/github/repos/item_item_secret_scanning_alerts_item_with_alert_escaped_number_patch_request_body.go @@ -0,0 +1,141 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // **Required when the `state` is `resolved`.** The reason for resolving the alert. + resolution *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertResolution + // An optional comment when closing an alert. Cannot be updated or deleted. Must be `null` when changing `state` to `open`. + resolution_comment *string + // Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. + state *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertState +} +// NewItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody instantiates a new ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody and sets the default values. +func NewItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody()(*ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) { + m := &ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody(), 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 *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) 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 *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["resolution"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParseSecretScanningAlertResolution) + if err != nil { + return err + } + if val != nil { + m.SetResolution(val.(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertResolution)) + } + return nil + } + res["resolution_comment"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetResolutionComment(val) + } + return nil + } + res["state"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetEnumValue(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParseSecretScanningAlertState) + if err != nil { + return err + } + if val != nil { + m.SetState(val.(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertState)) + } + return nil + } + return res +} +// 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 *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) GetResolution()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertResolution) { + return m.resolution +} +// GetResolutionComment gets the resolution_comment property value. An optional comment when closing an alert. Cannot be updated or deleted. Must be `null` when changing `state` to `open`. +// returns a *string when successful +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) GetResolutionComment()(*string) { + return m.resolution_comment +} +// GetState gets the state property value. Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. +// returns a *SecretScanningAlertState when successful +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) GetState()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertState) { + return m.state +} +// Serialize serializes information the current object +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetResolution() != nil { + cast := (*m.GetResolution()).String() + err := writer.WriteStringValue("resolution", &cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("resolution_comment", m.GetResolutionComment()) + if err != nil { + return err + } + } + if m.GetState() != nil { + cast := (*m.GetState()).String() + err := writer.WriteStringValue("state", &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 *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetResolution sets the resolution property value. **Required when the `state` is `resolved`.** The reason for resolving the alert. +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) SetResolution(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertResolution)() { + m.resolution = value +} +// SetResolutionComment sets the resolution_comment property value. An optional comment when closing an alert. Cannot be updated or deleted. Must be `null` when changing `state` to `open`. +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) SetResolutionComment(value *string)() { + m.resolution_comment = value +} +// SetState sets the state property value. Sets the state of the secret scanning alert. You must provide `resolution` when you set the state to `resolved`. +func (m *ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBody) SetState(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertState)() { + m.state = value +} +type ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetResolution()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertResolution) + GetResolutionComment()(*string) + GetState()(*ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertState) + SetResolution(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertResolution)() + SetResolutionComment(value *string)() + SetState(value *ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertState)() +} 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 new file mode 100644 index 00000000..d7897b46 --- /dev/null +++ b/pkg/github/repos/item_item_secret_scanning_alerts_request_builder.go @@ -0,0 +1,99 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ic653fdac08035cb8bfc7dabb4472628f1539065e4c88c3d7cb1a363ab7fa780f "github.com/octokit/go-sdk-enterprise-server/pkg/github/repos/item/item/secretscanning/alerts" +) + +// ItemItemSecretScanningAlertsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\secret-scanning\alerts +type ItemItemSecretScanningAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemSecretScanningAlertsRequestBuilderGetQueryParameters lists secret scanning alerts for an eligible repository, from newest to oldest.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +type ItemItemSecretScanningAlertsRequestBuilderGetQueryParameters struct { + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events after this cursor. To receive an initial cursor on your first request, include an empty "after" query string. + After *string `uriparametername:"after"` + // A cursor, as given in the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers). If specified, the query only searches for events before this cursor. To receive an initial cursor on your first request, include an empty "before" query string. + Before *string `uriparametername:"before"` + // The direction to sort the results by. + Direction *ic653fdac08035cb8bfc7dabb4472628f1539065e4c88c3d7cb1a363ab7fa780f.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + 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/enterprise-server@3.14/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 *ic653fdac08035cb8bfc7dabb4472628f1539065e4c88c3d7cb1a363ab7fa780f.GetSortQueryParameterType `uriparametername:"sort"` + // Set to `open` or `resolved` to only list secret scanning alerts in a specific state. + State *ic653fdac08035cb8bfc7dabb4472628f1539065e4c88c3d7cb1a363ab7fa780f.GetStateQueryParameterType `uriparametername:"state"` + // A comma-separated list of validities that, when present, will return alerts that match the validities in this list. Valid options are `active`, `inactive`, and `unknown`. + Validity *string `uriparametername:"validity"` +} +// ByAlert_number gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.secretScanning.alerts.item collection +// returns a *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder when successful +func (m *ItemItemSecretScanningAlertsRequestBuilder) ByAlert_number(alert_number int32)(*ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["alert_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(alert_number), 10) + return NewItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemSecretScanningAlertsRequestBuilderInternal instantiates a new ItemItemSecretScanningAlertsRequestBuilder and sets the default values. +func NewItemItemSecretScanningAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningAlertsRequestBuilder) { + m := &ItemItemSecretScanningAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/secret-scanning/alerts{?after*,before*,direction*,page*,per_page*,resolution*,secret_type*,sort*,state*,validity*}", pathParameters), + } + return m +} +// NewItemItemSecretScanningAlertsRequestBuilder instantiates a new ItemItemSecretScanningAlertsRequestBuilder and sets the default values. +func NewItemItemSecretScanningAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSecretScanningAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists secret scanning alerts for an eligible repository, from newest to oldest.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a []SecretScanningAlertable when successful +// returns a Alerts503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/secret-scanning/secret-scanning#list-secret-scanning-alerts-for-a-repository +func (m *ItemItemSecretScanningAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemSecretScanningAlertsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateAlerts503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSecretScanningAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertable) + } + } + return val, nil +} +// ToGetRequestInformation lists secret scanning alerts for an eligible repository, from newest to oldest.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemItemSecretScanningAlertsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemSecretScanningAlertsRequestBuilderGetQueryParameters])(*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 *ItemItemSecretScanningAlertsRequestBuilder when successful +func (m *ItemItemSecretScanningAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemItemSecretScanningAlertsRequestBuilder) { + return NewItemItemSecretScanningAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_secret_scanning_alerts_with_alert_escaped_number_item_request_builder.go b/pkg/github/repos/item_item_secret_scanning_alerts_with_alert_escaped_number_item_request_builder.go new file mode 100644 index 00000000..b1d21e56 --- /dev/null +++ b/pkg/github/repos/item_item_secret_scanning_alerts_with_alert_escaped_number_item_request_builder.go @@ -0,0 +1,101 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\secret-scanning\alerts\{alert_number} +type ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilderInternal instantiates a new ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder and sets the default values. +func NewItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) { + m := &ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/secret-scanning/alerts/{alert_number}", pathParameters), + } + return m +} +// NewItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder instantiates a new ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder and sets the default values. +func NewItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a single secret scanning alert detected in an eligible repository.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a SecretScanningAlertable when successful +// returns a SecretScanningAlert503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/secret-scanning/secret-scanning#get-a-secret-scanning-alert +func (m *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSecretScanningAlert503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSecretScanningAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertable), nil +} +// Locations the locations property +// returns a *ItemItemSecretScanningAlertsItemLocationsRequestBuilder when successful +func (m *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) Locations()(*ItemItemSecretScanningAlertsItemLocationsRequestBuilder) { + return NewItemItemSecretScanningAlertsItemLocationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch updates the status of a secret scanning alert in an eligible repository.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a SecretScanningAlertable when successful +// returns a SecretScanningAlert503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/secret-scanning/secret-scanning#update-a-secret-scanning-alert +func (m *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) Patch(ctx context.Context, body ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSecretScanningAlert503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSecretScanningAlertFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SecretScanningAlertable), nil +} +// ToGetRequestInformation gets a single secret scanning alert detected in an eligible repository.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) 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 the status of a secret scanning alert in an eligible repository.The authenticated user must be an administrator for the repository or for the organization that owns the repository to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `repo` or `security_events` scope to use this endpoint. If this endpoint is only used with public repositories, the token can use the `public_repo` scope instead. +// returns a *RequestInformation when successful +func (m *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemSecretScanningAlertsItemWithAlert_numberPatchRequestBodyable, 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 *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder when successful +func (m *ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder) { + return NewItemItemSecretScanningAlertsWithAlert_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_secret_scanning_request_builder.go b/pkg/github/repos/item_item_secret_scanning_request_builder.go new file mode 100644 index 00000000..6231e771 --- /dev/null +++ b/pkg/github/repos/item_item_secret_scanning_request_builder.go @@ -0,0 +1,28 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemSecretScanningRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\secret-scanning +type ItemItemSecretScanningRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Alerts the alerts property +// returns a *ItemItemSecretScanningAlertsRequestBuilder when successful +func (m *ItemItemSecretScanningRequestBuilder) Alerts()(*ItemItemSecretScanningAlertsRequestBuilder) { + return NewItemItemSecretScanningAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemSecretScanningRequestBuilderInternal instantiates a new ItemItemSecretScanningRequestBuilder and sets the default values. +func NewItemItemSecretScanningRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningRequestBuilder) { + m := &ItemItemSecretScanningRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/secret-scanning", pathParameters), + } + return m +} +// NewItemItemSecretScanningRequestBuilder instantiates a new ItemItemSecretScanningRequestBuilder and sets the default values. +func NewItemItemSecretScanningRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSecretScanningRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSecretScanningRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_stargazers_request_builder.go b/pkg/github/repos/item_item_stargazers_request_builder.go new file mode 100644 index 00000000..b6d32a63 --- /dev/null +++ b/pkg/github/repos/item_item_stargazers_request_builder.go @@ -0,0 +1,175 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemStargazersRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\stargazers +type ItemItemStargazersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemStargazersRequestBuilderGetQueryParameters lists the people that have starred the repository.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +type ItemItemStargazersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// StargazersGetResponse composed type wrapper for classes []ItemItemStargazersSimpleUserable, []ItemItemStargazersStargazerable +type StargazersGetResponse struct { + // Composed type representation for type []ItemItemStargazersSimpleUserable + itemItemStargazersSimpleUser []ItemItemStargazersSimpleUserable + // Composed type representation for type []ItemItemStargazersStargazerable + itemItemStargazersStargazer []ItemItemStargazersStargazerable +} +// NewStargazersGetResponse instantiates a new StargazersGetResponse and sets the default values. +func NewStargazersGetResponse()(*StargazersGetResponse) { + m := &StargazersGetResponse{ + } + return m +} +// CreateStargazersGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateStargazersGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewStargazersGetResponse() + if parseNode != nil { + if val, err := parseNode.GetCollectionOfObjectValues(CreateItemItemStargazersSimpleUserFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemItemStargazersSimpleUserable, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemItemStargazersSimpleUserable) + } + } + result.SetItemItemStargazersSimpleUser(cast) + } else if val, err := parseNode.GetCollectionOfObjectValues(CreateItemItemStargazersStargazerFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemItemStargazersStargazerable, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemItemStargazersStargazerable) + } + } + result.SetItemItemStargazersStargazer(cast) + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *StargazersGetResponse) 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 *StargazersGetResponse) GetIsComposedType()(bool) { + return true +} +// GetItemItemStargazersSimpleUser gets the ItemItemStargazersSimpleUser property value. Composed type representation for type []ItemItemStargazersSimpleUserable +// returns a []ItemItemStargazersSimpleUserable when successful +func (m *StargazersGetResponse) GetItemItemStargazersSimpleUser()([]ItemItemStargazersSimpleUserable) { + return m.itemItemStargazersSimpleUser +} +// GetItemItemStargazersStargazer gets the ItemItemStargazersStargazer property value. Composed type representation for type []ItemItemStargazersStargazerable +// returns a []ItemItemStargazersStargazerable when successful +func (m *StargazersGetResponse) GetItemItemStargazersStargazer()([]ItemItemStargazersStargazerable) { + return m.itemItemStargazersStargazer +} +// Serialize serializes information the current object +func (m *StargazersGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemItemStargazersSimpleUser() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItemItemStargazersSimpleUser())) + for i, v := range m.GetItemItemStargazersSimpleUser() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } else if m.GetItemItemStargazersStargazer() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItemItemStargazersStargazer())) + for i, v := range m.GetItemItemStargazersStargazer() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } + return nil +} +// SetItemItemStargazersSimpleUser sets the ItemItemStargazersSimpleUser property value. Composed type representation for type []ItemItemStargazersSimpleUserable +func (m *StargazersGetResponse) SetItemItemStargazersSimpleUser(value []ItemItemStargazersSimpleUserable)() { + m.itemItemStargazersSimpleUser = value +} +// SetItemItemStargazersStargazer sets the ItemItemStargazersStargazer property value. Composed type representation for type []ItemItemStargazersStargazerable +func (m *StargazersGetResponse) SetItemItemStargazersStargazer(value []ItemItemStargazersStargazerable)() { + m.itemItemStargazersStargazer = value +} +type StargazersGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemItemStargazersSimpleUser()([]ItemItemStargazersSimpleUserable) + GetItemItemStargazersStargazer()([]ItemItemStargazersStargazerable) + SetItemItemStargazersSimpleUser(value []ItemItemStargazersSimpleUserable)() + SetItemItemStargazersStargazer(value []ItemItemStargazersStargazerable)() +} +// NewItemItemStargazersRequestBuilderInternal instantiates a new ItemItemStargazersRequestBuilder and sets the default values. +func NewItemItemStargazersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStargazersRequestBuilder) { + m := &ItemItemStargazersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/stargazers{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemStargazersRequestBuilder instantiates a new ItemItemStargazersRequestBuilder and sets the default values. +func NewItemItemStargazersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStargazersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStargazersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the people that have starred the repository.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +// returns a StargazersGetResponseable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/starring#list-stargazers +func (m *ItemItemStargazersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemStargazersRequestBuilderGetQueryParameters])(StargazersGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateStargazersGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(StargazersGetResponseable), nil +} +// ToGetRequestInformation lists the people that have starred the repository.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +// returns a *RequestInformation when successful +func (m *ItemItemStargazersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemStargazersRequestBuilderGetQueryParameters])(*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 *ItemItemStargazersRequestBuilder when successful +func (m *ItemItemStargazersRequestBuilder) WithUrl(rawUrl string)(*ItemItemStargazersRequestBuilder) { + return NewItemItemStargazersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_stargazers_simple_user.go b/pkg/github/repos/item_item_stargazers_simple_user.go new file mode 100644 index 00000000..17990460 --- /dev/null +++ b/pkg/github/repos/item_item_stargazers_simple_user.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemStargazersSimpleUser struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemStargazersSimpleUser instantiates a new ItemItemStargazersSimpleUser and sets the default values. +func NewItemItemStargazersSimpleUser()(*ItemItemStargazersSimpleUser) { + m := &ItemItemStargazersSimpleUser{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemStargazersSimpleUserFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemStargazersSimpleUserFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemStargazersSimpleUser(), 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 *ItemItemStargazersSimpleUser) 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 *ItemItemStargazersSimpleUser) 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 *ItemItemStargazersSimpleUser) 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 *ItemItemStargazersSimpleUser) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemStargazersSimpleUserable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_stargazers_stargazer.go b/pkg/github/repos/item_item_stargazers_stargazer.go new file mode 100644 index 00000000..d8cc702d --- /dev/null +++ b/pkg/github/repos/item_item_stargazers_stargazer.go @@ -0,0 +1,51 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemStargazersStargazer struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemItemStargazersStargazer instantiates a new ItemItemStargazersStargazer and sets the default values. +func NewItemItemStargazersStargazer()(*ItemItemStargazersStargazer) { + m := &ItemItemStargazersStargazer{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemStargazersStargazerFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemStargazersStargazerFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemStargazersStargazer(), 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 *ItemItemStargazersStargazer) 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 *ItemItemStargazersStargazer) 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 *ItemItemStargazersStargazer) 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 *ItemItemStargazersStargazer) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemItemStargazersStargazerable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/repos/item_item_stats_code_escaped_frequency_request_builder.go b/pkg/github/repos/item_item_stats_code_escaped_frequency_request_builder.go new file mode 100644 index 00000000..7e082757 --- /dev/null +++ b/pkg/github/repos/item_item_stats_code_escaped_frequency_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemStatsCode_frequencyRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\stats\code_frequency +type ItemItemStatsCode_frequencyRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemStatsCode_frequencyRequestBuilderInternal instantiates a new ItemItemStatsCode_frequencyRequestBuilder and sets the default values. +func NewItemItemStatsCode_frequencyRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsCode_frequencyRequestBuilder) { + m := &ItemItemStatsCode_frequencyRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/stats/code_frequency", pathParameters), + } + return m +} +// NewItemItemStatsCode_frequencyRequestBuilder instantiates a new ItemItemStatsCode_frequencyRequestBuilder and sets the default values. +func NewItemItemStatsCode_frequencyRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsCode_frequencyRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatsCode_frequencyRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns a weekly aggregate of the number of additions and deletions pushed to a repository. +// returns a UntypedNodeable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/metrics/statistics#get-the-weekly-commit-activity +func (m *ItemItemStatsCode_frequencyRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable), nil +} +// ToGetRequestInformation returns a weekly aggregate of the number of additions and deletions pushed to a repository. +// returns a *RequestInformation when successful +func (m *ItemItemStatsCode_frequencyRequestBuilder) 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 *ItemItemStatsCode_frequencyRequestBuilder when successful +func (m *ItemItemStatsCode_frequencyRequestBuilder) WithUrl(rawUrl string)(*ItemItemStatsCode_frequencyRequestBuilder) { + return NewItemItemStatsCode_frequencyRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_stats_commit_escaped_activity_request_builder.go b/pkg/github/repos/item_item_stats_commit_escaped_activity_request_builder.go new file mode 100644 index 00000000..8f728dfa --- /dev/null +++ b/pkg/github/repos/item_item_stats_commit_escaped_activity_request_builder.go @@ -0,0 +1,60 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemStatsCommit_activityRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\stats\commit_activity +type ItemItemStatsCommit_activityRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemStatsCommit_activityRequestBuilderInternal instantiates a new ItemItemStatsCommit_activityRequestBuilder and sets the default values. +func NewItemItemStatsCommit_activityRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsCommit_activityRequestBuilder) { + m := &ItemItemStatsCommit_activityRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/stats/commit_activity", pathParameters), + } + return m +} +// NewItemItemStatsCommit_activityRequestBuilder instantiates a new ItemItemStatsCommit_activityRequestBuilder and sets the default values. +func NewItemItemStatsCommit_activityRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsCommit_activityRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatsCommit_activityRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the last year of commit activity grouped by week. The `days` array is a group of commits per day, starting on `Sunday`. +// returns a []CommitActivityable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/metrics/statistics#get-the-last-year-of-commit-activity +func (m *ItemItemStatsCommit_activityRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitActivityable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCommitActivityFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitActivityable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitActivityable) + } + } + return val, nil +} +// ToGetRequestInformation returns the last year of commit activity grouped by week. The `days` array is a group of commits per day, starting on `Sunday`. +// returns a *RequestInformation when successful +func (m *ItemItemStatsCommit_activityRequestBuilder) 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 *ItemItemStatsCommit_activityRequestBuilder when successful +func (m *ItemItemStatsCommit_activityRequestBuilder) WithUrl(rawUrl string)(*ItemItemStatsCommit_activityRequestBuilder) { + return NewItemItemStatsCommit_activityRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_stats_contributors_request_builder.go b/pkg/github/repos/item_item_stats_contributors_request_builder.go new file mode 100644 index 00000000..ecb17c04 --- /dev/null +++ b/pkg/github/repos/item_item_stats_contributors_request_builder.go @@ -0,0 +1,60 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemStatsContributorsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\stats\contributors +type ItemItemStatsContributorsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemStatsContributorsRequestBuilderInternal instantiates a new ItemItemStatsContributorsRequestBuilder and sets the default values. +func NewItemItemStatsContributorsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsContributorsRequestBuilder) { + m := &ItemItemStatsContributorsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/stats/contributors", pathParameters), + } + return m +} +// NewItemItemStatsContributorsRequestBuilder instantiates a new ItemItemStatsContributorsRequestBuilder and sets the default values. +func NewItemItemStatsContributorsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsContributorsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatsContributorsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the `total` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (`weeks` array) with the following information:* `w` - Start of the week, given as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time).* `a` - Number of additions* `d` - Number of deletions* `c` - Number of commits +// returns a []ContributorActivityable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/metrics/statistics#get-all-contributor-commit-activity +func (m *ItemItemStatsContributorsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContributorActivityable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateContributorActivityFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContributorActivityable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ContributorActivityable) + } + } + return val, nil +} +// ToGetRequestInformation returns the `total` number of commits authored by the contributor. In addition, the response includes a Weekly Hash (`weeks` array) with the following information:* `w` - Start of the week, given as a [Unix timestamp](https://en.wikipedia.org/wiki/Unix_time).* `a` - Number of additions* `d` - Number of deletions* `c` - Number of commits +// returns a *RequestInformation when successful +func (m *ItemItemStatsContributorsRequestBuilder) 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 *ItemItemStatsContributorsRequestBuilder when successful +func (m *ItemItemStatsContributorsRequestBuilder) WithUrl(rawUrl string)(*ItemItemStatsContributorsRequestBuilder) { + return NewItemItemStatsContributorsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_stats_participation_request_builder.go b/pkg/github/repos/item_item_stats_participation_request_builder.go new file mode 100644 index 00000000..9da2f98c --- /dev/null +++ b/pkg/github/repos/item_item_stats_participation_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemStatsParticipationRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\stats\participation +type ItemItemStatsParticipationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemStatsParticipationRequestBuilderInternal instantiates a new ItemItemStatsParticipationRequestBuilder and sets the default values. +func NewItemItemStatsParticipationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsParticipationRequestBuilder) { + m := &ItemItemStatsParticipationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/stats/participation", pathParameters), + } + return m +} +// NewItemItemStatsParticipationRequestBuilder instantiates a new ItemItemStatsParticipationRequestBuilder and sets the default values. +func NewItemItemStatsParticipationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsParticipationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatsParticipationRequestBuilderInternal(urlParams, requestAdapter) +} +// Get returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract `owner` from `all`.The array order is oldest week (index 0) to most recent week.The most recent week is seven days ago at UTC midnight to today at UTC midnight. +// returns a ParticipationStatsable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/metrics/statistics#get-the-weekly-commit-count +func (m *ItemItemStatsParticipationRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParticipationStatsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateParticipationStatsFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ParticipationStatsable), nil +} +// ToGetRequestInformation returns the total commit counts for the `owner` and total commit counts in `all`. `all` is everyone combined, including the `owner` in the last 52 weeks. If you'd like to get the commit counts for non-owners, you can subtract `owner` from `all`.The array order is oldest week (index 0) to most recent week.The most recent week is seven days ago at UTC midnight to today at UTC midnight. +// returns a *RequestInformation when successful +func (m *ItemItemStatsParticipationRequestBuilder) 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 *ItemItemStatsParticipationRequestBuilder when successful +func (m *ItemItemStatsParticipationRequestBuilder) WithUrl(rawUrl string)(*ItemItemStatsParticipationRequestBuilder) { + return NewItemItemStatsParticipationRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_stats_punch_escaped_card_request_builder.go b/pkg/github/repos/item_item_stats_punch_escaped_card_request_builder.go new file mode 100644 index 00000000..ccf4ef6f --- /dev/null +++ b/pkg/github/repos/item_item_stats_punch_escaped_card_request_builder.go @@ -0,0 +1,57 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// ItemItemStatsPunch_cardRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\stats\punch_card +type ItemItemStatsPunch_cardRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemStatsPunch_cardRequestBuilderInternal instantiates a new ItemItemStatsPunch_cardRequestBuilder and sets the default values. +func NewItemItemStatsPunch_cardRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsPunch_cardRequestBuilder) { + m := &ItemItemStatsPunch_cardRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/stats/punch_card", pathParameters), + } + return m +} +// NewItemItemStatsPunch_cardRequestBuilder instantiates a new ItemItemStatsPunch_cardRequestBuilder and sets the default values. +func NewItemItemStatsPunch_cardRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsPunch_cardRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatsPunch_cardRequestBuilderInternal(urlParams, requestAdapter) +} +// Get each array contains the day number, hour number, and number of commits:* `0-6`: Sunday - Saturday* `0-23`: Hour of day* Number of commitsFor example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits. +// returns a UntypedNodeable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/metrics/statistics#get-the-hourly-commit-count-for-each-day +func (m *ItemItemStatsPunch_cardRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.CreateUntypedNodeFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.UntypedNodeable), nil +} +// ToGetRequestInformation each array contains the day number, hour number, and number of commits:* `0-6`: Sunday - Saturday* `0-23`: Hour of day* Number of commitsFor example, `[2, 14, 25]` indicates that there were 25 total commits, during the 2:00pm hour on Tuesdays. All times are based on the time zone of individual commits. +// returns a *RequestInformation when successful +func (m *ItemItemStatsPunch_cardRequestBuilder) 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 *ItemItemStatsPunch_cardRequestBuilder when successful +func (m *ItemItemStatsPunch_cardRequestBuilder) WithUrl(rawUrl string)(*ItemItemStatsPunch_cardRequestBuilder) { + return NewItemItemStatsPunch_cardRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_stats_request_builder.go b/pkg/github/repos/item_item_stats_request_builder.go new file mode 100644 index 00000000..d4f3a3d8 --- /dev/null +++ b/pkg/github/repos/item_item_stats_request_builder.go @@ -0,0 +1,48 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemStatsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\stats +type ItemItemStatsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Code_frequency the code_frequency property +// returns a *ItemItemStatsCode_frequencyRequestBuilder when successful +func (m *ItemItemStatsRequestBuilder) Code_frequency()(*ItemItemStatsCode_frequencyRequestBuilder) { + return NewItemItemStatsCode_frequencyRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Commit_activity the commit_activity property +// returns a *ItemItemStatsCommit_activityRequestBuilder when successful +func (m *ItemItemStatsRequestBuilder) Commit_activity()(*ItemItemStatsCommit_activityRequestBuilder) { + return NewItemItemStatsCommit_activityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemStatsRequestBuilderInternal instantiates a new ItemItemStatsRequestBuilder and sets the default values. +func NewItemItemStatsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsRequestBuilder) { + m := &ItemItemStatsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/stats", pathParameters), + } + return m +} +// NewItemItemStatsRequestBuilder instantiates a new ItemItemStatsRequestBuilder and sets the default values. +func NewItemItemStatsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatsRequestBuilderInternal(urlParams, requestAdapter) +} +// Contributors the contributors property +// returns a *ItemItemStatsContributorsRequestBuilder when successful +func (m *ItemItemStatsRequestBuilder) Contributors()(*ItemItemStatsContributorsRequestBuilder) { + return NewItemItemStatsContributorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Participation the participation property +// returns a *ItemItemStatsParticipationRequestBuilder when successful +func (m *ItemItemStatsRequestBuilder) Participation()(*ItemItemStatsParticipationRequestBuilder) { + return NewItemItemStatsParticipationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Punch_card the punch_card property +// returns a *ItemItemStatsPunch_cardRequestBuilder when successful +func (m *ItemItemStatsRequestBuilder) Punch_card()(*ItemItemStatsPunch_cardRequestBuilder) { + return NewItemItemStatsPunch_cardRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/repos/item_item_statuses_item_with_sha_post_request_body.go b/pkg/github/repos/item_item_statuses_item_with_sha_post_request_body.go new file mode 100644 index 00000000..d19bc069 --- /dev/null +++ b/pkg/github/repos/item_item_statuses_item_with_sha_post_request_body.go @@ -0,0 +1,140 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemStatusesItemWithShaPostRequestBody 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 string label to differentiate this status from the status of other systems. This field is case-insensitive. + context *string + // A short description of the status. + description *string + // The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: `http://ci.example.com/user/repo/build/sha` + target_url *string +} +// NewItemItemStatusesItemWithShaPostRequestBody instantiates a new ItemItemStatusesItemWithShaPostRequestBody and sets the default values. +func NewItemItemStatusesItemWithShaPostRequestBody()(*ItemItemStatusesItemWithShaPostRequestBody) { + m := &ItemItemStatusesItemWithShaPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + contextValue := "default" + m.SetContext(&contextValue) + return m +} +// CreateItemItemStatusesItemWithShaPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemStatusesItemWithShaPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemStatusesItemWithShaPostRequestBody(), 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 *ItemItemStatusesItemWithShaPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetContext gets the context property value. A string label to differentiate this status from the status of other systems. This field is case-insensitive. +// returns a *string when successful +func (m *ItemItemStatusesItemWithShaPostRequestBody) GetContext()(*string) { + return m.context +} +// GetDescription gets the description property value. A short description of the status. +// returns a *string when successful +func (m *ItemItemStatusesItemWithShaPostRequestBody) 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 *ItemItemStatusesItemWithShaPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["context"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetContext(val) + } + 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["target_url"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTargetUrl(val) + } + return nil + } + return res +} +// GetTargetUrl gets the target_url property value. The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: `http://ci.example.com/user/repo/build/sha` +// returns a *string when successful +func (m *ItemItemStatusesItemWithShaPostRequestBody) GetTargetUrl()(*string) { + return m.target_url +} +// Serialize serializes information the current object +func (m *ItemItemStatusesItemWithShaPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("context", m.GetContext()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("target_url", m.GetTargetUrl()) + 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 *ItemItemStatusesItemWithShaPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetContext sets the context property value. A string label to differentiate this status from the status of other systems. This field is case-insensitive. +func (m *ItemItemStatusesItemWithShaPostRequestBody) SetContext(value *string)() { + m.context = value +} +// SetDescription sets the description property value. A short description of the status. +func (m *ItemItemStatusesItemWithShaPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetTargetUrl sets the target_url property value. The target URL to associate with this status. This URL will be linked from the GitHub UI to allow users to easily see the source of the status. For example, if your continuous integration system is posting build status, you would want to provide the deep link for the build output for this specific SHA: `http://ci.example.com/user/repo/build/sha` +func (m *ItemItemStatusesItemWithShaPostRequestBody) SetTargetUrl(value *string)() { + m.target_url = value +} +type ItemItemStatusesItemWithShaPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetContext()(*string) + GetDescription()(*string) + GetTargetUrl()(*string) + SetContext(value *string)() + SetDescription(value *string)() + SetTargetUrl(value *string)() +} diff --git a/pkg/github/repos/item_item_statuses_request_builder.go b/pkg/github/repos/item_item_statuses_request_builder.go new file mode 100644 index 00000000..83bc6eee --- /dev/null +++ b/pkg/github/repos/item_item_statuses_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemStatusesRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\statuses +type ItemItemStatusesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// BySha gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.statuses.item collection +// returns a *ItemItemStatusesWithShaItemRequestBuilder when successful +func (m *ItemItemStatusesRequestBuilder) BySha(sha string)(*ItemItemStatusesWithShaItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if sha != "" { + urlTplParams["sha"] = sha + } + return NewItemItemStatusesWithShaItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemStatusesRequestBuilderInternal instantiates a new ItemItemStatusesRequestBuilder and sets the default values. +func NewItemItemStatusesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatusesRequestBuilder) { + m := &ItemItemStatusesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/statuses", pathParameters), + } + return m +} +// NewItemItemStatusesRequestBuilder instantiates a new ItemItemStatusesRequestBuilder and sets the default values. +func NewItemItemStatusesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatusesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatusesRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_statuses_with_sha_item_request_builder.go b/pkg/github/repos/item_item_statuses_with_sha_item_request_builder.go new file mode 100644 index 00000000..d7b30ecd --- /dev/null +++ b/pkg/github/repos/item_item_statuses_with_sha_item_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemStatusesWithShaItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\statuses\{sha} +type ItemItemStatusesWithShaItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemStatusesWithShaItemRequestBuilderInternal instantiates a new ItemItemStatusesWithShaItemRequestBuilder and sets the default values. +func NewItemItemStatusesWithShaItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatusesWithShaItemRequestBuilder) { + m := &ItemItemStatusesWithShaItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/statuses/{sha}", pathParameters), + } + return m +} +// NewItemItemStatusesWithShaItemRequestBuilder instantiates a new ItemItemStatusesWithShaItemRequestBuilder and sets the default values. +func NewItemItemStatusesWithShaItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemStatusesWithShaItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemStatusesWithShaItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Post users with push access in a repository can create commit statuses for a given SHA.Note: there is a limit of 1000 statuses per `sha` and `context` within a repository. Attempts to create more than 1000 statuses will result in a validation error. +// returns a Statusable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/commits/statuses#create-a-commit-status +func (m *ItemItemStatusesWithShaItemRequestBuilder) Post(ctx context.Context, body ItemItemStatusesItemWithShaPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Statusable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateStatusFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Statusable), nil +} +// ToPostRequestInformation users with push access in a repository can create commit statuses for a given SHA.Note: there is a limit of 1000 statuses per `sha` and `context` within a repository. Attempts to create more than 1000 statuses will result in a validation error. +// returns a *RequestInformation when successful +func (m *ItemItemStatusesWithShaItemRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemStatusesItemWithShaPostRequestBodyable, 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 *ItemItemStatusesWithShaItemRequestBuilder when successful +func (m *ItemItemStatusesWithShaItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemStatusesWithShaItemRequestBuilder) { + return NewItemItemStatusesWithShaItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_subscribers_request_builder.go b/pkg/github/repos/item_item_subscribers_request_builder.go new file mode 100644 index 00000000..f142ca98 --- /dev/null +++ b/pkg/github/repos/item_item_subscribers_request_builder.go @@ -0,0 +1,67 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemSubscribersRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\subscribers +type ItemItemSubscribersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemSubscribersRequestBuilderGetQueryParameters lists the people watching the specified repository. +type ItemItemSubscribersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemSubscribersRequestBuilderInternal instantiates a new ItemItemSubscribersRequestBuilder and sets the default values. +func NewItemItemSubscribersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSubscribersRequestBuilder) { + m := &ItemItemSubscribersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/subscribers{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemSubscribersRequestBuilder instantiates a new ItemItemSubscribersRequestBuilder and sets the default values. +func NewItemItemSubscribersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSubscribersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSubscribersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the people watching the specified repository. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/watching#list-watchers +func (m *ItemItemSubscribersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemSubscribersRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists the people watching the specified repository. +// returns a *RequestInformation when successful +func (m *ItemItemSubscribersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemSubscribersRequestBuilderGetQueryParameters])(*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 *ItemItemSubscribersRequestBuilder when successful +func (m *ItemItemSubscribersRequestBuilder) WithUrl(rawUrl string)(*ItemItemSubscribersRequestBuilder) { + return NewItemItemSubscribersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_subscription_put_request_body.go b/pkg/github/repos/item_item_subscription_put_request_body.go new file mode 100644 index 00000000..763e3b2c --- /dev/null +++ b/pkg/github/repos/item_item_subscription_put_request_body.go @@ -0,0 +1,109 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemSubscriptionPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Determines if all notifications should be blocked from this repository. + ignored *bool + // Determines if notifications should be received from this repository. + subscribed *bool +} +// NewItemItemSubscriptionPutRequestBody instantiates a new ItemItemSubscriptionPutRequestBody and sets the default values. +func NewItemItemSubscriptionPutRequestBody()(*ItemItemSubscriptionPutRequestBody) { + m := &ItemItemSubscriptionPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemSubscriptionPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemSubscriptionPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemSubscriptionPutRequestBody(), 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 *ItemItemSubscriptionPutRequestBody) 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 *ItemItemSubscriptionPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["ignored"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIgnored(val) + } + return nil + } + res["subscribed"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetSubscribed(val) + } + return nil + } + return res +} +// GetIgnored gets the ignored property value. Determines if all notifications should be blocked from this repository. +// returns a *bool when successful +func (m *ItemItemSubscriptionPutRequestBody) GetIgnored()(*bool) { + return m.ignored +} +// GetSubscribed gets the subscribed property value. Determines if notifications should be received from this repository. +// returns a *bool when successful +func (m *ItemItemSubscriptionPutRequestBody) GetSubscribed()(*bool) { + return m.subscribed +} +// Serialize serializes information the current object +func (m *ItemItemSubscriptionPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("ignored", m.GetIgnored()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("subscribed", m.GetSubscribed()) + 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 *ItemItemSubscriptionPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIgnored sets the ignored property value. Determines if all notifications should be blocked from this repository. +func (m *ItemItemSubscriptionPutRequestBody) SetIgnored(value *bool)() { + m.ignored = value +} +// SetSubscribed sets the subscribed property value. Determines if notifications should be received from this repository. +func (m *ItemItemSubscriptionPutRequestBody) SetSubscribed(value *bool)() { + m.subscribed = value +} +type ItemItemSubscriptionPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIgnored()(*bool) + GetSubscribed()(*bool) + SetIgnored(value *bool)() + SetSubscribed(value *bool)() +} diff --git a/pkg/github/repos/item_item_subscription_request_builder.go b/pkg/github/repos/item_item_subscription_request_builder.go new file mode 100644 index 00000000..e08817b3 --- /dev/null +++ b/pkg/github/repos/item_item_subscription_request_builder.go @@ -0,0 +1,114 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemSubscriptionRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\subscription +type ItemItemSubscriptionRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemSubscriptionRequestBuilderInternal instantiates a new ItemItemSubscriptionRequestBuilder and sets the default values. +func NewItemItemSubscriptionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSubscriptionRequestBuilder) { + m := &ItemItemSubscriptionRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/subscription", pathParameters), + } + return m +} +// NewItemItemSubscriptionRequestBuilder instantiates a new ItemItemSubscriptionRequestBuilder and sets the default values. +func NewItemItemSubscriptionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemSubscriptionRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemSubscriptionRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete this endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/enterprise-server@3.14/rest/activity/watching#set-a-repository-subscription). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/watching#delete-a-repository-subscription +func (m *ItemItemSubscriptionRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get gets information about whether the authenticated user is subscribed to the repository. +// returns a RepositorySubscriptionable when successful +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/watching#get-a-repository-subscription +func (m *ItemItemSubscriptionRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositorySubscriptionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositorySubscriptionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositorySubscriptionable), nil +} +// Put if you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/enterprise-server@3.14/rest/activity/watching#delete-a-repository-subscription) completely. +// returns a RepositorySubscriptionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/watching#set-a-repository-subscription +func (m *ItemItemSubscriptionRequestBuilder) Put(ctx context.Context, body ItemItemSubscriptionPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositorySubscriptionable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositorySubscriptionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositorySubscriptionable), nil +} +// ToDeleteRequestInformation this endpoint should only be used to stop watching a repository. To control whether or not you wish to receive notifications from a repository, [set the repository's subscription manually](https://docs.github.com/enterprise-server@3.14/rest/activity/watching#set-a-repository-subscription). +// returns a *RequestInformation when successful +func (m *ItemItemSubscriptionRequestBuilder) 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 +} +// ToGetRequestInformation gets information about whether the authenticated user is subscribed to the repository. +// returns a *RequestInformation when successful +func (m *ItemItemSubscriptionRequestBuilder) 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 +} +// ToPutRequestInformation if you would like to watch a repository, set `subscribed` to `true`. If you would like to ignore notifications made within a repository, set `ignored` to `true`. If you would like to stop watching a repository, [delete the repository's subscription](https://docs.github.com/enterprise-server@3.14/rest/activity/watching#delete-a-repository-subscription) completely. +// returns a *RequestInformation when successful +func (m *ItemItemSubscriptionRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemSubscriptionPutRequestBodyable, 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 *ItemItemSubscriptionRequestBuilder when successful +func (m *ItemItemSubscriptionRequestBuilder) WithUrl(rawUrl string)(*ItemItemSubscriptionRequestBuilder) { + return NewItemItemSubscriptionRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_tags_protection_post_request_body.go b/pkg/github/repos/item_item_tags_protection_post_request_body.go new file mode 100644 index 00000000..14928f46 --- /dev/null +++ b/pkg/github/repos/item_item_tags_protection_post_request_body.go @@ -0,0 +1,80 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemTagsProtectionPostRequestBody 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 optional glob pattern to match against when enforcing tag protection. + pattern *string +} +// NewItemItemTagsProtectionPostRequestBody instantiates a new ItemItemTagsProtectionPostRequestBody and sets the default values. +func NewItemItemTagsProtectionPostRequestBody()(*ItemItemTagsProtectionPostRequestBody) { + m := &ItemItemTagsProtectionPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemTagsProtectionPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemTagsProtectionPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemTagsProtectionPostRequestBody(), 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 *ItemItemTagsProtectionPostRequestBody) 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 *ItemItemTagsProtectionPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["pattern"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPattern(val) + } + return nil + } + return res +} +// GetPattern gets the pattern property value. An optional glob pattern to match against when enforcing tag protection. +// returns a *string when successful +func (m *ItemItemTagsProtectionPostRequestBody) GetPattern()(*string) { + return m.pattern +} +// Serialize serializes information the current object +func (m *ItemItemTagsProtectionPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("pattern", m.GetPattern()) + 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 *ItemItemTagsProtectionPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetPattern sets the pattern property value. An optional glob pattern to match against when enforcing tag protection. +func (m *ItemItemTagsProtectionPostRequestBody) SetPattern(value *string)() { + m.pattern = value +} +type ItemItemTagsProtectionPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPattern()(*string) + SetPattern(value *string)() +} diff --git a/pkg/github/repos/item_item_tags_protection_request_builder.go b/pkg/github/repos/item_item_tags_protection_request_builder.go new file mode 100644 index 00000000..701706af --- /dev/null +++ b/pkg/github/repos/item_item_tags_protection_request_builder.go @@ -0,0 +1,120 @@ +package repos + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemTagsProtectionRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\tags\protection +type ItemItemTagsProtectionRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTag_protection_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.tags.protection.item collection +// Deprecated: +// returns a *ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder when successful +func (m *ItemItemTagsProtectionRequestBuilder) ByTag_protection_id(tag_protection_id int32)(*ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["tag_protection_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(tag_protection_id), 10) + return NewItemItemTagsProtectionWithTag_protection_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemTagsProtectionRequestBuilderInternal instantiates a new ItemItemTagsProtectionRequestBuilder and sets the default values. +func NewItemItemTagsProtectionRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTagsProtectionRequestBuilder) { + m := &ItemItemTagsProtectionRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/tags/protection", pathParameters), + } + return m +} +// NewItemItemTagsProtectionRequestBuilder instantiates a new ItemItemTagsProtectionRequestBuilder and sets the default values. +func NewItemItemTagsProtectionRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTagsProtectionRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTagsProtectionRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!WARNING]> **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/enterprise-server@3.14/rest/repos/rules#get-all-repository-rulesets)" endpoint instead.This returns the tag protection states of a repository.This information is only available to repository administrators. +// Deprecated: +// returns a []TagProtectionable 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/enterprise-server@3.14/rest/repos/tags#deprecated---list-tag-protection-states-for-a-repository +func (m *ItemItemTagsProtectionRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TagProtectionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTagProtectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TagProtectionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TagProtectionable) + } + } + return val, nil +} +// Post > [!WARNING]> **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/enterprise-server@3.14/rest/repos/rules#create-a-repository-ruleset)" endpoint instead.This creates a tag protection state for a repository.This endpoint is only available to repository administrators. +// Deprecated: +// returns a TagProtectionable 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/enterprise-server@3.14/rest/repos/tags#deprecated---create-a-tag-protection-state-for-a-repository +func (m *ItemItemTagsProtectionRequestBuilder) Post(ctx context.Context, body ItemItemTagsProtectionPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TagProtectionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTagProtectionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TagProtectionable), nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/enterprise-server@3.14/rest/repos/rules#get-all-repository-rulesets)" endpoint instead.This returns the tag protection states of a repository.This information is only available to repository administrators. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemTagsProtectionRequestBuilder) 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 > [!WARNING]> **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/enterprise-server@3.14/rest/repos/rules#create-a-repository-ruleset)" endpoint instead.This creates a tag protection state for a repository.This endpoint is only available to repository administrators. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemTagsProtectionRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemTagsProtectionPostRequestBodyable, 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. +// Deprecated: +// returns a *ItemItemTagsProtectionRequestBuilder when successful +func (m *ItemItemTagsProtectionRequestBuilder) WithUrl(rawUrl string)(*ItemItemTagsProtectionRequestBuilder) { + return NewItemItemTagsProtectionRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_tags_protection_with_tag_escaped_protection_escaped_item_request_builder.go b/pkg/github/repos/item_item_tags_protection_with_tag_escaped_protection_escaped_item_request_builder.go new file mode 100644 index 00000000..be1bdd32 --- /dev/null +++ b/pkg/github/repos/item_item_tags_protection_with_tag_escaped_protection_escaped_item_request_builder.go @@ -0,0 +1,62 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\tags\protection\{tag_protection_id} +type ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemTagsProtectionWithTag_protection_ItemRequestBuilderInternal instantiates a new ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder and sets the default values. +func NewItemItemTagsProtectionWithTag_protection_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder) { + m := &ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/tags/protection/{tag_protection_id}", pathParameters), + } + return m +} +// NewItemItemTagsProtectionWithTag_protection_ItemRequestBuilder instantiates a new ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder and sets the default values. +func NewItemItemTagsProtectionWithTag_protection_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTagsProtectionWithTag_protection_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!WARNING]> **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/enterprise-server@3.14/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead.This deletes a tag protection state for a repository.This endpoint is only available to repository administrators. +// Deprecated: +// 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/enterprise-server@3.14/rest/repos/tags#deprecated---delete-a-tag-protection-state-for-a-repository +func (m *ItemItemTagsProtectionWithTag_protection_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 { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation > [!WARNING]> **Deprecation notice:** This operation is deprecated and will be removed after August 30, 2024. Use the "[Repository Rulesets](https://docs.github.com/enterprise-server@3.14/rest/repos/rules#delete-a-repository-ruleset)" endpoint instead.This deletes a tag protection state for a repository.This endpoint is only available to repository administrators. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemItemTagsProtectionWithTag_protection_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") + 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 *ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder when successful +func (m *ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemTagsProtectionWithTag_protection_ItemRequestBuilder) { + return NewItemItemTagsProtectionWithTag_protection_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_tags_request_builder.go b/pkg/github/repos/item_item_tags_request_builder.go new file mode 100644 index 00000000..4c1a4d5c --- /dev/null +++ b/pkg/github/repos/item_item_tags_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemTagsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\tags +type ItemItemTagsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemTagsRequestBuilderGetQueryParameters list repository tags +type ItemItemTagsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemTagsRequestBuilderInternal instantiates a new ItemItemTagsRequestBuilder and sets the default values. +func NewItemItemTagsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTagsRequestBuilder) { + m := &ItemItemTagsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/tags{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemTagsRequestBuilder instantiates a new ItemItemTagsRequestBuilder and sets the default values. +func NewItemItemTagsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTagsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTagsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list repository tags +// returns a []Tagable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#list-repository-tags +func (m *ItemItemTagsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTagsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Tagable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTagFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Tagable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Tagable) + } + } + return val, nil +} +// Protection the protection property +// returns a *ItemItemTagsProtectionRequestBuilder when successful +func (m *ItemItemTagsRequestBuilder) Protection()(*ItemItemTagsProtectionRequestBuilder) { + return NewItemItemTagsProtectionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// returns a *RequestInformation when successful +func (m *ItemItemTagsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTagsRequestBuilderGetQueryParameters])(*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 *ItemItemTagsRequestBuilder when successful +func (m *ItemItemTagsRequestBuilder) WithUrl(rawUrl string)(*ItemItemTagsRequestBuilder) { + return NewItemItemTagsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_tarball_request_builder.go b/pkg/github/repos/item_item_tarball_request_builder.go new file mode 100644 index 00000000..2d2b471a --- /dev/null +++ b/pkg/github/repos/item_item_tarball_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemTarballRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\tarball +type ItemItemTarballRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRef gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.tarball.item collection +// returns a *ItemItemTarballWithRefItemRequestBuilder when successful +func (m *ItemItemTarballRequestBuilder) ByRef(ref string)(*ItemItemTarballWithRefItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ref != "" { + urlTplParams["ref"] = ref + } + return NewItemItemTarballWithRefItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemTarballRequestBuilderInternal instantiates a new ItemItemTarballRequestBuilder and sets the default values. +func NewItemItemTarballRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTarballRequestBuilder) { + m := &ItemItemTarballRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/tarball", pathParameters), + } + return m +} +// NewItemItemTarballRequestBuilder instantiates a new ItemItemTarballRequestBuilder and sets the default values. +func NewItemItemTarballRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTarballRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTarballRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_tarball_with_ref_item_request_builder.go b/pkg/github/repos/item_item_tarball_with_ref_item_request_builder.go new file mode 100644 index 00000000..18cb206b --- /dev/null +++ b/pkg/github/repos/item_item_tarball_with_ref_item_request_builder.go @@ -0,0 +1,54 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemTarballWithRefItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\tarball\{ref} +type ItemItemTarballWithRefItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemTarballWithRefItemRequestBuilderInternal instantiates a new ItemItemTarballWithRefItemRequestBuilder and sets the default values. +func NewItemItemTarballWithRefItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTarballWithRefItemRequestBuilder) { + m := &ItemItemTarballWithRefItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/tarball/{ref}", pathParameters), + } + return m +} +// NewItemItemTarballWithRefItemRequestBuilder instantiates a new ItemItemTarballWithRefItemRequestBuilder and sets the default values. +func NewItemItemTarballWithRefItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTarballWithRefItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTarballWithRefItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually`main`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to usethe `Location` header to make a second `GET` request.> [!NOTE]> For private repositories, these links are temporary and expire after five minutes. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/contents#download-a-repository-archive-tar +func (m *ItemItemTarballWithRefItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]byte, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.([]byte), nil +} +// ToGetRequestInformation gets a redirect URL to download a tar archive for a repository. If you omit `:ref`, the repository’s default branch (usually`main`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to usethe `Location` header to make a second `GET` request.> [!NOTE]> For private repositories, these links are temporary and expire after five minutes. +// returns a *RequestInformation when successful +func (m *ItemItemTarballWithRefItemRequestBuilder) 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) + 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 *ItemItemTarballWithRefItemRequestBuilder when successful +func (m *ItemItemTarballWithRefItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemTarballWithRefItemRequestBuilder) { + return NewItemItemTarballWithRefItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_teams_request_builder.go b/pkg/github/repos/item_item_teams_request_builder.go new file mode 100644 index 00000000..98d87971 --- /dev/null +++ b/pkg/github/repos/item_item_teams_request_builder.go @@ -0,0 +1,71 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemTeamsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\teams +type ItemItemTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemTeamsRequestBuilderGetQueryParameters lists the teams that have access to the specified repository and that are also visible to the authenticated user.For a public repository, a team is listed only if that team added the public repository explicitly.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to use this endpoint with a public repository, and `repo` scope to use this endpoint with a private repository. +type ItemItemTeamsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemTeamsRequestBuilderInternal instantiates a new ItemItemTeamsRequestBuilder and sets the default values. +func NewItemItemTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTeamsRequestBuilder) { + m := &ItemItemTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/teams{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemTeamsRequestBuilder instantiates a new ItemItemTeamsRequestBuilder and sets the default values. +func NewItemItemTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the teams that have access to the specified repository and that are also visible to the authenticated user.For a public repository, a team is listed only if that team added the public repository explicitly.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to use this endpoint with a public repository, and `repo` scope to use this endpoint with a private repository. +// returns a []Teamable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#list-repository-teams +func (m *ItemItemTeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTeamsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable) + } + } + return val, nil +} +// ToGetRequestInformation lists the teams that have access to the specified repository and that are also visible to the authenticated user.For a public repository, a team is listed only if that team added the public repository explicitly.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to use this endpoint with a public repository, and `repo` scope to use this endpoint with a private repository. +// returns a *RequestInformation when successful +func (m *ItemItemTeamsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTeamsRequestBuilderGetQueryParameters])(*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 *ItemItemTeamsRequestBuilder when successful +func (m *ItemItemTeamsRequestBuilder) WithUrl(rawUrl string)(*ItemItemTeamsRequestBuilder) { + return NewItemItemTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_topics_put_request_body.go b/pkg/github/repos/item_item_topics_put_request_body.go new file mode 100644 index 00000000..7d6c7c68 --- /dev/null +++ b/pkg/github/repos/item_item_topics_put_request_body.go @@ -0,0 +1,86 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemTopicsPutRequestBody 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 array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` cannot contain uppercase letters. + names []string +} +// NewItemItemTopicsPutRequestBody instantiates a new ItemItemTopicsPutRequestBody and sets the default values. +func NewItemItemTopicsPutRequestBody()(*ItemItemTopicsPutRequestBody) { + m := &ItemItemTopicsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemTopicsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemTopicsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemTopicsPutRequestBody(), 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 *ItemItemTopicsPutRequestBody) 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 *ItemItemTopicsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["names"] = 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.SetNames(res) + } + return nil + } + return res +} +// GetNames gets the names property value. An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` cannot contain uppercase letters. +// returns a []string when successful +func (m *ItemItemTopicsPutRequestBody) GetNames()([]string) { + return m.names +} +// Serialize serializes information the current object +func (m *ItemItemTopicsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetNames() != nil { + err := writer.WriteCollectionOfStringValues("names", m.GetNames()) + 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 *ItemItemTopicsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNames sets the names property value. An array of topics to add to the repository. Pass one or more topics to _replace_ the set of existing topics. Send an empty array (`[]`) to clear all topics from the repository. **Note:** Topic `names` cannot contain uppercase letters. +func (m *ItemItemTopicsPutRequestBody) SetNames(value []string)() { + m.names = value +} +type ItemItemTopicsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNames()([]string) + SetNames(value []string)() +} diff --git a/pkg/github/repos/item_item_topics_request_builder.go b/pkg/github/repos/item_item_topics_request_builder.go new file mode 100644 index 00000000..c7a859bd --- /dev/null +++ b/pkg/github/repos/item_item_topics_request_builder.go @@ -0,0 +1,103 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemTopicsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\topics +type ItemItemTopicsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemItemTopicsRequestBuilderGetQueryParameters get all repository topics +type ItemItemTopicsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemItemTopicsRequestBuilderInternal instantiates a new ItemItemTopicsRequestBuilder and sets the default values. +func NewItemItemTopicsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTopicsRequestBuilder) { + m := &ItemItemTopicsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/topics{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemItemTopicsRequestBuilder instantiates a new ItemItemTopicsRequestBuilder and sets the default values. +func NewItemItemTopicsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTopicsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTopicsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get all repository topics +// returns a Topicable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#get-all-repository-topics +func (m *ItemItemTopicsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTopicsRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Topicable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTopicFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Topicable), nil +} +// Put replace all repository topics +// returns a Topicable when successful +// returns a BasicError error when the service returns a 404 status code +// returns a ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#replace-all-repository-topics +func (m *ItemItemTopicsRequestBuilder) Put(ctx context.Context, body ItemItemTopicsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Topicable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTopicFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Topicable), nil +} +// returns a *RequestInformation when successful +func (m *ItemItemTopicsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemItemTopicsRequestBuilderGetQueryParameters])(*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 +} +// returns a *RequestInformation when successful +func (m *ItemItemTopicsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemItemTopicsPutRequestBodyable, 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 *ItemItemTopicsRequestBuilder when successful +func (m *ItemItemTopicsRequestBuilder) WithUrl(rawUrl string)(*ItemItemTopicsRequestBuilder) { + return NewItemItemTopicsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_transfer_post_request_body.go b/pkg/github/repos/item_item_transfer_post_request_body.go new file mode 100644 index 00000000..09df893c --- /dev/null +++ b/pkg/github/repos/item_item_transfer_post_request_body.go @@ -0,0 +1,144 @@ +package repos + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemItemTransferPostRequestBody 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 new name to be given to the repository. + new_name *string + // The username or organization name the repository will be transferred to. + new_owner *string + // ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. + team_ids []int32 +} +// NewItemItemTransferPostRequestBody instantiates a new ItemItemTransferPostRequestBody and sets the default values. +func NewItemItemTransferPostRequestBody()(*ItemItemTransferPostRequestBody) { + m := &ItemItemTransferPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemItemTransferPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemItemTransferPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemItemTransferPostRequestBody(), 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 *ItemItemTransferPostRequestBody) 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 *ItemItemTransferPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["new_name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNewName(val) + } + return nil + } + res["new_owner"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetNewOwner(val) + } + return nil + } + res["team_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.SetTeamIds(res) + } + return nil + } + return res +} +// GetNewName gets the new_name property value. The new name to be given to the repository. +// returns a *string when successful +func (m *ItemItemTransferPostRequestBody) GetNewName()(*string) { + return m.new_name +} +// GetNewOwner gets the new_owner property value. The username or organization name the repository will be transferred to. +// returns a *string when successful +func (m *ItemItemTransferPostRequestBody) GetNewOwner()(*string) { + return m.new_owner +} +// GetTeamIds gets the team_ids property value. ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. +// returns a []int32 when successful +func (m *ItemItemTransferPostRequestBody) GetTeamIds()([]int32) { + return m.team_ids +} +// Serialize serializes information the current object +func (m *ItemItemTransferPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("new_name", m.GetNewName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("new_owner", m.GetNewOwner()) + if err != nil { + return err + } + } + if m.GetTeamIds() != nil { + err := writer.WriteCollectionOfInt32Values("team_ids", m.GetTeamIds()) + 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 *ItemItemTransferPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetNewName sets the new_name property value. The new name to be given to the repository. +func (m *ItemItemTransferPostRequestBody) SetNewName(value *string)() { + m.new_name = value +} +// SetNewOwner sets the new_owner property value. The username or organization name the repository will be transferred to. +func (m *ItemItemTransferPostRequestBody) SetNewOwner(value *string)() { + m.new_owner = value +} +// SetTeamIds sets the team_ids property value. ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories. +func (m *ItemItemTransferPostRequestBody) SetTeamIds(value []int32)() { + m.team_ids = value +} +type ItemItemTransferPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetNewName()(*string) + GetNewOwner()(*string) + GetTeamIds()([]int32) + SetNewName(value *string)() + SetNewOwner(value *string)() + SetTeamIds(value []int32)() +} diff --git a/pkg/github/repos/item_item_transfer_request_builder.go b/pkg/github/repos/item_item_transfer_request_builder.go new file mode 100644 index 00000000..e253191e --- /dev/null +++ b/pkg/github/repos/item_item_transfer_request_builder.go @@ -0,0 +1,61 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemItemTransferRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\transfer +type ItemItemTransferRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemTransferRequestBuilderInternal instantiates a new ItemItemTransferRequestBuilder and sets the default values. +func NewItemItemTransferRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTransferRequestBuilder) { + m := &ItemItemTransferRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/transfer", pathParameters), + } + return m +} +// NewItemItemTransferRequestBuilder instantiates a new ItemItemTransferRequestBuilder and sets the default values. +func NewItemItemTransferRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemTransferRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemTransferRequestBuilderInternal(urlParams, requestAdapter) +} +// Post a transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original `owner`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://docs.github.com/enterprise-server@3.14/articles/about-repository-transfers/). +// returns a MinimalRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#transfer-a-repository +func (m *ItemItemTransferRequestBuilder) Post(ctx context.Context, body ItemItemTransferPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable), nil +} +// ToPostRequestInformation a transfer request will need to be accepted by the new owner when transferring a personal repository to another user. The response will contain the original `owner`, and the transfer will continue asynchronously. For more details on the requirements to transfer personal and organization-owned repositories, see [about repository transfers](https://docs.github.com/enterprise-server@3.14/articles/about-repository-transfers/). +// returns a *RequestInformation when successful +func (m *ItemItemTransferRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemTransferPostRequestBodyable, 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 *ItemItemTransferRequestBuilder when successful +func (m *ItemItemTransferRequestBuilder) WithUrl(rawUrl string)(*ItemItemTransferRequestBuilder) { + return NewItemItemTransferRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_vulnerability_alerts_request_builder.go b/pkg/github/repos/item_item_vulnerability_alerts_request_builder.go new file mode 100644 index 00000000..9946b8d4 --- /dev/null +++ b/pkg/github/repos/item_item_vulnerability_alerts_request_builder.go @@ -0,0 +1,95 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemVulnerabilityAlertsRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\vulnerability-alerts +type ItemItemVulnerabilityAlertsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemVulnerabilityAlertsRequestBuilderInternal instantiates a new ItemItemVulnerabilityAlertsRequestBuilder and sets the default values. +func NewItemItemVulnerabilityAlertsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemVulnerabilityAlertsRequestBuilder) { + m := &ItemItemVulnerabilityAlertsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/vulnerability-alerts", pathParameters), + } + return m +} +// NewItemItemVulnerabilityAlertsRequestBuilder instantiates a new ItemItemVulnerabilityAlertsRequestBuilder and sets the default values. +func NewItemItemVulnerabilityAlertsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemVulnerabilityAlertsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemVulnerabilityAlertsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete disables dependency alerts for a repository.The authenticated user must have admin access to the repository. For more information,see "[About security alerts for vulnerable dependencies](https://docs.github.com/enterprise-server@3.14/articles/about-security-alerts-for-vulnerable-dependencies)". +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#disable-vulnerability-alerts +func (m *ItemItemVulnerabilityAlertsRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin read access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/enterprise-server@3.14/articles/about-security-alerts-for-vulnerable-dependencies)". +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#check-if-vulnerability-alerts-are-enabled-for-a-repository +func (m *ItemItemVulnerabilityAlertsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/enterprise-server@3.14/articles/about-security-alerts-for-vulnerable-dependencies)". +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#enable-vulnerability-alerts +func (m *ItemItemVulnerabilityAlertsRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation disables dependency alerts for a repository.The authenticated user must have admin access to the repository. For more information,see "[About security alerts for vulnerable dependencies](https://docs.github.com/enterprise-server@3.14/articles/about-security-alerts-for-vulnerable-dependencies)". +// returns a *RequestInformation when successful +func (m *ItemItemVulnerabilityAlertsRequestBuilder) 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 +} +// ToGetRequestInformation shows whether dependency alerts are enabled or disabled for a repository. The authenticated user must have admin read access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/enterprise-server@3.14/articles/about-security-alerts-for-vulnerable-dependencies)". +// returns a *RequestInformation when successful +func (m *ItemItemVulnerabilityAlertsRequestBuilder) 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) + return requestInfo, nil +} +// ToPutRequestInformation enables dependency alerts and the dependency graph for a repository. The authenticated user must have admin access to the repository. For more information, see "[About security alerts for vulnerable dependencies](https://docs.github.com/enterprise-server@3.14/articles/about-security-alerts-for-vulnerable-dependencies)". +// returns a *RequestInformation when successful +func (m *ItemItemVulnerabilityAlertsRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemItemVulnerabilityAlertsRequestBuilder when successful +func (m *ItemItemVulnerabilityAlertsRequestBuilder) WithUrl(rawUrl string)(*ItemItemVulnerabilityAlertsRequestBuilder) { + return NewItemItemVulnerabilityAlertsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_item_zipball_request_builder.go b/pkg/github/repos/item_item_zipball_request_builder.go new file mode 100644 index 00000000..61679235 --- /dev/null +++ b/pkg/github/repos/item_item_zipball_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemZipballRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\zipball +type ItemItemZipballRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRef gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item.zipball.item collection +// returns a *ItemItemZipballWithRefItemRequestBuilder when successful +func (m *ItemItemZipballRequestBuilder) ByRef(ref string)(*ItemItemZipballWithRefItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ref != "" { + urlTplParams["ref"] = ref + } + return NewItemItemZipballWithRefItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemItemZipballRequestBuilderInternal instantiates a new ItemItemZipballRequestBuilder and sets the default values. +func NewItemItemZipballRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemZipballRequestBuilder) { + m := &ItemItemZipballRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/zipball", pathParameters), + } + return m +} +// NewItemItemZipballRequestBuilder instantiates a new ItemItemZipballRequestBuilder and sets the default values. +func NewItemItemZipballRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemZipballRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemZipballRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/item_item_zipball_with_ref_item_request_builder.go b/pkg/github/repos/item_item_zipball_with_ref_item_request_builder.go new file mode 100644 index 00000000..d43699aa --- /dev/null +++ b/pkg/github/repos/item_item_zipball_with_ref_item_request_builder.go @@ -0,0 +1,54 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemItemZipballWithRefItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id}\zipball\{ref} +type ItemItemZipballWithRefItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemItemZipballWithRefItemRequestBuilderInternal instantiates a new ItemItemZipballWithRefItemRequestBuilder and sets the default values. +func NewItemItemZipballWithRefItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemZipballWithRefItemRequestBuilder) { + m := &ItemItemZipballWithRefItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}/zipball/{ref}", pathParameters), + } + return m +} +// NewItemItemZipballWithRefItemRequestBuilder instantiates a new ItemItemZipballWithRefItemRequestBuilder and sets the default values. +func NewItemItemZipballWithRefItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemItemZipballWithRefItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemItemZipballWithRefItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually`main`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to usethe `Location` header to make a second `GET` request.> [!NOTE]> For private repositories, these links are temporary and expire after five minutes. If the repository is empty, you will receive a 404 when you follow the redirect. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/contents#download-a-repository-archive-zip +func (m *ItemItemZipballWithRefItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]byte, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "[]byte", nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.([]byte), nil +} +// ToGetRequestInformation gets a redirect URL to download a zip archive for a repository. If you omit `:ref`, the repository’s default branch (usually`main`) will be used. Please make sure your HTTP framework is configured to follow redirects or you will need to usethe `Location` header to make a second `GET` request.> [!NOTE]> For private repositories, these links are temporary and expire after five minutes. If the repository is empty, you will receive a 404 when you follow the redirect. +// returns a *RequestInformation when successful +func (m *ItemItemZipballWithRefItemRequestBuilder) 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) + 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 *ItemItemZipballWithRefItemRequestBuilder when successful +func (m *ItemItemZipballWithRefItemRequestBuilder) WithUrl(rawUrl string)(*ItemItemZipballWithRefItemRequestBuilder) { + return NewItemItemZipballWithRefItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/repos/item_repo_item_request_builder.go b/pkg/github/repos/item_repo_item_request_builder.go new file mode 100644 index 00000000..bccd431f --- /dev/null +++ b/pkg/github/repos/item_repo_item_request_builder.go @@ -0,0 +1,436 @@ +package repos + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemRepoItemRequestBuilder builds and executes requests for operations under \repos\{owner-id}\{repo-id} +type ItemRepoItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Actions the actions property +// returns a *ItemItemActionsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Actions()(*ItemItemActionsRequestBuilder) { + return NewItemItemActionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Activity the activity property +// returns a *ItemItemActivityRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Activity()(*ItemItemActivityRequestBuilder) { + return NewItemItemActivityRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Assignees the assignees property +// returns a *ItemItemAssigneesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Assignees()(*ItemItemAssigneesRequestBuilder) { + return NewItemItemAssigneesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Autolinks the autolinks property +// returns a *ItemItemAutolinksRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Autolinks()(*ItemItemAutolinksRequestBuilder) { + return NewItemItemAutolinksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// AutomatedSecurityFixes the automatedSecurityFixes property +// returns a *ItemItemAutomatedSecurityFixesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) AutomatedSecurityFixes()(*ItemItemAutomatedSecurityFixesRequestBuilder) { + return NewItemItemAutomatedSecurityFixesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Branches the branches property +// returns a *ItemItemBranchesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Branches()(*ItemItemBranchesRequestBuilder) { + return NewItemItemBranchesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckRuns the checkRuns property +// returns a *ItemItemCheckRunsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) CheckRuns()(*ItemItemCheckRunsRequestBuilder) { + return NewItemItemCheckRunsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CheckSuites the checkSuites property +// returns a *ItemItemCheckSuitesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) CheckSuites()(*ItemItemCheckSuitesRequestBuilder) { + return NewItemItemCheckSuitesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Codeowners the codeowners property +// returns a *ItemItemCodeownersRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Codeowners()(*ItemItemCodeownersRequestBuilder) { + return NewItemItemCodeownersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// CodeScanning the codeScanning property +// returns a *ItemItemCodeScanningRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) CodeScanning()(*ItemItemCodeScanningRequestBuilder) { + return NewItemItemCodeScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Collaborators the collaborators property +// returns a *ItemItemCollaboratorsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Collaborators()(*ItemItemCollaboratorsRequestBuilder) { + return NewItemItemCollaboratorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Comments the comments property +// returns a *ItemItemCommentsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Comments()(*ItemItemCommentsRequestBuilder) { + return NewItemItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Commits the commits property +// returns a *ItemItemCommitsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Commits()(*ItemItemCommitsRequestBuilder) { + return NewItemItemCommitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Compare the compare property +// returns a *ItemItemCompareRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Compare()(*ItemItemCompareRequestBuilder) { + return NewItemItemCompareRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemRepoItemRequestBuilderInternal instantiates a new ItemRepoItemRequestBuilder and sets the default values. +func NewItemRepoItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRepoItemRequestBuilder) { + m := &ItemRepoItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}/{repo%2Did}", pathParameters), + } + return m +} +// NewItemRepoItemRequestBuilder instantiates a new ItemRepoItemRequestBuilder and sets the default values. +func NewItemRepoItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemRepoItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemRepoItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Contents the contents property +// returns a *ItemItemContentsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Contents()(*ItemItemContentsRequestBuilder) { + return NewItemItemContentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Contributors the contributors property +// returns a *ItemItemContributorsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Contributors()(*ItemItemContributorsRequestBuilder) { + return NewItemItemContributorsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Delete deleting a repository requires admin access.If an organization owner has configured the organization to prevent members from deleting organization-ownedrepositories, you will get a `403 Forbidden` response.OAuth app tokens and personal access tokens (classic) need the `delete_repo` scope to use this endpoint. +// returns a ItemItemRepo403Error 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/enterprise-server@3.14/rest/repos/repos#delete-a-repository +func (m *ItemRepoItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": CreateItemItemRepo403ErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Dependabot the dependabot property +// returns a *ItemItemDependabotRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Dependabot()(*ItemItemDependabotRequestBuilder) { + return NewItemItemDependabotRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// DependencyGraph the dependencyGraph property +// returns a *ItemItemDependencyGraphRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) DependencyGraph()(*ItemItemDependencyGraphRequestBuilder) { + return NewItemItemDependencyGraphRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Deployments the deployments property +// returns a *ItemItemDeploymentsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Deployments()(*ItemItemDeploymentsRequestBuilder) { + return NewItemItemDeploymentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Dispatches the dispatches property +// returns a *ItemItemDispatchesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Dispatches()(*ItemItemDispatchesRequestBuilder) { + return NewItemItemDispatchesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Environments the environments property +// returns a *ItemItemEnvironmentsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Environments()(*ItemItemEnvironmentsRequestBuilder) { + return NewItemItemEnvironmentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Events the events property +// returns a *ItemItemEventsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Events()(*ItemItemEventsRequestBuilder) { + return NewItemItemEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Forks the forks property +// returns a *ItemItemForksRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Forks()(*ItemItemForksRequestBuilder) { + return NewItemItemForksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Generate the generate property +// returns a *ItemItemGenerateRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Generate()(*ItemItemGenerateRequestBuilder) { + return NewItemItemGenerateRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get the `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network.> [!NOTE]> In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." +// returns a FullRepositoryable 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/enterprise-server@3.14/rest/repos/repos#get-a-repository +func (m *ItemRepoItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FullRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FullRepositoryable), nil +} +// Git the git property +// returns a *ItemItemGitRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Git()(*ItemItemGitRequestBuilder) { + return NewItemItemGitRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Hooks the hooks property +// returns a *ItemItemHooksRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Hooks()(*ItemItemHooksRequestBuilder) { + return NewItemItemHooksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installation the installation property +// returns a *ItemItemInstallationRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Installation()(*ItemItemInstallationRequestBuilder) { + return NewItemItemInstallationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Invitations the invitations property +// returns a *ItemItemInvitationsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Invitations()(*ItemItemInvitationsRequestBuilder) { + return NewItemItemInvitationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Issues the issues property +// returns a *ItemItemIssuesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Issues()(*ItemItemIssuesRequestBuilder) { + return NewItemItemIssuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Keys the keys property +// returns a *ItemItemKeysRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Keys()(*ItemItemKeysRequestBuilder) { + return NewItemItemKeysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Labels the labels property +// returns a *ItemItemLabelsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Labels()(*ItemItemLabelsRequestBuilder) { + return NewItemItemLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Languages the languages property +// returns a *ItemItemLanguagesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Languages()(*ItemItemLanguagesRequestBuilder) { + return NewItemItemLanguagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Lfs the lfs property +// returns a *ItemItemLfsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Lfs()(*ItemItemLfsRequestBuilder) { + return NewItemItemLfsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// License the license property +// returns a *ItemItemLicenseRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) License()(*ItemItemLicenseRequestBuilder) { + return NewItemItemLicenseRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Merges the merges property +// returns a *ItemItemMergesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Merges()(*ItemItemMergesRequestBuilder) { + return NewItemItemMergesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// MergeUpstream the mergeUpstream property +// returns a *ItemItemMergeUpstreamRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) MergeUpstream()(*ItemItemMergeUpstreamRequestBuilder) { + return NewItemItemMergeUpstreamRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Milestones the milestones property +// returns a *ItemItemMilestonesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Milestones()(*ItemItemMilestonesRequestBuilder) { + return NewItemItemMilestonesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Notifications the notifications property +// returns a *ItemItemNotificationsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Notifications()(*ItemItemNotificationsRequestBuilder) { + return NewItemItemNotificationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Pages the pages property +// returns a *ItemItemPagesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Pages()(*ItemItemPagesRequestBuilder) { + return NewItemItemPagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch **Note**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/enterprise-server@3.14/rest/repos/repos#replace-all-repository-topics) endpoint. +// returns a FullRepositoryable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#update-a-repository +func (m *ItemRepoItemRequestBuilder) Patch(ctx context.Context, body ItemItemRepoPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FullRepositoryable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FullRepositoryable), nil +} +// PreReceiveHooks the preReceiveHooks property +// returns a *ItemItemPreReceiveHooksRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) PreReceiveHooks()(*ItemItemPreReceiveHooksRequestBuilder) { + return NewItemItemPreReceiveHooksRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Projects the projects property +// returns a *ItemItemProjectsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Projects()(*ItemItemProjectsRequestBuilder) { + return NewItemItemProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Properties the properties property +// returns a *ItemItemPropertiesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Properties()(*ItemItemPropertiesRequestBuilder) { + return NewItemItemPropertiesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Pulls the pulls property +// returns a *ItemItemPullsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Pulls()(*ItemItemPullsRequestBuilder) { + return NewItemItemPullsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Readme the readme property +// returns a *ItemItemReadmeRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Readme()(*ItemItemReadmeRequestBuilder) { + return NewItemItemReadmeRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Releases the releases property +// returns a *ItemItemReleasesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Releases()(*ItemItemReleasesRequestBuilder) { + return NewItemItemReleasesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Replicas the replicas property +// returns a *ItemItemReplicasRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Replicas()(*ItemItemReplicasRequestBuilder) { + return NewItemItemReplicasRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rules the rules property +// returns a *ItemItemRulesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Rules()(*ItemItemRulesRequestBuilder) { + return NewItemItemRulesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Rulesets the rulesets property +// returns a *ItemItemRulesetsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Rulesets()(*ItemItemRulesetsRequestBuilder) { + return NewItemItemRulesetsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// SecretScanning the secretScanning property +// returns a *ItemItemSecretScanningRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) SecretScanning()(*ItemItemSecretScanningRequestBuilder) { + return NewItemItemSecretScanningRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Stargazers the stargazers property +// returns a *ItemItemStargazersRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Stargazers()(*ItemItemStargazersRequestBuilder) { + return NewItemItemStargazersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Stats the stats property +// returns a *ItemItemStatsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Stats()(*ItemItemStatsRequestBuilder) { + return NewItemItemStatsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Statuses the statuses property +// returns a *ItemItemStatusesRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Statuses()(*ItemItemStatusesRequestBuilder) { + return NewItemItemStatusesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Subscribers the subscribers property +// returns a *ItemItemSubscribersRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Subscribers()(*ItemItemSubscribersRequestBuilder) { + return NewItemItemSubscribersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Subscription the subscription property +// returns a *ItemItemSubscriptionRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Subscription()(*ItemItemSubscriptionRequestBuilder) { + return NewItemItemSubscriptionRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Tags the tags property +// returns a *ItemItemTagsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Tags()(*ItemItemTagsRequestBuilder) { + return NewItemItemTagsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Tarball the tarball property +// returns a *ItemItemTarballRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Tarball()(*ItemItemTarballRequestBuilder) { + return NewItemItemTarballRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Teams the teams property +// returns a *ItemItemTeamsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Teams()(*ItemItemTeamsRequestBuilder) { + return NewItemItemTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deleting a repository requires admin access.If an organization owner has configured the organization to prevent members from deleting organization-ownedrepositories, you will get a `403 Forbidden` response.OAuth app tokens and personal access tokens (classic) need the `delete_repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemRepoItemRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation the `parent` and `source` objects are present when the repository is a fork. `parent` is the repository this repository was forked from, `source` is the ultimate source for the network.> [!NOTE]> In order to see the `security_and_analysis` block for a repository you must have admin permissions for the repository or be an owner or security manager for the organization that owns the repository. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)." +// returns a *RequestInformation when successful +func (m *ItemRepoItemRequestBuilder) 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**: To edit a repository's topics, use the [Replace all repository topics](https://docs.github.com/enterprise-server@3.14/rest/repos/repos#replace-all-repository-topics) endpoint. +// returns a *RequestInformation when successful +func (m *ItemRepoItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemItemRepoPatchRequestBodyable, 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 +} +// Topics the topics property +// returns a *ItemItemTopicsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Topics()(*ItemItemTopicsRequestBuilder) { + return NewItemItemTopicsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Transfer the transfer property +// returns a *ItemItemTransferRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Transfer()(*ItemItemTransferRequestBuilder) { + return NewItemItemTransferRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// VulnerabilityAlerts the vulnerabilityAlerts property +// returns a *ItemItemVulnerabilityAlertsRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) VulnerabilityAlerts()(*ItemItemVulnerabilityAlertsRequestBuilder) { + return NewItemItemVulnerabilityAlertsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemRepoItemRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) WithUrl(rawUrl string)(*ItemRepoItemRequestBuilder) { + return NewItemRepoItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} +// Zipball the zipball property +// returns a *ItemItemZipballRequestBuilder when successful +func (m *ItemRepoItemRequestBuilder) Zipball()(*ItemItemZipballRequestBuilder) { + return NewItemItemZipballRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/repos/owner_item_request_builder.go b/pkg/github/repos/owner_item_request_builder.go new file mode 100644 index 00000000..62963143 --- /dev/null +++ b/pkg/github/repos/owner_item_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// OwnerItemRequestBuilder builds and executes requests for operations under \repos\{owner-id} +type OwnerItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepoId gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item.item collection +// returns a *ItemRepoItemRequestBuilder when successful +func (m *OwnerItemRequestBuilder) ByRepoId(repoId string)(*ItemRepoItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repoId != "" { + urlTplParams["repo%2Did"] = repoId + } + return NewItemRepoItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewOwnerItemRequestBuilderInternal instantiates a new OwnerItemRequestBuilder and sets the default values. +func NewOwnerItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OwnerItemRequestBuilder) { + m := &OwnerItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos/{owner%2Did}", pathParameters), + } + return m +} +// NewOwnerItemRequestBuilder instantiates a new OwnerItemRequestBuilder and sets the default values. +func NewOwnerItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OwnerItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewOwnerItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repos/repos_request_builder.go b/pkg/github/repos/repos_request_builder.go new file mode 100644 index 00000000..21706f4f --- /dev/null +++ b/pkg/github/repos/repos_request_builder.go @@ -0,0 +1,35 @@ +package repos + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ReposRequestBuilder builds and executes requests for operations under \repos +type ReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByOwnerId gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.repos.item collection +// returns a *OwnerItemRequestBuilder when successful +func (m *ReposRequestBuilder) ByOwnerId(ownerId string)(*OwnerItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if ownerId != "" { + urlTplParams["owner%2Did"] = ownerId + } + return NewOwnerItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewReposRequestBuilderInternal instantiates a new ReposRequestBuilder and sets the default values. +func NewReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ReposRequestBuilder) { + m := &ReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repos", pathParameters), + } + return m +} +// NewReposRequestBuilder instantiates a new ReposRequestBuilder and sets the default values. +func NewReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewReposRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/repositories/get_visibility_query_parameter_type.go b/pkg/github/repositories/get_visibility_query_parameter_type.go new file mode 100644 index 00000000..03c6a46f --- /dev/null +++ b/pkg/github/repositories/get_visibility_query_parameter_type.go @@ -0,0 +1,33 @@ +package repositories +type GetVisibilityQueryParameterType int + +const ( + ALL_GETVISIBILITYQUERYPARAMETERTYPE GetVisibilityQueryParameterType = iota + PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE +) + +func (i GetVisibilityQueryParameterType) String() string { + return []string{"all", "public"}[i] +} +func ParseGetVisibilityQueryParameterType(v string) (any, error) { + result := ALL_GETVISIBILITYQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETVISIBILITYQUERYPARAMETERTYPE + case "public": + result = PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetVisibilityQueryParameterType(values []GetVisibilityQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetVisibilityQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/repositories/repositories_request_builder.go b/pkg/github/repositories/repositories_request_builder.go new file mode 100644 index 00000000..240d2ede --- /dev/null +++ b/pkg/github/repositories/repositories_request_builder.go @@ -0,0 +1,71 @@ +package repositories + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// RepositoriesRequestBuilder builds and executes requests for operations under \repositories +type RepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// RepositoriesRequestBuilderGetQueryParameters lists all public repositories in the order that they were created.Note:- For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise.- Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of repositories. +type RepositoriesRequestBuilderGetQueryParameters struct { + // A repository ID. Only return repositories with an ID greater than this ID. + Since *int32 `uriparametername:"since"` + // Specifies the types of repositories to return. This endpoint will only list repositories available to all users on the enterprise. + Visibility *GetVisibilityQueryParameterType `uriparametername:"visibility"` +} +// NewRepositoriesRequestBuilderInternal instantiates a new RepositoriesRequestBuilder and sets the default values. +func NewRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RepositoriesRequestBuilder) { + m := &RepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/repositories{?since*,visibility*}", pathParameters), + } + return m +} +// NewRepositoriesRequestBuilder instantiates a new RepositoriesRequestBuilder and sets the default values. +func NewRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all public repositories in the order that they were created.Note:- For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise.- Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of repositories. +// returns a []MinimalRepositoryable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#list-public-repositories +func (m *RepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[RepositoriesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists all public repositories in the order that they were created.Note:- For GitHub Enterprise Server, this endpoint will only list repositories available to all users on the enterprise.- Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of repositories. +// returns a *RequestInformation when successful +func (m *RepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[RepositoriesRequestBuilderGetQueryParameters])(*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 *RepositoriesRequestBuilder when successful +func (m *RepositoriesRequestBuilder) WithUrl(rawUrl string)(*RepositoriesRequestBuilder) { + return NewRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/scim/scim_request_builder.go b/pkg/github/scim/scim_request_builder.go new file mode 100644 index 00000000..1543940a --- /dev/null +++ b/pkg/github/scim/scim_request_builder.go @@ -0,0 +1,28 @@ +package scim + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ScimRequestBuilder builds and executes requests for operations under \scim +type ScimRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewScimRequestBuilderInternal instantiates a new ScimRequestBuilder and sets the default values. +func NewScimRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ScimRequestBuilder) { + m := &ScimRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/scim", pathParameters), + } + return m +} +// NewScimRequestBuilder instantiates a new ScimRequestBuilder and sets the default values. +func NewScimRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ScimRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewScimRequestBuilderInternal(urlParams, requestAdapter) +} +// V2 the v2 property +// returns a *V2RequestBuilder when successful +func (m *ScimRequestBuilder) V2()(*V2RequestBuilder) { + return NewV2RequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/scim/v2_enterprises_item_groups_request_builder.go b/pkg/github/scim/v2_enterprises_item_groups_request_builder.go new file mode 100644 index 00000000..76c61d61 --- /dev/null +++ b/pkg/github/scim/v2_enterprises_item_groups_request_builder.go @@ -0,0 +1,127 @@ +package scim + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V2EnterprisesItemGroupsRequestBuilder builds and executes requests for operations under \scim\v2\enterprises\{enterprise}\Groups +type V2EnterprisesItemGroupsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// V2EnterprisesItemGroupsRequestBuilderGetQueryParameters > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Lists provisioned SCIM groups in an enterprise.You can improve query search time by using the `excludedAttributes` query parameter with a value of `members` to exclude members from the response. +type V2EnterprisesItemGroupsRequestBuilderGetQueryParameters struct { + // Used for pagination: the number of results to return per page. + Count *int32 `uriparametername:"count"` + // Excludes the specified attribute from being returned in the results. Using this parameter can speed up response time. + ExcludedAttributes *string `uriparametername:"excludedAttributes"` + // If specified, only results that match the specified filter will be returned. Multiple filters are not supported. Possible filters are `externalId`, `id`, and `displayName`. For example, `?filter="externalId eq '9138790-10932-109120392-12321'"`. + Filter *string `uriparametername:"filter"` + // Used for pagination: the starting index of the first result to return when paginating through values. + StartIndex *int32 `uriparametername:"startIndex"` +} +// ByScim_group_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.scim.v2.enterprises.item.Groups.item collection +// returns a *V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder when successful +func (m *V2EnterprisesItemGroupsRequestBuilder) ByScim_group_id(scim_group_id string)(*V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if scim_group_id != "" { + urlTplParams["scim_group_id"] = scim_group_id + } + return NewV2EnterprisesItemGroupsWithScim_group_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewV2EnterprisesItemGroupsRequestBuilderInternal instantiates a new V2EnterprisesItemGroupsRequestBuilder and sets the default values. +func NewV2EnterprisesItemGroupsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2EnterprisesItemGroupsRequestBuilder) { + m := &V2EnterprisesItemGroupsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/scim/v2/enterprises/{enterprise}/Groups{?count*,excludedAttributes*,filter*,startIndex*}", pathParameters), + } + return m +} +// NewV2EnterprisesItemGroupsRequestBuilder instantiates a new V2EnterprisesItemGroupsRequestBuilder and sets the default values. +func NewV2EnterprisesItemGroupsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2EnterprisesItemGroupsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV2EnterprisesItemGroupsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Lists provisioned SCIM groups in an enterprise.You can improve query search time by using the `excludedAttributes` query parameter with a value of `members` to exclude members from the response. +// returns a ScimEnterpriseGroupListable when successful +// returns a ScimError error when the service returns a 400 status code +// returns a ScimError error when the service returns a 429 status code +// returns a ScimError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/scim#list-provisioned-scim-groups-for-an-enterprise +func (m *V2EnterprisesItemGroupsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V2EnterprisesItemGroupsRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseGroupListable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "429": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimEnterpriseGroupListFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseGroupListable), nil +} +// Post > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Creates a SCIM group for an enterprise.If members are included as part of the group provisioning payload, they will be created as external group members. It is up to a provider to store a mapping between the `externalId` and `id` of each user. +// returns a ScimEnterpriseGroupResponseable when successful +// returns a ScimError error when the service returns a 400 status code +// returns a ScimError error when the service returns a 429 status code +// returns a ScimError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/scim#provision-a-scim-enterprise-group +func (m *V2EnterprisesItemGroupsRequestBuilder) Post(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Groupable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseGroupResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "429": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimEnterpriseGroupResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseGroupResponseable), nil +} +// ToGetRequestInformation > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Lists provisioned SCIM groups in an enterprise.You can improve query search time by using the `excludedAttributes` query parameter with a value of `members` to exclude members from the response. +// returns a *RequestInformation when successful +func (m *V2EnterprisesItemGroupsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V2EnterprisesItemGroupsRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/scim+json") + return requestInfo, nil +} +// ToPostRequestInformation > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Creates a SCIM group for an enterprise.If members are included as part of the group provisioning payload, they will be created as external group members. It is up to a provider to store a mapping between the `externalId` and `id` of each user. +// returns a *RequestInformation when successful +func (m *V2EnterprisesItemGroupsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Groupable, 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/scim+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 *V2EnterprisesItemGroupsRequestBuilder when successful +func (m *V2EnterprisesItemGroupsRequestBuilder) WithUrl(rawUrl string)(*V2EnterprisesItemGroupsRequestBuilder) { + return NewV2EnterprisesItemGroupsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/scim/v2_enterprises_item_groups_with_scim_escaped_group_escaped_item_request_builder.go b/pkg/github/scim/v2_enterprises_item_groups_with_scim_escaped_group_escaped_item_request_builder.go new file mode 100644 index 00000000..3b5b252c --- /dev/null +++ b/pkg/github/scim/v2_enterprises_item_groups_with_scim_escaped_group_escaped_item_request_builder.go @@ -0,0 +1,187 @@ +package scim + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder builds and executes requests for operations under \scim\v2\enterprises\{enterprise}\Groups\{scim_group_id} +type V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilderGetQueryParameters > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Gets information about a SCIM group. +type V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilderGetQueryParameters struct { + // Excludes the specified attribute from being returned in the results. Using this parameter can speed up response time. + ExcludedAttributes *string `uriparametername:"excludedAttributes"` +} +// NewV2EnterprisesItemGroupsWithScim_group_ItemRequestBuilderInternal instantiates a new V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder and sets the default values. +func NewV2EnterprisesItemGroupsWithScim_group_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder) { + m := &V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/scim/v2/enterprises/{enterprise}/Groups/{scim_group_id}{?excludedAttributes*}", pathParameters), + } + return m +} +// NewV2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder instantiates a new V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder and sets the default values. +func NewV2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV2EnterprisesItemGroupsWithScim_group_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Deletes a SCIM group from an enterprise. +// returns a ScimError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ScimError error when the service returns a 429 status code +// returns a ScimError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/scim#delete-a-scim-group-from-an-enterprise +func (m *V2EnterprisesItemGroupsWithScim_group_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": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "429": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Gets information about a SCIM group. +// returns a ScimEnterpriseGroupResponseable when successful +// returns a ScimError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ScimError error when the service returns a 429 status code +// returns a ScimError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-group +func (m *V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseGroupResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "429": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimEnterpriseGroupResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseGroupResponseable), nil +} +// Patch > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Update a provisioned group’s individual attributes.To change a group’s values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). Update can also be used to add group memberships.Group memberships can be sent one at a time or in batches for faster performance. **Note**: The memberships are referenced through a local user `id`, and the user will need to be created before they are referenced here. +// returns a ScimEnterpriseGroupResponseable when successful +// returns a ScimError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ScimError error when the service returns a 429 status code +// returns a ScimError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-group +func (m *V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder) Patch(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PatchSchemaable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseGroupResponseable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "429": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimEnterpriseGroupResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseGroupResponseable), nil +} +// Put > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Replaces an existing provisioned group’s information.You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the [Update an attribute for a SCIM enterprise group](#update-an-attribute-for-a-scim-enterprise-group) endpoint instead. +// returns a ScimEnterpriseGroupResponseable when successful +// returns a ScimError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ScimError error when the service returns a 429 status code +// returns a ScimError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-group +func (m *V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder) Put(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Groupable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseGroupResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "429": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimEnterpriseGroupResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseGroupResponseable), nil +} +// ToDeleteRequestInformation > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Deletes a SCIM group from an enterprise. +// returns a *RequestInformation when successful +func (m *V2EnterprisesItemGroupsWithScim_group_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 > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Gets information about a SCIM group. +// returns a *RequestInformation when successful +func (m *V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/scim+json") + return requestInfo, nil +} +// ToPatchRequestInformation > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Update a provisioned group’s individual attributes.To change a group’s values, you must provide a specific Operations JSON format that contains at least one of the add, remove, or replace operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2). Update can also be used to add group memberships.Group memberships can be sent one at a time or in batches for faster performance. **Note**: The memberships are referenced through a local user `id`, and the user will need to be created before they are referenced here. +// returns a *RequestInformation when successful +func (m *V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PatchSchemaable, 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/scim+json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPutRequestInformation > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Replaces an existing provisioned group’s information.You must provide all the information required for the group as if you were provisioning it for the first time. Any existing group information that you don't provide will be removed, including group membership. If you want to only update a specific attribute, use the [Update an attribute for a SCIM enterprise group](#update-an-attribute-for-a-scim-enterprise-group) endpoint instead. +// returns a *RequestInformation when successful +func (m *V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Groupable, 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/scim+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 *V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder when successful +func (m *V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder) WithUrl(rawUrl string)(*V2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder) { + return NewV2EnterprisesItemGroupsWithScim_group_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/scim/v2_enterprises_item_users_request_builder.go b/pkg/github/scim/v2_enterprises_item_users_request_builder.go new file mode 100644 index 00000000..63ba2643 --- /dev/null +++ b/pkg/github/scim/v2_enterprises_item_users_request_builder.go @@ -0,0 +1,125 @@ +package scim + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V2EnterprisesItemUsersRequestBuilder builds and executes requests for operations under \scim\v2\enterprises\{enterprise}\Users +type V2EnterprisesItemUsersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// V2EnterprisesItemUsersRequestBuilderGetQueryParameters > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Lists provisioned SCIM enterprise members.When a user with a SCIM-provisioned external identity is removed from an enterprise through a `patch` with `active` flag set to `false`, the account's metadata is preserved to allow the user to re-join the enterprise in the future. However, the user's account will be suspended and the user will not be able to sign-in. In order to permanently suspend the users account with no ability to re-join the enterprise in the future, use the `delete` request. Users that were not permanently deleted will be visible in the returned results. +type V2EnterprisesItemUsersRequestBuilderGetQueryParameters struct { + // Used for pagination: the number of results to return per page. + Count *int32 `uriparametername:"count"` + // If specified, only results that match the specified filter will be returned. Multiple filters are not supported. Possible filters are `userName`, `externalId`, `id`, and `displayName`. For example, `?filter="externalId eq '9138790-10932-109120392-12321'"`. + Filter *string `uriparametername:"filter"` + // Used for pagination: the starting index of the first result to return when paginating through values. + StartIndex *int32 `uriparametername:"startIndex"` +} +// ByScim_user_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.scim.v2.enterprises.item.Users.item collection +// returns a *V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder when successful +func (m *V2EnterprisesItemUsersRequestBuilder) ByScim_user_id(scim_user_id string)(*V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if scim_user_id != "" { + urlTplParams["scim_user_id"] = scim_user_id + } + return NewV2EnterprisesItemUsersWithScim_user_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewV2EnterprisesItemUsersRequestBuilderInternal instantiates a new V2EnterprisesItemUsersRequestBuilder and sets the default values. +func NewV2EnterprisesItemUsersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2EnterprisesItemUsersRequestBuilder) { + m := &V2EnterprisesItemUsersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/scim/v2/enterprises/{enterprise}/Users{?count*,filter*,startIndex*}", pathParameters), + } + return m +} +// NewV2EnterprisesItemUsersRequestBuilder instantiates a new V2EnterprisesItemUsersRequestBuilder and sets the default values. +func NewV2EnterprisesItemUsersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2EnterprisesItemUsersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV2EnterprisesItemUsersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Lists provisioned SCIM enterprise members.When a user with a SCIM-provisioned external identity is removed from an enterprise through a `patch` with `active` flag set to `false`, the account's metadata is preserved to allow the user to re-join the enterprise in the future. However, the user's account will be suspended and the user will not be able to sign-in. In order to permanently suspend the users account with no ability to re-join the enterprise in the future, use the `delete` request. Users that were not permanently deleted will be visible in the returned results. +// returns a ScimEnterpriseUserListable when successful +// returns a ScimError error when the service returns a 400 status code +// returns a ScimError error when the service returns a 429 status code +// returns a ScimError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/scim#list-scim-provisioned-identities-for-an-enterprise +func (m *V2EnterprisesItemUsersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V2EnterprisesItemUsersRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseUserListable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "429": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimEnterpriseUserListFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseUserListable), nil +} +// Post > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Creates an external identity for a new SCIM enterprise user.SCIM does not authenticate users, it only provisions them. The authentication of users is done by SAML. However, when SCIM is enabled, all users need to be provisioned through SCIM before a user can sign in through SAML. The matching of a user to a SCIM provisioned user is done when the SAML assertion is consumed. The user will be matched on SAML response `NameID` to SCIM `userName`.When converting existing enterprise to use SCIM, the user handle (`userName`) from the SCIM payload will be used to match the provisioned user to an already existing user in the enterprise. Since the new identity record is created for newly provisioned users the matching for those records is done using a user's handle. Currently the matching will be performed to all of the users no matter if they were SAML JIT provisioned or created as local users. +// returns a ScimEnterpriseUserResponseable when successful +// returns a ScimError error when the service returns a 400 status code +// returns a ScimError error when the service returns a 429 status code +// returns a ScimError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/scim#provision-a-scim-enterprise-user +func (m *V2EnterprisesItemUsersRequestBuilder) Post(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Userable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseUserResponseable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "429": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimEnterpriseUserResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseUserResponseable), nil +} +// ToGetRequestInformation > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Lists provisioned SCIM enterprise members.When a user with a SCIM-provisioned external identity is removed from an enterprise through a `patch` with `active` flag set to `false`, the account's metadata is preserved to allow the user to re-join the enterprise in the future. However, the user's account will be suspended and the user will not be able to sign-in. In order to permanently suspend the users account with no ability to re-join the enterprise in the future, use the `delete` request. Users that were not permanently deleted will be visible in the returned results. +// returns a *RequestInformation when successful +func (m *V2EnterprisesItemUsersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[V2EnterprisesItemUsersRequestBuilderGetQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.GET, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + requestInfo.Headers.TryAdd("Accept", "application/scim+json") + return requestInfo, nil +} +// ToPostRequestInformation > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Creates an external identity for a new SCIM enterprise user.SCIM does not authenticate users, it only provisions them. The authentication of users is done by SAML. However, when SCIM is enabled, all users need to be provisioned through SCIM before a user can sign in through SAML. The matching of a user to a SCIM provisioned user is done when the SAML assertion is consumed. The user will be matched on SAML response `NameID` to SCIM `userName`.When converting existing enterprise to use SCIM, the user handle (`userName`) from the SCIM payload will be used to match the provisioned user to an already existing user in the enterprise. Since the new identity record is created for newly provisioned users the matching for those records is done using a user's handle. Currently the matching will be performed to all of the users no matter if they were SAML JIT provisioned or created as local users. +// returns a *RequestInformation when successful +func (m *V2EnterprisesItemUsersRequestBuilder) ToPostRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Userable, 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/scim+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 *V2EnterprisesItemUsersRequestBuilder when successful +func (m *V2EnterprisesItemUsersRequestBuilder) WithUrl(rawUrl string)(*V2EnterprisesItemUsersRequestBuilder) { + return NewV2EnterprisesItemUsersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/scim/v2_enterprises_item_users_with_scim_escaped_user_escaped_item_request_builder.go b/pkg/github/scim/v2_enterprises_item_users_with_scim_escaped_user_escaped_item_request_builder.go new file mode 100644 index 00000000..11f29c25 --- /dev/null +++ b/pkg/github/scim/v2_enterprises_item_users_with_scim_escaped_user_escaped_item_request_builder.go @@ -0,0 +1,182 @@ +package scim + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder builds and executes requests for operations under \scim\v2\enterprises\{enterprise}\Users\{scim_user_id} +type V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewV2EnterprisesItemUsersWithScim_user_ItemRequestBuilderInternal instantiates a new V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder and sets the default values. +func NewV2EnterprisesItemUsersWithScim_user_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder) { + m := &V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/scim/v2/enterprises/{enterprise}/Users/{scim_user_id}", pathParameters), + } + return m +} +// NewV2EnterprisesItemUsersWithScim_user_ItemRequestBuilder instantiates a new V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder and sets the default values. +func NewV2EnterprisesItemUsersWithScim_user_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV2EnterprisesItemUsersWithScim_user_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Permanently suspends a SCIM user from an enterprise, removes all data for the user, obfuscates the login, email, and display name of the user, removes all external-identity SCIM attributes, and deletes the emails, avatar, PATs, SSH keys, OAuth authorizations credentials, GPG keys, and SAML mappings for the user. You will not be able to undo this action. +// returns a ScimError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ScimError error when the service returns a 429 status code +// returns a ScimError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/scim#delete-a-scim-user-from-an-enterprise +func (m *V2EnterprisesItemUsersWithScim_user_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": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "429": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Gets information about a SCIM user. +// returns a ScimEnterpriseUserResponseable when successful +// returns a ScimError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ScimError error when the service returns a 429 status code +// returns a ScimError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/scim#get-scim-provisioning-information-for-an-enterprise-user +func (m *V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseUserResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "429": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimEnterpriseUserResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseUserResponseable), nil +} +// Patch > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Update a provisioned user's individual attributes.To change a user's values, you must provide a specific `Operations` JSON format that contains at least one of the `add`, `remove`, or `replace` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2).> [!NOTE]> Complicated SCIM `path` selectors that include filters are not supported. For example, a `path` selector defined as `"path": "emails[type eq \"work\"]"` will not work.> [!WARNING]> Setting `active: false` will suspend a user and obfuscate the user handle and user email. Since the implementation is a generic SCIM implementation and does not differentiate yet between different IdP providers, for Okta, the user GDPR data will not be purged and the credentials will not be removed.> ```> {> "Operations":[{> "op":"replace",> "value":{> "active":false> }> }]> }> ``` +// returns a ScimEnterpriseUserResponseable when successful +// returns a ScimError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ScimError error when the service returns a 429 status code +// returns a ScimError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/scim#update-an-attribute-for-a-scim-enterprise-user +func (m *V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder) Patch(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PatchSchemaable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseUserResponseable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "429": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimEnterpriseUserResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseUserResponseable), nil +} +// Put > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Replaces an existing provisioned user's information.You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](#update-an-attribute-for-a-scim-enterprise-user) endpoint instead.> [!WARNING]> Setting `active: false` will suspend a user and obfuscate the user handle and user email. Since the implementation is a generic SCIM implementation and does not differentiate yet between different IdP providers, for Okta, the user GDPR data will not be purged and the credentials will not be removed. +// returns a ScimEnterpriseUserResponseable when successful +// returns a ScimError error when the service returns a 400 status code +// returns a BasicError error when the service returns a 404 status code +// returns a ScimError error when the service returns a 429 status code +// returns a ScimError error when the service returns a 500 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/scim#set-scim-information-for-a-provisioned-enterprise-user +func (m *V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder) Put(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Userable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseUserResponseable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "429": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + "500": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateScimEnterpriseUserResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ScimEnterpriseUserResponseable), nil +} +// ToDeleteRequestInformation > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Permanently suspends a SCIM user from an enterprise, removes all data for the user, obfuscates the login, email, and display name of the user, removes all external-identity SCIM attributes, and deletes the emails, avatar, PATs, SSH keys, OAuth authorizations credentials, GPG keys, and SAML mappings for the user. You will not be able to undo this action. +// returns a *RequestInformation when successful +func (m *V2EnterprisesItemUsersWithScim_user_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 > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Gets information about a SCIM user. +// returns a *RequestInformation when successful +func (m *V2EnterprisesItemUsersWithScim_user_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/scim+json") + return requestInfo, nil +} +// ToPatchRequestInformation > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Update a provisioned user's individual attributes.To change a user's values, you must provide a specific `Operations` JSON format that contains at least one of the `add`, `remove`, or `replace` operations. For examples and more information on the SCIM operations format, see the [SCIM specification](https://tools.ietf.org/html/rfc7644#section-3.5.2).> [!NOTE]> Complicated SCIM `path` selectors that include filters are not supported. For example, a `path` selector defined as `"path": "emails[type eq \"work\"]"` will not work.> [!WARNING]> Setting `active: false` will suspend a user and obfuscate the user handle and user email. Since the implementation is a generic SCIM implementation and does not differentiate yet between different IdP providers, for Okta, the user GDPR data will not be purged and the credentials will not be removed.> ```> {> "Operations":[{> "op":"replace",> "value":{> "active":false> }> }]> }> ``` +// returns a *RequestInformation when successful +func (m *V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PatchSchemaable, 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/scim+json") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPutRequestInformation > [!NOTE]> The SCIM API endpoints for enterprise accounts are currently in *private* beta and are subject to change.Replaces an existing provisioned user's information.You must provide all the information required for the user as if you were provisioning them for the first time. Any existing user information that you don't provide will be removed. If you want to only update a specific attribute, use the [Update an attribute for a SCIM user](#update-an-attribute-for-a-scim-enterprise-user) endpoint instead.> [!WARNING]> Setting `active: false` will suspend a user and obfuscate the user handle and user email. Since the implementation is a generic SCIM implementation and does not differentiate yet between different IdP providers, for Okta, the user GDPR data will not be purged and the credentials will not be removed. +// returns a *RequestInformation when successful +func (m *V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Userable, 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/scim+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 *V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder when successful +func (m *V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder) WithUrl(rawUrl string)(*V2EnterprisesItemUsersWithScim_user_ItemRequestBuilder) { + return NewV2EnterprisesItemUsersWithScim_user_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/scim/v2_enterprises_request_builder.go b/pkg/github/scim/v2_enterprises_request_builder.go new file mode 100644 index 00000000..75a5f1cb --- /dev/null +++ b/pkg/github/scim/v2_enterprises_request_builder.go @@ -0,0 +1,35 @@ +package scim + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// V2EnterprisesRequestBuilder builds and executes requests for operations under \scim\v2\enterprises +type V2EnterprisesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByEnterprise gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.scim.v2.enterprises.item collection +// returns a *V2EnterprisesWithEnterpriseItemRequestBuilder when successful +func (m *V2EnterprisesRequestBuilder) ByEnterprise(enterprise string)(*V2EnterprisesWithEnterpriseItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if enterprise != "" { + urlTplParams["enterprise"] = enterprise + } + return NewV2EnterprisesWithEnterpriseItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewV2EnterprisesRequestBuilderInternal instantiates a new V2EnterprisesRequestBuilder and sets the default values. +func NewV2EnterprisesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2EnterprisesRequestBuilder) { + m := &V2EnterprisesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/scim/v2/enterprises", pathParameters), + } + return m +} +// NewV2EnterprisesRequestBuilder instantiates a new V2EnterprisesRequestBuilder and sets the default values. +func NewV2EnterprisesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2EnterprisesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV2EnterprisesRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/scim/v2_enterprises_with_enterprise_item_request_builder.go b/pkg/github/scim/v2_enterprises_with_enterprise_item_request_builder.go new file mode 100644 index 00000000..e0022b43 --- /dev/null +++ b/pkg/github/scim/v2_enterprises_with_enterprise_item_request_builder.go @@ -0,0 +1,33 @@ +package scim + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// V2EnterprisesWithEnterpriseItemRequestBuilder builds and executes requests for operations under \scim\v2\enterprises\{enterprise} +type V2EnterprisesWithEnterpriseItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewV2EnterprisesWithEnterpriseItemRequestBuilderInternal instantiates a new V2EnterprisesWithEnterpriseItemRequestBuilder and sets the default values. +func NewV2EnterprisesWithEnterpriseItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2EnterprisesWithEnterpriseItemRequestBuilder) { + m := &V2EnterprisesWithEnterpriseItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/scim/v2/enterprises/{enterprise}", pathParameters), + } + return m +} +// NewV2EnterprisesWithEnterpriseItemRequestBuilder instantiates a new V2EnterprisesWithEnterpriseItemRequestBuilder and sets the default values. +func NewV2EnterprisesWithEnterpriseItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2EnterprisesWithEnterpriseItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV2EnterprisesWithEnterpriseItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Groups the Groups property +// returns a *V2EnterprisesItemGroupsRequestBuilder when successful +func (m *V2EnterprisesWithEnterpriseItemRequestBuilder) Groups()(*V2EnterprisesItemGroupsRequestBuilder) { + return NewV2EnterprisesItemGroupsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Users the Users property +// returns a *V2EnterprisesItemUsersRequestBuilder when successful +func (m *V2EnterprisesWithEnterpriseItemRequestBuilder) Users()(*V2EnterprisesItemUsersRequestBuilder) { + return NewV2EnterprisesItemUsersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/scim/v2_request_builder.go b/pkg/github/scim/v2_request_builder.go new file mode 100644 index 00000000..bd4fc8af --- /dev/null +++ b/pkg/github/scim/v2_request_builder.go @@ -0,0 +1,28 @@ +package scim + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// V2RequestBuilder builds and executes requests for operations under \scim\v2 +type V2RequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewV2RequestBuilderInternal instantiates a new V2RequestBuilder and sets the default values. +func NewV2RequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2RequestBuilder) { + m := &V2RequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/scim/v2", pathParameters), + } + return m +} +// NewV2RequestBuilder instantiates a new V2RequestBuilder and sets the default values. +func NewV2RequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*V2RequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewV2RequestBuilderInternal(urlParams, requestAdapter) +} +// Enterprises the enterprises property +// returns a *V2EnterprisesRequestBuilder when successful +func (m *V2RequestBuilder) Enterprises()(*V2EnterprisesRequestBuilder) { + return NewV2EnterprisesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/search/code/get_order_query_parameter_type.go b/pkg/github/search/code/get_order_query_parameter_type.go new file mode 100644 index 00000000..56abb0a2 --- /dev/null +++ b/pkg/github/search/code/get_order_query_parameter_type.go @@ -0,0 +1,33 @@ +package code +type GetOrderQueryParameterType int + +const ( + DESC_GETORDERQUERYPARAMETERTYPE GetOrderQueryParameterType = iota + ASC_GETORDERQUERYPARAMETERTYPE +) + +func (i GetOrderQueryParameterType) String() string { + return []string{"desc", "asc"}[i] +} +func ParseGetOrderQueryParameterType(v string) (any, error) { + result := DESC_GETORDERQUERYPARAMETERTYPE + switch v { + case "desc": + result = DESC_GETORDERQUERYPARAMETERTYPE + case "asc": + result = ASC_GETORDERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetOrderQueryParameterType(values []GetOrderQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetOrderQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/search/code/get_sort_query_parameter_type.go b/pkg/github/search/code/get_sort_query_parameter_type.go new file mode 100644 index 00000000..5c25337e --- /dev/null +++ b/pkg/github/search/code/get_sort_query_parameter_type.go @@ -0,0 +1,30 @@ +package code +type GetSortQueryParameterType int + +const ( + INDEXED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota +) + +func (i GetSortQueryParameterType) String() string { + return []string{"indexed"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := INDEXED_GETSORTQUERYPARAMETERTYPE + switch v { + case "indexed": + result = INDEXED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/search/code_get_response.go b/pkg/github/search/code_get_response.go new file mode 100644 index 00000000..2a36a774 --- /dev/null +++ b/pkg/github/search/code_get_response.go @@ -0,0 +1,151 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type CodeGetResponse 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 incomplete_results property + incomplete_results *bool + // The items property + items []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeSearchResultItemable + // The total_count property + total_count *int32 +} +// NewCodeGetResponse instantiates a new CodeGetResponse and sets the default values. +func NewCodeGetResponse()(*CodeGetResponse) { + m := &CodeGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCodeGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCodeGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCodeGetResponse(), 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 *CodeGetResponse) 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 *CodeGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["incomplete_results"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncompleteResults(val) + } + return nil + } + res["items"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCodeSearchResultItemFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeSearchResultItemable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeSearchResultItemable) + } + } + m.SetItems(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 +} +// GetIncompleteResults gets the incomplete_results property value. The incomplete_results property +// returns a *bool when successful +func (m *CodeGetResponse) GetIncompleteResults()(*bool) { + return m.incomplete_results +} +// GetItems gets the items property value. The items property +// returns a []CodeSearchResultItemable when successful +func (m *CodeGetResponse) GetItems()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeSearchResultItemable) { + return m.items +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *CodeGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *CodeGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("incomplete_results", m.GetIncompleteResults()) + if err != nil { + return err + } + } + if m.GetItems() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItems())) + for i, v := range m.GetItems() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("items", 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 *CodeGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncompleteResults sets the incomplete_results property value. The incomplete_results property +func (m *CodeGetResponse) SetIncompleteResults(value *bool)() { + m.incomplete_results = value +} +// SetItems sets the items property value. The items property +func (m *CodeGetResponse) SetItems(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeSearchResultItemable)() { + m.items = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *CodeGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type CodeGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncompleteResults()(*bool) + GetItems()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeSearchResultItemable) + GetTotalCount()(*int32) + SetIncompleteResults(value *bool)() + SetItems(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CodeSearchResultItemable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/search/code_request_builder.go b/pkg/github/search/code_request_builder.go new file mode 100644 index 00000000..c1729fb4 --- /dev/null +++ b/pkg/github/search/code_request_builder.go @@ -0,0 +1,79 @@ +package search + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i2ba3707baaa564addcdb9907e1bc8337d35e614220a37fe7e77711dc059aca3f "github.com/octokit/go-sdk-enterprise-server/pkg/github/search/code" +) + +// CodeRequestBuilder builds and executes requests for operations under \search\code +type CodeRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// CodeRequestBuilderGetQueryParameters searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this:`q=addClass+in:file+language:js+repo:jquery/jquery`This query searches for the keyword `addClass` within a file's contents. The query limits the search to files where the language is JavaScript in the `jquery/jquery` repository.Considerations for code search:Due to the complexity of searching code, there are a few restrictions on how searches are performed:* Only the _default branch_ is considered. In most cases, this will be the `master` branch.* Only files smaller than 384 KB are searchable.* You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazinglanguage:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. +type CodeRequestBuilderGetQueryParameters struct { + // Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + Order *i2ba3707baaa564addcdb9907e1bc8337d35e614220a37fe7e77711dc059aca3f.GetOrderQueryParameterType `uriparametername:"order"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub Enterprise Server. The REST API supports the same qualifiers as the web interface for GitHub Enterprise Server. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.14/rest/search/search#constructing-a-search-query). See "[Searching code](https://docs.github.com/enterprise-server@3.14/search-github/searching-on-github/searching-code)" for a detailed list of qualifiers. + Q *string `uriparametername:"q"` + // Sorts the results of your query. Can only be `indexed`, which indicates how recently a file has been indexed by the GitHub Enterprise Server search infrastructure. Default: [best match](https://docs.github.com/enterprise-server@3.14/rest/search/search#ranking-search-results) + Sort *i2ba3707baaa564addcdb9907e1bc8337d35e614220a37fe7e77711dc059aca3f.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewCodeRequestBuilderInternal instantiates a new CodeRequestBuilder and sets the default values. +func NewCodeRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodeRequestBuilder) { + m := &CodeRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search/code?q={q}{&order*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewCodeRequestBuilder instantiates a new CodeRequestBuilder and sets the default values. +func NewCodeRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CodeRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCodeRequestBuilderInternal(urlParams, requestAdapter) +} +// Get searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this:`q=addClass+in:file+language:js+repo:jquery/jquery`This query searches for the keyword `addClass` within a file's contents. The query limits the search to files where the language is JavaScript in the `jquery/jquery` repository.Considerations for code search:Due to the complexity of searching code, there are a few restrictions on how searches are performed:* Only the _default branch_ is considered. In most cases, this will be the `master` branch.* Only files smaller than 384 KB are searchable.* You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazinglanguage:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. +// returns a CodeGetResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a Code503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/search/search#search-code +func (m *CodeRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[CodeRequestBuilderGetQueryParameters])(CodeGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCode503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateCodeGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(CodeGetResponseable), nil +} +// ToGetRequestInformation searches for query terms inside of a file. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for code, you can get text match metadata for the file **content** and file **path** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to find the definition of the `addClass` function inside [jQuery](https://github.com/jquery/jquery) repository, your query would look something like this:`q=addClass+in:file+language:js+repo:jquery/jquery`This query searches for the keyword `addClass` within a file's contents. The query limits the search to files where the language is JavaScript in the `jquery/jquery` repository.Considerations for code search:Due to the complexity of searching code, there are a few restrictions on how searches are performed:* Only the _default branch_ is considered. In most cases, this will be the `master` branch.* Only files smaller than 384 KB are searchable.* You must always include at least one search term when searching source code. For example, searching for [`language:go`](https://github.com/search?utf8=%E2%9C%93&q=language%3Ago&type=Code) is not valid, while [`amazinglanguage:go`](https://github.com/search?utf8=%E2%9C%93&q=amazing+language%3Ago&type=Code) is. +// returns a *RequestInformation when successful +func (m *CodeRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[CodeRequestBuilderGetQueryParameters])(*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 *CodeRequestBuilder when successful +func (m *CodeRequestBuilder) WithUrl(rawUrl string)(*CodeRequestBuilder) { + return NewCodeRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/search/commits/get_order_query_parameter_type.go b/pkg/github/search/commits/get_order_query_parameter_type.go new file mode 100644 index 00000000..a59bfc97 --- /dev/null +++ b/pkg/github/search/commits/get_order_query_parameter_type.go @@ -0,0 +1,33 @@ +package commits +type GetOrderQueryParameterType int + +const ( + DESC_GETORDERQUERYPARAMETERTYPE GetOrderQueryParameterType = iota + ASC_GETORDERQUERYPARAMETERTYPE +) + +func (i GetOrderQueryParameterType) String() string { + return []string{"desc", "asc"}[i] +} +func ParseGetOrderQueryParameterType(v string) (any, error) { + result := DESC_GETORDERQUERYPARAMETERTYPE + switch v { + case "desc": + result = DESC_GETORDERQUERYPARAMETERTYPE + case "asc": + result = ASC_GETORDERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetOrderQueryParameterType(values []GetOrderQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetOrderQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/search/commits/get_sort_query_parameter_type.go b/pkg/github/search/commits/get_sort_query_parameter_type.go new file mode 100644 index 00000000..d29417be --- /dev/null +++ b/pkg/github/search/commits/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package commits +type GetSortQueryParameterType int + +const ( + AUTHORDATE_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + COMMITTERDATE_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"author-date", "committer-date"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := AUTHORDATE_GETSORTQUERYPARAMETERTYPE + switch v { + case "author-date": + result = AUTHORDATE_GETSORTQUERYPARAMETERTYPE + case "committer-date": + result = COMMITTERDATE_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/search/commits_get_response.go b/pkg/github/search/commits_get_response.go new file mode 100644 index 00000000..196c3837 --- /dev/null +++ b/pkg/github/search/commits_get_response.go @@ -0,0 +1,151 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type CommitsGetResponse 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 incomplete_results property + incomplete_results *bool + // The items property + items []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitSearchResultItemable + // The total_count property + total_count *int32 +} +// NewCommitsGetResponse instantiates a new CommitsGetResponse and sets the default values. +func NewCommitsGetResponse()(*CommitsGetResponse) { + m := &CommitsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateCommitsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateCommitsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewCommitsGetResponse(), 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 *CommitsGetResponse) 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 *CommitsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["incomplete_results"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncompleteResults(val) + } + return nil + } + res["items"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateCommitSearchResultItemFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitSearchResultItemable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitSearchResultItemable) + } + } + m.SetItems(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 +} +// GetIncompleteResults gets the incomplete_results property value. The incomplete_results property +// returns a *bool when successful +func (m *CommitsGetResponse) GetIncompleteResults()(*bool) { + return m.incomplete_results +} +// GetItems gets the items property value. The items property +// returns a []CommitSearchResultItemable when successful +func (m *CommitsGetResponse) GetItems()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitSearchResultItemable) { + return m.items +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *CommitsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *CommitsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("incomplete_results", m.GetIncompleteResults()) + if err != nil { + return err + } + } + if m.GetItems() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItems())) + for i, v := range m.GetItems() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("items", 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 *CommitsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncompleteResults sets the incomplete_results property value. The incomplete_results property +func (m *CommitsGetResponse) SetIncompleteResults(value *bool)() { + m.incomplete_results = value +} +// SetItems sets the items property value. The items property +func (m *CommitsGetResponse) SetItems(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitSearchResultItemable)() { + m.items = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *CommitsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type CommitsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncompleteResults()(*bool) + GetItems()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitSearchResultItemable) + GetTotalCount()(*int32) + SetIncompleteResults(value *bool)() + SetItems(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CommitSearchResultItemable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/search/commits_request_builder.go b/pkg/github/search/commits_request_builder.go new file mode 100644 index 00000000..b347e007 --- /dev/null +++ b/pkg/github/search/commits_request_builder.go @@ -0,0 +1,70 @@ +package search + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i3a5de3f5f2a51975580fc1f7663601261dc5a6ac1f8616e88fbcdbb5ac387377 "github.com/octokit/go-sdk-enterprise-server/pkg/github/search/commits" +) + +// CommitsRequestBuilder builds and executes requests for operations under \search\commits +type CommitsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// CommitsRequestBuilderGetQueryParameters find commits via various criteria on the default branch (usually `main`). This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text matchmetadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this:`q=repo:octocat/Spoon-Knife+css` +type CommitsRequestBuilderGetQueryParameters struct { + // Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + Order *i3a5de3f5f2a51975580fc1f7663601261dc5a6ac1f8616e88fbcdbb5ac387377.GetOrderQueryParameterType `uriparametername:"order"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub Enterprise Server. The REST API supports the same qualifiers as the web interface for GitHub Enterprise Server. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.14/rest/search/search#constructing-a-search-query). See "[Searching commits](https://docs.github.com/enterprise-server@3.14/search-github/searching-on-github/searching-commits)" for a detailed list of qualifiers. + Q *string `uriparametername:"q"` + // Sorts the results of your query by `author-date` or `committer-date`. Default: [best match](https://docs.github.com/enterprise-server@3.14/rest/search/search#ranking-search-results) + Sort *i3a5de3f5f2a51975580fc1f7663601261dc5a6ac1f8616e88fbcdbb5ac387377.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewCommitsRequestBuilderInternal instantiates a new CommitsRequestBuilder and sets the default values. +func NewCommitsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CommitsRequestBuilder) { + m := &CommitsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search/commits?q={q}{&order*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewCommitsRequestBuilder instantiates a new CommitsRequestBuilder and sets the default values. +func NewCommitsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*CommitsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewCommitsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get find commits via various criteria on the default branch (usually `main`). This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text matchmetadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this:`q=repo:octocat/Spoon-Knife+css` +// returns a CommitsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/search/search#search-commits +func (m *CommitsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[CommitsRequestBuilderGetQueryParameters])(CommitsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateCommitsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(CommitsGetResponseable), nil +} +// ToGetRequestInformation find commits via various criteria on the default branch (usually `main`). This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for commits, you can get text match metadata for the **message** field when you provide the `text-match` media type. For more details about how to receive highlighted search results, see [Text matchmetadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to find commits related to CSS in the [octocat/Spoon-Knife](https://github.com/octocat/Spoon-Knife) repository. Your query would look something like this:`q=repo:octocat/Spoon-Knife+css` +// returns a *RequestInformation when successful +func (m *CommitsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[CommitsRequestBuilderGetQueryParameters])(*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 *CommitsRequestBuilder when successful +func (m *CommitsRequestBuilder) WithUrl(rawUrl string)(*CommitsRequestBuilder) { + return NewCommitsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/search/issues/get_order_query_parameter_type.go b/pkg/github/search/issues/get_order_query_parameter_type.go new file mode 100644 index 00000000..a68b72e6 --- /dev/null +++ b/pkg/github/search/issues/get_order_query_parameter_type.go @@ -0,0 +1,33 @@ +package issues +type GetOrderQueryParameterType int + +const ( + DESC_GETORDERQUERYPARAMETERTYPE GetOrderQueryParameterType = iota + ASC_GETORDERQUERYPARAMETERTYPE +) + +func (i GetOrderQueryParameterType) String() string { + return []string{"desc", "asc"}[i] +} +func ParseGetOrderQueryParameterType(v string) (any, error) { + result := DESC_GETORDERQUERYPARAMETERTYPE + switch v { + case "desc": + result = DESC_GETORDERQUERYPARAMETERTYPE + case "asc": + result = ASC_GETORDERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetOrderQueryParameterType(values []GetOrderQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetOrderQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/search/issues/get_sort_query_parameter_type.go b/pkg/github/search/issues/get_sort_query_parameter_type.go new file mode 100644 index 00000000..5fcfb629 --- /dev/null +++ b/pkg/github/search/issues/get_sort_query_parameter_type.go @@ -0,0 +1,60 @@ +package issues +type GetSortQueryParameterType int + +const ( + COMMENTS_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + REACTIONS_GETSORTQUERYPARAMETERTYPE + REACTIONS_PLUS_1_GETSORTQUERYPARAMETERTYPE + REACTIONS1_GETSORTQUERYPARAMETERTYPE + REACTIONSSMILE_GETSORTQUERYPARAMETERTYPE + REACTIONSTHINKING_FACE_GETSORTQUERYPARAMETERTYPE + REACTIONSHEART_GETSORTQUERYPARAMETERTYPE + REACTIONSTADA_GETSORTQUERYPARAMETERTYPE + INTERACTIONS_GETSORTQUERYPARAMETERTYPE + CREATED_GETSORTQUERYPARAMETERTYPE + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"comments", "reactions", "reactions-+1", "reactions--1", "reactions-smile", "reactions-thinking_face", "reactions-heart", "reactions-tada", "interactions", "created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := COMMENTS_GETSORTQUERYPARAMETERTYPE + switch v { + case "comments": + result = COMMENTS_GETSORTQUERYPARAMETERTYPE + case "reactions": + result = REACTIONS_GETSORTQUERYPARAMETERTYPE + case "reactions-+1": + result = REACTIONS_PLUS_1_GETSORTQUERYPARAMETERTYPE + case "reactions--1": + result = REACTIONS1_GETSORTQUERYPARAMETERTYPE + case "reactions-smile": + result = REACTIONSSMILE_GETSORTQUERYPARAMETERTYPE + case "reactions-thinking_face": + result = REACTIONSTHINKING_FACE_GETSORTQUERYPARAMETERTYPE + case "reactions-heart": + result = REACTIONSHEART_GETSORTQUERYPARAMETERTYPE + case "reactions-tada": + result = REACTIONSTADA_GETSORTQUERYPARAMETERTYPE + case "interactions": + result = INTERACTIONS_GETSORTQUERYPARAMETERTYPE + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/search/issues_get_response.go b/pkg/github/search/issues_get_response.go new file mode 100644 index 00000000..09d39b0c --- /dev/null +++ b/pkg/github/search/issues_get_response.go @@ -0,0 +1,151 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type IssuesGetResponse 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 incomplete_results property + incomplete_results *bool + // The items property + items []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueSearchResultItemable + // The total_count property + total_count *int32 +} +// NewIssuesGetResponse instantiates a new IssuesGetResponse and sets the default values. +func NewIssuesGetResponse()(*IssuesGetResponse) { + m := &IssuesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateIssuesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateIssuesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewIssuesGetResponse(), 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 *IssuesGetResponse) 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 *IssuesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["incomplete_results"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncompleteResults(val) + } + return nil + } + res["items"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueSearchResultItemFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueSearchResultItemable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueSearchResultItemable) + } + } + m.SetItems(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 +} +// GetIncompleteResults gets the incomplete_results property value. The incomplete_results property +// returns a *bool when successful +func (m *IssuesGetResponse) GetIncompleteResults()(*bool) { + return m.incomplete_results +} +// GetItems gets the items property value. The items property +// returns a []IssueSearchResultItemable when successful +func (m *IssuesGetResponse) GetItems()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueSearchResultItemable) { + return m.items +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *IssuesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *IssuesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("incomplete_results", m.GetIncompleteResults()) + if err != nil { + return err + } + } + if m.GetItems() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItems())) + for i, v := range m.GetItems() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("items", 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 *IssuesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncompleteResults sets the incomplete_results property value. The incomplete_results property +func (m *IssuesGetResponse) SetIncompleteResults(value *bool)() { + m.incomplete_results = value +} +// SetItems sets the items property value. The items property +func (m *IssuesGetResponse) SetItems(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueSearchResultItemable)() { + m.items = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *IssuesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type IssuesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncompleteResults()(*bool) + GetItems()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueSearchResultItemable) + GetTotalCount()(*int32) + SetIncompleteResults(value *bool)() + SetItems(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.IssueSearchResultItemable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/search/issues_request_builder.go b/pkg/github/search/issues_request_builder.go new file mode 100644 index 00000000..58372119 --- /dev/null +++ b/pkg/github/search/issues_request_builder.go @@ -0,0 +1,79 @@ +package search + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + iaff4441ad75fc7bc6037e7836ce0e101f06cf4c04ad20d0918be9fe81c36145f "github.com/octokit/go-sdk-enterprise-server/pkg/github/search/issues" +) + +// IssuesRequestBuilder builds and executes requests for operations under \search\issues +type IssuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// IssuesRequestBuilderGetQueryParameters find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlightedsearch results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this.`q=windows+label:bug+language:python+state:open&sort=created&order=asc`This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results.> [!NOTE]> For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/enterprise-server@3.14/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." +type IssuesRequestBuilderGetQueryParameters struct { + // Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + Order *iaff4441ad75fc7bc6037e7836ce0e101f06cf4c04ad20d0918be9fe81c36145f.GetOrderQueryParameterType `uriparametername:"order"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub Enterprise Server. The REST API supports the same qualifiers as the web interface for GitHub Enterprise Server. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.14/rest/search/search#constructing-a-search-query). See "[Searching issues and pull requests](https://docs.github.com/enterprise-server@3.14/search-github/searching-on-github/searching-issues-and-pull-requests)" for a detailed list of qualifiers. + Q *string `uriparametername:"q"` + // Sorts the results of your query by the number of `comments`, `reactions`, `reactions-+1`, `reactions--1`, `reactions-smile`, `reactions-thinking_face`, `reactions-heart`, `reactions-tada`, or `interactions`. You can also sort results by how recently the items were `created` or `updated`, Default: [best match](https://docs.github.com/enterprise-server@3.14/rest/search/search#ranking-search-results) + Sort *iaff4441ad75fc7bc6037e7836ce0e101f06cf4c04ad20d0918be9fe81c36145f.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewIssuesRequestBuilderInternal instantiates a new IssuesRequestBuilder and sets the default values. +func NewIssuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IssuesRequestBuilder) { + m := &IssuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search/issues?q={q}{&order*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewIssuesRequestBuilder instantiates a new IssuesRequestBuilder and sets the default values. +func NewIssuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IssuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewIssuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlightedsearch results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this.`q=windows+label:bug+language:python+state:open&sort=created&order=asc`This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results.> [!NOTE]> For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/enterprise-server@3.14/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." +// returns a IssuesGetResponseable when successful +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// returns a Issues503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/search/search#search-issues-and-pull-requests +func (m *IssuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[IssuesRequestBuilderGetQueryParameters])(IssuesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssues503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateIssuesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(IssuesGetResponseable), nil +} +// ToGetRequestInformation find issues by state and keyword. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for issues, you can get text match metadata for the issue **title**, issue **body**, and issue **comment body** fields when you pass the `text-match` media type. For more details about how to receive highlightedsearch results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to find the oldest unresolved Python bugs on Windows. Your query might look something like this.`q=windows+label:bug+language:python+state:open&sort=created&order=asc`This query searches for the keyword `windows`, within any open issue that is labeled as `bug`. The search runs across repositories whose primary language is Python. The results are sorted by creation date in ascending order, which means the oldest issues appear first in the search results.> [!NOTE]> For requests made by GitHub Apps with a user access token, you can't retrieve a combination of issues and pull requests in a single query. Requests that don't include the `is:issue` or `is:pull-request` qualifier will receive an HTTP `422 Unprocessable Entity` response. To get results for both issues and pull requests, you must send separate queries for issues and pull requests. For more information about the `is` qualifier, see "[Searching only issues or pull requests](https://docs.github.com/enterprise-server@3.14/github/searching-for-information-on-github/searching-issues-and-pull-requests#search-only-issues-or-pull-requests)." +// returns a *RequestInformation when successful +func (m *IssuesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[IssuesRequestBuilderGetQueryParameters])(*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 *IssuesRequestBuilder when successful +func (m *IssuesRequestBuilder) WithUrl(rawUrl string)(*IssuesRequestBuilder) { + return NewIssuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/search/labels/get_order_query_parameter_type.go b/pkg/github/search/labels/get_order_query_parameter_type.go new file mode 100644 index 00000000..a4360f92 --- /dev/null +++ b/pkg/github/search/labels/get_order_query_parameter_type.go @@ -0,0 +1,33 @@ +package labels +type GetOrderQueryParameterType int + +const ( + DESC_GETORDERQUERYPARAMETERTYPE GetOrderQueryParameterType = iota + ASC_GETORDERQUERYPARAMETERTYPE +) + +func (i GetOrderQueryParameterType) String() string { + return []string{"desc", "asc"}[i] +} +func ParseGetOrderQueryParameterType(v string) (any, error) { + result := DESC_GETORDERQUERYPARAMETERTYPE + switch v { + case "desc": + result = DESC_GETORDERQUERYPARAMETERTYPE + case "asc": + result = ASC_GETORDERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetOrderQueryParameterType(values []GetOrderQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetOrderQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/search/labels/get_sort_query_parameter_type.go b/pkg/github/search/labels/get_sort_query_parameter_type.go new file mode 100644 index 00000000..b2442a79 --- /dev/null +++ b/pkg/github/search/labels/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package labels +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/search/labels_get_response.go b/pkg/github/search/labels_get_response.go new file mode 100644 index 00000000..8ba6fd96 --- /dev/null +++ b/pkg/github/search/labels_get_response.go @@ -0,0 +1,151 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type LabelsGetResponse 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 incomplete_results property + incomplete_results *bool + // The items property + items []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LabelSearchResultItemable + // The total_count property + total_count *int32 +} +// NewLabelsGetResponse instantiates a new LabelsGetResponse and sets the default values. +func NewLabelsGetResponse()(*LabelsGetResponse) { + m := &LabelsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateLabelsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateLabelsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewLabelsGetResponse(), 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 *LabelsGetResponse) 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 *LabelsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["incomplete_results"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncompleteResults(val) + } + return nil + } + res["items"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateLabelSearchResultItemFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LabelSearchResultItemable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LabelSearchResultItemable) + } + } + m.SetItems(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 +} +// GetIncompleteResults gets the incomplete_results property value. The incomplete_results property +// returns a *bool when successful +func (m *LabelsGetResponse) GetIncompleteResults()(*bool) { + return m.incomplete_results +} +// GetItems gets the items property value. The items property +// returns a []LabelSearchResultItemable when successful +func (m *LabelsGetResponse) GetItems()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LabelSearchResultItemable) { + return m.items +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *LabelsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *LabelsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("incomplete_results", m.GetIncompleteResults()) + if err != nil { + return err + } + } + if m.GetItems() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItems())) + for i, v := range m.GetItems() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("items", 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 *LabelsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncompleteResults sets the incomplete_results property value. The incomplete_results property +func (m *LabelsGetResponse) SetIncompleteResults(value *bool)() { + m.incomplete_results = value +} +// SetItems sets the items property value. The items property +func (m *LabelsGetResponse) SetItems(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LabelSearchResultItemable)() { + m.items = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *LabelsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type LabelsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncompleteResults()(*bool) + GetItems()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LabelSearchResultItemable) + GetTotalCount()(*int32) + SetIncompleteResults(value *bool)() + SetItems(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.LabelSearchResultItemable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/search/labels_request_builder.go b/pkg/github/search/labels_request_builder.go new file mode 100644 index 00000000..7170389d --- /dev/null +++ b/pkg/github/search/labels_request_builder.go @@ -0,0 +1,81 @@ +package search + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + idd449cb339067dcbe7f356e27ad0eb7896e269f3de801e791658c4c63534d1e1 "github.com/octokit/go-sdk-enterprise-server/pkg/github/search/labels" +) + +// LabelsRequestBuilder builds and executes requests for operations under \search\labels +type LabelsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// LabelsRequestBuilderGetQueryParameters find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this:`q=bug+defect+enhancement&repository_id=64778136`The labels that best match the query appear first in the search results. +type LabelsRequestBuilderGetQueryParameters struct { + // Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + Order *idd449cb339067dcbe7f356e27ad0eb7896e269f3de801e791658c4c63534d1e1.GetOrderQueryParameterType `uriparametername:"order"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The search keywords. This endpoint does not accept qualifiers in the query. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.14/rest/search/search#constructing-a-search-query). + Q *string `uriparametername:"q"` + // The id of the repository. + Repository_id *int32 `uriparametername:"repository_id"` + // Sorts the results of your query by when the label was `created` or `updated`. Default: [best match](https://docs.github.com/enterprise-server@3.14/rest/search/search#ranking-search-results) + Sort *idd449cb339067dcbe7f356e27ad0eb7896e269f3de801e791658c4c63534d1e1.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewLabelsRequestBuilderInternal instantiates a new LabelsRequestBuilder and sets the default values. +func NewLabelsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LabelsRequestBuilder) { + m := &LabelsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search/labels?q={q}&repository_id={repository_id}{&order*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewLabelsRequestBuilder instantiates a new LabelsRequestBuilder and sets the default values. +func NewLabelsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*LabelsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewLabelsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this:`q=bug+defect+enhancement&repository_id=64778136`The labels that best match the query appear first in the search results. +// returns a LabelsGetResponseable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/search/search#search-labels +func (m *LabelsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[LabelsRequestBuilderGetQueryParameters])(LabelsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateLabelsGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(LabelsGetResponseable), nil +} +// ToGetRequestInformation find labels in a repository with names or descriptions that match search keywords. Returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for labels, you can get text match metadata for the label **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to find labels in the `linguist` repository that match `bug`, `defect`, or `enhancement`. Your query might look like this:`q=bug+defect+enhancement&repository_id=64778136`The labels that best match the query appear first in the search results. +// returns a *RequestInformation when successful +func (m *LabelsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[LabelsRequestBuilderGetQueryParameters])(*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 *LabelsRequestBuilder when successful +func (m *LabelsRequestBuilder) WithUrl(rawUrl string)(*LabelsRequestBuilder) { + return NewLabelsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/search/repositories/get_order_query_parameter_type.go b/pkg/github/search/repositories/get_order_query_parameter_type.go new file mode 100644 index 00000000..91f98d05 --- /dev/null +++ b/pkg/github/search/repositories/get_order_query_parameter_type.go @@ -0,0 +1,33 @@ +package repositories +type GetOrderQueryParameterType int + +const ( + DESC_GETORDERQUERYPARAMETERTYPE GetOrderQueryParameterType = iota + ASC_GETORDERQUERYPARAMETERTYPE +) + +func (i GetOrderQueryParameterType) String() string { + return []string{"desc", "asc"}[i] +} +func ParseGetOrderQueryParameterType(v string) (any, error) { + result := DESC_GETORDERQUERYPARAMETERTYPE + switch v { + case "desc": + result = DESC_GETORDERQUERYPARAMETERTYPE + case "asc": + result = ASC_GETORDERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetOrderQueryParameterType(values []GetOrderQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetOrderQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/search/repositories/get_sort_query_parameter_type.go b/pkg/github/search/repositories/get_sort_query_parameter_type.go new file mode 100644 index 00000000..d27adf24 --- /dev/null +++ b/pkg/github/search/repositories/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package repositories +type GetSortQueryParameterType int + +const ( + STARS_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + FORKS_GETSORTQUERYPARAMETERTYPE + HELPWANTEDISSUES_GETSORTQUERYPARAMETERTYPE + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"stars", "forks", "help-wanted-issues", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := STARS_GETSORTQUERYPARAMETERTYPE + switch v { + case "stars": + result = STARS_GETSORTQUERYPARAMETERTYPE + case "forks": + result = FORKS_GETSORTQUERYPARAMETERTYPE + case "help-wanted-issues": + result = HELPWANTEDISSUES_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/search/repositories_get_response.go b/pkg/github/search/repositories_get_response.go new file mode 100644 index 00000000..d27b26f3 --- /dev/null +++ b/pkg/github/search/repositories_get_response.go @@ -0,0 +1,151 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type RepositoriesGetResponse 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 incomplete_results property + incomplete_results *bool + // The items property + items []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepoSearchResultItemable + // The total_count property + total_count *int32 +} +// NewRepositoriesGetResponse instantiates a new RepositoriesGetResponse and sets the default values. +func NewRepositoriesGetResponse()(*RepositoriesGetResponse) { + m := &RepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewRepositoriesGetResponse(), 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 *RepositoriesGetResponse) 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 *RepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["incomplete_results"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncompleteResults(val) + } + return nil + } + res["items"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepoSearchResultItemFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepoSearchResultItemable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepoSearchResultItemable) + } + } + m.SetItems(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 +} +// GetIncompleteResults gets the incomplete_results property value. The incomplete_results property +// returns a *bool when successful +func (m *RepositoriesGetResponse) GetIncompleteResults()(*bool) { + return m.incomplete_results +} +// GetItems gets the items property value. The items property +// returns a []RepoSearchResultItemable when successful +func (m *RepositoriesGetResponse) GetItems()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepoSearchResultItemable) { + return m.items +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *RepositoriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *RepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("incomplete_results", m.GetIncompleteResults()) + if err != nil { + return err + } + } + if m.GetItems() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItems())) + for i, v := range m.GetItems() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("items", 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 *RepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncompleteResults sets the incomplete_results property value. The incomplete_results property +func (m *RepositoriesGetResponse) SetIncompleteResults(value *bool)() { + m.incomplete_results = value +} +// SetItems sets the items property value. The items property +func (m *RepositoriesGetResponse) SetItems(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepoSearchResultItemable)() { + m.items = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *RepositoriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type RepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncompleteResults()(*bool) + GetItems()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepoSearchResultItemable) + GetTotalCount()(*int32) + SetIncompleteResults(value *bool)() + SetItems(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepoSearchResultItemable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/search/repositories_request_builder.go b/pkg/github/search/repositories_request_builder.go new file mode 100644 index 00000000..4557d7e8 --- /dev/null +++ b/pkg/github/search/repositories_request_builder.go @@ -0,0 +1,77 @@ +package search + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i7dc1e75f45a2b3b315b1f16caa593c2c2784fa08a91daae9c7daf85fd1f38d70 "github.com/octokit/go-sdk-enterprise-server/pkg/github/search/repositories" +) + +// RepositoriesRequestBuilder builds and executes requests for operations under \search\repositories +type RepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// RepositoriesRequestBuilderGetQueryParameters find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this:`q=tetris+language:assembly&sort=stars&order=desc`This query searches for repositories with the word `tetris` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. +type RepositoriesRequestBuilderGetQueryParameters struct { + // Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + Order *i7dc1e75f45a2b3b315b1f16caa593c2c2784fa08a91daae9c7daf85fd1f38d70.GetOrderQueryParameterType `uriparametername:"order"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub Enterprise Server. The REST API supports the same qualifiers as the web interface for GitHub Enterprise Server. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.14/rest/search/search#constructing-a-search-query). See "[Searching for repositories](https://docs.github.com/enterprise-server@3.14/articles/searching-for-repositories/)" for a detailed list of qualifiers. + Q *string `uriparametername:"q"` + // Sorts the results of your query by number of `stars`, `forks`, or `help-wanted-issues` or how recently the items were `updated`. Default: [best match](https://docs.github.com/enterprise-server@3.14/rest/search/search#ranking-search-results) + Sort *i7dc1e75f45a2b3b315b1f16caa593c2c2784fa08a91daae9c7daf85fd1f38d70.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewRepositoriesRequestBuilderInternal instantiates a new RepositoriesRequestBuilder and sets the default values. +func NewRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RepositoriesRequestBuilder) { + m := &RepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search/repositories?q={q}{&order*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewRepositoriesRequestBuilder instantiates a new RepositoriesRequestBuilder and sets the default values. +func NewRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*RepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this:`q=tetris+language:assembly&sort=stars&order=desc`This query searches for repositories with the word `tetris` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. +// returns a RepositoriesGetResponseable when successful +// returns a ValidationError error when the service returns a 422 status code +// returns a Repositories503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/search/search#search-repositories +func (m *RepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[RepositoriesRequestBuilderGetQueryParameters])(RepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositories503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateRepositoriesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(RepositoriesGetResponseable), nil +} +// ToGetRequestInformation find repositories via various criteria. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for repositories, you can get text match metadata for the **name** and **description** fields when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to search for popular Tetris repositories written in assembly code, your query might look like this:`q=tetris+language:assembly&sort=stars&order=desc`This query searches for repositories with the word `tetris` in the name, the description, or the README. The results are limited to repositories where the primary language is assembly. The results are sorted by stars in descending order, so that the most popular repositories appear first in the search results. +// returns a *RequestInformation when successful +func (m *RepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[RepositoriesRequestBuilderGetQueryParameters])(*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 *RepositoriesRequestBuilder when successful +func (m *RepositoriesRequestBuilder) WithUrl(rawUrl string)(*RepositoriesRequestBuilder) { + return NewRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/search/search_request_builder.go b/pkg/github/search/search_request_builder.go new file mode 100644 index 00000000..81f859ac --- /dev/null +++ b/pkg/github/search/search_request_builder.go @@ -0,0 +1,58 @@ +package search + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// SearchRequestBuilder builds and executes requests for operations under \search +type SearchRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Code the code property +// returns a *CodeRequestBuilder when successful +func (m *SearchRequestBuilder) Code()(*CodeRequestBuilder) { + return NewCodeRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Commits the commits property +// returns a *CommitsRequestBuilder when successful +func (m *SearchRequestBuilder) Commits()(*CommitsRequestBuilder) { + return NewCommitsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewSearchRequestBuilderInternal instantiates a new SearchRequestBuilder and sets the default values. +func NewSearchRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SearchRequestBuilder) { + m := &SearchRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search", pathParameters), + } + return m +} +// NewSearchRequestBuilder instantiates a new SearchRequestBuilder and sets the default values. +func NewSearchRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SearchRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewSearchRequestBuilderInternal(urlParams, requestAdapter) +} +// Issues the issues property +// returns a *IssuesRequestBuilder when successful +func (m *SearchRequestBuilder) Issues()(*IssuesRequestBuilder) { + return NewIssuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Labels the labels property +// returns a *LabelsRequestBuilder when successful +func (m *SearchRequestBuilder) Labels()(*LabelsRequestBuilder) { + return NewLabelsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repositories the repositories property +// returns a *RepositoriesRequestBuilder when successful +func (m *SearchRequestBuilder) Repositories()(*RepositoriesRequestBuilder) { + return NewRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Topics the topics property +// returns a *TopicsRequestBuilder when successful +func (m *SearchRequestBuilder) Topics()(*TopicsRequestBuilder) { + return NewTopicsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Users the users property +// returns a *UsersRequestBuilder when successful +func (m *SearchRequestBuilder) Users()(*UsersRequestBuilder) { + return NewUsersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/search/topics_get_response.go b/pkg/github/search/topics_get_response.go new file mode 100644 index 00000000..125a49d0 --- /dev/null +++ b/pkg/github/search/topics_get_response.go @@ -0,0 +1,151 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type TopicsGetResponse 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 incomplete_results property + incomplete_results *bool + // The items property + items []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TopicSearchResultItemable + // The total_count property + total_count *int32 +} +// NewTopicsGetResponse instantiates a new TopicsGetResponse and sets the default values. +func NewTopicsGetResponse()(*TopicsGetResponse) { + m := &TopicsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateTopicsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateTopicsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewTopicsGetResponse(), 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 *TopicsGetResponse) 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 *TopicsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["incomplete_results"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncompleteResults(val) + } + return nil + } + res["items"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTopicSearchResultItemFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TopicSearchResultItemable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TopicSearchResultItemable) + } + } + m.SetItems(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 +} +// GetIncompleteResults gets the incomplete_results property value. The incomplete_results property +// returns a *bool when successful +func (m *TopicsGetResponse) GetIncompleteResults()(*bool) { + return m.incomplete_results +} +// GetItems gets the items property value. The items property +// returns a []TopicSearchResultItemable when successful +func (m *TopicsGetResponse) GetItems()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TopicSearchResultItemable) { + return m.items +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *TopicsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *TopicsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("incomplete_results", m.GetIncompleteResults()) + if err != nil { + return err + } + } + if m.GetItems() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItems())) + for i, v := range m.GetItems() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("items", 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 *TopicsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncompleteResults sets the incomplete_results property value. The incomplete_results property +func (m *TopicsGetResponse) SetIncompleteResults(value *bool)() { + m.incomplete_results = value +} +// SetItems sets the items property value. The items property +func (m *TopicsGetResponse) SetItems(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TopicSearchResultItemable)() { + m.items = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *TopicsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type TopicsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncompleteResults()(*bool) + GetItems()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TopicSearchResultItemable) + GetTotalCount()(*int32) + SetIncompleteResults(value *bool)() + SetItems(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TopicSearchResultItemable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/search/topics_request_builder.go b/pkg/github/search/topics_request_builder.go new file mode 100644 index 00000000..fad47b63 --- /dev/null +++ b/pkg/github/search/topics_request_builder.go @@ -0,0 +1,65 @@ +package search + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// TopicsRequestBuilder builds and executes requests for operations under \search\topics +type TopicsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// TopicsRequestBuilderGetQueryParameters find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api). See "[Searching topics](https://docs.github.com/enterprise-server@3.14/articles/searching-topics/)" for a detailed list of qualifiers.When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this:`q=ruby+is:featured`This query searches for topics with the keyword `ruby` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. +type TopicsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub Enterprise Server. The REST API supports the same qualifiers as the web interface for GitHub Enterprise Server. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.14/rest/search/search#constructing-a-search-query). + Q *string `uriparametername:"q"` +} +// NewTopicsRequestBuilderInternal instantiates a new TopicsRequestBuilder and sets the default values. +func NewTopicsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TopicsRequestBuilder) { + m := &TopicsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search/topics?q={q}{&page*,per_page*}", pathParameters), + } + return m +} +// NewTopicsRequestBuilder instantiates a new TopicsRequestBuilder and sets the default values. +func NewTopicsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TopicsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTopicsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api). See "[Searching topics](https://docs.github.com/enterprise-server@3.14/articles/searching-topics/)" for a detailed list of qualifiers.When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this:`q=ruby+is:featured`This query searches for topics with the keyword `ruby` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. +// returns a TopicsGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/search/search#search-topics +func (m *TopicsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[TopicsRequestBuilderGetQueryParameters])(TopicsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateTopicsGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(TopicsGetResponseable), nil +} +// ToGetRequestInformation find topics via various criteria. Results are sorted by best match. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api). See "[Searching topics](https://docs.github.com/enterprise-server@3.14/articles/searching-topics/)" for a detailed list of qualifiers.When searching for topics, you can get text match metadata for the topic's **short\_description**, **description**, **name**, or **display\_name** field when you pass the `text-match` media type. For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you want to search for topics related to Ruby that are featured on https://github.com/topics. Your query might look like this:`q=ruby+is:featured`This query searches for topics with the keyword `ruby` and limits the results to find only topics that are featured. The topics that are the best match for the query appear first in the search results. +// returns a *RequestInformation when successful +func (m *TopicsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[TopicsRequestBuilderGetQueryParameters])(*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 *TopicsRequestBuilder when successful +func (m *TopicsRequestBuilder) WithUrl(rawUrl string)(*TopicsRequestBuilder) { + return NewTopicsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/search/users/get_order_query_parameter_type.go b/pkg/github/search/users/get_order_query_parameter_type.go new file mode 100644 index 00000000..cf1024fb --- /dev/null +++ b/pkg/github/search/users/get_order_query_parameter_type.go @@ -0,0 +1,33 @@ +package users +type GetOrderQueryParameterType int + +const ( + DESC_GETORDERQUERYPARAMETERTYPE GetOrderQueryParameterType = iota + ASC_GETORDERQUERYPARAMETERTYPE +) + +func (i GetOrderQueryParameterType) String() string { + return []string{"desc", "asc"}[i] +} +func ParseGetOrderQueryParameterType(v string) (any, error) { + result := DESC_GETORDERQUERYPARAMETERTYPE + switch v { + case "desc": + result = DESC_GETORDERQUERYPARAMETERTYPE + case "asc": + result = ASC_GETORDERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetOrderQueryParameterType(values []GetOrderQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetOrderQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/search/users/get_sort_query_parameter_type.go b/pkg/github/search/users/get_sort_query_parameter_type.go new file mode 100644 index 00000000..98001837 --- /dev/null +++ b/pkg/github/search/users/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package users +type GetSortQueryParameterType int + +const ( + FOLLOWERS_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + REPOSITORIES_GETSORTQUERYPARAMETERTYPE + JOINED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"followers", "repositories", "joined"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := FOLLOWERS_GETSORTQUERYPARAMETERTYPE + switch v { + case "followers": + result = FOLLOWERS_GETSORTQUERYPARAMETERTYPE + case "repositories": + result = REPOSITORIES_GETSORTQUERYPARAMETERTYPE + case "joined": + result = JOINED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/search/users_get_response.go b/pkg/github/search/users_get_response.go new file mode 100644 index 00000000..47ed6a21 --- /dev/null +++ b/pkg/github/search/users_get_response.go @@ -0,0 +1,151 @@ +package search + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type UsersGetResponse 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 incomplete_results property + incomplete_results *bool + // The items property + items []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.UserSearchResultItemable + // The total_count property + total_count *int32 +} +// NewUsersGetResponse instantiates a new UsersGetResponse and sets the default values. +func NewUsersGetResponse()(*UsersGetResponse) { + m := &UsersGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUsersGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUsersGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUsersGetResponse(), 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 *UsersGetResponse) 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 *UsersGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["incomplete_results"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIncompleteResults(val) + } + return nil + } + res["items"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateUserSearchResultItemFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.UserSearchResultItemable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.UserSearchResultItemable) + } + } + m.SetItems(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 +} +// GetIncompleteResults gets the incomplete_results property value. The incomplete_results property +// returns a *bool when successful +func (m *UsersGetResponse) GetIncompleteResults()(*bool) { + return m.incomplete_results +} +// GetItems gets the items property value. The items property +// returns a []UserSearchResultItemable when successful +func (m *UsersGetResponse) GetItems()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.UserSearchResultItemable) { + return m.items +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *UsersGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *UsersGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("incomplete_results", m.GetIncompleteResults()) + if err != nil { + return err + } + } + if m.GetItems() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItems())) + for i, v := range m.GetItems() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("items", 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 *UsersGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetIncompleteResults sets the incomplete_results property value. The incomplete_results property +func (m *UsersGetResponse) SetIncompleteResults(value *bool)() { + m.incomplete_results = value +} +// SetItems sets the items property value. The items property +func (m *UsersGetResponse) SetItems(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.UserSearchResultItemable)() { + m.items = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *UsersGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type UsersGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetIncompleteResults()(*bool) + GetItems()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.UserSearchResultItemable) + GetTotalCount()(*int32) + SetIncompleteResults(value *bool)() + SetItems(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.UserSearchResultItemable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/search/users_request_builder.go b/pkg/github/search/users_request_builder.go new file mode 100644 index 00000000..7216e810 --- /dev/null +++ b/pkg/github/search/users_request_builder.go @@ -0,0 +1,77 @@ +package search + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ic1dba51050461ed0231d32a8b6e79e70803ce407c58db855b28929771dc85b8c "github.com/octokit/go-sdk-enterprise-server/pkg/github/search/users" +) + +// UsersRequestBuilder builds and executes requests for operations under \search\users +type UsersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// UsersRequestBuilderGetQueryParameters find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for users, you can get text match metadata for the issue **login**, public **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you're looking for a list of popular users, you might try this query:`q=tom+repos:%3E42+followers:%3E1000`This query searches for users with the name `tom`. The results are restricted to users with more than 42 repositories and over 1,000 followers.This endpoint does not accept authentication and will only include publicly visible users. As an alternative, you can use the GraphQL API. The GraphQL API requires authentication and will return private users, including Enterprise Managed Users (EMUs), that you are authorized to view. For more information, see "[GraphQL Queries](https://docs.github.com/enterprise-server@3.14/graphql/reference/queries#search)." +type UsersRequestBuilderGetQueryParameters struct { + // Determines whether the first search result returned is the highest number of matches (`desc`) or lowest number of matches (`asc`). This parameter is ignored unless you provide `sort`. + Order *ic1dba51050461ed0231d32a8b6e79e70803ce407c58db855b28929771dc85b8c.GetOrderQueryParameterType `uriparametername:"order"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The query contains one or more search keywords and qualifiers. Qualifiers allow you to limit your search to specific areas of GitHub Enterprise Server. The REST API supports the same qualifiers as the web interface for GitHub Enterprise Server. To learn more about the format of the query, see [Constructing a search query](https://docs.github.com/enterprise-server@3.14/rest/search/search#constructing-a-search-query). See "[Searching users](https://docs.github.com/enterprise-server@3.14/search-github/searching-on-github/searching-users)" for a detailed list of qualifiers. + Q *string `uriparametername:"q"` + // Sorts the results of your query by number of `followers` or `repositories`, or when the person `joined` GitHub Enterprise Server. Default: [best match](https://docs.github.com/enterprise-server@3.14/rest/search/search#ranking-search-results) + Sort *ic1dba51050461ed0231d32a8b6e79e70803ce407c58db855b28929771dc85b8c.GetSortQueryParameterType `uriparametername:"sort"` +} +// NewUsersRequestBuilderInternal instantiates a new UsersRequestBuilder and sets the default values. +func NewUsersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UsersRequestBuilder) { + m := &UsersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/search/users?q={q}{&order*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewUsersRequestBuilder instantiates a new UsersRequestBuilder and sets the default values. +func NewUsersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UsersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewUsersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for users, you can get text match metadata for the issue **login**, public **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you're looking for a list of popular users, you might try this query:`q=tom+repos:%3E42+followers:%3E1000`This query searches for users with the name `tom`. The results are restricted to users with more than 42 repositories and over 1,000 followers.This endpoint does not accept authentication and will only include publicly visible users. As an alternative, you can use the GraphQL API. The GraphQL API requires authentication and will return private users, including Enterprise Managed Users (EMUs), that you are authorized to view. For more information, see "[GraphQL Queries](https://docs.github.com/enterprise-server@3.14/graphql/reference/queries#search)." +// returns a UsersGetResponseable when successful +// returns a ValidationError error when the service returns a 422 status code +// returns a Users503Error error when the service returns a 503 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/search/search#search-users +func (m *UsersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[UsersRequestBuilderGetQueryParameters])(UsersGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + "503": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateUsers503ErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateUsersGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(UsersGetResponseable), nil +} +// ToGetRequestInformation find users via various criteria. This method returns up to 100 results [per page](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api).When searching for users, you can get text match metadata for the issue **login**, public **email**, and **name** fields when you pass the `text-match` media type. For more details about highlighting search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata). For more details about how to receive highlighted search results, see [Text match metadata](https://docs.github.com/enterprise-server@3.14/rest/search/search#text-match-metadata).For example, if you're looking for a list of popular users, you might try this query:`q=tom+repos:%3E42+followers:%3E1000`This query searches for users with the name `tom`. The results are restricted to users with more than 42 repositories and over 1,000 followers.This endpoint does not accept authentication and will only include publicly visible users. As an alternative, you can use the GraphQL API. The GraphQL API requires authentication and will return private users, including Enterprise Managed Users (EMUs), that you are authorized to view. For more information, see "[GraphQL Queries](https://docs.github.com/enterprise-server@3.14/graphql/reference/queries#search)." +// returns a *RequestInformation when successful +func (m *UsersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[UsersRequestBuilderGetQueryParameters])(*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 *UsersRequestBuilder when successful +func (m *UsersRequestBuilder) WithUrl(rawUrl string)(*UsersRequestBuilder) { + return NewUsersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/setup/api_configcheck_request_builder.go b/pkg/github/setup/api_configcheck_request_builder.go new file mode 100644 index 00000000..9ef296b7 --- /dev/null +++ b/pkg/github/setup/api_configcheck_request_builder.go @@ -0,0 +1,57 @@ +package setup + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ApiConfigcheckRequestBuilder builds and executes requests for operations under \setup\api\configcheck +type ApiConfigcheckRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewApiConfigcheckRequestBuilderInternal instantiates a new ApiConfigcheckRequestBuilder and sets the default values. +func NewApiConfigcheckRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiConfigcheckRequestBuilder) { + m := &ApiConfigcheckRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/setup/api/configcheck", pathParameters), + } + return m +} +// NewApiConfigcheckRequestBuilder instantiates a new ApiConfigcheckRequestBuilder and sets the default values. +func NewApiConfigcheckRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiConfigcheckRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewApiConfigcheckRequestBuilderInternal(urlParams, requestAdapter) +} +// Get this endpoint allows you to check the status of the most recent configuration process:Note that you may need to wait several seconds after you start a process before you can check its status.The different statuses are:| Status | Description || ------------- | --------------------------------- || `PENDING` | The job has not started yet || `CONFIGURING` | The job is running || `DONE` | The job has finished correctly || `FAILED` | The job has finished unexpectedly | +// returns a ConfigurationStatusable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-the-configuration-status +func (m *ApiConfigcheckRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ConfigurationStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateConfigurationStatusFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.ConfigurationStatusable), nil +} +// ToGetRequestInformation this endpoint allows you to check the status of the most recent configuration process:Note that you may need to wait several seconds after you start a process before you can check its status.The different statuses are:| Status | Description || ------------- | --------------------------------- || `PENDING` | The job has not started yet || `CONFIGURING` | The job is running || `DONE` | The job has finished correctly || `FAILED` | The job has finished unexpectedly | +// returns a *RequestInformation when successful +func (m *ApiConfigcheckRequestBuilder) 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 *ApiConfigcheckRequestBuilder when successful +func (m *ApiConfigcheckRequestBuilder) WithUrl(rawUrl string)(*ApiConfigcheckRequestBuilder) { + return NewApiConfigcheckRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/setup/api_configure_request_builder.go b/pkg/github/setup/api_configure_request_builder.go new file mode 100644 index 00000000..9938f43b --- /dev/null +++ b/pkg/github/setup/api_configure_request_builder.go @@ -0,0 +1,51 @@ +package setup + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ApiConfigureRequestBuilder builds and executes requests for operations under \setup\api\configure +type ApiConfigureRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewApiConfigureRequestBuilderInternal instantiates a new ApiConfigureRequestBuilder and sets the default values. +func NewApiConfigureRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiConfigureRequestBuilder) { + m := &ApiConfigureRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/setup/api/configure", pathParameters), + } + return m +} +// NewApiConfigureRequestBuilder instantiates a new ApiConfigureRequestBuilder and sets the default values. +func NewApiConfigureRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiConfigureRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewApiConfigureRequestBuilderInternal(urlParams, requestAdapter) +} +// Post this endpoint allows you to start a configuration process at any time for your updated settings to take effect: +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#start-a-configuration-process +func (m *ApiConfigureRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation this endpoint allows you to start a configuration process at any time for your updated settings to take effect: +// returns a *RequestInformation when successful +func (m *ApiConfigureRequestBuilder) 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) + 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 *ApiConfigureRequestBuilder when successful +func (m *ApiConfigureRequestBuilder) WithUrl(rawUrl string)(*ApiConfigureRequestBuilder) { + return NewApiConfigureRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/setup/api_maintenance_post_request_body.go b/pkg/github/setup/api_maintenance_post_request_body.go new file mode 100644 index 00000000..02b98193 --- /dev/null +++ b/pkg/github/setup/api_maintenance_post_request_body.go @@ -0,0 +1,80 @@ +package setup + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ApiMaintenancePostRequestBody 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 JSON string with the attributes `enabled` and `when`.The possible values for `enabled` are `true` and `false`. When it's `false`, the attribute `when` is ignored and the maintenance mode is turned off. `when` defines the time period when the maintenance was enabled.The possible values for `when` are `now` or any date parseable by [mojombo/chronic](https://github.com/mojombo/chronic). + maintenance *string +} +// NewApiMaintenancePostRequestBody instantiates a new ApiMaintenancePostRequestBody and sets the default values. +func NewApiMaintenancePostRequestBody()(*ApiMaintenancePostRequestBody) { + m := &ApiMaintenancePostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApiMaintenancePostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApiMaintenancePostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApiMaintenancePostRequestBody(), 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 *ApiMaintenancePostRequestBody) 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 *ApiMaintenancePostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["maintenance"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetMaintenance(val) + } + return nil + } + return res +} +// GetMaintenance gets the maintenance property value. A JSON string with the attributes `enabled` and `when`.The possible values for `enabled` are `true` and `false`. When it's `false`, the attribute `when` is ignored and the maintenance mode is turned off. `when` defines the time period when the maintenance was enabled.The possible values for `when` are `now` or any date parseable by [mojombo/chronic](https://github.com/mojombo/chronic). +// returns a *string when successful +func (m *ApiMaintenancePostRequestBody) GetMaintenance()(*string) { + return m.maintenance +} +// Serialize serializes information the current object +func (m *ApiMaintenancePostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("maintenance", m.GetMaintenance()) + 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 *ApiMaintenancePostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetMaintenance sets the maintenance property value. A JSON string with the attributes `enabled` and `when`.The possible values for `enabled` are `true` and `false`. When it's `false`, the attribute `when` is ignored and the maintenance mode is turned off. `when` defines the time period when the maintenance was enabled.The possible values for `when` are `now` or any date parseable by [mojombo/chronic](https://github.com/mojombo/chronic). +func (m *ApiMaintenancePostRequestBody) SetMaintenance(value *string)() { + m.maintenance = value +} +type ApiMaintenancePostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetMaintenance()(*string) + SetMaintenance(value *string)() +} diff --git a/pkg/github/setup/api_maintenance_request_builder.go b/pkg/github/setup/api_maintenance_request_builder.go new file mode 100644 index 00000000..13188743 --- /dev/null +++ b/pkg/github/setup/api_maintenance_request_builder.go @@ -0,0 +1,88 @@ +package setup + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ApiMaintenanceRequestBuilder builds and executes requests for operations under \setup\api\maintenance +type ApiMaintenanceRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewApiMaintenanceRequestBuilderInternal instantiates a new ApiMaintenanceRequestBuilder and sets the default values. +func NewApiMaintenanceRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiMaintenanceRequestBuilder) { + m := &ApiMaintenanceRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/setup/api/maintenance", pathParameters), + } + return m +} +// NewApiMaintenanceRequestBuilder instantiates a new ApiMaintenanceRequestBuilder and sets the default values. +func NewApiMaintenanceRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiMaintenanceRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewApiMaintenanceRequestBuilderInternal(urlParams, requestAdapter) +} +// Get check your installation's maintenance status: +// returns a MaintenanceStatusable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-the-maintenance-status +func (m *ApiMaintenanceRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MaintenanceStatusable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMaintenanceStatusFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MaintenanceStatusable), nil +} +// Post > [!NOTE]> The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode). +// returns a MaintenanceStatusable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#enable-or-disable-maintenance-mode +func (m *ApiMaintenanceRequestBuilder) Post(ctx context.Context, body ApiMaintenancePostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MaintenanceStatusable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMaintenanceStatusFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MaintenanceStatusable), nil +} +// ToGetRequestInformation check your installation's maintenance status: +// returns a *RequestInformation when successful +func (m *ApiMaintenanceRequestBuilder) 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 > [!NOTE]> The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode). +// returns a *RequestInformation when successful +func (m *ApiMaintenanceRequestBuilder) ToPostRequestInformation(ctx context.Context, body ApiMaintenancePostRequestBodyable, 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/x-www-form-urlencoded", 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 *ApiMaintenanceRequestBuilder when successful +func (m *ApiMaintenanceRequestBuilder) WithUrl(rawUrl string)(*ApiMaintenanceRequestBuilder) { + return NewApiMaintenanceRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/setup/api_request_builder.go b/pkg/github/setup/api_request_builder.go new file mode 100644 index 00000000..36e5ef0a --- /dev/null +++ b/pkg/github/setup/api_request_builder.go @@ -0,0 +1,53 @@ +package setup + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ApiRequestBuilder builds and executes requests for operations under \setup\api +type ApiRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Configcheck the configcheck property +// returns a *ApiConfigcheckRequestBuilder when successful +func (m *ApiRequestBuilder) Configcheck()(*ApiConfigcheckRequestBuilder) { + return NewApiConfigcheckRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Configure the configure property +// returns a *ApiConfigureRequestBuilder when successful +func (m *ApiRequestBuilder) Configure()(*ApiConfigureRequestBuilder) { + return NewApiConfigureRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewApiRequestBuilderInternal instantiates a new ApiRequestBuilder and sets the default values. +func NewApiRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiRequestBuilder) { + m := &ApiRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/setup/api", pathParameters), + } + return m +} +// NewApiRequestBuilder instantiates a new ApiRequestBuilder and sets the default values. +func NewApiRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewApiRequestBuilderInternal(urlParams, requestAdapter) +} +// Maintenance the maintenance property +// returns a *ApiMaintenanceRequestBuilder when successful +func (m *ApiRequestBuilder) Maintenance()(*ApiMaintenanceRequestBuilder) { + return NewApiMaintenanceRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Settings the settings property +// returns a *ApiSettingsRequestBuilder when successful +func (m *ApiRequestBuilder) Settings()(*ApiSettingsRequestBuilder) { + return NewApiSettingsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Start the start property +// returns a *ApiStartRequestBuilder when successful +func (m *ApiRequestBuilder) Start()(*ApiStartRequestBuilder) { + return NewApiStartRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Upgrade the upgrade property +// returns a *ApiUpgradeRequestBuilder when successful +func (m *ApiRequestBuilder) Upgrade()(*ApiUpgradeRequestBuilder) { + return NewApiUpgradeRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/setup/api_settings_authorized_keys_delete_request_body.go b/pkg/github/setup/api_settings_authorized_keys_delete_request_body.go new file mode 100644 index 00000000..e4562f59 --- /dev/null +++ b/pkg/github/setup/api_settings_authorized_keys_delete_request_body.go @@ -0,0 +1,80 @@ +package setup + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ApiSettingsAuthorizedKeysDeleteRequestBody 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 public SSH key. + authorized_key *string +} +// NewApiSettingsAuthorizedKeysDeleteRequestBody instantiates a new ApiSettingsAuthorizedKeysDeleteRequestBody and sets the default values. +func NewApiSettingsAuthorizedKeysDeleteRequestBody()(*ApiSettingsAuthorizedKeysDeleteRequestBody) { + m := &ApiSettingsAuthorizedKeysDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApiSettingsAuthorizedKeysDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApiSettingsAuthorizedKeysDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApiSettingsAuthorizedKeysDeleteRequestBody(), 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 *ApiSettingsAuthorizedKeysDeleteRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorizedKey gets the authorized_key property value. The public SSH key. +// returns a *string when successful +func (m *ApiSettingsAuthorizedKeysDeleteRequestBody) GetAuthorizedKey()(*string) { + return m.authorized_key +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ApiSettingsAuthorizedKeysDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["authorized_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAuthorizedKey(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ApiSettingsAuthorizedKeysDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("authorized_key", m.GetAuthorizedKey()) + 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 *ApiSettingsAuthorizedKeysDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorizedKey sets the authorized_key property value. The public SSH key. +func (m *ApiSettingsAuthorizedKeysDeleteRequestBody) SetAuthorizedKey(value *string)() { + m.authorized_key = value +} +type ApiSettingsAuthorizedKeysDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorizedKey()(*string) + SetAuthorizedKey(value *string)() +} diff --git a/pkg/github/setup/api_settings_authorized_keys_post_request_body.go b/pkg/github/setup/api_settings_authorized_keys_post_request_body.go new file mode 100644 index 00000000..41ed5807 --- /dev/null +++ b/pkg/github/setup/api_settings_authorized_keys_post_request_body.go @@ -0,0 +1,80 @@ +package setup + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ApiSettingsAuthorizedKeysPostRequestBody 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 public SSH key. + authorized_key *string +} +// NewApiSettingsAuthorizedKeysPostRequestBody instantiates a new ApiSettingsAuthorizedKeysPostRequestBody and sets the default values. +func NewApiSettingsAuthorizedKeysPostRequestBody()(*ApiSettingsAuthorizedKeysPostRequestBody) { + m := &ApiSettingsAuthorizedKeysPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApiSettingsAuthorizedKeysPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApiSettingsAuthorizedKeysPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApiSettingsAuthorizedKeysPostRequestBody(), 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 *ApiSettingsAuthorizedKeysPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAuthorizedKey gets the authorized_key property value. The public SSH key. +// returns a *string when successful +func (m *ApiSettingsAuthorizedKeysPostRequestBody) GetAuthorizedKey()(*string) { + return m.authorized_key +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ApiSettingsAuthorizedKeysPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["authorized_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetAuthorizedKey(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ApiSettingsAuthorizedKeysPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("authorized_key", m.GetAuthorizedKey()) + 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 *ApiSettingsAuthorizedKeysPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAuthorizedKey sets the authorized_key property value. The public SSH key. +func (m *ApiSettingsAuthorizedKeysPostRequestBody) SetAuthorizedKey(value *string)() { + m.authorized_key = value +} +type ApiSettingsAuthorizedKeysPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAuthorizedKey()(*string) + SetAuthorizedKey(value *string)() +} diff --git a/pkg/github/setup/api_settings_authorized_keys_request_builder.go b/pkg/github/setup/api_settings_authorized_keys_request_builder.go new file mode 100644 index 00000000..503931e3 --- /dev/null +++ b/pkg/github/setup/api_settings_authorized_keys_request_builder.go @@ -0,0 +1,127 @@ +package setup + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ApiSettingsAuthorizedKeysRequestBuilder builds and executes requests for operations under \setup\api\settings\authorized-keys +type ApiSettingsAuthorizedKeysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewApiSettingsAuthorizedKeysRequestBuilderInternal instantiates a new ApiSettingsAuthorizedKeysRequestBuilder and sets the default values. +func NewApiSettingsAuthorizedKeysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiSettingsAuthorizedKeysRequestBuilder) { + m := &ApiSettingsAuthorizedKeysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/setup/api/settings/authorized-keys", pathParameters), + } + return m +} +// NewApiSettingsAuthorizedKeysRequestBuilder instantiates a new ApiSettingsAuthorizedKeysRequestBuilder and sets the default values. +func NewApiSettingsAuthorizedKeysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiSettingsAuthorizedKeysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewApiSettingsAuthorizedKeysRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete **Note:** The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode). +// returns a []SshKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#remove-an-authorized-ssh-key +func (m *ApiSettingsAuthorizedKeysRequestBuilder) Delete(ctx context.Context, body ApiSettingsAuthorizedKeysDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshKeyable, error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSshKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshKeyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshKeyable) + } + } + return val, nil +} +// Get get all authorized SSH keys +// returns a []SshKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-all-authorized-ssh-keys +func (m *ApiSettingsAuthorizedKeysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSshKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshKeyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshKeyable) + } + } + return val, nil +} +// Post **Note:** The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode). +// returns a []SshKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#add-an-authorized-ssh-key +func (m *ApiSettingsAuthorizedKeysRequestBuilder) Post(ctx context.Context, body ApiSettingsAuthorizedKeysPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshKeyable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSshKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshKeyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshKeyable) + } + } + return val, nil +} +// ToDeleteRequestInformation **Note:** The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode). +// returns a *RequestInformation when successful +func (m *ApiSettingsAuthorizedKeysRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ApiSettingsAuthorizedKeysDeleteRequestBodyable, 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") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/x-www-form-urlencoded", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *ApiSettingsAuthorizedKeysRequestBuilder) 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 **Note:** The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode). +// returns a *RequestInformation when successful +func (m *ApiSettingsAuthorizedKeysRequestBuilder) ToPostRequestInformation(ctx context.Context, body ApiSettingsAuthorizedKeysPostRequestBodyable, 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/x-www-form-urlencoded", 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 *ApiSettingsAuthorizedKeysRequestBuilder when successful +func (m *ApiSettingsAuthorizedKeysRequestBuilder) WithUrl(rawUrl string)(*ApiSettingsAuthorizedKeysRequestBuilder) { + return NewApiSettingsAuthorizedKeysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/setup/api_settings_put_request_body.go b/pkg/github/setup/api_settings_put_request_body.go new file mode 100644 index 00000000..974f59fb --- /dev/null +++ b/pkg/github/setup/api_settings_put_request_body.go @@ -0,0 +1,80 @@ +package setup + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ApiSettingsPutRequestBody 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 JSON string with the new settings. Note that you only need to pass the specific settings you want to modify. For a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-settings). + settings *string +} +// NewApiSettingsPutRequestBody instantiates a new ApiSettingsPutRequestBody and sets the default values. +func NewApiSettingsPutRequestBody()(*ApiSettingsPutRequestBody) { + m := &ApiSettingsPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApiSettingsPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApiSettingsPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApiSettingsPutRequestBody(), 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 *ApiSettingsPutRequestBody) 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 *ApiSettingsPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["settings"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSettings(val) + } + return nil + } + return res +} +// GetSettings gets the settings property value. A JSON string with the new settings. Note that you only need to pass the specific settings you want to modify. For a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-settings). +// returns a *string when successful +func (m *ApiSettingsPutRequestBody) GetSettings()(*string) { + return m.settings +} +// Serialize serializes information the current object +func (m *ApiSettingsPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("settings", m.GetSettings()) + 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 *ApiSettingsPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetSettings sets the settings property value. A JSON string with the new settings. Note that you only need to pass the specific settings you want to modify. For a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-settings). +func (m *ApiSettingsPutRequestBody) SetSettings(value *string)() { + m.settings = value +} +type ApiSettingsPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetSettings()(*string) + SetSettings(value *string)() +} diff --git a/pkg/github/setup/api_settings_request_builder.go b/pkg/github/setup/api_settings_request_builder.go new file mode 100644 index 00000000..5b118b14 --- /dev/null +++ b/pkg/github/setup/api_settings_request_builder.go @@ -0,0 +1,88 @@ +package setup + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ApiSettingsRequestBuilder builds and executes requests for operations under \setup\api\settings +type ApiSettingsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// AuthorizedKeys the authorizedKeys property +// returns a *ApiSettingsAuthorizedKeysRequestBuilder when successful +func (m *ApiSettingsRequestBuilder) AuthorizedKeys()(*ApiSettingsAuthorizedKeysRequestBuilder) { + return NewApiSettingsAuthorizedKeysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewApiSettingsRequestBuilderInternal instantiates a new ApiSettingsRequestBuilder and sets the default values. +func NewApiSettingsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiSettingsRequestBuilder) { + m := &ApiSettingsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/setup/api/settings", pathParameters), + } + return m +} +// NewApiSettingsRequestBuilder instantiates a new ApiSettingsRequestBuilder and sets the default values. +func NewApiSettingsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiSettingsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewApiSettingsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get gets the settings for your instance. To change settings, see the [Set settings endpoint](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#set-settings).> [!NOTE]> You cannot retrieve the management console password with the Enterprise administration API. +// returns a EnterpriseSettingsable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-settings +func (m *ApiSettingsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseSettingsable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEnterpriseSettingsFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.EnterpriseSettingsable), nil +} +// Put applies settings on your instance. For a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-settings).**Notes:**- The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).- You cannot set the management console password with the Enterprise administration API. Use the `ghe-set-password` utility to change the management console password. For more information, see "[Command-line utilities](https://docs.github.com/enterprise-server@3.14/admin/configuration/configuring-your-enterprise/command-line-utilities#ghe-set-password)." +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#set-settings +func (m *ApiSettingsRequestBuilder) Put(ctx context.Context, body ApiSettingsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation gets the settings for your instance. To change settings, see the [Set settings endpoint](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#set-settings).> [!NOTE]> You cannot retrieve the management console password with the Enterprise administration API. +// returns a *RequestInformation when successful +func (m *ApiSettingsRequestBuilder) 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 +} +// ToPutRequestInformation applies settings on your instance. For a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-settings).**Notes:**- The request body for this operation must be submitted as `application/x-www-form-urlencoded` data. You can submit a parameter value as a string, or you can use a tool such as `curl` to submit a parameter value as the contents of a text file. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#--data-urlencode).- You cannot set the management console password with the Enterprise administration API. Use the `ghe-set-password` utility to change the management console password. For more information, see "[Command-line utilities](https://docs.github.com/enterprise-server@3.14/admin/configuration/configuring-your-enterprise/command-line-utilities#ghe-set-password)." +// returns a *RequestInformation when successful +func (m *ApiSettingsRequestBuilder) ToPutRequestInformation(ctx context.Context, body ApiSettingsPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/x-www-form-urlencoded", 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 *ApiSettingsRequestBuilder when successful +func (m *ApiSettingsRequestBuilder) WithUrl(rawUrl string)(*ApiSettingsRequestBuilder) { + return NewApiSettingsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/setup/api_start_post_request_body.go b/pkg/github/setup/api_start_post_request_body.go new file mode 100644 index 00000000..1911b20c --- /dev/null +++ b/pkg/github/setup/api_start_post_request_body.go @@ -0,0 +1,138 @@ +package setup + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ApiStartPostRequestBody 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 content of your _.ghl_ license file. + license *string + // You **must** provide a password _only if_ you are uploading your license for the first time. If you previously set a password through the web interface, you don't need this parameter. + password *string + // An optional JSON string containing the installation settings. For a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-settings). + settings *string +} +// NewApiStartPostRequestBody instantiates a new ApiStartPostRequestBody and sets the default values. +func NewApiStartPostRequestBody()(*ApiStartPostRequestBody) { + m := &ApiStartPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApiStartPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApiStartPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApiStartPostRequestBody(), 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 *ApiStartPostRequestBody) 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 *ApiStartPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicense(val) + } + return nil + } + res["password"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetPassword(val) + } + return nil + } + res["settings"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetSettings(val) + } + return nil + } + return res +} +// GetLicense gets the license property value. The content of your _.ghl_ license file. +// returns a *string when successful +func (m *ApiStartPostRequestBody) GetLicense()(*string) { + return m.license +} +// GetPassword gets the password property value. You **must** provide a password _only if_ you are uploading your license for the first time. If you previously set a password through the web interface, you don't need this parameter. +// returns a *string when successful +func (m *ApiStartPostRequestBody) GetPassword()(*string) { + return m.password +} +// GetSettings gets the settings property value. An optional JSON string containing the installation settings. For a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-settings). +// returns a *string when successful +func (m *ApiStartPostRequestBody) GetSettings()(*string) { + return m.settings +} +// Serialize serializes information the current object +func (m *ApiStartPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("license", m.GetLicense()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("password", m.GetPassword()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("settings", m.GetSettings()) + 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 *ApiStartPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLicense sets the license property value. The content of your _.ghl_ license file. +func (m *ApiStartPostRequestBody) SetLicense(value *string)() { + m.license = value +} +// SetPassword sets the password property value. You **must** provide a password _only if_ you are uploading your license for the first time. If you previously set a password through the web interface, you don't need this parameter. +func (m *ApiStartPostRequestBody) SetPassword(value *string)() { + m.password = value +} +// SetSettings sets the settings property value. An optional JSON string containing the installation settings. For a list of the available settings, see the [Get settings endpoint](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#get-settings). +func (m *ApiStartPostRequestBody) SetSettings(value *string)() { + m.settings = value +} +type ApiStartPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLicense()(*string) + GetPassword()(*string) + GetSettings()(*string) + SetLicense(value *string)() + SetPassword(value *string)() + SetSettings(value *string)() +} diff --git a/pkg/github/setup/api_start_request_builder.go b/pkg/github/setup/api_start_request_builder.go new file mode 100644 index 00000000..d7dcfb79 --- /dev/null +++ b/pkg/github/setup/api_start_request_builder.go @@ -0,0 +1,55 @@ +package setup + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ApiStartRequestBuilder builds and executes requests for operations under \setup\api\start +type ApiStartRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewApiStartRequestBuilderInternal instantiates a new ApiStartRequestBuilder and sets the default values. +func NewApiStartRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiStartRequestBuilder) { + m := &ApiStartRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/setup/api/start", pathParameters), + } + return m +} +// NewApiStartRequestBuilder instantiates a new ApiStartRequestBuilder and sets the default values. +func NewApiStartRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiStartRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewApiStartRequestBuilderInternal(urlParams, requestAdapter) +} +// Post when you boot a GitHub instance for the first time, you can use the following endpoint to upload a license.Note that you need to `POST` to [`/setup/api/configure`](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#start-a-configuration-process) to start the actual configuration process.When using this endpoint, your GitHub instance must have a password set. This can be accomplished two ways:1. If you're working directly with the API before accessing the web interface, you must pass in the password parameter to set your password.2. If you set up your instance via the web interface before accessing the API, your calls to this endpoint do not need the password parameter.> [!NOTE]> The request body for this operation must be submitted as `multipart/form-data` data. You can can reference the license file by prefixing the filename with the `@` symbol using `curl`. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#-F). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#create-a-github-license +func (m *ApiStartRequestBuilder) Post(ctx context.Context, body ApiStartPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation when you boot a GitHub instance for the first time, you can use the following endpoint to upload a license.Note that you need to `POST` to [`/setup/api/configure`](https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#start-a-configuration-process) to start the actual configuration process.When using this endpoint, your GitHub instance must have a password set. This can be accomplished two ways:1. If you're working directly with the API before accessing the web interface, you must pass in the password parameter to set your password.2. If you set up your instance via the web interface before accessing the API, your calls to this endpoint do not need the password parameter.> [!NOTE]> The request body for this operation must be submitted as `multipart/form-data` data. You can can reference the license file by prefixing the filename with the `@` symbol using `curl`. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#-F). +// returns a *RequestInformation when successful +func (m *ApiStartRequestBuilder) ToPostRequestInformation(ctx context.Context, body ApiStartPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "multipart/form-data", 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 *ApiStartRequestBuilder when successful +func (m *ApiStartRequestBuilder) WithUrl(rawUrl string)(*ApiStartRequestBuilder) { + return NewApiStartRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/setup/api_upgrade_post_request_body.go b/pkg/github/setup/api_upgrade_post_request_body.go new file mode 100644 index 00000000..3498c654 --- /dev/null +++ b/pkg/github/setup/api_upgrade_post_request_body.go @@ -0,0 +1,80 @@ +package setup + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ApiUpgradePostRequestBody 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 content of your new _.ghl_ license file. + license *string +} +// NewApiUpgradePostRequestBody instantiates a new ApiUpgradePostRequestBody and sets the default values. +func NewApiUpgradePostRequestBody()(*ApiUpgradePostRequestBody) { + m := &ApiUpgradePostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateApiUpgradePostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateApiUpgradePostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewApiUpgradePostRequestBody(), 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 *ApiUpgradePostRequestBody) 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 *ApiUpgradePostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["license"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicense(val) + } + return nil + } + return res +} +// GetLicense gets the license property value. The content of your new _.ghl_ license file. +// returns a *string when successful +func (m *ApiUpgradePostRequestBody) GetLicense()(*string) { + return m.license +} +// Serialize serializes information the current object +func (m *ApiUpgradePostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("license", m.GetLicense()) + 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 *ApiUpgradePostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetLicense sets the license property value. The content of your new _.ghl_ license file. +func (m *ApiUpgradePostRequestBody) SetLicense(value *string)() { + m.license = value +} +type ApiUpgradePostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetLicense()(*string) + SetLicense(value *string)() +} diff --git a/pkg/github/setup/api_upgrade_request_builder.go b/pkg/github/setup/api_upgrade_request_builder.go new file mode 100644 index 00000000..a514e03b --- /dev/null +++ b/pkg/github/setup/api_upgrade_request_builder.go @@ -0,0 +1,55 @@ +package setup + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ApiUpgradeRequestBuilder builds and executes requests for operations under \setup\api\upgrade +type ApiUpgradeRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewApiUpgradeRequestBuilderInternal instantiates a new ApiUpgradeRequestBuilder and sets the default values. +func NewApiUpgradeRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiUpgradeRequestBuilder) { + m := &ApiUpgradeRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/setup/api/upgrade", pathParameters), + } + return m +} +// NewApiUpgradeRequestBuilder instantiates a new ApiUpgradeRequestBuilder and sets the default values. +func NewApiUpgradeRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ApiUpgradeRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewApiUpgradeRequestBuilderInternal(urlParams, requestAdapter) +} +// Post this API upgrades your license and also triggers the configuration process.> [!NOTE]> The request body for this operation must be submitted as `multipart/form-data` data. You can can reference the license file by prefixing the filename with the `@` symbol using `curl`. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#-F). +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/management-console#upgrade-a-license +func (m *ApiUpgradeRequestBuilder) Post(ctx context.Context, body ApiUpgradePostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation this API upgrades your license and also triggers the configuration process.> [!NOTE]> The request body for this operation must be submitted as `multipart/form-data` data. You can can reference the license file by prefixing the filename with the `@` symbol using `curl`. For more information, see the [`curl` documentation](https://curl.se/docs/manpage.html#-F). +// returns a *RequestInformation when successful +func (m *ApiUpgradeRequestBuilder) ToPostRequestInformation(ctx context.Context, body ApiUpgradePostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.POST, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "multipart/form-data", 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 *ApiUpgradeRequestBuilder when successful +func (m *ApiUpgradeRequestBuilder) WithUrl(rawUrl string)(*ApiUpgradeRequestBuilder) { + return NewApiUpgradeRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/setup/setup_request_builder.go b/pkg/github/setup/setup_request_builder.go new file mode 100644 index 00000000..df86e138 --- /dev/null +++ b/pkg/github/setup/setup_request_builder.go @@ -0,0 +1,28 @@ +package setup + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// SetupRequestBuilder builds and executes requests for operations under \setup +type SetupRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Api the api property +// returns a *ApiRequestBuilder when successful +func (m *SetupRequestBuilder) Api()(*ApiRequestBuilder) { + return NewApiRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewSetupRequestBuilderInternal instantiates a new SetupRequestBuilder and sets the default values. +func NewSetupRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SetupRequestBuilder) { + m := &SetupRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/setup", pathParameters), + } + return m +} +// NewSetupRequestBuilder instantiates a new SetupRequestBuilder and sets the default values. +func NewSetupRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SetupRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewSetupRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/teams/item/discussions/get_direction_query_parameter_type.go b/pkg/github/teams/item/discussions/get_direction_query_parameter_type.go new file mode 100644 index 00000000..464403a3 --- /dev/null +++ b/pkg/github/teams/item/discussions/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package discussions +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/teams/item/discussions/item/comments/get_direction_query_parameter_type.go b/pkg/github/teams/item/discussions/item/comments/get_direction_query_parameter_type.go new file mode 100644 index 00000000..6561eb6a --- /dev/null +++ b/pkg/github/teams/item/discussions/item/comments/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package comments +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/teams/item/discussions/item/comments/item/reactions/get_content_query_parameter_type.go b/pkg/github/teams/item/discussions/item/comments/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 00000000..f3e64542 --- /dev/null +++ b/pkg/github/teams/item/discussions/item/comments/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,51 @@ +package reactions +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/teams/item/discussions/item/comments/item/reactions/reactions_post_request_body_escaped_content.go b/pkg/github/teams/item/discussions/item/comments/item/reactions/reactions_post_request_body_escaped_content.go new file mode 100644 index 00000000..b203b01a --- /dev/null +++ b/pkg/github/teams/item/discussions/item/comments/item/reactions/reactions_post_request_body_escaped_content.go @@ -0,0 +1,52 @@ +package reactions +// The [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions) to add to the team discussion comment. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return nil, nil + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/pkg/github/teams/item/discussions/item/reactions/get_content_query_parameter_type.go b/pkg/github/teams/item/discussions/item/reactions/get_content_query_parameter_type.go new file mode 100644 index 00000000..f3e64542 --- /dev/null +++ b/pkg/github/teams/item/discussions/item/reactions/get_content_query_parameter_type.go @@ -0,0 +1,51 @@ +package reactions +type GetContentQueryParameterType int + +const ( + PLUS_1_GETCONTENTQUERYPARAMETERTYPE GetContentQueryParameterType = iota + MINUS_1_GETCONTENTQUERYPARAMETERTYPE + LAUGH_GETCONTENTQUERYPARAMETERTYPE + CONFUSED_GETCONTENTQUERYPARAMETERTYPE + HEART_GETCONTENTQUERYPARAMETERTYPE + HOORAY_GETCONTENTQUERYPARAMETERTYPE + ROCKET_GETCONTENTQUERYPARAMETERTYPE + EYES_GETCONTENTQUERYPARAMETERTYPE +) + +func (i GetContentQueryParameterType) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseGetContentQueryParameterType(v string) (any, error) { + result := PLUS_1_GETCONTENTQUERYPARAMETERTYPE + switch v { + case "+1": + result = PLUS_1_GETCONTENTQUERYPARAMETERTYPE + case "-1": + result = MINUS_1_GETCONTENTQUERYPARAMETERTYPE + case "laugh": + result = LAUGH_GETCONTENTQUERYPARAMETERTYPE + case "confused": + result = CONFUSED_GETCONTENTQUERYPARAMETERTYPE + case "heart": + result = HEART_GETCONTENTQUERYPARAMETERTYPE + case "hooray": + result = HOORAY_GETCONTENTQUERYPARAMETERTYPE + case "rocket": + result = ROCKET_GETCONTENTQUERYPARAMETERTYPE + case "eyes": + result = EYES_GETCONTENTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetContentQueryParameterType(values []GetContentQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetContentQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/teams/item/discussions/item/reactions/reactions_post_request_body_escaped_content.go b/pkg/github/teams/item/discussions/item/reactions/reactions_post_request_body_escaped_content.go new file mode 100644 index 00000000..6b5b61e1 --- /dev/null +++ b/pkg/github/teams/item/discussions/item/reactions/reactions_post_request_body_escaped_content.go @@ -0,0 +1,52 @@ +package reactions +// The [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions) to add to the team discussion. +type ReactionsPostRequestBody_content int + +const ( + PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT ReactionsPostRequestBody_content = iota + MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + HEART_REACTIONSPOSTREQUESTBODY_CONTENT + HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + EYES_REACTIONSPOSTREQUESTBODY_CONTENT +) + +func (i ReactionsPostRequestBody_content) String() string { + return []string{"+1", "-1", "laugh", "confused", "heart", "hooray", "rocket", "eyes"}[i] +} +func ParseReactionsPostRequestBody_content(v string) (any, error) { + result := PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + switch v { + case "+1": + result = PLUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "-1": + result = MINUS_1_REACTIONSPOSTREQUESTBODY_CONTENT + case "laugh": + result = LAUGH_REACTIONSPOSTREQUESTBODY_CONTENT + case "confused": + result = CONFUSED_REACTIONSPOSTREQUESTBODY_CONTENT + case "heart": + result = HEART_REACTIONSPOSTREQUESTBODY_CONTENT + case "hooray": + result = HOORAY_REACTIONSPOSTREQUESTBODY_CONTENT + case "rocket": + result = ROCKET_REACTIONSPOSTREQUESTBODY_CONTENT + case "eyes": + result = EYES_REACTIONSPOSTREQUESTBODY_CONTENT + default: + return nil, nil + } + return &result, nil +} +func SerializeReactionsPostRequestBody_content(values []ReactionsPostRequestBody_content) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReactionsPostRequestBody_content) isMultiValue() bool { + return false +} diff --git a/pkg/github/teams/item/members/get_role_query_parameter_type.go b/pkg/github/teams/item/members/get_role_query_parameter_type.go new file mode 100644 index 00000000..4d703803 --- /dev/null +++ b/pkg/github/teams/item/members/get_role_query_parameter_type.go @@ -0,0 +1,36 @@ +package members +type GetRoleQueryParameterType int + +const ( + MEMBER_GETROLEQUERYPARAMETERTYPE GetRoleQueryParameterType = iota + MAINTAINER_GETROLEQUERYPARAMETERTYPE + ALL_GETROLEQUERYPARAMETERTYPE +) + +func (i GetRoleQueryParameterType) String() string { + return []string{"member", "maintainer", "all"}[i] +} +func ParseGetRoleQueryParameterType(v string) (any, error) { + result := MEMBER_GETROLEQUERYPARAMETERTYPE + switch v { + case "member": + result = MEMBER_GETROLEQUERYPARAMETERTYPE + case "maintainer": + result = MAINTAINER_GETROLEQUERYPARAMETERTYPE + case "all": + result = ALL_GETROLEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetRoleQueryParameterType(values []GetRoleQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetRoleQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/teams/item/memberships/item/with_username_put_request_body_escaped_role.go b/pkg/github/teams/item/memberships/item/with_username_put_request_body_escaped_role.go new file mode 100644 index 00000000..d01d40bb --- /dev/null +++ b/pkg/github/teams/item/memberships/item/with_username_put_request_body_escaped_role.go @@ -0,0 +1,34 @@ +package item +// The role that this user should have in the team. +type WithUsernamePutRequestBody_role int + +const ( + MEMBER_WITHUSERNAMEPUTREQUESTBODY_ROLE WithUsernamePutRequestBody_role = iota + MAINTAINER_WITHUSERNAMEPUTREQUESTBODY_ROLE +) + +func (i WithUsernamePutRequestBody_role) String() string { + return []string{"member", "maintainer"}[i] +} +func ParseWithUsernamePutRequestBody_role(v string) (any, error) { + result := MEMBER_WITHUSERNAMEPUTREQUESTBODY_ROLE + switch v { + case "member": + result = MEMBER_WITHUSERNAMEPUTREQUESTBODY_ROLE + case "maintainer": + result = MAINTAINER_WITHUSERNAMEPUTREQUESTBODY_ROLE + default: + return nil, nil + } + return &result, nil +} +func SerializeWithUsernamePutRequestBody_role(values []WithUsernamePutRequestBody_role) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithUsernamePutRequestBody_role) isMultiValue() bool { + return false +} diff --git a/pkg/github/teams/item/projects/item/with_project_escaped_put_request_body_escaped_permission.go b/pkg/github/teams/item/projects/item/with_project_escaped_put_request_body_escaped_permission.go new file mode 100644 index 00000000..1cc17e0d --- /dev/null +++ b/pkg/github/teams/item/projects/item/with_project_escaped_put_request_body_escaped_permission.go @@ -0,0 +1,37 @@ +package item +// The permission to grant to the team for this project. Default: the team's `permission` attribute will be used to determine what permission to grant the team on this project. Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +type WithProject_PutRequestBody_permission int + +const ( + READ_WITHPROJECT_PUTREQUESTBODY_PERMISSION WithProject_PutRequestBody_permission = iota + WRITE_WITHPROJECT_PUTREQUESTBODY_PERMISSION + ADMIN_WITHPROJECT_PUTREQUESTBODY_PERMISSION +) + +func (i WithProject_PutRequestBody_permission) String() string { + return []string{"read", "write", "admin"}[i] +} +func ParseWithProject_PutRequestBody_permission(v string) (any, error) { + result := READ_WITHPROJECT_PUTREQUESTBODY_PERMISSION + switch v { + case "read": + result = READ_WITHPROJECT_PUTREQUESTBODY_PERMISSION + case "write": + result = WRITE_WITHPROJECT_PUTREQUESTBODY_PERMISSION + case "admin": + result = ADMIN_WITHPROJECT_PUTREQUESTBODY_PERMISSION + default: + return nil, nil + } + return &result, nil +} +func SerializeWithProject_PutRequestBody_permission(values []WithProject_PutRequestBody_permission) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithProject_PutRequestBody_permission) isMultiValue() bool { + return false +} diff --git a/pkg/github/teams/item/repos/item/item/with_repo_put_request_body_escaped_permission.go b/pkg/github/teams/item/repos/item/item/with_repo_put_request_body_escaped_permission.go new file mode 100644 index 00000000..4adae412 --- /dev/null +++ b/pkg/github/teams/item/repos/item/item/with_repo_put_request_body_escaped_permission.go @@ -0,0 +1,37 @@ +package item +// The permission to grant the team on this repository. If no permission is specified, the team's `permission` attribute will be used to determine what permission to grant the team on this repository. +type WithRepoPutRequestBody_permission int + +const ( + PULL_WITHREPOPUTREQUESTBODY_PERMISSION WithRepoPutRequestBody_permission = iota + PUSH_WITHREPOPUTREQUESTBODY_PERMISSION + ADMIN_WITHREPOPUTREQUESTBODY_PERMISSION +) + +func (i WithRepoPutRequestBody_permission) String() string { + return []string{"pull", "push", "admin"}[i] +} +func ParseWithRepoPutRequestBody_permission(v string) (any, error) { + result := PULL_WITHREPOPUTREQUESTBODY_PERMISSION + switch v { + case "pull": + result = PULL_WITHREPOPUTREQUESTBODY_PERMISSION + case "push": + result = PUSH_WITHREPOPUTREQUESTBODY_PERMISSION + case "admin": + result = ADMIN_WITHREPOPUTREQUESTBODY_PERMISSION + default: + return nil, nil + } + return &result, nil +} +func SerializeWithRepoPutRequestBody_permission(values []WithRepoPutRequestBody_permission) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithRepoPutRequestBody_permission) isMultiValue() bool { + return false +} diff --git a/pkg/github/teams/item/with_team_escaped_patch_request_body_escaped_notification_escaped_setting.go b/pkg/github/teams/item/with_team_escaped_patch_request_body_escaped_notification_escaped_setting.go new file mode 100644 index 00000000..9bad994e --- /dev/null +++ b/pkg/github/teams/item/with_team_escaped_patch_request_body_escaped_notification_escaped_setting.go @@ -0,0 +1,34 @@ +package item +// The notification setting the team has chosen. Editing teams without specifying this parameter leaves `notification_setting` intact. The options are: * `notifications_enabled` - team members receive notifications when the team is @mentioned. * `notifications_disabled` - no one receives notifications. +type WithTeam_PatchRequestBody_notification_setting int + +const ( + NOTIFICATIONS_ENABLED_WITHTEAM_PATCHREQUESTBODY_NOTIFICATION_SETTING WithTeam_PatchRequestBody_notification_setting = iota + NOTIFICATIONS_DISABLED_WITHTEAM_PATCHREQUESTBODY_NOTIFICATION_SETTING +) + +func (i WithTeam_PatchRequestBody_notification_setting) String() string { + return []string{"notifications_enabled", "notifications_disabled"}[i] +} +func ParseWithTeam_PatchRequestBody_notification_setting(v string) (any, error) { + result := NOTIFICATIONS_ENABLED_WITHTEAM_PATCHREQUESTBODY_NOTIFICATION_SETTING + switch v { + case "notifications_enabled": + result = NOTIFICATIONS_ENABLED_WITHTEAM_PATCHREQUESTBODY_NOTIFICATION_SETTING + case "notifications_disabled": + result = NOTIFICATIONS_DISABLED_WITHTEAM_PATCHREQUESTBODY_NOTIFICATION_SETTING + default: + return nil, nil + } + return &result, nil +} +func SerializeWithTeam_PatchRequestBody_notification_setting(values []WithTeam_PatchRequestBody_notification_setting) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithTeam_PatchRequestBody_notification_setting) isMultiValue() bool { + return false +} diff --git a/pkg/github/teams/item/with_team_escaped_patch_request_body_escaped_permission.go b/pkg/github/teams/item/with_team_escaped_patch_request_body_escaped_permission.go new file mode 100644 index 00000000..e4493fdf --- /dev/null +++ b/pkg/github/teams/item/with_team_escaped_patch_request_body_escaped_permission.go @@ -0,0 +1,37 @@ +package item +// **Deprecated**. The permission that new repositories will be added to the team with when none is specified. +type WithTeam_PatchRequestBody_permission int + +const ( + PULL_WITHTEAM_PATCHREQUESTBODY_PERMISSION WithTeam_PatchRequestBody_permission = iota + PUSH_WITHTEAM_PATCHREQUESTBODY_PERMISSION + ADMIN_WITHTEAM_PATCHREQUESTBODY_PERMISSION +) + +func (i WithTeam_PatchRequestBody_permission) String() string { + return []string{"pull", "push", "admin"}[i] +} +func ParseWithTeam_PatchRequestBody_permission(v string) (any, error) { + result := PULL_WITHTEAM_PATCHREQUESTBODY_PERMISSION + switch v { + case "pull": + result = PULL_WITHTEAM_PATCHREQUESTBODY_PERMISSION + case "push": + result = PUSH_WITHTEAM_PATCHREQUESTBODY_PERMISSION + case "admin": + result = ADMIN_WITHTEAM_PATCHREQUESTBODY_PERMISSION + default: + return nil, nil + } + return &result, nil +} +func SerializeWithTeam_PatchRequestBody_permission(values []WithTeam_PatchRequestBody_permission) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithTeam_PatchRequestBody_permission) isMultiValue() bool { + return false +} diff --git a/pkg/github/teams/item/with_team_escaped_patch_request_body_escaped_privacy.go b/pkg/github/teams/item/with_team_escaped_patch_request_body_escaped_privacy.go new file mode 100644 index 00000000..8159c993 --- /dev/null +++ b/pkg/github/teams/item/with_team_escaped_patch_request_body_escaped_privacy.go @@ -0,0 +1,34 @@ +package item +// The level of privacy this team should have. Editing teams without specifying this parameter leaves `privacy` intact. The options are: **For a non-nested team:** * `secret` - only visible to organization owners and members of this team. * `closed` - visible to all members of this organization. **For a parent or child team:** * `closed` - visible to all members of this organization. +type WithTeam_PatchRequestBody_privacy int + +const ( + SECRET_WITHTEAM_PATCHREQUESTBODY_PRIVACY WithTeam_PatchRequestBody_privacy = iota + CLOSED_WITHTEAM_PATCHREQUESTBODY_PRIVACY +) + +func (i WithTeam_PatchRequestBody_privacy) String() string { + return []string{"secret", "closed"}[i] +} +func ParseWithTeam_PatchRequestBody_privacy(v string) (any, error) { + result := SECRET_WITHTEAM_PATCHREQUESTBODY_PRIVACY + switch v { + case "secret": + result = SECRET_WITHTEAM_PATCHREQUESTBODY_PRIVACY + case "closed": + result = CLOSED_WITHTEAM_PATCHREQUESTBODY_PRIVACY + default: + return nil, nil + } + return &result, nil +} +func SerializeWithTeam_PatchRequestBody_privacy(values []WithTeam_PatchRequestBody_privacy) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithTeam_PatchRequestBody_privacy) isMultiValue() bool { + return false +} diff --git a/pkg/github/teams/item_discussions_item_comments_item_reactions_post_request_body.go b/pkg/github/teams/item_discussions_item_comments_item_reactions_post_request_body.go new file mode 100644 index 00000000..df7c80e7 --- /dev/null +++ b/pkg/github/teams/item_discussions_item_comments_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDiscussionsItemCommentsItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemDiscussionsItemCommentsItemReactionsPostRequestBody instantiates a new ItemDiscussionsItemCommentsItemReactionsPostRequestBody and sets the default values. +func NewItemDiscussionsItemCommentsItemReactionsPostRequestBody()(*ItemDiscussionsItemCommentsItemReactionsPostRequestBody) { + m := &ItemDiscussionsItemCommentsItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDiscussionsItemCommentsItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDiscussionsItemCommentsItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDiscussionsItemCommentsItemReactionsPostRequestBody(), 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 *ItemDiscussionsItemCommentsItemReactionsPostRequestBody) 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 *ItemDiscussionsItemCommentsItemReactionsPostRequestBody) 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 *ItemDiscussionsItemCommentsItemReactionsPostRequestBody) 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 *ItemDiscussionsItemCommentsItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemDiscussionsItemCommentsItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/teams/item_discussions_item_comments_item_reactions_request_builder.go b/pkg/github/teams/item_discussions_item_comments_item_reactions_request_builder.go new file mode 100644 index 00000000..cd177640 --- /dev/null +++ b/pkg/github/teams/item_discussions_item_comments_item_reactions_request_builder.go @@ -0,0 +1,106 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i0e502917b2f0701ab8a9a6e2189eca63fadab16c6e7ceb276965613570b6ac9a "github.com/octokit/go-sdk-enterprise-server/pkg/github/teams/item/discussions/item/comments/item/reactions" +) + +// ItemDiscussionsItemCommentsItemReactionsRequestBuilder builds and executes requests for operations under \teams\{team_id}\discussions\{discussion_number}\comments\{comment_number}\reactions +type ItemDiscussionsItemCommentsItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint.List the reactions to a [team discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment).OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion comment. + Content *i0e502917b2f0701ab8a9a6e2189eca63fadab16c6e7ceb276965613570b6ac9a.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal instantiates a new ItemDiscussionsItemCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + m := &ItemDiscussionsItemCommentsItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemDiscussionsItemCommentsItemReactionsRequestBuilder instantiates a new ItemDiscussionsItemCommentsItemReactionsRequestBuilder and sets the default values. +func NewItemDiscussionsItemCommentsItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint.List the reactions to a [team discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment).OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a []Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment-legacy +func (m *ItemDiscussionsItemCommentsItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable) + } + } + return val, nil +} +// Post > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint.Create a reaction to a [team discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment).A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment-legacy +func (m *ItemDiscussionsItemCommentsItemReactionsRequestBuilder) Post(ctx context.Context, body ItemDiscussionsItemCommentsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable), nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion comment`](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-a-team-discussion-comment) endpoint.List the reactions to a [team discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment).OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemCommentsItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsItemCommentsItemReactionsRequestBuilderGetQueryParameters])(*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 > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Create reaction for a team discussion comment](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#create-reaction-for-a-team-discussion-comment)" endpoint.Create a reaction to a [team discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment).A response with an HTTP `200` status means that you already added the reaction type to this team discussion comment.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemCommentsItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemDiscussionsItemCommentsItemReactionsPostRequestBodyable, 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. +// Deprecated: +// returns a *ItemDiscussionsItemCommentsItemReactionsRequestBuilder when successful +func (m *ItemDiscussionsItemCommentsItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + return NewItemDiscussionsItemCommentsItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/teams/item_discussions_item_comments_item_with_comment_escaped_number_patch_request_body.go b/pkg/github/teams/item_discussions_item_comments_item_with_comment_escaped_number_patch_request_body.go new file mode 100644 index 00000000..74f0d6d8 --- /dev/null +++ b/pkg/github/teams/item_discussions_item_comments_item_with_comment_escaped_number_patch_request_body.go @@ -0,0 +1,80 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody 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 discussion comment's body text. + body *string +} +// NewItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody instantiates a new ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody and sets the default values. +func NewItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody()(*ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) { + m := &ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody(), 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 *ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion comment's body text. +// returns a *string when successful +func (m *ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion comment's body text. +func (m *ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/pkg/github/teams/item_discussions_item_comments_post_request_body.go b/pkg/github/teams/item_discussions_item_comments_post_request_body.go new file mode 100644 index 00000000..93b15090 --- /dev/null +++ b/pkg/github/teams/item_discussions_item_comments_post_request_body.go @@ -0,0 +1,80 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDiscussionsItemCommentsPostRequestBody 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 discussion comment's body text. + body *string +} +// NewItemDiscussionsItemCommentsPostRequestBody instantiates a new ItemDiscussionsItemCommentsPostRequestBody and sets the default values. +func NewItemDiscussionsItemCommentsPostRequestBody()(*ItemDiscussionsItemCommentsPostRequestBody) { + m := &ItemDiscussionsItemCommentsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDiscussionsItemCommentsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDiscussionsItemCommentsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDiscussionsItemCommentsPostRequestBody(), 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 *ItemDiscussionsItemCommentsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion comment's body text. +// returns a *string when successful +func (m *ItemDiscussionsItemCommentsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemDiscussionsItemCommentsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *ItemDiscussionsItemCommentsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + 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 *ItemDiscussionsItemCommentsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion comment's body text. +func (m *ItemDiscussionsItemCommentsPostRequestBody) SetBody(value *string)() { + m.body = value +} +type ItemDiscussionsItemCommentsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + SetBody(value *string)() +} diff --git a/pkg/github/teams/item_discussions_item_comments_request_builder.go b/pkg/github/teams/item_discussions_item_comments_request_builder.go new file mode 100644 index 00000000..88ecb9ce --- /dev/null +++ b/pkg/github/teams/item_discussions_item_comments_request_builder.go @@ -0,0 +1,118 @@ +package teams + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i7f894752788a21e319d42021818012cfae50b0fcbfd6a0ab4d54cf93b24873d7 "github.com/octokit/go-sdk-enterprise-server/pkg/github/teams/item/discussions/item/comments" +) + +// ItemDiscussionsItemCommentsRequestBuilder builds and executes requests for operations under \teams\{team_id}\discussions\{discussion_number}\comments +type ItemDiscussionsItemCommentsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDiscussionsItemCommentsRequestBuilderGetQueryParameters > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#list-discussion-comments) endpoint.List all comments on a team discussion.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemDiscussionsItemCommentsRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i7f894752788a21e319d42021818012cfae50b0fcbfd6a0ab4d54cf93b24873d7.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByComment_number gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.teams.item.discussions.item.comments.item collection +// Deprecated: +// returns a *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder when successful +func (m *ItemDiscussionsItemCommentsRequestBuilder) ByComment_number(comment_number int32)(*ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["comment_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(comment_number), 10) + return NewItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDiscussionsItemCommentsRequestBuilderInternal instantiates a new ItemDiscussionsItemCommentsRequestBuilder and sets the default values. +func NewItemDiscussionsItemCommentsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemCommentsRequestBuilder) { + m := &ItemDiscussionsItemCommentsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/discussions/{discussion_number}/comments{?direction*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemDiscussionsItemCommentsRequestBuilder instantiates a new ItemDiscussionsItemCommentsRequestBuilder and sets the default values. +func NewItemDiscussionsItemCommentsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemCommentsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDiscussionsItemCommentsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#list-discussion-comments) endpoint.List all comments on a team discussion.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a []TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#list-discussion-comments-legacy +func (m *ItemDiscussionsItemCommentsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsItemCommentsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable) + } + } + return val, nil +} +// Post > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#create-a-discussion-comment) endpoint.Creates a new comment on a team discussion.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#create-a-discussion-comment-legacy +func (m *ItemDiscussionsItemCommentsRequestBuilder) Post(ctx context.Context, body ItemDiscussionsItemCommentsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable), nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List discussion comments](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#list-discussion-comments) endpoint.List all comments on a team discussion.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemCommentsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsItemCommentsRequestBuilderGetQueryParameters])(*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 > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Create a discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#create-a-discussion-comment) endpoint.Creates a new comment on a team discussion.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemCommentsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemDiscussionsItemCommentsPostRequestBodyable, 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. +// Deprecated: +// returns a *ItemDiscussionsItemCommentsRequestBuilder when successful +func (m *ItemDiscussionsItemCommentsRequestBuilder) WithUrl(rawUrl string)(*ItemDiscussionsItemCommentsRequestBuilder) { + return NewItemDiscussionsItemCommentsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/teams/item_discussions_item_comments_with_comment_escaped_number_item_request_builder.go b/pkg/github/teams/item_discussions_item_comments_with_comment_escaped_number_item_request_builder.go new file mode 100644 index 00000000..2ebd78cc --- /dev/null +++ b/pkg/github/teams/item_discussions_item_comments_with_comment_escaped_number_item_request_builder.go @@ -0,0 +1,122 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder builds and executes requests for operations under \teams\{team_id}\discussions\{discussion_number}\comments\{comment_number} +type ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal instantiates a new ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder and sets the default values. +func NewItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + m := &ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/discussions/{discussion_number}/comments/{comment_number}", pathParameters), + } + return m +} +// NewItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder instantiates a new ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder and sets the default values. +func NewItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDiscussionsItemCommentsWithComment_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint.Deletes a comment on a team discussion.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#delete-a-discussion-comment-legacy +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment) endpoint.Get a specific comment on a team discussion.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment-legacy +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable), nil +} +// Patch > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#update-a-discussion-comment) endpoint.Edits the body text of a discussion comment.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a TeamDiscussionCommentable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#update-a-discussion-comment-legacy +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Patch(ctx context.Context, body ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionCommentFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionCommentable), nil +} +// Reactions the reactions property +// returns a *ItemDiscussionsItemCommentsItemReactionsRequestBuilder when successful +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) Reactions()(*ItemDiscussionsItemCommentsItemReactionsRequestBuilder) { + return NewItemDiscussionsItemCommentsItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#delete-a-discussion-comment) endpoint.Deletes a comment on a team discussion.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) 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 +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#get-a-discussion-comment) endpoint.Get a specific comment on a team discussion.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) 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 > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion comment](https://docs.github.com/enterprise-server@3.14/rest/teams/discussion-comments#update-a-discussion-comment) endpoint.Edits the body text of a discussion comment.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemDiscussionsItemCommentsItemWithComment_numberPatchRequestBodyable, 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. +// Deprecated: +// returns a *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder when successful +func (m *ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder) { + return NewItemDiscussionsItemCommentsWithComment_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/teams/item_discussions_item_reactions_post_request_body.go b/pkg/github/teams/item_discussions_item_reactions_post_request_body.go new file mode 100644 index 00000000..1745132b --- /dev/null +++ b/pkg/github/teams/item_discussions_item_reactions_post_request_body.go @@ -0,0 +1,51 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDiscussionsItemReactionsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemDiscussionsItemReactionsPostRequestBody instantiates a new ItemDiscussionsItemReactionsPostRequestBody and sets the default values. +func NewItemDiscussionsItemReactionsPostRequestBody()(*ItemDiscussionsItemReactionsPostRequestBody) { + m := &ItemDiscussionsItemReactionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDiscussionsItemReactionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDiscussionsItemReactionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDiscussionsItemReactionsPostRequestBody(), 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 *ItemDiscussionsItemReactionsPostRequestBody) 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 *ItemDiscussionsItemReactionsPostRequestBody) 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 *ItemDiscussionsItemReactionsPostRequestBody) 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 *ItemDiscussionsItemReactionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemDiscussionsItemReactionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/teams/item_discussions_item_reactions_request_builder.go b/pkg/github/teams/item_discussions_item_reactions_request_builder.go new file mode 100644 index 00000000..144f5a59 --- /dev/null +++ b/pkg/github/teams/item_discussions_item_reactions_request_builder.go @@ -0,0 +1,106 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i1a1e729735b51f95530640f79216c59be351602f9fad69552a42b1352cd6f655 "github.com/octokit/go-sdk-enterprise-server/pkg/github/teams/item/discussions/item/reactions" +) + +// ItemDiscussionsItemReactionsRequestBuilder builds and executes requests for operations under \teams\{team_id}\discussions\{discussion_number}\reactions +type ItemDiscussionsItemReactionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDiscussionsItemReactionsRequestBuilderGetQueryParameters > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint.List the reactions to a [team discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion).OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemDiscussionsItemReactionsRequestBuilderGetQueryParameters struct { + // Returns a single [reaction type](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#about-reactions). Omit this parameter to list all reactions to a team discussion. + Content *i1a1e729735b51f95530640f79216c59be351602f9fad69552a42b1352cd6f655.GetContentQueryParameterType `uriparametername:"content"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemDiscussionsItemReactionsRequestBuilderInternal instantiates a new ItemDiscussionsItemReactionsRequestBuilder and sets the default values. +func NewItemDiscussionsItemReactionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemReactionsRequestBuilder) { + m := &ItemDiscussionsItemReactionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/discussions/{discussion_number}/reactions{?content*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemDiscussionsItemReactionsRequestBuilder instantiates a new ItemDiscussionsItemReactionsRequestBuilder and sets the default values. +func NewItemDiscussionsItemReactionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsItemReactionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDiscussionsItemReactionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint.List the reactions to a [team discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion).OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a []Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-a-team-discussion-legacy +func (m *ItemDiscussionsItemReactionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsItemReactionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable) + } + } + return val, nil +} +// Post > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint.Create a reaction to a [team discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion).A response with an HTTP `200` status means that you already added the reaction type to this team discussion.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a Reactionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#create-reaction-for-a-team-discussion-legacy +func (m *ItemDiscussionsItemReactionsRequestBuilder) Post(ctx context.Context, body ItemDiscussionsItemReactionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateReactionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Reactionable), nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List reactions for a team discussion`](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#list-reactions-for-a-team-discussion) endpoint.List the reactions to a [team discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion).OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemReactionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsItemReactionsRequestBuilderGetQueryParameters])(*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 > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create reaction for a team discussion`](https://docs.github.com/enterprise-server@3.14/rest/reactions/reactions#create-reaction-for-a-team-discussion) endpoint.Create a reaction to a [team discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion).A response with an HTTP `200` status means that you already added the reaction type to this team discussion.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsItemReactionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemDiscussionsItemReactionsPostRequestBodyable, 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. +// Deprecated: +// returns a *ItemDiscussionsItemReactionsRequestBuilder when successful +func (m *ItemDiscussionsItemReactionsRequestBuilder) WithUrl(rawUrl string)(*ItemDiscussionsItemReactionsRequestBuilder) { + return NewItemDiscussionsItemReactionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/teams/item_discussions_item_with_discussion_escaped_number_patch_request_body.go b/pkg/github/teams/item_discussions_item_with_discussion_escaped_number_patch_request_body.go new file mode 100644 index 00000000..6922f186 --- /dev/null +++ b/pkg/github/teams/item_discussions_item_with_discussion_escaped_number_patch_request_body.go @@ -0,0 +1,109 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDiscussionsItemWithDiscussion_numberPatchRequestBody 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 discussion post's body text. + body *string + // The discussion post's title. + title *string +} +// NewItemDiscussionsItemWithDiscussion_numberPatchRequestBody instantiates a new ItemDiscussionsItemWithDiscussion_numberPatchRequestBody and sets the default values. +func NewItemDiscussionsItemWithDiscussion_numberPatchRequestBody()(*ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) { + m := &ItemDiscussionsItemWithDiscussion_numberPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDiscussionsItemWithDiscussion_numberPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDiscussionsItemWithDiscussion_numberPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDiscussionsItemWithDiscussion_numberPatchRequestBody(), 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 *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion post's body text. +// returns a *string when successful +func (m *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetTitle gets the title property value. The discussion post's title. +// returns a *string when successful +func (m *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion post's body text. +func (m *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) SetBody(value *string)() { + m.body = value +} +// SetTitle sets the title property value. The discussion post's title. +func (m *ItemDiscussionsItemWithDiscussion_numberPatchRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemDiscussionsItemWithDiscussion_numberPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetTitle()(*string) + SetBody(value *string)() + SetTitle(value *string)() +} diff --git a/pkg/github/teams/item_discussions_post_request_body.go b/pkg/github/teams/item_discussions_post_request_body.go new file mode 100644 index 00000000..118eabbc --- /dev/null +++ b/pkg/github/teams/item_discussions_post_request_body.go @@ -0,0 +1,138 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemDiscussionsPostRequestBody 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 discussion post's body text. + body *string + // Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. + private *bool + // The discussion post's title. + title *string +} +// NewItemDiscussionsPostRequestBody instantiates a new ItemDiscussionsPostRequestBody and sets the default values. +func NewItemDiscussionsPostRequestBody()(*ItemDiscussionsPostRequestBody) { + m := &ItemDiscussionsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemDiscussionsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemDiscussionsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemDiscussionsPostRequestBody(), 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 *ItemDiscussionsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. The discussion post's body text. +// returns a *string when successful +func (m *ItemDiscussionsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ItemDiscussionsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(val) + } + return nil + } + res["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetPrivate gets the private property value. Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. +// returns a *bool when successful +func (m *ItemDiscussionsPostRequestBody) GetPrivate()(*bool) { + return m.private +} +// GetTitle gets the title property value. The discussion post's title. +// returns a *string when successful +func (m *ItemDiscussionsPostRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *ItemDiscussionsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *ItemDiscussionsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. The discussion post's body text. +func (m *ItemDiscussionsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetPrivate sets the private property value. Private posts are only visible to team members, organization owners, and team maintainers. Public posts are visible to all members of the organization. Set to `true` to create a private post. +func (m *ItemDiscussionsPostRequestBody) SetPrivate(value *bool)() { + m.private = value +} +// SetTitle sets the title property value. The discussion post's title. +func (m *ItemDiscussionsPostRequestBody) SetTitle(value *string)() { + m.title = value +} +type ItemDiscussionsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetPrivate()(*bool) + GetTitle()(*string) + SetBody(value *string)() + SetPrivate(value *bool)() + SetTitle(value *string)() +} diff --git a/pkg/github/teams/item_discussions_request_builder.go b/pkg/github/teams/item_discussions_request_builder.go new file mode 100644 index 00000000..57206a0d --- /dev/null +++ b/pkg/github/teams/item_discussions_request_builder.go @@ -0,0 +1,118 @@ +package teams + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i74905effaddfad2641db8adcacd6698497990d022175c92bee611240571486b8 "github.com/octokit/go-sdk-enterprise-server/pkg/github/teams/item/discussions" +) + +// ItemDiscussionsRequestBuilder builds and executes requests for operations under \teams\{team_id}\discussions +type ItemDiscussionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemDiscussionsRequestBuilderGetQueryParameters > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#list-discussions) endpoint.List all discussions on a team's page.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +type ItemDiscussionsRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *i74905effaddfad2641db8adcacd6698497990d022175c92bee611240571486b8.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByDiscussion_number gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.teams.item.discussions.item collection +// Deprecated: +// returns a *ItemDiscussionsWithDiscussion_numberItemRequestBuilder when successful +func (m *ItemDiscussionsRequestBuilder) ByDiscussion_number(discussion_number int32)(*ItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["discussion_number"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(discussion_number), 10) + return NewItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDiscussionsRequestBuilderInternal instantiates a new ItemDiscussionsRequestBuilder and sets the default values. +func NewItemDiscussionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsRequestBuilder) { + m := &ItemDiscussionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/discussions{?direction*,page*,per_page*}", pathParameters), + } + return m +} +// NewItemDiscussionsRequestBuilder instantiates a new ItemDiscussionsRequestBuilder and sets the default values. +func NewItemDiscussionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDiscussionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#list-discussions) endpoint.List all discussions on a team's page.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a []TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#list-discussions-legacy +func (m *ItemDiscussionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable) + } + } + return val, nil +} +// Post > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#create-a-discussion) endpoint.Creates a new discussion post on a team's page.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#create-a-discussion-legacy +func (m *ItemDiscussionsRequestBuilder) Post(ctx context.Context, body ItemDiscussionsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable), nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List discussions`](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#list-discussions) endpoint.List all discussions on a team's page.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemDiscussionsRequestBuilderGetQueryParameters])(*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 > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Create a discussion`](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#create-a-discussion) endpoint.Creates a new discussion post on a team's page.This endpoint triggers [notifications](https://docs.github.com/enterprise-server@3.14/github/managing-subscriptions-and-notifications-on-github/about-notifications). Creating content too quickly using this endpoint may result in secondary rate limiting. For more information, see "[Rate limits for the API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/rate-limits-for-the-rest-api#about-secondary-rate-limits)" and "[Best practices for using the REST API](https://docs.github.com/enterprise-server@3.14/rest/guides/best-practices-for-using-the-rest-api)."OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemDiscussionsPostRequestBodyable, 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. +// Deprecated: +// returns a *ItemDiscussionsRequestBuilder when successful +func (m *ItemDiscussionsRequestBuilder) WithUrl(rawUrl string)(*ItemDiscussionsRequestBuilder) { + return NewItemDiscussionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/teams/item_discussions_with_discussion_escaped_number_item_request_builder.go b/pkg/github/teams/item_discussions_with_discussion_escaped_number_item_request_builder.go new file mode 100644 index 00000000..f66dee91 --- /dev/null +++ b/pkg/github/teams/item_discussions_with_discussion_escaped_number_item_request_builder.go @@ -0,0 +1,127 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemDiscussionsWithDiscussion_numberItemRequestBuilder builds and executes requests for operations under \teams\{team_id}\discussions\{discussion_number} +type ItemDiscussionsWithDiscussion_numberItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Comments the comments property +// returns a *ItemDiscussionsItemCommentsRequestBuilder when successful +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) Comments()(*ItemDiscussionsItemCommentsRequestBuilder) { + return NewItemDiscussionsItemCommentsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal instantiates a new ItemDiscussionsWithDiscussion_numberItemRequestBuilder and sets the default values. +func NewItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + m := &ItemDiscussionsWithDiscussion_numberItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/discussions/{discussion_number}", pathParameters), + } + return m +} +// NewItemDiscussionsWithDiscussion_numberItemRequestBuilder instantiates a new ItemDiscussionsWithDiscussion_numberItemRequestBuilder and sets the default values. +func NewItemDiscussionsWithDiscussion_numberItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDiscussionsWithDiscussion_numberItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#delete-a-discussion) endpoint.Delete a discussion from a team's page.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#delete-a-discussion-legacy +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion) endpoint.Get a specific discussion on a team's page.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion-legacy +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable), nil +} +// Patch > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#update-a-discussion) endpoint.Edits the title and body text of a discussion post. Only the parameters you provide are updated.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a TeamDiscussionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#update-a-discussion-legacy +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) Patch(ctx context.Context, body ItemDiscussionsItemWithDiscussion_numberPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamDiscussionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamDiscussionable), nil +} +// Reactions the reactions property +// returns a *ItemDiscussionsItemReactionsRequestBuilder when successful +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) Reactions()(*ItemDiscussionsItemReactionsRequestBuilder) { + return NewItemDiscussionsItemReactionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`Delete a discussion`](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#delete-a-discussion) endpoint.Delete a discussion from a team's page.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) 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 +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get a discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#get-a-discussion) endpoint.Get a specific discussion on a team's page.OAuth app tokens and personal access tokens (classic) need the `read:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) 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 > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a discussion](https://docs.github.com/enterprise-server@3.14/rest/teams/discussions#update-a-discussion) endpoint.Edits the title and body text of a discussion post. Only the parameters you provide are updated.OAuth app tokens and personal access tokens (classic) need the `write:discussion` scope to use this endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemDiscussionsItemWithDiscussion_numberPatchRequestBodyable, 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. +// Deprecated: +// returns a *ItemDiscussionsWithDiscussion_numberItemRequestBuilder when successful +func (m *ItemDiscussionsWithDiscussion_numberItemRequestBuilder) WithUrl(rawUrl string)(*ItemDiscussionsWithDiscussion_numberItemRequestBuilder) { + return NewItemDiscussionsWithDiscussion_numberItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/teams/item_members_request_builder.go b/pkg/github/teams/item_members_request_builder.go new file mode 100644 index 00000000..d7ac097b --- /dev/null +++ b/pkg/github/teams/item_members_request_builder.go @@ -0,0 +1,90 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i4f50812fb596eef609cfbe24dd53d962613e025aa96b09d82fd9cab69eec53b9 "github.com/octokit/go-sdk-enterprise-server/pkg/github/teams/item/members" +) + +// ItemMembersRequestBuilder builds and executes requests for operations under \teams\{team_id}\members +type ItemMembersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemMembersRequestBuilderGetQueryParameters > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/enterprise-server@3.14/rest/teams/members#list-team-members) endpoint.Team members will include the members of child teams. +type ItemMembersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Filters members returned by their role in the team. + Role *i4f50812fb596eef609cfbe24dd53d962613e025aa96b09d82fd9cab69eec53b9.GetRoleQueryParameterType `uriparametername:"role"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.teams.item.members.item collection +// Deprecated: +// returns a *ItemMembersWithUsernameItemRequestBuilder when successful +func (m *ItemMembersRequestBuilder) ByUsername(username string)(*ItemMembersWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemMembersWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMembersRequestBuilderInternal instantiates a new ItemMembersRequestBuilder and sets the default values. +func NewItemMembersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersRequestBuilder) { + m := &ItemMembersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/members{?page*,per_page*,role*}", pathParameters), + } + return m +} +// NewItemMembersRequestBuilder instantiates a new ItemMembersRequestBuilder and sets the default values. +func NewItemMembersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/enterprise-server@3.14/rest/teams/members#list-team-members) endpoint.Team members will include the members of child teams. +// Deprecated: +// returns a []SimpleUserable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/members#list-team-members-legacy +func (m *ItemMembersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMembersRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team members`](https://docs.github.com/enterprise-server@3.14/rest/teams/members#list-team-members) endpoint.Team members will include the members of child teams. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemMembersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemMembersRequestBuilderGetQueryParameters])(*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. +// Deprecated: +// returns a *ItemMembersRequestBuilder when successful +func (m *ItemMembersRequestBuilder) WithUrl(rawUrl string)(*ItemMembersRequestBuilder) { + return NewItemMembersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/teams/item_members_with_username_item_request_builder.go b/pkg/github/teams/item_members_with_username_item_request_builder.go new file mode 100644 index 00000000..b90b94dc --- /dev/null +++ b/pkg/github/teams/item_members_with_username_item_request_builder.go @@ -0,0 +1,108 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemMembersWithUsernameItemRequestBuilder builds and executes requests for operations under \teams\{team_id}\members\{username} +type ItemMembersWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMembersWithUsernameItemRequestBuilderInternal instantiates a new ItemMembersWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembersWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersWithUsernameItemRequestBuilder) { + m := &ItemMembersWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/members/{username}", pathParameters), + } + return m +} +// NewItemMembersWithUsernameItemRequestBuilder instantiates a new ItemMembersWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembersWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembersWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembersWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete the "Remove team member" endpoint (described below) is deprecated.We recommend using the [Remove team membership for a user](https://docs.github.com/enterprise-server@3.14/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team.> [!NOTE]> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/enterprise-server@3.14/articles/synchronizing-teams-between-your-identity-provider-and-github/)." +// Deprecated: +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/members#remove-team-member-legacy +func (m *ItemMembersWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get the "Get team member" endpoint (described below) is deprecated.We recommend using the [Get team membership for a user](https://docs.github.com/enterprise-server@3.14/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships.To list members in a team, the team must be visible to the authenticated user. +// Deprecated: +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/members#get-team-member-legacy +func (m *ItemMembersWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put the "Add team member" endpoint (described below) is deprecated.We recommend using the [Add or update team membership for a user](https://docs.github.com/enterprise-server@3.14/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization.> [!NOTE]> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/enterprise-server@3.14/articles/synchronizing-teams-between-your-identity-provider-and-github/)."Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// Deprecated: +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/members#add-team-member-legacy +func (m *ItemMembersWithUsernameItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation the "Remove team member" endpoint (described below) is deprecated.We recommend using the [Remove team membership for a user](https://docs.github.com/enterprise-server@3.14/rest/teams/members#remove-team-membership-for-a-user) endpoint instead. It allows you to remove both active and pending memberships.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To remove a team member, the authenticated user must have 'admin' permissions to the team or be an owner of the org that the team is associated with. Removing a team member does not delete the user, it just removes them from the team.> [!NOTE]> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/enterprise-server@3.14/articles/synchronizing-teams-between-your-identity-provider-and-github/)." +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) 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 +} +// ToGetRequestInformation the "Get team member" endpoint (described below) is deprecated.We recommend using the [Get team membership for a user](https://docs.github.com/enterprise-server@3.14/rest/teams/members#get-team-membership-for-a-user) endpoint instead. It allows you to get both active and pending memberships.To list members in a team, the team must be visible to the authenticated user. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) 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) + return requestInfo, nil +} +// ToPutRequestInformation the "Add team member" endpoint (described below) is deprecated.We recommend using the [Add or update team membership for a user](https://docs.github.com/enterprise-server@3.14/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint instead. It allows you to invite new organization members to your teams.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To add someone to a team, the authenticated user must be an organization owner or a team maintainer in the team they're changing. The person being added to the team must be a member of the team's organization.> [!NOTE]> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/enterprise-server@3.14/articles/synchronizing-teams-between-your-identity-provider-and-github/)."Note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, 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") + 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 *ItemMembersWithUsernameItemRequestBuilder when successful +func (m *ItemMembersWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemMembersWithUsernameItemRequestBuilder) { + return NewItemMembersWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/teams/item_memberships_item_with_username_put_request_body.go b/pkg/github/teams/item_memberships_item_with_username_put_request_body.go new file mode 100644 index 00000000..a5846458 --- /dev/null +++ b/pkg/github/teams/item_memberships_item_with_username_put_request_body.go @@ -0,0 +1,51 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemMembershipsItemWithUsernamePutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemMembershipsItemWithUsernamePutRequestBody instantiates a new ItemMembershipsItemWithUsernamePutRequestBody and sets the default values. +func NewItemMembershipsItemWithUsernamePutRequestBody()(*ItemMembershipsItemWithUsernamePutRequestBody) { + m := &ItemMembershipsItemWithUsernamePutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemMembershipsItemWithUsernamePutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemMembershipsItemWithUsernamePutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemMembershipsItemWithUsernamePutRequestBody(), 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 *ItemMembershipsItemWithUsernamePutRequestBody) 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 *ItemMembershipsItemWithUsernamePutRequestBody) 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 *ItemMembershipsItemWithUsernamePutRequestBody) 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 *ItemMembershipsItemWithUsernamePutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemMembershipsItemWithUsernamePutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/teams/item_memberships_request_builder.go b/pkg/github/teams/item_memberships_request_builder.go new file mode 100644 index 00000000..71ac6a82 --- /dev/null +++ b/pkg/github/teams/item_memberships_request_builder.go @@ -0,0 +1,36 @@ +package teams + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemMembershipsRequestBuilder builds and executes requests for operations under \teams\{team_id}\memberships +type ItemMembershipsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByUsername gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.teams.item.memberships.item collection +// Deprecated: +// returns a *ItemMembershipsWithUsernameItemRequestBuilder when successful +func (m *ItemMembershipsRequestBuilder) ByUsername(username string)(*ItemMembershipsWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewItemMembershipsWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemMembershipsRequestBuilderInternal instantiates a new ItemMembershipsRequestBuilder and sets the default values. +func NewItemMembershipsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsRequestBuilder) { + m := &ItemMembershipsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/memberships", pathParameters), + } + return m +} +// NewItemMembershipsRequestBuilder instantiates a new ItemMembershipsRequestBuilder and sets the default values. +func NewItemMembershipsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembershipsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/teams/item_memberships_with_username_item_request_builder.go b/pkg/github/teams/item_memberships_with_username_item_request_builder.go new file mode 100644 index 00000000..14ee7a99 --- /dev/null +++ b/pkg/github/teams/item_memberships_with_username_item_request_builder.go @@ -0,0 +1,125 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemMembershipsWithUsernameItemRequestBuilder builds and executes requests for operations under \teams\{team_id}\memberships\{username} +type ItemMembershipsWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemMembershipsWithUsernameItemRequestBuilderInternal instantiates a new ItemMembershipsWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembershipsWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsWithUsernameItemRequestBuilder) { + m := &ItemMembershipsWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/memberships/{username}", pathParameters), + } + return m +} +// NewItemMembershipsWithUsernameItemRequestBuilder instantiates a new ItemMembershipsWithUsernameItemRequestBuilder and sets the default values. +func NewItemMembershipsWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemMembershipsWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemMembershipsWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/enterprise-server@3.14/rest/teams/members#remove-team-membership-for-a-user) endpoint.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.> [!NOTE]> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/enterprise-server@3.14/articles/synchronizing-teams-between-your-identity-provider-and-github/)." +// Deprecated: +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/members#remove-team-membership-for-a-user-legacy +func (m *ItemMembershipsWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/enterprise-server@3.14/rest/teams/members#get-team-membership-for-a-user) endpoint.Team members will include the members of child teams.To get a user's membership with a team, the team must be visible to the authenticated user.**Note:**The response contains the `state` of the membership and the member's `role`.The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#create-a-team). +// Deprecated: +// returns a TeamMembershipable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/members#get-team-membership-for-a-user-legacy +func (m *ItemMembershipsWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamMembershipable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamMembershipFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamMembershipable), nil +} +// Put > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/enterprise-server@3.14/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer.> [!NOTE]> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/enterprise-server@3.14/articles/synchronizing-teams-between-your-identity-provider-and-github/)."If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner.If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. +// Deprecated: +// returns a TeamMembershipable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/members#add-or-update-team-membership-for-a-user-legacy +func (m *ItemMembershipsWithUsernameItemRequestBuilder) Put(ctx context.Context, body ItemMembershipsItemWithUsernamePutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamMembershipable, error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamMembershipFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamMembershipable), nil +} +// ToDeleteRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove team membership for a user](https://docs.github.com/enterprise-server@3.14/rest/teams/members#remove-team-membership-for-a-user) endpoint.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.To remove a membership between a user and a team, the authenticated user must have 'admin' permissions to the team or be an owner of the organization that the team is associated with. Removing team membership does not delete the user, it just removes their membership from the team.> [!NOTE]> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/enterprise-server@3.14/articles/synchronizing-teams-between-your-identity-provider-and-github/)." +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) 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 +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Get team membership for a user](https://docs.github.com/enterprise-server@3.14/rest/teams/members#get-team-membership-for-a-user) endpoint.Team members will include the members of child teams.To get a user's membership with a team, the team must be visible to the authenticated user.**Note:**The response contains the `state` of the membership and the member's `role`.The `role` for organization owners is set to `maintainer`. For more information about `maintainer` roles, see [Create a team](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#create-a-team). +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) 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 +} +// ToPutRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team membership for a user](https://docs.github.com/enterprise-server@3.14/rest/teams/members#add-or-update-team-membership-for-a-user) endpoint.Team synchronization is available for organizations using GitHub Enterprise Cloud. For more information, see [GitHub's products](https://docs.github.com/enterprise-server@3.14/github/getting-started-with-github/githubs-products) in the GitHub Help documentation.If the user is already a member of the team's organization, this endpoint will add the user to the team. To add a membership between an organization member and a team, the authenticated user must be an organization owner or a team maintainer.> [!NOTE]> When you have team synchronization set up for a team with your organization's identity provider (IdP), you will see an error if you attempt to use the API for making changes to the team's membership. If you have access to manage group membership in your IdP, you can manage GitHub Enterprise Server team membership through your identity provider, which automatically adds and removes team members in an organization. For more information, see "[Synchronizing teams between your identity provider and GitHub Enterprise Server](https://docs.github.com/enterprise-server@3.14/articles/synchronizing-teams-between-your-identity-provider-and-github/)."If the user is unaffiliated with the team's organization, this endpoint will send an invitation to the user via email. This newly-created membership will be in the "pending" state until the user accepts the invitation, at which point the membership will transition to the "active" state and the user will be added as a member of the team. To add a membership between an unaffiliated user and a team, the authenticated user must be an organization owner.If the user is already a member of the team, this endpoint will update the role of the team member's role. To update the membership of a team member, the authenticated user must be an organization owner or a team maintainer. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemMembershipsItemWithUsernamePutRequestBodyable, 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. +// Deprecated: +// returns a *ItemMembershipsWithUsernameItemRequestBuilder when successful +func (m *ItemMembershipsWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*ItemMembershipsWithUsernameItemRequestBuilder) { + return NewItemMembershipsWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/teams/item_projects_item_with_project_escaped_403_error.go b/pkg/github/teams/item_projects_item_with_project_escaped_403_error.go new file mode 100644 index 00000000..a05755eb --- /dev/null +++ b/pkg/github/teams/item_projects_item_with_project_escaped_403_error.go @@ -0,0 +1,117 @@ +package teams + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemProjectsItemWithProject_403Error 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 documentation_url property + documentation_url *string + // The message property + message *string +} +// NewItemProjectsItemWithProject_403Error instantiates a new ItemProjectsItemWithProject_403Error and sets the default values. +func NewItemProjectsItemWithProject_403Error()(*ItemProjectsItemWithProject_403Error) { + m := &ItemProjectsItemWithProject_403Error{ + ApiError: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewApiError(), + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemProjectsItemWithProject_403ErrorFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemProjectsItemWithProject_403ErrorFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemProjectsItemWithProject_403Error(), nil +} +// Error the primary error message. +// returns a string when successful +func (m *ItemProjectsItemWithProject_403Error) 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 *ItemProjectsItemWithProject_403Error) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDocumentationUrl gets the documentation_url property value. The documentation_url property +// returns a *string when successful +func (m *ItemProjectsItemWithProject_403Error) 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 *ItemProjectsItemWithProject_403Error) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + 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 *ItemProjectsItemWithProject_403Error) GetMessage()(*string) { + return m.message +} +// Serialize serializes information the current object +func (m *ItemProjectsItemWithProject_403Error) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + 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 *ItemProjectsItemWithProject_403Error) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDocumentationUrl sets the documentation_url property value. The documentation_url property +func (m *ItemProjectsItemWithProject_403Error) SetDocumentationUrl(value *string)() { + m.documentation_url = value +} +// SetMessage sets the message property value. The message property +func (m *ItemProjectsItemWithProject_403Error) SetMessage(value *string)() { + m.message = value +} +type ItemProjectsItemWithProject_403Errorable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDocumentationUrl()(*string) + GetMessage()(*string) + SetDocumentationUrl(value *string)() + SetMessage(value *string)() +} diff --git a/pkg/github/teams/item_projects_item_with_project_escaped_put_request_body.go b/pkg/github/teams/item_projects_item_with_project_escaped_put_request_body.go new file mode 100644 index 00000000..173232ac --- /dev/null +++ b/pkg/github/teams/item_projects_item_with_project_escaped_put_request_body.go @@ -0,0 +1,51 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemProjectsItemWithProject_PutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemProjectsItemWithProject_PutRequestBody instantiates a new ItemProjectsItemWithProject_PutRequestBody and sets the default values. +func NewItemProjectsItemWithProject_PutRequestBody()(*ItemProjectsItemWithProject_PutRequestBody) { + m := &ItemProjectsItemWithProject_PutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemProjectsItemWithProject_PutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemProjectsItemWithProject_PutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemProjectsItemWithProject_PutRequestBody(), nil +} +// GetAdditionalData gets the AdditionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. +// returns a map[string]any when successful +func (m *ItemProjectsItemWithProject_PutRequestBody) 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 *ItemProjectsItemWithProject_PutRequestBody) 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 *ItemProjectsItemWithProject_PutRequestBody) 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 *ItemProjectsItemWithProject_PutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemProjectsItemWithProject_PutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/teams/item_projects_request_builder.go b/pkg/github/teams/item_projects_request_builder.go new file mode 100644 index 00000000..58952e99 --- /dev/null +++ b/pkg/github/teams/item_projects_request_builder.go @@ -0,0 +1,86 @@ +package teams + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemProjectsRequestBuilder builds and executes requests for operations under \teams\{team_id}\projects +type ItemProjectsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemProjectsRequestBuilderGetQueryParameters > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-team-projects) endpoint.Lists the organization projects for a team. +type ItemProjectsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByProject_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.teams.item.projects.item collection +// Deprecated: +// returns a *ItemProjectsWithProject_ItemRequestBuilder when successful +func (m *ItemProjectsRequestBuilder) ByProject_id(project_id int32)(*ItemProjectsWithProject_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["project_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(project_id), 10) + return NewItemProjectsWithProject_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemProjectsRequestBuilderInternal instantiates a new ItemProjectsRequestBuilder and sets the default values. +func NewItemProjectsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsRequestBuilder) { + m := &ItemProjectsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/projects{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemProjectsRequestBuilder instantiates a new ItemProjectsRequestBuilder and sets the default values. +func NewItemProjectsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemProjectsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-team-projects) endpoint.Lists the organization projects for a team. +// Deprecated: +// returns a []TeamProjectable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-team-projects-legacy +func (m *ItemProjectsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemProjectsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamProjectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamProjectable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamProjectable) + } + } + return val, nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List team projects`](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-team-projects) endpoint.Lists the organization projects for a team. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemProjectsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemProjectsRequestBuilderGetQueryParameters])(*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. +// Deprecated: +// returns a *ItemProjectsRequestBuilder when successful +func (m *ItemProjectsRequestBuilder) WithUrl(rawUrl string)(*ItemProjectsRequestBuilder) { + return NewItemProjectsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/teams/item_projects_with_project_escaped_item_request_builder.go b/pkg/github/teams/item_projects_with_project_escaped_item_request_builder.go new file mode 100644 index 00000000..1ffde3f4 --- /dev/null +++ b/pkg/github/teams/item_projects_with_project_escaped_item_request_builder.go @@ -0,0 +1,128 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemProjectsWithProject_ItemRequestBuilder builds and executes requests for operations under \teams\{team_id}\projects\{project_id} +type ItemProjectsWithProject_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemProjectsWithProject_ItemRequestBuilderInternal instantiates a new ItemProjectsWithProject_ItemRequestBuilder and sets the default values. +func NewItemProjectsWithProject_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsWithProject_ItemRequestBuilder) { + m := &ItemProjectsWithProject_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/projects/{project_id}", pathParameters), + } + return m +} +// NewItemProjectsWithProject_ItemRequestBuilder instantiates a new ItemProjectsWithProject_ItemRequestBuilder and sets the default values. +func NewItemProjectsWithProject_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsWithProject_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemProjectsWithProject_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#remove-a-project-from-a-team) endpoint.Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. +// Deprecated: +// 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/enterprise-server@3.14/rest/teams/teams#remove-a-project-from-a-team-legacy +func (m *ItemProjectsWithProject_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 { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#check-team-permissions-for-a-project) endpoint.Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. +// Deprecated: +// returns a TeamProjectable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#check-team-permissions-for-a-project-legacy +func (m *ItemProjectsWithProject_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamProjectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamProjectFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamProjectable), nil +} +// Put > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#add-or-update-team-project-permissions) endpoint.Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. +// Deprecated: +// returns a ItemProjectsItemWithProject_403Error error when the service returns a 403 status code +// 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/enterprise-server@3.14/rest/teams/teams#add-or-update-team-project-permissions-legacy +func (m *ItemProjectsWithProject_ItemRequestBuilder) Put(ctx context.Context, body ItemProjectsItemWithProject_PutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": CreateItemProjectsItemWithProject_403ErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a project from a team](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#remove-a-project-from-a-team) endpoint.Removes an organization project from a team. An organization owner or a team maintainer can remove any project from the team. To remove a project from a team as an organization member, the authenticated user must have `read` access to both the team and project, or `admin` access to the team or project. **Note:** This endpoint removes the project from the team, but does not delete it. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemProjectsWithProject_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") + return requestInfo, nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a project](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#check-team-permissions-for-a-project) endpoint.Checks whether a team has `read`, `write`, or `admin` permissions for an organization project. The response includes projects inherited from a parent team. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemProjectsWithProject_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 +} +// ToPutRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Add or update team project permissions](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#add-or-update-team-project-permissions) endpoint.Adds an organization project to a team. To add a project to a team or update the team's permission on a project, the authenticated user must have `admin` permissions for the project. The project and team must be part of the same organization. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemProjectsWithProject_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemProjectsItemWithProject_PutRequestBodyable, 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. +// Deprecated: +// returns a *ItemProjectsWithProject_ItemRequestBuilder when successful +func (m *ItemProjectsWithProject_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemProjectsWithProject_ItemRequestBuilder) { + return NewItemProjectsWithProject_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/teams/item_repos_item_item_with_repo_put_request_body.go b/pkg/github/teams/item_repos_item_item_with_repo_put_request_body.go new file mode 100644 index 00000000..978ca7c4 --- /dev/null +++ b/pkg/github/teams/item_repos_item_item_with_repo_put_request_body.go @@ -0,0 +1,51 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemReposItemItemWithRepoPutRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemReposItemItemWithRepoPutRequestBody instantiates a new ItemReposItemItemWithRepoPutRequestBody and sets the default values. +func NewItemReposItemItemWithRepoPutRequestBody()(*ItemReposItemItemWithRepoPutRequestBody) { + m := &ItemReposItemItemWithRepoPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemReposItemItemWithRepoPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemReposItemItemWithRepoPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemReposItemItemWithRepoPutRequestBody(), 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 *ItemReposItemItemWithRepoPutRequestBody) 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 *ItemReposItemItemWithRepoPutRequestBody) 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 *ItemReposItemItemWithRepoPutRequestBody) 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 *ItemReposItemItemWithRepoPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemReposItemItemWithRepoPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/teams/item_repos_item_with_repo_item_request_builder.go b/pkg/github/teams/item_repos_item_with_repo_item_request_builder.go new file mode 100644 index 00000000..0af069b3 --- /dev/null +++ b/pkg/github/teams/item_repos_item_with_repo_item_request_builder.go @@ -0,0 +1,119 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemReposItemWithRepoItemRequestBuilder builds and executes requests for operations under \teams\{team_id}\repos\{owner}\{repo} +type ItemReposItemWithRepoItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemReposItemWithRepoItemRequestBuilderInternal instantiates a new ItemReposItemWithRepoItemRequestBuilder and sets the default values. +func NewItemReposItemWithRepoItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposItemWithRepoItemRequestBuilder) { + m := &ItemReposItemWithRepoItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/repos/{owner}/{repo}", pathParameters), + } + return m +} +// NewItemReposItemWithRepoItemRequestBuilder instantiates a new ItemReposItemWithRepoItemRequestBuilder and sets the default values. +func NewItemReposItemWithRepoItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposItemWithRepoItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemReposItemWithRepoItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#remove-a-repository-from-a-team) endpoint.If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. +// Deprecated: +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#remove-a-repository-from-a-team-legacy +func (m *ItemReposItemWithRepoItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Get > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#check-team-permissions-for-a-repository) endpoint.> [!NOTE]> Repositories inherited through a parent team will also be checked.You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `Accept` header: +// Deprecated: +// returns a TeamRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#check-team-permissions-for-a-repository-legacy +func (m *ItemReposItemWithRepoItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamRepositoryable), nil +} +// Put > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint.To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization.Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// Deprecated: +// returns a BasicError error when the service returns a 403 status code +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#add-or-update-team-repository-permissions-legacy +func (m *ItemReposItemWithRepoItemRequestBuilder) Put(ctx context.Context, body ItemReposItemItemWithRepoPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Remove a repository from a team](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#remove-a-repository-from-a-team) endpoint.If the authenticated user is an organization owner or a team maintainer, they can remove any repositories from the team. To remove a repository from a team as an organization member, the authenticated user must have admin access to the repository and must be able to see the team. NOTE: This does not delete the repository, it just removes it from the team. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemReposItemWithRepoItemRequestBuilder) 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 +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Check team permissions for a repository](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#check-team-permissions-for-a-repository) endpoint.> [!NOTE]> Repositories inherited through a parent team will also be checked.You can also get information about the specified repository, including what permissions the team grants on it, by passing the following custom [media type](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types/) via the `Accept` header: +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemReposItemWithRepoItemRequestBuilder) 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 +} +// ToPutRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new "[Add or update team repository permissions](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#add-or-update-team-repository-permissions)" endpoint.To add a repository to a team or update the team's permission on a repository, the authenticated user must have admin access to the repository, and must be able to see the team. The repository must be owned by the organization, or a direct fork of a repository owned by the organization. You will get a `422 Unprocessable Entity` status if you attempt to add a repository to a team that is not owned by the organization.Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemReposItemWithRepoItemRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemReposItemItemWithRepoPutRequestBodyable, 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. +// Deprecated: +// returns a *ItemReposItemWithRepoItemRequestBuilder when successful +func (m *ItemReposItemWithRepoItemRequestBuilder) WithUrl(rawUrl string)(*ItemReposItemWithRepoItemRequestBuilder) { + return NewItemReposItemWithRepoItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/teams/item_repos_request_builder.go b/pkg/github/teams/item_repos_request_builder.go new file mode 100644 index 00000000..eecbed7b --- /dev/null +++ b/pkg/github/teams/item_repos_request_builder.go @@ -0,0 +1,86 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemReposRequestBuilder builds and executes requests for operations under \teams\{team_id}\repos +type ItemReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemReposRequestBuilderGetQueryParameters > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-team-repositories) endpoint. +type ItemReposRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByOwner gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.teams.item.repos.item collection +// returns a *ItemReposWithOwnerItemRequestBuilder when successful +func (m *ItemReposRequestBuilder) ByOwner(owner string)(*ItemReposWithOwnerItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if owner != "" { + urlTplParams["owner"] = owner + } + return NewItemReposWithOwnerItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemReposRequestBuilderInternal instantiates a new ItemReposRequestBuilder and sets the default values. +func NewItemReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposRequestBuilder) { + m := &ItemReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/repos{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemReposRequestBuilder instantiates a new ItemReposRequestBuilder and sets the default values. +func NewItemReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemReposRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-team-repositories) endpoint. +// Deprecated: +// returns a []MinimalRepositoryable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-team-repositories-legacy +func (m *ItemReposRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReposRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [List team repositories](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-team-repositories) endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemReposRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReposRequestBuilderGetQueryParameters])(*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. +// Deprecated: +// returns a *ItemReposRequestBuilder when successful +func (m *ItemReposRequestBuilder) WithUrl(rawUrl string)(*ItemReposRequestBuilder) { + return NewItemReposRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/teams/item_repos_with_owner_item_request_builder.go b/pkg/github/teams/item_repos_with_owner_item_request_builder.go new file mode 100644 index 00000000..7e2fb640 --- /dev/null +++ b/pkg/github/teams/item_repos_with_owner_item_request_builder.go @@ -0,0 +1,36 @@ +package teams + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemReposWithOwnerItemRequestBuilder builds and executes requests for operations under \teams\{team_id}\repos\{owner} +type ItemReposWithOwnerItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepo gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.teams.item.repos.item.item collection +// Deprecated: +// returns a *ItemReposItemWithRepoItemRequestBuilder when successful +func (m *ItemReposWithOwnerItemRequestBuilder) ByRepo(repo string)(*ItemReposItemWithRepoItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repo != "" { + urlTplParams["repo"] = repo + } + return NewItemReposItemWithRepoItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemReposWithOwnerItemRequestBuilderInternal instantiates a new ItemReposWithOwnerItemRequestBuilder and sets the default values. +func NewItemReposWithOwnerItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposWithOwnerItemRequestBuilder) { + m := &ItemReposWithOwnerItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/repos/{owner}", pathParameters), + } + return m +} +// NewItemReposWithOwnerItemRequestBuilder instantiates a new ItemReposWithOwnerItemRequestBuilder and sets the default values. +func NewItemReposWithOwnerItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposWithOwnerItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemReposWithOwnerItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/teams/item_teams_request_builder.go b/pkg/github/teams/item_teams_request_builder.go new file mode 100644 index 00000000..96950744 --- /dev/null +++ b/pkg/github/teams/item_teams_request_builder.go @@ -0,0 +1,78 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemTeamsRequestBuilder builds and executes requests for operations under \teams\{team_id}\teams +type ItemTeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemTeamsRequestBuilderGetQueryParameters > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-child-teams) endpoint. +type ItemTeamsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemTeamsRequestBuilderInternal instantiates a new ItemTeamsRequestBuilder and sets the default values. +func NewItemTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsRequestBuilder) { + m := &ItemTeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}/teams{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemTeamsRequestBuilder instantiates a new ItemTeamsRequestBuilder and sets the default values. +func NewItemTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemTeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-child-teams) endpoint. +// Deprecated: +// returns a []Teamable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-child-teams-legacy +func (m *ItemTeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Teamable) + } + } + return val, nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [`List child teams`](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#list-child-teams) endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *ItemTeamsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemTeamsRequestBuilderGetQueryParameters])(*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. +// Deprecated: +// returns a *ItemTeamsRequestBuilder when successful +func (m *ItemTeamsRequestBuilder) WithUrl(rawUrl string)(*ItemTeamsRequestBuilder) { + return NewItemTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/teams/item_with_team_escaped_patch_request_body.go b/pkg/github/teams/item_with_team_escaped_patch_request_body.go new file mode 100644 index 00000000..f037c20e --- /dev/null +++ b/pkg/github/teams/item_with_team_escaped_patch_request_body.go @@ -0,0 +1,138 @@ +package teams + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemWithTeam_PatchRequestBody 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 the team. + description *string + // The name of the team. + name *string + // The ID of a team to set as the parent team. + parent_team_id *int32 +} +// NewItemWithTeam_PatchRequestBody instantiates a new ItemWithTeam_PatchRequestBody and sets the default values. +func NewItemWithTeam_PatchRequestBody()(*ItemWithTeam_PatchRequestBody) { + m := &ItemWithTeam_PatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemWithTeam_PatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemWithTeam_PatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemWithTeam_PatchRequestBody(), 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 *ItemWithTeam_PatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetDescription gets the description property value. The description of the team. +// returns a *string when successful +func (m *ItemWithTeam_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 *ItemWithTeam_PatchRequestBody) 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["name"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetName(val) + } + return nil + } + res["parent_team_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetParentTeamId(val) + } + return nil + } + return res +} +// GetName gets the name property value. The name of the team. +// returns a *string when successful +func (m *ItemWithTeam_PatchRequestBody) GetName()(*string) { + return m.name +} +// GetParentTeamId gets the parent_team_id property value. The ID of a team to set as the parent team. +// returns a *int32 when successful +func (m *ItemWithTeam_PatchRequestBody) GetParentTeamId()(*int32) { + return m.parent_team_id +} +// Serialize serializes information the current object +func (m *ItemWithTeam_PatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("parent_team_id", m.GetParentTeamId()) + 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 *ItemWithTeam_PatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetDescription sets the description property value. The description of the team. +func (m *ItemWithTeam_PatchRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetName sets the name property value. The name of the team. +func (m *ItemWithTeam_PatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetParentTeamId sets the parent_team_id property value. The ID of a team to set as the parent team. +func (m *ItemWithTeam_PatchRequestBody) SetParentTeamId(value *int32)() { + m.parent_team_id = value +} +type ItemWithTeam_PatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetDescription()(*string) + GetName()(*string) + GetParentTeamId()(*int32) + SetDescription(value *string)() + SetName(value *string)() + SetParentTeamId(value *int32)() +} diff --git a/pkg/github/teams/teams_request_builder.go b/pkg/github/teams/teams_request_builder.go new file mode 100644 index 00000000..d67d51fd --- /dev/null +++ b/pkg/github/teams/teams_request_builder.go @@ -0,0 +1,35 @@ +package teams + +import ( + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// TeamsRequestBuilder builds and executes requests for operations under \teams +type TeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByTeam_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.teams.item collection +// Deprecated: +// returns a *WithTeam_ItemRequestBuilder when successful +func (m *TeamsRequestBuilder) ByTeam_id(team_id int32)(*WithTeam_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["team_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(team_id), 10) + return NewWithTeam_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewTeamsRequestBuilderInternal instantiates a new TeamsRequestBuilder and sets the default values. +func NewTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamsRequestBuilder) { + m := &TeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams", pathParameters), + } + return m +} +// NewTeamsRequestBuilder instantiates a new TeamsRequestBuilder and sets the default values. +func NewTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/teams/with_team_escaped_item_request_builder.go b/pkg/github/teams/with_team_escaped_item_request_builder.go new file mode 100644 index 00000000..bcb299e8 --- /dev/null +++ b/pkg/github/teams/with_team_escaped_item_request_builder.go @@ -0,0 +1,166 @@ +package teams + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// WithTeam_ItemRequestBuilder builds and executes requests for operations under \teams\{team_id} +type WithTeam_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewWithTeam_ItemRequestBuilderInternal instantiates a new WithTeam_ItemRequestBuilder and sets the default values. +func NewWithTeam_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithTeam_ItemRequestBuilder) { + m := &WithTeam_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/teams/{team_id}", pathParameters), + } + return m +} +// NewWithTeam_ItemRequestBuilder instantiates a new WithTeam_ItemRequestBuilder and sets the default values. +func NewWithTeam_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithTeam_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithTeam_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#delete-a-team) endpoint.To delete a team, the authenticated user must be an organization owner or team maintainer.If you are an organization owner, deleting a parent team will delete all of its child teams as well. +// Deprecated: +// 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/enterprise-server@3.14/rest/teams/teams#delete-a-team-legacy +func (m *WithTeam_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 { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Discussions the discussions property +// returns a *ItemDiscussionsRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) Discussions()(*ItemDiscussionsRequestBuilder) { + return NewItemDiscussionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#get-a-team-by-name) endpoint. +// Deprecated: +// returns a TeamFullable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#get-a-team-legacy +func (m *WithTeam_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamFullable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamFullable), nil +} +// Members the members property +// returns a *ItemMembersRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) Members()(*ItemMembersRequestBuilder) { + return NewItemMembersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Memberships the memberships property +// returns a *ItemMembershipsRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) Memberships()(*ItemMembershipsRequestBuilder) { + return NewItemMembershipsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#update-a-team) endpoint.To edit a team, the authenticated user must either be an organization owner or a team maintainer.> [!NOTE]> With nested teams, the `privacy` for parent teams cannot be `secret`. +// Deprecated: +// returns a TeamFullable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/teams/teams#update-a-team-legacy +func (m *WithTeam_ItemRequestBuilder) Patch(ctx context.Context, body ItemWithTeam_PatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamFullable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamFullable), nil +} +// Projects the projects property +// returns a *ItemProjectsRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) Projects()(*ItemProjectsRequestBuilder) { + return NewItemProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repos the repos property +// returns a *ItemReposRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) Repos()(*ItemReposRequestBuilder) { + return NewItemReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Teams the teams property +// returns a *ItemTeamsRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) Teams()(*ItemTeamsRequestBuilder) { + return NewItemTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Delete a team](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#delete-a-team) endpoint.To delete a team, the authenticated user must be an organization owner or team maintainer.If you are an organization owner, deleting a parent team will delete all of its child teams as well. +// Deprecated: +// returns a *RequestInformation when successful +func (m *WithTeam_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") + return requestInfo, nil +} +// ToGetRequestInformation > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the [Get a team by name](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#get-a-team-by-name) endpoint. +// Deprecated: +// returns a *RequestInformation when successful +func (m *WithTeam_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 > [!WARNING]> **Deprecation notice:** This endpoint route is deprecated and will be removed from the Teams API. We recommend migrating your existing code to use the new [Update a team](https://docs.github.com/enterprise-server@3.14/rest/teams/teams#update-a-team) endpoint.To edit a team, the authenticated user must either be an organization owner or a team maintainer.> [!NOTE]> With nested teams, the `privacy` for parent teams cannot be `secret`. +// Deprecated: +// returns a *RequestInformation when successful +func (m *WithTeam_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body ItemWithTeam_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. +// Deprecated: +// returns a *WithTeam_ItemRequestBuilder when successful +func (m *WithTeam_ItemRequestBuilder) WithUrl(rawUrl string)(*WithTeam_ItemRequestBuilder) { + return NewWithTeam_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/docker_conflicts_request_builder.go b/pkg/github/user/docker_conflicts_request_builder.go new file mode 100644 index 00000000..1adeb0cf --- /dev/null +++ b/pkg/github/user/docker_conflicts_request_builder.go @@ -0,0 +1,60 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// DockerConflictsRequestBuilder builds and executes requests for operations under \user\docker\conflicts +type DockerConflictsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewDockerConflictsRequestBuilderInternal instantiates a new DockerConflictsRequestBuilder and sets the default values. +func NewDockerConflictsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DockerConflictsRequestBuilder) { + m := &DockerConflictsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/docker/conflicts", pathParameters), + } + return m +} +// NewDockerConflictsRequestBuilder instantiates a new DockerConflictsRequestBuilder and sets the default values. +func NewDockerConflictsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DockerConflictsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewDockerConflictsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all packages that are owned by the authenticated user within the user's namespace, and that encountered a conflict during a Docker migration.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. +// returns a []PackageEscapedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-authenticated-user +func (m *DockerConflictsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageEscapedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable) + } + } + return val, nil +} +// ToGetRequestInformation lists all packages that are owned by the authenticated user within the user's namespace, and that encountered a conflict during a Docker migration.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *DockerConflictsRequestBuilder) 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 *DockerConflictsRequestBuilder when successful +func (m *DockerConflictsRequestBuilder) WithUrl(rawUrl string)(*DockerConflictsRequestBuilder) { + return NewDockerConflictsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/docker_request_builder.go b/pkg/github/user/docker_request_builder.go new file mode 100644 index 00000000..b099b53a --- /dev/null +++ b/pkg/github/user/docker_request_builder.go @@ -0,0 +1,28 @@ +package user + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// DockerRequestBuilder builds and executes requests for operations under \user\docker +type DockerRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Conflicts the conflicts property +// returns a *DockerConflictsRequestBuilder when successful +func (m *DockerRequestBuilder) Conflicts()(*DockerConflictsRequestBuilder) { + return NewDockerConflictsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewDockerRequestBuilderInternal instantiates a new DockerRequestBuilder and sets the default values. +func NewDockerRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DockerRequestBuilder) { + m := &DockerRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/docker", pathParameters), + } + return m +} +// NewDockerRequestBuilder instantiates a new DockerRequestBuilder and sets the default values. +func NewDockerRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*DockerRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewDockerRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/user/emails_delete_request_body_member1.go b/pkg/github/user/emails_delete_request_body_member1.go new file mode 100644 index 00000000..f9fc2a77 --- /dev/null +++ b/pkg/github/user/emails_delete_request_body_member1.go @@ -0,0 +1,87 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +// EmailsDeleteRequestBodyMember1 deletes one or more email addresses from your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key. +type EmailsDeleteRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Email addresses associated with the GitHub user account. + emails []string +} +// NewEmailsDeleteRequestBodyMember1 instantiates a new EmailsDeleteRequestBodyMember1 and sets the default values. +func NewEmailsDeleteRequestBodyMember1()(*EmailsDeleteRequestBodyMember1) { + m := &EmailsDeleteRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEmailsDeleteRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmailsDeleteRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEmailsDeleteRequestBodyMember1(), 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 *EmailsDeleteRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmails gets the emails property value. Email addresses associated with the GitHub user account. +// returns a []string when successful +func (m *EmailsDeleteRequestBodyMember1) GetEmails()([]string) { + return m.emails +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EmailsDeleteRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["emails"] = 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.SetEmails(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *EmailsDeleteRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEmails() != nil { + err := writer.WriteCollectionOfStringValues("emails", m.GetEmails()) + 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 *EmailsDeleteRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmails sets the emails property value. Email addresses associated with the GitHub user account. +func (m *EmailsDeleteRequestBodyMember1) SetEmails(value []string)() { + m.emails = value +} +type EmailsDeleteRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmails()([]string) + SetEmails(value []string)() +} diff --git a/pkg/github/user/emails_post_request_body_member1.go b/pkg/github/user/emails_post_request_body_member1.go new file mode 100644 index 00000000..a43702bb --- /dev/null +++ b/pkg/github/user/emails_post_request_body_member1.go @@ -0,0 +1,86 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type EmailsPostRequestBodyMember1 struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key. + emails []string +} +// NewEmailsPostRequestBodyMember1 instantiates a new EmailsPostRequestBodyMember1 and sets the default values. +func NewEmailsPostRequestBodyMember1()(*EmailsPostRequestBodyMember1) { + m := &EmailsPostRequestBodyMember1{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateEmailsPostRequestBodyMember1FromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmailsPostRequestBodyMember1FromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewEmailsPostRequestBodyMember1(), 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 *EmailsPostRequestBodyMember1) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetEmails gets the emails property value. Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key. +// returns a []string when successful +func (m *EmailsPostRequestBodyMember1) GetEmails()([]string) { + return m.emails +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EmailsPostRequestBodyMember1) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["emails"] = 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.SetEmails(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *EmailsPostRequestBodyMember1) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEmails() != nil { + err := writer.WriteCollectionOfStringValues("emails", m.GetEmails()) + 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 *EmailsPostRequestBodyMember1) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetEmails sets the emails property value. Adds one or more email addresses to your GitHub account. Must contain at least one email address. **Note:** Alternatively, you can pass a single email address or an `array` of emails addresses directly, but we recommend that you pass an object using the `emails` key. +func (m *EmailsPostRequestBodyMember1) SetEmails(value []string)() { + m.emails = value +} +type EmailsPostRequestBodyMember1able interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmails()([]string) + SetEmails(value []string)() +} diff --git a/pkg/github/user/emails_request_builder.go b/pkg/github/user/emails_request_builder.go new file mode 100644 index 00000000..5e8d8766 --- /dev/null +++ b/pkg/github/user/emails_request_builder.go @@ -0,0 +1,417 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// EmailsRequestBuilder builds and executes requests for operations under \user\emails +type EmailsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// EmailsDeleteRequestBody composed type wrapper for classes EmailsDeleteRequestBodyMember1able, string +type EmailsDeleteRequestBody struct { + // Composed type representation for type EmailsDeleteRequestBodyMember1able + emailsDeleteRequestBodyEmailsDeleteRequestBodyMember1 EmailsDeleteRequestBodyMember1able + // Composed type representation for type EmailsDeleteRequestBodyMember1able + emailsDeleteRequestBodyMember1 EmailsDeleteRequestBodyMember1able + // Composed type representation for type string + emailsDeleteRequestBodyString *string + // Composed type representation for type string + string *string +} +// NewEmailsDeleteRequestBody instantiates a new EmailsDeleteRequestBody and sets the default values. +func NewEmailsDeleteRequestBody()(*EmailsDeleteRequestBody) { + m := &EmailsDeleteRequestBody{ + } + return m +} +// CreateEmailsDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmailsDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewEmailsDeleteRequestBody() + 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.SetEmailsDeleteRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1 gets the EmailsDeleteRequestBodyMember1 property value. Composed type representation for type EmailsDeleteRequestBodyMember1able +// returns a EmailsDeleteRequestBodyMember1able when successful +func (m *EmailsDeleteRequestBody) GetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1()(EmailsDeleteRequestBodyMember1able) { + return m.emailsDeleteRequestBodyEmailsDeleteRequestBodyMember1 +} +// GetEmailsDeleteRequestBodyMember1 gets the EmailsDeleteRequestBodyMember1 property value. Composed type representation for type EmailsDeleteRequestBodyMember1able +// returns a EmailsDeleteRequestBodyMember1able when successful +func (m *EmailsDeleteRequestBody) GetEmailsDeleteRequestBodyMember1()(EmailsDeleteRequestBodyMember1able) { + return m.emailsDeleteRequestBodyMember1 +} +// GetEmailsDeleteRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *EmailsDeleteRequestBody) GetEmailsDeleteRequestBodyString()(*string) { + return m.emailsDeleteRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EmailsDeleteRequestBody) 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 *EmailsDeleteRequestBody) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *EmailsDeleteRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *EmailsDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetEmailsDeleteRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetEmailsDeleteRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetEmailsDeleteRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetEmailsDeleteRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1 sets the EmailsDeleteRequestBodyMember1 property value. Composed type representation for type EmailsDeleteRequestBodyMember1able +func (m *EmailsDeleteRequestBody) SetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1(value EmailsDeleteRequestBodyMember1able)() { + m.emailsDeleteRequestBodyEmailsDeleteRequestBodyMember1 = value +} +// SetEmailsDeleteRequestBodyMember1 sets the EmailsDeleteRequestBodyMember1 property value. Composed type representation for type EmailsDeleteRequestBodyMember1able +func (m *EmailsDeleteRequestBody) SetEmailsDeleteRequestBodyMember1(value EmailsDeleteRequestBodyMember1able)() { + m.emailsDeleteRequestBodyMember1 = value +} +// SetEmailsDeleteRequestBodyString sets the string property value. Composed type representation for type string +func (m *EmailsDeleteRequestBody) SetEmailsDeleteRequestBodyString(value *string)() { + m.emailsDeleteRequestBodyString = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *EmailsDeleteRequestBody) SetString(value *string)() { + m.string = value +} +// EmailsPostRequestBody composed type wrapper for classes EmailsPostRequestBodyMember1able, string +type EmailsPostRequestBody struct { + // Composed type representation for type EmailsPostRequestBodyMember1able + emailsPostRequestBodyEmailsPostRequestBodyMember1 EmailsPostRequestBodyMember1able + // Composed type representation for type EmailsPostRequestBodyMember1able + emailsPostRequestBodyMember1 EmailsPostRequestBodyMember1able + // Composed type representation for type string + emailsPostRequestBodyString *string + // Composed type representation for type string + string *string +} +// NewEmailsPostRequestBody instantiates a new EmailsPostRequestBody and sets the default values. +func NewEmailsPostRequestBody()(*EmailsPostRequestBody) { + m := &EmailsPostRequestBody{ + } + return m +} +// CreateEmailsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateEmailsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewEmailsPostRequestBody() + 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.SetEmailsPostRequestBodyString(val) + } else if val, err := parseNode.GetStringValue(); val != nil { + if err != nil { + return nil, err + } + result.SetString(val) + } + return result, nil +} +// GetEmailsPostRequestBodyEmailsPostRequestBodyMember1 gets the EmailsPostRequestBodyMember1 property value. Composed type representation for type EmailsPostRequestBodyMember1able +// returns a EmailsPostRequestBodyMember1able when successful +func (m *EmailsPostRequestBody) GetEmailsPostRequestBodyEmailsPostRequestBodyMember1()(EmailsPostRequestBodyMember1able) { + return m.emailsPostRequestBodyEmailsPostRequestBodyMember1 +} +// GetEmailsPostRequestBodyMember1 gets the EmailsPostRequestBodyMember1 property value. Composed type representation for type EmailsPostRequestBodyMember1able +// returns a EmailsPostRequestBodyMember1able when successful +func (m *EmailsPostRequestBody) GetEmailsPostRequestBodyMember1()(EmailsPostRequestBodyMember1able) { + return m.emailsPostRequestBodyMember1 +} +// GetEmailsPostRequestBodyString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *EmailsPostRequestBody) GetEmailsPostRequestBodyString()(*string) { + return m.emailsPostRequestBodyString +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *EmailsPostRequestBody) 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 *EmailsPostRequestBody) GetIsComposedType()(bool) { + return true +} +// GetString gets the string property value. Composed type representation for type string +// returns a *string when successful +func (m *EmailsPostRequestBody) GetString()(*string) { + return m.string +} +// Serialize serializes information the current object +func (m *EmailsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetEmailsPostRequestBodyEmailsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetEmailsPostRequestBodyEmailsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetEmailsPostRequestBodyMember1() != nil { + err := writer.WriteObjectValue("", m.GetEmailsPostRequestBodyMember1()) + if err != nil { + return err + } + } else if m.GetEmailsPostRequestBodyString() != nil { + err := writer.WriteStringValue("", m.GetEmailsPostRequestBodyString()) + if err != nil { + return err + } + } else if m.GetString() != nil { + err := writer.WriteStringValue("", m.GetString()) + if err != nil { + return err + } + } + return nil +} +// SetEmailsPostRequestBodyEmailsPostRequestBodyMember1 sets the EmailsPostRequestBodyMember1 property value. Composed type representation for type EmailsPostRequestBodyMember1able +func (m *EmailsPostRequestBody) SetEmailsPostRequestBodyEmailsPostRequestBodyMember1(value EmailsPostRequestBodyMember1able)() { + m.emailsPostRequestBodyEmailsPostRequestBodyMember1 = value +} +// SetEmailsPostRequestBodyMember1 sets the EmailsPostRequestBodyMember1 property value. Composed type representation for type EmailsPostRequestBodyMember1able +func (m *EmailsPostRequestBody) SetEmailsPostRequestBodyMember1(value EmailsPostRequestBodyMember1able)() { + m.emailsPostRequestBodyMember1 = value +} +// SetEmailsPostRequestBodyString sets the string property value. Composed type representation for type string +func (m *EmailsPostRequestBody) SetEmailsPostRequestBodyString(value *string)() { + m.emailsPostRequestBodyString = value +} +// SetString sets the string property value. Composed type representation for type string +func (m *EmailsPostRequestBody) SetString(value *string)() { + m.string = value +} +// EmailsRequestBuilderGetQueryParameters lists all of your email addresses, and specifies which one is visibleto the public.OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint. +type EmailsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +type EmailsDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1()(EmailsDeleteRequestBodyMember1able) + GetEmailsDeleteRequestBodyMember1()(EmailsDeleteRequestBodyMember1able) + GetEmailsDeleteRequestBodyString()(*string) + GetString()(*string) + SetEmailsDeleteRequestBodyEmailsDeleteRequestBodyMember1(value EmailsDeleteRequestBodyMember1able)() + SetEmailsDeleteRequestBodyMember1(value EmailsDeleteRequestBodyMember1able)() + SetEmailsDeleteRequestBodyString(value *string)() + SetString(value *string)() +} +type EmailsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetEmailsPostRequestBodyEmailsPostRequestBodyMember1()(EmailsPostRequestBodyMember1able) + GetEmailsPostRequestBodyMember1()(EmailsPostRequestBodyMember1able) + GetEmailsPostRequestBodyString()(*string) + GetString()(*string) + SetEmailsPostRequestBodyEmailsPostRequestBodyMember1(value EmailsPostRequestBodyMember1able)() + SetEmailsPostRequestBodyMember1(value EmailsPostRequestBodyMember1able)() + SetEmailsPostRequestBodyString(value *string)() + SetString(value *string)() +} +// NewEmailsRequestBuilderInternal instantiates a new EmailsRequestBuilder and sets the default values. +func NewEmailsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EmailsRequestBuilder) { + m := &EmailsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/emails{?page*,per_page*}", pathParameters), + } + return m +} +// NewEmailsRequestBuilder instantiates a new EmailsRequestBuilder and sets the default values. +func NewEmailsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*EmailsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewEmailsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete oAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/emails#delete-an-email-address-for-the-authenticated-user +func (m *EmailsRequestBuilder) Delete(ctx context.Context, body EmailsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get lists all of your email addresses, and specifies which one is visibleto the public.OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint. +// returns a []Emailable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/emails#list-email-addresses-for-the-authenticated-user +func (m *EmailsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[EmailsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Emailable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmailFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Emailable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Emailable) + } + } + return val, nil +} +// Post oAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a []Emailable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/emails#add-an-email-address-for-the-authenticated-user +func (m *EmailsRequestBuilder) Post(ctx context.Context, body EmailsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Emailable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmailFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Emailable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Emailable) + } + } + return val, nil +} +// ToDeleteRequestInformation oAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *EmailsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body EmailsDeleteRequestBodyable, 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") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation lists all of your email addresses, and specifies which one is visibleto the public.OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *EmailsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[EmailsRequestBuilderGetQueryParameters])(*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 oAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *EmailsRequestBuilder) ToPostRequestInformation(ctx context.Context, body EmailsPostRequestBodyable, 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 *EmailsRequestBuilder when successful +func (m *EmailsRequestBuilder) WithUrl(rawUrl string)(*EmailsRequestBuilder) { + return NewEmailsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/followers_request_builder.go b/pkg/github/user/followers_request_builder.go new file mode 100644 index 00000000..f1182fb4 --- /dev/null +++ b/pkg/github/user/followers_request_builder.go @@ -0,0 +1,73 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// FollowersRequestBuilder builds and executes requests for operations under \user\followers +type FollowersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// FollowersRequestBuilderGetQueryParameters lists the people following the authenticated user. +type FollowersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewFollowersRequestBuilderInternal instantiates a new FollowersRequestBuilder and sets the default values. +func NewFollowersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FollowersRequestBuilder) { + m := &FollowersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/followers{?page*,per_page*}", pathParameters), + } + return m +} +// NewFollowersRequestBuilder instantiates a new FollowersRequestBuilder and sets the default values. +func NewFollowersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FollowersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewFollowersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the people following the authenticated user. +// returns a []SimpleUserable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/followers#list-followers-of-the-authenticated-user +func (m *FollowersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[FollowersRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists the people following the authenticated user. +// returns a *RequestInformation when successful +func (m *FollowersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[FollowersRequestBuilderGetQueryParameters])(*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 *FollowersRequestBuilder when successful +func (m *FollowersRequestBuilder) WithUrl(rawUrl string)(*FollowersRequestBuilder) { + return NewFollowersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/following_request_builder.go b/pkg/github/user/following_request_builder.go new file mode 100644 index 00000000..232206b9 --- /dev/null +++ b/pkg/github/user/following_request_builder.go @@ -0,0 +1,85 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// FollowingRequestBuilder builds and executes requests for operations under \user\following +type FollowingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// FollowingRequestBuilderGetQueryParameters lists the people who the authenticated user follows. +type FollowingRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.following.item collection +// returns a *FollowingWithUsernameItemRequestBuilder when successful +func (m *FollowingRequestBuilder) ByUsername(username string)(*FollowingWithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewFollowingWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewFollowingRequestBuilderInternal instantiates a new FollowingRequestBuilder and sets the default values. +func NewFollowingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FollowingRequestBuilder) { + m := &FollowingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/following{?page*,per_page*}", pathParameters), + } + return m +} +// NewFollowingRequestBuilder instantiates a new FollowingRequestBuilder and sets the default values. +func NewFollowingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FollowingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewFollowingRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the people who the authenticated user follows. +// returns a []SimpleUserable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/followers#list-the-people-the-authenticated-user-follows +func (m *FollowingRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[FollowingRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists the people who the authenticated user follows. +// returns a *RequestInformation when successful +func (m *FollowingRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[FollowingRequestBuilderGetQueryParameters])(*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 *FollowingRequestBuilder when successful +func (m *FollowingRequestBuilder) WithUrl(rawUrl string)(*FollowingRequestBuilder) { + return NewFollowingRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/following_with_username_item_request_builder.go b/pkg/github/user/following_with_username_item_request_builder.go new file mode 100644 index 00000000..d6e01eab --- /dev/null +++ b/pkg/github/user/following_with_username_item_request_builder.go @@ -0,0 +1,122 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// FollowingWithUsernameItemRequestBuilder builds and executes requests for operations under \user\following\{username} +type FollowingWithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewFollowingWithUsernameItemRequestBuilderInternal instantiates a new FollowingWithUsernameItemRequestBuilder and sets the default values. +func NewFollowingWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FollowingWithUsernameItemRequestBuilder) { + m := &FollowingWithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/following/{username}", pathParameters), + } + return m +} +// NewFollowingWithUsernameItemRequestBuilder instantiates a new FollowingWithUsernameItemRequestBuilder and sets the default values. +func NewFollowingWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*FollowingWithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewFollowingWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete oAuth app tokens and personal access tokens (classic) need the `user:follow` scope to use this endpoint. +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/followers#unfollow-a-user +func (m *FollowingWithUsernameItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get check if a person is followed by the authenticated user +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/followers#check-if-a-person-is-followed-by-the-authenticated-user +func (m *FollowingWithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)."OAuth app tokens and personal access tokens (classic) need the `user:follow` scope to use this endpoint. +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/followers#follow-a-user +func (m *FollowingWithUsernameItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation oAuth app tokens and personal access tokens (classic) need the `user:follow` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *FollowingWithUsernameItemRequestBuilder) 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") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *FollowingWithUsernameItemRequestBuilder) 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 +} +// ToPutRequestInformation note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP verbs](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)."OAuth app tokens and personal access tokens (classic) need the `user:follow` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *FollowingWithUsernameItemRequestBuilder) ToPutRequestInformation(ctx context.Context, 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") + 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 *FollowingWithUsernameItemRequestBuilder when successful +func (m *FollowingWithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*FollowingWithUsernameItemRequestBuilder) { + return NewFollowingWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/gpg_escaped_keys_post_request_body.go b/pkg/github/user/gpg_escaped_keys_post_request_body.go new file mode 100644 index 00000000..2e080f98 --- /dev/null +++ b/pkg/github/user/gpg_escaped_keys_post_request_body.go @@ -0,0 +1,109 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Gpg_keysPostRequestBody 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 GPG key in ASCII-armored format. + armored_public_key *string + // A descriptive name for the new key. + name *string +} +// NewGpg_keysPostRequestBody instantiates a new Gpg_keysPostRequestBody and sets the default values. +func NewGpg_keysPostRequestBody()(*Gpg_keysPostRequestBody) { + m := &Gpg_keysPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateGpg_keysPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateGpg_keysPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewGpg_keysPostRequestBody(), 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 *Gpg_keysPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetArmoredPublicKey gets the armored_public_key property value. A GPG key in ASCII-armored format. +// returns a *string when successful +func (m *Gpg_keysPostRequestBody) GetArmoredPublicKey()(*string) { + return m.armored_public_key +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *Gpg_keysPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["armored_public_key"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetArmoredPublicKey(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. A descriptive name for the new key. +// returns a *string when successful +func (m *Gpg_keysPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *Gpg_keysPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("armored_public_key", m.GetArmoredPublicKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *Gpg_keysPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetArmoredPublicKey sets the armored_public_key property value. A GPG key in ASCII-armored format. +func (m *Gpg_keysPostRequestBody) SetArmoredPublicKey(value *string)() { + m.armored_public_key = value +} +// SetName sets the name property value. A descriptive name for the new key. +func (m *Gpg_keysPostRequestBody) SetName(value *string)() { + m.name = value +} +type Gpg_keysPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetArmoredPublicKey()(*string) + GetName()(*string) + SetArmoredPublicKey(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/user/gpg_escaped_keys_request_builder.go b/pkg/github/user/gpg_escaped_keys_request_builder.go new file mode 100644 index 00000000..6c14e191 --- /dev/null +++ b/pkg/github/user/gpg_escaped_keys_request_builder.go @@ -0,0 +1,127 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// Gpg_keysRequestBuilder builds and executes requests for operations under \user\gpg_keys +type Gpg_keysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Gpg_keysRequestBuilderGetQueryParameters lists the current user's GPG keys.OAuth app tokens and personal access tokens (classic) need the `read:gpg_key` scope to use this endpoint. +type Gpg_keysRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByGpg_key_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.gpg_keys.item collection +// returns a *Gpg_keysWithGpg_key_ItemRequestBuilder when successful +func (m *Gpg_keysRequestBuilder) ByGpg_key_id(gpg_key_id int32)(*Gpg_keysWithGpg_key_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["gpg_key_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(gpg_key_id), 10) + return NewGpg_keysWithGpg_key_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewGpg_keysRequestBuilderInternal instantiates a new Gpg_keysRequestBuilder and sets the default values. +func NewGpg_keysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Gpg_keysRequestBuilder) { + m := &Gpg_keysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/gpg_keys{?page*,per_page*}", pathParameters), + } + return m +} +// NewGpg_keysRequestBuilder instantiates a new Gpg_keysRequestBuilder and sets the default values. +func NewGpg_keysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Gpg_keysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewGpg_keysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the current user's GPG keys.OAuth app tokens and personal access tokens (classic) need the `read:gpg_key` scope to use this endpoint. +// returns a []GpgKeyable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/gpg-keys#list-gpg-keys-for-the-authenticated-user +func (m *Gpg_keysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Gpg_keysRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GpgKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGpgKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GpgKeyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GpgKeyable) + } + } + return val, nil +} +// Post adds a GPG key to the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint. +// returns a GpgKeyable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/gpg-keys#create-a-gpg-key-for-the-authenticated-user +func (m *Gpg_keysRequestBuilder) Post(ctx context.Context, body Gpg_keysPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GpgKeyable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGpgKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GpgKeyable), nil +} +// ToGetRequestInformation lists the current user's GPG keys.OAuth app tokens and personal access tokens (classic) need the `read:gpg_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Gpg_keysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Gpg_keysRequestBuilderGetQueryParameters])(*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 adds a GPG key to the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Gpg_keysRequestBuilder) ToPostRequestInformation(ctx context.Context, body Gpg_keysPostRequestBodyable, 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 *Gpg_keysRequestBuilder when successful +func (m *Gpg_keysRequestBuilder) WithUrl(rawUrl string)(*Gpg_keysRequestBuilder) { + return NewGpg_keysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/gpg_escaped_keys_with_gpg_escaped_key_escaped_item_request_builder.go b/pkg/github/user/gpg_escaped_keys_with_gpg_escaped_key_escaped_item_request_builder.go new file mode 100644 index 00000000..92af62b1 --- /dev/null +++ b/pkg/github/user/gpg_escaped_keys_with_gpg_escaped_key_escaped_item_request_builder.go @@ -0,0 +1,98 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// Gpg_keysWithGpg_key_ItemRequestBuilder builds and executes requests for operations under \user\gpg_keys\{gpg_key_id} +type Gpg_keysWithGpg_key_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewGpg_keysWithGpg_key_ItemRequestBuilderInternal instantiates a new Gpg_keysWithGpg_key_ItemRequestBuilder and sets the default values. +func NewGpg_keysWithGpg_key_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Gpg_keysWithGpg_key_ItemRequestBuilder) { + m := &Gpg_keysWithGpg_key_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/gpg_keys/{gpg_key_id}", pathParameters), + } + return m +} +// NewGpg_keysWithGpg_key_ItemRequestBuilder instantiates a new Gpg_keysWithGpg_key_ItemRequestBuilder and sets the default values. +func NewGpg_keysWithGpg_key_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Gpg_keysWithGpg_key_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewGpg_keysWithGpg_key_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a GPG key from the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `admin:gpg_key` scope to use this endpoint. +// 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/gpg-keys#delete-a-gpg-key-for-the-authenticated-user +func (m *Gpg_keysWithGpg_key_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 { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get view extended details for a single GPG key.OAuth app tokens and personal access tokens (classic) need the `read:gpg_key` scope to use this endpoint. +// returns a GpgKeyable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/gpg-keys#get-a-gpg-key-for-the-authenticated-user +func (m *Gpg_keysWithGpg_key_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GpgKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGpgKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GpgKeyable), nil +} +// ToDeleteRequestInformation removes a GPG key from the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `admin:gpg_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Gpg_keysWithGpg_key_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") + return requestInfo, nil +} +// ToGetRequestInformation view extended details for a single GPG key.OAuth app tokens and personal access tokens (classic) need the `read:gpg_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Gpg_keysWithGpg_key_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *Gpg_keysWithGpg_key_ItemRequestBuilder when successful +func (m *Gpg_keysWithGpg_key_ItemRequestBuilder) WithUrl(rawUrl string)(*Gpg_keysWithGpg_key_ItemRequestBuilder) { + return NewGpg_keysWithGpg_key_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/installations_get_response.go b/pkg/github/user/installations_get_response.go new file mode 100644 index 00000000..f9cf3beb --- /dev/null +++ b/pkg/github/user/installations_get_response.go @@ -0,0 +1,122 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type InstallationsGetResponse 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 installations property + installations []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable + // The total_count property + total_count *int32 +} +// NewInstallationsGetResponse instantiates a new InstallationsGetResponse and sets the default values. +func NewInstallationsGetResponse()(*InstallationsGetResponse) { + m := &InstallationsGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateInstallationsGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInstallationsGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInstallationsGetResponse(), 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 *InstallationsGetResponse) 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 *InstallationsGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["installations"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateInstallationFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable) + } + } + m.SetInstallations(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 +} +// GetInstallations gets the installations property value. The installations property +// returns a []Installationable when successful +func (m *InstallationsGetResponse) GetInstallations()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable) { + return m.installations +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *InstallationsGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *InstallationsGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetInstallations() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetInstallations())) + for i, v := range m.GetInstallations() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("installations", 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 *InstallationsGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetInstallations sets the installations property value. The installations property +func (m *InstallationsGetResponse) SetInstallations(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable)() { + m.installations = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *InstallationsGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type InstallationsGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetInstallations()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable) + GetTotalCount()(*int32) + SetInstallations(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/user/installations_item_repositories_get_response.go b/pkg/github/user/installations_item_repositories_get_response.go new file mode 100644 index 00000000..eda8a86e --- /dev/null +++ b/pkg/github/user/installations_item_repositories_get_response.go @@ -0,0 +1,151 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +type InstallationsItemRepositoriesGetResponse 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 repositories property + repositories []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable + // The repository_selection property + repository_selection *string + // The total_count property + total_count *int32 +} +// NewInstallationsItemRepositoriesGetResponse instantiates a new InstallationsItemRepositoriesGetResponse and sets the default values. +func NewInstallationsItemRepositoriesGetResponse()(*InstallationsItemRepositoriesGetResponse) { + m := &InstallationsItemRepositoriesGetResponse{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateInstallationsItemRepositoriesGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateInstallationsItemRepositoriesGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewInstallationsItemRepositoriesGetResponse(), 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 *InstallationsItemRepositoriesGetResponse) 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 *InstallationsItemRepositoriesGetResponse) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetCollectionOfObjectValues(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryFromDiscriminatorValue) + if err != nil { + return err + } + if val != nil { + res := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable, len(val)) + for i, v := range val { + if v != nil { + res[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable) + } + } + m.SetRepositories(res) + } + return nil + } + res["repository_selection"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetRepositorySelection(val) + } + 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 +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []Repositoryable when successful +func (m *InstallationsItemRepositoriesGetResponse) GetRepositories()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable) { + return m.repositories +} +// GetRepositorySelection gets the repository_selection property value. The repository_selection property +// returns a *string when successful +func (m *InstallationsItemRepositoriesGetResponse) GetRepositorySelection()(*string) { + return m.repository_selection +} +// GetTotalCount gets the total_count property value. The total_count property +// returns a *int32 when successful +func (m *InstallationsItemRepositoriesGetResponse) GetTotalCount()(*int32) { + return m.total_count +} +// Serialize serializes information the current object +func (m *InstallationsItemRepositoriesGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetRepositories() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetRepositories())) + for i, v := range m.GetRepositories() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("repositories", cast) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("repository_selection", m.GetRepositorySelection()) + 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 *InstallationsItemRepositoriesGetResponse) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *InstallationsItemRepositoriesGetResponse) SetRepositories(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable)() { + m.repositories = value +} +// SetRepositorySelection sets the repository_selection property value. The repository_selection property +func (m *InstallationsItemRepositoriesGetResponse) SetRepositorySelection(value *string)() { + m.repository_selection = value +} +// SetTotalCount sets the total_count property value. The total_count property +func (m *InstallationsItemRepositoriesGetResponse) SetTotalCount(value *int32)() { + m.total_count = value +} +type InstallationsItemRepositoriesGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetRepositories()([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable) + GetRepositorySelection()(*string) + GetTotalCount()(*int32) + SetRepositories(value []ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable)() + SetRepositorySelection(value *string)() + SetTotalCount(value *int32)() +} diff --git a/pkg/github/user/installations_item_repositories_request_builder.go b/pkg/github/user/installations_item_repositories_request_builder.go new file mode 100644 index 00000000..6d0345a1 --- /dev/null +++ b/pkg/github/user/installations_item_repositories_request_builder.go @@ -0,0 +1,81 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// InstallationsItemRepositoriesRequestBuilder builds and executes requests for operations under \user\installations\{installation_id}\repositories +type InstallationsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// InstallationsItemRepositoriesRequestBuilderGetQueryParameters list repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.The access the user has to each repository is included in the hash under the `permissions` key. +type InstallationsItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByRepository_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.installations.item.repositories.item collection +// returns a *InstallationsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *InstallationsItemRepositoriesRequestBuilder) ByRepository_id(repository_id int32)(*InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["repository_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(repository_id), 10) + return NewInstallationsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewInstallationsItemRepositoriesRequestBuilderInternal instantiates a new InstallationsItemRepositoriesRequestBuilder and sets the default values. +func NewInstallationsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemRepositoriesRequestBuilder) { + m := &InstallationsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/installations/{installation_id}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewInstallationsItemRepositoriesRequestBuilder instantiates a new InstallationsItemRepositoriesRequestBuilder and sets the default values. +func NewInstallationsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.The access the user has to each repository is included in the hash under the `permissions` key. +// returns a InstallationsItemRepositoriesGetResponseable 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/enterprise-server@3.14/rest/apps/installations#list-repositories-accessible-to-the-user-access-token +func (m *InstallationsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationsItemRepositoriesRequestBuilderGetQueryParameters])(InstallationsItemRepositoriesGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateInstallationsItemRepositoriesGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(InstallationsItemRepositoriesGetResponseable), nil +} +// ToGetRequestInformation list repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access for an installation.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.The access the user has to each repository is included in the hash under the `permissions` key. +// returns a *RequestInformation when successful +func (m *InstallationsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationsItemRepositoriesRequestBuilderGetQueryParameters])(*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 *InstallationsItemRepositoriesRequestBuilder when successful +func (m *InstallationsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*InstallationsItemRepositoriesRequestBuilder) { + return NewInstallationsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/installations_item_repositories_with_repository_escaped_item_request_builder.go b/pkg/github/user/installations_item_repositories_with_repository_escaped_item_request_builder.go new file mode 100644 index 00000000..e6051ec5 --- /dev/null +++ b/pkg/github/user/installations_item_repositories_with_repository_escaped_item_request_builder.go @@ -0,0 +1,88 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// InstallationsItemRepositoriesWithRepository_ItemRequestBuilder builds and executes requests for operations under \user\installations\{installation_id}\repositories\{repository_id} +type InstallationsItemRepositoriesWithRepository_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewInstallationsItemRepositoriesWithRepository_ItemRequestBuilderInternal instantiates a new InstallationsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewInstallationsItemRepositoriesWithRepository_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) { + m := &InstallationsItemRepositoriesWithRepository_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/installations/{installation_id}/repositories/{repository_id}", pathParameters), + } + return m +} +// NewInstallationsItemRepositoriesWithRepository_ItemRequestBuilder instantiates a new InstallationsItemRepositoriesWithRepository_ItemRequestBuilder and sets the default values. +func NewInstallationsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsItemRepositoriesWithRepository_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`. This endpoint only works for PATs (classic) with the `repo` scope. +// 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/enterprise-server@3.14/rest/apps/installations#remove-a-repository-from-an-app-installation +func (m *InstallationsItemRepositoriesWithRepository_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 { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put add a single repository to an installation. The authenticated user must have admin access to the repository. This endpoint only works for PATs (classic) with the `repo` scope. +// 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/enterprise-server@3.14/rest/apps/installations#add-a-repository-to-an-app-installation +func (m *InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation remove a single repository from an installation. The authenticated user must have admin access to the repository. The installation must have the `repository_selection` of `selected`. This endpoint only works for PATs (classic) with the `repo` scope. +// returns a *RequestInformation when successful +func (m *InstallationsItemRepositoriesWithRepository_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") + return requestInfo, nil +} +// ToPutRequestInformation add a single repository to an installation. The authenticated user must have admin access to the repository. This endpoint only works for PATs (classic) with the `repo` scope. +// returns a *RequestInformation when successful +func (m *InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) ToPutRequestInformation(ctx context.Context, 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") + 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 *InstallationsItemRepositoriesWithRepository_ItemRequestBuilder when successful +func (m *InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) WithUrl(rawUrl string)(*InstallationsItemRepositoriesWithRepository_ItemRequestBuilder) { + return NewInstallationsItemRepositoriesWithRepository_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/installations_request_builder.go b/pkg/github/user/installations_request_builder.go new file mode 100644 index 00000000..29e106bc --- /dev/null +++ b/pkg/github/user/installations_request_builder.go @@ -0,0 +1,81 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// InstallationsRequestBuilder builds and executes requests for operations under \user\installations +type InstallationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// InstallationsRequestBuilderGetQueryParameters lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.You can find the permissions for the installation under the `permissions` key. +type InstallationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByInstallation_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.installations.item collection +// returns a *InstallationsWithInstallation_ItemRequestBuilder when successful +func (m *InstallationsRequestBuilder) ByInstallation_id(installation_id int32)(*InstallationsWithInstallation_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["installation_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(installation_id), 10) + return NewInstallationsWithInstallation_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewInstallationsRequestBuilderInternal instantiates a new InstallationsRequestBuilder and sets the default values. +func NewInstallationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsRequestBuilder) { + m := &InstallationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/installations{?page*,per_page*}", pathParameters), + } + return m +} +// NewInstallationsRequestBuilder instantiates a new InstallationsRequestBuilder and sets the default values. +func NewInstallationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.You can find the permissions for the installation under the `permissions` key. +// returns a InstallationsGetResponseable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/installations#list-app-installations-accessible-to-the-user-access-token +func (m *InstallationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationsRequestBuilderGetQueryParameters])(InstallationsGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateInstallationsGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(InstallationsGetResponseable), nil +} +// ToGetRequestInformation lists installations of your GitHub App that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership.You can find the permissions for the installation under the `permissions` key. +// returns a *RequestInformation when successful +func (m *InstallationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[InstallationsRequestBuilderGetQueryParameters])(*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 *InstallationsRequestBuilder when successful +func (m *InstallationsRequestBuilder) WithUrl(rawUrl string)(*InstallationsRequestBuilder) { + return NewInstallationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/installations_with_installation_escaped_item_request_builder.go b/pkg/github/user/installations_with_installation_escaped_item_request_builder.go new file mode 100644 index 00000000..e69d370c --- /dev/null +++ b/pkg/github/user/installations_with_installation_escaped_item_request_builder.go @@ -0,0 +1,28 @@ +package user + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// InstallationsWithInstallation_ItemRequestBuilder builds and executes requests for operations under \user\installations\{installation_id} +type InstallationsWithInstallation_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewInstallationsWithInstallation_ItemRequestBuilderInternal instantiates a new InstallationsWithInstallation_ItemRequestBuilder and sets the default values. +func NewInstallationsWithInstallation_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsWithInstallation_ItemRequestBuilder) { + m := &InstallationsWithInstallation_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/installations/{installation_id}", pathParameters), + } + return m +} +// NewInstallationsWithInstallation_ItemRequestBuilder instantiates a new InstallationsWithInstallation_ItemRequestBuilder and sets the default values. +func NewInstallationsWithInstallation_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*InstallationsWithInstallation_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewInstallationsWithInstallation_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Repositories the repositories property +// returns a *InstallationsItemRepositoriesRequestBuilder when successful +func (m *InstallationsWithInstallation_ItemRequestBuilder) Repositories()(*InstallationsItemRepositoriesRequestBuilder) { + return NewInstallationsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/user/issues/get_direction_query_parameter_type.go b/pkg/github/user/issues/get_direction_query_parameter_type.go new file mode 100644 index 00000000..f176c1cc --- /dev/null +++ b/pkg/github/user/issues/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package issues +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/issues/get_filter_query_parameter_type.go b/pkg/github/user/issues/get_filter_query_parameter_type.go new file mode 100644 index 00000000..0c77b959 --- /dev/null +++ b/pkg/github/user/issues/get_filter_query_parameter_type.go @@ -0,0 +1,45 @@ +package issues +type GetFilterQueryParameterType int + +const ( + ASSIGNED_GETFILTERQUERYPARAMETERTYPE GetFilterQueryParameterType = iota + CREATED_GETFILTERQUERYPARAMETERTYPE + MENTIONED_GETFILTERQUERYPARAMETERTYPE + SUBSCRIBED_GETFILTERQUERYPARAMETERTYPE + REPOS_GETFILTERQUERYPARAMETERTYPE + ALL_GETFILTERQUERYPARAMETERTYPE +) + +func (i GetFilterQueryParameterType) String() string { + return []string{"assigned", "created", "mentioned", "subscribed", "repos", "all"}[i] +} +func ParseGetFilterQueryParameterType(v string) (any, error) { + result := ASSIGNED_GETFILTERQUERYPARAMETERTYPE + switch v { + case "assigned": + result = ASSIGNED_GETFILTERQUERYPARAMETERTYPE + case "created": + result = CREATED_GETFILTERQUERYPARAMETERTYPE + case "mentioned": + result = MENTIONED_GETFILTERQUERYPARAMETERTYPE + case "subscribed": + result = SUBSCRIBED_GETFILTERQUERYPARAMETERTYPE + case "repos": + result = REPOS_GETFILTERQUERYPARAMETERTYPE + case "all": + result = ALL_GETFILTERQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetFilterQueryParameterType(values []GetFilterQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetFilterQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/issues/get_sort_query_parameter_type.go b/pkg/github/user/issues/get_sort_query_parameter_type.go new file mode 100644 index 00000000..10b7912a --- /dev/null +++ b/pkg/github/user/issues/get_sort_query_parameter_type.go @@ -0,0 +1,36 @@ +package issues +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + COMMENTS_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "comments"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "comments": + result = COMMENTS_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/issues/get_state_query_parameter_type.go b/pkg/github/user/issues/get_state_query_parameter_type.go new file mode 100644 index 00000000..065faf93 --- /dev/null +++ b/pkg/github/user/issues/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package issues +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/issues_request_builder.go b/pkg/github/user/issues_request_builder.go new file mode 100644 index 00000000..0cd4bde1 --- /dev/null +++ b/pkg/github/user/issues_request_builder.go @@ -0,0 +1,85 @@ +package user + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + if1ab960635ffd41eb7eab1756c5d146b16383eb2ff1e0b7e2e3d3e0d7cb926a1 "github.com/octokit/go-sdk-enterprise-server/pkg/github/user/issues" +) + +// IssuesRequestBuilder builds and executes requests for operations under \user\issues +type IssuesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// IssuesRequestBuilderGetQueryParameters list issues across owned and member repositories assigned to the authenticated user.> [!NOTE]> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +type IssuesRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *if1ab960635ffd41eb7eab1756c5d146b16383eb2ff1e0b7e2e3d3e0d7cb926a1.GetDirectionQueryParameterType `uriparametername:"direction"` + // Indicates which sorts of issues to return. `assigned` means issues assigned to you. `created` means issues created by you. `mentioned` means issues mentioning you. `subscribed` means issues you're subscribed to updates for. `all` or `repos` means all issues you can see, regardless of participation or creation. + Filter *if1ab960635ffd41eb7eab1756c5d146b16383eb2ff1e0b7e2e3d3e0d7cb926a1.GetFilterQueryParameterType `uriparametername:"filter"` + // A list of comma separated label names. Example: `bug,ui,@high` + Labels *string `uriparametername:"labels"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // What to sort results by. + Sort *if1ab960635ffd41eb7eab1756c5d146b16383eb2ff1e0b7e2e3d3e0d7cb926a1.GetSortQueryParameterType `uriparametername:"sort"` + // Indicates the state of the issues to return. + State *if1ab960635ffd41eb7eab1756c5d146b16383eb2ff1e0b7e2e3d3e0d7cb926a1.GetStateQueryParameterType `uriparametername:"state"` +} +// NewIssuesRequestBuilderInternal instantiates a new IssuesRequestBuilder and sets the default values. +func NewIssuesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IssuesRequestBuilder) { + m := &IssuesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/issues{?direction*,filter*,labels*,page*,per_page*,since*,sort*,state*}", pathParameters), + } + return m +} +// NewIssuesRequestBuilder instantiates a new IssuesRequestBuilder and sets the default values. +func NewIssuesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*IssuesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewIssuesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list issues across owned and member repositories assigned to the authenticated user.> [!NOTE]> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a []Issueable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/issues/issues#list-user-account-issues-assigned-to-the-authenticated-user +func (m *IssuesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[IssuesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateIssueFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Issueable) + } + } + return val, nil +} +// ToGetRequestInformation list issues across owned and member repositories assigned to the authenticated user.> [!NOTE]> GitHub's REST API considers every pull request an issue, but not every issue is a pull request. For this reason, "Issues" endpoints may return both issues and pull requests in the response. You can identify pull requests by the `pull_request` key. Be aware that the `id` of a pull request returned from "Issues" endpoints will be an _issue id_. To find out the pull request id, use the "[List pull requests](https://docs.github.com/enterprise-server@3.14/rest/pulls/pulls#list-pull-requests)" endpoint.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.raw+json`**: Returns the raw markdown body. Response will include `body`. This is the default if you do not pass any specific media type.- **`application/vnd.github.text+json`**: Returns a text only representation of the markdown body. Response will include `body_text`.- **`application/vnd.github.html+json`**: Returns HTML rendered from the body's markdown. Response will include `body_html`.- **`application/vnd.github.full+json`**: Returns raw, text, and HTML representations. Response will include `body`, `body_text`, and `body_html`. +// returns a *RequestInformation when successful +func (m *IssuesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[IssuesRequestBuilderGetQueryParameters])(*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 *IssuesRequestBuilder when successful +func (m *IssuesRequestBuilder) WithUrl(rawUrl string)(*IssuesRequestBuilder) { + return NewIssuesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/keys_post_request_body.go b/pkg/github/user/keys_post_request_body.go new file mode 100644 index 00000000..be7c1d2c --- /dev/null +++ b/pkg/github/user/keys_post_request_body.go @@ -0,0 +1,109 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type KeysPostRequestBody 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 public SSH key to add to your GitHub account. + key *string + // A descriptive name for the new key. + title *string +} +// NewKeysPostRequestBody instantiates a new KeysPostRequestBody and sets the default values. +func NewKeysPostRequestBody()(*KeysPostRequestBody) { + m := &KeysPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateKeysPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateKeysPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewKeysPostRequestBody(), 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 *KeysPostRequestBody) 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 *KeysPostRequestBody) 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["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The public SSH key to add to your GitHub account. +// returns a *string when successful +func (m *KeysPostRequestBody) GetKey()(*string) { + return m.key +} +// GetTitle gets the title property value. A descriptive name for the new key. +// returns a *string when successful +func (m *KeysPostRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *KeysPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *KeysPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The public SSH key to add to your GitHub account. +func (m *KeysPostRequestBody) SetKey(value *string)() { + m.key = value +} +// SetTitle sets the title property value. A descriptive name for the new key. +func (m *KeysPostRequestBody) SetTitle(value *string)() { + m.title = value +} +type KeysPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetTitle()(*string) + SetKey(value *string)() + SetTitle(value *string)() +} diff --git a/pkg/github/user/keys_request_builder.go b/pkg/github/user/keys_request_builder.go new file mode 100644 index 00000000..eba88399 --- /dev/null +++ b/pkg/github/user/keys_request_builder.go @@ -0,0 +1,127 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// KeysRequestBuilder builds and executes requests for operations under \user\keys +type KeysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// KeysRequestBuilderGetQueryParameters lists the public SSH keys for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `read:public_key` scope to use this endpoint. +type KeysRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByKey_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.keys.item collection +// returns a *KeysWithKey_ItemRequestBuilder when successful +func (m *KeysRequestBuilder) ByKey_id(key_id int32)(*KeysWithKey_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["key_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(key_id), 10) + return NewKeysWithKey_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewKeysRequestBuilderInternal instantiates a new KeysRequestBuilder and sets the default values. +func NewKeysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeysRequestBuilder) { + m := &KeysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/keys{?page*,per_page*}", pathParameters), + } + return m +} +// NewKeysRequestBuilder instantiates a new KeysRequestBuilder and sets the default values. +func NewKeysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewKeysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the public SSH keys for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `read:public_key` scope to use this endpoint. +// returns a []Keyable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/keys#list-public-ssh-keys-for-the-authenticated-user +func (m *KeysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[KeysRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Keyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Keyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Keyable) + } + } + return val, nil +} +// Post adds a public SSH key to the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint. +// returns a Keyable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/keys#create-a-public-ssh-key-for-the-authenticated-user +func (m *KeysRequestBuilder) Post(ctx context.Context, body KeysPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Keyable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Keyable), nil +} +// ToGetRequestInformation lists the public SSH keys for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `read:public_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *KeysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[KeysRequestBuilderGetQueryParameters])(*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 adds a public SSH key to the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `write:gpg_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *KeysRequestBuilder) ToPostRequestInformation(ctx context.Context, body KeysPostRequestBodyable, 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 *KeysRequestBuilder when successful +func (m *KeysRequestBuilder) WithUrl(rawUrl string)(*KeysRequestBuilder) { + return NewKeysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/keys_with_key_escaped_item_request_builder.go b/pkg/github/user/keys_with_key_escaped_item_request_builder.go new file mode 100644 index 00000000..53b44d75 --- /dev/null +++ b/pkg/github/user/keys_with_key_escaped_item_request_builder.go @@ -0,0 +1,96 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// KeysWithKey_ItemRequestBuilder builds and executes requests for operations under \user\keys\{key_id} +type KeysWithKey_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewKeysWithKey_ItemRequestBuilderInternal instantiates a new KeysWithKey_ItemRequestBuilder and sets the default values. +func NewKeysWithKey_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeysWithKey_ItemRequestBuilder) { + m := &KeysWithKey_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/keys/{key_id}", pathParameters), + } + return m +} +// NewKeysWithKey_ItemRequestBuilder instantiates a new KeysWithKey_ItemRequestBuilder and sets the default values. +func NewKeysWithKey_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*KeysWithKey_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewKeysWithKey_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete removes a public SSH key from the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `admin:public_key` scope to use this endpoint. +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/keys#delete-a-public-ssh-key-for-the-authenticated-user +func (m *KeysWithKey_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 { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get view extended details for a single public SSH key.OAuth app tokens and personal access tokens (classic) need the `read:public_key` scope to use this endpoint. +// returns a Keyable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/keys#get-a-public-ssh-key-for-the-authenticated-user +func (m *KeysWithKey_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Keyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Keyable), nil +} +// ToDeleteRequestInformation removes a public SSH key from the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `admin:public_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *KeysWithKey_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") + return requestInfo, nil +} +// ToGetRequestInformation view extended details for a single public SSH key.OAuth app tokens and personal access tokens (classic) need the `read:public_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *KeysWithKey_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *KeysWithKey_ItemRequestBuilder when successful +func (m *KeysWithKey_ItemRequestBuilder) WithUrl(rawUrl string)(*KeysWithKey_ItemRequestBuilder) { + return NewKeysWithKey_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/memberships/orgs/get_state_query_parameter_type.go b/pkg/github/user/memberships/orgs/get_state_query_parameter_type.go new file mode 100644 index 00000000..bad195de --- /dev/null +++ b/pkg/github/user/memberships/orgs/get_state_query_parameter_type.go @@ -0,0 +1,33 @@ +package orgs +type GetStateQueryParameterType int + +const ( + ACTIVE_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + PENDING_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"active", "pending"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := ACTIVE_GETSTATEQUERYPARAMETERTYPE + switch v { + case "active": + result = ACTIVE_GETSTATEQUERYPARAMETERTYPE + case "pending": + result = PENDING_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/memberships/orgs/item/with_org_patch_request_body_escaped_state.go b/pkg/github/user/memberships/orgs/item/with_org_patch_request_body_escaped_state.go new file mode 100644 index 00000000..1d1d089a --- /dev/null +++ b/pkg/github/user/memberships/orgs/item/with_org_patch_request_body_escaped_state.go @@ -0,0 +1,31 @@ +package item +// The state that the membership should be in. Only `"active"` will be accepted. +type WithOrgPatchRequestBody_state int + +const ( + ACTIVE_WITHORGPATCHREQUESTBODY_STATE WithOrgPatchRequestBody_state = iota +) + +func (i WithOrgPatchRequestBody_state) String() string { + return []string{"active"}[i] +} +func ParseWithOrgPatchRequestBody_state(v string) (any, error) { + result := ACTIVE_WITHORGPATCHREQUESTBODY_STATE + switch v { + case "active": + result = ACTIVE_WITHORGPATCHREQUESTBODY_STATE + default: + return nil, nil + } + return &result, nil +} +func SerializeWithOrgPatchRequestBody_state(values []WithOrgPatchRequestBody_state) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i WithOrgPatchRequestBody_state) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/memberships_orgs_item_with_org_patch_request_body.go b/pkg/github/user/memberships_orgs_item_with_org_patch_request_body.go new file mode 100644 index 00000000..1fc6debe --- /dev/null +++ b/pkg/github/user/memberships_orgs_item_with_org_patch_request_body.go @@ -0,0 +1,51 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MembershipsOrgsItemWithOrgPatchRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewMembershipsOrgsItemWithOrgPatchRequestBody instantiates a new MembershipsOrgsItemWithOrgPatchRequestBody and sets the default values. +func NewMembershipsOrgsItemWithOrgPatchRequestBody()(*MembershipsOrgsItemWithOrgPatchRequestBody) { + m := &MembershipsOrgsItemWithOrgPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMembershipsOrgsItemWithOrgPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMembershipsOrgsItemWithOrgPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMembershipsOrgsItemWithOrgPatchRequestBody(), 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 *MembershipsOrgsItemWithOrgPatchRequestBody) 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 *MembershipsOrgsItemWithOrgPatchRequestBody) 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 *MembershipsOrgsItemWithOrgPatchRequestBody) 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 *MembershipsOrgsItemWithOrgPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type MembershipsOrgsItemWithOrgPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/user/memberships_orgs_request_builder.go b/pkg/github/user/memberships_orgs_request_builder.go new file mode 100644 index 00000000..62b96815 --- /dev/null +++ b/pkg/github/user/memberships_orgs_request_builder.go @@ -0,0 +1,90 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i841e0512172b6bc6cebe7fa6307ef8fd6049762720795a9f1c68e59ce67a9757 "github.com/octokit/go-sdk-enterprise-server/pkg/github/user/memberships/orgs" +) + +// MembershipsOrgsRequestBuilder builds and executes requests for operations under \user\memberships\orgs +type MembershipsOrgsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// MembershipsOrgsRequestBuilderGetQueryParameters lists all of the authenticated user's organization memberships. +type MembershipsOrgsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Indicates the state of the memberships to return. If not specified, the API returns both active and pending memberships. + State *i841e0512172b6bc6cebe7fa6307ef8fd6049762720795a9f1c68e59ce67a9757.GetStateQueryParameterType `uriparametername:"state"` +} +// ByOrg gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.memberships.orgs.item collection +// returns a *MembershipsOrgsWithOrgItemRequestBuilder when successful +func (m *MembershipsOrgsRequestBuilder) ByOrg(org string)(*MembershipsOrgsWithOrgItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if org != "" { + urlTplParams["org"] = org + } + return NewMembershipsOrgsWithOrgItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewMembershipsOrgsRequestBuilderInternal instantiates a new MembershipsOrgsRequestBuilder and sets the default values. +func NewMembershipsOrgsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MembershipsOrgsRequestBuilder) { + m := &MembershipsOrgsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/memberships/orgs{?page*,per_page*,state*}", pathParameters), + } + return m +} +// NewMembershipsOrgsRequestBuilder instantiates a new MembershipsOrgsRequestBuilder and sets the default values. +func NewMembershipsOrgsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MembershipsOrgsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMembershipsOrgsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all of the authenticated user's organization memberships. +// returns a []OrgMembershipable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/members#list-organization-memberships-for-the-authenticated-user +func (m *MembershipsOrgsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[MembershipsOrgsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgMembershipable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgMembershipFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgMembershipable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgMembershipable) + } + } + return val, nil +} +// ToGetRequestInformation lists all of the authenticated user's organization memberships. +// returns a *RequestInformation when successful +func (m *MembershipsOrgsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[MembershipsOrgsRequestBuilderGetQueryParameters])(*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 *MembershipsOrgsRequestBuilder when successful +func (m *MembershipsOrgsRequestBuilder) WithUrl(rawUrl string)(*MembershipsOrgsRequestBuilder) { + return NewMembershipsOrgsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/memberships_orgs_with_org_item_request_builder.go b/pkg/github/user/memberships_orgs_with_org_item_request_builder.go new file mode 100644 index 00000000..7ba488ff --- /dev/null +++ b/pkg/github/user/memberships_orgs_with_org_item_request_builder.go @@ -0,0 +1,102 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// MembershipsOrgsWithOrgItemRequestBuilder builds and executes requests for operations under \user\memberships\orgs\{org} +type MembershipsOrgsWithOrgItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewMembershipsOrgsWithOrgItemRequestBuilderInternal instantiates a new MembershipsOrgsWithOrgItemRequestBuilder and sets the default values. +func NewMembershipsOrgsWithOrgItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MembershipsOrgsWithOrgItemRequestBuilder) { + m := &MembershipsOrgsWithOrgItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/memberships/orgs/{org}", pathParameters), + } + return m +} +// NewMembershipsOrgsWithOrgItemRequestBuilder instantiates a new MembershipsOrgsWithOrgItemRequestBuilder and sets the default values. +func NewMembershipsOrgsWithOrgItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MembershipsOrgsWithOrgItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMembershipsOrgsWithOrgItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get if the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a `404` is returned. This endpoint will return a `403` if the request is made by a GitHub App that is blocked by the organization. +// returns a OrgMembershipable 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/enterprise-server@3.14/rest/orgs/members#get-an-organization-membership-for-the-authenticated-user +func (m *MembershipsOrgsWithOrgItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgMembershipable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgMembershipFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgMembershipable), nil +} +// Patch converts the authenticated user to an active member of the organization, if that user has a pending invitation from the organization. +// returns a OrgMembershipable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/members#update-an-organization-membership-for-the-authenticated-user +func (m *MembershipsOrgsWithOrgItemRequestBuilder) Patch(ctx context.Context, body MembershipsOrgsItemWithOrgPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgMembershipable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrgMembershipFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrgMembershipable), nil +} +// ToGetRequestInformation if the authenticated user is an active or pending member of the organization, this endpoint will return the user's membership. If the authenticated user is not affiliated with the organization, a `404` is returned. This endpoint will return a `403` if the request is made by a GitHub App that is blocked by the organization. +// returns a *RequestInformation when successful +func (m *MembershipsOrgsWithOrgItemRequestBuilder) 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 converts the authenticated user to an active member of the organization, if that user has a pending invitation from the organization. +// returns a *RequestInformation when successful +func (m *MembershipsOrgsWithOrgItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, body MembershipsOrgsItemWithOrgPatchRequestBodyable, 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 *MembershipsOrgsWithOrgItemRequestBuilder when successful +func (m *MembershipsOrgsWithOrgItemRequestBuilder) WithUrl(rawUrl string)(*MembershipsOrgsWithOrgItemRequestBuilder) { + return NewMembershipsOrgsWithOrgItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/memberships_request_builder.go b/pkg/github/user/memberships_request_builder.go new file mode 100644 index 00000000..f865a111 --- /dev/null +++ b/pkg/github/user/memberships_request_builder.go @@ -0,0 +1,28 @@ +package user + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// MembershipsRequestBuilder builds and executes requests for operations under \user\memberships +type MembershipsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewMembershipsRequestBuilderInternal instantiates a new MembershipsRequestBuilder and sets the default values. +func NewMembershipsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MembershipsRequestBuilder) { + m := &MembershipsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/memberships", pathParameters), + } + return m +} +// NewMembershipsRequestBuilder instantiates a new MembershipsRequestBuilder and sets the default values. +func NewMembershipsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MembershipsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMembershipsRequestBuilderInternal(urlParams, requestAdapter) +} +// Orgs the orgs property +// returns a *MembershipsOrgsRequestBuilder when successful +func (m *MembershipsRequestBuilder) Orgs()(*MembershipsOrgsRequestBuilder) { + return NewMembershipsOrgsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/user/migrations/migrations_post_request_body_escaped_exclude.go b/pkg/github/user/migrations/migrations_post_request_body_escaped_exclude.go new file mode 100644 index 00000000..e176c69d --- /dev/null +++ b/pkg/github/user/migrations/migrations_post_request_body_escaped_exclude.go @@ -0,0 +1,31 @@ +package migrations +// Allowed values that can be passed to the exclude param. +type MigrationsPostRequestBody_exclude int + +const ( + REPOSITORIES_MIGRATIONSPOSTREQUESTBODY_EXCLUDE MigrationsPostRequestBody_exclude = iota +) + +func (i MigrationsPostRequestBody_exclude) String() string { + return []string{"repositories"}[i] +} +func ParseMigrationsPostRequestBody_exclude(v string) (any, error) { + result := REPOSITORIES_MIGRATIONSPOSTREQUESTBODY_EXCLUDE + switch v { + case "repositories": + result = REPOSITORIES_MIGRATIONSPOSTREQUESTBODY_EXCLUDE + default: + return nil, nil + } + return &result, nil +} +func SerializeMigrationsPostRequestBody_exclude(values []MigrationsPostRequestBody_exclude) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i MigrationsPostRequestBody_exclude) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/migrations_item_archive_request_builder.go b/pkg/github/user/migrations_item_archive_request_builder.go new file mode 100644 index 00000000..20ac4e58 --- /dev/null +++ b/pkg/github/user/migrations_item_archive_request_builder.go @@ -0,0 +1,59 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// MigrationsItemArchiveRequestBuilder builds and executes requests for operations under \user\migrations\{migration_id}\archive +type MigrationsItemArchiveRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewMigrationsItemArchiveRequestBuilderInternal instantiates a new MigrationsItemArchiveRequestBuilder and sets the default values. +func NewMigrationsItemArchiveRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsItemArchiveRequestBuilder) { + m := &MigrationsItemArchiveRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/migrations/{migration_id}/archive", pathParameters), + } + return m +} +// NewMigrationsItemArchiveRequestBuilder instantiates a new MigrationsItemArchiveRequestBuilder and sets the default values. +func NewMigrationsItemArchiveRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsItemArchiveRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMigrationsItemArchiveRequestBuilderInternal(urlParams, requestAdapter) +} +// Get fetches the URL to download the migration archive as a `tar.gz` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects:* attachments* bases* commit\_comments* issue\_comments* issue\_events* issues* milestones* organizations* projects* protected\_branches* pull\_request\_reviews* pull\_requests* releases* repositories* review\_comments* schema* usersThe archive will also contain an `attachments` directory that includes all attachment files uploaded to GitHub.com and a `repositories` directory that contains the repository's Git data. +// returns a BasicError error when the service returns a 401 status code +// returns a BasicError error when the service returns a 403 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/migrations/users#download-a-user-migration-archive +func (m *MigrationsItemArchiveRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToGetRequestInformation fetches the URL to download the migration archive as a `tar.gz` file. Depending on the resources your repository uses, the migration archive can contain JSON files with data for these objects:* attachments* bases* commit\_comments* issue\_comments* issue\_events* issues* milestones* organizations* projects* protected\_branches* pull\_request\_reviews* pull\_requests* releases* repositories* review\_comments* schema* usersThe archive will also contain an `attachments` directory that includes all attachment files uploaded to GitHub.com and a `repositories` directory that contains the repository's Git data. +// returns a *RequestInformation when successful +func (m *MigrationsItemArchiveRequestBuilder) 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 *MigrationsItemArchiveRequestBuilder when successful +func (m *MigrationsItemArchiveRequestBuilder) WithUrl(rawUrl string)(*MigrationsItemArchiveRequestBuilder) { + return NewMigrationsItemArchiveRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/migrations_item_repositories_request_builder.go b/pkg/github/user/migrations_item_repositories_request_builder.go new file mode 100644 index 00000000..71cf4294 --- /dev/null +++ b/pkg/github/user/migrations_item_repositories_request_builder.go @@ -0,0 +1,71 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// MigrationsItemRepositoriesRequestBuilder builds and executes requests for operations under \user\migrations\{migration_id}\repositories +type MigrationsItemRepositoriesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// MigrationsItemRepositoriesRequestBuilderGetQueryParameters lists all the repositories for this user migration. +type MigrationsItemRepositoriesRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewMigrationsItemRepositoriesRequestBuilderInternal instantiates a new MigrationsItemRepositoriesRequestBuilder and sets the default values. +func NewMigrationsItemRepositoriesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsItemRepositoriesRequestBuilder) { + m := &MigrationsItemRepositoriesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/migrations/{migration_id}/repositories{?page*,per_page*}", pathParameters), + } + return m +} +// NewMigrationsItemRepositoriesRequestBuilder instantiates a new MigrationsItemRepositoriesRequestBuilder and sets the default values. +func NewMigrationsItemRepositoriesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsItemRepositoriesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMigrationsItemRepositoriesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all the repositories for this user migration. +// returns a []MinimalRepositoryable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/migrations/users#list-repositories-for-a-user-migration +func (m *MigrationsItemRepositoriesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[MigrationsItemRepositoriesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists all the repositories for this user migration. +// returns a *RequestInformation when successful +func (m *MigrationsItemRepositoriesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[MigrationsItemRepositoriesRequestBuilderGetQueryParameters])(*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 *MigrationsItemRepositoriesRequestBuilder when successful +func (m *MigrationsItemRepositoriesRequestBuilder) WithUrl(rawUrl string)(*MigrationsItemRepositoriesRequestBuilder) { + return NewMigrationsItemRepositoriesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/migrations_post_request_body.go b/pkg/github/user/migrations_post_request_body.go new file mode 100644 index 00000000..29914cc5 --- /dev/null +++ b/pkg/github/user/migrations_post_request_body.go @@ -0,0 +1,289 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type MigrationsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Do not include attachments in the migration + exclude_attachments *bool + // Indicates whether the repository git data should be excluded from the migration. + exclude_git_data *bool + // Indicates whether metadata should be excluded and only git source should be included for the migration. + exclude_metadata *bool + // Indicates whether projects owned by the organization or users should be excluded. + exclude_owner_projects *bool + // Do not include releases in the migration + exclude_releases *bool + // Lock the repositories being migrated at the start of the migration + lock_repositories *bool + // Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags). + org_metadata_only *bool + // The repositories property + repositories []string +} +// NewMigrationsPostRequestBody instantiates a new MigrationsPostRequestBody and sets the default values. +func NewMigrationsPostRequestBody()(*MigrationsPostRequestBody) { + m := &MigrationsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateMigrationsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateMigrationsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewMigrationsPostRequestBody(), 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 *MigrationsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetExcludeAttachments gets the exclude_attachments property value. Do not include attachments in the migration +// returns a *bool when successful +func (m *MigrationsPostRequestBody) GetExcludeAttachments()(*bool) { + return m.exclude_attachments +} +// GetExcludeGitData gets the exclude_git_data property value. Indicates whether the repository git data should be excluded from the migration. +// returns a *bool when successful +func (m *MigrationsPostRequestBody) GetExcludeGitData()(*bool) { + return m.exclude_git_data +} +// GetExcludeMetadata gets the exclude_metadata property value. Indicates whether metadata should be excluded and only git source should be included for the migration. +// returns a *bool when successful +func (m *MigrationsPostRequestBody) GetExcludeMetadata()(*bool) { + return m.exclude_metadata +} +// GetExcludeOwnerProjects gets the exclude_owner_projects property value. Indicates whether projects owned by the organization or users should be excluded. +// returns a *bool when successful +func (m *MigrationsPostRequestBody) GetExcludeOwnerProjects()(*bool) { + return m.exclude_owner_projects +} +// GetExcludeReleases gets the exclude_releases property value. Do not include releases in the migration +// returns a *bool when successful +func (m *MigrationsPostRequestBody) GetExcludeReleases()(*bool) { + return m.exclude_releases +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *MigrationsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["exclude_attachments"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeAttachments(val) + } + return nil + } + res["exclude_git_data"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeGitData(val) + } + return nil + } + res["exclude_metadata"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeMetadata(val) + } + return nil + } + res["exclude_owner_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeOwnerProjects(val) + } + return nil + } + res["exclude_releases"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetExcludeReleases(val) + } + return nil + } + res["lock_repositories"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetLockRepositories(val) + } + return nil + } + res["org_metadata_only"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetOrgMetadataOnly(val) + } + return nil + } + res["repositories"] = 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.SetRepositories(res) + } + return nil + } + return res +} +// GetLockRepositories gets the lock_repositories property value. Lock the repositories being migrated at the start of the migration +// returns a *bool when successful +func (m *MigrationsPostRequestBody) GetLockRepositories()(*bool) { + return m.lock_repositories +} +// GetOrgMetadataOnly gets the org_metadata_only property value. Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags). +// returns a *bool when successful +func (m *MigrationsPostRequestBody) GetOrgMetadataOnly()(*bool) { + return m.org_metadata_only +} +// GetRepositories gets the repositories property value. The repositories property +// returns a []string when successful +func (m *MigrationsPostRequestBody) GetRepositories()([]string) { + return m.repositories +} +// Serialize serializes information the current object +func (m *MigrationsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("exclude_attachments", m.GetExcludeAttachments()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_git_data", m.GetExcludeGitData()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_metadata", m.GetExcludeMetadata()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_owner_projects", m.GetExcludeOwnerProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("exclude_releases", m.GetExcludeReleases()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("lock_repositories", m.GetLockRepositories()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("org_metadata_only", m.GetOrgMetadataOnly()) + if err != nil { + return err + } + } + if m.GetRepositories() != nil { + err := writer.WriteCollectionOfStringValues("repositories", m.GetRepositories()) + 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 *MigrationsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetExcludeAttachments sets the exclude_attachments property value. Do not include attachments in the migration +func (m *MigrationsPostRequestBody) SetExcludeAttachments(value *bool)() { + m.exclude_attachments = value +} +// SetExcludeGitData sets the exclude_git_data property value. Indicates whether the repository git data should be excluded from the migration. +func (m *MigrationsPostRequestBody) SetExcludeGitData(value *bool)() { + m.exclude_git_data = value +} +// SetExcludeMetadata sets the exclude_metadata property value. Indicates whether metadata should be excluded and only git source should be included for the migration. +func (m *MigrationsPostRequestBody) SetExcludeMetadata(value *bool)() { + m.exclude_metadata = value +} +// SetExcludeOwnerProjects sets the exclude_owner_projects property value. Indicates whether projects owned by the organization or users should be excluded. +func (m *MigrationsPostRequestBody) SetExcludeOwnerProjects(value *bool)() { + m.exclude_owner_projects = value +} +// SetExcludeReleases sets the exclude_releases property value. Do not include releases in the migration +func (m *MigrationsPostRequestBody) SetExcludeReleases(value *bool)() { + m.exclude_releases = value +} +// SetLockRepositories sets the lock_repositories property value. Lock the repositories being migrated at the start of the migration +func (m *MigrationsPostRequestBody) SetLockRepositories(value *bool)() { + m.lock_repositories = value +} +// SetOrgMetadataOnly sets the org_metadata_only property value. Indicates whether this should only include organization metadata (repositories array should be empty and will ignore other flags). +func (m *MigrationsPostRequestBody) SetOrgMetadataOnly(value *bool)() { + m.org_metadata_only = value +} +// SetRepositories sets the repositories property value. The repositories property +func (m *MigrationsPostRequestBody) SetRepositories(value []string)() { + m.repositories = value +} +type MigrationsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetExcludeAttachments()(*bool) + GetExcludeGitData()(*bool) + GetExcludeMetadata()(*bool) + GetExcludeOwnerProjects()(*bool) + GetExcludeReleases()(*bool) + GetLockRepositories()(*bool) + GetOrgMetadataOnly()(*bool) + GetRepositories()([]string) + SetExcludeAttachments(value *bool)() + SetExcludeGitData(value *bool)() + SetExcludeMetadata(value *bool)() + SetExcludeOwnerProjects(value *bool)() + SetExcludeReleases(value *bool)() + SetLockRepositories(value *bool)() + SetOrgMetadataOnly(value *bool)() + SetRepositories(value []string)() +} diff --git a/pkg/github/user/migrations_request_builder.go b/pkg/github/user/migrations_request_builder.go new file mode 100644 index 00000000..ba707c3d --- /dev/null +++ b/pkg/github/user/migrations_request_builder.go @@ -0,0 +1,123 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// MigrationsRequestBuilder builds and executes requests for operations under \user\migrations +type MigrationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// MigrationsRequestBuilderGetQueryParameters lists all migrations a user has started. +type MigrationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByMigration_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.migrations.item collection +// returns a *MigrationsWithMigration_ItemRequestBuilder when successful +func (m *MigrationsRequestBuilder) ByMigration_id(migration_id int32)(*MigrationsWithMigration_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["migration_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(migration_id), 10) + return NewMigrationsWithMigration_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewMigrationsRequestBuilderInternal instantiates a new MigrationsRequestBuilder and sets the default values. +func NewMigrationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsRequestBuilder) { + m := &MigrationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/migrations{?page*,per_page*}", pathParameters), + } + return m +} +// NewMigrationsRequestBuilder instantiates a new MigrationsRequestBuilder and sets the default values. +func NewMigrationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMigrationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all migrations a user has started. +// returns a []Migrationable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/migrations/users#list-user-migrations +func (m *MigrationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[MigrationsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Migrationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMigrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Migrationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Migrationable) + } + } + return val, nil +} +// Post initiates the generation of a user migration archive. +// returns a Migrationable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/migrations/users#start-a-user-migration +func (m *MigrationsRequestBuilder) Post(ctx context.Context, body MigrationsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Migrationable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMigrationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Migrationable), nil +} +// ToGetRequestInformation lists all migrations a user has started. +// returns a *RequestInformation when successful +func (m *MigrationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[MigrationsRequestBuilderGetQueryParameters])(*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 initiates the generation of a user migration archive. +// returns a *RequestInformation when successful +func (m *MigrationsRequestBuilder) ToPostRequestInformation(ctx context.Context, body MigrationsPostRequestBodyable, 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 *MigrationsRequestBuilder when successful +func (m *MigrationsRequestBuilder) WithUrl(rawUrl string)(*MigrationsRequestBuilder) { + return NewMigrationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/migrations_with_migration_escaped_item_request_builder.go b/pkg/github/user/migrations_with_migration_escaped_item_request_builder.go new file mode 100644 index 00000000..98c22262 --- /dev/null +++ b/pkg/github/user/migrations_with_migration_escaped_item_request_builder.go @@ -0,0 +1,33 @@ +package user + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// MigrationsWithMigration_ItemRequestBuilder builds and executes requests for operations under \user\migrations\{migration_id} +type MigrationsWithMigration_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Archive the archive property +// returns a *MigrationsItemArchiveRequestBuilder when successful +func (m *MigrationsWithMigration_ItemRequestBuilder) Archive()(*MigrationsItemArchiveRequestBuilder) { + return NewMigrationsItemArchiveRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewMigrationsWithMigration_ItemRequestBuilderInternal instantiates a new MigrationsWithMigration_ItemRequestBuilder and sets the default values. +func NewMigrationsWithMigration_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsWithMigration_ItemRequestBuilder) { + m := &MigrationsWithMigration_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/migrations/{migration_id}", pathParameters), + } + return m +} +// NewMigrationsWithMigration_ItemRequestBuilder instantiates a new MigrationsWithMigration_ItemRequestBuilder and sets the default values. +func NewMigrationsWithMigration_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*MigrationsWithMigration_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewMigrationsWithMigration_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Repositories the repositories property +// returns a *MigrationsItemRepositoriesRequestBuilder when successful +func (m *MigrationsWithMigration_ItemRequestBuilder) Repositories()(*MigrationsItemRepositoriesRequestBuilder) { + return NewMigrationsItemRepositoriesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} diff --git a/pkg/github/user/orgs_request_builder.go b/pkg/github/user/orgs_request_builder.go new file mode 100644 index 00000000..fd99a984 --- /dev/null +++ b/pkg/github/user/orgs_request_builder.go @@ -0,0 +1,73 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// OrgsRequestBuilder builds and executes requests for operations under \user\orgs +type OrgsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// OrgsRequestBuilderGetQueryParameters list organizations for the authenticated user.For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response. +type OrgsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewOrgsRequestBuilderInternal instantiates a new OrgsRequestBuilder and sets the default values. +func NewOrgsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrgsRequestBuilder) { + m := &OrgsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/orgs{?page*,per_page*}", pathParameters), + } + return m +} +// NewOrgsRequestBuilder instantiates a new OrgsRequestBuilder and sets the default values. +func NewOrgsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*OrgsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewOrgsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list organizations for the authenticated user.For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response. +// returns a []OrganizationSimpleable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/orgs#list-organizations-for-the-authenticated-user +func (m *OrgsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[OrgsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationSimpleFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable) + } + } + return val, nil +} +// ToGetRequestInformation list organizations for the authenticated user.For OAuth app tokens and personal access tokens (classic), this endpoint only lists organizations that your authorization allows you to operate on in some way (e.g., you can list teams with `read:org` scope, you can publicize your organization membership with `user` scope, etc.). Therefore, this API requires at least `user` or `read:org` scope for OAuth app tokens and personal access tokens (classic). Requests with insufficient scope will receive a `403 Forbidden` response. +// returns a *RequestInformation when successful +func (m *OrgsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[OrgsRequestBuilderGetQueryParameters])(*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 *OrgsRequestBuilder when successful +func (m *OrgsRequestBuilder) WithUrl(rawUrl string)(*OrgsRequestBuilder) { + return NewOrgsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/packages/get_package_escaped_type_query_parameter_type.go b/pkg/github/user/packages/get_package_escaped_type_query_parameter_type.go new file mode 100644 index 00000000..071c8927 --- /dev/null +++ b/pkg/github/user/packages/get_package_escaped_type_query_parameter_type.go @@ -0,0 +1,45 @@ +package packages +type GetPackage_typeQueryParameterType int + +const ( + NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE GetPackage_typeQueryParameterType = iota + MAVEN_GETPACKAGE_TYPEQUERYPARAMETERTYPE + RUBYGEMS_GETPACKAGE_TYPEQUERYPARAMETERTYPE + DOCKER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + NUGET_GETPACKAGE_TYPEQUERYPARAMETERTYPE + CONTAINER_GETPACKAGE_TYPEQUERYPARAMETERTYPE +) + +func (i GetPackage_typeQueryParameterType) String() string { + return []string{"npm", "maven", "rubygems", "docker", "nuget", "container"}[i] +} +func ParseGetPackage_typeQueryParameterType(v string) (any, error) { + result := NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE + switch v { + case "npm": + result = NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "maven": + result = MAVEN_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "rubygems": + result = RUBYGEMS_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "docker": + result = DOCKER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "nuget": + result = NUGET_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "container": + result = CONTAINER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetPackage_typeQueryParameterType(values []GetPackage_typeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetPackage_typeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/packages/get_visibility_query_parameter_type.go b/pkg/github/user/packages/get_visibility_query_parameter_type.go new file mode 100644 index 00000000..f6ffbef0 --- /dev/null +++ b/pkg/github/user/packages/get_visibility_query_parameter_type.go @@ -0,0 +1,36 @@ +package packages +type GetVisibilityQueryParameterType int + +const ( + PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE GetVisibilityQueryParameterType = iota + PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE + INTERNAL_GETVISIBILITYQUERYPARAMETERTYPE +) + +func (i GetVisibilityQueryParameterType) String() string { + return []string{"public", "private", "internal"}[i] +} +func ParseGetVisibilityQueryParameterType(v string) (any, error) { + result := PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + switch v { + case "public": + result = PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + case "private": + result = PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE + case "internal": + result = INTERNAL_GETVISIBILITYQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetVisibilityQueryParameterType(values []GetVisibilityQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetVisibilityQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/packages/item/item/versions/get_state_query_parameter_type.go b/pkg/github/user/packages/item/item/versions/get_state_query_parameter_type.go new file mode 100644 index 00000000..e78d12f6 --- /dev/null +++ b/pkg/github/user/packages/item/item/versions/get_state_query_parameter_type.go @@ -0,0 +1,33 @@ +package versions +type GetStateQueryParameterType int + +const ( + ACTIVE_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + DELETED_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"active", "deleted"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := ACTIVE_GETSTATEQUERYPARAMETERTYPE + switch v { + case "active": + result = ACTIVE_GETSTATEQUERYPARAMETERTYPE + case "deleted": + result = DELETED_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/packages_item_item_restore_request_builder.go b/pkg/github/user/packages_item_item_restore_request_builder.go new file mode 100644 index 00000000..f54b565c --- /dev/null +++ b/pkg/github/user/packages_item_item_restore_request_builder.go @@ -0,0 +1,66 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// PackagesItemItemRestoreRequestBuilder builds and executes requests for operations under \user\packages\{package_type}\{package_name}\restore +type PackagesItemItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// PackagesItemItemRestoreRequestBuilderPostQueryParameters restores a package owned by the authenticated user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type PackagesItemItemRestoreRequestBuilderPostQueryParameters struct { + // package token + Token *string `uriparametername:"token"` +} +// NewPackagesItemItemRestoreRequestBuilderInternal instantiates a new PackagesItemItemRestoreRequestBuilder and sets the default values. +func NewPackagesItemItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemRestoreRequestBuilder) { + m := &PackagesItemItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/packages/{package_type}/{package_name}/restore{?token*}", pathParameters), + } + return m +} +// NewPackagesItemItemRestoreRequestBuilder instantiates a new PackagesItemItemRestoreRequestBuilder and sets the default values. +func NewPackagesItemItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemRestoreRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPackagesItemItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} +// Post restores a package owned by the authenticated user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#restore-a-package-for-the-authenticated-user +func (m *PackagesItemItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PackagesItemItemRestoreRequestBuilderPostQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation restores a package owned by the authenticated user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesItemItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PackagesItemItemRestoreRequestBuilderPostQueryParameters])(*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 *PackagesItemItemRestoreRequestBuilder when successful +func (m *PackagesItemItemRestoreRequestBuilder) WithUrl(rawUrl string)(*PackagesItemItemRestoreRequestBuilder) { + return NewPackagesItemItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/packages_item_item_versions_item_restore_request_builder.go b/pkg/github/user/packages_item_item_versions_item_restore_request_builder.go new file mode 100644 index 00000000..1f484596 --- /dev/null +++ b/pkg/github/user/packages_item_item_versions_item_restore_request_builder.go @@ -0,0 +1,61 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// PackagesItemItemVersionsItemRestoreRequestBuilder builds and executes requests for operations under \user\packages\{package_type}\{package_name}\versions\{package_version_id}\restore +type PackagesItemItemVersionsItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewPackagesItemItemVersionsItemRestoreRequestBuilderInternal instantiates a new PackagesItemItemVersionsItemRestoreRequestBuilder and sets the default values. +func NewPackagesItemItemVersionsItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemVersionsItemRestoreRequestBuilder) { + m := &PackagesItemItemVersionsItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/packages/{package_type}/{package_name}/versions/{package_version_id}/restore", pathParameters), + } + return m +} +// NewPackagesItemItemVersionsItemRestoreRequestBuilder instantiates a new PackagesItemItemVersionsItemRestoreRequestBuilder and sets the default values. +func NewPackagesItemItemVersionsItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemVersionsItemRestoreRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPackagesItemItemVersionsItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} +// Post restores a package version owned by the authenticated user.You can restore a deleted package version under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#restore-a-package-version-for-the-authenticated-user +func (m *PackagesItemItemVersionsItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation restores a package version owned by the authenticated user.You can restore a deleted package version under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesItemItemVersionsItemRestoreRequestBuilder) 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 *PackagesItemItemVersionsItemRestoreRequestBuilder when successful +func (m *PackagesItemItemVersionsItemRestoreRequestBuilder) WithUrl(rawUrl string)(*PackagesItemItemVersionsItemRestoreRequestBuilder) { + return NewPackagesItemItemVersionsItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/packages_item_item_versions_request_builder.go b/pkg/github/user/packages_item_item_versions_request_builder.go new file mode 100644 index 00000000..ac23b6bb --- /dev/null +++ b/pkg/github/user/packages_item_item_versions_request_builder.go @@ -0,0 +1,89 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + ie3e38d3c245e5a60c6e23d0be682cf222ca82a823bcffdd08be0dd88d18ed80e "github.com/octokit/go-sdk-enterprise-server/pkg/github/user/packages/item/item/versions" +) + +// PackagesItemItemVersionsRequestBuilder builds and executes requests for operations under \user\packages\{package_type}\{package_name}\versions +type PackagesItemItemVersionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// PackagesItemItemVersionsRequestBuilderGetQueryParameters lists package versions for a package owned by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type PackagesItemItemVersionsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The state of the package, either active or deleted. + State *ie3e38d3c245e5a60c6e23d0be682cf222ca82a823bcffdd08be0dd88d18ed80e.GetStateQueryParameterType `uriparametername:"state"` +} +// ByPackage_version_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.packages.item.item.versions.item collection +// returns a *PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder when successful +func (m *PackagesItemItemVersionsRequestBuilder) ByPackage_version_id(package_version_id int32)(*PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["package_version_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(package_version_id), 10) + return NewPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewPackagesItemItemVersionsRequestBuilderInternal instantiates a new PackagesItemItemVersionsRequestBuilder and sets the default values. +func NewPackagesItemItemVersionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemVersionsRequestBuilder) { + m := &PackagesItemItemVersionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/packages/{package_type}/{package_name}/versions{?page*,per_page*,state*}", pathParameters), + } + return m +} +// NewPackagesItemItemVersionsRequestBuilder instantiates a new PackagesItemItemVersionsRequestBuilder and sets the default values. +func NewPackagesItemItemVersionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemVersionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPackagesItemItemVersionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists package versions for a package owned by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a []PackageVersionable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#list-package-versions-for-a-package-owned-by-the-authenticated-user +func (m *PackagesItemItemVersionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PackagesItemItemVersionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable) + } + } + return val, nil +} +// ToGetRequestInformation lists package versions for a package owned by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesItemItemVersionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PackagesItemItemVersionsRequestBuilderGetQueryParameters])(*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 *PackagesItemItemVersionsRequestBuilder when successful +func (m *PackagesItemItemVersionsRequestBuilder) WithUrl(rawUrl string)(*PackagesItemItemVersionsRequestBuilder) { + return NewPackagesItemItemVersionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/packages_item_item_versions_with_package_escaped_version_escaped_item_request_builder.go b/pkg/github/user/packages_item_item_versions_with_package_escaped_version_escaped_item_request_builder.go new file mode 100644 index 00000000..227a86de --- /dev/null +++ b/pkg/github/user/packages_item_item_versions_with_package_escaped_version_escaped_item_request_builder.go @@ -0,0 +1,93 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder builds and executes requests for operations under \user\packages\{package_type}\{package_name}\versions\{package_version_id} +type PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal instantiates a new PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder and sets the default values. +func NewPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + m := &PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/packages/{package_type}/{package_name}/versions/{package_version_id}", pathParameters), + } + return m +} +// NewPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder instantiates a new PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder and sets the default values. +func NewPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.The authenticated user must have admin permissions in the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#delete-a-package-version-for-the-authenticated-user +func (m *PackagesItemItemVersionsWithPackage_version_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 { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a specific package version for a package owned by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a PackageVersionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#get-a-package-version-for-the-authenticated-user +func (m *PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageVersionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable), nil +} +// Restore the restore property +// returns a *PackagesItemItemVersionsItemRestoreRequestBuilder when successful +func (m *PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Restore()(*PackagesItemItemVersionsItemRestoreRequestBuilder) { + return NewPackagesItemItemVersionsItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a specific package version for a package owned by the authenticated user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.The authenticated user must have admin permissions in the organization to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesItemItemVersionsWithPackage_version_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") + return requestInfo, nil +} +// ToGetRequestInformation gets a specific package version for a package owned by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesItemItemVersionsWithPackage_version_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder when successful +func (m *PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) WithUrl(rawUrl string)(*PackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + return NewPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/packages_item_with_package_escaped_name_item_request_builder.go b/pkg/github/user/packages_item_with_package_escaped_name_item_request_builder.go new file mode 100644 index 00000000..cda76c4e --- /dev/null +++ b/pkg/github/user/packages_item_with_package_escaped_name_item_request_builder.go @@ -0,0 +1,98 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// PackagesItemWithPackage_nameItemRequestBuilder builds and executes requests for operations under \user\packages\{package_type}\{package_name} +type PackagesItemWithPackage_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewPackagesItemWithPackage_nameItemRequestBuilderInternal instantiates a new PackagesItemWithPackage_nameItemRequestBuilder and sets the default values. +func NewPackagesItemWithPackage_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemWithPackage_nameItemRequestBuilder) { + m := &PackagesItemWithPackage_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/packages/{package_type}/{package_name}", pathParameters), + } + return m +} +// NewPackagesItemWithPackage_nameItemRequestBuilder instantiates a new PackagesItemWithPackage_nameItemRequestBuilder and sets the default values. +func NewPackagesItemWithPackage_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesItemWithPackage_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPackagesItemWithPackage_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, `repo` scope is also required. For the list these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#delete-a-package-for-the-authenticated-user +func (m *PackagesItemWithPackage_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 { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a specific package for a package owned by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a PackageEscapedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#get-a-package-for-the-authenticated-user +func (m *PackagesItemWithPackage_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageEscapedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable), nil +} +// Restore the restore property +// returns a *PackagesItemItemRestoreRequestBuilder when successful +func (m *PackagesItemWithPackage_nameItemRequestBuilder) Restore()(*PackagesItemItemRestoreRequestBuilder) { + return NewPackagesItemItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a package owned by the authenticated user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, `repo` scope is also required. For the list these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesItemWithPackage_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") + return requestInfo, nil +} +// ToGetRequestInformation gets a specific package for a package owned by the authenticated user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesItemWithPackage_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 +} +// Versions the versions property +// returns a *PackagesItemItemVersionsRequestBuilder when successful +func (m *PackagesItemWithPackage_nameItemRequestBuilder) Versions()(*PackagesItemItemVersionsRequestBuilder) { + return NewPackagesItemItemVersionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *PackagesItemWithPackage_nameItemRequestBuilder when successful +func (m *PackagesItemWithPackage_nameItemRequestBuilder) WithUrl(rawUrl string)(*PackagesItemWithPackage_nameItemRequestBuilder) { + return NewPackagesItemWithPackage_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/packages_request_builder.go b/pkg/github/user/packages_request_builder.go new file mode 100644 index 00000000..8fe47d2e --- /dev/null +++ b/pkg/github/user/packages_request_builder.go @@ -0,0 +1,84 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + idfe81f62bf34ae3347ccebafe6ad58dc6a612f663d209b1f2887e70ecb7726ff "github.com/octokit/go-sdk-enterprise-server/pkg/github/user/packages" +) + +// PackagesRequestBuilder builds and executes requests for operations under \user\packages +type PackagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// PackagesRequestBuilderGetQueryParameters lists packages owned by the authenticated user within the user's namespace.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type PackagesRequestBuilderGetQueryParameters struct { + // The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. + Package_type *idfe81f62bf34ae3347ccebafe6ad58dc6a612f663d209b1f2887e70ecb7726ff.GetPackage_typeQueryParameterType `uriparametername:"package_type"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The selected visibility of the packages. This parameter is optional and only filters an existing result set.The `internal` visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystems `internal` is synonymous with `private`.For the list of GitHub Packages registries that support granular permissions, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." + Visibility *idfe81f62bf34ae3347ccebafe6ad58dc6a612f663d209b1f2887e70ecb7726ff.GetVisibilityQueryParameterType `uriparametername:"visibility"` +} +// ByPackage_type gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.packages.item collection +// returns a *PackagesWithPackage_typeItemRequestBuilder when successful +func (m *PackagesRequestBuilder) ByPackage_type(package_type string)(*PackagesWithPackage_typeItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if package_type != "" { + urlTplParams["package_type"] = package_type + } + return NewPackagesWithPackage_typeItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewPackagesRequestBuilderInternal instantiates a new PackagesRequestBuilder and sets the default values. +func NewPackagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesRequestBuilder) { + m := &PackagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/packages?package_type={package_type}{&page*,per_page*,visibility*}", pathParameters), + } + return m +} +// NewPackagesRequestBuilder instantiates a new PackagesRequestBuilder and sets the default values. +func NewPackagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPackagesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists packages owned by the authenticated user within the user's namespace.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a []PackageEscapedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#list-packages-for-the-authenticated-users-namespace +func (m *PackagesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PackagesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageEscapedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable) + } + } + return val, nil +} +// ToGetRequestInformation lists packages owned by the authenticated user within the user's namespace.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *PackagesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[PackagesRequestBuilderGetQueryParameters])(*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 *PackagesRequestBuilder when successful +func (m *PackagesRequestBuilder) WithUrl(rawUrl string)(*PackagesRequestBuilder) { + return NewPackagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/packages_with_package_escaped_type_item_request_builder.go b/pkg/github/user/packages_with_package_escaped_type_item_request_builder.go new file mode 100644 index 00000000..848c3450 --- /dev/null +++ b/pkg/github/user/packages_with_package_escaped_type_item_request_builder.go @@ -0,0 +1,35 @@ +package user + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// PackagesWithPackage_typeItemRequestBuilder builds and executes requests for operations under \user\packages\{package_type} +type PackagesWithPackage_typeItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByPackage_name gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.packages.item.item collection +// returns a *PackagesItemWithPackage_nameItemRequestBuilder when successful +func (m *PackagesWithPackage_typeItemRequestBuilder) ByPackage_name(package_name string)(*PackagesItemWithPackage_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if package_name != "" { + urlTplParams["package_name"] = package_name + } + return NewPackagesItemWithPackage_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewPackagesWithPackage_typeItemRequestBuilderInternal instantiates a new PackagesWithPackage_typeItemRequestBuilder and sets the default values. +func NewPackagesWithPackage_typeItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesWithPackage_typeItemRequestBuilder) { + m := &PackagesWithPackage_typeItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/packages/{package_type}", pathParameters), + } + return m +} +// NewPackagesWithPackage_typeItemRequestBuilder instantiates a new PackagesWithPackage_typeItemRequestBuilder and sets the default values. +func NewPackagesWithPackage_typeItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*PackagesWithPackage_typeItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPackagesWithPackage_typeItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/user/projects_post_request_body.go b/pkg/github/user/projects_post_request_body.go new file mode 100644 index 00000000..1c18aca3 --- /dev/null +++ b/pkg/github/user/projects_post_request_body.go @@ -0,0 +1,109 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ProjectsPostRequestBody struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any + // Body of the project + body *string + // Name of the project + name *string +} +// NewProjectsPostRequestBody instantiates a new ProjectsPostRequestBody and sets the default values. +func NewProjectsPostRequestBody()(*ProjectsPostRequestBody) { + m := &ProjectsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateProjectsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateProjectsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewProjectsPostRequestBody(), 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 *ProjectsPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBody gets the body property value. Body of the project +// returns a *string when successful +func (m *ProjectsPostRequestBody) GetBody()(*string) { + return m.body +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *ProjectsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["body"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBody(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. Name of the project +// returns a *string when successful +func (m *ProjectsPostRequestBody) GetName()(*string) { + return m.name +} +// Serialize serializes information the current object +func (m *ProjectsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("body", m.GetBody()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + 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 *ProjectsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBody sets the body property value. Body of the project +func (m *ProjectsPostRequestBody) SetBody(value *string)() { + m.body = value +} +// SetName sets the name property value. Name of the project +func (m *ProjectsPostRequestBody) SetName(value *string)() { + m.name = value +} +type ProjectsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBody()(*string) + GetName()(*string) + SetBody(value *string)() + SetName(value *string)() +} diff --git a/pkg/github/user/projects_request_builder.go b/pkg/github/user/projects_request_builder.go new file mode 100644 index 00000000..48a09ee4 --- /dev/null +++ b/pkg/github/user/projects_request_builder.go @@ -0,0 +1,69 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ProjectsRequestBuilder builds and executes requests for operations under \user\projects +type ProjectsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewProjectsRequestBuilderInternal instantiates a new ProjectsRequestBuilder and sets the default values. +func NewProjectsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ProjectsRequestBuilder) { + m := &ProjectsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/projects", pathParameters), + } + return m +} +// NewProjectsRequestBuilder instantiates a new ProjectsRequestBuilder and sets the default values. +func NewProjectsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ProjectsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewProjectsRequestBuilderInternal(urlParams, requestAdapter) +} +// Post creates a user project board. Returns a `410 Gone` status if the user does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a Projectable 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 ValidationErrorSimple error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/projects#create-a-user-project +func (m *ProjectsRequestBuilder) Post(ctx context.Context, body ProjectsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorSimpleFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable), nil +} +// ToPostRequestInformation creates a user project board. Returns a `410 Gone` status if the user does not have existing classic projects. If you do not have sufficient privileges to perform this action, a `401 Unauthorized` or `410 Gone` status is returned. +// returns a *RequestInformation when successful +func (m *ProjectsRequestBuilder) ToPostRequestInformation(ctx context.Context, body ProjectsPostRequestBodyable, 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 *ProjectsRequestBuilder when successful +func (m *ProjectsRequestBuilder) WithUrl(rawUrl string)(*ProjectsRequestBuilder) { + return NewProjectsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/public_escaped_emails_request_builder.go b/pkg/github/user/public_escaped_emails_request_builder.go new file mode 100644 index 00000000..a527875c --- /dev/null +++ b/pkg/github/user/public_escaped_emails_request_builder.go @@ -0,0 +1,75 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// Public_emailsRequestBuilder builds and executes requests for operations under \user\public_emails +type Public_emailsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Public_emailsRequestBuilderGetQueryParameters lists your publicly visible email address, which you can set with the[Set primary email visibility for the authenticated user](https://docs.github.com/enterprise-server@3.14/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user)endpoint.OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint. +type Public_emailsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewPublic_emailsRequestBuilderInternal instantiates a new Public_emailsRequestBuilder and sets the default values. +func NewPublic_emailsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Public_emailsRequestBuilder) { + m := &Public_emailsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/public_emails{?page*,per_page*}", pathParameters), + } + return m +} +// NewPublic_emailsRequestBuilder instantiates a new Public_emailsRequestBuilder and sets the default values. +func NewPublic_emailsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Public_emailsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewPublic_emailsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists your publicly visible email address, which you can set with the[Set primary email visibility for the authenticated user](https://docs.github.com/enterprise-server@3.14/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user)endpoint.OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint. +// returns a []Emailable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/emails#list-public-email-addresses-for-the-authenticated-user +func (m *Public_emailsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Public_emailsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Emailable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEmailFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Emailable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Emailable) + } + } + return val, nil +} +// ToGetRequestInformation lists your publicly visible email address, which you can set with the[Set primary email visibility for the authenticated user](https://docs.github.com/enterprise-server@3.14/rest/users/emails#set-primary-email-visibility-for-the-authenticated-user)endpoint.OAuth app tokens and personal access tokens (classic) need the `user:email` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Public_emailsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Public_emailsRequestBuilderGetQueryParameters])(*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 *Public_emailsRequestBuilder when successful +func (m *Public_emailsRequestBuilder) WithUrl(rawUrl string)(*Public_emailsRequestBuilder) { + return NewPublic_emailsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/repos/get_direction_query_parameter_type.go b/pkg/github/user/repos/get_direction_query_parameter_type.go new file mode 100644 index 00000000..03a299e2 --- /dev/null +++ b/pkg/github/user/repos/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package repos +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/repos/get_sort_query_parameter_type.go b/pkg/github/user/repos/get_sort_query_parameter_type.go new file mode 100644 index 00000000..58939d2b --- /dev/null +++ b/pkg/github/user/repos/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package repos +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + PUSHED_GETSORTQUERYPARAMETERTYPE + FULL_NAME_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "pushed", "full_name"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "pushed": + result = PUSHED_GETSORTQUERYPARAMETERTYPE + case "full_name": + result = FULL_NAME_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/repos/get_type_query_parameter_type.go b/pkg/github/user/repos/get_type_query_parameter_type.go new file mode 100644 index 00000000..8efe1374 --- /dev/null +++ b/pkg/github/user/repos/get_type_query_parameter_type.go @@ -0,0 +1,42 @@ +package repos +type GetTypeQueryParameterType int + +const ( + ALL_GETTYPEQUERYPARAMETERTYPE GetTypeQueryParameterType = iota + OWNER_GETTYPEQUERYPARAMETERTYPE + PUBLIC_GETTYPEQUERYPARAMETERTYPE + PRIVATE_GETTYPEQUERYPARAMETERTYPE + MEMBER_GETTYPEQUERYPARAMETERTYPE +) + +func (i GetTypeQueryParameterType) String() string { + return []string{"all", "owner", "public", "private", "member"}[i] +} +func ParseGetTypeQueryParameterType(v string) (any, error) { + result := ALL_GETTYPEQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETTYPEQUERYPARAMETERTYPE + case "owner": + result = OWNER_GETTYPEQUERYPARAMETERTYPE + case "public": + result = PUBLIC_GETTYPEQUERYPARAMETERTYPE + case "private": + result = PRIVATE_GETTYPEQUERYPARAMETERTYPE + case "member": + result = MEMBER_GETTYPEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetTypeQueryParameterType(values []GetTypeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTypeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/repos/get_visibility_query_parameter_type.go b/pkg/github/user/repos/get_visibility_query_parameter_type.go new file mode 100644 index 00000000..786b54e9 --- /dev/null +++ b/pkg/github/user/repos/get_visibility_query_parameter_type.go @@ -0,0 +1,36 @@ +package repos +type GetVisibilityQueryParameterType int + +const ( + ALL_GETVISIBILITYQUERYPARAMETERTYPE GetVisibilityQueryParameterType = iota + PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE +) + +func (i GetVisibilityQueryParameterType) String() string { + return []string{"all", "public", "private"}[i] +} +func ParseGetVisibilityQueryParameterType(v string) (any, error) { + result := ALL_GETVISIBILITYQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETVISIBILITYQUERYPARAMETERTYPE + case "public": + result = PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + case "private": + result = PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetVisibilityQueryParameterType(values []GetVisibilityQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetVisibilityQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_message.go b/pkg/github/user/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_message.go new file mode 100644 index 00000000..38d5b057 --- /dev/null +++ b/pkg/github/user/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_message.go @@ -0,0 +1,37 @@ +package repos +// The default value for a merge commit message.- `PR_TITLE` - default to the pull request's title.- `PR_BODY` - default to the pull request's body.- `BLANK` - default to a blank commit message. +type ReposPostRequestBody_merge_commit_message int + +const ( + PR_BODY_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE ReposPostRequestBody_merge_commit_message = iota + PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + BLANK_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE +) + +func (i ReposPostRequestBody_merge_commit_message) String() string { + return []string{"PR_BODY", "PR_TITLE", "BLANK"}[i] +} +func ParseReposPostRequestBody_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + case "PR_TITLE": + result = PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOSPOSTREQUESTBODY_MERGE_COMMIT_MESSAGE + default: + return nil, nil + } + return &result, nil +} +func SerializeReposPostRequestBody_merge_commit_message(values []ReposPostRequestBody_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_title.go b/pkg/github/user/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_title.go new file mode 100644 index 00000000..e110ce99 --- /dev/null +++ b/pkg/github/user/repos/repos_post_request_body_escaped_merge_escaped_commit_escaped_title.go @@ -0,0 +1,34 @@ +package repos +// Required when using `merge_commit_message`.The default value for a merge commit title.- `PR_TITLE` - default to the pull request's title.- `MERGE_MESSAGE` - default to the classic title for a merge message (e.g., Merge pull request #123 from branch-name). +type ReposPostRequestBody_merge_commit_title int + +const ( + PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE ReposPostRequestBody_merge_commit_title = iota + MERGE_MESSAGE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE +) + +func (i ReposPostRequestBody_merge_commit_title) String() string { + return []string{"PR_TITLE", "MERGE_MESSAGE"}[i] +} +func ParseReposPostRequestBody_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE + case "MERGE_MESSAGE": + result = MERGE_MESSAGE_REPOSPOSTREQUESTBODY_MERGE_COMMIT_TITLE + default: + return nil, nil + } + return &result, nil +} +func SerializeReposPostRequestBody_merge_commit_title(values []ReposPostRequestBody_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_message.go b/pkg/github/user/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_message.go new file mode 100644 index 00000000..1e336e72 --- /dev/null +++ b/pkg/github/user/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_message.go @@ -0,0 +1,37 @@ +package repos +// The default value for a squash merge commit message:- `PR_BODY` - default to the pull request's body.- `COMMIT_MESSAGES` - default to the branch's commit messages.- `BLANK` - default to a blank commit message. +type ReposPostRequestBody_squash_merge_commit_message int + +const ( + PR_BODY_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE ReposPostRequestBody_squash_merge_commit_message = iota + COMMIT_MESSAGES_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + BLANK_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE +) + +func (i ReposPostRequestBody_squash_merge_commit_message) String() string { + return []string{"PR_BODY", "COMMIT_MESSAGES", "BLANK"}[i] +} +func ParseReposPostRequestBody_squash_merge_commit_message(v string) (any, error) { + result := PR_BODY_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + switch v { + case "PR_BODY": + result = PR_BODY_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + case "COMMIT_MESSAGES": + result = COMMIT_MESSAGES_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + case "BLANK": + result = BLANK_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_MESSAGE + default: + return nil, nil + } + return &result, nil +} +func SerializeReposPostRequestBody_squash_merge_commit_message(values []ReposPostRequestBody_squash_merge_commit_message) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_squash_merge_commit_message) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_title.go b/pkg/github/user/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_title.go new file mode 100644 index 00000000..fc909b0b --- /dev/null +++ b/pkg/github/user/repos/repos_post_request_body_escaped_squash_escaped_merge_escaped_commit_escaped_title.go @@ -0,0 +1,34 @@ +package repos +// Required when using `squash_merge_commit_message`.The default value for a squash merge commit title:- `PR_TITLE` - default to the pull request's title.- `COMMIT_OR_PR_TITLE` - default to the commit's title (if only one commit) or the pull request's title (when more than one commit). +type ReposPostRequestBody_squash_merge_commit_title int + +const ( + PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE ReposPostRequestBody_squash_merge_commit_title = iota + COMMIT_OR_PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE +) + +func (i ReposPostRequestBody_squash_merge_commit_title) String() string { + return []string{"PR_TITLE", "COMMIT_OR_PR_TITLE"}[i] +} +func ParseReposPostRequestBody_squash_merge_commit_title(v string) (any, error) { + result := PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + switch v { + case "PR_TITLE": + result = PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + case "COMMIT_OR_PR_TITLE": + result = COMMIT_OR_PR_TITLE_REPOSPOSTREQUESTBODY_SQUASH_MERGE_COMMIT_TITLE + default: + return nil, nil + } + return &result, nil +} +func SerializeReposPostRequestBody_squash_merge_commit_title(values []ReposPostRequestBody_squash_merge_commit_title) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i ReposPostRequestBody_squash_merge_commit_title) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/repos_post_request_body.go b/pkg/github/user/repos_post_request_body.go new file mode 100644 index 00000000..eddc2cf2 --- /dev/null +++ b/pkg/github/user/repos_post_request_body.go @@ -0,0 +1,602 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ReposPostRequestBody 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 allow Auto-merge to be used on pull requests. + allow_auto_merge *bool + // Whether to allow merge commits for pull requests. + allow_merge_commit *bool + // Whether to allow rebase merges for pull requests. + allow_rebase_merge *bool + // Whether to allow squash merges for pull requests. + allow_squash_merge *bool + // Whether the repository is initialized with a minimal README. + auto_init *bool + // Whether to delete head branches when pull requests are merged + delete_branch_on_merge *bool + // A short description of the repository. + description *string + // The desired language or platform to apply to the .gitignore. + gitignore_template *string + // Whether discussions are enabled. + has_discussions *bool + // Whether downloads are enabled. + has_downloads *bool + // Whether issues are enabled. + has_issues *bool + // Whether projects are enabled. + has_projects *bool + // Whether the wiki is enabled. + has_wiki *bool + // A URL with more information about the repository. + homepage *string + // Whether this repository acts as a template that can be used to generate new repositories. + is_template *bool + // The license keyword of the open source license for this repository. + license_template *string + // The name of the repository. + name *string + // Whether the repository is private. + private *bool + // The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. + team_id *int32 +} +// NewReposPostRequestBody instantiates a new ReposPostRequestBody and sets the default values. +func NewReposPostRequestBody()(*ReposPostRequestBody) { + m := &ReposPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateReposPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateReposPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewReposPostRequestBody(), 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 *ReposPostRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetAllowAutoMerge gets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetAllowAutoMerge()(*bool) { + return m.allow_auto_merge +} +// GetAllowMergeCommit gets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetAllowMergeCommit()(*bool) { + return m.allow_merge_commit +} +// GetAllowRebaseMerge gets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetAllowRebaseMerge()(*bool) { + return m.allow_rebase_merge +} +// GetAllowSquashMerge gets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetAllowSquashMerge()(*bool) { + return m.allow_squash_merge +} +// GetAutoInit gets the auto_init property value. Whether the repository is initialized with a minimal README. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetAutoInit()(*bool) { + return m.auto_init +} +// GetDeleteBranchOnMerge gets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +// returns a *bool when successful +func (m *ReposPostRequestBody) GetDeleteBranchOnMerge()(*bool) { + return m.delete_branch_on_merge +} +// GetDescription gets the description property value. A short description of the repository. +// returns a *string when successful +func (m *ReposPostRequestBody) 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 *ReposPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["allow_auto_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowAutoMerge(val) + } + return nil + } + res["allow_merge_commit"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowMergeCommit(val) + } + return nil + } + res["allow_rebase_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowRebaseMerge(val) + } + return nil + } + res["allow_squash_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAllowSquashMerge(val) + } + return nil + } + res["auto_init"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetAutoInit(val) + } + return nil + } + res["delete_branch_on_merge"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetDeleteBranchOnMerge(val) + } + 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["gitignore_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetGitignoreTemplate(val) + } + return nil + } + res["has_discussions"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDiscussions(val) + } + return nil + } + res["has_downloads"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasDownloads(val) + } + return nil + } + res["has_issues"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasIssues(val) + } + return nil + } + res["has_projects"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasProjects(val) + } + return nil + } + res["has_wiki"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHasWiki(val) + } + return nil + } + res["homepage"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetHomepage(val) + } + return nil + } + res["is_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetIsTemplate(val) + } + return nil + } + res["license_template"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLicenseTemplate(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["private"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetPrivate(val) + } + return nil + } + res["team_id"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetInt32Value() + if err != nil { + return err + } + if val != nil { + m.SetTeamId(val) + } + return nil + } + return res +} +// GetGitignoreTemplate gets the gitignore_template property value. The desired language or platform to apply to the .gitignore. +// returns a *string when successful +func (m *ReposPostRequestBody) GetGitignoreTemplate()(*string) { + return m.gitignore_template +} +// GetHasDiscussions gets the has_discussions property value. Whether discussions are enabled. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetHasDiscussions()(*bool) { + return m.has_discussions +} +// GetHasDownloads gets the has_downloads property value. Whether downloads are enabled. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetHasDownloads()(*bool) { + return m.has_downloads +} +// GetHasIssues gets the has_issues property value. Whether issues are enabled. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetHasIssues()(*bool) { + return m.has_issues +} +// GetHasProjects gets the has_projects property value. Whether projects are enabled. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetHasProjects()(*bool) { + return m.has_projects +} +// GetHasWiki gets the has_wiki property value. Whether the wiki is enabled. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetHasWiki()(*bool) { + return m.has_wiki +} +// GetHomepage gets the homepage property value. A URL with more information about the repository. +// returns a *string when successful +func (m *ReposPostRequestBody) GetHomepage()(*string) { + return m.homepage +} +// GetIsTemplate gets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetIsTemplate()(*bool) { + return m.is_template +} +// GetLicenseTemplate gets the license_template property value. The license keyword of the open source license for this repository. +// returns a *string when successful +func (m *ReposPostRequestBody) GetLicenseTemplate()(*string) { + return m.license_template +} +// GetName gets the name property value. The name of the repository. +// returns a *string when successful +func (m *ReposPostRequestBody) GetName()(*string) { + return m.name +} +// GetPrivate gets the private property value. Whether the repository is private. +// returns a *bool when successful +func (m *ReposPostRequestBody) GetPrivate()(*bool) { + return m.private +} +// GetTeamId gets the team_id property value. The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. +// returns a *int32 when successful +func (m *ReposPostRequestBody) GetTeamId()(*int32) { + return m.team_id +} +// Serialize serializes information the current object +func (m *ReposPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteBoolValue("allow_auto_merge", m.GetAllowAutoMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_merge_commit", m.GetAllowMergeCommit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_rebase_merge", m.GetAllowRebaseMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("allow_squash_merge", m.GetAllowSquashMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("auto_init", m.GetAutoInit()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("delete_branch_on_merge", m.GetDeleteBranchOnMerge()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("description", m.GetDescription()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("gitignore_template", m.GetGitignoreTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_discussions", m.GetHasDiscussions()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_downloads", m.GetHasDownloads()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_issues", m.GetHasIssues()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_projects", m.GetHasProjects()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("has_wiki", m.GetHasWiki()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("homepage", m.GetHomepage()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("is_template", m.GetIsTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("license_template", m.GetLicenseTemplate()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("private", m.GetPrivate()) + if err != nil { + return err + } + } + { + err := writer.WriteInt32Value("team_id", m.GetTeamId()) + 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 *ReposPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetAllowAutoMerge sets the allow_auto_merge property value. Whether to allow Auto-merge to be used on pull requests. +func (m *ReposPostRequestBody) SetAllowAutoMerge(value *bool)() { + m.allow_auto_merge = value +} +// SetAllowMergeCommit sets the allow_merge_commit property value. Whether to allow merge commits for pull requests. +func (m *ReposPostRequestBody) SetAllowMergeCommit(value *bool)() { + m.allow_merge_commit = value +} +// SetAllowRebaseMerge sets the allow_rebase_merge property value. Whether to allow rebase merges for pull requests. +func (m *ReposPostRequestBody) SetAllowRebaseMerge(value *bool)() { + m.allow_rebase_merge = value +} +// SetAllowSquashMerge sets the allow_squash_merge property value. Whether to allow squash merges for pull requests. +func (m *ReposPostRequestBody) SetAllowSquashMerge(value *bool)() { + m.allow_squash_merge = value +} +// SetAutoInit sets the auto_init property value. Whether the repository is initialized with a minimal README. +func (m *ReposPostRequestBody) SetAutoInit(value *bool)() { + m.auto_init = value +} +// SetDeleteBranchOnMerge sets the delete_branch_on_merge property value. Whether to delete head branches when pull requests are merged +func (m *ReposPostRequestBody) SetDeleteBranchOnMerge(value *bool)() { + m.delete_branch_on_merge = value +} +// SetDescription sets the description property value. A short description of the repository. +func (m *ReposPostRequestBody) SetDescription(value *string)() { + m.description = value +} +// SetGitignoreTemplate sets the gitignore_template property value. The desired language or platform to apply to the .gitignore. +func (m *ReposPostRequestBody) SetGitignoreTemplate(value *string)() { + m.gitignore_template = value +} +// SetHasDiscussions sets the has_discussions property value. Whether discussions are enabled. +func (m *ReposPostRequestBody) SetHasDiscussions(value *bool)() { + m.has_discussions = value +} +// SetHasDownloads sets the has_downloads property value. Whether downloads are enabled. +func (m *ReposPostRequestBody) SetHasDownloads(value *bool)() { + m.has_downloads = value +} +// SetHasIssues sets the has_issues property value. Whether issues are enabled. +func (m *ReposPostRequestBody) SetHasIssues(value *bool)() { + m.has_issues = value +} +// SetHasProjects sets the has_projects property value. Whether projects are enabled. +func (m *ReposPostRequestBody) SetHasProjects(value *bool)() { + m.has_projects = value +} +// SetHasWiki sets the has_wiki property value. Whether the wiki is enabled. +func (m *ReposPostRequestBody) SetHasWiki(value *bool)() { + m.has_wiki = value +} +// SetHomepage sets the homepage property value. A URL with more information about the repository. +func (m *ReposPostRequestBody) SetHomepage(value *string)() { + m.homepage = value +} +// SetIsTemplate sets the is_template property value. Whether this repository acts as a template that can be used to generate new repositories. +func (m *ReposPostRequestBody) SetIsTemplate(value *bool)() { + m.is_template = value +} +// SetLicenseTemplate sets the license_template property value. The license keyword of the open source license for this repository. +func (m *ReposPostRequestBody) SetLicenseTemplate(value *string)() { + m.license_template = value +} +// SetName sets the name property value. The name of the repository. +func (m *ReposPostRequestBody) SetName(value *string)() { + m.name = value +} +// SetPrivate sets the private property value. Whether the repository is private. +func (m *ReposPostRequestBody) SetPrivate(value *bool)() { + m.private = value +} +// SetTeamId sets the team_id property value. The id of the team that will be granted access to this repository. This is only valid when creating a repository in an organization. +func (m *ReposPostRequestBody) SetTeamId(value *int32)() { + m.team_id = value +} +type ReposPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAllowAutoMerge()(*bool) + GetAllowMergeCommit()(*bool) + GetAllowRebaseMerge()(*bool) + GetAllowSquashMerge()(*bool) + GetAutoInit()(*bool) + GetDeleteBranchOnMerge()(*bool) + GetDescription()(*string) + GetGitignoreTemplate()(*string) + GetHasDiscussions()(*bool) + GetHasDownloads()(*bool) + GetHasIssues()(*bool) + GetHasProjects()(*bool) + GetHasWiki()(*bool) + GetHomepage()(*string) + GetIsTemplate()(*bool) + GetLicenseTemplate()(*string) + GetName()(*string) + GetPrivate()(*bool) + GetTeamId()(*int32) + SetAllowAutoMerge(value *bool)() + SetAllowMergeCommit(value *bool)() + SetAllowRebaseMerge(value *bool)() + SetAllowSquashMerge(value *bool)() + SetAutoInit(value *bool)() + SetDeleteBranchOnMerge(value *bool)() + SetDescription(value *string)() + SetGitignoreTemplate(value *string)() + SetHasDiscussions(value *bool)() + SetHasDownloads(value *bool)() + SetHasIssues(value *bool)() + SetHasProjects(value *bool)() + SetHasWiki(value *bool)() + SetHomepage(value *string)() + SetIsTemplate(value *bool)() + SetLicenseTemplate(value *string)() + SetName(value *string)() + SetPrivate(value *bool)() + SetTeamId(value *int32)() +} diff --git a/pkg/github/user/repos_request_builder.go b/pkg/github/user/repos_request_builder.go new file mode 100644 index 00000000..26311f64 --- /dev/null +++ b/pkg/github/user/repos_request_builder.go @@ -0,0 +1,134 @@ +package user + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i8f8c4ae879d3b2cece00b776182b259c82b1f089c9c6960a8d7f1a7a4f77c524 "github.com/octokit/go-sdk-enterprise-server/pkg/github/user/repos" +) + +// ReposRequestBuilder builds and executes requests for operations under \user\repos +type ReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ReposRequestBuilderGetQueryParameters lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. +type ReposRequestBuilderGetQueryParameters struct { + // Comma-separated list of values. Can include: * `owner`: Repositories that are owned by the authenticated user. * `collaborator`: Repositories that the user has been added to as a collaborator. * `organization_member`: Repositories that the user has access to through being a member of an organization. This includes every repository on every team that the user is on. + Affiliation *string `uriparametername:"affiliation"` + // Only show repositories updated before the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Before *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"before"` + // The order to sort by. Default: `asc` when using `full_name`, otherwise `desc`. + Direction *i8f8c4ae879d3b2cece00b776182b259c82b1f089c9c6960a8d7f1a7a4f77c524.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show repositories updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` + // The property to sort the results by. + Sort *i8f8c4ae879d3b2cece00b776182b259c82b1f089c9c6960a8d7f1a7a4f77c524.GetSortQueryParameterType `uriparametername:"sort"` + // Limit results to repositories of the specified type. Will cause a `422` error if used in the same request as **visibility** or **affiliation**. + Type *i8f8c4ae879d3b2cece00b776182b259c82b1f089c9c6960a8d7f1a7a4f77c524.GetTypeQueryParameterType `uriparametername:"type"` + // Limit results to repositories with the specified visibility. + Visibility *i8f8c4ae879d3b2cece00b776182b259c82b1f089c9c6960a8d7f1a7a4f77c524.GetVisibilityQueryParameterType `uriparametername:"visibility"` +} +// NewReposRequestBuilderInternal instantiates a new ReposRequestBuilder and sets the default values. +func NewReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ReposRequestBuilder) { + m := &ReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/repos{?affiliation*,before*,direction*,page*,per_page*,since*,sort*,type*,visibility*}", pathParameters), + } + return m +} +// NewReposRequestBuilder instantiates a new ReposRequestBuilder and sets the default values. +func NewReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewReposRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. +// returns a []Repositoryable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#list-repositories-for-the-authenticated-user +func (m *ReposRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ReposRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable) + } + } + return val, nil +} +// Post creates a new repository for the authenticated user.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository. +// returns a FullRepositoryable when successful +// returns a BasicError error when the service returns a 400 status code +// 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#create-a-repository-for-the-authenticated-user +func (m *ReposRequestBuilder) Post(ctx context.Context, body ReposPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FullRepositoryable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "400": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateFullRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.FullRepositoryable), nil +} +// ToGetRequestInformation lists repositories that the authenticated user has explicit permission (`:read`, `:write`, or `:admin`) to access.The authenticated user has explicit permission to access repositories they own, repositories where they are a collaborator, and repositories that they can access through an organization membership. +// returns a *RequestInformation when successful +func (m *ReposRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ReposRequestBuilderGetQueryParameters])(*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 new repository for the authenticated user.OAuth app tokens and personal access tokens (classic) need the `public_repo` or `repo` scope to create a public repository, and `repo` scope to create a private repository. +// returns a *RequestInformation when successful +func (m *ReposRequestBuilder) ToPostRequestInformation(ctx context.Context, body ReposPostRequestBodyable, 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 *ReposRequestBuilder when successful +func (m *ReposRequestBuilder) WithUrl(rawUrl string)(*ReposRequestBuilder) { + return NewReposRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/repository_escaped_invitations_request_builder.go b/pkg/github/user/repository_escaped_invitations_request_builder.go new file mode 100644 index 00000000..f4cae59c --- /dev/null +++ b/pkg/github/user/repository_escaped_invitations_request_builder.go @@ -0,0 +1,86 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// Repository_invitationsRequestBuilder builds and executes requests for operations under \user\repository_invitations +type Repository_invitationsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Repository_invitationsRequestBuilderGetQueryParameters when authenticating as a user, this endpoint will list all currently open repository invitations for that user. +type Repository_invitationsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByInvitation_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.repository_invitations.item collection +// returns a *Repository_invitationsWithInvitation_ItemRequestBuilder when successful +func (m *Repository_invitationsRequestBuilder) ByInvitation_id(invitation_id int32)(*Repository_invitationsWithInvitation_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["invitation_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(invitation_id), 10) + return NewRepository_invitationsWithInvitation_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewRepository_invitationsRequestBuilderInternal instantiates a new Repository_invitationsRequestBuilder and sets the default values. +func NewRepository_invitationsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Repository_invitationsRequestBuilder) { + m := &Repository_invitationsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/repository_invitations{?page*,per_page*}", pathParameters), + } + return m +} +// NewRepository_invitationsRequestBuilder instantiates a new Repository_invitationsRequestBuilder and sets the default values. +func NewRepository_invitationsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Repository_invitationsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewRepository_invitationsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get when authenticating as a user, this endpoint will list all currently open repository invitations for that user. +// returns a []RepositoryInvitationable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/collaborators/invitations#list-repository-invitations-for-the-authenticated-user +func (m *Repository_invitationsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Repository_invitationsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryInvitationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryInvitationFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryInvitationable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.RepositoryInvitationable) + } + } + return val, nil +} +// ToGetRequestInformation when authenticating as a user, this endpoint will list all currently open repository invitations for that user. +// returns a *RequestInformation when successful +func (m *Repository_invitationsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Repository_invitationsRequestBuilderGetQueryParameters])(*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 *Repository_invitationsRequestBuilder when successful +func (m *Repository_invitationsRequestBuilder) WithUrl(rawUrl string)(*Repository_invitationsRequestBuilder) { + return NewRepository_invitationsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/repository_escaped_invitations_with_invitation_escaped_item_request_builder.go b/pkg/github/user/repository_escaped_invitations_with_invitation_escaped_item_request_builder.go new file mode 100644 index 00000000..35b0ad4e --- /dev/null +++ b/pkg/github/user/repository_escaped_invitations_with_invitation_escaped_item_request_builder.go @@ -0,0 +1,90 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// Repository_invitationsWithInvitation_ItemRequestBuilder builds and executes requests for operations under \user\repository_invitations\{invitation_id} +type Repository_invitationsWithInvitation_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewRepository_invitationsWithInvitation_ItemRequestBuilderInternal instantiates a new Repository_invitationsWithInvitation_ItemRequestBuilder and sets the default values. +func NewRepository_invitationsWithInvitation_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Repository_invitationsWithInvitation_ItemRequestBuilder) { + m := &Repository_invitationsWithInvitation_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/repository_invitations/{invitation_id}", pathParameters), + } + return m +} +// NewRepository_invitationsWithInvitation_ItemRequestBuilder instantiates a new Repository_invitationsWithInvitation_ItemRequestBuilder and sets the default values. +func NewRepository_invitationsWithInvitation_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Repository_invitationsWithInvitation_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewRepository_invitationsWithInvitation_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete decline a repository invitation +// 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/enterprise-server@3.14/rest/collaborators/invitations#decline-a-repository-invitation +func (m *Repository_invitationsWithInvitation_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 { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Patch accept a repository invitation +// 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/enterprise-server@3.14/rest/collaborators/invitations#accept-a-repository-invitation +func (m *Repository_invitationsWithInvitation_ItemRequestBuilder) Patch(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "409": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// returns a *RequestInformation when successful +func (m *Repository_invitationsWithInvitation_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") + return requestInfo, nil +} +// returns a *RequestInformation when successful +func (m *Repository_invitationsWithInvitation_ItemRequestBuilder) ToPatchRequestInformation(ctx context.Context, 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") + 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 *Repository_invitationsWithInvitation_ItemRequestBuilder when successful +func (m *Repository_invitationsWithInvitation_ItemRequestBuilder) WithUrl(rawUrl string)(*Repository_invitationsWithInvitation_ItemRequestBuilder) { + return NewRepository_invitationsWithInvitation_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/social_escaped_accounts_delete_request_body.go b/pkg/github/user/social_escaped_accounts_delete_request_body.go new file mode 100644 index 00000000..90237df8 --- /dev/null +++ b/pkg/github/user/social_escaped_accounts_delete_request_body.go @@ -0,0 +1,86 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Social_accountsDeleteRequestBody struct { + // Full URLs for the social media profiles to delete. + account_urls []string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewSocial_accountsDeleteRequestBody instantiates a new Social_accountsDeleteRequestBody and sets the default values. +func NewSocial_accountsDeleteRequestBody()(*Social_accountsDeleteRequestBody) { + m := &Social_accountsDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSocial_accountsDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSocial_accountsDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSocial_accountsDeleteRequestBody(), nil +} +// GetAccountUrls gets the account_urls property value. Full URLs for the social media profiles to delete. +// returns a []string when successful +func (m *Social_accountsDeleteRequestBody) GetAccountUrls()([]string) { + return m.account_urls +} +// 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 *Social_accountsDeleteRequestBody) 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 *Social_accountsDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["account_urls"] = 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.SetAccountUrls(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *Social_accountsDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAccountUrls() != nil { + err := writer.WriteCollectionOfStringValues("account_urls", m.GetAccountUrls()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccountUrls sets the account_urls property value. Full URLs for the social media profiles to delete. +func (m *Social_accountsDeleteRequestBody) SetAccountUrls(value []string)() { + m.account_urls = 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 *Social_accountsDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type Social_accountsDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccountUrls()([]string) + SetAccountUrls(value []string)() +} diff --git a/pkg/github/user/social_escaped_accounts_post_request_body.go b/pkg/github/user/social_escaped_accounts_post_request_body.go new file mode 100644 index 00000000..37aeb9d6 --- /dev/null +++ b/pkg/github/user/social_escaped_accounts_post_request_body.go @@ -0,0 +1,86 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Social_accountsPostRequestBody struct { + // Full URLs for the social media profiles to add. + account_urls []string + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewSocial_accountsPostRequestBody instantiates a new Social_accountsPostRequestBody and sets the default values. +func NewSocial_accountsPostRequestBody()(*Social_accountsPostRequestBody) { + m := &Social_accountsPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSocial_accountsPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSocial_accountsPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSocial_accountsPostRequestBody(), nil +} +// GetAccountUrls gets the account_urls property value. Full URLs for the social media profiles to add. +// returns a []string when successful +func (m *Social_accountsPostRequestBody) GetAccountUrls()([]string) { + return m.account_urls +} +// 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 *Social_accountsPostRequestBody) 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 *Social_accountsPostRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["account_urls"] = 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.SetAccountUrls(res) + } + return nil + } + return res +} +// Serialize serializes information the current object +func (m *Social_accountsPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetAccountUrls() != nil { + err := writer.WriteCollectionOfStringValues("account_urls", m.GetAccountUrls()) + if err != nil { + return err + } + } + { + err := writer.WriteAdditionalData(m.GetAdditionalData()) + if err != nil { + return err + } + } + return nil +} +// SetAccountUrls sets the account_urls property value. Full URLs for the social media profiles to add. +func (m *Social_accountsPostRequestBody) SetAccountUrls(value []string)() { + m.account_urls = 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 *Social_accountsPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type Social_accountsPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetAccountUrls()([]string) + SetAccountUrls(value []string)() +} diff --git a/pkg/github/user/social_escaped_accounts_request_builder.go b/pkg/github/user/social_escaped_accounts_request_builder.go new file mode 100644 index 00000000..1edb14fe --- /dev/null +++ b/pkg/github/user/social_escaped_accounts_request_builder.go @@ -0,0 +1,156 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// Social_accountsRequestBuilder builds and executes requests for operations under \user\social_accounts +type Social_accountsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Social_accountsRequestBuilderGetQueryParameters lists all of your social accounts. +type Social_accountsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewSocial_accountsRequestBuilderInternal instantiates a new Social_accountsRequestBuilder and sets the default values. +func NewSocial_accountsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Social_accountsRequestBuilder) { + m := &Social_accountsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/social_accounts{?page*,per_page*}", pathParameters), + } + return m +} +// NewSocial_accountsRequestBuilder instantiates a new Social_accountsRequestBuilder and sets the default values. +func NewSocial_accountsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Social_accountsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewSocial_accountsRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes one or more social accounts from the authenticated user's profile.OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/social-accounts#delete-social-accounts-for-the-authenticated-user +func (m *Social_accountsRequestBuilder) Delete(ctx context.Context, body Social_accountsDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get lists all of your social accounts. +// returns a []SocialAccountable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/social-accounts#list-social-accounts-for-the-authenticated-user +func (m *Social_accountsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Social_accountsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SocialAccountable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSocialAccountFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SocialAccountable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SocialAccountable) + } + } + return val, nil +} +// Post add one or more social accounts to the authenticated user's profile.OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a []SocialAccountable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/social-accounts#add-social-accounts-for-the-authenticated-user +func (m *Social_accountsRequestBuilder) Post(ctx context.Context, body Social_accountsPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SocialAccountable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSocialAccountFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SocialAccountable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SocialAccountable) + } + } + return val, nil +} +// ToDeleteRequestInformation deletes one or more social accounts from the authenticated user's profile.OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Social_accountsRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body Social_accountsDeleteRequestBodyable, 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") + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToGetRequestInformation lists all of your social accounts. +// returns a *RequestInformation when successful +func (m *Social_accountsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Social_accountsRequestBuilderGetQueryParameters])(*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 add one or more social accounts to the authenticated user's profile.OAuth app tokens and personal access tokens (classic) need the `user` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Social_accountsRequestBuilder) ToPostRequestInformation(ctx context.Context, body Social_accountsPostRequestBodyable, 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 *Social_accountsRequestBuilder when successful +func (m *Social_accountsRequestBuilder) WithUrl(rawUrl string)(*Social_accountsRequestBuilder) { + return NewSocial_accountsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/ssh_escaped_signing_escaped_keys_post_request_body.go b/pkg/github/user/ssh_escaped_signing_escaped_keys_post_request_body.go new file mode 100644 index 00000000..83532af6 --- /dev/null +++ b/pkg/github/user/ssh_escaped_signing_escaped_keys_post_request_body.go @@ -0,0 +1,109 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type Ssh_signing_keysPostRequestBody 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 public SSH key to add to your GitHub account. For more information, see "[Checking for existing SSH keys](https://docs.github.com/enterprise-server@3.14/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys)." + key *string + // A descriptive name for the new key. + title *string +} +// NewSsh_signing_keysPostRequestBody instantiates a new Ssh_signing_keysPostRequestBody and sets the default values. +func NewSsh_signing_keysPostRequestBody()(*Ssh_signing_keysPostRequestBody) { + m := &Ssh_signing_keysPostRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateSsh_signing_keysPostRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateSsh_signing_keysPostRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewSsh_signing_keysPostRequestBody(), 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 *Ssh_signing_keysPostRequestBody) 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 *Ssh_signing_keysPostRequestBody) 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["title"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTitle(val) + } + return nil + } + return res +} +// GetKey gets the key property value. The public SSH key to add to your GitHub account. For more information, see "[Checking for existing SSH keys](https://docs.github.com/enterprise-server@3.14/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys)." +// returns a *string when successful +func (m *Ssh_signing_keysPostRequestBody) GetKey()(*string) { + return m.key +} +// GetTitle gets the title property value. A descriptive name for the new key. +// returns a *string when successful +func (m *Ssh_signing_keysPostRequestBody) GetTitle()(*string) { + return m.title +} +// Serialize serializes information the current object +func (m *Ssh_signing_keysPostRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("key", m.GetKey()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("title", m.GetTitle()) + 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 *Ssh_signing_keysPostRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetKey sets the key property value. The public SSH key to add to your GitHub account. For more information, see "[Checking for existing SSH keys](https://docs.github.com/enterprise-server@3.14/authentication/connecting-to-github-with-ssh/checking-for-existing-ssh-keys)." +func (m *Ssh_signing_keysPostRequestBody) SetKey(value *string)() { + m.key = value +} +// SetTitle sets the title property value. A descriptive name for the new key. +func (m *Ssh_signing_keysPostRequestBody) SetTitle(value *string)() { + m.title = value +} +type Ssh_signing_keysPostRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetKey()(*string) + GetTitle()(*string) + SetKey(value *string)() + SetTitle(value *string)() +} diff --git a/pkg/github/user/ssh_escaped_signing_escaped_keys_request_builder.go b/pkg/github/user/ssh_escaped_signing_escaped_keys_request_builder.go new file mode 100644 index 00000000..57e611c9 --- /dev/null +++ b/pkg/github/user/ssh_escaped_signing_escaped_keys_request_builder.go @@ -0,0 +1,127 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// Ssh_signing_keysRequestBuilder builds and executes requests for operations under \user\ssh_signing_keys +type Ssh_signing_keysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Ssh_signing_keysRequestBuilderGetQueryParameters lists the SSH signing keys for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `read:ssh_signing_key` scope to use this endpoint. +type Ssh_signing_keysRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// BySsh_signing_key_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.ssh_signing_keys.item collection +// returns a *Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder when successful +func (m *Ssh_signing_keysRequestBuilder) BySsh_signing_key_id(ssh_signing_key_id int32)(*Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["ssh_signing_key_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(ssh_signing_key_id), 10) + return NewSsh_signing_keysWithSsh_signing_key_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewSsh_signing_keysRequestBuilderInternal instantiates a new Ssh_signing_keysRequestBuilder and sets the default values. +func NewSsh_signing_keysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Ssh_signing_keysRequestBuilder) { + m := &Ssh_signing_keysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/ssh_signing_keys{?page*,per_page*}", pathParameters), + } + return m +} +// NewSsh_signing_keysRequestBuilder instantiates a new Ssh_signing_keysRequestBuilder and sets the default values. +func NewSsh_signing_keysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Ssh_signing_keysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewSsh_signing_keysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the SSH signing keys for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `read:ssh_signing_key` scope to use this endpoint. +// returns a []SshSigningKeyable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-the-authenticated-user +func (m *Ssh_signing_keysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Ssh_signing_keysRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshSigningKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSshSigningKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshSigningKeyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshSigningKeyable) + } + } + return val, nil +} +// Post creates an SSH signing key for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `write:ssh_signing_key` scope to use this endpoint. +// returns a SshSigningKeyable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/ssh-signing-keys#create-a-ssh-signing-key-for-the-authenticated-user +func (m *Ssh_signing_keysRequestBuilder) Post(ctx context.Context, body Ssh_signing_keysPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshSigningKeyable, error) { + requestInfo, err := m.ToPostRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSshSigningKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshSigningKeyable), nil +} +// ToGetRequestInformation lists the SSH signing keys for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `read:ssh_signing_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Ssh_signing_keysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[Ssh_signing_keysRequestBuilderGetQueryParameters])(*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 SSH signing key for the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `write:ssh_signing_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Ssh_signing_keysRequestBuilder) ToPostRequestInformation(ctx context.Context, body Ssh_signing_keysPostRequestBodyable, 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 *Ssh_signing_keysRequestBuilder when successful +func (m *Ssh_signing_keysRequestBuilder) WithUrl(rawUrl string)(*Ssh_signing_keysRequestBuilder) { + return NewSsh_signing_keysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/ssh_escaped_signing_escaped_keys_with_ssh_escaped_signing_escaped_key_escaped_item_request_builder.go b/pkg/github/user/ssh_escaped_signing_escaped_keys_with_ssh_escaped_signing_escaped_key_escaped_item_request_builder.go new file mode 100644 index 00000000..722cfa4e --- /dev/null +++ b/pkg/github/user/ssh_escaped_signing_escaped_keys_with_ssh_escaped_signing_escaped_key_escaped_item_request_builder.go @@ -0,0 +1,96 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder builds and executes requests for operations under \user\ssh_signing_keys\{ssh_signing_key_id} +type Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewSsh_signing_keysWithSsh_signing_key_ItemRequestBuilderInternal instantiates a new Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder and sets the default values. +func NewSsh_signing_keysWithSsh_signing_key_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) { + m := &Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/ssh_signing_keys/{ssh_signing_key_id}", pathParameters), + } + return m +} +// NewSsh_signing_keysWithSsh_signing_key_ItemRequestBuilder instantiates a new Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder and sets the default values. +func NewSsh_signing_keysWithSsh_signing_key_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewSsh_signing_keysWithSsh_signing_key_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an SSH signing key from the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `admin:ssh_signing_key` scope to use this endpoint. +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/ssh-signing-keys#delete-an-ssh-signing-key-for-the-authenticated-user +func (m *Ssh_signing_keysWithSsh_signing_key_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 { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets extended details for an SSH signing key.OAuth app tokens and personal access tokens (classic) need the `read:ssh_signing_key` scope to use this endpoint. +// returns a SshSigningKeyable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/ssh-signing-keys#get-an-ssh-signing-key-for-the-authenticated-user +func (m *Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshSigningKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSshSigningKeyFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshSigningKeyable), nil +} +// ToDeleteRequestInformation deletes an SSH signing key from the authenticated user's GitHub account.OAuth app tokens and personal access tokens (classic) need the `admin:ssh_signing_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Ssh_signing_keysWithSsh_signing_key_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") + return requestInfo, nil +} +// ToGetRequestInformation gets extended details for an SSH signing key.OAuth app tokens and personal access tokens (classic) need the `read:ssh_signing_key` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *Ssh_signing_keysWithSsh_signing_key_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder when successful +func (m *Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) WithUrl(rawUrl string)(*Ssh_signing_keysWithSsh_signing_key_ItemRequestBuilder) { + return NewSsh_signing_keysWithSsh_signing_key_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/starred/get_direction_query_parameter_type.go b/pkg/github/user/starred/get_direction_query_parameter_type.go new file mode 100644 index 00000000..c2f626bb --- /dev/null +++ b/pkg/github/user/starred/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package starred +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/starred/get_sort_query_parameter_type.go b/pkg/github/user/starred/get_sort_query_parameter_type.go new file mode 100644 index 00000000..a7875d45 --- /dev/null +++ b/pkg/github/user/starred/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package starred +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/user/starred_item_with_repo_item_request_builder.go b/pkg/github/user/starred_item_with_repo_item_request_builder.go new file mode 100644 index 00000000..403ba3cb --- /dev/null +++ b/pkg/github/user/starred_item_with_repo_item_request_builder.go @@ -0,0 +1,123 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// StarredItemWithRepoItemRequestBuilder builds and executes requests for operations under \user\starred\{owner}\{repo} +type StarredItemWithRepoItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewStarredItemWithRepoItemRequestBuilderInternal instantiates a new StarredItemWithRepoItemRequestBuilder and sets the default values. +func NewStarredItemWithRepoItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredItemWithRepoItemRequestBuilder) { + m := &StarredItemWithRepoItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/starred/{owner}/{repo}", pathParameters), + } + return m +} +// NewStarredItemWithRepoItemRequestBuilder instantiates a new StarredItemWithRepoItemRequestBuilder and sets the default values. +func NewStarredItemWithRepoItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredItemWithRepoItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStarredItemWithRepoItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete unstar a repository that the authenticated user has previously starred. +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/starring#unstar-a-repository-for-the-authenticated-user +func (m *StarredItemWithRepoItemRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get whether the authenticated user has starred the repository. +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/starring#check-if-a-repository-is-starred-by-the-authenticated-user +func (m *StarredItemWithRepoItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Put note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/starring#star-a-repository-for-the-authenticated-user +func (m *StarredItemWithRepoItemRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation unstar a repository that the authenticated user has previously starred. +// returns a *RequestInformation when successful +func (m *StarredItemWithRepoItemRequestBuilder) 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") + return requestInfo, nil +} +// ToGetRequestInformation whether the authenticated user has starred the repository. +// returns a *RequestInformation when successful +func (m *StarredItemWithRepoItemRequestBuilder) 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 +} +// ToPutRequestInformation note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a *RequestInformation when successful +func (m *StarredItemWithRepoItemRequestBuilder) ToPutRequestInformation(ctx context.Context, 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") + 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 *StarredItemWithRepoItemRequestBuilder when successful +func (m *StarredItemWithRepoItemRequestBuilder) WithUrl(rawUrl string)(*StarredItemWithRepoItemRequestBuilder) { + return NewStarredItemWithRepoItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/starred_request_builder.go b/pkg/github/user/starred_request_builder.go new file mode 100644 index 00000000..2cccf6e5 --- /dev/null +++ b/pkg/github/user/starred_request_builder.go @@ -0,0 +1,90 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + icd0d0eeb49e0011ccac02b4e4a0d91480a7f99532147b4eb2ededb1cd9194f0f "github.com/octokit/go-sdk-enterprise-server/pkg/github/user/starred" +) + +// StarredRequestBuilder builds and executes requests for operations under \user\starred +type StarredRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// StarredRequestBuilderGetQueryParameters lists repositories the authenticated user has starred.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +type StarredRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *icd0d0eeb49e0011ccac02b4e4a0d91480a7f99532147b4eb2ededb1cd9194f0f.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The property to sort the results by. `created` means when the repository was starred. `updated` means when the repository was last pushed to. + Sort *icd0d0eeb49e0011ccac02b4e4a0d91480a7f99532147b4eb2ededb1cd9194f0f.GetSortQueryParameterType `uriparametername:"sort"` +} +// ByOwner gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.starred.item collection +// returns a *StarredWithOwnerItemRequestBuilder when successful +func (m *StarredRequestBuilder) ByOwner(owner string)(*StarredWithOwnerItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if owner != "" { + urlTplParams["owner"] = owner + } + return NewStarredWithOwnerItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewStarredRequestBuilderInternal instantiates a new StarredRequestBuilder and sets the default values. +func NewStarredRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredRequestBuilder) { + m := &StarredRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/starred{?direction*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewStarredRequestBuilder instantiates a new StarredRequestBuilder and sets the default values. +func NewStarredRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStarredRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repositories the authenticated user has starred.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +// returns a []Repositoryable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/starring#list-repositories-starred-by-the-authenticated-user +func (m *StarredRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[StarredRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Repositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists repositories the authenticated user has starred.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +// returns a *RequestInformation when successful +func (m *StarredRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[StarredRequestBuilderGetQueryParameters])(*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 *StarredRequestBuilder when successful +func (m *StarredRequestBuilder) WithUrl(rawUrl string)(*StarredRequestBuilder) { + return NewStarredRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/starred_with_owner_item_request_builder.go b/pkg/github/user/starred_with_owner_item_request_builder.go new file mode 100644 index 00000000..de844307 --- /dev/null +++ b/pkg/github/user/starred_with_owner_item_request_builder.go @@ -0,0 +1,35 @@ +package user + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// StarredWithOwnerItemRequestBuilder builds and executes requests for operations under \user\starred\{owner} +type StarredWithOwnerItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByRepo gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.starred.item.item collection +// returns a *StarredItemWithRepoItemRequestBuilder when successful +func (m *StarredWithOwnerItemRequestBuilder) ByRepo(repo string)(*StarredItemWithRepoItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if repo != "" { + urlTplParams["repo"] = repo + } + return NewStarredItemWithRepoItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewStarredWithOwnerItemRequestBuilderInternal instantiates a new StarredWithOwnerItemRequestBuilder and sets the default values. +func NewStarredWithOwnerItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredWithOwnerItemRequestBuilder) { + m := &StarredWithOwnerItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/starred/{owner}", pathParameters), + } + return m +} +// NewStarredWithOwnerItemRequestBuilder instantiates a new StarredWithOwnerItemRequestBuilder and sets the default values. +func NewStarredWithOwnerItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*StarredWithOwnerItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewStarredWithOwnerItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/user/subscriptions_request_builder.go b/pkg/github/user/subscriptions_request_builder.go new file mode 100644 index 00000000..d4cb7657 --- /dev/null +++ b/pkg/github/user/subscriptions_request_builder.go @@ -0,0 +1,73 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// SubscriptionsRequestBuilder builds and executes requests for operations under \user\subscriptions +type SubscriptionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// SubscriptionsRequestBuilderGetQueryParameters lists repositories the authenticated user is watching. +type SubscriptionsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewSubscriptionsRequestBuilderInternal instantiates a new SubscriptionsRequestBuilder and sets the default values. +func NewSubscriptionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SubscriptionsRequestBuilder) { + m := &SubscriptionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/subscriptions{?page*,per_page*}", pathParameters), + } + return m +} +// NewSubscriptionsRequestBuilder instantiates a new SubscriptionsRequestBuilder and sets the default values. +func NewSubscriptionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*SubscriptionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewSubscriptionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repositories the authenticated user is watching. +// returns a []MinimalRepositoryable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/watching#list-repositories-watched-by-the-authenticated-user +func (m *SubscriptionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[SubscriptionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists repositories the authenticated user is watching. +// returns a *RequestInformation when successful +func (m *SubscriptionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[SubscriptionsRequestBuilderGetQueryParameters])(*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 *SubscriptionsRequestBuilder when successful +func (m *SubscriptionsRequestBuilder) WithUrl(rawUrl string)(*SubscriptionsRequestBuilder) { + return NewSubscriptionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/teams_request_builder.go b/pkg/github/user/teams_request_builder.go new file mode 100644 index 00000000..af100bbb --- /dev/null +++ b/pkg/github/user/teams_request_builder.go @@ -0,0 +1,73 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// TeamsRequestBuilder builds and executes requests for operations under \user\teams +type TeamsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// TeamsRequestBuilderGetQueryParameters list all of the teams across all of the organizations to which the authenticateduser belongs.OAuth app tokens and personal access tokens (classic) need the `user`, `repo`, or `read:org` scope to use this endpoint.When using a fine-grained personal access token, the resource owner of the token must be a single organization, and the response will only include the teams from that organization. +type TeamsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewTeamsRequestBuilderInternal instantiates a new TeamsRequestBuilder and sets the default values. +func NewTeamsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamsRequestBuilder) { + m := &TeamsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/teams{?page*,per_page*}", pathParameters), + } + return m +} +// NewTeamsRequestBuilder instantiates a new TeamsRequestBuilder and sets the default values. +func NewTeamsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*TeamsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewTeamsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list all of the teams across all of the organizations to which the authenticateduser belongs.OAuth app tokens and personal access tokens (classic) need the `user`, `repo`, or `read:org` scope to use this endpoint.When using a fine-grained personal access token, the resource owner of the token must be a single organization, and the response will only include the teams from that organization. +// returns a []TeamFullable 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/enterprise-server@3.14/rest/teams/teams#list-teams-for-the-authenticated-user +func (m *TeamsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[TeamsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamFullable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateTeamFullFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamFullable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.TeamFullable) + } + } + return val, nil +} +// ToGetRequestInformation list all of the teams across all of the organizations to which the authenticateduser belongs.OAuth app tokens and personal access tokens (classic) need the `user`, `repo`, or `read:org` scope to use this endpoint.When using a fine-grained personal access token, the resource owner of the token must be a single organization, and the response will only include the teams from that organization. +// returns a *RequestInformation when successful +func (m *TeamsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[TeamsRequestBuilderGetQueryParameters])(*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 *TeamsRequestBuilder when successful +func (m *TeamsRequestBuilder) WithUrl(rawUrl string)(*TeamsRequestBuilder) { + return NewTeamsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/user_patch_request_body.go b/pkg/github/user/user_patch_request_body.go new file mode 100644 index 00000000..03387dc1 --- /dev/null +++ b/pkg/github/user/user_patch_request_body.go @@ -0,0 +1,283 @@ +package user + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type UserPatchRequestBody 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 new short biography of the user. + bio *string + // The new blog URL of the user. + blog *string + // The new company of the user. + company *string + // The publicly visible email address of the user. + email *string + // The new hiring availability of the user. + hireable *bool + // The new location of the user. + location *string + // The new name of the user. + name *string + // The new Twitter username of the user. + twitter_username *string +} +// NewUserPatchRequestBody instantiates a new UserPatchRequestBody and sets the default values. +func NewUserPatchRequestBody()(*UserPatchRequestBody) { + m := &UserPatchRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateUserPatchRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUserPatchRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewUserPatchRequestBody(), 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 *UserPatchRequestBody) GetAdditionalData()(map[string]any) { + return m.additionalData +} +// GetBio gets the bio property value. The new short biography of the user. +// returns a *string when successful +func (m *UserPatchRequestBody) GetBio()(*string) { + return m.bio +} +// GetBlog gets the blog property value. The new blog URL of the user. +// returns a *string when successful +func (m *UserPatchRequestBody) GetBlog()(*string) { + return m.blog +} +// GetCompany gets the company property value. The new company of the user. +// returns a *string when successful +func (m *UserPatchRequestBody) GetCompany()(*string) { + return m.company +} +// GetEmail gets the email property value. The publicly visible email address of the user. +// returns a *string when successful +func (m *UserPatchRequestBody) GetEmail()(*string) { + return m.email +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UserPatchRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["bio"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBio(val) + } + return nil + } + res["blog"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetBlog(val) + } + return nil + } + res["company"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetCompany(val) + } + return nil + } + res["email"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetEmail(val) + } + return nil + } + res["hireable"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetBoolValue() + if err != nil { + return err + } + if val != nil { + m.SetHireable(val) + } + return nil + } + res["location"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetLocation(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["twitter_username"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetTwitterUsername(val) + } + return nil + } + return res +} +// GetHireable gets the hireable property value. The new hiring availability of the user. +// returns a *bool when successful +func (m *UserPatchRequestBody) GetHireable()(*bool) { + return m.hireable +} +// GetLocation gets the location property value. The new location of the user. +// returns a *string when successful +func (m *UserPatchRequestBody) GetLocation()(*string) { + return m.location +} +// GetName gets the name property value. The new name of the user. +// returns a *string when successful +func (m *UserPatchRequestBody) GetName()(*string) { + return m.name +} +// GetTwitterUsername gets the twitter_username property value. The new Twitter username of the user. +// returns a *string when successful +func (m *UserPatchRequestBody) GetTwitterUsername()(*string) { + return m.twitter_username +} +// Serialize serializes information the current object +func (m *UserPatchRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("bio", m.GetBio()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("blog", m.GetBlog()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("company", m.GetCompany()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("email", m.GetEmail()) + if err != nil { + return err + } + } + { + err := writer.WriteBoolValue("hireable", m.GetHireable()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("location", m.GetLocation()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("name", m.GetName()) + if err != nil { + return err + } + } + { + err := writer.WriteStringValue("twitter_username", m.GetTwitterUsername()) + 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 *UserPatchRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetBio sets the bio property value. The new short biography of the user. +func (m *UserPatchRequestBody) SetBio(value *string)() { + m.bio = value +} +// SetBlog sets the blog property value. The new blog URL of the user. +func (m *UserPatchRequestBody) SetBlog(value *string)() { + m.blog = value +} +// SetCompany sets the company property value. The new company of the user. +func (m *UserPatchRequestBody) SetCompany(value *string)() { + m.company = value +} +// SetEmail sets the email property value. The publicly visible email address of the user. +func (m *UserPatchRequestBody) SetEmail(value *string)() { + m.email = value +} +// SetHireable sets the hireable property value. The new hiring availability of the user. +func (m *UserPatchRequestBody) SetHireable(value *bool)() { + m.hireable = value +} +// SetLocation sets the location property value. The new location of the user. +func (m *UserPatchRequestBody) SetLocation(value *string)() { + m.location = value +} +// SetName sets the name property value. The new name of the user. +func (m *UserPatchRequestBody) SetName(value *string)() { + m.name = value +} +// SetTwitterUsername sets the twitter_username property value. The new Twitter username of the user. +func (m *UserPatchRequestBody) SetTwitterUsername(value *string)() { + m.twitter_username = value +} +type UserPatchRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetBio()(*string) + GetBlog()(*string) + GetCompany()(*string) + GetEmail()(*string) + GetHireable()(*bool) + GetLocation()(*string) + GetName()(*string) + GetTwitterUsername()(*string) + SetBio(value *string)() + SetBlog(value *string)() + SetCompany(value *string)() + SetEmail(value *string)() + SetHireable(value *bool)() + SetLocation(value *string)() + SetName(value *string)() + SetTwitterUsername(value *string)() +} diff --git a/pkg/github/user/user_request_builder.go b/pkg/github/user/user_request_builder.go new file mode 100644 index 00000000..1c658ff7 --- /dev/null +++ b/pkg/github/user/user_request_builder.go @@ -0,0 +1,304 @@ +package user + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// UserRequestBuilder builds and executes requests for operations under \user +type UserRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// UserGetResponse composed type wrapper for classes ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable +type UserGetResponse struct { + // Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable + privateUser ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable + // Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable + publicUser ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable +} +// NewUserGetResponse instantiates a new UserGetResponse and sets the default values. +func NewUserGetResponse()(*UserGetResponse) { + m := &UserGetResponse{ + } + return m +} +// CreateUserGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateUserGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewUserGetResponse() + 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 { + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *UserGetResponse) 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 *UserGetResponse) GetIsComposedType()(bool) { + return true +} +// GetPrivateUser gets the privateUser property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable +// returns a PrivateUserable when successful +func (m *UserGetResponse) GetPrivateUser()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable) { + return m.privateUser +} +// GetPublicUser gets the publicUser property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable +// returns a PublicUserable when successful +func (m *UserGetResponse) GetPublicUser()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable) { + return m.publicUser +} +// Serialize serializes information the current object +func (m *UserGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetPrivateUser() != nil { + err := writer.WriteObjectValue("", m.GetPrivateUser()) + if err != nil { + return err + } + } else if m.GetPublicUser() != nil { + err := writer.WriteObjectValue("", m.GetPublicUser()) + if err != nil { + return err + } + } + return nil +} +// SetPrivateUser sets the privateUser property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable +func (m *UserGetResponse) SetPrivateUser(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable)() { + m.privateUser = value +} +// SetPublicUser sets the publicUser property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable +func (m *UserGetResponse) SetPublicUser(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable)() { + m.publicUser = value +} +type UserGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPrivateUser()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable) + GetPublicUser()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable) + SetPrivateUser(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable)() + SetPublicUser(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable)() +} +// ByAccount_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.user.item collection +// returns a *WithAccount_ItemRequestBuilder when successful +func (m *UserRequestBuilder) ByAccount_id(account_id int32)(*WithAccount_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["account_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(account_id), 10) + return NewWithAccount_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewUserRequestBuilderInternal instantiates a new UserRequestBuilder and sets the default values. +func NewUserRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UserRequestBuilder) { + m := &UserRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user", pathParameters), + } + return m +} +// NewUserRequestBuilder instantiates a new UserRequestBuilder and sets the default values. +func NewUserRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UserRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewUserRequestBuilderInternal(urlParams, requestAdapter) +} +// Docker the docker property +// returns a *DockerRequestBuilder when successful +func (m *UserRequestBuilder) Docker()(*DockerRequestBuilder) { + return NewDockerRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Emails the emails property +// returns a *EmailsRequestBuilder when successful +func (m *UserRequestBuilder) Emails()(*EmailsRequestBuilder) { + return NewEmailsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Followers the followers property +// returns a *FollowersRequestBuilder when successful +func (m *UserRequestBuilder) Followers()(*FollowersRequestBuilder) { + return NewFollowersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Following the following property +// returns a *FollowingRequestBuilder when successful +func (m *UserRequestBuilder) Following()(*FollowingRequestBuilder) { + return NewFollowingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get oAuth app tokens and personal access tokens (classic) need the `user` scope in order for the response to include private profile information. +// returns a UserGetResponseable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/users#get-the-authenticated-user +func (m *UserRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(UserGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateUserGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(UserGetResponseable), nil +} +// Gpg_keys the gpg_keys property +// returns a *Gpg_keysRequestBuilder when successful +func (m *UserRequestBuilder) Gpg_keys()(*Gpg_keysRequestBuilder) { + return NewGpg_keysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installations the installations property +// returns a *InstallationsRequestBuilder when successful +func (m *UserRequestBuilder) Installations()(*InstallationsRequestBuilder) { + return NewInstallationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Issues the issues property +// returns a *IssuesRequestBuilder when successful +func (m *UserRequestBuilder) Issues()(*IssuesRequestBuilder) { + return NewIssuesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Keys the keys property +// returns a *KeysRequestBuilder when successful +func (m *UserRequestBuilder) Keys()(*KeysRequestBuilder) { + return NewKeysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Memberships the memberships property +// returns a *MembershipsRequestBuilder when successful +func (m *UserRequestBuilder) Memberships()(*MembershipsRequestBuilder) { + return NewMembershipsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Migrations the migrations property +// returns a *MigrationsRequestBuilder when successful +func (m *UserRequestBuilder) Migrations()(*MigrationsRequestBuilder) { + return NewMigrationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Orgs the orgs property +// returns a *OrgsRequestBuilder when successful +func (m *UserRequestBuilder) Orgs()(*OrgsRequestBuilder) { + return NewOrgsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Packages the packages property +// returns a *PackagesRequestBuilder when successful +func (m *UserRequestBuilder) Packages()(*PackagesRequestBuilder) { + return NewPackagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Patch **Note:** If your email is set to private and you send an `email` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. +// returns a PrivateUserable 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 ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/users#update-the-authenticated-user +func (m *UserRequestBuilder) Patch(ctx context.Context, body UserPatchRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable, error) { + requestInfo, err := m.ToPatchRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePrivateUserFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable), nil +} +// Projects the projects property +// returns a *ProjectsRequestBuilder when successful +func (m *UserRequestBuilder) Projects()(*ProjectsRequestBuilder) { + return NewProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Public_emails the public_emails property +// returns a *Public_emailsRequestBuilder when successful +func (m *UserRequestBuilder) Public_emails()(*Public_emailsRequestBuilder) { + return NewPublic_emailsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repos the repos property +// returns a *ReposRequestBuilder when successful +func (m *UserRequestBuilder) Repos()(*ReposRequestBuilder) { + return NewReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repository_invitations the repository_invitations property +// returns a *Repository_invitationsRequestBuilder when successful +func (m *UserRequestBuilder) Repository_invitations()(*Repository_invitationsRequestBuilder) { + return NewRepository_invitationsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Social_accounts the social_accounts property +// returns a *Social_accountsRequestBuilder when successful +func (m *UserRequestBuilder) Social_accounts()(*Social_accountsRequestBuilder) { + return NewSocial_accountsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Ssh_signing_keys the ssh_signing_keys property +// returns a *Ssh_signing_keysRequestBuilder when successful +func (m *UserRequestBuilder) Ssh_signing_keys()(*Ssh_signing_keysRequestBuilder) { + return NewSsh_signing_keysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Starred the starred property +// returns a *StarredRequestBuilder when successful +func (m *UserRequestBuilder) Starred()(*StarredRequestBuilder) { + return NewStarredRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Subscriptions the subscriptions property +// returns a *SubscriptionsRequestBuilder when successful +func (m *UserRequestBuilder) Subscriptions()(*SubscriptionsRequestBuilder) { + return NewSubscriptionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Teams the teams property +// returns a *TeamsRequestBuilder when successful +func (m *UserRequestBuilder) Teams()(*TeamsRequestBuilder) { + return NewTeamsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation oAuth app tokens and personal access tokens (classic) need the `user` scope in order for the response to include private profile information. +// returns a *RequestInformation when successful +func (m *UserRequestBuilder) 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:** If your email is set to private and you send an `email` parameter as part of this request to update your profile, your privacy settings are still enforced: the email address will not be displayed on your public profile or via the API. +// returns a *RequestInformation when successful +func (m *UserRequestBuilder) ToPatchRequestInformation(ctx context.Context, body UserPatchRequestBodyable, 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 *UserRequestBuilder when successful +func (m *UserRequestBuilder) WithUrl(rawUrl string)(*UserRequestBuilder) { + return NewUserRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/user/with_account_escaped_item_request_builder.go b/pkg/github/user/with_account_escaped_item_request_builder.go new file mode 100644 index 00000000..95a67fe0 --- /dev/null +++ b/pkg/github/user/with_account_escaped_item_request_builder.go @@ -0,0 +1,145 @@ +package user + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// WithAccount_ItemRequestBuilder builds and executes requests for operations under \user\{account_id} +type WithAccount_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// WithAccount_GetResponse composed type wrapper for classes ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable +type WithAccount_GetResponse struct { + // Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable + privateUser ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable + // Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable + publicUser ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable +} +// NewWithAccount_GetResponse instantiates a new WithAccount_GetResponse and sets the default values. +func NewWithAccount_GetResponse()(*WithAccount_GetResponse) { + m := &WithAccount_GetResponse{ + } + return m +} +// CreateWithAccount_GetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWithAccount_GetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewWithAccount_GetResponse() + 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 { + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WithAccount_GetResponse) 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 *WithAccount_GetResponse) GetIsComposedType()(bool) { + return true +} +// GetPrivateUser gets the privateUser property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable +// returns a PrivateUserable when successful +func (m *WithAccount_GetResponse) GetPrivateUser()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable) { + return m.privateUser +} +// GetPublicUser gets the publicUser property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable +// returns a PublicUserable when successful +func (m *WithAccount_GetResponse) GetPublicUser()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable) { + return m.publicUser +} +// Serialize serializes information the current object +func (m *WithAccount_GetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetPrivateUser() != nil { + err := writer.WriteObjectValue("", m.GetPrivateUser()) + if err != nil { + return err + } + } else if m.GetPublicUser() != nil { + err := writer.WriteObjectValue("", m.GetPublicUser()) + if err != nil { + return err + } + } + return nil +} +// SetPrivateUser sets the privateUser property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable +func (m *WithAccount_GetResponse) SetPrivateUser(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable)() { + m.privateUser = value +} +// SetPublicUser sets the publicUser property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable +func (m *WithAccount_GetResponse) SetPublicUser(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable)() { + m.publicUser = value +} +type WithAccount_GetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPrivateUser()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable) + GetPublicUser()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable) + SetPrivateUser(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable)() + SetPublicUser(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable)() +} +// NewWithAccount_ItemRequestBuilderInternal instantiates a new WithAccount_ItemRequestBuilder and sets the default values. +func NewWithAccount_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithAccount_ItemRequestBuilder) { + m := &WithAccount_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/user/{account_id}", pathParameters), + } + return m +} +// NewWithAccount_ItemRequestBuilder instantiates a new WithAccount_ItemRequestBuilder and sets the default values. +func NewWithAccount_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithAccount_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithAccount_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get provides publicly available information about someone with a GitHub account. This method takes their durable user `ID` instead of their `login`, which can change over time.The `email` key in the following response is the publicly visible email address from your GitHub Enterprise Server [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub Enterprise Server. For more information, see [Authentication](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#authentication).The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/enterprise-server@3.14/rest/users/emails)". +// returns a WithAccount_GetResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/users#get-a-user-using-their-id +func (m *WithAccount_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(WithAccount_GetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateWithAccount_GetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(WithAccount_GetResponseable), nil +} +// ToGetRequestInformation provides publicly available information about someone with a GitHub account. This method takes their durable user `ID` instead of their `login`, which can change over time.The `email` key in the following response is the publicly visible email address from your GitHub Enterprise Server [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub Enterprise Server. For more information, see [Authentication](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#authentication).The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/enterprise-server@3.14/rest/users/emails)". +// returns a *RequestInformation when successful +func (m *WithAccount_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *WithAccount_ItemRequestBuilder when successful +func (m *WithAccount_ItemRequestBuilder) WithUrl(rawUrl string)(*WithAccount_ItemRequestBuilder) { + return NewWithAccount_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item/hovercard/get_subject_escaped_type_query_parameter_type.go b/pkg/github/users/item/hovercard/get_subject_escaped_type_query_parameter_type.go new file mode 100644 index 00000000..97ec2398 --- /dev/null +++ b/pkg/github/users/item/hovercard/get_subject_escaped_type_query_parameter_type.go @@ -0,0 +1,39 @@ +package hovercard +type GetSubject_typeQueryParameterType int + +const ( + ORGANIZATION_GETSUBJECT_TYPEQUERYPARAMETERTYPE GetSubject_typeQueryParameterType = iota + REPOSITORY_GETSUBJECT_TYPEQUERYPARAMETERTYPE + ISSUE_GETSUBJECT_TYPEQUERYPARAMETERTYPE + PULL_REQUEST_GETSUBJECT_TYPEQUERYPARAMETERTYPE +) + +func (i GetSubject_typeQueryParameterType) String() string { + return []string{"organization", "repository", "issue", "pull_request"}[i] +} +func ParseGetSubject_typeQueryParameterType(v string) (any, error) { + result := ORGANIZATION_GETSUBJECT_TYPEQUERYPARAMETERTYPE + switch v { + case "organization": + result = ORGANIZATION_GETSUBJECT_TYPEQUERYPARAMETERTYPE + case "repository": + result = REPOSITORY_GETSUBJECT_TYPEQUERYPARAMETERTYPE + case "issue": + result = ISSUE_GETSUBJECT_TYPEQUERYPARAMETERTYPE + case "pull_request": + result = PULL_REQUEST_GETSUBJECT_TYPEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSubject_typeQueryParameterType(values []GetSubject_typeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSubject_typeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/users/item/packages/get_package_escaped_type_query_parameter_type.go b/pkg/github/users/item/packages/get_package_escaped_type_query_parameter_type.go new file mode 100644 index 00000000..071c8927 --- /dev/null +++ b/pkg/github/users/item/packages/get_package_escaped_type_query_parameter_type.go @@ -0,0 +1,45 @@ +package packages +type GetPackage_typeQueryParameterType int + +const ( + NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE GetPackage_typeQueryParameterType = iota + MAVEN_GETPACKAGE_TYPEQUERYPARAMETERTYPE + RUBYGEMS_GETPACKAGE_TYPEQUERYPARAMETERTYPE + DOCKER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + NUGET_GETPACKAGE_TYPEQUERYPARAMETERTYPE + CONTAINER_GETPACKAGE_TYPEQUERYPARAMETERTYPE +) + +func (i GetPackage_typeQueryParameterType) String() string { + return []string{"npm", "maven", "rubygems", "docker", "nuget", "container"}[i] +} +func ParseGetPackage_typeQueryParameterType(v string) (any, error) { + result := NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE + switch v { + case "npm": + result = NPM_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "maven": + result = MAVEN_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "rubygems": + result = RUBYGEMS_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "docker": + result = DOCKER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "nuget": + result = NUGET_GETPACKAGE_TYPEQUERYPARAMETERTYPE + case "container": + result = CONTAINER_GETPACKAGE_TYPEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetPackage_typeQueryParameterType(values []GetPackage_typeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetPackage_typeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/users/item/packages/get_visibility_query_parameter_type.go b/pkg/github/users/item/packages/get_visibility_query_parameter_type.go new file mode 100644 index 00000000..f6ffbef0 --- /dev/null +++ b/pkg/github/users/item/packages/get_visibility_query_parameter_type.go @@ -0,0 +1,36 @@ +package packages +type GetVisibilityQueryParameterType int + +const ( + PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE GetVisibilityQueryParameterType = iota + PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE + INTERNAL_GETVISIBILITYQUERYPARAMETERTYPE +) + +func (i GetVisibilityQueryParameterType) String() string { + return []string{"public", "private", "internal"}[i] +} +func ParseGetVisibilityQueryParameterType(v string) (any, error) { + result := PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + switch v { + case "public": + result = PUBLIC_GETVISIBILITYQUERYPARAMETERTYPE + case "private": + result = PRIVATE_GETVISIBILITYQUERYPARAMETERTYPE + case "internal": + result = INTERNAL_GETVISIBILITYQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetVisibilityQueryParameterType(values []GetVisibilityQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetVisibilityQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/users/item/projects/get_state_query_parameter_type.go b/pkg/github/users/item/projects/get_state_query_parameter_type.go new file mode 100644 index 00000000..2c9bc230 --- /dev/null +++ b/pkg/github/users/item/projects/get_state_query_parameter_type.go @@ -0,0 +1,36 @@ +package projects +type GetStateQueryParameterType int + +const ( + OPEN_GETSTATEQUERYPARAMETERTYPE GetStateQueryParameterType = iota + CLOSED_GETSTATEQUERYPARAMETERTYPE + ALL_GETSTATEQUERYPARAMETERTYPE +) + +func (i GetStateQueryParameterType) String() string { + return []string{"open", "closed", "all"}[i] +} +func ParseGetStateQueryParameterType(v string) (any, error) { + result := OPEN_GETSTATEQUERYPARAMETERTYPE + switch v { + case "open": + result = OPEN_GETSTATEQUERYPARAMETERTYPE + case "closed": + result = CLOSED_GETSTATEQUERYPARAMETERTYPE + case "all": + result = ALL_GETSTATEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetStateQueryParameterType(values []GetStateQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetStateQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/users/item/repos/get_direction_query_parameter_type.go b/pkg/github/users/item/repos/get_direction_query_parameter_type.go new file mode 100644 index 00000000..03a299e2 --- /dev/null +++ b/pkg/github/users/item/repos/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package repos +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/users/item/repos/get_sort_query_parameter_type.go b/pkg/github/users/item/repos/get_sort_query_parameter_type.go new file mode 100644 index 00000000..58939d2b --- /dev/null +++ b/pkg/github/users/item/repos/get_sort_query_parameter_type.go @@ -0,0 +1,39 @@ +package repos +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE + PUSHED_GETSORTQUERYPARAMETERTYPE + FULL_NAME_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated", "pushed", "full_name"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + case "pushed": + result = PUSHED_GETSORTQUERYPARAMETERTYPE + case "full_name": + result = FULL_NAME_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/users/item/repos/get_type_query_parameter_type.go b/pkg/github/users/item/repos/get_type_query_parameter_type.go new file mode 100644 index 00000000..4a14923c --- /dev/null +++ b/pkg/github/users/item/repos/get_type_query_parameter_type.go @@ -0,0 +1,36 @@ +package repos +type GetTypeQueryParameterType int + +const ( + ALL_GETTYPEQUERYPARAMETERTYPE GetTypeQueryParameterType = iota + OWNER_GETTYPEQUERYPARAMETERTYPE + MEMBER_GETTYPEQUERYPARAMETERTYPE +) + +func (i GetTypeQueryParameterType) String() string { + return []string{"all", "owner", "member"}[i] +} +func ParseGetTypeQueryParameterType(v string) (any, error) { + result := ALL_GETTYPEQUERYPARAMETERTYPE + switch v { + case "all": + result = ALL_GETTYPEQUERYPARAMETERTYPE + case "owner": + result = OWNER_GETTYPEQUERYPARAMETERTYPE + case "member": + result = MEMBER_GETTYPEQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetTypeQueryParameterType(values []GetTypeQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetTypeQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/users/item/starred/get_direction_query_parameter_type.go b/pkg/github/users/item/starred/get_direction_query_parameter_type.go new file mode 100644 index 00000000..c2f626bb --- /dev/null +++ b/pkg/github/users/item/starred/get_direction_query_parameter_type.go @@ -0,0 +1,33 @@ +package starred +type GetDirectionQueryParameterType int + +const ( + ASC_GETDIRECTIONQUERYPARAMETERTYPE GetDirectionQueryParameterType = iota + DESC_GETDIRECTIONQUERYPARAMETERTYPE +) + +func (i GetDirectionQueryParameterType) String() string { + return []string{"asc", "desc"}[i] +} +func ParseGetDirectionQueryParameterType(v string) (any, error) { + result := ASC_GETDIRECTIONQUERYPARAMETERTYPE + switch v { + case "asc": + result = ASC_GETDIRECTIONQUERYPARAMETERTYPE + case "desc": + result = DESC_GETDIRECTIONQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetDirectionQueryParameterType(values []GetDirectionQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetDirectionQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/users/item/starred/get_sort_query_parameter_type.go b/pkg/github/users/item/starred/get_sort_query_parameter_type.go new file mode 100644 index 00000000..a7875d45 --- /dev/null +++ b/pkg/github/users/item/starred/get_sort_query_parameter_type.go @@ -0,0 +1,33 @@ +package starred +type GetSortQueryParameterType int + +const ( + CREATED_GETSORTQUERYPARAMETERTYPE GetSortQueryParameterType = iota + UPDATED_GETSORTQUERYPARAMETERTYPE +) + +func (i GetSortQueryParameterType) String() string { + return []string{"created", "updated"}[i] +} +func ParseGetSortQueryParameterType(v string) (any, error) { + result := CREATED_GETSORTQUERYPARAMETERTYPE + switch v { + case "created": + result = CREATED_GETSORTQUERYPARAMETERTYPE + case "updated": + result = UPDATED_GETSORTQUERYPARAMETERTYPE + default: + return nil, nil + } + return &result, nil +} +func SerializeGetSortQueryParameterType(values []GetSortQueryParameterType) []string { + result := make([]string, len(values)) + for i, v := range values { + result[i] = v.String() + } + return result +} +func (i GetSortQueryParameterType) isMultiValue() bool { + return false +} diff --git a/pkg/github/users/item_docker_conflicts_request_builder.go b/pkg/github/users/item_docker_conflicts_request_builder.go new file mode 100644 index 00000000..573f4357 --- /dev/null +++ b/pkg/github/users/item_docker_conflicts_request_builder.go @@ -0,0 +1,66 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemDockerConflictsRequestBuilder builds and executes requests for operations under \users\{username}\docker\conflicts +type ItemDockerConflictsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemDockerConflictsRequestBuilderInternal instantiates a new ItemDockerConflictsRequestBuilder and sets the default values. +func NewItemDockerConflictsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerConflictsRequestBuilder) { + m := &ItemDockerConflictsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/docker/conflicts", pathParameters), + } + return m +} +// NewItemDockerConflictsRequestBuilder instantiates a new ItemDockerConflictsRequestBuilder and sets the default values. +func NewItemDockerConflictsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerConflictsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDockerConflictsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all packages that are in a specific user's namespace, that the requesting user has access to, and that encountered a conflict during Docker migration.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. +// returns a []PackageEscapedable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#get-list-of-conflicting-packages-during-docker-migration-for-user +func (m *ItemDockerConflictsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageEscapedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable) + } + } + return val, nil +} +// ToGetRequestInformation lists all packages that are in a specific user's namespace, that the requesting user has access to, and that encountered a conflict during Docker migration.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemDockerConflictsRequestBuilder) 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 *ItemDockerConflictsRequestBuilder when successful +func (m *ItemDockerConflictsRequestBuilder) WithUrl(rawUrl string)(*ItemDockerConflictsRequestBuilder) { + return NewItemDockerConflictsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_docker_request_builder.go b/pkg/github/users/item_docker_request_builder.go new file mode 100644 index 00000000..7b9159d2 --- /dev/null +++ b/pkg/github/users/item_docker_request_builder.go @@ -0,0 +1,28 @@ +package users + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemDockerRequestBuilder builds and executes requests for operations under \users\{username}\docker +type ItemDockerRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// Conflicts the conflicts property +// returns a *ItemDockerConflictsRequestBuilder when successful +func (m *ItemDockerRequestBuilder) Conflicts()(*ItemDockerConflictsRequestBuilder) { + return NewItemDockerConflictsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemDockerRequestBuilderInternal instantiates a new ItemDockerRequestBuilder and sets the default values. +func NewItemDockerRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerRequestBuilder) { + m := &ItemDockerRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/docker", pathParameters), + } + return m +} +// NewItemDockerRequestBuilder instantiates a new ItemDockerRequestBuilder and sets the default values. +func NewItemDockerRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemDockerRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemDockerRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/users/item_events_orgs_request_builder.go b/pkg/github/users/item_events_orgs_request_builder.go new file mode 100644 index 00000000..6e13d3d5 --- /dev/null +++ b/pkg/github/users/item_events_orgs_request_builder.go @@ -0,0 +1,35 @@ +package users + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemEventsOrgsRequestBuilder builds and executes requests for operations under \users\{username}\events\orgs +type ItemEventsOrgsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByOrg gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.users.item.events.orgs.item collection +// returns a *ItemEventsOrgsWithOrgItemRequestBuilder when successful +func (m *ItemEventsOrgsRequestBuilder) ByOrg(org string)(*ItemEventsOrgsWithOrgItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if org != "" { + urlTplParams["org"] = org + } + return NewItemEventsOrgsWithOrgItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemEventsOrgsRequestBuilderInternal instantiates a new ItemEventsOrgsRequestBuilder and sets the default values. +func NewItemEventsOrgsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsOrgsRequestBuilder) { + m := &ItemEventsOrgsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/events/orgs", pathParameters), + } + return m +} +// NewItemEventsOrgsRequestBuilder instantiates a new ItemEventsOrgsRequestBuilder and sets the default values. +func NewItemEventsOrgsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsOrgsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEventsOrgsRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/users/item_events_orgs_with_org_item_request_builder.go b/pkg/github/users/item_events_orgs_with_org_item_request_builder.go new file mode 100644 index 00000000..4dc26b23 --- /dev/null +++ b/pkg/github/users/item_events_orgs_with_org_item_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemEventsOrgsWithOrgItemRequestBuilder builds and executes requests for operations under \users\{username}\events\orgs\{org} +type ItemEventsOrgsWithOrgItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemEventsOrgsWithOrgItemRequestBuilderGetQueryParameters this is the user's organization dashboard. You must be authenticated as the user to view this.> [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +type ItemEventsOrgsWithOrgItemRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemEventsOrgsWithOrgItemRequestBuilderInternal instantiates a new ItemEventsOrgsWithOrgItemRequestBuilder and sets the default values. +func NewItemEventsOrgsWithOrgItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsOrgsWithOrgItemRequestBuilder) { + m := &ItemEventsOrgsWithOrgItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/events/orgs/{org}{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemEventsOrgsWithOrgItemRequestBuilder instantiates a new ItemEventsOrgsWithOrgItemRequestBuilder and sets the default values. +func NewItemEventsOrgsWithOrgItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsOrgsWithOrgItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEventsOrgsWithOrgItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get this is the user's organization dashboard. You must be authenticated as the user to view this.> [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a []Eventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/events#list-organization-events-for-the-authenticated-user +func (m *ItemEventsOrgsWithOrgItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsOrgsWithOrgItemRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable) + } + } + return val, nil +} +// ToGetRequestInformation this is the user's organization dashboard. You must be authenticated as the user to view this.> [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a *RequestInformation when successful +func (m *ItemEventsOrgsWithOrgItemRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsOrgsWithOrgItemRequestBuilderGetQueryParameters])(*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 *ItemEventsOrgsWithOrgItemRequestBuilder when successful +func (m *ItemEventsOrgsWithOrgItemRequestBuilder) WithUrl(rawUrl string)(*ItemEventsOrgsWithOrgItemRequestBuilder) { + return NewItemEventsOrgsWithOrgItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_events_public_request_builder.go b/pkg/github/users/item_events_public_request_builder.go new file mode 100644 index 00000000..638d623d --- /dev/null +++ b/pkg/github/users/item_events_public_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemEventsPublicRequestBuilder builds and executes requests for operations under \users\{username}\events\public +type ItemEventsPublicRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemEventsPublicRequestBuilderGetQueryParameters > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +type ItemEventsPublicRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemEventsPublicRequestBuilderInternal instantiates a new ItemEventsPublicRequestBuilder and sets the default values. +func NewItemEventsPublicRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsPublicRequestBuilder) { + m := &ItemEventsPublicRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/events/public{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemEventsPublicRequestBuilder instantiates a new ItemEventsPublicRequestBuilder and sets the default values. +func NewItemEventsPublicRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsPublicRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEventsPublicRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a []Eventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/events#list-public-events-for-a-user +func (m *ItemEventsPublicRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsPublicRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable) + } + } + return val, nil +} +// ToGetRequestInformation > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a *RequestInformation when successful +func (m *ItemEventsPublicRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsPublicRequestBuilderGetQueryParameters])(*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 *ItemEventsPublicRequestBuilder when successful +func (m *ItemEventsPublicRequestBuilder) WithUrl(rawUrl string)(*ItemEventsPublicRequestBuilder) { + return NewItemEventsPublicRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_events_request_builder.go b/pkg/github/users/item_events_request_builder.go new file mode 100644 index 00000000..7d66b56e --- /dev/null +++ b/pkg/github/users/item_events_request_builder.go @@ -0,0 +1,77 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemEventsRequestBuilder builds and executes requests for operations under \users\{username}\events +type ItemEventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemEventsRequestBuilderGetQueryParameters if you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events.> [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +type ItemEventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemEventsRequestBuilderInternal instantiates a new ItemEventsRequestBuilder and sets the default values. +func NewItemEventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsRequestBuilder) { + m := &ItemEventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/events{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemEventsRequestBuilder instantiates a new ItemEventsRequestBuilder and sets the default values. +func NewItemEventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemEventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemEventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get if you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events.> [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a []Eventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/events#list-events-for-the-authenticated-user +func (m *ItemEventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable) + } + } + return val, nil +} +// Orgs the orgs property +// returns a *ItemEventsOrgsRequestBuilder when successful +func (m *ItemEventsRequestBuilder) Orgs()(*ItemEventsOrgsRequestBuilder) { + return NewItemEventsOrgsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Public the public property +// returns a *ItemEventsPublicRequestBuilder when successful +func (m *ItemEventsRequestBuilder) Public()(*ItemEventsPublicRequestBuilder) { + return NewItemEventsPublicRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation if you are authenticated as the given user, you will see your private events. Otherwise, you'll only see public events.> [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a *RequestInformation when successful +func (m *ItemEventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemEventsRequestBuilderGetQueryParameters])(*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 *ItemEventsRequestBuilder when successful +func (m *ItemEventsRequestBuilder) WithUrl(rawUrl string)(*ItemEventsRequestBuilder) { + return NewItemEventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_followers_request_builder.go b/pkg/github/users/item_followers_request_builder.go new file mode 100644 index 00000000..8c2faab2 --- /dev/null +++ b/pkg/github/users/item_followers_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemFollowersRequestBuilder builds and executes requests for operations under \users\{username}\followers +type ItemFollowersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemFollowersRequestBuilderGetQueryParameters lists the people following the specified user. +type ItemFollowersRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemFollowersRequestBuilderInternal instantiates a new ItemFollowersRequestBuilder and sets the default values. +func NewItemFollowersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemFollowersRequestBuilder) { + m := &ItemFollowersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/followers{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemFollowersRequestBuilder instantiates a new ItemFollowersRequestBuilder and sets the default values. +func NewItemFollowersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemFollowersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemFollowersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the people following the specified user. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/followers#list-followers-of-a-user +func (m *ItemFollowersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemFollowersRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists the people following the specified user. +// returns a *RequestInformation when successful +func (m *ItemFollowersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemFollowersRequestBuilderGetQueryParameters])(*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 *ItemFollowersRequestBuilder when successful +func (m *ItemFollowersRequestBuilder) WithUrl(rawUrl string)(*ItemFollowersRequestBuilder) { + return NewItemFollowersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_following_request_builder.go b/pkg/github/users/item_following_request_builder.go new file mode 100644 index 00000000..8cc9cdc3 --- /dev/null +++ b/pkg/github/users/item_following_request_builder.go @@ -0,0 +1,79 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemFollowingRequestBuilder builds and executes requests for operations under \users\{username}\following +type ItemFollowingRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemFollowingRequestBuilderGetQueryParameters lists the people who the specified user follows. +type ItemFollowingRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// ByTarget_user gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.users.item.following.item collection +// returns a *ItemFollowingWithTarget_userItemRequestBuilder when successful +func (m *ItemFollowingRequestBuilder) ByTarget_user(target_user string)(*ItemFollowingWithTarget_userItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if target_user != "" { + urlTplParams["target_user"] = target_user + } + return NewItemFollowingWithTarget_userItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemFollowingRequestBuilderInternal instantiates a new ItemFollowingRequestBuilder and sets the default values. +func NewItemFollowingRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemFollowingRequestBuilder) { + m := &ItemFollowingRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/following{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemFollowingRequestBuilder instantiates a new ItemFollowingRequestBuilder and sets the default values. +func NewItemFollowingRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemFollowingRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemFollowingRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the people who the specified user follows. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/followers#list-the-people-a-user-follows +func (m *ItemFollowingRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemFollowingRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists the people who the specified user follows. +// returns a *RequestInformation when successful +func (m *ItemFollowingRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemFollowingRequestBuilderGetQueryParameters])(*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 *ItemFollowingRequestBuilder when successful +func (m *ItemFollowingRequestBuilder) WithUrl(rawUrl string)(*ItemFollowingRequestBuilder) { + return NewItemFollowingRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_following_with_target_escaped_user_item_request_builder.go b/pkg/github/users/item_following_with_target_escaped_user_item_request_builder.go new file mode 100644 index 00000000..835bf659 --- /dev/null +++ b/pkg/github/users/item_following_with_target_escaped_user_item_request_builder.go @@ -0,0 +1,50 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemFollowingWithTarget_userItemRequestBuilder builds and executes requests for operations under \users\{username}\following\{target_user} +type ItemFollowingWithTarget_userItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemFollowingWithTarget_userItemRequestBuilderInternal instantiates a new ItemFollowingWithTarget_userItemRequestBuilder and sets the default values. +func NewItemFollowingWithTarget_userItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemFollowingWithTarget_userItemRequestBuilder) { + m := &ItemFollowingWithTarget_userItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/following/{target_user}", pathParameters), + } + return m +} +// NewItemFollowingWithTarget_userItemRequestBuilder instantiates a new ItemFollowingWithTarget_userItemRequestBuilder and sets the default values. +func NewItemFollowingWithTarget_userItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemFollowingWithTarget_userItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemFollowingWithTarget_userItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Get check if a user follows another user +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/followers#check-if-a-user-follows-another-user +func (m *ItemFollowingWithTarget_userItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// returns a *RequestInformation when successful +func (m *ItemFollowingWithTarget_userItemRequestBuilder) 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) + 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 *ItemFollowingWithTarget_userItemRequestBuilder when successful +func (m *ItemFollowingWithTarget_userItemRequestBuilder) WithUrl(rawUrl string)(*ItemFollowingWithTarget_userItemRequestBuilder) { + return NewItemFollowingWithTarget_userItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_gists_request_builder.go b/pkg/github/users/item_gists_request_builder.go new file mode 100644 index 00000000..849202e3 --- /dev/null +++ b/pkg/github/users/item_gists_request_builder.go @@ -0,0 +1,74 @@ +package users + +import ( + "context" + i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e "time" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemGistsRequestBuilder builds and executes requests for operations under \users\{username}\gists +type ItemGistsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemGistsRequestBuilderGetQueryParameters lists public gists for the specified user: +type ItemGistsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Only show results that were last updated after the given time. This is a timestamp in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format: `YYYY-MM-DDTHH:MM:SSZ`. + Since *i336074805fc853987abe6f7fe3ad97a6a6f3077a16391fec744f671a015fbd7e.Time `uriparametername:"since"` +} +// NewItemGistsRequestBuilderInternal instantiates a new ItemGistsRequestBuilder and sets the default values. +func NewItemGistsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemGistsRequestBuilder) { + m := &ItemGistsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/gists{?page*,per_page*,since*}", pathParameters), + } + return m +} +// NewItemGistsRequestBuilder instantiates a new ItemGistsRequestBuilder and sets the default values. +func NewItemGistsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemGistsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemGistsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists public gists for the specified user: +// returns a []BaseGistable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/gists/gists#list-gists-for-a-user +func (m *ItemGistsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemGistsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BaseGistable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBaseGistFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BaseGistable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.BaseGistable) + } + } + return val, nil +} +// ToGetRequestInformation lists public gists for the specified user: +// returns a *RequestInformation when successful +func (m *ItemGistsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemGistsRequestBuilderGetQueryParameters])(*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 *ItemGistsRequestBuilder when successful +func (m *ItemGistsRequestBuilder) WithUrl(rawUrl string)(*ItemGistsRequestBuilder) { + return NewItemGistsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_gpg_escaped_keys_request_builder.go b/pkg/github/users/item_gpg_escaped_keys_request_builder.go new file mode 100644 index 00000000..1ded6d5d --- /dev/null +++ b/pkg/github/users/item_gpg_escaped_keys_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemGpg_keysRequestBuilder builds and executes requests for operations under \users\{username}\gpg_keys +type ItemGpg_keysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemGpg_keysRequestBuilderGetQueryParameters lists the GPG keys for a user. This information is accessible by anyone. +type ItemGpg_keysRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemGpg_keysRequestBuilderInternal instantiates a new ItemGpg_keysRequestBuilder and sets the default values. +func NewItemGpg_keysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemGpg_keysRequestBuilder) { + m := &ItemGpg_keysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/gpg_keys{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemGpg_keysRequestBuilder instantiates a new ItemGpg_keysRequestBuilder and sets the default values. +func NewItemGpg_keysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemGpg_keysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemGpg_keysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the GPG keys for a user. This information is accessible by anyone. +// returns a []GpgKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/gpg-keys#list-gpg-keys-for-a-user +func (m *ItemGpg_keysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemGpg_keysRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GpgKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateGpgKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GpgKeyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.GpgKeyable) + } + } + return val, nil +} +// ToGetRequestInformation lists the GPG keys for a user. This information is accessible by anyone. +// returns a *RequestInformation when successful +func (m *ItemGpg_keysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemGpg_keysRequestBuilderGetQueryParameters])(*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 *ItemGpg_keysRequestBuilder when successful +func (m *ItemGpg_keysRequestBuilder) WithUrl(rawUrl string)(*ItemGpg_keysRequestBuilder) { + return NewItemGpg_keysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_hovercard_request_builder.go b/pkg/github/users/item_hovercard_request_builder.go new file mode 100644 index 00000000..8100b81e --- /dev/null +++ b/pkg/github/users/item_hovercard_request_builder.go @@ -0,0 +1,71 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i9a082e3935015f10a734dd5481cfcaeed2f79de67b906adbbde6bec44be2d505 "github.com/octokit/go-sdk-enterprise-server/pkg/github/users/item/hovercard" +) + +// ItemHovercardRequestBuilder builds and executes requests for operations under \users\{username}\hovercard +type ItemHovercardRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemHovercardRequestBuilderGetQueryParameters provides hovercard information. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository, you would use a `subject_type` value of `repository` and a `subject_id` value of `1300192` (the ID of the `Spoon-Knife` repository).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +type ItemHovercardRequestBuilderGetQueryParameters struct { + // Uses the ID for the `subject_type` you specified. **Required** when using `subject_type`. + Subject_id *string `uriparametername:"subject_id"` + // Identifies which additional information you'd like to receive about the person's hovercard. Can be `organization`, `repository`, `issue`, `pull_request`. **Required** when using `subject_id`. + Subject_type *i9a082e3935015f10a734dd5481cfcaeed2f79de67b906adbbde6bec44be2d505.GetSubject_typeQueryParameterType `uriparametername:"subject_type"` +} +// NewItemHovercardRequestBuilderInternal instantiates a new ItemHovercardRequestBuilder and sets the default values. +func NewItemHovercardRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHovercardRequestBuilder) { + m := &ItemHovercardRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/hovercard{?subject_id*,subject_type*}", pathParameters), + } + return m +} +// NewItemHovercardRequestBuilder instantiates a new ItemHovercardRequestBuilder and sets the default values. +func NewItemHovercardRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemHovercardRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemHovercardRequestBuilderInternal(urlParams, requestAdapter) +} +// Get provides hovercard information. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository, you would use a `subject_type` value of `repository` and a `subject_id` value of `1300192` (the ID of the `Spoon-Knife` repository).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a Hovercardable 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/enterprise-server@3.14/rest/users/users#get-contextual-information-for-a-user +func (m *ItemHovercardRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemHovercardRequestBuilderGetQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Hovercardable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateHovercardFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Hovercardable), nil +} +// ToGetRequestInformation provides hovercard information. You can find out more about someone in relation to their pull requests, issues, repositories, and organizations. The `subject_type` and `subject_id` parameters provide context for the person's hovercard, which returns more information than without the parameters. For example, if you wanted to find out more about `octocat` who owns the `Spoon-Knife` repository, you would use a `subject_type` value of `repository` and a `subject_id` value of `1300192` (the ID of the `Spoon-Knife` repository).OAuth app tokens and personal access tokens (classic) need the `repo` scope to use this endpoint. +// returns a *RequestInformation when successful +func (m *ItemHovercardRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemHovercardRequestBuilderGetQueryParameters])(*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 *ItemHovercardRequestBuilder when successful +func (m *ItemHovercardRequestBuilder) WithUrl(rawUrl string)(*ItemHovercardRequestBuilder) { + return NewItemHovercardRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_installation_request_builder.go b/pkg/github/users/item_installation_request_builder.go new file mode 100644 index 00000000..93bb2a68 --- /dev/null +++ b/pkg/github/users/item_installation_request_builder.go @@ -0,0 +1,57 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemInstallationRequestBuilder builds and executes requests for operations under \users\{username}\installation +type ItemInstallationRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemInstallationRequestBuilderInternal instantiates a new ItemInstallationRequestBuilder and sets the default values. +func NewItemInstallationRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInstallationRequestBuilder) { + m := &ItemInstallationRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/installation", pathParameters), + } + return m +} +// NewItemInstallationRequestBuilder instantiates a new ItemInstallationRequestBuilder and sets the default values. +func NewItemInstallationRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemInstallationRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemInstallationRequestBuilderInternal(urlParams, requestAdapter) +} +// Get enables an authenticated GitHub App to find the user’s installation information.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a Installationable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/apps/apps#get-a-user-installation-for-the-authenticated-app +func (m *ItemInstallationRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateInstallationFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Installationable), nil +} +// ToGetRequestInformation enables an authenticated GitHub App to find the user’s installation information.You must use a [JWT](https://docs.github.com/enterprise-server@3.14/apps/building-github-apps/authenticating-with-github-apps/#authenticating-as-a-github-app) to access this endpoint. +// returns a *RequestInformation when successful +func (m *ItemInstallationRequestBuilder) 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 *ItemInstallationRequestBuilder when successful +func (m *ItemInstallationRequestBuilder) WithUrl(rawUrl string)(*ItemInstallationRequestBuilder) { + return NewItemInstallationRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_keys_request_builder.go b/pkg/github/users/item_keys_request_builder.go new file mode 100644 index 00000000..e5c17e18 --- /dev/null +++ b/pkg/github/users/item_keys_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemKeysRequestBuilder builds and executes requests for operations under \users\{username}\keys +type ItemKeysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemKeysRequestBuilderGetQueryParameters lists the _verified_ public SSH keys for a user. This is accessible by anyone. +type ItemKeysRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemKeysRequestBuilderInternal instantiates a new ItemKeysRequestBuilder and sets the default values. +func NewItemKeysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemKeysRequestBuilder) { + m := &ItemKeysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/keys{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemKeysRequestBuilder instantiates a new ItemKeysRequestBuilder and sets the default values. +func NewItemKeysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemKeysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemKeysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the _verified_ public SSH keys for a user. This is accessible by anyone. +// returns a []KeySimpleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/keys#list-public-keys-for-a-user +func (m *ItemKeysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemKeysRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.KeySimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateKeySimpleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.KeySimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.KeySimpleable) + } + } + return val, nil +} +// ToGetRequestInformation lists the _verified_ public SSH keys for a user. This is accessible by anyone. +// returns a *RequestInformation when successful +func (m *ItemKeysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemKeysRequestBuilderGetQueryParameters])(*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 *ItemKeysRequestBuilder when successful +func (m *ItemKeysRequestBuilder) WithUrl(rawUrl string)(*ItemKeysRequestBuilder) { + return NewItemKeysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_orgs_request_builder.go b/pkg/github/users/item_orgs_request_builder.go new file mode 100644 index 00000000..4beede45 --- /dev/null +++ b/pkg/github/users/item_orgs_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemOrgsRequestBuilder builds and executes requests for operations under \users\{username}\orgs +type ItemOrgsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemOrgsRequestBuilderGetQueryParameters list [public organization memberships](https://docs.github.com/enterprise-server@3.14/articles/publicizing-or-concealing-organization-membership) for the specified user.This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/enterprise-server@3.14/rest/orgs/orgs#list-organizations-for-the-authenticated-user) API instead. +type ItemOrgsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemOrgsRequestBuilderInternal instantiates a new ItemOrgsRequestBuilder and sets the default values. +func NewItemOrgsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrgsRequestBuilder) { + m := &ItemOrgsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/orgs{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemOrgsRequestBuilder instantiates a new ItemOrgsRequestBuilder and sets the default values. +func NewItemOrgsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemOrgsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemOrgsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get list [public organization memberships](https://docs.github.com/enterprise-server@3.14/articles/publicizing-or-concealing-organization-membership) for the specified user.This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/enterprise-server@3.14/rest/orgs/orgs#list-organizations-for-the-authenticated-user) API instead. +// returns a []OrganizationSimpleable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/orgs/orgs#list-organizations-for-a-user +func (m *ItemOrgsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOrgsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateOrganizationSimpleFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.OrganizationSimpleable) + } + } + return val, nil +} +// ToGetRequestInformation list [public organization memberships](https://docs.github.com/enterprise-server@3.14/articles/publicizing-or-concealing-organization-membership) for the specified user.This method only lists _public_ memberships, regardless of authentication. If you need to fetch all of the organization memberships (public and private) for the authenticated user, use the [List organizations for the authenticated user](https://docs.github.com/enterprise-server@3.14/rest/orgs/orgs#list-organizations-for-the-authenticated-user) API instead. +// returns a *RequestInformation when successful +func (m *ItemOrgsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemOrgsRequestBuilderGetQueryParameters])(*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 *ItemOrgsRequestBuilder when successful +func (m *ItemOrgsRequestBuilder) WithUrl(rawUrl string)(*ItemOrgsRequestBuilder) { + return NewItemOrgsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_packages_item_item_restore_request_builder.go b/pkg/github/users/item_packages_item_item_restore_request_builder.go new file mode 100644 index 00000000..12feb9f4 --- /dev/null +++ b/pkg/github/users/item_packages_item_item_restore_request_builder.go @@ -0,0 +1,66 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPackagesItemItemRestoreRequestBuilder builds and executes requests for operations under \users\{username}\packages\{package_type}\{package_name}\restore +type ItemPackagesItemItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters restores an entire package for a user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters struct { + // package token + Token *string `uriparametername:"token"` +} +// NewItemPackagesItemItemRestoreRequestBuilderInternal instantiates a new ItemPackagesItemItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemRestoreRequestBuilder) { + m := &ItemPackagesItemItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/packages/{package_type}/{package_name}/restore{?token*}", pathParameters), + } + return m +} +// NewItemPackagesItemItemRestoreRequestBuilder instantiates a new ItemPackagesItemItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemRestoreRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} +// Post restores an entire package for a user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#restore-a-package-for-a-user +func (m *ItemPackagesItemItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation restores an entire package for a user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemRestoreRequestBuilder) ToPostRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesItemItemRestoreRequestBuilderPostQueryParameters])(*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 *ItemPackagesItemItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemItemRestoreRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemRestoreRequestBuilder) { + return NewItemPackagesItemItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_packages_item_item_versions_item_restore_request_builder.go b/pkg/github/users/item_packages_item_item_versions_item_restore_request_builder.go new file mode 100644 index 00000000..b3214af1 --- /dev/null +++ b/pkg/github/users/item_packages_item_item_versions_item_restore_request_builder.go @@ -0,0 +1,61 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPackagesItemItemVersionsItemRestoreRequestBuilder builds and executes requests for operations under \users\{username}\packages\{package_type}\{package_name}\versions\{package_version_id}\restore +type ItemPackagesItemItemVersionsItemRestoreRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal instantiates a new ItemPackagesItemItemVersionsItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + m := &ItemPackagesItemItemVersionsItemRestoreRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}/restore", pathParameters), + } + return m +} +// NewItemPackagesItemItemVersionsItemRestoreRequestBuilder instantiates a new ItemPackagesItemItemVersionsItemRestoreRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsItemRestoreRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal(urlParams, requestAdapter) +} +// Post restores a specific package version for a user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#restore-package-version-for-a-user +func (m *ItemPackagesItemItemVersionsItemRestoreRequestBuilder) Post(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPostRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// ToPostRequestInformation restores a specific package version for a user.You can restore a deleted package under the following conditions: - The package was deleted within the last 30 days. - The same package namespace and version is still available and not reused for a new package. If the same package namespace is not available, you will not be able to restore your package. In this scenario, to restore the deleted package, you must delete the new package that uses the deleted package's namespace first.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `write:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsItemRestoreRequestBuilder) 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 *ItemPackagesItemItemVersionsItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsItemRestoreRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + return NewItemPackagesItemItemVersionsItemRestoreRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_packages_item_item_versions_request_builder.go b/pkg/github/users/item_packages_item_item_versions_request_builder.go new file mode 100644 index 00000000..0884dd9b --- /dev/null +++ b/pkg/github/users/item_packages_item_item_versions_request_builder.go @@ -0,0 +1,79 @@ +package users + +import ( + "context" + i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274 "strconv" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPackagesItemItemVersionsRequestBuilder builds and executes requests for operations under \users\{username}\packages\{package_type}\{package_name}\versions +type ItemPackagesItemItemVersionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByPackage_version_id gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.users.item.packages.item.item.versions.item collection +// returns a *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsRequestBuilder) ByPackage_version_id(package_version_id int32)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + urlTplParams["package_version_id"] = i53ac87e8cb3cc9276228f74d38694a208cacb99bb8ceb705eeae99fb88d4d274.FormatInt(int64(package_version_id), 10) + return NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPackagesItemItemVersionsRequestBuilderInternal instantiates a new ItemPackagesItemItemVersionsRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsRequestBuilder) { + m := &ItemPackagesItemItemVersionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/packages/{package_type}/{package_name}/versions", pathParameters), + } + return m +} +// NewItemPackagesItemItemVersionsRequestBuilder instantiates a new ItemPackagesItemItemVersionsRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemVersionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists package versions for a public package owned by a specified user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a []PackageVersionable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#list-package-versions-for-a-package-owned-by-a-user +func (m *ItemPackagesItemItemVersionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageVersionFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable) + } + } + return val, nil +} +// ToGetRequestInformation lists package versions for a public package owned by a specified user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsRequestBuilder) 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 *ItemPackagesItemItemVersionsRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemVersionsRequestBuilder) { + return NewItemPackagesItemItemVersionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_packages_item_item_versions_with_package_escaped_version_escaped_item_request_builder.go b/pkg/github/users/item_packages_item_item_versions_with_package_escaped_version_escaped_item_request_builder.go new file mode 100644 index 00000000..a55e56a3 --- /dev/null +++ b/pkg/github/users/item_packages_item_item_versions_with_package_escaped_version_escaped_item_request_builder.go @@ -0,0 +1,93 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder builds and executes requests for operations under \users\{username}\packages\{package_type}\{package_name}\versions\{package_version_id} +type ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal instantiates a new ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + m := &ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/packages/{package_type}/{package_name}/versions/{package_version_id}", pathParameters), + } + return m +} +// NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder instantiates a new ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder and sets the default values. +func NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes a specific package version for a user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#delete-package-version-for-a-user +func (m *ItemPackagesItemItemVersionsWithPackage_version_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 { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a specific package version for a public package owned by a specified user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a PackageVersionable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#get-a-package-version-for-a-user +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageVersionFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageVersionable), nil +} +// Restore the restore property +// returns a *ItemPackagesItemItemVersionsItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) Restore()(*ItemPackagesItemItemVersionsItemRestoreRequestBuilder) { + return NewItemPackagesItemItemVersionsItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes a specific package version for a user. If the package is public and the package version has more than 5,000 downloads, you cannot delete the package version. In this scenario, contact GitHub support for further assistance.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_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") + return requestInfo, nil +} +// ToGetRequestInformation gets a specific package version for a public package owned by a specified user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_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 +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder when successful +func (m *ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder) { + return NewItemPackagesItemItemVersionsWithPackage_version_ItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_packages_item_with_package_escaped_name_item_request_builder.go b/pkg/github/users/item_packages_item_with_package_escaped_name_item_request_builder.go new file mode 100644 index 00000000..4614b967 --- /dev/null +++ b/pkg/github/users/item_packages_item_with_package_escaped_name_item_request_builder.go @@ -0,0 +1,98 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemPackagesItemWithPackage_nameItemRequestBuilder builds and executes requests for operations under \users\{username}\packages\{package_type}\{package_name} +type ItemPackagesItemWithPackage_nameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal instantiates a new ItemPackagesItemWithPackage_nameItemRequestBuilder and sets the default values. +func NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + m := &ItemPackagesItemWithPackage_nameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/packages/{package_type}/{package_name}", pathParameters), + } + return m +} +// NewItemPackagesItemWithPackage_nameItemRequestBuilder instantiates a new ItemPackagesItemWithPackage_nameItemRequestBuilder and sets the default values. +func NewItemPackagesItemWithPackage_nameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete deletes an entire package for a user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#delete-a-package-for-a-user +func (m *ItemPackagesItemWithPackage_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 { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, errorMapping) + if err != nil { + return err + } + return nil +} +// Get gets a specific package metadata for a public package owned by a user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a PackageEscapedable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#get-a-package-for-a-user +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageEscapedFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable), nil +} +// Restore the restore property +// returns a *ItemPackagesItemItemRestoreRequestBuilder when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) Restore()(*ItemPackagesItemItemRestoreRequestBuilder) { + return NewItemPackagesItemItemRestoreRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToDeleteRequestInformation deletes an entire package for a user. You cannot delete a public package if any version of the package has more than 5,000 downloads. In this scenario, contact GitHub support for further assistance.If the `package_type` belongs to a GitHub Packages registry that supports granular permissions, the authenticated user must have admin permissions to the package. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)."OAuth app tokens and personal access tokens (classic) need the `read:packages` and `delete:packages` scopes to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemWithPackage_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") + return requestInfo, nil +} +// ToGetRequestInformation gets a specific package metadata for a public package owned by a user.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesItemWithPackage_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 +} +// Versions the versions property +// returns a *ItemPackagesItemItemVersionsRequestBuilder when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) Versions()(*ItemPackagesItemItemVersionsRequestBuilder) { + return NewItemPackagesItemItemVersionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// WithUrl returns a request builder with the provided arbitrary URL. Using this method means any other path or query parameters are ignored. +// returns a *ItemPackagesItemWithPackage_nameItemRequestBuilder when successful +func (m *ItemPackagesItemWithPackage_nameItemRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + return NewItemPackagesItemWithPackage_nameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_packages_request_builder.go b/pkg/github/users/item_packages_request_builder.go new file mode 100644 index 00000000..f8e27f42 --- /dev/null +++ b/pkg/github/users/item_packages_request_builder.go @@ -0,0 +1,90 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i66622260929edc1fdb6159e42fd6418012be2afc18eafcd05ec45ead74113644 "github.com/octokit/go-sdk-enterprise-server/pkg/github/users/item/packages" +) + +// ItemPackagesRequestBuilder builds and executes requests for operations under \users\{username}\packages +type ItemPackagesRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemPackagesRequestBuilderGetQueryParameters lists all packages in a user's namespace for which the requesting user has access.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +type ItemPackagesRequestBuilderGetQueryParameters struct { + // The type of supported package. Packages in GitHub's Gradle registry have the type `maven`. Docker images pushed to GitHub's Container registry (`ghcr.io`) have the type `container`. You can use the type `docker` to find images that were pushed to GitHub's Docker registry (`docker.pkg.github.com`), even if these have now been migrated to the Container registry. + Package_type *i66622260929edc1fdb6159e42fd6418012be2afc18eafcd05ec45ead74113644.GetPackage_typeQueryParameterType `uriparametername:"package_type"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The selected visibility of the packages. This parameter is optional and only filters an existing result set.The `internal` visibility is only supported for GitHub Packages registries that allow for granular permissions. For other ecosystems `internal` is synonymous with `private`.For the list of GitHub Packages registries that support granular permissions, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#granular-permissions-for-userorganization-scoped-packages)." + Visibility *i66622260929edc1fdb6159e42fd6418012be2afc18eafcd05ec45ead74113644.GetVisibilityQueryParameterType `uriparametername:"visibility"` +} +// ByPackage_type gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.users.item.packages.item collection +// returns a *ItemPackagesWithPackage_typeItemRequestBuilder when successful +func (m *ItemPackagesRequestBuilder) ByPackage_type(package_type string)(*ItemPackagesWithPackage_typeItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if package_type != "" { + urlTplParams["package_type"] = package_type + } + return NewItemPackagesWithPackage_typeItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPackagesRequestBuilderInternal instantiates a new ItemPackagesRequestBuilder and sets the default values. +func NewItemPackagesRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesRequestBuilder) { + m := &ItemPackagesRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/packages?package_type={package_type}{&page*,per_page*,visibility*}", pathParameters), + } + return m +} +// NewItemPackagesRequestBuilder instantiates a new ItemPackagesRequestBuilder and sets the default values. +func NewItemPackagesRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all packages in a user's namespace for which the requesting user has access.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a []PackageEscapedable 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 +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/packages/packages#list-packages-for-a-user +func (m *ItemPackagesRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "401": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + "403": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreatePackageEscapedFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PackageEscapedable) + } + } + return val, nil +} +// ToGetRequestInformation lists all packages in a user's namespace for which the requesting user has access.OAuth app tokens and personal access tokens (classic) need the `read:packages` scope to use this endpoint. If the `package_type` belongs to a GitHub Packages registry that only supports repository-scoped permissions, the `repo` scope is also required. For the list of these registries, see "[About permissions for GitHub Packages](https://docs.github.com/enterprise-server@3.14/packages/learn-github-packages/about-permissions-for-github-packages#permissions-for-repository-scoped-packages)." +// returns a *RequestInformation when successful +func (m *ItemPackagesRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemPackagesRequestBuilderGetQueryParameters])(*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 *ItemPackagesRequestBuilder when successful +func (m *ItemPackagesRequestBuilder) WithUrl(rawUrl string)(*ItemPackagesRequestBuilder) { + return NewItemPackagesRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_packages_with_package_escaped_type_item_request_builder.go b/pkg/github/users/item_packages_with_package_escaped_type_item_request_builder.go new file mode 100644 index 00000000..8bde08ea --- /dev/null +++ b/pkg/github/users/item_packages_with_package_escaped_type_item_request_builder.go @@ -0,0 +1,35 @@ +package users + +import ( + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemPackagesWithPackage_typeItemRequestBuilder builds and executes requests for operations under \users\{username}\packages\{package_type} +type ItemPackagesWithPackage_typeItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ByPackage_name gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.users.item.packages.item.item collection +// returns a *ItemPackagesItemWithPackage_nameItemRequestBuilder when successful +func (m *ItemPackagesWithPackage_typeItemRequestBuilder) ByPackage_name(package_name string)(*ItemPackagesItemWithPackage_nameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if package_name != "" { + urlTplParams["package_name"] = package_name + } + return NewItemPackagesItemWithPackage_nameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewItemPackagesWithPackage_typeItemRequestBuilderInternal instantiates a new ItemPackagesWithPackage_typeItemRequestBuilder and sets the default values. +func NewItemPackagesWithPackage_typeItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesWithPackage_typeItemRequestBuilder) { + m := &ItemPackagesWithPackage_typeItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/packages/{package_type}", pathParameters), + } + return m +} +// NewItemPackagesWithPackage_typeItemRequestBuilder instantiates a new ItemPackagesWithPackage_typeItemRequestBuilder and sets the default values. +func NewItemPackagesWithPackage_typeItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemPackagesWithPackage_typeItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemPackagesWithPackage_typeItemRequestBuilderInternal(urlParams, requestAdapter) +} diff --git a/pkg/github/users/item_projects_request_builder.go b/pkg/github/users/item_projects_request_builder.go new file mode 100644 index 00000000..e4426ecd --- /dev/null +++ b/pkg/github/users/item_projects_request_builder.go @@ -0,0 +1,74 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i7284cd19d6514766979a782c5fd3294efbf54503ed81bcfa19557684dba14b09 "github.com/octokit/go-sdk-enterprise-server/pkg/github/users/item/projects" +) + +// ItemProjectsRequestBuilder builds and executes requests for operations under \users\{username}\projects +type ItemProjectsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemProjectsRequestBuilderGetQueryParameters lists projects for a user. +type ItemProjectsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // Indicates the state of the projects to return. + State *i7284cd19d6514766979a782c5fd3294efbf54503ed81bcfa19557684dba14b09.GetStateQueryParameterType `uriparametername:"state"` +} +// NewItemProjectsRequestBuilderInternal instantiates a new ItemProjectsRequestBuilder and sets the default values. +func NewItemProjectsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsRequestBuilder) { + m := &ItemProjectsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/projects{?page*,per_page*,state*}", pathParameters), + } + return m +} +// NewItemProjectsRequestBuilder instantiates a new ItemProjectsRequestBuilder and sets the default values. +func NewItemProjectsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemProjectsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemProjectsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists projects for a user. +// returns a []Projectable when successful +// returns a ValidationError error when the service returns a 422 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/projects/projects#list-user-projects +func (m *ItemProjectsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemProjectsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "422": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateValidationErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateProjectFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Projectable) + } + } + return val, nil +} +// ToGetRequestInformation lists projects for a user. +// returns a *RequestInformation when successful +func (m *ItemProjectsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemProjectsRequestBuilderGetQueryParameters])(*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 *ItemProjectsRequestBuilder when successful +func (m *ItemProjectsRequestBuilder) WithUrl(rawUrl string)(*ItemProjectsRequestBuilder) { + return NewItemProjectsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_received_escaped_events_public_request_builder.go b/pkg/github/users/item_received_escaped_events_public_request_builder.go new file mode 100644 index 00000000..033e0dca --- /dev/null +++ b/pkg/github/users/item_received_escaped_events_public_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemReceived_eventsPublicRequestBuilder builds and executes requests for operations under \users\{username}\received_events\public +type ItemReceived_eventsPublicRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemReceived_eventsPublicRequestBuilderGetQueryParameters > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +type ItemReceived_eventsPublicRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemReceived_eventsPublicRequestBuilderInternal instantiates a new ItemReceived_eventsPublicRequestBuilder and sets the default values. +func NewItemReceived_eventsPublicRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReceived_eventsPublicRequestBuilder) { + m := &ItemReceived_eventsPublicRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/received_events/public{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemReceived_eventsPublicRequestBuilder instantiates a new ItemReceived_eventsPublicRequestBuilder and sets the default values. +func NewItemReceived_eventsPublicRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReceived_eventsPublicRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemReceived_eventsPublicRequestBuilderInternal(urlParams, requestAdapter) +} +// Get > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a []Eventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/events#list-public-events-received-by-a-user +func (m *ItemReceived_eventsPublicRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReceived_eventsPublicRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable) + } + } + return val, nil +} +// ToGetRequestInformation > [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a *RequestInformation when successful +func (m *ItemReceived_eventsPublicRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReceived_eventsPublicRequestBuilderGetQueryParameters])(*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 *ItemReceived_eventsPublicRequestBuilder when successful +func (m *ItemReceived_eventsPublicRequestBuilder) WithUrl(rawUrl string)(*ItemReceived_eventsPublicRequestBuilder) { + return NewItemReceived_eventsPublicRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_received_escaped_events_request_builder.go b/pkg/github/users/item_received_escaped_events_request_builder.go new file mode 100644 index 00000000..c17551e4 --- /dev/null +++ b/pkg/github/users/item_received_escaped_events_request_builder.go @@ -0,0 +1,72 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemReceived_eventsRequestBuilder builds and executes requests for operations under \users\{username}\received_events +type ItemReceived_eventsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemReceived_eventsRequestBuilderGetQueryParameters these are events that you've received by watching repositories and following users. If you are authenticated as thegiven user, you will see private events. Otherwise, you'll only see public events.> [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +type ItemReceived_eventsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemReceived_eventsRequestBuilderInternal instantiates a new ItemReceived_eventsRequestBuilder and sets the default values. +func NewItemReceived_eventsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReceived_eventsRequestBuilder) { + m := &ItemReceived_eventsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/received_events{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemReceived_eventsRequestBuilder instantiates a new ItemReceived_eventsRequestBuilder and sets the default values. +func NewItemReceived_eventsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReceived_eventsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemReceived_eventsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get these are events that you've received by watching repositories and following users. If you are authenticated as thegiven user, you will see private events. Otherwise, you'll only see public events.> [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a []Eventable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/events#list-events-received-by-the-authenticated-user +func (m *ItemReceived_eventsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReceived_eventsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateEventFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.Eventable) + } + } + return val, nil +} +// Public the public property +// returns a *ItemReceived_eventsPublicRequestBuilder when successful +func (m *ItemReceived_eventsRequestBuilder) Public()(*ItemReceived_eventsPublicRequestBuilder) { + return NewItemReceived_eventsPublicRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation these are events that you've received by watching repositories and following users. If you are authenticated as thegiven user, you will see private events. Otherwise, you'll only see public events.> [!NOTE]> This API is not built to serve real-time use cases. Depending on the time of day, event latency can be anywhere from 30s to 6h. +// returns a *RequestInformation when successful +func (m *ItemReceived_eventsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReceived_eventsRequestBuilderGetQueryParameters])(*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 *ItemReceived_eventsRequestBuilder when successful +func (m *ItemReceived_eventsRequestBuilder) WithUrl(rawUrl string)(*ItemReceived_eventsRequestBuilder) { + return NewItemReceived_eventsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_repos_request_builder.go b/pkg/github/users/item_repos_request_builder.go new file mode 100644 index 00000000..e22656ed --- /dev/null +++ b/pkg/github/users/item_repos_request_builder.go @@ -0,0 +1,74 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" + i7d971b3962b4d33471e6a80c7113395b0a76a2cb149af9becb35ca06739c803e "github.com/octokit/go-sdk-enterprise-server/pkg/github/users/item/repos" +) + +// ItemReposRequestBuilder builds and executes requests for operations under \users\{username}\repos +type ItemReposRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemReposRequestBuilderGetQueryParameters lists public repositories for the specified user. +type ItemReposRequestBuilderGetQueryParameters struct { + // The order to sort by. Default: `asc` when using `full_name`, otherwise `desc`. + Direction *i7d971b3962b4d33471e6a80c7113395b0a76a2cb149af9becb35ca06739c803e.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The property to sort the results by. + Sort *i7d971b3962b4d33471e6a80c7113395b0a76a2cb149af9becb35ca06739c803e.GetSortQueryParameterType `uriparametername:"sort"` + // Limit results to repositories of the specified type. + Type *i7d971b3962b4d33471e6a80c7113395b0a76a2cb149af9becb35ca06739c803e.GetTypeQueryParameterType `uriparametername:"type"` +} +// NewItemReposRequestBuilderInternal instantiates a new ItemReposRequestBuilder and sets the default values. +func NewItemReposRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposRequestBuilder) { + m := &ItemReposRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/repos{?direction*,page*,per_page*,sort*,type*}", pathParameters), + } + return m +} +// NewItemReposRequestBuilder instantiates a new ItemReposRequestBuilder and sets the default values. +func NewItemReposRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemReposRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemReposRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists public repositories for the specified user. +// returns a []MinimalRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/repos/repos#list-repositories-for-a-user +func (m *ItemReposRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReposRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists public repositories for the specified user. +// returns a *RequestInformation when successful +func (m *ItemReposRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemReposRequestBuilderGetQueryParameters])(*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 *ItemReposRequestBuilder when successful +func (m *ItemReposRequestBuilder) WithUrl(rawUrl string)(*ItemReposRequestBuilder) { + return NewItemReposRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_site_escaped_admin_request_builder.go b/pkg/github/users/item_site_escaped_admin_request_builder.go new file mode 100644 index 00000000..c9e7d019 --- /dev/null +++ b/pkg/github/users/item_site_escaped_admin_request_builder.go @@ -0,0 +1,73 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSite_adminRequestBuilder builds and executes requests for operations under \users\{username}\site_admin +type ItemSite_adminRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemSite_adminRequestBuilderInternal instantiates a new ItemSite_adminRequestBuilder and sets the default values. +func NewItemSite_adminRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSite_adminRequestBuilder) { + m := &ItemSite_adminRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/site_admin", pathParameters), + } + return m +} +// NewItemSite_adminRequestBuilder instantiates a new ItemSite_adminRequestBuilder and sets the default values. +func NewItemSite_adminRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSite_adminRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSite_adminRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete you can demote any user account except your own. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#demote-a-site-administrator +func (m *ItemSite_adminRequestBuilder) Delete(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#promote-a-user-to-be-a-site-administrator +func (m *ItemSite_adminRequestBuilder) Put(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation you can demote any user account except your own. +// returns a *RequestInformation when successful +func (m *ItemSite_adminRequestBuilder) 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 note that you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a *RequestInformation when successful +func (m *ItemSite_adminRequestBuilder) ToPutRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemSite_adminRequestBuilder when successful +func (m *ItemSite_adminRequestBuilder) WithUrl(rawUrl string)(*ItemSite_adminRequestBuilder) { + return NewItemSite_adminRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_social_escaped_accounts_request_builder.go b/pkg/github/users/item_social_escaped_accounts_request_builder.go new file mode 100644 index 00000000..4726b082 --- /dev/null +++ b/pkg/github/users/item_social_escaped_accounts_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemSocial_accountsRequestBuilder builds and executes requests for operations under \users\{username}\social_accounts +type ItemSocial_accountsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemSocial_accountsRequestBuilderGetQueryParameters lists social media accounts for a user. This endpoint is accessible by anyone. +type ItemSocial_accountsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemSocial_accountsRequestBuilderInternal instantiates a new ItemSocial_accountsRequestBuilder and sets the default values. +func NewItemSocial_accountsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSocial_accountsRequestBuilder) { + m := &ItemSocial_accountsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/social_accounts{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemSocial_accountsRequestBuilder instantiates a new ItemSocial_accountsRequestBuilder and sets the default values. +func NewItemSocial_accountsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSocial_accountsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSocial_accountsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists social media accounts for a user. This endpoint is accessible by anyone. +// returns a []SocialAccountable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/social-accounts#list-social-accounts-for-a-user +func (m *ItemSocial_accountsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSocial_accountsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SocialAccountable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSocialAccountFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SocialAccountable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SocialAccountable) + } + } + return val, nil +} +// ToGetRequestInformation lists social media accounts for a user. This endpoint is accessible by anyone. +// returns a *RequestInformation when successful +func (m *ItemSocial_accountsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSocial_accountsRequestBuilderGetQueryParameters])(*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 *ItemSocial_accountsRequestBuilder when successful +func (m *ItemSocial_accountsRequestBuilder) WithUrl(rawUrl string)(*ItemSocial_accountsRequestBuilder) { + return NewItemSocial_accountsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_ssh_escaped_signing_escaped_keys_request_builder.go b/pkg/github/users/item_ssh_escaped_signing_escaped_keys_request_builder.go new file mode 100644 index 00000000..228ca2ce --- /dev/null +++ b/pkg/github/users/item_ssh_escaped_signing_escaped_keys_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemSsh_signing_keysRequestBuilder builds and executes requests for operations under \users\{username}\ssh_signing_keys +type ItemSsh_signing_keysRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemSsh_signing_keysRequestBuilderGetQueryParameters lists the SSH signing keys for a user. This operation is accessible by anyone. +type ItemSsh_signing_keysRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemSsh_signing_keysRequestBuilderInternal instantiates a new ItemSsh_signing_keysRequestBuilder and sets the default values. +func NewItemSsh_signing_keysRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSsh_signing_keysRequestBuilder) { + m := &ItemSsh_signing_keysRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/ssh_signing_keys{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemSsh_signing_keysRequestBuilder instantiates a new ItemSsh_signing_keysRequestBuilder and sets the default values. +func NewItemSsh_signing_keysRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSsh_signing_keysRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSsh_signing_keysRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists the SSH signing keys for a user. This operation is accessible by anyone. +// returns a []SshSigningKeyable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/ssh-signing-keys#list-ssh-signing-keys-for-a-user +func (m *ItemSsh_signing_keysRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSsh_signing_keysRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshSigningKeyable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSshSigningKeyFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshSigningKeyable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SshSigningKeyable) + } + } + return val, nil +} +// ToGetRequestInformation lists the SSH signing keys for a user. This operation is accessible by anyone. +// returns a *RequestInformation when successful +func (m *ItemSsh_signing_keysRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSsh_signing_keysRequestBuilderGetQueryParameters])(*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 *ItemSsh_signing_keysRequestBuilder when successful +func (m *ItemSsh_signing_keysRequestBuilder) WithUrl(rawUrl string)(*ItemSsh_signing_keysRequestBuilder) { + return NewItemSsh_signing_keysRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_starred_repository.go b/pkg/github/users/item_starred_repository.go new file mode 100644 index 00000000..4bb84840 --- /dev/null +++ b/pkg/github/users/item_starred_repository.go @@ -0,0 +1,51 @@ +package users + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemStarredRepository struct { + // Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. + additionalData map[string]any +} +// NewItemStarredRepository instantiates a new ItemStarredRepository and sets the default values. +func NewItemStarredRepository()(*ItemStarredRepository) { + m := &ItemStarredRepository{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemStarredRepositoryFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemStarredRepositoryFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemStarredRepository(), 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 *ItemStarredRepository) 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 *ItemStarredRepository) 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 *ItemStarredRepository) 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 *ItemStarredRepository) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +type ItemStarredRepositoryable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable +} diff --git a/pkg/github/users/item_starred_request_builder.go b/pkg/github/users/item_starred_request_builder.go new file mode 100644 index 00000000..a0ef1cbf --- /dev/null +++ b/pkg/github/users/item_starred_request_builder.go @@ -0,0 +1,175 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + id8c8059c3f6c019ab1f02512161b44a25b95a3ab167dd66eee2e52202cb7c4a1 "github.com/octokit/go-sdk-enterprise-server/pkg/github/users/item/starred" +) + +// ItemStarredRequestBuilder builds and executes requests for operations under \users\{username}\starred +type ItemStarredRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemStarredRequestBuilderGetQueryParameters lists repositories a user has starred.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +type ItemStarredRequestBuilderGetQueryParameters struct { + // The direction to sort the results by. + Direction *id8c8059c3f6c019ab1f02512161b44a25b95a3ab167dd66eee2e52202cb7c4a1.GetDirectionQueryParameterType `uriparametername:"direction"` + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // The property to sort the results by. `created` means when the repository was starred. `updated` means when the repository was last pushed to. + Sort *id8c8059c3f6c019ab1f02512161b44a25b95a3ab167dd66eee2e52202cb7c4a1.GetSortQueryParameterType `uriparametername:"sort"` +} +// StarredGetResponse composed type wrapper for classes []ItemStarredRepositoryable, []ItemStarredRepositoryable +type StarredGetResponse struct { + // Composed type representation for type []ItemStarredRepositoryable + itemStarredRepository []ItemStarredRepositoryable + // Composed type representation for type []ItemStarredRepositoryable + starredGetResponseItemStarredRepository []ItemStarredRepositoryable +} +// NewStarredGetResponse instantiates a new StarredGetResponse and sets the default values. +func NewStarredGetResponse()(*StarredGetResponse) { + m := &StarredGetResponse{ + } + return m +} +// CreateStarredGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateStarredGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewStarredGetResponse() + if parseNode != nil { + if val, err := parseNode.GetCollectionOfObjectValues(CreateItemStarredRepositoryFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemStarredRepositoryable, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemStarredRepositoryable) + } + } + result.SetItemStarredRepository(cast) + } else if val, err := parseNode.GetCollectionOfObjectValues(CreateItemStarredRepositoryFromDiscriminatorValue); val != nil { + if err != nil { + return nil, err + } + cast := make([]ItemStarredRepositoryable, len(val)) + for i, v := range val { + if v != nil { + cast[i] = v.(ItemStarredRepositoryable) + } + } + result.SetStarredGetResponseItemStarredRepository(cast) + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *StarredGetResponse) 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 *StarredGetResponse) GetIsComposedType()(bool) { + return true +} +// GetItemStarredRepository gets the ItemStarredRepository property value. Composed type representation for type []ItemStarredRepositoryable +// returns a []ItemStarredRepositoryable when successful +func (m *StarredGetResponse) GetItemStarredRepository()([]ItemStarredRepositoryable) { + return m.itemStarredRepository +} +// GetStarredGetResponseItemStarredRepository gets the ItemStarredRepository property value. Composed type representation for type []ItemStarredRepositoryable +// returns a []ItemStarredRepositoryable when successful +func (m *StarredGetResponse) GetStarredGetResponseItemStarredRepository()([]ItemStarredRepositoryable) { + return m.starredGetResponseItemStarredRepository +} +// Serialize serializes information the current object +func (m *StarredGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetItemStarredRepository() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetItemStarredRepository())) + for i, v := range m.GetItemStarredRepository() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } else if m.GetStarredGetResponseItemStarredRepository() != nil { + cast := make([]i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, len(m.GetStarredGetResponseItemStarredRepository())) + for i, v := range m.GetStarredGetResponseItemStarredRepository() { + if v != nil { + cast[i] = v.(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable) + } + } + err := writer.WriteCollectionOfObjectValues("", cast) + if err != nil { + return err + } + } + return nil +} +// SetItemStarredRepository sets the ItemStarredRepository property value. Composed type representation for type []ItemStarredRepositoryable +func (m *StarredGetResponse) SetItemStarredRepository(value []ItemStarredRepositoryable)() { + m.itemStarredRepository = value +} +// SetStarredGetResponseItemStarredRepository sets the ItemStarredRepository property value. Composed type representation for type []ItemStarredRepositoryable +func (m *StarredGetResponse) SetStarredGetResponseItemStarredRepository(value []ItemStarredRepositoryable)() { + m.starredGetResponseItemStarredRepository = value +} +type StarredGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetItemStarredRepository()([]ItemStarredRepositoryable) + GetStarredGetResponseItemStarredRepository()([]ItemStarredRepositoryable) + SetItemStarredRepository(value []ItemStarredRepositoryable)() + SetStarredGetResponseItemStarredRepository(value []ItemStarredRepositoryable)() +} +// NewItemStarredRequestBuilderInternal instantiates a new ItemStarredRequestBuilder and sets the default values. +func NewItemStarredRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemStarredRequestBuilder) { + m := &ItemStarredRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/starred{?direction*,page*,per_page*,sort*}", pathParameters), + } + return m +} +// NewItemStarredRequestBuilder instantiates a new ItemStarredRequestBuilder and sets the default values. +func NewItemStarredRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemStarredRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemStarredRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repositories a user has starred.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +// returns a StarredGetResponseable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/starring#list-repositories-starred-by-a-user +func (m *ItemStarredRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemStarredRequestBuilderGetQueryParameters])(StarredGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateStarredGetResponseFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(StarredGetResponseable), nil +} +// ToGetRequestInformation lists repositories a user has starred.This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."- **`application/vnd.github.star+json`**: Includes a timestamp of when the star was created. +// returns a *RequestInformation when successful +func (m *ItemStarredRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemStarredRequestBuilderGetQueryParameters])(*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 *ItemStarredRequestBuilder when successful +func (m *ItemStarredRequestBuilder) WithUrl(rawUrl string)(*ItemStarredRequestBuilder) { + return NewItemStarredRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_subscriptions_request_builder.go b/pkg/github/users/item_subscriptions_request_builder.go new file mode 100644 index 00000000..f9579064 --- /dev/null +++ b/pkg/github/users/item_subscriptions_request_builder.go @@ -0,0 +1,67 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// ItemSubscriptionsRequestBuilder builds and executes requests for operations under \users\{username}\subscriptions +type ItemSubscriptionsRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// ItemSubscriptionsRequestBuilderGetQueryParameters lists repositories a user is watching. +type ItemSubscriptionsRequestBuilderGetQueryParameters struct { + // The page number of the results to fetch. For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/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/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` +} +// NewItemSubscriptionsRequestBuilderInternal instantiates a new ItemSubscriptionsRequestBuilder and sets the default values. +func NewItemSubscriptionsRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSubscriptionsRequestBuilder) { + m := &ItemSubscriptionsRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/subscriptions{?page*,per_page*}", pathParameters), + } + return m +} +// NewItemSubscriptionsRequestBuilder instantiates a new ItemSubscriptionsRequestBuilder and sets the default values. +func NewItemSubscriptionsRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSubscriptionsRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSubscriptionsRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists repositories a user is watching. +// returns a []MinimalRepositoryable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/activity/watching#list-repositories-watched-by-a-user +func (m *ItemSubscriptionsRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSubscriptionsRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateMinimalRepositoryFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.MinimalRepositoryable) + } + } + return val, nil +} +// ToGetRequestInformation lists repositories a user is watching. +// returns a *RequestInformation when successful +func (m *ItemSubscriptionsRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[ItemSubscriptionsRequestBuilderGetQueryParameters])(*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 *ItemSubscriptionsRequestBuilder when successful +func (m *ItemSubscriptionsRequestBuilder) WithUrl(rawUrl string)(*ItemSubscriptionsRequestBuilder) { + return NewItemSubscriptionsRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/item_suspended_delete_request_body.go b/pkg/github/users/item_suspended_delete_request_body.go new file mode 100644 index 00000000..d0e23d14 --- /dev/null +++ b/pkg/github/users/item_suspended_delete_request_body.go @@ -0,0 +1,80 @@ +package users + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemSuspendedDeleteRequestBody 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 reason the user is being unsuspended. This message will be logged in the [audit log](https://docs.github.com/enterprise-server@3.14/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/about-the-audit-log-for-your-enterprise). If you don't provide a `reason`, it will default to "Unsuspended via API by _SITE\_ADMINISTRATOR_", where _SITE\_ADMINISTRATOR_ is the person who performed the action. + reason *string +} +// NewItemSuspendedDeleteRequestBody instantiates a new ItemSuspendedDeleteRequestBody and sets the default values. +func NewItemSuspendedDeleteRequestBody()(*ItemSuspendedDeleteRequestBody) { + m := &ItemSuspendedDeleteRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemSuspendedDeleteRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemSuspendedDeleteRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemSuspendedDeleteRequestBody(), 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 *ItemSuspendedDeleteRequestBody) 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 *ItemSuspendedDeleteRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + return res +} +// GetReason gets the reason property value. The reason the user is being unsuspended. This message will be logged in the [audit log](https://docs.github.com/enterprise-server@3.14/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/about-the-audit-log-for-your-enterprise). If you don't provide a `reason`, it will default to "Unsuspended via API by _SITE\_ADMINISTRATOR_", where _SITE\_ADMINISTRATOR_ is the person who performed the action. +// returns a *string when successful +func (m *ItemSuspendedDeleteRequestBody) GetReason()(*string) { + return m.reason +} +// Serialize serializes information the current object +func (m *ItemSuspendedDeleteRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("reason", m.GetReason()) + 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 *ItemSuspendedDeleteRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetReason sets the reason property value. The reason the user is being unsuspended. This message will be logged in the [audit log](https://docs.github.com/enterprise-server@3.14/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/about-the-audit-log-for-your-enterprise). If you don't provide a `reason`, it will default to "Unsuspended via API by _SITE\_ADMINISTRATOR_", where _SITE\_ADMINISTRATOR_ is the person who performed the action. +func (m *ItemSuspendedDeleteRequestBody) SetReason(value *string)() { + m.reason = value +} +type ItemSuspendedDeleteRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetReason()(*string) + SetReason(value *string)() +} diff --git a/pkg/github/users/item_suspended_put_request_body.go b/pkg/github/users/item_suspended_put_request_body.go new file mode 100644 index 00000000..6cb19bd5 --- /dev/null +++ b/pkg/github/users/item_suspended_put_request_body.go @@ -0,0 +1,80 @@ +package users + +import ( + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" +) + +type ItemSuspendedPutRequestBody 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 reason the user is being suspended. This message will be logged in the [audit log](https://docs.github.com/enterprise-server@3.14/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/about-the-audit-log-for-your-enterprise). If you don't provide a `reason`, it will default to "Suspended via API by _SITE\_ADMINISTRATOR_", where _SITE\_ADMINISTRATOR_ is the person who performed the action. + reason *string +} +// NewItemSuspendedPutRequestBody instantiates a new ItemSuspendedPutRequestBody and sets the default values. +func NewItemSuspendedPutRequestBody()(*ItemSuspendedPutRequestBody) { + m := &ItemSuspendedPutRequestBody{ + } + m.SetAdditionalData(make(map[string]any)) + return m +} +// CreateItemSuspendedPutRequestBodyFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateItemSuspendedPutRequestBodyFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + return NewItemSuspendedPutRequestBody(), 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 *ItemSuspendedPutRequestBody) 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 *ItemSuspendedPutRequestBody) GetFieldDeserializers()(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) { + res := make(map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error)) + res["reason"] = func (n i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode) error { + val, err := n.GetStringValue() + if err != nil { + return err + } + if val != nil { + m.SetReason(val) + } + return nil + } + return res +} +// GetReason gets the reason property value. The reason the user is being suspended. This message will be logged in the [audit log](https://docs.github.com/enterprise-server@3.14/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/about-the-audit-log-for-your-enterprise). If you don't provide a `reason`, it will default to "Suspended via API by _SITE\_ADMINISTRATOR_", where _SITE\_ADMINISTRATOR_ is the person who performed the action. +// returns a *string when successful +func (m *ItemSuspendedPutRequestBody) GetReason()(*string) { + return m.reason +} +// Serialize serializes information the current object +func (m *ItemSuspendedPutRequestBody) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + { + err := writer.WriteStringValue("reason", m.GetReason()) + 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 *ItemSuspendedPutRequestBody) SetAdditionalData(value map[string]any)() { + m.additionalData = value +} +// SetReason sets the reason property value. The reason the user is being suspended. This message will be logged in the [audit log](https://docs.github.com/enterprise-server@3.14/admin/monitoring-activity-in-your-enterprise/reviewing-audit-logs-for-your-enterprise/about-the-audit-log-for-your-enterprise). If you don't provide a `reason`, it will default to "Suspended via API by _SITE\_ADMINISTRATOR_", where _SITE\_ADMINISTRATOR_ is the person who performed the action. +func (m *ItemSuspendedPutRequestBody) SetReason(value *string)() { + m.reason = value +} +type ItemSuspendedPutRequestBodyable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.AdditionalDataHolder + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetReason()(*string) + SetReason(value *string)() +} diff --git a/pkg/github/users/item_suspended_request_builder.go b/pkg/github/users/item_suspended_request_builder.go new file mode 100644 index 00000000..ed9d7b38 --- /dev/null +++ b/pkg/github/users/item_suspended_request_builder.go @@ -0,0 +1,81 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ItemSuspendedRequestBuilder builds and executes requests for operations under \users\{username}\suspended +type ItemSuspendedRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewItemSuspendedRequestBuilderInternal instantiates a new ItemSuspendedRequestBuilder and sets the default values. +func NewItemSuspendedRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSuspendedRequestBuilder) { + m := &ItemSuspendedRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}/suspended", pathParameters), + } + return m +} +// NewItemSuspendedRequestBuilder instantiates a new ItemSuspendedRequestBuilder and sets the default values. +func NewItemSuspendedRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ItemSuspendedRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewItemSuspendedRequestBuilderInternal(urlParams, requestAdapter) +} +// Delete if your GitHub instance uses [LDAP Sync with Active Directory LDAP servers](https://docs.github.com/enterprise-server@3.14/admin/identity-and-access-management/using-ldap-for-enterprise-iam/using-ldap), this API is disabled and will return a `403` response. Active Directory LDAP-authenticated users cannot be unsuspended using the API. +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#unsuspend-a-user +func (m *ItemSuspendedRequestBuilder) Delete(ctx context.Context, body ItemSuspendedDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToDeleteRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// Put if your GitHub instance uses [LDAP Sync with Active Directory LDAP servers](https://docs.github.com/enterprise-server@3.14/admin/identity-and-access-management/using-ldap-for-enterprise-iam/using-ldap), Active Directory LDAP-authenticated users cannot be suspended through this API. If you attempt to suspend an Active Directory LDAP-authenticated user through this API, it will return a `403` response.You can suspend any user account except your own.Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/enterprise-admin/users#suspend-a-user +func (m *ItemSuspendedRequestBuilder) Put(ctx context.Context, body ItemSuspendedPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(error) { + requestInfo, err := m.ToPutRequestInformation(ctx, body, requestConfiguration); + if err != nil { + return err + } + err = m.BaseRequestBuilder.RequestAdapter.SendNoContent(ctx, requestInfo, nil) + if err != nil { + return err + } + return nil +} +// ToDeleteRequestInformation if your GitHub instance uses [LDAP Sync with Active Directory LDAP servers](https://docs.github.com/enterprise-server@3.14/admin/identity-and-access-management/using-ldap-for-enterprise-iam/using-ldap), this API is disabled and will return a `403` response. Active Directory LDAP-authenticated users cannot be unsuspended using the API. +// returns a *RequestInformation when successful +func (m *ItemSuspendedRequestBuilder) ToDeleteRequestInformation(ctx context.Context, body ItemSuspendedDeleteRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DELETE, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + err := requestInfo.SetContentFromParsable(ctx, m.BaseRequestBuilder.RequestAdapter, "application/json", body) + if err != nil { + return nil, err + } + return requestInfo, nil +} +// ToPutRequestInformation if your GitHub instance uses [LDAP Sync with Active Directory LDAP servers](https://docs.github.com/enterprise-server@3.14/admin/identity-and-access-management/using-ldap-for-enterprise-iam/using-ldap), Active Directory LDAP-authenticated users cannot be suspended through this API. If you attempt to suspend an Active Directory LDAP-authenticated user through this API, it will return a `403` response.You can suspend any user account except your own.Note that, if you choose not to pass any parameters, you'll need to set `Content-Length` to zero when calling out to this endpoint. For more information, see "[HTTP method](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#http-method)." +// returns a *RequestInformation when successful +func (m *ItemSuspendedRequestBuilder) ToPutRequestInformation(ctx context.Context, body ItemSuspendedPutRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) { + requestInfo := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewRequestInformationWithMethodAndUrlTemplateAndPathParameters(i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.PUT, m.BaseRequestBuilder.UrlTemplate, m.BaseRequestBuilder.PathParameters) + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ConfigureRequestInformation(requestInfo, requestConfiguration) + 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 *ItemSuspendedRequestBuilder when successful +func (m *ItemSuspendedRequestBuilder) WithUrl(rawUrl string)(*ItemSuspendedRequestBuilder) { + return NewItemSuspendedRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/users_request_builder.go b/pkg/github/users/users_request_builder.go new file mode 100644 index 00000000..2e89c910 --- /dev/null +++ b/pkg/github/users/users_request_builder.go @@ -0,0 +1,79 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// UsersRequestBuilder builds and executes requests for operations under \users +type UsersRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// UsersRequestBuilderGetQueryParameters lists all users, in the order that they signed up on GitHub Enterprise Server. This list includes personal user accounts and organization accounts.Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of users. +type UsersRequestBuilderGetQueryParameters struct { + // The number of results per page (max 100). For more information, see "[Using pagination in the REST API](https://docs.github.com/enterprise-server@3.14/rest/using-the-rest-api/using-pagination-in-the-rest-api)." + Per_page *int32 `uriparametername:"per_page"` + // A user ID. Only return users with an ID greater than this ID. + Since *int32 `uriparametername:"since"` +} +// ByUsername gets an item from the github.com/octokit/go-sdk-enterprise-server/pkg/github.users.item collection +// returns a *WithUsernameItemRequestBuilder when successful +func (m *UsersRequestBuilder) ByUsername(username string)(*WithUsernameItemRequestBuilder) { + urlTplParams := make(map[string]string) + for idx, item := range m.BaseRequestBuilder.PathParameters { + urlTplParams[idx] = item + } + if username != "" { + urlTplParams["username"] = username + } + return NewWithUsernameItemRequestBuilderInternal(urlTplParams, m.BaseRequestBuilder.RequestAdapter) +} +// NewUsersRequestBuilderInternal instantiates a new UsersRequestBuilder and sets the default values. +func NewUsersRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UsersRequestBuilder) { + m := &UsersRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users{?per_page*,since*}", pathParameters), + } + return m +} +// NewUsersRequestBuilder instantiates a new UsersRequestBuilder and sets the default values. +func NewUsersRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*UsersRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewUsersRequestBuilderInternal(urlParams, requestAdapter) +} +// Get lists all users, in the order that they signed up on GitHub Enterprise Server. This list includes personal user accounts and organization accounts.Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of users. +// returns a []SimpleUserable when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/users#list-users +func (m *UsersRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[UsersRequestBuilderGetQueryParameters])([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendCollection(ctx, requestInfo, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateSimpleUserFromDiscriminatorValue, nil) + if err != nil { + return nil, err + } + val := make([]ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable, len(res)) + for i, v := range res { + if v != nil { + val[i] = v.(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.SimpleUserable) + } + } + return val, nil +} +// ToGetRequestInformation lists all users, in the order that they signed up on GitHub Enterprise Server. This list includes personal user accounts and organization accounts.Note: Pagination is powered exclusively by the `since` parameter. Use the [Link header](https://docs.github.com/enterprise-server@3.14/rest/guides/using-pagination-in-the-rest-api#using-link-headers) to get the URL for the next page of users. +// returns a *RequestInformation when successful +func (m *UsersRequestBuilder) ToGetRequestInformation(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[UsersRequestBuilderGetQueryParameters])(*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 *UsersRequestBuilder when successful +func (m *UsersRequestBuilder) WithUrl(rawUrl string)(*UsersRequestBuilder) { + return NewUsersRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/users/with_username_item_request_builder.go b/pkg/github/users/with_username_item_request_builder.go new file mode 100644 index 00000000..e63db0d7 --- /dev/null +++ b/pkg/github/users/with_username_item_request_builder.go @@ -0,0 +1,245 @@ +package users + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization" + ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207 "github.com/octokit/go-sdk-enterprise-server/pkg/github/models" +) + +// WithUsernameItemRequestBuilder builds and executes requests for operations under \users\{username} +type WithUsernameItemRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// WithUsernameGetResponse composed type wrapper for classes ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable, ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable +type WithUsernameGetResponse struct { + // Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable + privateUser ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable + // Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable + publicUser ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable +} +// NewWithUsernameGetResponse instantiates a new WithUsernameGetResponse and sets the default values. +func NewWithUsernameGetResponse()(*WithUsernameGetResponse) { + m := &WithUsernameGetResponse{ + } + return m +} +// CreateWithUsernameGetResponseFromDiscriminatorValue creates a new instance of the appropriate class based on discriminator value +// returns a Parsable when successful +func CreateWithUsernameGetResponseFromDiscriminatorValue(parseNode i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable, error) { + result := NewWithUsernameGetResponse() + 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 { + } + } + } + return result, nil +} +// GetFieldDeserializers the deserialization information for the current model +// returns a map[string]func(i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.ParseNode)(error) when successful +func (m *WithUsernameGetResponse) 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 *WithUsernameGetResponse) GetIsComposedType()(bool) { + return true +} +// GetPrivateUser gets the privateUser property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable +// returns a PrivateUserable when successful +func (m *WithUsernameGetResponse) GetPrivateUser()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable) { + return m.privateUser +} +// GetPublicUser gets the publicUser property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable +// returns a PublicUserable when successful +func (m *WithUsernameGetResponse) GetPublicUser()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable) { + return m.publicUser +} +// Serialize serializes information the current object +func (m *WithUsernameGetResponse) Serialize(writer i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.SerializationWriter)(error) { + if m.GetPrivateUser() != nil { + err := writer.WriteObjectValue("", m.GetPrivateUser()) + if err != nil { + return err + } + } else if m.GetPublicUser() != nil { + err := writer.WriteObjectValue("", m.GetPublicUser()) + if err != nil { + return err + } + } + return nil +} +// SetPrivateUser sets the privateUser property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable +func (m *WithUsernameGetResponse) SetPrivateUser(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable)() { + m.privateUser = value +} +// SetPublicUser sets the publicUser property value. Composed type representation for type ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable +func (m *WithUsernameGetResponse) SetPublicUser(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable)() { + m.publicUser = value +} +type WithUsernameGetResponseable interface { + i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91.Parsable + GetPrivateUser()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable) + GetPublicUser()(ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable) + SetPrivateUser(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PrivateUserable)() + SetPublicUser(value ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.PublicUserable)() +} +// NewWithUsernameItemRequestBuilderInternal instantiates a new WithUsernameItemRequestBuilder and sets the default values. +func NewWithUsernameItemRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithUsernameItemRequestBuilder) { + m := &WithUsernameItemRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/users/{username}", pathParameters), + } + return m +} +// NewWithUsernameItemRequestBuilder instantiates a new WithUsernameItemRequestBuilder and sets the default values. +func NewWithUsernameItemRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*WithUsernameItemRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewWithUsernameItemRequestBuilderInternal(urlParams, requestAdapter) +} +// Docker the docker property +// returns a *ItemDockerRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Docker()(*ItemDockerRequestBuilder) { + return NewItemDockerRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Events the events property +// returns a *ItemEventsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Events()(*ItemEventsRequestBuilder) { + return NewItemEventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Followers the followers property +// returns a *ItemFollowersRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Followers()(*ItemFollowersRequestBuilder) { + return NewItemFollowersRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Following the following property +// returns a *ItemFollowingRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Following()(*ItemFollowingRequestBuilder) { + return NewItemFollowingRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Get provides publicly available information about someone with a GitHub account.The `email` key in the following response is the publicly visible email address from your GitHub Enterprise Server [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub Enterprise Server. For more information, see [Authentication](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#authentication).The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/enterprise-server@3.14/rest/users/emails)". +// returns a WithUsernameGetResponseable when successful +// returns a BasicError error when the service returns a 404 status code +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/users/users#get-a-user +func (m *WithUsernameItemRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(WithUsernameGetResponseable, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + errorMapping := i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.ErrorMappings { + "404": ie1e2072a5a4eb80f74a1387d59644d3f70804e6b7b2f406016da8826571f1207.CreateBasicErrorFromDiscriminatorValue, + } + res, err := m.BaseRequestBuilder.RequestAdapter.Send(ctx, requestInfo, CreateWithUsernameGetResponseFromDiscriminatorValue, errorMapping) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(WithUsernameGetResponseable), nil +} +// Gists the gists property +// returns a *ItemGistsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Gists()(*ItemGistsRequestBuilder) { + return NewItemGistsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Gpg_keys the gpg_keys property +// returns a *ItemGpg_keysRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Gpg_keys()(*ItemGpg_keysRequestBuilder) { + return NewItemGpg_keysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Hovercard the hovercard property +// returns a *ItemHovercardRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Hovercard()(*ItemHovercardRequestBuilder) { + return NewItemHovercardRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Installation the installation property +// returns a *ItemInstallationRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Installation()(*ItemInstallationRequestBuilder) { + return NewItemInstallationRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Keys the keys property +// returns a *ItemKeysRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Keys()(*ItemKeysRequestBuilder) { + return NewItemKeysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Orgs the orgs property +// returns a *ItemOrgsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Orgs()(*ItemOrgsRequestBuilder) { + return NewItemOrgsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Packages the packages property +// returns a *ItemPackagesRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Packages()(*ItemPackagesRequestBuilder) { + return NewItemPackagesRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Projects the projects property +// returns a *ItemProjectsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Projects()(*ItemProjectsRequestBuilder) { + return NewItemProjectsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Received_events the received_events property +// returns a *ItemReceived_eventsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Received_events()(*ItemReceived_eventsRequestBuilder) { + return NewItemReceived_eventsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Repos the repos property +// returns a *ItemReposRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Repos()(*ItemReposRequestBuilder) { + return NewItemReposRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Site_admin the site_admin property +// returns a *ItemSite_adminRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Site_admin()(*ItemSite_adminRequestBuilder) { + return NewItemSite_adminRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Social_accounts the social_accounts property +// returns a *ItemSocial_accountsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Social_accounts()(*ItemSocial_accountsRequestBuilder) { + return NewItemSocial_accountsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Ssh_signing_keys the ssh_signing_keys property +// returns a *ItemSsh_signing_keysRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Ssh_signing_keys()(*ItemSsh_signing_keysRequestBuilder) { + return NewItemSsh_signing_keysRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Starred the starred property +// returns a *ItemStarredRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Starred()(*ItemStarredRequestBuilder) { + return NewItemStarredRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Subscriptions the subscriptions property +// returns a *ItemSubscriptionsRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Subscriptions()(*ItemSubscriptionsRequestBuilder) { + return NewItemSubscriptionsRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// Suspended the suspended property +// returns a *ItemSuspendedRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) Suspended()(*ItemSuspendedRequestBuilder) { + return NewItemSuspendedRequestBuilderInternal(m.BaseRequestBuilder.PathParameters, m.BaseRequestBuilder.RequestAdapter) +} +// ToGetRequestInformation provides publicly available information about someone with a GitHub account.The `email` key in the following response is the publicly visible email address from your GitHub Enterprise Server [profile page](https://github.com/settings/profile). When setting up your profile, you can select a primary email address to be “public” which provides an email entry for this endpoint. If you do not set a public email address for `email`, then it will have a value of `null`. You only see publicly visible email addresses when authenticated with GitHub Enterprise Server. For more information, see [Authentication](https://docs.github.com/enterprise-server@3.14/rest/guides/getting-started-with-the-rest-api#authentication).The Emails API enables you to list all of your email addresses, and toggle a primary email to be visible publicly. For more information, see "[Emails API](https://docs.github.com/enterprise-server@3.14/rest/users/emails)". +// returns a *RequestInformation when successful +func (m *WithUsernameItemRequestBuilder) 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 *WithUsernameItemRequestBuilder when successful +func (m *WithUsernameItemRequestBuilder) WithUrl(rawUrl string)(*WithUsernameItemRequestBuilder) { + return NewWithUsernameItemRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/github/zen/zen_request_builder.go b/pkg/github/zen/zen_request_builder.go new file mode 100644 index 00000000..c5afc22d --- /dev/null +++ b/pkg/github/zen/zen_request_builder.go @@ -0,0 +1,56 @@ +package zen + +import ( + "context" + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f "github.com/microsoft/kiota-abstractions-go" +) + +// ZenRequestBuilder builds and executes requests for operations under \zen +type ZenRequestBuilder struct { + i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.BaseRequestBuilder +} +// NewZenRequestBuilderInternal instantiates a new ZenRequestBuilder and sets the default values. +func NewZenRequestBuilderInternal(pathParameters map[string]string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ZenRequestBuilder) { + m := &ZenRequestBuilder{ + BaseRequestBuilder: *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.NewBaseRequestBuilder(requestAdapter, "{+baseurl}/zen", pathParameters), + } + return m +} +// NewZenRequestBuilder instantiates a new ZenRequestBuilder and sets the default values. +func NewZenRequestBuilder(rawUrl string, requestAdapter i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestAdapter)(*ZenRequestBuilder) { + urlParams := make(map[string]string) + urlParams["request-raw-url"] = rawUrl + return NewZenRequestBuilderInternal(urlParams, requestAdapter) +} +// Get get a random sentence from the Zen of GitHub +// returns a *string when successful +// [API method documentation] +// +// [API method documentation]: https://docs.github.com/enterprise-server@3.14/rest/meta/meta#get-the-zen-of-github +func (m *ZenRequestBuilder) Get(ctx context.Context, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*string, error) { + requestInfo, err := m.ToGetRequestInformation(ctx, requestConfiguration); + if err != nil { + return nil, err + } + res, err := m.BaseRequestBuilder.RequestAdapter.SendPrimitive(ctx, requestInfo, "string", nil) + if err != nil { + return nil, err + } + if res == nil { + return nil, nil + } + return res.(*string), nil +} +// ToGetRequestInformation get a random sentence from the Zen of GitHub +// returns a *RequestInformation when successful +func (m *ZenRequestBuilder) 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 *ZenRequestBuilder when successful +func (m *ZenRequestBuilder) WithUrl(rawUrl string)(*ZenRequestBuilder) { + return NewZenRequestBuilder(rawUrl, m.BaseRequestBuilder.RequestAdapter); +} diff --git a/pkg/handlers/rate_limit_handler.go b/pkg/handlers/rate_limit_handler.go new file mode 100644 index 00000000..8122746a --- /dev/null +++ b/pkg/handlers/rate_limit_handler.go @@ -0,0 +1,177 @@ +package handlers + +import ( + "context" + "fmt" + "log" + netHttp "net/http" + "strconv" + "time" + + abs "github.com/microsoft/kiota-abstractions-go" + kiotaHttp "github.com/microsoft/kiota-http-go" + "github.com/octokit/go-sdk-enterprise-server/pkg/headers" +) + +// RateLimitHandler is a middleware that detects primary and secondary rate +// limits and retries requests after the appropriate time when necessary. +type RateLimitHandler struct { + options RateLimitHandlerOptions +} + +// RateLimitHandlerOptions is a struct that holds options for the RateLimitHandler. +// In the future, this could hold different strategies for handling rate limits: +// e.g. exponential backoff, jitter, throttling, etc. +type RateLimitHandlerOptions struct{} + +// rateLimitHandlerOptions (lowercase, private) that RateLimitHandlerOptions +// (uppercase, public) implements. +type rateLimitHandlerOptions interface { + abs.RequestOption + IsRateLimited() func(req *netHttp.Request, res *netHttp.Response) RateLimitType +} + +// RateLimitType is an enum that represents either None, Primary, +// or Secondary rate limiting +type RateLimitType int + +const ( + None RateLimitType = iota + Primary + Secondary +) + +var rateLimitKeyValue = abs.RequestOptionKey{ + Key: "RateLimitHandler", +} + +// GetKey returns the unique RateLimitHandler key, used by Kiota to store +// request options. +func (options *RateLimitHandlerOptions) GetKey() abs.RequestOptionKey { + return rateLimitKeyValue +} + +// IsRateLimited returns a function that determines if an HTTP response was +// rate-limited, and if so, what type of rate limit was hit. +func (options *RateLimitHandlerOptions) IsRateLimited() func(req *netHttp.Request, resp *netHttp.Response) RateLimitType { + return func(req *netHttp.Request, resp *netHttp.Response) RateLimitType { + if resp.StatusCode != 429 && resp.StatusCode != 403 { + return None + } + + if resp.Header.Get(headers.RetryAfterKey) != "" { + return Secondary // secondary rate limits are abuse limits + } + + if resp.Header.Get(headers.XRateLimitRemainingKey) == "0" { + return Primary + } + + return None + } +} + +// NewRateLimitHandler creates a new RateLimitHandler with default options. +func NewRateLimitHandler() *RateLimitHandler { + return &RateLimitHandler{} +} + +// Intercept tries a request. If the response shows it was rate-limited, it +// retries the request after the appropriate period of time. +func (handler RateLimitHandler) Intercept(pipeline kiotaHttp.Pipeline, middlewareIndex int, request *netHttp.Request) (*netHttp.Response, error) { + resp, err := pipeline.Next(request, middlewareIndex) + if err != nil { + return resp, err + } + + rateLimit := handler.options.IsRateLimited()(request, resp) + + if rateLimit == Primary || rateLimit == Secondary { + reqOption, ok := request.Context().Value(rateLimitKeyValue).(rateLimitHandlerOptions) + if !ok { + reqOption = &handler.options + } + return handler.retryRequest(request.Context(), pipeline, middlewareIndex, reqOption, rateLimit, request, resp) + } + return resp, nil +} + +// retryRequest retries a request if it has been rate-limited. +func (handler RateLimitHandler) retryRequest(ctx context.Context, pipeline kiotaHttp.Pipeline, middlewareIndex int, + options rateLimitHandlerOptions, rateLimitType RateLimitType, request *netHttp.Request, resp *netHttp.Response) (*netHttp.Response, error) { + + if rateLimitType == Secondary || rateLimitType == Primary { + retryAfterDuration, err := parseRateLimit(resp) + if err != nil { + return nil, fmt.Errorf("failed to parse retry-after header into duration: %v", err) + } + if *retryAfterDuration < 0 { + log.Printf("retry-after duration is negative: %s; sleeping until next request will be a no-op", *retryAfterDuration) + } + if rateLimitType == Secondary { + log.Printf("Abuse detection mechanism (secondary rate limit) triggered, sleeping for %s before retrying\n", *retryAfterDuration) + } else if rateLimitType == Primary { + log.Printf("Primary rate limit (reset: %s) reached, sleeping for %s before retrying\n", resp.Header.Get(headers.XRateLimitResetKey), *retryAfterDuration) + log.Printf("Rate limit information: %s: %s, %s: %s, %s: %s\n", headers.XRateLimitLimitKey, resp.Header.Get(headers.XRateLimitLimitKey), headers.XRateLimitUsedKey, resp.Header.Get(headers.XRateLimitUsedKey), headers.XRateLimitResourceKey, resp.Header.Get(headers.XRateLimitResourceKey)) + } + time.Sleep(*retryAfterDuration) + log.Printf("Retrying request after rate limit sleep\n") + return handler.Intercept(pipeline, middlewareIndex, request) + } + + return handler.retryRequest(ctx, pipeline, middlewareIndex, options, rateLimitType, request, resp) +} + +// parseRateLimit parses rate-limit related headers and returns an appropriate +// time.Duration to retry the request after based on the header information. +// Much of this code was taken from the google/go-github library: +// see https://github.com/google/go-github/blob/0e3ab5807f0e9bc6ea690f1b49e94b78259f3681/github/github.go +// Note that "Retry-After" headers correspond to secondary rate limits and +// "x-ratelimit-reset" headers to primary rate limits. +// Docs for rate limit headers: +// https://docs.github.com/en/rest/using-the-rest-api/best-practices-for-using-the-rest-api?apiVersion=2022-11-28#handle-rate-limit-errors-appropriately +func parseRateLimit(r *netHttp.Response) (*time.Duration, error) { + + // "If the retry-after response header is present, you should not retry + // your request until after that many seconds has elapsed." + // (see docs link above) + if v := r.Header.Get(headers.RetryAfterKey); v != "" { + return parseRetryAfter(v) + } + + // "If the x-ratelimit-remaining header is 0, you should not make another + // request until after the time specified by the x-ratelimit-reset + // header. The x-ratelimit-reset header is in UTC epoch seconds."" + // (see docs link above) + if v := r.Header.Get(headers.XRateLimitResetKey); v != "" { + return parseXRateLimitReset(v) + } + + return nil, nil +} + +// parseRetryAfter parses the "Retry-After" header used for secondary +// rate limits. +func parseRetryAfter(retryAfterValue string) (*time.Duration, error) { + if retryAfterValue == "" { + return nil, fmt.Errorf("could not parse emtpy RetryAfter string") + } + + retryAfterSeconds, err := strconv.ParseInt(retryAfterValue, 10, 64) + if err != nil { + return nil, fmt.Errorf("failed to parse retry-after header into duration: %v", err) + } + retryAfter := time.Duration(retryAfterSeconds) * time.Second + return &retryAfter, nil +} + +// parseXRateLimitReset parses the "x-ratelimit-reset" header used for primary +// rate limits +func parseXRateLimitReset(rateLimitResetValue string) (*time.Duration, error) { + secondsSinceEpoch, err := strconv.ParseInt(rateLimitResetValue, 10, 64) + if err != nil { + return nil, fmt.Errorf("failed to parse x-ratelimit-reset header into duration: %v", err) + } + retryAfter := time.Until(time.Unix(secondsSinceEpoch, 0)) + return &retryAfter, nil +} diff --git a/pkg/handlers/rate_limit_handler_test.go b/pkg/handlers/rate_limit_handler_test.go new file mode 100644 index 00000000..85fab57f --- /dev/null +++ b/pkg/handlers/rate_limit_handler_test.go @@ -0,0 +1,463 @@ +package handlers + +import ( + "encoding/json" + "fmt" + "net/http" + "net/http/httptest" + "sync" + "testing" + "time" + + "github.com/octokit/go-sdk-enterprise-server/pkg/headers" +) + +// NoopPipeline code for testing taken from our colleagues at Kiota: +// see https://github.com/microsoft/kiota-http-go/blob/main/retry_handler_test.go#L15-L26 +// for the original source. +type NoopPipeline struct { + client *http.Client +} + +func (pipeline *NoopPipeline) Next(req *http.Request, middlewareIndex int) (*http.Response, error) { + return pipeline.client.Do(req) +} + +func newNoopPipeline() *NoopPipeline { + return &NoopPipeline{ + client: getDefaultClientWithoutMiddleware(), + } +} + +// used for internal unit testing +func getDefaultClientWithoutMiddleware() *http.Client { + // the default client doesn't come with any other settings than making a new one does, and using the default client impacts behavior for non-kiota requests + return &http.Client{ + CheckRedirect: func(req *http.Request, via []*http.Request) error { + return http.ErrUseLastResponse + }, + Timeout: time.Second * 100, + } +} + +// paired with 200 status code +var happyPathTestHeaders = `{ + "Access-Control-Allow-Origin": [ + "*" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Cache-Control": [ + "private, max-age=60, s-maxage=60" + ], + "Connection": [ + "keep-alive" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Date": [ + "Thu, 28 Mar 2024 20:20:55 GMT" + ], + "Etag": [ + "W/\"513ca5822992932a02050bbecb8c58a75cc211fb7ef0d597b6a3119c9fb45e94\"" + ], + "Github-Authentication-Token-Expiration": [ + "2024-04-27 20:14:21 UTC" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Server": [ + "nginx/1.18.0 (Ubuntu)" + ], + "Vary": [ + "Accept, Authorization, Cookie, X-GitHub-OTP", + "Accept, X-Requested-With" + ], + "X-Accepted-Oauth-Scopes": [ + "" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Github-Api-Version-Selected": [ + "2022-11-28" + ], + "X-Github-Media-Type": [ + "github.v3" + ], + "X-Github-Request-Id": [ + "488c61a3-2ad6-4182-a16e-299d4cbd5c3c" + ], + "X-Github-Sso": [ + "partial-results; organizations=136,137,138" + ], + "X-Glb-Log-Append": [ + "rails_request_category=api rails_method=get rails_controller=api_repositories rails_action=/user/repos rails_catalog_service=github/repos rails_request_queued_time=691 rails_request_time=5747" + ], + "X-Oauth-Scopes": [ + "repo" + ], + "X-Xss-Protection": [ + "0" + ] +}` + +// example primary rate-limited headers (paired with 403 status code) +var primaryRateLimitHeaders = `{ + "Access-Control-Allow-Origin": [ + "*" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Connection": [ + "keep-alive" + ], + "Content-Security-Policy": [ + "default-src 'none'" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Date": [ + "Thu, 28 Mar 2024 20:16:11 GMT" + ], + "Github-Authentication-Token-Expiration": [ + "2024-04-27 20:14:21 UTC" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Server": [ + "nginx/1.18.0 (Ubuntu)" + ], + "Vary": [ + "Accept, X-Requested-With" + ], + "X-Accepted-Oauth-Scopes": [ + "repo" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Github-Media-Type": [ + "github.v3" + ], + "X-Github-Request-Id": [ + "d283bbfe-d024-4334-9bd1-284ff860fe3e" + ], + "X-Glb-Log-Append": [ + "rails_request_category=api rails_method=get rails_controller=api_repositories rails_action=/user/repos rails_catalog_service=github/repos rails_request_queued_time=513 rails_request_time=13" + ], + "X-Oauth-Scopes": [ + "repo" + ], + "X-Ratelimit-Limit": [ + "100" + ], + "X-Ratelimit-Remaining": [ + "0" + ], + "X-Ratelimit-Reset": [ + "1711656978" + ], + "X-Ratelimit-Resource": [ + "core" + ], + "X-Ratelimit-Used": [ + "103" + ], + "X-Xss-Protection": [ + "0" + ] +}` + +// example secondary rate-limited headers (paired with 403 status code) +var secondaryRateLimitHeaders = `{ + "Access-Control-Allow-Origin": [ + "*" + ], + "Access-Control-Expose-Headers": [ + "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset" + ], + "Connection": [ + "keep-alive" + ], + "Content-Security-Policy": [ + "default-src 'none'; base-uri 'self'; child-src github.localhost/assets-cdn/worker/; connect-src 'self' http://alambic.github.localhost https://www.githubstatus.com http://collector.github.localhost ws://127.0.0.1:35729/livereload ws://github.localhost raw.github.localhost api.github.localhost https://github-cloud.s3.amazonaws.com https://github-development-repository-file-5c1aeb.s3.amazonaws.com https://github-development-upload-manifest-file-7fdce7.s3.amazonaws.com https://github-development-user-asset-6210df.s3.amazonaws.com http://localhost:2206 http://objects-staging-origin.githubusercontent.com; font-src 'self'; form-action 'self' github.localhost copilot-workspace.githubnext.com http://objects-staging-origin.githubusercontent.com; frame-ancestors 'none'; frame-src http://viewscreen.githubusercontent.localhost:9494 http://notebooks.githubusercontent.localhost:8888; img-src 'self' data: http://alambic.github.localhost http://github.localhost:8081 https://identicons.github.com http://alambic.github.localhost/avatars https://github-dev.s3.amazonaws.com https://objects-staging.githubusercontent.com http://localhost:7071 https://github-development-user-asset-6210df.s3.amazonaws.com https://customer-stories-feed.github.com https://spotlights-feed.github.com http://objects-staging-origin.githubusercontent.com; manifest-src 'self'; media-src http://github.localhost http://alambic.github.localhost https://github-development-user-asset-6210df.s3.amazonaws.com; script-src 'self'; style-src 'unsafe-inline' 'self'; worker-src github.localhost/assets-cdn/worker/" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Date": [ + "Thu, 28 Mar 2024 20:22:54 GMT" + ], + "Gh-Limited-By": [ + "time-based" + ], + "Gh-Limited-Group": [ + "api" + ], + "Referrer-Policy": [ + "origin-when-cross-origin, strict-origin-when-cross-origin" + ], + "Retry-After": [ + "60" + ], + "Server": [ + "nginx/1.18.0 (Ubuntu)" + ], + "Vary": [ + "Accept, X-Requested-With" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "X-Frame-Options": [ + "deny" + ], + "X-Github-Media-Type": [ + "github.v3; format=json" + ], + "X-Github-Request-Id": [ + "47dae098-2903-4a0a-835d-d7de10368f0f" + ], + "X-Glb-Log-Append": [ + "rails_request_category=api rails_method=get rails_controller=api_repositories rails_action=/user/repos rails_catalog_service=github/rest_api rails_request_queued_time=4 rails_request_time=12" + ], + "X-Xss-Protection": [ + "0" + ] +}` + +func TestParseRateLimitHappyPath(t *testing.T) { + resp, err := setupHeaderMap(happyPathTestHeaders, 200) + if err != nil { + t.Errorf("Failed to set up headers: %v", err) + } + + result, err := parseRateLimit(resp) + if err != nil { + t.Errorf("Expected no error, got %v", err) + } + if result != nil { + t.Errorf("Expected nil result, got %v", result) + } +} + +func TestParseRateLimitPrimaryRateLimit(t *testing.T) { + resp, err := setupHeaderMap(primaryRateLimitHeaders, 403) + if err != nil { + t.Errorf("Failed to set up headers: %v", err) + } + + result, err := parseRateLimit(resp) + if err != nil { + t.Errorf("Expected no error, got %v", err) + } + + // TODO(kfcampbell): fix tests to use fixed times, not current times (will fix negative time issue in tests) + if result == nil { + t.Errorf("Expected non-nil result, got %v", result) + } +} + +func TestParseRateLimitSecondaryRateLimit(t *testing.T) { + resp, err := setupHeaderMap(secondaryRateLimitHeaders, 403) + if err != nil { + t.Errorf("Failed to set up headers: %v", err) + } + + result, err := parseRateLimit(resp) + if err != nil { + t.Errorf("Expected no error, got %v", err) + } + + if *result != time.Minute { + t.Errorf("Expected one minute, got %v", result) + } +} + +func TestIsRateLimitedHappyPath(t *testing.T) { + resp, err := setupHeaderMap(happyPathTestHeaders, 200) + if err != nil { + t.Errorf("Failed to set up headers: %v", err) + } + + handler := NewRateLimitHandler() + + rateLimit := handler.options.IsRateLimited()(nil, resp) + if rateLimit != None { + t.Errorf("Expected no rate limit, got %v", rateLimit) + } +} + +func TestIsRateLimitedPrimaryRateLimit(t *testing.T) { + resp, err := setupHeaderMap(primaryRateLimitHeaders, 403) + if err != nil { + t.Errorf("Failed to set up headers: %v", err) + } + + handler := NewRateLimitHandler() + + rateLimit := handler.options.IsRateLimited()(nil, resp) + if rateLimit != Primary { + t.Errorf("Expected primary rate limit, got %v", rateLimit) + } +} + +func TestIsRateLimitedSecondaryRateLimit(t *testing.T) { + resp, err := setupHeaderMap(secondaryRateLimitHeaders, 403) + if err != nil { + t.Errorf("Failed to set up headers: %v", err) + } + + handler := NewRateLimitHandler() + + rateLimit := handler.options.IsRateLimited()(nil, resp) + if rateLimit != Secondary { + t.Errorf("Expected secondary rate limit, got %v", rateLimit) + } +} + +func TestParseRetryAfterBlankString(t *testing.T) { + retryAfterValue := "" + result, err := parseRetryAfter(retryAfterValue) + if err == nil { + t.Errorf("Expected error, got %v", result) + } +} + +func TestParseRetryAfterInvalidString(t *testing.T) { + retryAfterValue := "xxx_invalid_string_xxx" + result, err := parseRetryAfter(retryAfterValue) + if err == nil { + t.Errorf("Expected error, got %v", result) + } +} + +func TestParseXRateLimitResetInvalidString(t *testing.T) { + xRateLimitResetValue := "xxx_invalid_string_xxx" + result, err := parseXRateLimitReset(xRateLimitResetValue) + if err == nil { + t.Errorf("Expected error, got %v", result) + } +} + +func TestInterceptRateLimitHappyPath(t *testing.T) { + testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + _, _ = w.Write([]byte("test 200 response")) + w.WriteHeader(200) + })) + defer func() { testServer.Close() }() + + handler := NewRateLimitHandler() + req, err := http.NewRequest("GET", testServer.URL, nil) + if err != nil { + t.Errorf("Failed to create request: %v", err) + } + resp, err := handler.Intercept(newNoopPipeline(), 0, req) + if err != nil { + t.Errorf("Expected no error, got %v", err) + } + if resp.StatusCode != 200 { + t.Errorf("Expected status code 200, got %v", resp.StatusCode) + } +} + +func TestInterceptRateLimitPrimaryRateLimit(t *testing.T) { + initialRateLimit := sync.Once{} + // since it's a test, only sleep 5 seconds before returning the + // primary rate limit response in the interest of time + resetTime := time.Now().Add(5 * time.Second).Unix() + testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + initialRateLimit.Do(func() { + w.Header().Set(headers.XRateLimitRemainingKey, "0") + w.Header().Set(headers.XRateLimitResetKey, fmt.Sprintf("%d", resetTime)) + w.WriteHeader(403) + _, _ = w.Write([]byte("test primary rate limit 403 response")) + }) + + w.WriteHeader(200) + _, _ = w.Write([]byte("test primary rate limit 200 response")) + })) + defer func() { testServer.Close() }() + + handler := NewRateLimitHandler() + req, err := http.NewRequest("GET", testServer.URL, nil) + if err != nil { + t.Errorf("Failed to create request: %v", err) + } + resp, err := handler.Intercept(newNoopPipeline(), 0, req) + if err != nil { + t.Errorf("Expected no error, got %v", err) + } + if resp.StatusCode != 200 { + t.Errorf("Expected status code 200, got %v", resp.StatusCode) + } +} + +func TestInterceptRateLimitSecondaryRateLimit(t *testing.T) { + initialRateLimit := sync.Once{} + testServer := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + initialRateLimit.Do(func() { + // since it's a test, only sleep 5 seconds before returning the + // secondary rate limit response in the interest of time + w.Header().Set(headers.RetryAfterKey, "5") + w.WriteHeader(403) + _, _ = w.Write([]byte("test secondary rate limit 403 response")) + }) + + w.WriteHeader(200) + _, _ = w.Write([]byte("test secondary rate limit 200 response")) + })) + defer func() { testServer.Close() }() + + handler := NewRateLimitHandler() + req, err := http.NewRequest("GET", testServer.URL, nil) + if err != nil { + t.Errorf("Failed to create request: %v", err) + } + resp, err := handler.Intercept(newNoopPipeline(), 0, req) + if err != nil { + t.Errorf("Expected no error, got %v", err) + } + if resp.StatusCode != 200 { + t.Errorf("Expected status code 200, got %v", resp.StatusCode) + } +} + +// setupHeaderMap is a utility function that takes in a JSON string of headers and +// a status code and returns a hydrated http.Response object. +func setupHeaderMap(headers string, statusCode int) (*http.Response, error) { + headerMap := make(map[string][]string) + err := json.Unmarshal([]byte(headers), &headerMap) + if err != nil { + return nil, err + } + + resp := &http.Response{ + Header: make(http.Header), + StatusCode: statusCode, + } + + for key, values := range headerMap { + for _, value := range values { + resp.Header.Add(key, value) + } + } + + return resp, nil +} diff --git a/pkg/headers/header_contents.go b/pkg/headers/header_contents.go new file mode 100644 index 00000000..53d7f3de --- /dev/null +++ b/pkg/headers/header_contents.go @@ -0,0 +1,23 @@ +package headers + +const AuthorizationKey = "Authorization" +const AuthType = "bearer" +const UserAgentKey = "User-Agent" + +// TODO(kfcampbell): get the version and binary name from build settings rather than hard-coding +const UserAgentValue = "go-sdk@v0.0.0" + +const APIVersionKey = "X-GitHub-Api-Version" + +// TODO(kfcampbell): get the version from the generated code somehow +const APIVersionValue = "2022-11-28" + +// documentation on rate limit headers is available here: +// https://docs.github.com/en/rest/using-the-rest-api/rate-limits-for-the-rest-api?apiVersion=2022-11-28#checking-the-status-of-your-rate-limit +const XRateLimitRemainingKey = "X-Ratelimit-Remaining" +const XRateLimitResetKey = "X-Ratelimit-Reset" +const RetryAfterKey = "Retry-After" + +const XRateLimitLimitKey = "X-Ratelimit-Limit" +const XRateLimitUsedKey = "X-Ratelimit-Used" +const XRateLimitResourceKey = "X-Ratelimit-Resource" diff --git a/script/lint.sh b/script/lint.sh new file mode 100755 index 00000000..1bc77823 --- /dev/null +++ b/script/lint.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# GitHub Actions runs linting checks from .github/workflows/lint.yml. +# This script may be used to detect issues before pushing to a PR check. + +# note: check the version of golangci-lint used in .github/workflows/lint.yml to ensure accuracy +go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.55 + +golangci-lint run ./... From fe2090eeae6984643db45f0dfdb585089a504753 Mon Sep 17 00:00:00 2001 From: Octokit Bot Date: Thu, 19 Sep 2024 00:09:39 +0000 Subject: [PATCH 2/2] New updates to generated code --- pkg/github/kiota-lock.json | 2 +- .../orgs/item_item_with_enablement_item_request_builder.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/github/kiota-lock.json b/pkg/github/kiota-lock.json index 8b73fffc..14aa4c7a 100644 --- a/pkg/github/kiota-lock.json +++ b/pkg/github/kiota-lock.json @@ -1,5 +1,5 @@ { - "descriptionHash": "A7010F4C25A6E478ADD3F3A541C16766BDE5080E4F3A031B75213252E13A3558AAD25EFC6EC6902616F3066807192AEABEB3E53CDF7965AEC66D6FBD974BBF3C", + "descriptionHash": "12DF1E15BA73305937A12C26C9416358C3B6F5CC2F176595578F1623B747B8B9D28934FBF88839377445093B6979D4BD2FE825F52F224DFC224FADB019BE6F92", "descriptionLocation": "../../../../../schemas/ghes-3.14.json", "lockFileVersion": "1.0.0", "kiotaVersion": "1.18.0", diff --git a/pkg/github/orgs/item_item_with_enablement_item_request_builder.go b/pkg/github/orgs/item_item_with_enablement_item_request_builder.go index 27e93241..3bd40864 100644 --- a/pkg/github/orgs/item_item_with_enablement_item_request_builder.go +++ b/pkg/github/orgs/item_item_with_enablement_item_request_builder.go @@ -22,7 +22,7 @@ func NewItemItemWithEnablementItemRequestBuilder(rawUrl string, requestAdapter i urlParams["request-raw-url"] = rawUrl return NewItemItemWithEnablementItemRequestBuilderInternal(urlParams, requestAdapter) } -// Post > [!WARNING]> **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// Post > [!WARNING]> **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint. // Deprecated: // [API method documentation] // @@ -38,7 +38,7 @@ func (m *ItemItemWithEnablementItemRequestBuilder) Post(ctx context.Context, bod } return nil } -// ToPostRequestInformation > [!WARNING]> **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `write:org` scope to use this endpoint. +// ToPostRequestInformation > [!WARNING]> **Deprecation notice:** The ability to enable or disable a security feature for all eligible repositories in an organization is deprecated. Please use [code security configurations](https://docs.github.com/enterprise-server@3.14/rest/code-security/configurations) instead. For more information, see the [changelog](https://github.blog/changelog/2024-07-22-deprecation-of-api-endpoint-to-enable-or-disable-a-security-feature-for-an-organization/).Enables or disables the specified security feature for all eligible repositories in an organization. For more information, see "[Managing security managers in your organization](https://docs.github.com/enterprise-server@3.14/organizations/managing-peoples-access-to-your-organization-with-roles/managing-security-managers-in-your-organization)."The authenticated user must be an organization owner or be member of a team with the security manager role to use this endpoint.OAuth app tokens and personal access tokens (classic) need the `admin:org`, `write:org`, or `repo` scopes to use this endpoint. // Deprecated: // returns a *RequestInformation when successful func (m *ItemItemWithEnablementItemRequestBuilder) ToPostRequestInformation(ctx context.Context, body ItemItemItemWithEnablementPostRequestBodyable, requestConfiguration *i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestConfiguration[i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.DefaultQueryParameters])(*i2ae4187f7daee263371cb1c977df639813ab50ffa529013b7437480d1ec0158f.RequestInformation, error) {